X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=76122ed945fb2638caec5d3fe03a1414ffeda4dd;hb=0f953325f06ce1e21439fd90fd1d73d8ee515095;hp=604e767cc4a8a3744fbd340a7d5360876434d02f;hpb=7e13f3525bddd2926dae88aa7b547749d9436bf4;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index 604e767c..76122ed9 100644 --- a/src/tools.c +++ b/src/tools.c @@ -3339,8 +3339,6 @@ static void ShowEnvelopeRequest(char *text, unsigned int req_state, int action) if (action == ACTION_OPENING) { - DrawEnvelopeRequest(text, req_state); - PlayMenuSoundStereo(sound_opening, SOUND_MIDDLE); if (anim_mode == ANIM_DEFAULT) @@ -4793,7 +4791,7 @@ static int RequestHandleEvents(unsigned int req_state, int draw_buffer_game) return result; } -static void DoRequestBefore(unsigned int req_state) +static void DoRequestBefore(void) { if (game_status == GAME_MODE_PLAYING) BlitScreenToBitmap(backbuffer); @@ -4807,8 +4805,7 @@ static void DoRequestBefore(unsigned int req_state) // pause network game while waiting for request to answer if (network.enabled && game_status == GAME_MODE_PLAYING && - !game.all_players_gone && - req_state & REQUEST_WAIT_FOR_INPUT) + !game.all_players_gone) SendToServer_PausePlaying(); // simulate releasing mouse button over last gadget, if still pressed @@ -4818,7 +4815,7 @@ static void DoRequestBefore(unsigned int req_state) UnmapAllGadgets(); } -static void DoRequestAfter(unsigned int req_state) +static void DoRequestAfter(void) { RemapAllGadgets(); @@ -4835,8 +4832,7 @@ static void DoRequestAfter(unsigned int req_state) // continue network game after request if (network.enabled && game_status == GAME_MODE_PLAYING && - !game.all_players_gone && - req_state & REQUEST_WAIT_FOR_INPUT) + !game.all_players_gone) SendToServer_ContinuePlaying(); // restore deactivated drawing when quick-loading level tape recording @@ -4860,7 +4856,7 @@ static boolean RequestDoor(char *text, unsigned int req_state) font_nr = FONT_TEXT_1; } - DoRequestBefore(req_state); + DoRequestBefore(); // draw released gadget before proceeding // BackToFront(); @@ -4930,21 +4926,6 @@ static boolean RequestDoor(char *text, unsigned int req_state) OpenDoor(DOOR_OPEN_1); - if (!(req_state & REQUEST_WAIT_FOR_INPUT)) - { - if (game_status == GAME_MODE_PLAYING) - { - SetPanelBackground(); - SetDrawBackgroundMask(REDRAW_DOOR_1); - } - else - { - SetDrawBackgroundMask(REDRAW_FIELD); - } - - return FALSE; - } - SetDrawBackgroundMask(REDRAW_FIELD | REDRAW_DOOR_1); // ---------- handle request buttons ---------- @@ -4961,7 +4942,7 @@ static boolean RequestDoor(char *text, unsigned int req_state) OpenDoor(DOOR_OPEN_1 | DOOR_COPY_BACK); } - DoRequestAfter(req_state); + DoRequestAfter(); return result; } @@ -4971,32 +4952,11 @@ static boolean RequestEnvelope(char *text, unsigned int req_state) int draw_buffer_last = GetDrawtoField(); int result; - DoRequestBefore(req_state); - - // (replace with setting corresponding request background) - // SetDoorBackgroundImage(IMG_BACKGROUND_DOOR); - // SetDrawBackgroundMask(REDRAW_FIELD | REDRAW_DOOR_1); - - // clear door drawing field - // DrawBackground(DX, DY, DXSIZE, DYSIZE); + DoRequestBefore(); + DrawEnvelopeRequest(text, req_state); ShowEnvelopeRequest(text, req_state, ACTION_OPENING); - if (!(req_state & REQUEST_WAIT_FOR_INPUT)) - { - if (game_status == GAME_MODE_PLAYING) - { - SetPanelBackground(); - SetDrawBackgroundMask(REDRAW_DOOR_1); - } - else - { - SetDrawBackgroundMask(REDRAW_FIELD); - } - - return FALSE; - } - SetDrawBackgroundMask(REDRAW_FIELD | REDRAW_DOOR_1); // ---------- handle request buttons ---------- @@ -5006,7 +4966,7 @@ static boolean RequestEnvelope(char *text, unsigned int req_state) ShowEnvelopeRequest(text, req_state, ACTION_CLOSING); - DoRequestAfter(req_state); + DoRequestAfter(); return result; }