From de602ae6486b181ec081749a510cfcf15c71c817 Mon Sep 17 00:00:00 2001 From: lordjaxom Date: Fri, 18 Jun 2004 16:41:02 +0000 Subject: - reimplemented image cache (fixes segfaults and speeds up image loading) - 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 --- bitmap.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'bitmap.h') 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 -class cText2SkinBitmap; -typedef cText2SkinCache cImageCache; - class cText2SkinBitmap { private: - static cImageCache mCache; - static bool mFirstTime; + static cText2SkinCache mCache; vector 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 -- cgit v1.2.3