diff options
Diffstat (limited to '')
-rw-r--r-- | gui/resources.hpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/gui/resources.hpp b/gui/resources.hpp index 69d24279f..83fc7a537 100644 --- a/gui/resources.hpp +++ b/gui/resources.hpp @@ -18,7 +18,6 @@ public: public: std::string GetName() { return mName; } - virtual bool loadedOK() = 0; private: std::string mName; @@ -47,8 +46,6 @@ public: void* GetResource() { return this ? mFont : NULL; } int GetHeight() { return gr_getMaxFontHeight(this ? mFont : NULL); } - virtual bool loadedOK() { return mFont != NULL; } - protected: void* mFont; Type m_type; @@ -65,8 +62,6 @@ public: int GetWidth() { return gr_get_width(this ? mSurface : NULL); } int GetHeight() { return gr_get_height(this ? mSurface : NULL); } - virtual bool loadedOK() { return mSurface != NULL; } - protected: gr_surface mSurface; }; @@ -83,7 +78,6 @@ public: int GetWidth() { return gr_get_width(this ? GetResource() : NULL); } int GetHeight() { return gr_get_height(this ? GetResource() : NULL); } int GetResourceCount() { return mSurfaces.size(); } - virtual bool loadedOK() { return !mSurfaces.empty(); } protected: std::vector<gr_surface> mSurfaces; @@ -92,15 +86,19 @@ protected: class ResourceManager { public: - ResourceManager(xml_node<>* resList, ZipArchive* pZip); + ResourceManager(); virtual ~ResourceManager(); void LoadResources(xml_node<>* resList, ZipArchive* pZip); public: - Resource* FindResource(std::string name); + FontResource* FindFont(const std::string& name) const; + ImageResource* FindImage(const std::string& name) const; + AnimationResource* FindAnimation(const std::string& name) const; private: - std::vector<Resource*> mResources; + std::vector<FontResource*> mFonts; + std::vector<ImageResource*> mImages; + std::vector<AnimationResource*> mAnimations; }; #endif // _RESOURCE_HEADER |