From d116a94e2b3aaed238aa370c11bc21d455b8b5a9 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 13 May 2009 11:59:49 +0000 Subject: Normalized types for several variables. Formatting svn-id: r40521 --- engines/drascula/drascula.cpp | 64 +++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 24 deletions(-) (limited to 'engines/drascula/drascula.cpp') diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index b39df842f4..a3c56be1f4 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -186,24 +186,40 @@ Common::Error DrasculaEngine::run() { memset(VGA, 0, 64000); takeObject = 0; - menuBar = 0; menuScreen = 0; hasName = 0; + _menuBar = false; + _menuScreen = false; + _hasName = false; frame_y = 0; - curX = -1; characterMoved = 0; trackProtagonist = 3; num_frame = 0; hare_se_ve = 1; + curX = -1; + characterMoved = 0; + trackProtagonist = 3; + num_frame = 0; + hare_se_ve = 1; checkFlags = 1; doBreak = 0; walkToObject = 0; - stepX = STEP_X; stepY = STEP_Y; - curHeight = CHARACTER_HEIGHT; curWidth = CHARACTER_WIDTH; feetHeight = FEET_HEIGHT; - talkHeight = TALK_HEIGHT; talkWidth = TALK_WIDTH; + + stepX = STEP_X; + stepY = STEP_Y; + + curHeight = CHARACTER_HEIGHT; + curWidth = CHARACTER_WIDTH; + feetHeight = FEET_HEIGHT; + + talkHeight = TALK_HEIGHT; + talkWidth = TALK_WIDTH; + hasAnswer = 0; savedTime = 0; breakOut = 0; - vonBraunX = 120; trackVonBraun = 1; vonBraunHasMoved = 0; + vonBraunX = 120; + trackVonBraun = 1; + vonBraunHasMoved = 0; framesWithoutAction = 0; term_int = 0; musicStopped = 0; selectionMade = 0; - UsingMem = 0; + _useMemForArj = false; globalSpeed = 0; curExcuseLook = 0; curExcuseAction = 0; @@ -467,14 +483,14 @@ bool DrasculaEngine::runCurrentChapter() { updateEvents(); #endif - if (menuScreen == 0 && takeObject == 1) + if (!_menuScreen && takeObject == 1) checkObjects(); #ifdef _WIN32_WCE if (rightMouseButton) - if (menuScreen) { + if (_menuScreen) { #else - if (rightMouseButton == 1 && menuScreen == 1) { + if (rightMouseButton == 1 && _menuScreen) { #endif delay(100); if (currentChapter == 2) @@ -482,7 +498,7 @@ bool DrasculaEngine::runCurrentChapter() { else loadPic(99, backSurface); setPalette((byte *)&gamePalette); - menuScreen = 0; + _menuScreen = false; #ifndef _WIN32_WCE // FIXME: This call here is in hope that it will catch the rightmouseup event so the // next if block won't be executed. This too is not a good coding practice. I've recoded it @@ -498,7 +514,7 @@ bool DrasculaEngine::runCurrentChapter() { // Do not show the inventory screen in chapter 5, if the right mouse button is clicked // while the plug (object 16) is held // Fixes bug #2059621 - "DRASCULA: Plug bug" - if (rightMouseButton == 1 && menuScreen == 0 && + if (rightMouseButton == 1 && !_menuScreen && !(currentChapter == 5 && pickedObject == 16)) { #endif delay(100); @@ -513,14 +529,14 @@ bool DrasculaEngine::runCurrentChapter() { loadPic("iconsp.alg", backSurface); else loadPic("icons.alg", backSurface); - menuScreen = 1; + _menuScreen = true; #ifndef _WIN32_WCE updateEvents(); #endif selectVerb(kVerbNone); } - if (leftMouseButton == 1 && menuBar == 1) { + if (leftMouseButton == 1 && _menuBar) { delay(100); selectVerbFromBar(); } else if (leftMouseButton == 1 && takeObject == 0) { @@ -532,20 +548,20 @@ bool DrasculaEngine::runCurrentChapter() { return true; } - menuBar = (mouseY < 24 && menuScreen == 0) ? 1 : 0; + _menuBar = (mouseY < 24 && !_menuScreen) ? true : false; Common::KeyCode key = getScan(); - if (key == Common::KEYCODE_F1 && menuScreen == 0) { + if (key == Common::KEYCODE_F1 && !_menuScreen) { selectVerb(kVerbLook); - } else if (key == Common::KEYCODE_F2 && menuScreen == 0) { + } else if (key == Common::KEYCODE_F2 && !_menuScreen) { selectVerb(kVerbPick); - } else if (key == Common::KEYCODE_F3 && menuScreen == 0) { + } else if (key == Common::KEYCODE_F3 && !_menuScreen) { selectVerb(kVerbOpen); - } else if (key == Common::KEYCODE_F4 && menuScreen == 0) { + } else if (key == Common::KEYCODE_F4 && !_menuScreen) { selectVerb(kVerbClose); - } else if (key == Common::KEYCODE_F5 && menuScreen == 0) { + } else if (key == Common::KEYCODE_F5 && !_menuScreen) { selectVerb(kVerbTalk); - } else if (key == Common::KEYCODE_F6 && menuScreen == 0) { + } else if (key == Common::KEYCODE_F6 && !_menuScreen) { selectVerb(kVerbMove); } else if (key == Common::KEYCODE_F9) { volumeControls(); @@ -629,7 +645,7 @@ void DrasculaEngine::getStringFromLine(char *buf, int len, char* result) { bool DrasculaEngine::verify1() { int l; - if (menuScreen == 1) + if (_menuScreen) removeObject(); else { for (l = 0; l < numRoomObjs; l++) { @@ -672,11 +688,11 @@ bool DrasculaEngine::verify1() { bool DrasculaEngine::verify2() { int l; - if (menuScreen == 1) { + if (_menuScreen) { if (pickupObject()) return true; } else { - if (!strcmp(textName, "hacker") && hasName == 1) { + if (!strcmp(textName, "hacker") && _hasName) { if (checkAction(50)) return true; } else { -- cgit v1.2.3