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/resource.h | |
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/resource.h')
-rw-r--r-- | engines/sci/resource.h | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/engines/sci/resource.h b/engines/sci/resource.h index f66b5b3956..d7acf3b9d6 100644 --- a/engines/sci/resource.h +++ b/engines/sci/resource.h @@ -95,22 +95,21 @@ enum ResourceType { kResourceTypeHeap, kResourceTypeAudio36, kResourceTypeSync36, - kResourceTypeUnknown1, // Translation, currently unsupported - kResourceTypeUnknown2, + kResourceTypeTranslation, // Currently unsupported kResourceTypeRobot, kResourceTypeVMD, - kResourceTypeInvalid, + kResourceTypeChunk, - // Mac-only resources, these resource types are self-defined - // Numbers subject to change - kResourceTypeMacIconBarPictN = -1, // IBIN resources (icon bar, not selected) - kResourceTypeMacIconBarPictS = -2, // IBIS resources (icon bar, selected) - kResourceTypeMacPict = -3 // PICT resources (inventory) + // Mac-only resources + kResourceTypeMacIconBarPictN, // IBIN resources (icon bar, not selected) + kResourceTypeMacIconBarPictS, // IBIS resources (icon bar, selected) + kResourceTypeMacPict, // PICT resources (inventory) + + kResourceTypeInvalid }; const char *getResourceTypeName(ResourceType restype); - enum ResVersion { kResVersionUnknown, kResVersionSci0Sci1Early, @@ -126,7 +125,7 @@ class ResourceSource; class ResourceId { static inline ResourceType fixupType(ResourceType type) { - if (type < kResourceTypeMacPict || type > kResourceTypeInvalid) + if (type == kResourceTypeInvalid) return kResourceTypeInvalid; return type; } @@ -344,6 +343,13 @@ public: */ reg_t findGameObject(bool addSci11ScriptOffset = true); + /** + * Converts a map resource type to our type + * @param sciType The type from the map/patch + * @return The ResourceType + */ + ResourceType convertResType(byte type); + protected: // Maximum number of bytes to allow being allocated for resources // Note: maxMemory will not be interpreted as a hard limit, only as a restriction |