summaryrefslogtreecommitdiff
path: root/apps/gui/icon.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-11-08 21:39:28 +0000
committerThomas Martitz <kugel@rockbox.org>2011-11-08 21:39:28 +0000
commitb02c82e10529f2750103e31285500e927ec37a7c (patch)
tree642e2fabdc43391881c3762486e6090b72af35cf /apps/gui/icon.c
parentc7b8054714cff4580ddbdbf5c9d503b20ff45740 (diff)
downloadrockbox-b02c82e10529f2750103e31285500e927ec37a7c.tar.gz
rockbox-b02c82e10529f2750103e31285500e927ec37a7c.zip
Adapt icon and skin engine to make use of the new 32bit bitmap capabilities.
You can now use 32bit icons in lists and skins (except album art, but can be added if wanted). The code also shows how to free the unused alpha channel data if the bitmap doesn't actually contain such information. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30939 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/icon.c')
-rw-r--r--apps/gui/icon.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/gui/icon.c b/apps/gui/icon.c
index 4c006f947a..d24d8bb677 100644
--- a/apps/gui/icon.c
+++ b/apps/gui/icon.c
@@ -189,7 +189,7 @@ static void load_icons(const char* filename, enum Iconset iconset,
189 enum screen_type screen) 189 enum screen_type screen)
190{ 190{
191 int size_read; 191 int size_read;
192 int bmpformat = (FORMAT_NATIVE|FORMAT_DITHER); 192 int bmpformat = (FORMAT_NATIVE|FORMAT_DITHER|FORMAT_TRANSPARENT);
193 struct iconset *ic = &iconsets[iconset][screen]; 193 struct iconset *ic = &iconsets[iconset][screen];
194 int fd; 194 int fd;
195 195
@@ -217,6 +217,9 @@ static void load_icons(const char* filename, enum Iconset iconset,
217 size_read = read_bmp_fd(fd, &ic->bmp, buf_size, bmpformat, NULL); 217 size_read = read_bmp_fd(fd, &ic->bmp, buf_size, bmpformat, NULL);
218 ic->handle_locked = 0; 218 ic->handle_locked = 0;
219 219
220 /* free unused alpha channel, if any */
221 core_shrink(ic->handle, ic->bmp.data, size_read);
222
220 if (size_read <= 0) 223 if (size_read <= 0)
221 ic->handle = core_free(ic->handle); 224 ic->handle = core_free(ic->handle);
222 else 225 else