summaryrefslogtreecommitdiff
path: root/skinengine/src/bitmap_cache.h
diff options
context:
space:
mode:
Diffstat (limited to 'skinengine/src/bitmap_cache.h')
-rw-r--r--skinengine/src/bitmap_cache.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/skinengine/src/bitmap_cache.h b/skinengine/src/bitmap_cache.h
new file mode 100644
index 0000000..3cf4893
--- /dev/null
+++ b/skinengine/src/bitmap_cache.h
@@ -0,0 +1,32 @@
+#ifndef bitmap_cache_h__
+#define bitmap_cache_h__
+
+class CMyBitmap;
+
+class CBitmapCache
+{
+private:
+ struct CacheNode
+ {
+ TCHAR *path;
+ HBITMAP bitmap;
+ int refCount;
+
+ static int cmp(const CacheNode *p1, const CacheNode *p2)
+ {
+ return lstrcmp(p1->path, p2->path);
+ }
+ };
+ OBJLIST<CacheNode> m_cache;
+
+public:
+ CBitmapCache();
+ ~CBitmapCache();
+ HBITMAP LoadBitmap(const TCHAR *path);
+ void UnloadBitmap(HBITMAP);
+};
+
+// The only instance
+extern CBitmapCache g_BitmapCache;
+
+#endif // bitmap_cache_h__