]> git.localhorst.tv Git - l2e.git/blobdiff - src/loader/ObjectFile.cpp
relocate scripts
[l2e.git] / src / loader / ObjectFile.cpp
index b6ab2b71c57e3724a93b0a5d987ad6ccf9fc1f32..76cc98266c1214b31395a419db68700cea97285a 100644 (file)
@@ -13,10 +13,14 @@ ObjectFileHeader::ObjectFileHeader()
 , exportsEnd(0)
 , externalsBegin(0)
 , externalsEnd(0)
+, imagesBegin(0)
+, imagesEnd(0)
 , objectsBegin(0)
 , objectsEnd(0)
 , arraysBegin(0)
-, arraysEnd(0) {
+, arraysEnd(0)
+, scriptsBegin(0)
+, scriptsEnd(0) {
        ident[0] = 'L';
        ident[1] = '2';
        ident[2] = 'E';
@@ -119,6 +123,16 @@ Array *ObjectFileHeader::ArraysEnd() {
        return reinterpret_cast<Array *>(data + arraysEnd);
 }
 
+Script *ObjectFileHeader::ScriptsBegin() {
+       char *data = reinterpret_cast<char *>(this);
+       return reinterpret_cast<Script *>(data + scriptsBegin);
+}
+
+Script *ObjectFileHeader::ScriptsEnd() {
+       char *data = reinterpret_cast<char *>(this);
+       return reinterpret_cast<Script *>(data + scriptsEnd);
+}
+
 
 char *Object::RawObject() {
        return reinterpret_cast<char *>(this) + sizeof(Object);
@@ -137,4 +151,12 @@ Array *Array::Next() {
        return reinterpret_cast<Array *>(Data() + size);
 }
 
+char *Script::Text() {
+       return reinterpret_cast<char *>(this) + sizeof(Script);
+}
+
+Script *Script::Next() {
+       return reinterpret_cast<Script *>(Text() + size);
+}
+
 }