X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fscreens.c;h=f49f895904f61fe99b3c89995f2769d31eb7548c;hb=bfae6eed033adc10e9f816182dd7812ae9cb3a0a;hp=3dd571fe857cb912493d9dc0105a0a559103d2fe;hpb=6cf6b75d5b9c84476a121cfd2ff11a0351ecba47;p=rocksndiamonds.git diff --git a/src/screens.c b/src/screens.c index 3dd571fe..f49f8959 100644 --- a/src/screens.c +++ b/src/screens.c @@ -7351,6 +7351,31 @@ boolean ConfigureVirtualButtonsMain() } break; +#if defined(TARGET_SDL2) + case SDL_WINDOWEVENT: + HandleWindowEvent((WindowEvent *) &event); + + // check if device has been rotated + if (nr != GRID_ACTIVE_NR()) + { + nr = GRID_ACTIVE_NR(); + + for (x = 0; x < MAX_GRID_XSIZE; x++) + for (y = 0; y < MAX_GRID_YSIZE; y++) + grid_button_old[x][y] = grid_button_tmp[x][y] = + overlay.grid_button[x][y]; + } + + break; + + case SDL_APP_WILLENTERBACKGROUND: + case SDL_APP_DIDENTERBACKGROUND: + case SDL_APP_WILLENTERFOREGROUND: + case SDL_APP_DIDENTERFOREGROUND: + HandlePauseResumeEvent((PauseResumeEvent *) &event); + break; +#endif + default: HandleOtherEvents(&event); break; @@ -7372,7 +7397,7 @@ boolean ConfigureVirtualButtonsMain() for (x = 0; x < MAX_GRID_XSIZE; x++) for (y = 0; y < MAX_GRID_YSIZE; y++) - overlay.grid_button_all[nr][x][y] = overlay.grid_button[x][y]; + setup.touch.grid_button[nr][x][y] = overlay.grid_button[x][y]; overlay.grid_button_highlight = CHAR_GRID_BUTTON_NONE;