}
redraw_mask = REDRAW_NONE;
+
+ // force screen redraw in every frame to continue drawing global animations
+ redraw_mask = REDRAW_ALL;
}
static void FadeCrossSaveBackbuffer()
redraw_mask &= ~fade_mask;
}
+static void SetAnimStatus_BeforeFadingOut()
+{
+ global.anim_status = GAME_MODE_PSEUDO_FADING;
+}
+
+static void SetAnimStatus_AfterFadingIn()
+{
+ global.anim_status = global.anim_status_next;
+
+ // force update of global animation status in case of rapid screen changes
+ redraw_mask = REDRAW_ALL;
+ BackToFront();
+}
+
void FadeIn(int fade_mask)
{
#if 1
FADE_SY = REAL_SY;
FADE_SXSIZE = FULL_SXSIZE;
FADE_SYSIZE = FULL_SYSIZE;
+
+ SetAnimStatus_AfterFadingIn();
}
void FadeOut(int fade_mask)
{
+ SetAnimStatus_BeforeFadingOut();
+
#if 0
DrawMaskedBorder(REDRAW_ALL);
#endif
tile_size, tile_size);
/* force DOOR font inside door area */
- game_status = GAME_MODE_PSEUDO_DOOR;
+ SetGameStatus(GAME_MODE_PSEUDO_DOOR);
DrawTextBuffer(sx + sx_offset, sy + sy_offset, text_final, font_nr,
line_length, -1, max_lines, line_spacing, mask_mode,
request.autowrap, request.centered, FALSE);
- game_status = last_game_status; /* restore current game status */
+ SetGameStatus(last_game_status); /* restore current game status */
for (i = 0; i < NUM_TOOL_BUTTONS; i++)
RedrawGadget(tool_gadget[i]);
DrawTextSAligned(pos->x, pos->y, label_text, font_nr, pos->align);
}
- game_status = last_game_status; /* restore current game status */
+ SetGameStatus(last_game_status); /* restore current game status */
return;
}
DrawPreviewLevelLabelExt(label_state);
}
- game_status = last_game_status; /* restore current game status */
+ SetGameStatus(last_game_status); /* restore current game status */
}
void DrawPreviewLevelInitial()
DrawBackground(DX, DY, DXSIZE, DYSIZE);
/* force DOOR font inside door area */
- game_status = GAME_MODE_PSEUDO_DOOR;
+ SetGameStatus(GAME_MODE_PSEUDO_DOOR);
/* write text for request */
for (text_ptr = text, ty = 0; ty < MAX_REQUEST_LINES; ty++)
// text_ptr += tl + (tc == ' ' || tc == '?' || tc == '!' ? 1 : 0);
}
- game_status = last_game_status; /* restore current game status */
+ SetGameStatus(last_game_status); /* restore current game status */
if (req_state & REQ_ASK)
{
*height = MAX(*height, height2);
}
+void SetGameStatus(int game_status_new)
+{
+ game_status = game_status_new;
+
+ global.anim_status_next = game_status;
+}
+
void ChangeViewportPropertiesIfNeeded()
{
int gfx_game_mode = game_status;