X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2FDDScrollBuffer.c;h=544b169e4f69731e54174e108fdc5ec773989529;hb=f926e522aef77158e0011ae5ad2cf8805509d6d1;hp=5a89919c320bc0982be26a0b3d365d535c6f680f;hpb=4f9e14eb7715eb000d6a750f9734b8dcc521923f;p=rocksndiamonds.git diff --git a/src/game_sp/DDScrollBuffer.c b/src/game_sp/DDScrollBuffer.c index 5a89919c..544b169e 100644 --- a/src/game_sp/DDScrollBuffer.c +++ b/src/game_sp/DDScrollBuffer.c @@ -39,6 +39,28 @@ boolean redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE]; int TEST_flag = 0; +void RestorePlayfield() +{ + int x1 = mScrollX / TILEX - 2; + int y1 = mScrollY / TILEY - 2; + int x2 = mScrollX / TILEX + (SCR_FIELDX - 1) + 2; + int y2 = mScrollY / TILEY + (SCR_FIELDY - 1) + 2; + int x, y; + + DrawFrameIfNeeded(); + + for (y = DisplayMinY; y <= DisplayMaxY; y++) + { + for (x = DisplayMinX; x <= DisplayMaxX; x++) + { + if (x >= x1 && x <= x2 && y >= y1 && y <= y2) + { + DrawFieldNoAnimated(x, y); + DrawFieldAnimated(x, y); + } + } + } +} static void ScrollPlayfield(int dx, int dy) { @@ -184,7 +206,7 @@ void InitScrollPlayfield() ScrollPlayfieldIfNeededExt(TRUE); } -void UpdatePlayfield() +void UpdatePlayfield(boolean force_redraw) { int x, y; #if 1 @@ -198,10 +220,10 @@ void UpdatePlayfield() int element = LowByte(PlayField16[GetSI(x, y)]); int graphic = GfxGraphic[x][y]; int sync_frame = GfxFrame[x][y]; -#if 1 - boolean redraw = FALSE; -#else - boolean redraw = TRUE; // !!! TEST ONLY -- ALWAYS REDRAW !!! + boolean redraw = force_redraw; + +#if 0 + redraw = TRUE; // !!! TEST ONLY -- ALWAYS REDRAW !!! #endif if (graphic < 0)