X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=324bd45bf150f22d8964a81506922b8724d88410;hb=2722043bbea282f3e74e6617cbc75e4df928fb3c;hp=1ea116bab181f892eb1280285b3203743873a9c7;hpb=d870b82d2c53def1ed6da9fdc46ce6bf3dd1bfae;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index 1ea116ba..324bd45b 100644 --- a/src/tools.c +++ b/src/tools.c @@ -622,11 +622,24 @@ void DrawFramesPerSecond() char text[100]; int font_nr = FONT_TEXT_2; int font_width = getFontWidth(font_nr); + int draw_deactivation_mask = GetDrawDeactivationMask(); + boolean draw_masked = (draw_deactivation_mask == REDRAW_NONE); - sprintf(text, "%04.1f fps", global.frames_per_second); + /* draw FPS with leading space (needed if field buffer deactivated) */ + sprintf(text, " %04.1f fps", global.frames_per_second); - DrawTextExt(backbuffer, WIN_XSIZE - font_width * strlen(text), 0, text, - font_nr, BLIT_OPAQUE); + /* override draw deactivation mask (required for invisible warp mode) */ + SetDrawDeactivationMask(REDRAW_NONE); + + /* draw opaque FPS if field buffer deactivated, else draw masked FPS */ + DrawTextExt(backbuffer, SX + SXSIZE - font_width * strlen(text), SY, text, + font_nr, (draw_masked ? BLIT_MASKED : BLIT_OPAQUE)); + + /* set draw deactivation mask to previous value */ + SetDrawDeactivationMask(draw_deactivation_mask); + + /* force full-screen redraw in this frame */ + redraw_mask = REDRAW_ALL; } #if DEBUG_FRAME_TIME @@ -3759,6 +3772,10 @@ void WaitForEventToContinue() { case EVENT_BUTTONPRESS: case EVENT_KEYPRESS: +#if defined(TARGET_SDL2) + case SDL_CONTROLLERBUTTONDOWN: +#endif + case SDL_JOYBUTTONDOWN: still_wait = FALSE; break; @@ -8366,8 +8383,15 @@ void CheckSingleStepMode_EM(byte action[MAX_PLAYERS], int frame, void CheckSingleStepMode_SP(boolean murphy_is_waiting, boolean murphy_is_dropping) { + boolean murphy_starts_dropping = FALSE; + int i; + + for (i = 0; i < MAX_PLAYERS; i++) + if (stored_player[i].force_dropping) + murphy_starts_dropping = TRUE; + if (tape.single_step && tape.recording && !tape.pausing) - if (murphy_is_waiting) + if (murphy_is_waiting && !murphy_starts_dropping) TapeTogglePause(TAPE_TOGGLE_AUTOMATIC); CheckSaveEngineSnapshot_SP(murphy_is_waiting, murphy_is_dropping);