diff options
author | Sven Hesse | 2011-08-26 09:17:51 +0200 |
---|---|---|
committer | Sven Hesse | 2011-08-26 09:17:51 +0200 |
commit | cdc86c6f67c62f2c9db05501f7e31cd257952566 (patch) | |
tree | 4df85e23283d53f41f3abff003b198a5a5b35101 | |
parent | 8fd8c913af7536781a8a59bb27006b3f54087aa8 (diff) | |
download | scummvm-rg350-cdc86c6f67c62f2c9db05501f7e31cd257952566.tar.gz scummvm-rg350-cdc86c6f67c62f2c9db05501f7e31cd257952566.tar.bz2 scummvm-rg350-cdc86c6f67c62f2c9db05501f7e31cd257952566.zip |
GOB: Add oGeisha_checkData
-rw-r--r-- | engines/gob/inter.h | 1 | ||||
-rw-r--r-- | engines/gob/inter_geisha.cpp | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/engines/gob/inter.h b/engines/gob/inter.h index f229478301..84180f407d 100644 --- a/engines/gob/inter.h +++ b/engines/gob/inter.h @@ -347,6 +347,7 @@ protected: void oGeisha_loadCursor(OpFuncParams ¶ms); void oGeisha_goblinFunc(OpFuncParams ¶ms); void oGeisha_loadSound(OpFuncParams ¶ms); + void oGeisha_checkData(OpFuncParams ¶ms); void oGeisha_gamePenetration(OpGobParams ¶ms); void oGeisha_gameDiving(OpGobParams ¶ms); diff --git a/engines/gob/inter_geisha.cpp b/engines/gob/inter_geisha.cpp index 3f79088ac8..658f2346f4 100644 --- a/engines/gob/inter_geisha.cpp +++ b/engines/gob/inter_geisha.cpp @@ -53,6 +53,7 @@ void Inter_Geisha::setupOpcodesFunc() { OPCODEFUNC(0x03, oGeisha_loadCursor); OPCODEFUNC(0x25, oGeisha_goblinFunc); OPCODEFUNC(0x3A, oGeisha_loadSound); + OPCODEFUNC(0x3F, oGeisha_checkData); OPCODEGOB(0, oGeisha_gamePenetration); OPCODEGOB(1, oGeisha_gameDiving); @@ -112,6 +113,23 @@ int16 Inter_Geisha::loadSound(int16 slot) { return 0; } +void Inter_Geisha::oGeisha_checkData(OpFuncParams ¶ms) { + const char *file = _vm->_game->_script->evalString(); + int16 varOff = _vm->_game->_script->readVarIndex(); + + Common::String fileName(file); + + fileName.toLowercase(); + if (fileName.hasSuffix(".0ot")) + fileName.setChar('t', fileName.size() - 3); + + if (!_vm->_dataIO->hasFile(fileName)) { + warning("File \"%s\" not found", fileName.c_str()); + WRITE_VAR_OFFSET(varOff, (uint32) -1); + } else + WRITE_VAR_OFFSET(varOff, 50); // "handle" between 50 and 128 = in archive +} + void Inter_Geisha::oGeisha_gamePenetration(OpGobParams ¶ms) { uint16 var1 = _vm->_game->_script->readUint16(); uint16 var2 = _vm->_game->_script->readUint16(); |