summaryrefslogtreecommitdiffstats
path: root/gui/resources.hpp
diff options
context:
space:
mode:
authorthat <github@that.at>2015-03-04 22:39:34 +0100
committerEthan Yonker <dees_troy@teamw.in>2015-03-11 13:21:37 +0100
commit74ac6060ccb68e6ae80dbcb44d11f07a17e26034 (patch)
tree292c86e0888392da8f4a73d97f750e0d732a4dc2 /gui/resources.hpp
parentgui: make scroll bars smaller and transparent (diff)
downloadandroid_bootable_recovery-74ac6060ccb68e6ae80dbcb44d11f07a17e26034.tar
android_bootable_recovery-74ac6060ccb68e6ae80dbcb44d11f07a17e26034.tar.gz
android_bootable_recovery-74ac6060ccb68e6ae80dbcb44d11f07a17e26034.tar.bz2
android_bootable_recovery-74ac6060ccb68e6ae80dbcb44d11f07a17e26034.tar.lz
android_bootable_recovery-74ac6060ccb68e6ae80dbcb44d11f07a17e26034.tar.xz
android_bootable_recovery-74ac6060ccb68e6ae80dbcb44d11f07a17e26034.tar.zst
android_bootable_recovery-74ac6060ccb68e6ae80dbcb44d11f07a17e26034.zip
Diffstat (limited to '')
-rw-r--r--gui/resources.hpp16
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