diff options
author | louis <louis.braun@gmx.de> | 2013-09-30 06:00:55 +0200 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2013-09-30 06:00:55 +0200 |
commit | 8eeae278b54410f03410105c5621bd690523f61c (patch) | |
tree | f4d8638ce95e3e2a48f592740d7feb873cffebfb | |
parent | 301b8ff21bccd136e48f2a63f943d69a9ef9c67f (diff) | |
download | skin-nopacity-8eeae278b54410f03410105c5621bd690523f61c.tar.gz skin-nopacity-8eeae278b54410f03410105c5621bd690523f61c.tar.bz2 |
fixed a bug if DisplayMenu is called before image cache is completely initialised
-rw-r--r-- | imagecache.c | 5 | ||||
-rw-r--r-- | imagecache.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/imagecache.c b/imagecache.c index 452a942..4dc6507 100644 --- a/imagecache.c +++ b/imagecache.c @@ -6,6 +6,7 @@ using namespace Magick; cImageCache::cImageCache() : cImageMagickWrapper() { + initComplete = false; osdTheme = Setup.OSDTheme; } @@ -83,6 +84,8 @@ cImage *cImageCache::GetSkinIcon(std::string name, int width, int height, bool p } cImage *cImageCache::GetBackground(eBackgroundType type) { + if (!initComplete) + return NULL; try { return backgroundImages[(int)type]; } catch (...) { @@ -289,6 +292,8 @@ void cImageCache::CreateBackgroundImages(void) { bool mirrorHeader = (config.menuAdjustLeft) ? false : true; CreateBackground(Theme.Color(clrMenuHeaderBlend), Theme.Color(clrMenuHeader), geoManager->osdWidth, geoManager->menuHeaderHeight, mirrorHeader); backgroundImages.push_back(CreateImage()); + + initComplete = true; } void cImageCache::Clear(void) { diff --git a/imagecache.h b/imagecache.h index 4977c3e..eb91d0d 100644 --- a/imagecache.h +++ b/imagecache.h @@ -57,6 +57,7 @@ public: cImage *GetBackground(eBackgroundType type); cImage GetBackground(tColor back, tColor blend, int width, int height, bool flip = false); private: + bool initComplete; std::string osdTheme; std::map<std::string, cImage*> menuIconCache; std::map<std::string, cImage*> skinIconCache; |