summaryrefslogtreecommitdiff
path: root/bitmap.h
diff options
context:
space:
mode:
authorlordjaxom <lordjaxom>2004-06-18 16:41:02 +0000
committerlordjaxom <lordjaxom>2004-06-18 16:41:02 +0000
commitde602ae6486b181ec081749a510cfcf15c71c817 (patch)
treea6b7efe2b4ad29d6c88b588e8a9b0d7bbeff7c08 /bitmap.h
parent1d3cd38e88ae97dd6906f9818d52b9ef07bf057d (diff)
downloadvdr-plugin-text2skin-de602ae6486b181ec081749a510cfcf15c71c817.tar.gz
vdr-plugin-text2skin-de602ae6486b181ec081749a510cfcf15c71c817.tar.bz2
- reimplemented image cache (fixes segfaults and speeds up image loading)v0.0.6
- fixed a recursion wenn de-initializing ImageMagick (crashes on exit) - reverted the changes in ImageMagick-loader that concerned palettes (obviously some versions of ImageMagick are BROKEN!!! I am using 5.5.7 which works fine. Version 5.4.7 shows random errors) - reimplemented "Flush image cache" into the setup menu - included -lMagick into Makefile as a workaround for Debian (and others possibly) - fixed display of scrollbar
Diffstat (limited to 'bitmap.h')
-rw-r--r--bitmap.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/bitmap.h b/bitmap.h
index 44a3e1b..79c44e7 100644
--- a/bitmap.h
+++ b/bitmap.h
@@ -1,5 +1,5 @@
/*
- * $Id: bitmap.h,v 1.11 2004/06/16 18:46:50 lordjaxom Exp $
+ * $Id: bitmap.h,v 1.12 2004/06/18 16:08:11 lordjaxom Exp $
*/
#ifndef VDR_TEXT2SKIN_BITMAP_H
@@ -9,13 +9,9 @@
#include "cache.h"
#include <vdr/osd.h>
-class cText2SkinBitmap;
-typedef cText2SkinCache<string,cText2SkinBitmap*> cImageCache;
-
class cText2SkinBitmap {
private:
- static cImageCache mCache;
- static bool mFirstTime;
+ static cText2SkinCache mCache;
vector<cBitmap*> mBitmaps;
int mCurrent;
@@ -27,12 +23,14 @@ private:
public:
static cText2SkinBitmap *Load(const char *Filename, int Alpha = 0);
+ static void ResetCache(void) { mCache.Reset(); }
static void FlushCache(void) { mCache.Flush(); }
virtual ~cText2SkinBitmap();
+ void Reset(void) { mCurrent = 0; mLastGet = 0; }
cBitmap &Get(int &UpdateIn);
- void SetColor(int Index, tColor Color) { mBitmaps[mCurrent]->SetColor(Index, Color); }
+ void SetColor(int Index, tColor Color);
void SetAlpha(int Alpha);
bool LoadXpm(const char *Filename, int Alpha);
@@ -44,4 +42,8 @@ public:
#endif
};
+inline void cText2SkinBitmap::SetColor(int Index, tColor Color) {
+ mBitmaps[mCurrent]->SetColor(Index, Color);
+}
+
#endif // VDR_TEXT2SKIN_BITMAP_H