diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/kscripts.cpp | 6 | ||||
-rw-r--r-- | engines/sci/sound/soundcmd.h | 7 |
2 files changed, 12 insertions, 1 deletions
diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp index c04de525f0..3dba4b127d 100644 --- a/engines/sci/engine/kscripts.cpp +++ b/engines/sci/engine/kscripts.cpp @@ -61,7 +61,11 @@ reg_t kUnLoad(EngineState *s, int argc, reg_t *argv) { reg_t kLock(EngineState *s, int argc, reg_t *argv) { int state = argc > 2 ? argv[2].toUint16() : 1; ResourceType type = g_sci->getResMan()->convertResType(argv[0].toUint16()); - ResourceId id = ResourceId(type, argv[1].toUint16()); + if (type == kResourceTypeSound && getSciVersion() >= SCI_VERSION_1_1) { + type = g_sci->_soundCmd->getSoundResourceType(argv[1].toUint16()); + } + + const ResourceId id(type, argv[1].toUint16()); Resource *which; diff --git a/engines/sci/sound/soundcmd.h b/engines/sci/sound/soundcmd.h index 928c9b1acb..cac3ff794b 100644 --- a/engines/sci/sound/soundcmd.h +++ b/engines/sci/sound/soundcmd.h @@ -72,6 +72,13 @@ public: MusicType getMusicType() const; + ResourceType getSoundResourceType(const uint16 resourceNo) const { + if (_useDigitalSFX && _resMan->testResource(ResourceId(kResourceTypeAudio, resourceNo))) + return kResourceTypeAudio; + else + return kResourceTypeSound; + } + /** * Synchronizes the current state of the music list to the rest of the engine, so that * the changes that the sound thread makes to the music are registered with the engine |