X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fscreens.c;h=576f1ff0566a054f1dd9d4fc2df1345cde67da33;hb=5af7a60ac60b406852cfa7c445a60e3573124944;hp=98cb6ba9b8a72aa5ed469572a37d2de442c3ea15;hpb=253688c723334738297ec82a5256c76ed55efe5e;p=rocksndiamonds.git diff --git a/src/screens.c b/src/screens.c index 98cb6ba9..576f1ff0 100644 --- a/src/screens.c +++ b/src/screens.c @@ -4816,8 +4816,8 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, // directly continue when touching the screen after playing if ((mx || my) && scores.continue_on_return) { + // ignore touch events until released mx = my = 0; - button = MB_MENU_CHOICE; } #endif @@ -7394,7 +7394,7 @@ static struct TokenInfo setup_info_editor[] = static struct TokenInfo setup_info_graphics[] = { -#if !defined(PLATFORM_ANDROID) +#if !defined(PLATFORM_ANDROID) && !defined(PLATFORM_EMSCRIPTEN) { TYPE_SWITCH, &setup.fullscreen, "Fullscreen:" }, { TYPE_ENTER_LIST, execSetupChooseWindowSize, "Window Scaling:" }, { TYPE_STRING, &window_size_text, "" }, @@ -7407,8 +7407,10 @@ static struct TokenInfo setup_info_graphics[] = { TYPE_ENTER_LIST, execSetupChooseScrollDelay, "Scroll Delay:" }, { TYPE_STRING, &scroll_delay_text, "" }, #endif +#if !defined(PLATFORM_EMSCRIPTEN) { TYPE_ENTER_LIST, execSetupChooseVsyncMode, "Vertical Sync (VSync):" }, { TYPE_STRING, &vsync_mode_text, "" }, +#endif { TYPE_SWITCH, &setup.fade_screens, "Fade Screens:" }, { TYPE_SWITCH, &setup.quick_switch, "Quick Player Focus Switch:" }, { TYPE_SWITCH, &setup.quick_doors, "Quick Menu Doors:" }, @@ -8454,8 +8456,13 @@ static boolean CustomizeKeyboardMain(int player_nr) while (!finished) { Event event; + unsigned int event_frame_delay = 0; + unsigned int event_frame_delay_value = GAME_FRAME_DELAY; - if (NextValidEvent(&event)) + // reset frame delay counter directly after updating screen + ResetDelayCounter(&event_frame_delay); + + while (NextValidEvent(&event)) { switch (event.type) { @@ -8526,6 +8533,10 @@ static boolean CustomizeKeyboardMain(int player_nr) HandleOtherEvents(&event); break; } + + // do not handle events for longer than standard frame delay period + if (DelayReached(&event_frame_delay, event_frame_delay_value)) + break; } BackToFront(); @@ -8628,11 +8639,6 @@ static boolean ConfigureJoystickMapButtonsAndAxes(SDL_Joystick *joystick) { 282, 210, MARKER_AXIS_Y, "righty", }, }; - unsigned int event_frame_delay = 0; - unsigned int event_frame_delay_value = GAME_FRAME_DELAY; - - ResetDelayCounter(&event_frame_delay); - if (!bitmaps_initialized) { controller = LoadCustomImage("joystick/controller.png"); @@ -8764,6 +8770,12 @@ static boolean ConfigureJoystickMapButtonsAndAxes(SDL_Joystick *joystick) screen_initialized = TRUE; + unsigned int event_frame_delay = 0; + unsigned int event_frame_delay_value = GAME_FRAME_DELAY; + + // reset frame delay counter directly after updating screen + ResetDelayCounter(&event_frame_delay); + while (NextValidEvent(&event)) { switch (event.type) @@ -9743,6 +9755,10 @@ static void CreateScreenMenubuttons(void) int type = GD_TYPE_NORMAL_BUTTON; boolean checked = FALSE; + // do not use touch buttons if overlay touch buttons are disabled + if (is_touch_button && !setup.touch.overlay_buttons) + continue; + event_mask = menubutton_info[i].event_mask; x = (is_touch_button ? pos->x : mSX + GDI_ACTIVE_POS(pos->x));