diff options
author | Gregory Montoir | 2006-03-02 20:08:41 +0000 |
---|---|---|
committer | Gregory Montoir | 2006-03-02 20:08:41 +0000 |
commit | 2d464787c1b067268172b2ebdee0941aa0358151 (patch) | |
tree | 8ec97076998cd24784180dd1815d104a39b6c33b /engines/cine/main_loop.cpp | |
parent | 55898dfe61b6480a615803f3d432d105af874bfc (diff) | |
download | scummvm-rg350-2d464787c1b067268172b2ebdee0941aa0358151.tar.gz scummvm-rg350-2d464787c1b067268172b2ebdee0941aa0358151.tar.bz2 scummvm-rg350-2d464787c1b067268172b2ebdee0941aa0358151.zip |
fixed compilation.
svn-id: r21014
Diffstat (limited to 'engines/cine/main_loop.cpp')
-rw-r--r-- | engines/cine/main_loop.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
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; } } |