X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=4a5243602014051440e8ae14fca474bce98b5c9e;hb=cbab48e3ea7c2821978dccb4f299e81e9c567050;hp=6a1306e45e903f9238a6526b4a6a86f68bcc1ce2;hpb=8ae535c1c76e1c33572afbcd4b2d3d9c3d7ba63e;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index 6a1306e4..4a524360 100644 --- a/src/tools.c +++ b/src/tools.c @@ -643,10 +643,14 @@ void FadeIn(int fade_mask) FADE_SY = REAL_SY; FADE_SXSIZE = FULL_SXSIZE; FADE_SYSIZE = FULL_SYSIZE; + + global.anim_status = global.anim_status_next; } void FadeOut(int fade_mask) { + global.anim_status = GAME_MODE_PSEUDO_FADING; + #if 0 DrawMaskedBorder(REDRAW_ALL); #endif @@ -2382,13 +2386,13 @@ void DrawEnvelopeRequest(char *text) 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]); @@ -2793,7 +2797,7 @@ static void DrawPreviewLevelExt(boolean restart) 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; } @@ -2895,7 +2899,7 @@ static void DrawPreviewLevelExt(boolean restart) DrawPreviewLevelLabelExt(label_state); } - game_status = last_game_status; /* restore current game status */ + SetGameStatus(last_game_status); /* restore current game status */ } void DrawPreviewLevelInitial() @@ -3680,7 +3684,7 @@ static boolean RequestDoor(char *text, unsigned int req_state) 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++) @@ -3720,7 +3724,7 @@ static boolean RequestDoor(char *text, unsigned int req_state) // 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) { @@ -8178,6 +8182,13 @@ void JoinRectangles(int *x, int *y, int *width, int *height, *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; @@ -8233,6 +8244,7 @@ void ChangeViewportPropertiesIfNeeded() init_video_buffer = TRUE; init_gfx_buffers = TRUE; + init_gadgets_and_toons = TRUE; // printf("::: video: init_video_buffer, init_gfx_buffers\n"); } @@ -8383,6 +8395,7 @@ void ChangeViewportPropertiesIfNeeded() InitGadgets(); InitToons(); + InitGlobalAnimations(); } if (init_em_graphics)