]> git.localhorst.tv Git - l2e.git/blobdiff - src/loader/Compiler.h
extracted object file structure
[l2e.git] / src / loader / Compiler.h
index d2f036115733d2237f8f07508166c7135ff8f92b..ab26cea41e5ed955933c4a20e0598b9f1bbfc146 100644 (file)
@@ -8,6 +8,8 @@
 #ifndef LOADER_COMPILER_H_
 #define LOADER_COMPILER_H_
 
+#include "ObjectFile.h"
+
 #include <iosfwd>
 #include <map>
 #include <memory>
@@ -29,29 +31,6 @@ private:
 public:
        void Write(std::ostream &);
 
-       struct Export {
-               int nameOffset;
-               int typeId;
-               int dataOffset;
-       };
-
-       struct External {
-               int nameOffset;
-               int referenceOffset;
-               int inlined;
-       };
-
-       struct ImageProperties {
-               Uint32 flags;
-               int width;
-               int height;
-               int depth;
-               Uint32 rmask;
-               Uint32 gmask;
-               Uint32 bmask;
-               Uint32 amask;
-       };
-
 private:
        void WriteHeader(std::ostream &);
        void WriteExports(std::ostream &);
@@ -67,19 +46,14 @@ private:
 
        int ReferenceOffset(int typeId, int objectId, std::ptrdiff_t fieldOffset) const;
        int ObjectOffset(int typeId, int objectId) const;
-       int TypeOffset(int typeId) const;
+       int GetTypeOffset(int typeId) const;
 
 private:
        const Interpreter &intp;
 
        int cursor;
 
-       int exportsOffset;
-       int externalsOffset;
-       int externalStringsOffset;
-       int exportStringsOffset;
-       int imagesOffset;
-       int objectsOffset;
+       ObjectFileHeader fileHeader;
 
        std::map<int, int> objectOffsets;