diff options
author | Colin Snover | 2017-01-02 23:30:35 -0600 |
---|---|---|
committer | Colin Snover | 2017-03-30 19:46:27 -0500 |
commit | 766d46153a285794d573d84d237aac3821431a01 (patch) | |
tree | 5d85232e856175fc20c4990ad48bf06a9db3d490 /engines/sci/engine/kscripts.cpp | |
parent | 65fe7bcfd8431888d9fdf345759bad1a78c455b7 (diff) | |
download | scummvm-rg350-766d46153a285794d573d84d237aac3821431a01.tar.gz scummvm-rg350-766d46153a285794d573d84d237aac3821431a01.tar.bz2 scummvm-rg350-766d46153a285794d573d84d237aac3821431a01.zip |
SCI32: Implement known-used portions of kPlayDuck
Diffstat (limited to 'engines/sci/engine/kscripts.cpp')
-rw-r--r-- | engines/sci/engine/kscripts.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp index 77ef92b349..7c4c955824 100644 --- a/engines/sci/engine/kscripts.cpp +++ b/engines/sci/engine/kscripts.cpp @@ -119,11 +119,28 @@ reg_t kResCheck(EngineState *s, int argc, reg_t *argv) { } #ifdef ENABLE_SCI32 - // GK2 stores some VMDs inside of resource volumes, but usually they are - // streamed from the filesystem - if (res == nullptr && restype == kResourceTypeVMD) { - const Common::String fileName = Common::String::format("%u.vmd", argv[1].toUint16()); - return make_reg(0, Common::File::exists(fileName)); + // GK2 stores some VMDs inside of resource volumes, but usually videos are + // streamed from the filesystem. + if (res == nullptr) { + const char *format = nullptr; + switch (restype) { + case kResourceTypeRobot: + format = "%u.rbt"; + break; + case kResourceTypeDuck: + format = "%u.duk"; + break; + case kResourceTypeVMD: + format = "%u.vmd"; + break; + default: + format = nullptr; + } + + if (format) { + const Common::String fileName = Common::String::format(format, argv[1].toUint16()); + return make_reg(0, Common::File::exists(fileName)); + } } #endif |