diff options
-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; |