diff options
author | mataes2007 <mataes2007@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb> | 2011-11-26 15:41:10 +0000 |
---|---|---|
committer | mataes2007 <mataes2007@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb> | 2011-11-26 15:41:10 +0000 |
commit | f04d64869f3b1de54fb343f28f955584780001b8 (patch) | |
tree | 5453dc10de3d980de79ffe019fa0b5fcb692a27d /skinengine/src/bitmap_cache.cpp | |
parent | 7aff1e4cb053394db57c2814d5fe1e6493e0cc75 (diff) |
Project folders rename part 3
git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@215 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb
Diffstat (limited to 'skinengine/src/bitmap_cache.cpp')
-rw-r--r-- | skinengine/src/bitmap_cache.cpp | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/skinengine/src/bitmap_cache.cpp b/skinengine/src/bitmap_cache.cpp deleted file mode 100644 index 5c4eab8..0000000 --- a/skinengine/src/bitmap_cache.cpp +++ /dev/null @@ -1,53 +0,0 @@ -#include "headers.h"
-
-CBitmapCache g_BitmapCache;
-
-CBitmapCache::CBitmapCache(): m_cache(5, CacheNode::cmp)
-{
-}
-
-CBitmapCache::~CBitmapCache()
-{
- for (int i = 0; i < m_cache.getCount(); ++i)
- {
- delete m_cache[i].bitmap;
- free(m_cache[i].path);
- }
-}
-
-HBITMAP CBitmapCache::LoadBitmap(const TCHAR *path)
-{
- CacheNode search = {0};
- search.path = (TCHAR *)path;
- CacheNode *newNode = m_cache.find(&search);
- if (newNode)
- {
- newNode->refCount++;
- return newNode->bitmap;
- }
-
- newNode = new CacheNode;
- newNode->path = _tcsdup(path);
- char *s = mir_t2a(path);
- newNode->bitmap = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)s);
- mir_free(s);
- newNode->refCount = 1;
- m_cache.insert(newNode);
-
- return newNode->bitmap;
-}
-
-void CBitmapCache::UnloadBitmap(HBITMAP bmp)
-{
- for (int i = 0; i < m_cache.getCount(); ++i)
- if (m_cache[i].bitmap == bmp)
- {
- if (--m_cache[i].refCount == 0)
- {
- DeleteObject(m_cache[i].bitmap);
- free(m_cache[i].path);
- m_cache.remove(i);
- }
- return;
- }
-}
|