X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2FDDScrollBuffer.c;h=f580d3991dc1e5273f32eb49bfb3f99b406b6a60;hb=7f40f3e4e3ae0818a91083952fd1710841735152;hp=026b80dd81c675681154a8f98cada0de810116e2;hpb=49e5cc70747062c45172e6106b8bec41d2e859ad;p=rocksndiamonds.git diff --git a/src/game_sp/DDScrollBuffer.c b/src/game_sp/DDScrollBuffer.c index 026b80dd..f580d399 100644 --- a/src/game_sp/DDScrollBuffer.c +++ b/src/game_sp/DDScrollBuffer.c @@ -168,6 +168,17 @@ void UpdatePlayfield(boolean force_redraw) int num_redrawn = 0; #endif + if (force_redraw) + { + // force re-initialization of graphics status variables + for (y = DisplayMinY; y <= DisplayMaxY; y++) + for (x = DisplayMinX; x <= DisplayMaxX; x++) + GfxGraphic[x][y] = -1; + + // force complete playfield redraw + DisplayLevel(); + } + for (y = DisplayMinY; y <= DisplayMaxY; y++) { for (x = DisplayMinX; x <= DisplayMaxX; x++) @@ -233,16 +244,14 @@ void BlitScreenToBitmap_SP(Bitmap *target_bitmap) int px = getFieldbufferOffsetX_SP(); int py = getFieldbufferOffsetY_SP(); - int sx, sy, sxsize, sysize; int xsize = SXSIZE; int ysize = SYSIZE; int full_xsize = (FieldWidth - (menBorder ? 0 : 1)) * TILEX_VAR; int full_ysize = (FieldHeight - (menBorder ? 0 : 1)) * TILEY_VAR; - - sxsize = (full_xsize < xsize ? full_xsize : xsize); - sysize = (full_ysize < ysize ? full_ysize : ysize); - sx = SX + (full_xsize < xsize ? (xsize - full_xsize) / 2 : 0); - sy = SY + (full_ysize < ysize ? (ysize - full_ysize) / 2 : 0); + int sx = SX + (full_xsize < xsize ? (xsize - full_xsize) / 2 : 0); + int sy = SY + (full_ysize < ysize ? (ysize - full_ysize) / 2 : 0); + int sxsize = (full_xsize < xsize ? full_xsize : xsize); + int sysize = (full_ysize < ysize ? full_ysize : ysize); BlitBitmap(bitmap_db_field_sp, target_bitmap, px, py, sxsize, sysize, sx, sy); }