summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2006-01-29 09:58:53 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2006-01-29 09:58:53 +0000
commit3722a99dd4f10425bd09b28b05b2bfe9f90fdd4f (patch)
treefd011912c6ef4fc46b25a84270daaf7cfbd9480f /apps
parent8f0740333be6cf191a9faa70f43e7b334f3fa66f (diff)
downloadrockbox-3722a99dd4f10425bd09b28b05b2bfe9f90fdd4f.tar.gz
rockbox-3722a99dd4f10425bd09b28b05b2bfe9f90fdd4f.zip
Better working fix for the BMP loader transparency flag bug
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8481 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/recorder/bmp.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/apps/recorder/bmp.c b/apps/recorder/bmp.c
index 2e377df0ed..806d97081b 100644
--- a/apps/recorder/bmp.c
+++ b/apps/recorder/bmp.c
@@ -127,7 +127,15 @@ int read_bmp_file(char* filename,
#if LCD_DEPTH == 1
(void)format;
+#else
+ bool transparent;
+
+ if(format & FORMAT_TRANSPARENT) {
+ transparent = true;
+ format &= ~FORMAT_TRANSPARENT;
+ }
#endif
+
fd = open(filename, O_RDONLY);
@@ -175,7 +183,7 @@ int read_bmp_file(char* filename,
PaddedWidth = (width * depth / 8 + 3) & ~3;
#if LCD_DEPTH > 1
- if(format & FORMAT_ANY) {
+ if(format == FORMAT_ANY) {
if(depth == 1)
format = FORMAT_MONO;
else
@@ -184,7 +192,7 @@ int read_bmp_file(char* filename,
#endif
/* PaddedHeight is for rockbox format. */
- if(format & FORMAT_MONO) {
+ if(format == FORMAT_MONO) {
PaddedHeight = (height + 7) / 8;
totalsize = PaddedHeight * width;
} else {
@@ -230,7 +238,7 @@ int read_bmp_file(char* filename,
lseek(fd, (off_t)readlong(&fh.OffBits), SEEK_SET);
#if LCD_DEPTH == 2
- if(format & FORMAT_NATIVE)
+ if(format == FORMAT_NATIVE)
memset(bitmap, 0, width * height / 4);
#endif
@@ -254,7 +262,7 @@ int read_bmp_file(char* filename,
switch(depth) {
case 1:
#if LCD_DEPTH > 1
- if(format & FORMAT_MONO) {
+ if(format == FORMAT_MONO) {
#endif
/* Mono -> Mono */
for (col = 0; col < width; col++) {
@@ -299,7 +307,7 @@ int read_bmp_file(char* filename,
case 24:
p = bmpbuf;
#if LCD_DEPTH > 1
- if(format & FORMAT_MONO) {
+ if(format == FORMAT_MONO) {
#endif
/* RGB24 -> mono */
for (col = 0; col < width; col++) {