aboutsummaryrefslogtreecommitdiff
path: root/engines/cine/main_loop.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/cine/main_loop.cpp')
-rw-r--r--engines/cine/main_loop.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/engines/cine/main_loop.cpp b/engines/cine/main_loop.cpp
index 6aa1ec1737..ffaa1b49b4 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;
@@ -195,7 +209,7 @@ void CineEngine::mainLoop(int bootScriptIdx) {
errorVar = 0;
- addScriptToList0(bootScriptIdx);
+ addScriptToGlobalScripts(bootScriptIdx);
menuVar = 0;
@@ -244,11 +258,12 @@ void CineEngine::mainLoop(int bootScriptIdx) {
}
processSeqList();
- executeList1();
- executeList0();
+ executeObjectScripts();
+ executeGlobalScripts();
- purgeList1();
- purgeList0();
+ purgeObjectScripts();
+ purgeGlobalScripts();
+ purgeSeqList();
if (playerCommand == -1) {
setMouseCursor(MOUSE_CURSOR_NORMAL);