]> git.localhorst.tv Git - l2e.git/blobdiff - src/loader/Interpreter.h
added interpretation of colors
[l2e.git] / src / loader / Interpreter.h
index ffbad42e1a6ef1e2897305c55a04ad3090e38832..b91e4781d901cefbb4a5dfa446d2c6b6787e1660 100644 (file)
@@ -9,6 +9,7 @@
 #define LOADER_INTERPRETER_H_
 
 #include "../geometry/Vector.h"
+#include "../graphics/Color.h"
 #include "../graphics/ComplexAnimation.h"
 
 #include <map>
@@ -68,6 +69,7 @@ public:
 public:
        graphics::Animation *GetAnimation(const std::string &name);
        bool GetBoolean(const std::string &name) const;
+       const graphics::Color &GetColor(const std::string &name) const;
        graphics::Font *GetFont(const std::string &name);
        graphics::Frame *GetFrame(const std::string &name);
        graphics::Gauge *GetGauge(const std::string &name);
@@ -77,6 +79,7 @@ public:
        battle::Monster *GetMonster(const std::string &name);
        int GetNumber(const std::string &name) const;
        battle::PartyLayout *GetPartyLayout(const std::string &name);
+       const char *GetPath(const std::string &name) const;
        common::Spell *GetSpell(const std::string &name);
        graphics::Sprite *GetSprite(const std::string &name);
        const char *GetString(const std::string &name) const;
@@ -85,6 +88,7 @@ public:
 
 public:
        const std::vector<bool> &Booleans() const { return booleans; }
+       const std::vector<graphics::Color> &Colors() const { return colors; }
        const std::vector<graphics::ComplexAnimation *> &ComplexAnimations() const { return complexAnimations; }
        const std::vector<graphics::Font *> &Fonts() const { return fonts; }
        const std::vector<graphics::Frame *> &Frames() const { return frames; }
@@ -109,6 +113,7 @@ private:
        void ReadObject(const Definition &);
 
        graphics::Animation *GetAnimation(const Value &);
+       graphics::Color GetColor(const Value &);
        bool GetBoolean(const Value &);
        graphics::Font *GetFont(const Value &);
        graphics::Frame *GetFrame(const Value &);
@@ -121,6 +126,7 @@ private:
        battle::PartyLayout *GetPartyLayout(const Value &);
        const PropertyList *GetPropertyList(const Value &);
        const std::vector<PropertyList *> &GetPropertyListArray(const Value &);
+       const char *GetPath(const Value &);
        common::Spell *GetSpell(const Value &);
        graphics::Sprite *GetSprite(const Value &);
        const char *GetString(const Value &);
@@ -148,6 +154,7 @@ private:
        const ParsedSource &source;
        enum Type {
                BOOLEAN,
+               COLOR,
                COMPLEX_ANIMATION,
                FONT,
                FRAME,
@@ -159,6 +166,7 @@ private:
                MONSTER,
                NUMBER,
                PARTY_LAYOUT,
+               PATH,
                PROPERTY_LIST_ARRAY,
                SIMPLE_ANIMATION,
                SPELL,
@@ -177,7 +185,10 @@ private:
        };
        std::map<std::string, ParsedDefinition> parsedDefinitions;
 
+       std::map<std::string, SDL_Surface *> imageCache;
+
        std::vector<bool> booleans;
+       std::vector<graphics::Color> colors;
        std::vector<graphics::ComplexAnimation *> complexAnimations;
        std::vector<graphics::Font *> fonts;
        std::vector<graphics::Frame *> frames;