X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2FDDScrollBuffer.c;h=d90835b3e50ef804e0d220600cec84b35fea16bd;hb=f585bab94637506eec06b81b8919fedcd3e63a1e;hp=e7664f7651fc2ef81016562f805461a4179611bd;hpb=fdd2829c52e8f4ec204e089b5d35ed5aef50e4e6;p=rocksndiamonds.git diff --git a/src/game_sp/DDScrollBuffer.c b/src/game_sp/DDScrollBuffer.c index e7664f76..d90835b3 100644 --- a/src/game_sp/DDScrollBuffer.c +++ b/src/game_sp/DDScrollBuffer.c @@ -11,7 +11,6 @@ int mScrollX, mScrollY; int mScrollX_last, mScrollY_last; int ScreenBuffer[2 + MAX_PLAYFIELD_WIDTH + 2][2 + MAX_PLAYFIELD_HEIGHT + 2]; -boolean redraw[2 + MAX_PLAYFIELD_WIDTH + 2][2 + MAX_PLAYFIELD_HEIGHT + 2]; void RestorePlayfield() @@ -53,12 +52,6 @@ static void ScrollPlayfield(int dx, int dy) TILEX_VAR * (dx == 1), TILEY_VAR * (dy == 1)); - /* when scrolling the whole playfield, do not redraw single tiles */ - for (x = 0; x < 2 + MAX_PLAYFIELD_WIDTH + 2; x++) - for (y = 0; y < 2 + MAX_PLAYFIELD_HEIGHT + 2; y++) - redraw[x][y] = FALSE; - redraw_tiles = 0; - DrawFrameIfNeeded(); for (y = DisplayMinY; y <= DisplayMaxY; y++) @@ -204,10 +197,10 @@ void UpdatePlayfield(boolean force_redraw) #endif } -/* copy the entire screen to the window at the scroll position */ - void BlitScreenToBitmap_SP(Bitmap *target_bitmap) { + /* copy playfield buffer to target bitmap at scroll position */ + int px = 2 * TILEX + (mScrollX - mScrollX_last) % TILEX; int py = 2 * TILEY + (mScrollY - mScrollY_last) % TILEY; int sx, sy, sxsize, sysize; @@ -237,18 +230,6 @@ void BlitScreenToBitmap_SP(Bitmap *target_bitmap) BlitBitmap(bitmap_db_field_sp, target_bitmap, px, py, sxsize, sysize, sx, sy); } -void BackToFront_SP(void) -{ - int x, y; - - BlitScreenToBitmap_SP(window); - - for (x = 0; x < 2 + MAX_PLAYFIELD_WIDTH + 2; x++) - for (y = 0; y < 2 + MAX_PLAYFIELD_HEIGHT + 2; y++) - redraw[x][y] = FALSE; - redraw_tiles = 0; -} - void DDScrollBuffer_ScrollTo(int X, int Y) { if (NoDisplayFlag)