summaryrefslogtreecommitdiff
path: root/bitmap.c
diff options
context:
space:
mode:
authorlordjaxom <lordjaxom>2004-06-01 17:27:26 +0000
committerlordjaxom <lordjaxom>2004-06-01 17:27:26 +0000
commit37b57e7872214cc59119faf29bd058362504b3f6 (patch)
tree91ac522daad78b4f6498559845c0c3457fd9061e /bitmap.c
parentb968a310699595ff139278440ae278aebf112c1f (diff)
downloadvdr-plugin-text2skin-37b57e7872214cc59119faf29bd058362504b3f6.tar.gz
vdr-plugin-text2skin-37b57e7872214cc59119faf29bd058362504b3f6.tar.bz2
- fixed some possible segfaults in Display Updatev0.0.1-rc2
- fixed segfault in Timebar when EPG doesn't contain time and duration - fixed "too many colors used in palette" warning (only with HAVE_IMLIB2=1) in channel display - fixed above message in full menu - removed some debug printf's
Diffstat (limited to 'bitmap.c')
-rw-r--r--bitmap.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/bitmap.c b/bitmap.c
index f52576a..a4eebd7 100644
--- a/bitmap.c
+++ b/bitmap.c
@@ -1,5 +1,5 @@
/*
- * $Id: bitmap.c,v 1.3 2004/05/31 19:54:12 lordjaxom Exp $
+ * $Id: bitmap.c,v 1.5 2004/06/01 17:10:13 lordjaxom Exp $
*/
#define __STL_CONFIG_H
@@ -24,11 +24,12 @@ cText2SkinBitmap::~cText2SkinBitmap() {
bool cText2SkinBitmap::Load(const char *Filename) {
int len = strlen(Filename);
if (len > 4) {
+#ifndef HAVE_IMLIB2
if (strcmp(Filename + len - 4, ".xpm") == 0)
return LoadXpm(Filename);
-#ifdef HAVE_IMLIB2
- else if (strcmp(Filename + len - 4, ".png") == 0)
- return LoadPng(Filename);
+#else
+ if (strcmp(Filename + len - 4, ".xpm") == 0 || strcmp(Filename + len - 4, ".png") == 0)
+ return LoadImlib(Filename);
#endif
else
esyslog("ERROR: text2skin: unknown file format for %s", Filename);
@@ -38,14 +39,14 @@ bool cText2SkinBitmap::Load(const char *Filename) {
}
#ifdef HAVE_IMLIB2
-bool cText2SkinBitmap::LoadPng(const char *Filename) {
+bool cText2SkinBitmap::LoadImlib(const char *Filename) {
Imlib_Image image;
image = imlib_load_image(Filename);
if (!image)
return false;
imlib_context_set_image(image);
SetSize(imlib_image_get_width(), imlib_image_get_height());
- SetBpp(4);
+ SetBpp(8);
uint8_t *data = (uint8_t*)imlib_image_get_data_for_reading_only();
int pal = 0, pos = 0;
for (int y = 0; y < Height(); ++y) {