X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2FInitGameConditions.c;h=1313c49d4ce1c7e5c7745160e4b9b6912b25e70f;hb=5c5685a92a0ca8060018c4d035e6b37fea7e0f5a;hp=ef5ce12c1a71f18c11a18d9cd6133bbe29359ee1;hpb=34e8c8894f9aa655a87577c946c31a3f9b6134c5;p=rocksndiamonds.git diff --git a/src/game_sp/InitGameConditions.c b/src/game_sp/InitGameConditions.c index ef5ce12c..1313c49d 100644 --- a/src/game_sp/InitGameConditions.c +++ b/src/game_sp/InitGameConditions.c @@ -12,8 +12,6 @@ void subInitGameConditions() { - bCapturePane = False; - MurphyVarFaceLeft = 0; KillMurphyFlag = 0; // no "kill Murphy" ExitToMenuFlag = 0; @@ -23,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 @@ -47,7 +45,7 @@ void InitMurphyPos() { int si; - for (si = 0; si <= LevelMax - 1; si++) + for (si = 0; si < LevelMax; si++) if (PlayField16[si] == fiMurphy) break; @@ -58,17 +56,11 @@ 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 - StretchedSprites.BltImg(MurphyScreenXPos, MurphyScreenYPos, aniMurphy, 0); - - MurphyScreenXPos = MurphyScreenXPos / Stretch; - MurphyScreenYPos = MurphyScreenYPos / Stretch; + DDSpriteBuffer_BltImg(MurphyScreenXPos, MurphyScreenYPos, aniMurphy, 0); subCalculateScreenScrollPos(); // calculate screen start addrs @@ -235,68 +227,33 @@ void ResetInfotronsNeeded(int dx) void subFetchAndInitLevelB() { - boolean UpdatePlayTime; - - data_scr_demo = 0; - UpdatePlayTime = (0 == demo_stopped ? True : False); - demo_stopped = 0; - - subFetchAndInitLevelA(UpdatePlayTime); + subFetchAndInitLevelA(); } -void subFetchAndInitLevelA(boolean UpdatePlayTime) +void subFetchAndInitLevelA() { - D_ModeFlag = 0; // 1=debug D pressed (CPU use) - if (0 != demo_stopped) // 1=demo, 0=game - DemoFlag = 1; - - GameBusyFlag = 0; // restore scissors too - - subFetchAndInitLevel(); // Fetch and initialize a level - - GameBusyFlag = 1; // no free screen write + 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) - { - DemoFlag = 0; // 1=demo, 0=game - demo_stopped = demo_stopped + 1; - } - else - { - DemoFlag = 0; // 1=demo, 0=game - } - } - - DemoKeyCode = 0; // delete last demo key! - if (DemoFlag != 0) // don't allow during game! only in Demo - { - DemoOffset = DemoPointer; // init demo pointer - DemoKeyRepeatCounter = 1; - subGetNextDemoKey(); // get next demo byte - } + DemoKeyCode = 0; // delete last demo key! } void subFetchAndInitLevel() { int InfoCountInLevel; - ReadLevel(); // Read LEVELS.DAT - - if (RecordDemoFlag == 1) - RecDemoRandomSeed = RandomSeed; - - GameBusyFlag = -GameBusyFlag; // make <>1 + PrepareLevel(); // initialize level data - InfoCountInLevel = subConvertToEasySymbols(); // Convert to easy symbols - 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 }