aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/script.h
diff options
context:
space:
mode:
authorMartin Kiewitz2015-05-04 21:19:05 +0200
committerMartin Kiewitz2015-05-04 21:19:05 +0200
commited7007162a092e4b9e3d9306b078af5a8984cad0 (patch)
tree466c6b93adb5ee00550ee428e188896ae655b2a9 /engines/sci/engine/script.h
parent3d0c691694ddcf00a5bfc347626d38625f057dee (diff)
downloadscummvm-rg350-ed7007162a092e4b9e3d9306b078af5a8984cad0.tar.gz
scummvm-rg350-ed7007162a092e4b9e3d9306b078af5a8984cad0.tar.bz2
scummvm-rg350-ed7007162a092e4b9e3d9306b078af5a8984cad0.zip
SCI: Scripts: identify strings + debug command
debug command is called "script_strings" / "scrs"
Diffstat (limited to 'engines/sci/engine/script.h')
-rw-r--r--engines/sci/engine/script.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/engines/sci/engine/script.h b/engines/sci/engine/script.h
index 46d6ace917..fe774aeab5 100644
--- a/engines/sci/engine/script.h
+++ b/engines/sci/engine/script.h
@@ -49,6 +49,13 @@ enum ScriptObjectTypes {
typedef Common::HashMap<uint16, Object> ObjMap;
+struct stringLookupListEntry {
+ uint16 ptrOffset; // offset of the string
+ uint16 stringSize; // size of string, including terminating [NUL]
+};
+
+typedef Common::List<stringLookupListEntry> stringLookupListType;
+
class Script : public SegmentObj {
private:
int _nr; /**< Script number */
@@ -75,6 +82,8 @@ private:
ObjMap _objects; /**< Table for objects, contains property variables */
+ stringLookupListType _stringLookupList; // Table of string data, that is inside the currently loaded script
+
public:
int getLocalsOffset() const { return _localsOffset; }
uint16 getLocalsCount() const { return _localsCount; }
@@ -248,6 +257,11 @@ public:
*/
int getCodeBlockOffsetSci3() { return READ_SCI11ENDIAN_UINT32(_buf); }
+ /**
+ * Print string lookup table (list) to debug console
+ */
+ void debugPrintStrings(Console *con);
+
private:
/**
* Processes a relocation block within a SCI0-SCI2.1 script
@@ -294,6 +308,11 @@ private:
void initializeObjectsSci3(SegManager *segMan, SegmentId segmentId);
LocalVariables *allocLocalsSegment(SegManager *segMan);
+
+ /**
+ * Identifies strings within script data and set up lookup-table
+ */
+ void identifyStrings();
};
} // End of namespace Sci