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()
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++)
#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;
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)