X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2FInitGameConditions.c;h=050533e8a7b7b60e103109171d65755d7bfbc6ff;hb=9f688962eb90591205c511c1ae9bf752d276d1f5;hp=ccbd2147175d9d6d7351f0fc5092473cffd5f2b6;hpb=8d3d7d213a9691455a49544624bf380e85f43461;p=rocksndiamonds.git diff --git a/src/game_sp/InitGameConditions.c b/src/game_sp/InitGameConditions.c index ccbd2147..050533e8 100644 --- a/src/game_sp/InitGameConditions.c +++ b/src/game_sp/InitGameConditions.c @@ -102,6 +102,15 @@ int InitMurphyPosB(int si) MurphyScreenYPos = MurphyScreenYPos / Stretch; 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) @@ -114,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 @@ -288,7 +305,7 @@ int subFetchAndInitLevelB() MovLowByte(&data_SPtorunavail, 0); // no SP file data_scr_demo = 0; - UpdatePlayTime = (0 == demo_stopped ? True : True); + UpdatePlayTime = (0 == demo_stopped ? True : False); demo_stopped = 0; subFetchAndInitLevelA(UpdatePlayTime); @@ -309,8 +326,11 @@ int subFetchAndInitLevelA(boolean UpdatePlayTime) DemoFlag = 1; GameBusyFlag = 0; // restore scissors too + subFetchAndInitLevel(); // Fetch and initialize a level + GameBusyFlag = 1; // no free screen write + if (1 <= demo_stopped) { if (1 == demo_stopped) @@ -343,7 +363,9 @@ int subFetchAndInitLevel() Trace("modInitGameConditions", "--> subFetchAndInitLevel"); Trace("modInitGameConditions", "Call ReadLevel"); + ReadLevel(); // Read LEVELS.DAT + Trace("modInitGameConditions", "ReadLevel return subFetchAndInitLeveled"); if (RecordDemoFlag == 1) @@ -356,17 +378,27 @@ int subFetchAndInitLevel() // Debug.Print "FetchPlay: " & Hex(RandomSeed) // End If GameBusyFlag = -GameBusyFlag; // make <>1 + Trace("modInitGameConditions", "subConvertToEasySymbols"); + InfoCountInLevel = subConvertToEasySymbols(); // Convert to easy symbols GameBusyFlag = -GameBusyFlag; // restore + Trace("modInitGameConditions", "subDisplayLevel"); + subDisplayLevel(); // Paint (Init) game field subDisplayPanel(); // Paint (Init) Panel + ResetInfotronsNeeded(InfoCountInLevel); // and reset Infotron count + Data_SubRstFlg = 1; + Trace("modInitGameConditions", "subInitGameConditions"); + subInitGameConditions(); // Init game conditions (vars) + InitMurphyPos(); // Locate Murphy + screen pos + Trace("modInitGameConditions", "<-- subFetchAndInitLevel"); return subFetchAndInitLevel;