diff options
author | Colin Snover | 2017-01-02 16:59:06 -0600 |
---|---|---|
committer | Colin Snover | 2017-01-02 17:02:31 -0600 |
commit | a91b432cdbd97b1fde73dae2b67bd2b6b4ef6257 (patch) | |
tree | d9f0ca2ea6b7c2c52250fdfb9e53c100f940d4f1 /engines/sci/engine/kscripts.cpp | |
parent | 3be2025a5e5b029fc5e4a26a221ac8383efb587f (diff) | |
download | scummvm-rg350-a91b432cdbd97b1fde73dae2b67bd2b6b4ef6257.tar.gz scummvm-rg350-a91b432cdbd97b1fde73dae2b67bd2b6b4ef6257.tar.bz2 scummvm-rg350-a91b432cdbd97b1fde73dae2b67bd2b6b4ef6257.zip |
SCI32: Load VMDs from resource bundles
GK2 includes some VMDs in the RESSCI.00n volume bundles for the
chase scene at the end of Chapter 6.
Diffstat (limited to 'engines/sci/engine/kscripts.cpp')
-rw-r--r-- | engines/sci/engine/kscripts.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp index 0e29ccf783..77ef92b349 100644 --- a/engines/sci/engine/kscripts.cpp +++ b/engines/sci/engine/kscripts.cpp @@ -102,15 +102,9 @@ reg_t kLock(EngineState *s, int argc, reg_t *argv) { } reg_t kResCheck(EngineState *s, int argc, reg_t *argv) { - Resource *res = NULL; + Resource *res = nullptr; ResourceType restype = g_sci->getResMan()->convertResType(argv[0].toUint16()); - if (restype == kResourceTypeVMD) { - char fileName[10]; - sprintf(fileName, "%d.vmd", argv[1].toUint16()); - return make_reg(0, Common::File::exists(fileName)); - } - if ((restype == kResourceTypeAudio36) || (restype == kResourceTypeSync36)) { if (argc >= 6) { uint noun = argv[2].toUint16() & 0xff; @@ -124,7 +118,16 @@ reg_t kResCheck(EngineState *s, int argc, reg_t *argv) { res = g_sci->getResMan()->testResource(ResourceId(restype, argv[1].toUint16())); } - return make_reg(0, res != NULL); +#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)); + } +#endif + + return make_reg(0, res != nullptr); } reg_t kClone(EngineState *s, int argc, reg_t *argv) { |