summaryrefslogtreecommitdiff
path: root/libcore/imagecache.c
diff options
context:
space:
mode:
authorManuel Reimer <manuel.reimer@gmx.de>2014-10-30 21:07:26 +0100
committerManuel Reimer <manuel.reimer@gmx.de>2014-10-30 21:07:26 +0100
commitf17af1f7136fb38cee6898dab514dd33f9363b4d (patch)
tree13a95bc933d005a85228a1ceddc8c5ce0d72d692 /libcore/imagecache.c
parent94542945595f39866f868181f79583d20a019d1f (diff)
downloadvdr-plugin-skindesigner-f17af1f7136fb38cee6898dab514dd33f9363b4d.tar.gz
vdr-plugin-skindesigner-f17af1f7136fb38cee6898dab514dd33f9363b4d.tar.bz2
Added SVG rendering support
Diffstat (limited to 'libcore/imagecache.c')
-rw-r--r--libcore/imagecache.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/libcore/imagecache.c b/libcore/imagecache.c
index 7c96438..62691e6 100644
--- a/libcore/imagecache.c
+++ b/libcore/imagecache.c
@@ -311,18 +311,17 @@ cImage *cImageCache::GetSkinpart(string name, int width, int height) {
}
bool cImageCache::LoadIcon(eImageType type, string name) {
- bool success = false;
cString subdir("");
if (type == itMenuIcon)
subdir = "menuicons";
else if (type == itIcon)
subdir = "icons";
cString subIconPath = cString::sprintf("%s%s/", iconPath.c_str(), *subdir);
- success = LoadImage(name, *subIconPath, "png");
- if (success) {
- return true;
- }
- return false;
+
+ if (FileExists(*subIconPath, name, "svg"))
+ return LoadImage(*subIconPath, name, "svg");
+ else
+ return LoadImage(*subIconPath, name, "png");
}
bool cImageCache::LoadLogo(const cChannel *channel) {
@@ -331,32 +330,27 @@ bool cImageCache::LoadLogo(const cChannel *channel) {
string channelID = StrToLowerCase(*(channel->GetChannelID().ToString()));
string logoLower = StrToLowerCase(channel->Name());
bool success = false;
- success = LoadImage(channelID.c_str(), logoPath.c_str(), *config.logoExtension);
- if (success)
- return true;
- success = LoadImage(logoLower.c_str(), logoPath.c_str(), *config.logoExtension);
- if (success)
- return true;
+
+ if (FileExists(logoPath.c_str(), channelID.c_str(), *config.logoExtension))
+ return LoadImage(logoPath.c_str(), channelID.c_str(), *config.logoExtension);
+
+ if (FileExists(logoPath.c_str(), logoLower.c_str(), *config.logoExtension))
+ return LoadImage(logoPath.c_str(), logoLower.c_str(), *config.logoExtension);
+
return false;
}
bool cImageCache::LoadSeparatorLogo(string name) {
cString separatorPath = cString::sprintf("%sseparatorlogos/", logoPath.c_str());
string nameLower = StrToLowerCase(name.c_str());
- bool success = false;
- success = LoadImage(nameLower.c_str(), *separatorPath, *config.logoExtension);
- if (success)
- return true;
- return false;
+ return LoadImage(*separatorPath, nameLower.c_str(), *config.logoExtension);
}
bool cImageCache::LoadSkinpart(string name) {
- bool success = false;
- success = LoadImage(name, skinPartsPath.c_str(), "png");
- if (success) {
- return true;
- }
- return false;
+ if (FileExists(skinPartsPath.c_str(), name, "svg"))
+ return LoadImage(skinPartsPath.c_str(), name, "svg");
+ else
+ return LoadImage(skinPartsPath.c_str(), name, "png");
}
void cImageCache::Clear(void) {