diff options
author | Martin Kiewitz | 2015-05-14 20:33:21 +0200 |
---|---|---|
committer | Martin Kiewitz | 2015-05-14 20:33:21 +0200 |
commit | bfab4c4cbe3d857ef6a067440ea17baa8b30ec4d (patch) | |
tree | 39101ed09bdb030013425ae96e39ec99785df7e5 /engines/sci/engine/script.h | |
parent | fdfb7775a49ec6b93cbaa720b88fee37e052a86c (diff) | |
download | scummvm-rg350-bfab4c4cbe3d857ef6a067440ea17baa8b30ec4d.tar.gz scummvm-rg350-bfab4c4cbe3d857ef6a067440ea17baa8b30ec4d.tar.bz2 scummvm-rg350-bfab4c4cbe3d857ef6a067440ea17baa8b30ec4d.zip |
SCI: debug commands scro, scrs and script_said
implement string collecting for SCI3
implement object offset collecting for SCI0-SCI2
implement said-str offset collecting for SCI0-SCI1
add new debug command scro / script_objects
add new debug command script_said
string without terminating NUL now a warning
the latter happens in qfg2 for amiga room 84
Diffstat (limited to 'engines/sci/engine/script.h')
-rw-r--r-- | engines/sci/engine/script.h | 26 |
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 |