+ /* virtual buttons setup */
+ setup.touch.grid_initialized = TRUE;
+ for (i = 0; i < 2; i++)
+ {
+ int grid_xsize = setup.touch.grid_xsize[i];
+ int grid_ysize = setup.touch.grid_ysize[i];
+ int x, y;
+
+ // if virtual buttons are not loaded from setup file, repeat initializing
+ // virtual buttons grid with default values later when video is initialized
+ if (grid_xsize == -1 ||
+ grid_ysize == -1)
+ {
+ setup.touch.grid_initialized = FALSE;
+
+ continue;
+ }
+
+ for (y = 0; y < grid_ysize; y++)
+ {
+ char token_string[MAX_LINE_LEN];
+
+ sprintf(token_string, "touch.virtual_buttons.%d.%02d", i, y);
+
+ char *value_string = getHashEntry(setup_file_hash, token_string);
+
+ if (value_string == NULL)
+ continue;
+
+ for (x = 0; x < grid_xsize; x++)
+ {
+ char c = value_string[x];
+
+ setup.touch.grid_button[i][x][y] =
+ (c == '.' ? CHAR_GRID_BUTTON_NONE : c);
+ }
+ }
+ }
+