diff options
Diffstat (limited to 'engines/cine/main_loop.cpp')
| -rw-r--r-- | engines/cine/main_loop.cpp | 39 | 
1 files changed, 33 insertions, 6 deletions
diff --git a/engines/cine/main_loop.cpp b/engines/cine/main_loop.cpp index cfb828cf3c..e5e670c973 100644 --- a/engines/cine/main_loop.cpp +++ b/engines/cine/main_loop.cpp @@ -179,6 +179,20 @@ int getKeyData() {  	return k;  } +/** Removes elements from seqList that have their member variable var4 set to value -1. */ +void purgeSeqList() { +	Common::List<SeqListElement>::iterator it = seqList.begin(); +	while (it != seqList.end()) { +		if (it->var4 == -1) { +			// Erase the element and jump to the next element +			it = seqList.erase(it); +		} else { +			// Let the element be and jump to the next element +			it++; +		} +	} +} +  void CineEngine::mainLoop(int bootScriptIdx) {  	bool playerAction;  	uint16 quitFlag; @@ -186,6 +200,7 @@ void CineEngine::mainLoop(int bootScriptIdx) {  	uint16 mouseButton;  	quitFlag = 0; +	exitEngine = 0;  	if (_preLoad == false) {  		resetBgIncrustList(); @@ -194,7 +209,7 @@ void CineEngine::mainLoop(int bootScriptIdx) {  		errorVar = 0; -		addScriptToList0(bootScriptIdx); +		addScriptToGlobalScripts(bootScriptIdx);	  		menuVar = 0; @@ -234,13 +249,25 @@ void CineEngine::mainLoop(int bootScriptIdx) {  	do {  		stopMusicAfterFadeOut();  		di = executePlayerInput(); +		 +		// Clear the zoneQuery table (Operation Stealth specific) +		if (g_cine->getGameType() == Cine::GType_OS) { +			for (uint i = 0; i < NUM_MAX_ZONE; i++) { +				zoneQuery[i] = 0; +			} +		} -		processSeqList(); -		executeList1(); -		executeList0(); +		if (g_cine->getGameType() == Cine::GType_OS) { +			processSeqList(); +		} +		executeObjectScripts(); +		executeGlobalScripts(); -		purgeList1(); -		purgeList0(); +		purgeObjectScripts(); +		purgeGlobalScripts(); +		if (g_cine->getGameType() == Cine::GType_OS) { +			purgeSeqList(); +		}  		if (playerCommand == -1) {  			setMouseCursor(MOUSE_CURSOR_NORMAL);  | 
