void HandleFingerEvent_VirtualButtons(FingerEvent *event)
{
+#if 1
+ int x = event->x * overlay.grid_xsize;
+ int y = event->y * overlay.grid_ysize;
+ int grid_button = overlay.grid_button[x][y];
+ Key key = (grid_button == CHAR_GRID_BUTTON_LEFT ? setup.input[0].key.left :
+ grid_button == CHAR_GRID_BUTTON_RIGHT ? setup.input[0].key.right :
+ grid_button == CHAR_GRID_BUTTON_UP ? setup.input[0].key.up :
+ grid_button == CHAR_GRID_BUTTON_DOWN ? setup.input[0].key.down :
+ grid_button == CHAR_GRID_BUTTON_SNAP ? setup.input[0].key.snap :
+ grid_button == CHAR_GRID_BUTTON_DROP ? setup.input[0].key.drop :
+ KSYM_UNDEFINED);
+#else
float ypos = 1.0 - 1.0 / 3.0 * video.display_width / video.display_height;
float event_x = (event->x);
float event_y = (event->y - ypos) / (1 - ypos);
event_y > 2.0 / 3.0 && event_y < 1 ?
setup.input[0].key.down :
KSYM_UNDEFINED);
+#endif
int key_status = (event->type == EVENT_FINGERRELEASE ? KEY_RELEASED :
KEY_PRESSED);
char *key_status_name = (key_status == KEY_RELEASED ? "KEY_RELEASED" :
static boolean initialized = FALSE;
static boolean deactivated = TRUE;
static boolean show_grid = FALSE;
- static boolean show_grid_buttons = FALSE;
static int width = 0, height = 0;
static int alpha_max = SDL_ALPHA_OPAQUE / 2;
static int alpha_step = 5;
else if (deactivated)
show_grid = FALSE;
- if (overlay.show_grid_buttons)
- show_grid_buttons = TRUE;
- else if (deactivated)
- show_grid_buttons = FALSE;
-
if (show_grid)
DrawTouchInputOverlay_ShowGrid(alpha);
- if (show_grid_buttons)
- DrawTouchInputOverlay_ShowGridButtons(alpha);
+ DrawTouchInputOverlay_ShowGridButtons(alpha);
- if (show_grid || show_grid_buttons)
- return;
+ return;
+
+
+ // !!! VIRTUAL BUTTONS FROM IMAGE FILE NOT USED ANYMORE !!!
if (!initialized)
{
overlay.active = FALSE;
overlay.show_grid = FALSE;
- overlay.show_grid_buttons = FALSE;
for (i = 0; i < 2; i++)
{
void SetOverlayShowGrid(boolean show_grid)
{
overlay.show_grid = show_grid;
- overlay.show_grid_buttons = show_grid;
SetOverlayActive(show_grid);
boolean active; /* overlay activated (depending on game mode) */
boolean show_grid;
- boolean show_grid_buttons;
int grid_xsize_all[2];
int grid_ysize_all[2];