X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=8954a19dc9ac9d33371ea95e06485e51c97a699d;hb=2486a7a849210371bb59e733e37b0271a4332d8b;hp=ac20e3c144e5b3567019de53c3ad60344ab517c5;hpb=520b554dfeb3a72b6b3af91903642b158169407c;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index ac20e3c1..8954a19d 100644 --- a/src/tools.c +++ b/src/tools.c @@ -437,6 +437,8 @@ void BlitScreenToBitmap(Bitmap *target_bitmap) { DrawBuffer *buffer = (drawto_field == window ? backbuffer : drawto_field); int fx = FX, fy = FY; + int full_lev_fieldx = lev_fieldx + (BorderElement != EL_EMPTY ? 2 : 0); + int full_lev_fieldy = lev_fieldy + (BorderElement != EL_EMPTY ? 2 : 0); #if NEW_TILESIZE int dx = (ScreenMovDir & (MV_LEFT | MV_RIGHT) ? ScreenGfxPos : 0); @@ -487,6 +489,28 @@ void BlitScreenToBitmap(Bitmap *target_bitmap) fx, fy); #endif +#if 1 + if (full_lev_fieldx <= SCR_FIELDX) + { + // printf(":1: PLAYFIELD FITS TO SCREEN [%d, %d, %d]\n", fx, ffx, dx_var); + + if (EVEN(SCR_FIELDX)) + fx = 2 * TILEX_VAR - (ODD(lev_fieldx) ? TILEX_VAR / 2 : 0); + else + fx = 2 * TILEX_VAR - (EVEN(lev_fieldx) ? TILEX_VAR / 2 : 0); + + // printf(":2: PLAYFIELD FITS TO SCREEN [%d, %d, %d]\n", fx, ffx, dx_var); + } + + if (full_lev_fieldy <= SCR_FIELDY) + { + if (EVEN(SCR_FIELDY)) + fy = 2 * TILEY_VAR - (ODD(lev_fieldy) ? TILEY_VAR / 2 : 0); + else + fy = 2 * TILEY_VAR - (EVEN(lev_fieldy) ? TILEY_VAR / 2 : 0); + } +#endif + if (border.draw_masked[GAME_MODE_PLAYING]) { if (buffer != backbuffer) @@ -2993,6 +3017,7 @@ void AnimateEnvelopeRequest(int anim_mode, int action) redraw_mask = REDRAW_FIELD | REDRAW_FROM_BACKBUFFER; // redraw_mask |= REDRAW_ALL | REDRAW_FROM_BACKBUFFER; #else + /* CHECK AGAIN (previous code reactivated) */ redraw_mask |= REDRAW_FIELD | REDRAW_FROM_BACKBUFFER; #endif @@ -3334,6 +3359,11 @@ void ShowEnvelopeRequest(char *text, unsigned int req_state, int action) #if 1 // game_status = last_game_status; /* restore current game status */ +#if 1 + /* !!! CHECK AGAIN (SEE BELOW) !!! */ + game_status = last_game_status; /* restore current game status */ +#endif + if (action == ACTION_CLOSING) { if (game_status != GAME_MODE_MAIN) @@ -3347,10 +3377,11 @@ void ShowEnvelopeRequest(char *text, unsigned int req_state, int action) // SetDrawBackgroundMask(last_draw_background_mask); -#if 1 +#if 0 redraw_mask = REDRAW_FIELD; // redraw_mask |= REDRAW_ALL; #else + /* CHECK AGAIN (previous code reactivated) */ redraw_mask |= REDRAW_FIELD; #endif @@ -3360,8 +3391,10 @@ void ShowEnvelopeRequest(char *text, unsigned int req_state, int action) BackToFront(); +#if 0 /* (important: after "BackToFront()", but before "SetDrawtoField()") */ game_status = last_game_status; /* restore current game status */ +#endif #if 1 if (action == ACTION_CLOSING &&