X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Floader%2FInterpreter.h;h=3e9f661e56ccb53da7f5637315c5b1f5e5b9e1a4;hb=8c8061a4f8b88410d6d93c039afe6affc4b69cf2;hp=1a73d2dce69c54591354a2ae09fdd9234d03df91;hpb=0f30d8254ff8b9e63795960ec031577cf68fbf95;p=l2e.git diff --git a/src/loader/Interpreter.h b/src/loader/Interpreter.h index 1a73d2d..3e9f661 100644 --- a/src/loader/Interpreter.h +++ b/src/loader/Interpreter.h @@ -59,6 +59,7 @@ public: /// Error is thrown if the object is undefined or a cast /// was unsuccessful. void *GetObject(int typeId, const std::string &name); + const void *GetObject(int typeId, const std::string &name) const; /// Register the type descriptions of builtin types. /// This should be called before any interpretation (like @@ -80,18 +81,21 @@ public: /// linked by its identifier. struct PostponedDefinition { PostponedDefinition( + char *object, char *dest, - const char *identifier, + const std::string &identifier, int type, bool inlined, bool aggregate) - : dest(dest) + : object(object) + , dest(dest) , identifier(identifier) , type(type) , inlined(inlined) , aggregate(aggregate) { } + char *object; char *dest; - const char *identifier; + std::string identifier; int type; bool inlined; bool aggregate; @@ -104,6 +108,7 @@ public: } /// Get the object definition for given identifier. const ParsedDefinition &GetDefinition(const std::string &identifier); + const ParsedDefinition &GetDefinition(const std::string &identifier) const; /// Get all images reference by he source. /// The returned map is indexed by filenames relative to /// the source file and contains ready-to-blit surfaces. @@ -119,6 +124,14 @@ public: const std::map > &Values() const { return values; } + struct Array { + void *data; + unsigned int size; + bool ref; + }; + const std::vector &Arrays() const { + return arrays; + } private: /// Interpret given definition. @@ -169,6 +182,7 @@ private: bool CanLink(const Value &) const; /// Defer linking of given object reference. void Postpone( + char *object, char *dest, const std::string &identifier, int type, @@ -184,6 +198,7 @@ private: std::vector postponedDefinitions; std::map imageCache; std::map > values; + std::vector arrays; };