diff options
author | yinsimei | 2017-07-11 15:39:22 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2017-07-13 18:27:45 +0200 |
commit | 91fcdda2d188602a376f4369d375a74117f93ae7 (patch) | |
tree | f5b08aa8d6b1e33ae8b7bdb4335fa195801c84eb /engines/sludge/newfatal.cpp | |
parent | d6308b91769c904421cc6c0470e34c743c903dfc (diff) | |
download | scummvm-rg350-91fcdda2d188602a376f4369d375a74117f93ae7.tar.gz scummvm-rg350-91fcdda2d188602a376f4369d375a74117f93ae7.tar.bz2 scummvm-rg350-91fcdda2d188602a376f4369d375a74117f93ae7.zip |
SLUDGE: change global Common::String to public var of SludgeEngine
Diffstat (limited to 'engines/sludge/newfatal.cpp')
-rw-r--r-- | engines/sludge/newfatal.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/engines/sludge/newfatal.cpp b/engines/sludge/newfatal.cpp index e9cd860d8a..0f847bdda8 100644 --- a/engines/sludge/newfatal.cpp +++ b/engines/sludge/newfatal.cpp @@ -33,9 +33,6 @@ namespace Sludge { const char emergencyMemoryMessage[] = "Out of memory displaying error message!"; -static Common::String fatalMessage; -static Common::String fatalInfo = "Initialisation error! Something went wrong before we even got started!"; - extern int numResourceNames /* = 0*/; extern Common::String *allResourceNames /*= ""*/; @@ -52,13 +49,13 @@ const Common::String &resourceNameFromNum(int i) { } bool hasFatal() { - if (!fatalMessage.empty()) + if (!g_sludge->fatalMessage.empty()) return true; return false; } void displayFatal() { - if (!fatalMessage.empty()) { + if (!g_sludge->fatalMessage.empty()) { #if 0 msgBox("SLUDGE v" TEXT_VERSION " fatal error!", fatalMessage); #endif @@ -66,7 +63,7 @@ void displayFatal() { } void registerWindowForFatal() { - fatalInfo = "There's an error with this SLUDGE game! If you're designing this game, please turn on verbose error messages in the project manager and recompile. If not, please contact the author saying where and how this problem occured."; + g_sludge->fatalInfo = "There's an error with this SLUDGE game! If you're designing this game, please turn on verbose error messages in the project manager and recompile. If not, please contact the author saying where and how this problem occured."; } int inFatal(const Common::String &str) { @@ -84,8 +81,8 @@ int checkNew(const void *mem) { } void setFatalInfo(const Common::String &userFunc, const Common::String &BIF) { - fatalInfo = "Currently in this sub: " + userFunc + "\nCalling: " + BIF; - debug(kSludgeDebugFatal, "%s", fatalInfo.c_str()); + g_sludge->fatalInfo = "Currently in this sub: " + userFunc + "\nCalling: " + BIF; + debug(kSludgeDebugFatal, "%s", g_sludge->fatalInfo.c_str()); } void setResourceForFatal(int n) { @@ -95,10 +92,10 @@ void setResourceForFatal(int n) { int fatal(const Common::String &str1) { if (numResourceNames && resourceForFatal != -1) { Common::String r = resourceNameFromNum(resourceForFatal); - Common::String newStr = fatalInfo + "\nResource: " + r + "\n\n" + str1; + Common::String newStr = g_sludge->fatalInfo + "\nResource: " + r + "\n\n" + str1; inFatal(newStr); } else { - Common::String newStr = fatalInfo + "\n\n" + str1; + Common::String newStr = g_sludge->fatalInfo + "\n\n" + str1; inFatal(newStr); } return 0; |