aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwhiterandrek2018-04-27 08:36:43 +0300
committerEugene Sandulenko2018-06-28 23:51:32 +0200
commit2f43cbafa0da1266ab55e39b94a88af65c844ea0 (patch)
tree70939f017fa9a78f2f0d3450453c2a7d96237ade
parent8c5bfed75678dd8b083c1cc024bbd80f1facb13c (diff)
downloadscummvm-rg350-2f43cbafa0da1266ab55e39b94a88af65c844ea0.tar.gz
scummvm-rg350-2f43cbafa0da1266ab55e39b94a88af65c844ea0.tar.bz2
scummvm-rg350-2f43cbafa0da1266ab55e39b94a88af65c844ea0.zip
PINK: moved more values to constants section
-rw-r--r--engines/pink/constants.h6
-rw-r--r--engines/pink/objects/module.cpp2
-rw-r--r--engines/pink/objects/pages/game_page.cpp2
-rw-r--r--engines/pink/pink.cpp14
4 files changed, 14 insertions, 10 deletions
diff --git a/engines/pink/constants.h b/engines/pink/constants.h
index da572d1f91..6d2b02a9a2 100644
--- a/engines/pink/constants.h
+++ b/engines/pink/constants.h
@@ -138,8 +138,12 @@ enum {
kBroMinorVersion = 0,
};
+static const char *kPinkGame = "PinkGame";
-const char *kPinkGame = "PinkGame";
+static const char *kPokus = "pokus";
+static const char *kPeril = "peril";
+
+static const char *kUndefined = "UNDEFINED";
} // End of namespace Pink
diff --git a/engines/pink/objects/module.cpp b/engines/pink/objects/module.cpp
index d35f794540..46ea8e11e4 100644
--- a/engines/pink/objects/module.cpp
+++ b/engines/pink/objects/module.cpp
@@ -88,7 +88,7 @@ PinkEngine *Module::getGame() const {
bool Module::checkValueOfVariable(Common::String &variable, Common::String &value) {
if (!_variables.contains(variable))
- return value == "UNDEFINED";
+ return value == kUndefined;
return _variables[variable] == value;
}
diff --git a/engines/pink/objects/pages/game_page.cpp b/engines/pink/objects/pages/game_page.cpp
index e38bed8da8..6b029fbae3 100644
--- a/engines/pink/objects/pages/game_page.cpp
+++ b/engines/pink/objects/pages/game_page.cpp
@@ -133,7 +133,7 @@ Module *GamePage::getModule() const {
bool GamePage::checkValueOfVariable(Common::String &variable, Common::String &value) {
if (!_variables.contains(variable))
- return value == "UNDEFINED";
+ return value == kUndefined;
return _variables[variable] == value;
}
diff --git a/engines/pink/pink.cpp b/engines/pink/pink.cpp
index 008f8277d9..df23a48110 100644
--- a/engines/pink/pink.cpp
+++ b/engines/pink/pink.cpp
@@ -68,10 +68,10 @@ Common::Error PinkEngine::init() {
_console = new Console(this);
- Common::String orbName{_desc.filesDescriptions[0].fileName};
- Common::String broName{_desc.filesDescriptions[1].fileName};
+ const Common::String orbName{_desc.filesDescriptions[0].fileName};
+ const Common::String broName{_desc.filesDescriptions[1].fileName};
- if (strcmp(_desc.gameId, "peril") == 0){
+ if (strcmp(_desc.gameId, kPeril) == 0){
_bro = new BroFile();
}
else debug("This game doesn't need to use bro");
@@ -87,8 +87,8 @@ Common::Error PinkEngine::init() {
_system->showMouse(1);
_orb.loadGame(this);
- const Common::String empty;
- initModule(_modules[0]->getName(), kLoadingNewGame, empty);
+
+ initModule(_modules[0]->getName(), kLoadingNewGame, "");
return Common::kNoError;
}
@@ -193,7 +193,7 @@ void PinkEngine::loadModule(int index) {
bool PinkEngine::checkValueOfVariable(Common::String &variable, Common::String &value) {
if (!_variables.contains(variable))
- return value == "UNDEFINED";
+ return value == kUndefined;
return _variables[variable] == value;
}
@@ -203,7 +203,7 @@ void PinkEngine::setVariable(Common::String &variable, Common::String &value) {
bool PinkEngine::loadCursors() {
Common::PEResources exeResources;
- bool isPokus = !strcmp(_desc.gameId, "pokus");
+ bool isPokus = !strcmp(_desc.gameId, kPokus);
Common::String fileName = isPokus ? _desc.filesDescriptions[1].fileName : _desc.filesDescriptions[2].fileName;
if (!exeResources.loadFromEXE(fileName))
return false;