@@ -794,11 +794,14 @@
osd->DrawRectangle(0, 0, osd->Width(), osd->Height(), clrTransparent);
if (fShowLogo) {
+ int logoWidth = (xLogoRight - xLogoLeft);
+ int logoHeight = (yLogoBottom - yLogoTop);
+
// draw logo area
osd->DrawRectangle(xLogoLeft, yLogoTop, xLogoRight - 1, yLogoBottom - 1, Theme.Color(clrLogoBg));
osd->DrawRectangle(xLogoDecoLeft, yLogoTop, xLogoDecoRight - 1, yLogoBottom - 1, Theme.Color(clrLogoBg));
- if (EnigmaLogoCache.LoadChannelLogo(Channel)) {
+ if (EnigmaLogoCache.LoadChannelLogo(Channel,logoWidth,logoHeight)) {
int lw = EnigmaLogoCache.Get().Width();
int lh = EnigmaLogoCache.Get().Height();
osd->DrawBitmap(xLogoLeft + (xLogoRight - xLogoLeft - lw) / 2,
@@ -110,7 +110,7 @@
*name = 0;
}
-bool cEnigmaLogoCache::LoadChannelLogo(const cChannel *Channel)
+bool cEnigmaLogoCache::LoadChannelLogo(const cChannel *Channel, int w, int h)
{
if (Channel == NULL)
return false;
@@ -128,12 +128,12 @@
if (filename != NULL) {
strcpy(filename, "hqlogos/");
strcat(filename, logoname);
- if (!(fFoundLogo = Load(filename, ChannelLogoWidth, ChannelLogoHeight, false))) {
+ if (!(fFoundLogo = Load(filename, w, h, false))) {
strcpy(filename, "logos/");
strcat(filename, logoname);
- if (!(fFoundLogo = Load(filename, ChannelLogoWidth, ChannelLogoHeight, false))) {
+ if (!(fFoundLogo = Load(filename, w, h, false))) {
error("cPluginSkinEnigma::LoadChannelLogo: LOGO \"%s.jpg\" NOT FOUND in %s/[hq]logos", logoname, EnigmaConfig.GetLogoDir());
- fFoundLogo = Load("hqlogos/no_logo", ChannelLogoWidth, ChannelLogoHeight); //TODO? different default logo for channel/group?
+ fFoundLogo = Load("hqlogos/no_logo", w, h); //TODO? different default logo for channel/group?
}
}
free(filename);
@@ -226,14 +226,14 @@
return false;
struct stat stbuf;
- cBitmap *bmp = new cBitmap(1, 1, 8);
+ cBitmap *bmp = new cBitmap(w, h, 8);
// create absolute filename
debug("cPluginSkinEnigma::LoadJpg(%s)", fileNameP);
// check validity
if(lstat(fileNameP, &stbuf) == 0)
{
- DrawImage(fileNameP,0,0,80,80,230,bmp);
+ DrawImage(fileNameP,0,0,w,h,230,bmp);
if ((bmp->Width() <= w) && (bmp->Height() <= h)) {
int numColors;
@@ -50,7 +50,7 @@
bool Resize(unsigned int cacheSizeP);
bool DrawEventImage(const cEvent *Event, int x, int y, int w, int h, int c, cBitmap *bmp);
bool DrawRecordingImage(const cRecording *Recording, int x, int y, int w, int h, int c, cBitmap *bmp);
- bool LoadChannelLogo(const cChannel *Channel);
+ bool LoadChannelLogo(const cChannel *Channel, int w, int h);
bool LoadSymbol(const char *fileNameP);
bool LoadIcon(const char *fileNameP);
cBitmap& Get(void);