diff options
-rw-r--r-- | engines/cine/cine.cpp | 5 | ||||
-rw-r--r-- | engines/cine/main_loop.cpp | 17 | ||||
-rw-r--r-- | engines/cine/various.cpp | 2 | ||||
-rw-r--r-- | engines/cine/various.h | 2 |
4 files changed, 16 insertions, 10 deletions
diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp index d1254aeac6..5a7c2b9433 100644 --- a/engines/cine/cine.cpp +++ b/engines/cine/cine.cpp @@ -215,7 +215,10 @@ static void initialize() { globalVars[i] = 0; } - globalVars[255] = 1; + // bypass protection + if (gameType == GID_OS) { + globalVars[255] = 1; + } for (i = 0; i < NUM_MAX_SCRIPT; i++) { scriptTable[i].ptr = NULL; diff --git a/engines/cine/main_loop.cpp b/engines/cine/main_loop.cpp index 9a529938c4..ef7d186a20 100644 --- a/engines/cine/main_loop.cpp +++ b/engines/cine/main_loop.cpp @@ -89,7 +89,7 @@ void mainLoop(int bootScriptIdx) { uint16 var_6; uint16 quitFlag; uint16 i; - char *di; + uint8 di; uint16 mouseButton; closeEngine3(); @@ -120,7 +120,7 @@ void mainLoop(int bootScriptIdx) { fadeRequired = 0; isDrawCommandEnabled = 0; waitForPlayerClick = 0; - var16 = 0; + menuCommandLen = 0; playerCommand = -1; strcpy(commandBuffer, ""); @@ -146,9 +146,7 @@ void mainLoop(int bootScriptIdx) { do { mainLoopSub3(); -This is bad code. executePlayerInput returns an uint16, and we cast it to a char -pointer. Yeah, right... - di = (char *)executePlayerInput(); + di = executePlayerInput(); if (var18 != 0) { if (var18 >= 100 || var19) { @@ -219,8 +217,13 @@ pointer. Yeah, right... } if (di) { - if (!strcmp(di, "quit")) { - quitFlag = 1; + if ("quit"[menuCommandLen] == (char)di) { + ++menuCommandLen; + if (menuCommandLen == 4) { + quitFlag = 1; + } + } else { + menuCommandLen = 0; } } diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp index cc324baedf..26c51f855a 100644 --- a/engines/cine/various.cpp +++ b/engines/cine/various.cpp @@ -94,7 +94,7 @@ uint16 checkForPendingDataLoadSwitch; uint16 fadeRequired; uint16 isDrawCommandEnabled; uint16 waitForPlayerClick; -uint16 var16; +uint16 menuCommandLen; uint16 var17; uint16 var18; uint16 var19; diff --git a/engines/cine/various.h b/engines/cine/various.h index e78829a273..809805fdda 100644 --- a/engines/cine/various.h +++ b/engines/cine/various.h @@ -105,7 +105,7 @@ extern uint16 checkForPendingDataLoadSwitch; extern uint16 fadeRequired; extern uint16 isDrawCommandEnabled; extern uint16 waitForPlayerClick; -extern uint16 var16; +extern uint16 menuCommandLen; extern uint16 var17; extern uint16 var18; extern uint16 var19; |