aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/script.cpp
diff options
context:
space:
mode:
authorSven Hesse2009-06-23 23:55:35 +0000
committerSven Hesse2009-06-23 23:55:35 +0000
commit82f1ebcafed7e565ac4dce610f7bc098f45ee67d (patch)
treee90eb9b36ffdc1f699bafb3b52bf2793892f16f1 /engines/gob/script.cpp
parent04d4ce4a8be24bde70933c7e4a1dc41f374a75ad (diff)
downloadscummvm-rg350-82f1ebcafed7e565ac4dce610f7bc098f45ee67d.tar.gz
scummvm-rg350-82f1ebcafed7e565ac4dce610f7bc098f45ee67d.tar.bz2
scummvm-rg350-82f1ebcafed7e565ac4dce610f7bc098f45ee67d.zip
Putting TOT filename generation and LOM checking into TOTFile
svn-id: r41822
Diffstat (limited to 'engines/gob/script.cpp')
-rw-r--r--engines/gob/script.cpp25
1 files changed, 4 insertions, 21 deletions
diff --git a/engines/gob/script.cpp b/engines/gob/script.cpp
index c41da6cc2c..2cb719db26 100644
--- a/engines/gob/script.cpp
+++ b/engines/gob/script.cpp
@@ -319,33 +319,16 @@ char *Script::getResultStr() const {
return _expression->getResultStr();
}
-bool Script::load(const char *fileName) {
+bool Script::load(const Common::String &fileName) {
unload();
_finished = false;
- bool lom = false;
+ bool isLOM;
- Common::String *fileBase;
+ _totFile = TOTFile::createFileName(fileName, isLOM);
- const char *dot;
- if ((dot = strrchr(fileName, '.'))) {
- // fileName includes an extension
-
- fileBase = new Common::String(fileName, dot);
-
- // Is it a LOM file?
- if (!scumm_stricmp(dot + 1, "LOM"))
- lom = true;
- } else
- fileBase = new Common::String(fileName);
-
- // If it's a LOM file, it includes the TOT file
- _totFile = *fileBase + (lom ? ".lom" : ".tot");
-
- delete fileBase;
-
- if (lom) {
+ if (isLOM) {
if (!loadLOM(_totFile)) {
unload();
return false;