FadeSoundsAndMusic();
- if (CheckIfGlobalBorderHasChanged())
+ if (CheckIfGlobalBorderOrPlayfieldViewportHasChanged())
fade_mask = REDRAW_ALL;
FadeOut(fade_mask);
else
FadeSetEnterScreen();
- if (CheckIfGlobalBorderHasChanged())
+ if (CheckIfGlobalBorderOrPlayfieldViewportHasChanged())
fade_mask = REDRAW_ALL;
FadeLevelSoundsAndMusic();
if (redraw_mask & REDRAW_ALL)
fade_mask = REDRAW_ALL;
- if (CheckIfGlobalBorderHasChanged())
+ if (CheckIfGlobalBorderOrPlayfieldViewportHasChanged())
fade_mask = REDRAW_ALL;
FadeOut(fade_mask);
if (redraw_mask & REDRAW_ALL)
fade_mask = REDRAW_ALL;
- if (CheckIfGlobalBorderHasChanged())
+ if (CheckIfGlobalBorderOrPlayfieldViewportHasChanged())
fade_mask = REDRAW_ALL;
UnmapAllGadgets();
{
int fade_mask = REDRAW_FIELD;
- if (CheckIfGlobalBorderHasChanged())
+ if (CheckIfGlobalBorderOrPlayfieldViewportHasChanged())
fade_mask = REDRAW_ALL;
if (strEqual((*ti_ptr)->subdir, STRING_TOP_DIRECTORY))
{
int fade_mask = REDRAW_FIELD;
- if (CheckIfGlobalBorderHasChanged())
+ if (CheckIfGlobalBorderOrPlayfieldViewportHasChanged())
fade_mask = REDRAW_ALL;
UnmapAllGadgets();
char *title_string = NULL;
int i;
- if (CheckIfGlobalBorderHasChanged())
+ if (CheckIfGlobalBorderOrPlayfieldViewportHasChanged())
fade_mask = REDRAW_ALL;
UnmapAllGadgets();
SetFontStatus(-1);
}
+boolean CheckIfPlayfieldViewportHasChanged()
+{
+ // if game status has not changed, playfield viewport has not changed either
+ if (game_status == game_status_last)
+ return FALSE;
+
+ // check if playfield viewport has changed with current game status
+ struct RectWithBorder *vp_playfield = &viewport.playfield[game_status];
+ int new_real_sx = vp_playfield->x;
+ int new_real_sy = vp_playfield->y;
+ int new_full_sxsize = vp_playfield->width;
+ int new_full_sysize = vp_playfield->height;
+
+ return (new_real_sx != REAL_SX ||
+ new_real_sy != REAL_SY ||
+ new_full_sxsize != FULL_SXSIZE ||
+ new_full_sysize != FULL_SYSIZE);
+}
+
+boolean CheckIfGlobalBorderOrPlayfieldViewportHasChanged()
+{
+ return (CheckIfGlobalBorderHasChanged() ||
+ CheckIfPlayfieldViewportHasChanged());
+}
+
void ChangeViewportPropertiesIfNeeded()
{
boolean use_mini_tilesize = (level.game_engine_type == GAME_ENGINE_TYPE_MM ?
void ToggleFullscreenOrChangeWindowScalingIfNeeded();
void ChangeViewportPropertiesIfNeeded();
+boolean CheckIfPlayfieldViewportHasChanged();
+boolean CheckIfGlobalBorderOrPlayfieldViewportHasChanged();
+
#endif /* TOOLS_H */