From 8fddc1258118ff5b32fc594dc9892f76244af474 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 25 Nov 2006 09:28:00 +0000 Subject: Support loading saves from command line. svn-id: r24787 --- engines/cine/main_loop.cpp | 79 ++++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 38 deletions(-) (limited to 'engines/cine/main_loop.cpp') diff --git a/engines/cine/main_loop.cpp b/engines/cine/main_loop.cpp index 7eafa0b88e..b3d60ca547 100644 --- a/engines/cine/main_loop.cpp +++ b/engines/cine/main_loop.cpp @@ -178,65 +178,68 @@ int getKeyData() { return k; } -void mainLoop(int bootScriptIdx) { +void CineEngine::mainLoop(int bootScriptIdx) { uint16 var_6; uint16 quitFlag; uint16 i; byte di; uint16 mouseButton; - freeAnimDataTable(); - resetMessageHead(); - resetSeqList(); - resetglobalScriptsHead(); - resetObjectScriptHead(); - resetBgIncrustList(); + quitFlag = 0; - setTextWindow(0, 0, 20, 200); + if (_preLoad == false) { + freeAnimDataTable(); + resetMessageHead(); + resetSeqList(); + resetglobalScriptsHead(); + resetObjectScriptHead(); + resetBgIncrustList(); - errorVar = 0; + setTextWindow(0, 0, 20, 200); - addScriptToList0(bootScriptIdx); + errorVar = 0; - menuVar = 0; + addScriptToList0(bootScriptIdx); - gfxFuncGen1(page0c, page0, page0c, page0, -1); + menuVar = 0; - ptrGfxFunc13(); + gfxFuncGen1(page0c, page0, page0c, page0, -1); - gfxFuncGen2(); + ptrGfxFunc13(); - quitFlag = 0; - inMenu = false; - allowPlayerInput = 0; - checkForPendingDataLoadSwitch = 0; + gfxFuncGen2(); - fadeRequired = 0; - isDrawCommandEnabled = 0; - waitForPlayerClick = 0; - menuCommandLen = 0; + inMenu = false; + allowPlayerInput = 0; + checkForPendingDataLoadSwitch = 0; - playerCommand = -1; - strcpy(commandBuffer, ""); + fadeRequired = 0; + isDrawCommandEnabled = 0; + waitForPlayerClick = 0; + menuCommandLen = 0; - globalVars[0x1F2] = 0; - globalVars[0x1F4] = 0; + playerCommand = -1; + strcpy(commandBuffer, ""); - for (i = 0; i < 16; i++) { - c_palette[i] = 0; - } + globalVars[0x1F2] = 0; + globalVars[0x1F4] = 0; - var17 = 1; + for (i = 0; i < 16; i++) { + c_palette[i] = 0; + } - strcpy(newPrcName, ""); - strcpy(newRelName, ""); - strcpy(newObjectName, ""); - strcpy(newMsgName, ""); - strcpy(currentBgName[0], ""); - strcpy(currentCtName, ""); - strcpy(currentPartName, ""); + var17 = 1; - g_sfxPlayer->stop(); + strcpy(newPrcName, ""); + strcpy(newRelName, ""); + strcpy(newObjectName, ""); + strcpy(newMsgName, ""); + strcpy(currentBgName[0], ""); + strcpy(currentCtName, ""); + strcpy(currentPartName, ""); + + g_sfxPlayer->stop(); + } do { mainLoopSub3(); -- cgit v1.2.3