From: Holger Schemel Date: Thu, 13 Aug 2015 13:39:04 +0000 (+0200) Subject: fixed drawing wrong masked global border when using envelope requests X-Git-Tag: 4.0.0.0-rc1~154 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=d0d2411a139b4ff6c5f9d2ba1df723ffbb0beeb8;p=rocksndiamonds.git fixed drawing wrong masked global border when using envelope requests --- diff --git a/src/tools.c b/src/tools.c index 0370b1d3..6597768d 100644 --- a/src/tools.c +++ b/src/tools.c @@ -2264,6 +2264,7 @@ static void setRequestPosition(int *x, int *y, boolean add_border_size) void DrawEnvelopeRequest(char *text) { + int last_game_status = game_status; /* save current game status */ char *text_final = text; char *text_door_style = NULL; int graphic = IMG_BACKGROUND_REQUEST; @@ -2324,10 +2325,15 @@ void DrawEnvelopeRequest(char *text) x, y, x_steps, y_steps, tile_size, tile_size); + /* force DOOR font inside door area */ + game_status = GAME_MODE_PSEUDO_DOOR; + DrawTextBuffer(sx + border_size, sy + border_size, 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 */ + for (i = 0; i < NUM_TOOL_BUTTONS; i++) RedrawGadget(tool_gadget[i]); @@ -2433,7 +2439,6 @@ void AnimateEnvelopeRequest(int anim_mode, int action) void ShowEnvelopeRequest(char *text, unsigned int req_state, int action) { - int last_game_status = game_status; /* save current game status */ int graphic = IMG_BACKGROUND_REQUEST; int sound_opening = SND_REQUEST_OPENING; int sound_closing = SND_REQUEST_CLOSING; @@ -2477,9 +2482,6 @@ void ShowEnvelopeRequest(char *text, unsigned int req_state, int action) InitAnimation(); } - /* force DOOR font inside door area */ - game_status = GAME_MODE_PSEUDO_DOOR; - game.envelope_active = TRUE; /* needed for RedrawPlayfield() events */ if (action == ACTION_OPENING) @@ -2504,8 +2506,6 @@ void ShowEnvelopeRequest(char *text, unsigned int req_state, int action) game.envelope_active = FALSE; - game_status = last_game_status; /* restore current game status */ - if (action == ACTION_CLOSING) { if (game_status != GAME_MODE_MAIN)