]> git.localhorst.tv Git - l2e.git/blobdiff - src/loader/Compiler.h
relocate scripts
[l2e.git] / src / loader / Compiler.h
index 7afe633afd655db4434aaf283abbb32990785084..d406bbf2c8cbf016873472941c333e961ac65812 100644 (file)
@@ -8,6 +8,8 @@
 #include <iosfwd>
 #include <map>
 #include <memory>
+#include <utility>
+#include <vector>
 #include <SDL.h>
 
 namespace loader {
@@ -32,10 +34,13 @@ private:
        void WriteHeader(std::ostream &);
        void WriteExports(std::ostream &);
        void WriteExternals(std::ostream &);
+       void WriteImages(std::ostream &);
+       void WriteScripts(std::ostream &);
 
        void Relocate(std::iostream &);
        void RelocateArray(char *, int size);
-       void Relocate(char *, const TypeDescription &);
+       void Relocate(unsigned int pos, char *dest, const TypeDescription &);
+       void RelocateScript(char *, unsigned int);
 
        void PrepareExport(Export &, const std::string &);
        void PrepareExternal(External &, const Interpreter::PostponedDefinition &);
@@ -49,11 +54,11 @@ private:
 private:
        const Interpreter &intp;
 
-       unsigned int cursor;
-
        ObjectFileHeader fileHeader;
 
        std::map<const void *, unsigned int> addressMap;
+       std::map<unsigned int, void *> images;
+       std::vector<std::pair<const char *, unsigned int> > scripts;
 
 };