From 2d464787c1b067268172b2ebdee0941aa0358151 Mon Sep 17 00:00:00 2001 From: Gregory Montoir Date: Thu, 2 Mar 2006 20:08:41 +0000 Subject: fixed compilation. svn-id: r21014 --- engines/cine/main_loop.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'engines/cine/main_loop.cpp') 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; } } -- cgit v1.2.3