aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/kscripts.cpp
diff options
context:
space:
mode:
authorColin Snover2017-06-07 13:34:42 -0500
committerColin Snover2017-06-09 22:48:15 -0500
commit095226a614be5f1d4d3d8b9b5b03c4127fdb33e2 (patch)
tree345faa21281afa7293aad434cb941216e0d66b92 /engines/sci/engine/kscripts.cpp
parentf0d00caf93b4d329fa39d66740906c317317780c (diff)
downloadscummvm-rg350-095226a614be5f1d4d3d8b9b5b03c4127fdb33e2.tar.gz
scummvm-rg350-095226a614be5f1d4d3d8b9b5b03c4127fdb33e2.tar.bz2
scummvm-rg350-095226a614be5f1d4d3d8b9b5b03c4127fdb33e2.zip
SCI: Lock Audio resource types when digital SFX is enabled
This seems to have been added in SCI1.1 and continued through SCI32; older games with digital SFX (like KQ5CD) did not convert the resource type in kLock. This is not known to fix any problem, but was a noted difference in the implementation between ScummVM and SSCI.
Diffstat (limited to 'engines/sci/engine/kscripts.cpp')
-rw-r--r--engines/sci/engine/kscripts.cpp6
1 files changed, 5 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;