aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Hesse2011-02-02 19:53:22 +0000
committerSven Hesse2011-02-02 19:53:22 +0000
commitc3e7b03b4632ee82e4744aa2ce9998005a61713b (patch)
treeb72d5a559f1e704b909881fc78fb3ecd94a29f3f
parentc1967c1a0a4ca016b6dceff2a911faba7ace0694 (diff)
downloadscummvm-rg350-c3e7b03b4632ee82e4744aa2ce9998005a61713b.tar.gz
scummvm-rg350-c3e7b03b4632ee82e4744aa2ce9998005a61713b.tar.bz2
scummvm-rg350-c3e7b03b4632ee82e4744aa2ce9998005a61713b.zip
GOB: Add o7_findCDFile
Stubbing that for now svn-id: r55738
-rw-r--r--engines/gob/inter.h3
-rw-r--r--engines/gob/inter_v7.cpp42
2 files changed, 26 insertions, 19 deletions
diff --git a/engines/gob/inter.h b/engines/gob/inter.h
index 3810df9024..07e873c703 100644
--- a/engines/gob/inter.h
+++ b/engines/gob/inter.h
@@ -611,6 +611,7 @@ protected:
void o7_playVmdOrMusic();
void o7_draw0x89();
void o7_findFile();
+ void o7_findCDFile();
void o7_getSystemProperty();
void o7_loadImage();
void o7_setVolume();
@@ -634,6 +635,8 @@ private:
void storeString(uint16 index, uint16 type, const char *value);
void storeString(const char *value);
+
+ Common::String findFile(const Common::String &mask);
};
} // End of namespace Gob
diff --git a/engines/gob/inter_v7.cpp b/engines/gob/inter_v7.cpp
index a25c2079a4..e740c98d5d 100644
--- a/engines/gob/inter_v7.cpp
+++ b/engines/gob/inter_v7.cpp
@@ -61,6 +61,7 @@ void Inter_v7::setupOpcodesDraw() {
OPCODEDRAW(0x83, o7_playVmdOrMusic);
OPCODEDRAW(0x89, o7_draw0x89);
OPCODEDRAW(0x8A, o7_findFile);
+ OPCODEDRAW(0x8B, o7_findCDFile);
OPCODEDRAW(0x8C, o7_getSystemProperty);
OPCODEDRAW(0x90, o7_loadImage);
OPCODEDRAW(0x93, o7_setVolume);
@@ -297,11 +298,7 @@ void Inter_v7::o7_draw0x89() {
warning("Addy Stub Draw 0x89: \"%s\", \"%s\"", str0.c_str(), str1.c_str());
- Common::ArchiveMemberList files;
-
- SearchMan.listMatchingMembers(files, str0);
-
- if (files.empty()) {
+ if (findFile(str0).empty()) {
storeValue(0);
return;
}
@@ -310,22 +307,18 @@ void Inter_v7::o7_draw0x89() {
}
void Inter_v7::o7_findFile() {
- Common::String file = getFile(_vm->_game->_script->evalString());
-
- uint16 pathIndex = _vm->_game->_script->readVarIndex();
+ Common::String file = findFile(getFile(_vm->_game->_script->evalString()));
- Common::ArchiveMemberList files;
+ storeString(file.c_str());
+ storeValue(file.empty() ? 0 : 1);
+}
- SearchMan.listMatchingMembers(files, file);
+void Inter_v7::o7_findCDFile() {
+ Common::String mask = getFile(GET_VARO_STR(_vm->_game->_script->readVarIndex()));
+ Common::String file = findFile(mask);
- if (files.empty()) {
- GET_VARO_STR(pathIndex)[0] = '\0';
- storeValue(0);
- return;
- }
-
- strcpy(GET_VARO_STR(pathIndex), files.front()->getName().c_str());
- storeValue(1);
+ warning("Addy Stub: Find CD file \"%s\"", mask.c_str());
+ storeValue(0);
}
void Inter_v7::o7_getSystemProperty() {
@@ -587,7 +580,7 @@ void Inter_v7::storeString(uint16 index, uint16 type, const char *value) {
void Inter_v7::storeString(const char *value) {
uint16 type;
- int16 varIndex = _vm->_game->_script->readVarIndex(0, &type);
+ uint16 varIndex = _vm->_game->_script->readVarIndex(0, &type);
storeString(varIndex, type, value);
}
@@ -598,4 +591,15 @@ void Inter_v7::o7_gob0x201(OpGobParams &params) {
WRITE_VAR(varIndex, 1);
}
+Common::String Inter_v7::findFile(const Common::String &mask) {
+ Common::ArchiveMemberList files;
+
+ SearchMan.listMatchingMembers(files, mask);
+
+ if (files.empty())
+ return "";
+
+ return files.front()->getName();
+}
+
} // End of namespace Gob