diff options
author | Matthew Hoops | 2010-07-18 00:16:19 +0000 |
---|---|---|
committer | Matthew Hoops | 2010-07-18 00:16:19 +0000 |
commit | c128b87c779ab74deb494c48782fc8199c9672a5 (patch) | |
tree | d3e65cf79bc04a847f3d0ac6077cbe9b63ace89c /engines/sci/engine/kscripts.cpp | |
parent | cd0997368cfc9f272888a96e80b1f4cc2379d0bc (diff) | |
download | scummvm-rg350-c128b87c779ab74deb494c48782fc8199c9672a5.tar.gz scummvm-rg350-c128b87c779ab74deb494c48782fc8199c9672a5.tar.bz2 scummvm-rg350-c128b87c779ab74deb494c48782fc8199c9672a5.zip |
In SCI2.1, the type numbers inside resource maps/patches have changed slightly. We no longer use the number Sierra gives us directly, but use a function to convert to our ResourceType enum based on version. This allows us to read the chunk type from SCI2.1 (a form of script). Also, allow debugging of Mac-specific resources from the console.
svn-id: r50973
Diffstat (limited to 'engines/sci/engine/kscripts.cpp')
-rw-r--r-- | engines/sci/engine/kscripts.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp index 029943b070..0286f7454a 100644 --- a/engines/sci/engine/kscripts.cpp +++ b/engines/sci/engine/kscripts.cpp @@ -38,7 +38,7 @@ namespace Sci { // Loads arbitrary resources of type 'restype' with resource numbers 'resnrs' // This implementation ignores all resource numbers except the first one. reg_t kLoad(EngineState *s, int argc, reg_t *argv) { - ResourceType restype = (ResourceType)(argv[0].toUint16() & 0x7f); + ResourceType restype = g_sci->getResMan()->convertResType(argv[0].toUint16()); int resnr = argv[1].toUint16(); // Request to dynamically allocate hunk memory for later use @@ -53,7 +53,7 @@ reg_t kLoad(EngineState *s, int argc, reg_t *argv) { // 1 or 3+ parameters is not right according to sierra sci reg_t kUnLoad(EngineState *s, int argc, reg_t *argv) { if (argc >= 2) { - ResourceType restype = (ResourceType)(argv[0].toUint16() & 0x7f); + ResourceType restype = g_sci->getResMan()->convertResType(argv[0].toUint16()); reg_t resnr = argv[1]; // WORKAROUND for a broken script in room 320 in Castle of Dr. Brain. @@ -73,7 +73,7 @@ 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 = (ResourceType)(argv[0].toUint16() & 0x7f); + ResourceType type = g_sci->getResMan()->convertResType(argv[0].toUint16()); ResourceId id = ResourceId(type, argv[1].toUint16()); Resource *which; @@ -115,7 +115,7 @@ reg_t kLock(EngineState *s, int argc, reg_t *argv) { reg_t kResCheck(EngineState *s, int argc, reg_t *argv) { Resource *res = NULL; - ResourceType restype = (ResourceType)(argv[0].toUint16() & 0x7f); + ResourceType restype = g_sci->getResMan()->convertResType(argv[0].toUint16()); if (restype == kResourceTypeVMD) { char fileName[10]; |