X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2FInitGameConditions.c;h=1641862ff1549041dde23437b1aeb378ce8392f1;hb=1d35cc6d159fbdcfebcfc0d7b361944f8da20062;hp=73c6ec11d23522ef0f3e4894a508bf02ccfd4fc5;hpb=4591885cdbcfec145d1ac0510fed1519af1eea1d;p=rocksndiamonds.git diff --git a/src/game_sp/InitGameConditions.c b/src/game_sp/InitGameConditions.c index 73c6ec11..1641862f 100644 --- a/src/game_sp/InitGameConditions.c +++ b/src/game_sp/InitGameConditions.c @@ -10,7 +10,7 @@ // Init game conditions (variables) // ========================================================================== -void subInitGameConditions() +void subInitGameConditions(void) { MurphyVarFaceLeft = 0; KillMurphyFlag = 0; // no "kill Murphy" @@ -21,13 +21,13 @@ void subInitGameConditions() YawnSleepCounter = 0; // Wake up sleeping Murphy ExplosionShake = 0; // Force explosion flag off + ExplosionShakeMurphy = 0; // Force explosion flag off TerminalMaxCycles = 0x7F; YellowDisksExploded = 0; TimerVar = 0; - EnterRepeatCounter = 0; // restart Enter repeat counter SnikSnaksElectronsFrozen = 0; // Snik-Snaks and Electrons move! SplitMoveFlag = 0; // Reset Split-through-ports @@ -41,11 +41,11 @@ void subInitGameConditions() // Locate Murphy and init location. // ========================================================================== -void InitMurphyPos() +void InitMurphyPos(void) { int si; - for (si = 0; si <= LevelMax - 1; si++) + for (si = 0; si < LevelMax; si++) if (PlayField16[si] == fiMurphy) break; @@ -56,18 +56,12 @@ void InitMurphyPos() void InitMurphyPosB(int si) { - MurphyYPos = GetStretchY(si) / Stretch; - MurphyXPos = GetStretchX(si) / Stretch; - - MurphyScreenXPos = GetStretchX(si); // Murphy's screen x-position - MurphyScreenYPos = GetStretchY(si); // Murphy's screen y-position + MurphyScreenXPos = MurphyXPos = GetStretchX(si); // Murphy's screen x-position + MurphyScreenYPos = MurphyYPos = GetStretchY(si); // Murphy's screen y-position // To Do: draw Murphy in location ax DDSpriteBuffer_BltImg(MurphyScreenXPos, MurphyScreenYPos, aniMurphy, 0); - MurphyScreenXPos = MurphyScreenXPos / Stretch; - MurphyScreenYPos = MurphyScreenYPos / Stretch; - subCalculateScreenScrollPos(); // calculate screen start addrs if (AutoScrollFlag) @@ -85,7 +79,7 @@ void InitMurphyPosB(int si) // Convert to easy symbols and reset Infotron count If not ThenVer62 // ========================================================================== -int subConvertToEasySymbols() +int subConvertToEasySymbols(void) { int ax, bx, cx, dx, i; int al; @@ -231,39 +225,35 @@ void ResetInfotronsNeeded(int dx) // Fetch and initialize a level // ========================================================================== -void subFetchAndInitLevelB() +void subFetchAndInitLevelB(void) { subFetchAndInitLevelA(); } -void subFetchAndInitLevelA() +void subFetchAndInitLevelA(void) { - GameBusyFlag = 0; // restore scissors too - - subFetchAndInitLevel(); // Fetch and initialize a level + GameBusyFlag = 0; // restore scissors too + subFetchAndInitLevel(); // fetch and initialize a level + GameBusyFlag = 1; // no free screen write - GameBusyFlag = 1; // no free screen write - - DemoKeyCode = 0; // delete last demo key! + DemoKeyCode = 0; // delete last demo key! } -void subFetchAndInitLevel() +void subFetchAndInitLevel(void) { int InfoCountInLevel; - ReadLevel(); // Read LEVELS.DAT - - GameBusyFlag = -GameBusyFlag; // make <>1 - - InfoCountInLevel = subConvertToEasySymbols(); // Convert to easy symbols + PrepareLevel(); // initialize level data - GameBusyFlag = -GameBusyFlag; // restore + GameBusyFlag = -GameBusyFlag; // make != 1 + InfoCountInLevel = subConvertToEasySymbols(); // convert to easy symbols + GameBusyFlag = -GameBusyFlag; // restore - subDisplayLevel(); // Paint (Init) game field + subDisplayLevel(); // paint (init) game field - ResetInfotronsNeeded(InfoCountInLevel); // and reset Infotron count + ResetInfotronsNeeded(InfoCountInLevel); // and reset Infotron count - subInitGameConditions(); // Init game conditions (vars) + subInitGameConditions(); // init game conditions (vars) - InitMurphyPos(); // Locate Murphy + screen pos + InitMurphyPos(); // locate Murphy + screen pos }