X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fscreens.c;h=576f1ff0566a054f1dd9d4fc2df1345cde67da33;hb=e7c8e578d45fe076e6bf40042202971d83e73104;hp=ee5035ce0320569f35a9fb27e510a0123da9636d;hpb=6ca233d4d71331460af0443bf5b307f16c6fe069;p=rocksndiamonds.git diff --git a/src/screens.c b/src/screens.c index ee5035ce..576f1ff0 100644 --- a/src/screens.c +++ b/src/screens.c @@ -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));