From 80e176e969192ac90d74ef83b4ab22dc0fe21b7a Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Fri, 26 Jan 2007 02:54:29 +0100 Subject: [PATCH] rnd-20070126-1-src --- src/conftime.h | 2 +- src/game.c | 31 ++++++++++++++++++++++++++++--- src/init.c | 1 - src/main.c | 1 - src/main.h | 1 - 5 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/conftime.h b/src/conftime.h index a7fc3e08..caae2a71 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2007-01-25 03:07" +#define COMPILE_DATE_STRING "2007-01-26 02:51" diff --git a/src/game.c b/src/game.c index bb6e6ede..0b52048d 100644 --- a/src/game.c +++ b/src/game.c @@ -10565,8 +10565,32 @@ static boolean AllPlayersInVisibleScreen() void ScrollLevel(int dx, int dy) { + int i, x, y; + + /* only horizontal XOR vertical scroll direction allowed */ + if ((dx == 0 && dy == 0) || (dx != 0 && dy != 0)) + return; + +#if 1 + int xsize = (BX2 - BX1 + 1); + int ysize = (BY2 - BY1 + 1); + int start = (dx != 0 ? (dx == -1 ? BX1 : BX2) : (dy == -1 ? BY1 : BY2)); + int end = (dx != 0 ? (dx == -1 ? BX2 : BX1) : (dy == -1 ? BY2 : BY1)); + int step = (start < end ? +1 : -1); + + for (i = start; i != end; i += step) + { + BlitBitmap(drawto_field, drawto_field, + FX + TILEX * (dx != 0 ? i + step : 0), + FY + TILEY * (dy != 0 ? i + step : 0), + TILEX * (dx != 0 ? 1 : xsize), + TILEY * (dy != 0 ? 1 : ysize), + FX + TILEX * (dx != 0 ? i : 0), + FY + TILEY * (dy != 0 ? i : 0)); + } +#else + int softscroll_offset = (setup.soft_scrolling ? TILEX : 0); - int x, y; #if 1 BlitBitmap(drawto_field, bitmap_db_field2, @@ -10591,16 +10615,17 @@ void ScrollLevel(int dx, int dy) SYSIZE - TILEY * (dy != 0) + 2 * softscroll_offset, FX + TILEX * (dx == 1) - softscroll_offset, FY + TILEY * (dy == 1) - softscroll_offset); +#endif #endif - if (dx) + if (dx != 0) { x = (dx == 1 ? BX1 : BX2); for (y = BY1; y <= BY2; y++) DrawScreenField(x, y); } - if (dy) + if (dy != 0) { y = (dy == 1 ? BY1 : BY2); for (x = BX1; x <= BX2; x++) diff --git a/src/init.c b/src/init.c index 6487cb0b..49006fa1 100644 --- a/src/init.c +++ b/src/init.c @@ -4718,7 +4718,6 @@ void InitGfx() /* create additional image buffers for double-buffering and cross-fading */ bitmap_db_cross = CreateBitmap(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH); bitmap_db_field = CreateBitmap(FXSIZE, FYSIZE, DEFAULT_DEPTH); - bitmap_db_field2= CreateBitmap(FXSIZE, FYSIZE, DEFAULT_DEPTH); bitmap_db_panel = CreateBitmap(DXSIZE, DYSIZE, DEFAULT_DEPTH); bitmap_db_door = CreateBitmap(3 * DXSIZE, DYSIZE + VYSIZE, DEFAULT_DEPTH); diff --git a/src/main.c b/src/main.c index 7f0eca2e..83eefa6d 100644 --- a/src/main.c +++ b/src/main.c @@ -22,7 +22,6 @@ Bitmap *bitmap_db_cross; Bitmap *bitmap_db_field; -Bitmap *bitmap_db_field2; Bitmap *bitmap_db_panel; Bitmap *bitmap_db_door; DrawBuffer *fieldbuffer; diff --git a/src/main.h b/src/main.h index d07b005f..fd1fe6ee 100644 --- a/src/main.h +++ b/src/main.h @@ -2559,7 +2559,6 @@ struct HelpAnimInfo extern Bitmap *bitmap_db_cross; extern Bitmap *bitmap_db_field; -extern Bitmap *bitmap_db_field2; extern Bitmap *bitmap_db_panel; extern Bitmap *bitmap_db_door; extern Pixmap tile_clipmask[]; -- 2.34.1