X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Ftools.c;h=099fd59de0c007460883d811c59d2997624745d1;hp=57dbfe794b0b53078c3445ea832b54fb365ff290;hb=b2c4f6e649f55c838726a81ac0cc913db1e55536;hpb=7e204c3c0d1c73b526ec1a61cdc43c105915cb37 diff --git a/src/tools.c b/src/tools.c index 57dbfe79..099fd59d 100644 --- a/src/tools.c +++ b/src/tools.c @@ -391,6 +391,16 @@ int getLevelFromScreenY(int y) return getLevelFromScreenY_RND(y); } +int getScreenFieldSizeX(void) +{ + return (tape.playing ? tape.scr_fieldx : SCR_FIELDX); +} + +int getScreenFieldSizeY(void) +{ + return (tape.playing ? tape.scr_fieldy : SCR_FIELDY); +} + void DumpTile(int x, int y) { int sx = SCREENX(x); @@ -2844,6 +2854,19 @@ static void PrepareEnvelopeRequestToScreen(Bitmap *bitmap, int sx, int sy, request.ysize = ysize; } +void DrawEnvelopeRequestToScreen(int drawing_target, int drawing_stage) +{ + if (global.use_envelope_request && + game.request_active_or_moving && + request.sort_priority > 0 && + drawing_target == DRAW_TO_SCREEN && + drawing_stage == DRAW_GLOBAL_ANIM_STAGE_2) + { + BlitToScreen(request.bitmap, 0, 0, request.xsize, request.ysize, + request.sx, request.sy); + } +} + static void setRequestBasePosition(int *x, int *y) { int sx_base, sy_base; @@ -4251,7 +4274,7 @@ void WaitForEventToContinue(void) #define MAX_REQUEST_LINE_FONT1_LEN 7 #define MAX_REQUEST_LINE_FONT2_LEN 10 -static int RequestHandleEvents(unsigned int req_state) +static int RequestHandleEvents(unsigned int req_state, int draw_buffer_game) { boolean game_just_ended = (game_status == GAME_MODE_PLAYING && checkGameEnded()); @@ -4280,7 +4303,7 @@ static int RequestHandleEvents(unsigned int req_state) if (game_just_ended) { - SetDrawtoField(draw_buffer_last); + SetDrawtoField(draw_buffer_game); HandleGameActions(); @@ -4581,6 +4604,7 @@ static int RequestHandleEvents(unsigned int req_state) static boolean RequestDoor(char *text, unsigned int req_state) { + int draw_buffer_last = GetDrawtoField(); unsigned int old_door_state; int max_request_line_len = MAX_REQUEST_LINE_FONT1_LEN; int font_nr = FONT_TEXT_2; @@ -4722,7 +4746,7 @@ static boolean RequestDoor(char *text, unsigned int req_state) SetDrawBackgroundMask(REDRAW_FIELD | REDRAW_DOOR_1); // ---------- handle request buttons ---------- - result = RequestHandleEvents(req_state); + result = RequestHandleEvents(req_state, draw_buffer_last); UnmapToolButtons(); @@ -4763,6 +4787,7 @@ static boolean RequestDoor(char *text, unsigned int req_state) static boolean RequestEnvelope(char *text, unsigned int req_state) { + int draw_buffer_last = GetDrawtoField(); int result; if (game_status == GAME_MODE_PLAYING) @@ -4814,7 +4839,7 @@ static boolean RequestEnvelope(char *text, unsigned int req_state) SetDrawBackgroundMask(REDRAW_FIELD | REDRAW_DOOR_1); // ---------- handle request buttons ---------- - result = RequestHandleEvents(req_state); + result = RequestHandleEvents(req_state, draw_buffer_last); UnmapToolButtons();