aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2015-05-19 20:07:24 +0200
committerStrangerke2015-05-19 20:07:24 +0200
commit456e0c584f2497b82b6be5f531f655b9681a11b8 (patch)
tree494bb1a2402adcd5e179afac7a7f1bb86fb513e4
parent85081b7702e7571a144ff57accd5ac9123f4123f (diff)
downloadscummvm-rg350-456e0c584f2497b82b6be5f531f655b9681a11b8.tar.gz
scummvm-rg350-456e0c584f2497b82b6be5f531f655b9681a11b8.tar.bz2
scummvm-rg350-456e0c584f2497b82b6be5f531f655b9681a11b8.zip
SHERLOCK: Use a bit more MenuMode and SaveMode
-rw-r--r--engines/sherlock/saveload.cpp4
-rw-r--r--engines/sherlock/scene.cpp2
-rw-r--r--engines/sherlock/screen.h32
-rw-r--r--engines/sherlock/talk.cpp7
-rw-r--r--engines/sherlock/user_interface.cpp8
5 files changed, 28 insertions, 25 deletions
diff --git a/engines/sherlock/saveload.cpp b/engines/sherlock/saveload.cpp
index 9848f8160f..c13d6dd9ee 100644
--- a/engines/sherlock/saveload.cpp
+++ b/engines/sherlock/saveload.cpp
@@ -260,12 +260,12 @@ void SaveManager::highlightButtons(int btnIndex) {
screen.buttonPrint(Common::Point(ENV_POINTS[0][2], CONTROLS_Y), color, 1, "Exit");
- if ((btnIndex == 1) || ((_envMode == 1) && (btnIndex != 2)))
+ if ((btnIndex == 1) || ((_envMode == SAVEMODE_LOAD) && (btnIndex != 2)))
screen.buttonPrint(Common::Point(ENV_POINTS[1][2], CONTROLS_Y), COMMAND_HIGHLIGHTED, true, "Load");
else
screen.buttonPrint(Common::Point(ENV_POINTS[1][2], CONTROLS_Y), COMMAND_FOREGROUND, true, "Load");
- if ((btnIndex == 2) || ((_envMode == 2) && (btnIndex != 1)))
+ if ((btnIndex == 2) || ((_envMode == SAVEMODE_SAVE) && (btnIndex != 1)))
screen.buttonPrint(Common::Point(ENV_POINTS[2][2], CONTROLS_Y), COMMAND_HIGHLIGHTED, true, "Save");
else
screen.buttonPrint(Common::Point(ENV_POINTS[2][2], CONTROLS_Y), COMMAND_FOREGROUND, true, "Save");
diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp
index d835b5caa8..573dfff2b1 100644
--- a/engines/sherlock/scene.cpp
+++ b/engines/sherlock/scene.cpp
@@ -150,7 +150,7 @@ void Scene::selectScene() {
loadScene(sceneFile);
- // If the fade style was changed from running amovie, then reset it
+ // If the fade style was changed from running a movie, then reset it
if (_tempFadeStyle) {
screen._fadeStyle = _tempFadeStyle;
_tempFadeStyle = 0;
diff --git a/engines/sherlock/screen.h b/engines/sherlock/screen.h
index 0369422bc3..ee9e800cdc 100644
--- a/engines/sherlock/screen.h
+++ b/engines/sherlock/screen.h
@@ -36,22 +36,22 @@ namespace Sherlock {
#define VGA_COLOR_TRANS(x) ((x) * 255 / 63)
enum {
- INFO_BLACK = 1,
- INFO_FOREGROUND = 11,
- INFO_BACKGROUND = 1,
- BORDER_COLOR = 237,
- INV_FOREGROUND = 14,
- INV_BACKGROUND = 1,
- COMMAND_HIGHLIGHTED = 10,
- COMMAND_FOREGROUND = 15,
- COMMAND_BACKGROUND = 4,
- COMMAND_NULL = 248,
- BUTTON_TOP = 233,
- BUTTON_MIDDLE = 244,
- BUTTON_BOTTOM = 248,
- TALK_FOREGROUND = 12,
- TALK_NULL = 16,
- PEN_COLOR = 250
+ INFO_BLACK = 1,
+ INFO_FOREGROUND = 11,
+ INFO_BACKGROUND = 1,
+ BORDER_COLOR = 237,
+ INV_FOREGROUND = 14,
+ INV_BACKGROUND = 1,
+ COMMAND_HIGHLIGHTED = 10,
+ COMMAND_FOREGROUND = 15,
+ COMMAND_BACKGROUND = 4,
+ COMMAND_NULL = 248,
+ BUTTON_TOP = 233,
+ BUTTON_MIDDLE = 244,
+ BUTTON_BOTTOM = 248,
+ TALK_FOREGROUND = 12,
+ TALK_NULL = 16,
+ PEN_COLOR = 250
};
class SherlockEngine;
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index 734aa76e0a..47b9f6f277 100644
--- a/engines/sherlock/talk.cpp
+++ b/engines/sherlock/talk.cpp
@@ -146,7 +146,7 @@ void Talk::talkTo(const Common::String &filename) {
}
// Save the ui mode temporarily and switch to talk mode
- int savedMode = ui._menuMode;
+ MenuMode savedMode = ui._menuMode;
ui._menuMode = TALK_MODE;
// Turn on the Exit option
@@ -183,7 +183,7 @@ void Talk::talkTo(const Common::String &filename) {
// Restore any pressed button
if (!ui._windowOpen && savedMode != STD_MODE)
- ui.restoreButton(savedMode - 1);
+ ui.restoreButton((int)(savedMode - 1));
// Clear the ui counter so that anything displayed on the info line
// before the window was opened isn't cleared
@@ -258,6 +258,9 @@ void Talk::talkTo(const Common::String &filename) {
events._pressed = events._released = events._oldButtons = 0;
abortFlag = true;
break;
+
+ default:
+ break;
}
}
diff --git a/engines/sherlock/user_interface.cpp b/engines/sherlock/user_interface.cpp
index 943d3498b2..c42829167b 100644
--- a/engines/sherlock/user_interface.cpp
+++ b/engines/sherlock/user_interface.cpp
@@ -389,7 +389,7 @@ void UserInterface::handleInput() {
doMainControl();
}
- if (pt.y < CONTROLS_Y && events._pressed && _oldTemp != (_menuMode - 1) && _oldKey != -1)
+ if (pt.y < CONTROLS_Y && events._pressed && _oldTemp != (int)(_menuMode - 1) && _oldKey != -1)
restoreButton(_oldTemp);
}
}
@@ -438,7 +438,7 @@ void UserInterface::pushButton(int num) {
void UserInterface::toggleButton(int num) {
Screen &screen = *_vm->_screen;
- if (_menuMode != (num + 1)) {
+ if (_menuMode != (MenuMode)(num + 1)) {
_menuMode = (MenuMode)(num + 1);
_oldKey = COMMANDS[num];
_oldTemp = num;
@@ -700,7 +700,7 @@ void UserInterface::doEnvControl() {
if (mousePos.y > (CONTROLS_Y + 11 + _selector * 10) && mousePos.y < (CONTROLS_Y + 21 + _selector * 10))
found1 = 1;
- if (_selector + saves._savegameIndex - 1 < MAX_SAVEGAME_SLOTS + (saves._envMode != 1))
+ if (_selector + saves._savegameIndex - 1 < MAX_SAVEGAME_SLOTS + (saves._envMode != SAVEMODE_LOAD))
_selector = _selector + saves._savegameIndex - 1;
else
_selector = -1;
@@ -734,7 +734,7 @@ void UserInterface::doEnvControl() {
} else if (_key >= '1' && _key <= '9') {
_keyboardInput = true;
_selector = _key - '1';
- if (_selector >= MAX_SAVEGAME_SLOTS + (saves._envMode == 1 ? 0 : 1))
+ if (_selector >= MAX_SAVEGAME_SLOTS + (saves._envMode == SAVEMODE_LOAD ? 0 : 1))
_selector = -1;
if (saves.checkGameOnScreen(_selector))