From: Holger Schemel Date: Wed, 6 Jan 2010 23:45:59 +0000 (+0100) Subject: rnd-20100107-1-src X-Git-Tag: 3.3.0.0^2~50 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=9f688962eb90591205c511c1ae9bf752d276d1f5;p=rocksndiamonds.git rnd-20100107-1-src * fixed bug in Supaplex engine regarding initial screen scroll position --- diff --git a/ChangeLog b/ChangeLog index 0efd5105..fc0dd1c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2010-01-06 + * fixed bug in Supaplex engine regarding initial screen scroll position + 2009-12-17 * fixed EMC style pushing animations in the R'n'D graphics engine (when using ".2nd_movement_tile" for animations having start and end tile) diff --git a/src/conftime.h b/src/conftime.h index 51b9787d..86fdfa27 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2009-12-18 23:21" +#define COMPILE_DATE_STRING "2010-01-07 00:44" diff --git a/src/game_sp/DDScrollBuffer.c b/src/game_sp/DDScrollBuffer.c index 24594faa..53cc5ea0 100644 --- a/src/game_sp/DDScrollBuffer.c +++ b/src/game_sp/DDScrollBuffer.c @@ -882,6 +882,14 @@ void DDScrollBuffer_SoftScrollTo(int X, int Y, long TimeMS, int FPS) long oldX, oldY, maxD; static boolean AlreadyRunning = False; +#if 0 + printf(":a: %d, %d [%d, %d] [%d, %d] [%d, %d]\n", + mScrollX, mScrollY, + mScrollX_last, mScrollY_last, + ScreenScrollXPos, ScreenScrollYPos, + ScrollX, ScrollY); +#endif + if (NoDisplayFlag) return; @@ -924,9 +932,20 @@ void DDScrollBuffer_SoftScrollTo(int X, int Y, long TimeMS, int FPS) mScrollY = oldY + T * dY; ScrollX = mScrollX; ScrollY = mScrollY; - // Blt(); + +#if 0 + Blt(); +#endif } +#if 0 + printf(":x: %d, %d [%d, %d] [%d, %d] [%d, %d]\n", + mScrollX, mScrollY, + mScrollX_last, mScrollY_last, + ScreenScrollXPos, ScreenScrollYPos, + ScrollX, ScrollY); +#endif + if (UserDragFlag) goto SoftScrollEH; @@ -938,7 +957,10 @@ void DDScrollBuffer_SoftScrollTo(int X, int Y, long TimeMS, int FPS) mScrollY = Y; ScrollX = mScrollX; ScrollY = mScrollY; - // Blt(); + +#if 0 + Blt(); +#endif SoftScrollEH: AlreadyRunning = False; @@ -948,7 +970,23 @@ SoftScrollEH: mScrollX, mScrollY); #endif +#if 0 + printf(":y: %d, %d [%d, %d] [%d, %d] [%d, %d]\n", + mScrollX, mScrollY, + mScrollX_last, mScrollY_last, + ScreenScrollXPos, ScreenScrollYPos, + ScrollX, ScrollY); +#endif + #if 1 ScrollPlayfieldIfNeeded(); #endif + +#if 0 + printf(":z: %d, %d [%d, %d] [%d, %d] [%d, %d]\n", + mScrollX, mScrollY, + mScrollX_last, mScrollY_last, + ScreenScrollXPos, ScreenScrollYPos, + ScrollX, ScrollY); +#endif } diff --git a/src/game_sp/Display.c b/src/game_sp/Display.c index 2eefc737..94c846ed 100644 --- a/src/game_sp/Display.c +++ b/src/game_sp/Display.c @@ -167,6 +167,12 @@ void SoftScrollTo(int X, int Y, long TimeMS, int FPS) if (NoDisplayFlag) return; +#if 0 + printf(":(: %d, %d [%d, %d - %d, %d] [%d]\n", + X, Y, ScrollMinX, ScrollMinY, ScrollMaxX, ScrollMaxY, + ScrollDelta); +#endif + oldX = ScrollX; oldY = ScrollY; X = ScrollDelta * (X / ScrollDelta); @@ -178,5 +184,11 @@ void SoftScrollTo(int X, int Y, long TimeMS, int FPS) // ScrollX = X // ScrollY = Y +#if 0 + printf(":): %d, %d [%d, %d - %d, %d] [%d]\n", + X, Y, ScrollMinX, ScrollMinY, ScrollMaxX, ScrollMaxY, + ScrollDelta); +#endif + Stage.SoftScrollTo(X, Y, TimeMS, FPS); } diff --git a/src/game_sp/Globals.c b/src/game_sp/Globals.c index 4c4f7afe..ebf59fd6 100644 --- a/src/game_sp/Globals.c +++ b/src/game_sp/Globals.c @@ -630,6 +630,11 @@ void ReadLevel() copyInternalEngineVars_SP(); +#if 1 + SetDisplayRegion(); + SetScrollEdges(); +#endif + LevelNumber = level_nr; #if 0 diff --git a/src/game_sp/InitGameConditions.c b/src/game_sp/InitGameConditions.c index 78ecefe1..050533e8 100644 --- a/src/game_sp/InitGameConditions.c +++ b/src/game_sp/InitGameConditions.c @@ -103,6 +103,14 @@ int InitMurphyPosB(int si) subCalculateScreenScrollPos(); // calculate screen start addrs +#if 0 + printf(":1: %d, %d [%d, %d] [%d, %d] [%d, %d]\n", + mScrollX, mScrollY, + mScrollX_last, mScrollY_last, + ScreenScrollXPos, ScreenScrollYPos, + ScrollX, ScrollY); +#endif + if (AutoScrollFlag) { if (bPlaying) @@ -115,6 +123,14 @@ int InitMurphyPosB(int si) } } +#if 0 + printf(":2: %d, %d [%d, %d] [%d, %d] [%d, %d]\n", + mScrollX, mScrollY, + mScrollX_last, mScrollY_last, + ScreenScrollXPos, ScreenScrollYPos, + ScrollX, ScrollY); +#endif + return InitMurphyPosB; } // InitMurphyPosB diff --git a/src/game_sp/MainForm.c b/src/game_sp/MainForm.c index 4ac25f81..9ee82353 100644 --- a/src/game_sp/MainForm.c +++ b/src/game_sp/MainForm.c @@ -2490,6 +2490,9 @@ void menPlay_Click() UpdateDeltaT(); #endif +#if 1 +#endif + #if 0 printf("::: MainForm.c: menPlay_Click(): subFetchAndInitLevelB(): ...\n"); #endif @@ -3128,7 +3131,11 @@ static void ReStretch(float NewStretch) #endif } +#if 0 static void SetScrollEdges() +#else +void SetScrollEdges() +#endif { #if 0 printf("::: MainForm.c: SetScrollEdges() ... [%ld, %ld, %ld, %ld] [%f, %d] [%d, %d, %d, %d]\n", diff --git a/src/game_sp/MainForm.h b/src/game_sp/MainForm.h index 90db2d17..6d8ab117 100644 --- a/src/game_sp/MainForm.h +++ b/src/game_sp/MainForm.h @@ -26,6 +26,7 @@ extern void Let_PanelVisible(boolean NewVal); extern void ReLoadStretchSprites(); extern void SaveSnapshot(currency Number); extern void SetDisplayRegion(); +extern void SetScrollEdges(); extern void ShowKey(int KeyVar); extern void menDemoSpeed_Click(int Index); extern void menEdit_Click(); diff --git a/src/game_sp/main.c b/src/game_sp/main.c index d63d32a0..fb46ec87 100644 --- a/src/game_sp/main.c +++ b/src/game_sp/main.c @@ -15,11 +15,21 @@ void InitGameEngine_SP() InitScrollPlayfield(); +#if 0 + printf(":A: %d, %d [%d, %d]\n", + mScrollX, mScrollY, mScrollX_last, mScrollY_last); +#endif + #if 1 menPlay_Click(); #else menPlayDemo_Click(); #endif + +#if 0 + printf(":B: %d, %d [%d, %d]\n", + mScrollX, mScrollY, mScrollX_last, mScrollY_last); +#endif } #if 0