From 70e95507923cc6cfb20d9e9a74e8f5cc5f6e44de Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 1 Nov 2009 21:37:08 +0100 Subject: [PATCH] rnd-20091101-3-src --- src/conftime.h | 2 +- src/game_sp/DDScrollBuffer.c | 44 ++++++++++++++++++++++++++++++++---- src/game_sp/MainForm.c | 5 +++- 3 files changed, 45 insertions(+), 6 deletions(-) diff --git a/src/conftime.h b/src/conftime.h index 3a907a71..524cdb82 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2009-11-01 17:22" +#define COMPILE_DATE_STRING "2009-11-01 21:31" diff --git a/src/game_sp/DDScrollBuffer.c b/src/game_sp/DDScrollBuffer.c index 48a35ef1..23ce4ce9 100644 --- a/src/game_sp/DDScrollBuffer.c +++ b/src/game_sp/DDScrollBuffer.c @@ -135,13 +135,19 @@ void DDScrollBuffer_Blt_Ext(Bitmap *target_bitmap) { RECT DR, SR; long tX, tY, L; + int sX, sY; // RECT ERect; // long Restore; if (NoDisplayFlag) return; -#if 0 +#if 1 + DR.left = 0; + DR.top = 0; + DR.right = SCR_FIELDX * TILEX; + DR.bottom = SCR_FIELDY * TILEY; +#else // --- On Error GoTo BltEH DirectX.GetWindowRect(mhWnd, DR); // --- On Error GoTo 0 @@ -175,10 +181,37 @@ void DDScrollBuffer_Blt_Ext(Bitmap *target_bitmap) } #if 1 + SR.left = (SR.left < 0 ? 0 : SR.left); + SR.top = (SR.top < 0 ? 0 : SR.top); +#endif -#if 0 - printf("::: DDScrollBuffer.c: DDScrollBuffer_Blt(): blit from %d, %d [%ld, %ld] [%ld, %ld]\n", - SR.left, SR.top, mScrollX, mScrollY, mDestXOff, mDestYOff); +#if 1 + { + int full_xsize = (FieldWidth - (menBorder.Checked ? 0 : 1)) * TILEX; + int full_ysize = (FieldHeight - (menBorder.Checked ? 0 : 1)) * TILEY; + int sxsize = SCR_FIELDX * TILEX; + int sysize = SCR_FIELDY * TILEY; + + tX = (full_xsize < sxsize ? full_xsize : tX); + tY = (full_ysize < sysize ? full_ysize : tY); + sX = SX + (full_xsize < sxsize ? (sxsize - full_xsize) / 2 : 0); + sY = SY + (full_ysize < sysize ? (sysize - full_ysize) / 2 : 0); + } +#endif + +#if 1 + if (!menBorder.Checked) + { + SR.left += 16; + SR.top += 16; + } +#endif + +#if 1 + +#if 1 + printf("::: DDScrollBuffer.c: DDScrollBuffer_Blt(): blit from %d, %d [%ld, %ld] [%ld, %ld] [%ld, %ld]\n", + SR.left, SR.top, mScrollX, mScrollY, mDestXOff, mDestYOff, tX, tY); #endif #if 0 @@ -194,6 +227,9 @@ void DDScrollBuffer_Blt_Ext(Bitmap *target_bitmap) #endif #if 1 + BlitBitmap(screenBitmap, target_bitmap, + SR.left, SR.top, tX, tY, sX, sY); +#else BlitBitmap(screenBitmap, target_bitmap, SR.left, SR.top, SCR_FIELDX * TILEX, SCR_FIELDY * TILEY, SX, SY); diff --git a/src/game_sp/MainForm.c b/src/game_sp/MainForm.c index 0a66bd96..7936fee2 100644 --- a/src/game_sp/MainForm.c +++ b/src/game_sp/MainForm.c @@ -1024,7 +1024,8 @@ void DisplayLevel() DrawFrame(0); -#if 0 + /* !!! CHECK THIS !!! */ +#if 1 if (! menBorder.Checked) DrawFrame(1); #endif @@ -1369,7 +1370,9 @@ void Form_Load() PauseMode = 0; // BaseWidth = 16 +#if 0 menBorder_Click(); +#endif Loaded = True; -- 2.34.1