From: Holger Schemel Date: Tue, 24 Nov 2009 22:03:11 +0000 (+0100) Subject: rnd-20091124-2-src X-Git-Tag: 3.3.0.0^2~61 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=df8f020b9c0aad57e1f2e790c771550232fb6ce8;p=rocksndiamonds.git rnd-20091124-2-src --- diff --git a/src/conftime.h b/src/conftime.h index a8578e71..abed863e 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2009-11-24 01:16" +#define COMPILE_DATE_STRING "2009-11-24 23:00" diff --git a/src/game_sp/DDScrollBuffer.c b/src/game_sp/DDScrollBuffer.c index 859fb35d..fdc925f2 100644 --- a/src/game_sp/DDScrollBuffer.c +++ b/src/game_sp/DDScrollBuffer.c @@ -348,6 +348,36 @@ void BlitScreenToBitmap_SP(Bitmap *target_bitmap) sy = SY + (full_ysize < ysize ? (ysize - full_ysize) / 2 : 0); #endif +#if 0 + { + static int mScrollX_tmp = -1; + static int mScrollY_tmp = -1; + + if (mScrollX != mScrollX_tmp || mScrollY != mScrollY_tmp) + { + printf("::: %ld, %ld\n", mScrollX, mScrollY); + + mScrollX_tmp = mScrollX; + mScrollY_tmp = mScrollY; + } + } +#endif + +#if 0 + { + static boolean x = 0; + + if (x == 0) + { + printf("::: %d, %d (%d, %d) (%d, %d) [%ld, %ld] [%ld, %ld] \n", + sx, sy, xsize, ysize, full_xsize, full_ysize, + mScrollX, mScrollY, mScrollX_last, mScrollY_last); + + x = 1; + } + } +#endif + #if 1 if (!menBorder.Checked) { @@ -356,6 +386,29 @@ void BlitScreenToBitmap_SP(Bitmap *target_bitmap) } #endif +#if 0 + if (mScrollX >= 0 && mScrollX <= 16) + { + px -= mScrollX; + } +#if 0 + else if (mScrollX >= 352 && mScrollX <= 368) + { + px -= mScrollX; + } +#endif + else if (mScrollX >= 16) // && mScrollX <= 352) + { + px -= TILEX / 2; + } +#endif + +#if 0 + /* !!! TEST ONLY !!! */ + px = py = 0; + sx = sy = SX; +#endif + BlitBitmap(screenBitmap, target_bitmap, px, py, sxsize, sysize, sx, sy); } diff --git a/src/game_sp/DDSpriteBuffer.c b/src/game_sp/DDSpriteBuffer.c index 00e49d7a..872ded6f 100644 --- a/src/game_sp/DDSpriteBuffer.c +++ b/src/game_sp/DDSpriteBuffer.c @@ -179,10 +179,12 @@ static void Blt(int pX, int pY, int SpriteX, int SpriteY) #if 1 - int sx1 = mScrollX_last - 2 * TILEX; - int sy1 = mScrollY_last - 2 * TILEY; - int sx2 = mScrollX_last + SXSIZE + 1 * TILEX; - int sy2 = mScrollY_last + SYSIZE + 1 * TILEY; + int scx = (mScrollX_last < 0 ? 0 : mScrollX_last); + int scy = (mScrollY_last < 0 ? 0 : mScrollY_last); + int sx1 = scx - 2 * TILEX; + int sy1 = scy - 2 * TILEY; + int sx2 = scx + SXSIZE + 1 * TILEX; + int sy2 = scy + SYSIZE + 1 * TILEY; int sx = pX - sx1; int sy = pY - sy1; diff --git a/src/game_sp/MainForm.c b/src/game_sp/MainForm.c index a2dfbbeb..a9dc22c5 100644 --- a/src/game_sp/MainForm.c +++ b/src/game_sp/MainForm.c @@ -1029,6 +1029,10 @@ void DisplayLevel() if (! LevelLoaded) return; + ClearRectangle(backbuffer, REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE); + ClearRectangle(screenBitmap, 0, 0, + MAX_BUF_XSIZE * TILEX, MAX_BUF_YSIZE * TILEY); + #if 1 SetDisplayRegion(); #endif diff --git a/src/game_sp/main_sp.h b/src/game_sp/main_sp.h index 7e0480e2..008afa31 100644 --- a/src/game_sp/main_sp.h +++ b/src/game_sp/main_sp.h @@ -49,6 +49,11 @@ #define SXSIZE (SCR_FIELDX * TILEX) #define SYSIZE (SCR_FIELDY * TILEY) +#define REAL_SX (SX - 2) +#define REAL_SY (SY - 2) +#define FULL_SXSIZE (2 + SXSIZE + 2) +#define FULL_SYSIZE (2 + SYSIZE + 2) + /* ------------------------------------------------------------------------- */ /* data structure definitions */