aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/script.h
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/engine/script.h')
-rw-r--r--engines/sci/engine/script.h26
1 files changed, 20 insertions, 6 deletions
diff --git a/engines/sci/engine/script.h b/engines/sci/engine/script.h
index fe774aeab5..3f24bb191b 100644
--- a/engines/sci/engine/script.h
+++ b/engines/sci/engine/script.h
@@ -49,12 +49,20 @@ enum ScriptObjectTypes {
typedef Common::HashMap<uint16, Object> ObjMap;
-struct stringLookupListEntry {
- uint16 ptrOffset; // offset of the string
+enum ScriptOffsetEntryTypes {
+ SCI_SCR_OFFSET_TYPE_OBJECT = 0, // classes are handled by this type as well
+ SCI_SCR_OFFSET_TYPE_STRING,
+ SCI_SCR_OFFSET_TYPE_SAID
+};
+
+struct offsetLookupArrayEntry {
+ uint16 type; // type of entry
+ uint16 id; // id of this type, first item inside script data is 1, second item is 2, etc.
+ uint32 offset; // offset of entry within script resource data
uint16 stringSize; // size of string, including terminating [NUL]
};
-typedef Common::List<stringLookupListEntry> stringLookupListType;
+typedef Common::Array<offsetLookupArrayEntry> offsetLookupArrayType;
class Script : public SegmentObj {
private:
@@ -82,7 +90,8 @@ private:
ObjMap _objects; /**< Table for objects, contains property variables */
- stringLookupListType _stringLookupList; // Table of string data, that is inside the currently loaded script
+protected:
+ offsetLookupArrayType _offsetLookupArray; // Table of all elements of currently loaded script, that may get pointed to
public:
int getLocalsOffset() const { return _localsOffset; }
@@ -258,6 +267,11 @@ public:
int getCodeBlockOffsetSci3() { return READ_SCI11ENDIAN_UINT32(_buf); }
/**
+ * Get the offset array
+ */
+ const offsetLookupArrayType *getOffsetArray() { return &_offsetLookupArray; };
+
+ /**
* Print string lookup table (list) to debug console
*/
void debugPrintStrings(Console *con);
@@ -310,9 +324,9 @@ private:
LocalVariables *allocLocalsSegment(SegManager *segMan);
/**
- * Identifies strings within script data and set up lookup-table
+ * Identifies certain offsets within script data and set up lookup-table
*/
- void identifyStrings();
+ void identifyOffsets();
};
} // End of namespace Sci