summaryrefslogtreecommitdiffstats
path: root/apps/gui/icon.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-11-13 15:37:16 +0000
committerThomas Martitz <kugel@rockbox.org>2011-11-13 15:37:16 +0000
commit9a70c42241c70e57bbe739f45d254c67bacc83e7 (patch)
tree2387eebfd2f3ad83c5e4e69d6d39fd37f234d928 /apps/gui/icon.c
parent61f61c97738a3f0e279b7c31f9096a5aaa977291 (diff)
downloadrockbox-9a70c42241c70e57bbe739f45d254c67bacc83e7.tar.gz
rockbox-9a70c42241c70e57bbe739f45d254c67bacc83e7.zip
Add the ability to create a prefilled struct bitmap along with generated images.
This allows to directly draw generated and builtin images using lcd_bmp(bm_xxx); Also fixes builtin list icons on non-mono targets, as they didn't have the format field set. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30971 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/icon.c')
-rw-r--r--apps/gui/icon.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/apps/gui/icon.c b/apps/gui/icon.c
index 5684ff057c..a9075b1b0f 100644
--- a/apps/gui/icon.c
+++ b/apps/gui/icon.c
@@ -44,19 +44,11 @@
/* We dont actually do anything with these pointers,
but they need to be grouped like this to save code
so storing them as void* is ok. (stops compile warning) */
-static const struct bitmap inbuilt_iconset[NB_SCREENS] =
+static const struct bitmap *inbuilt_iconset[NB_SCREENS] =
{
- {
- .width = BMPWIDTH_default_icons,
- .height = BMPHEIGHT_default_icons,
- .data = (unsigned char*)default_icons,
- },
+ &bm_default_icons,
#if defined(HAVE_REMOTE_LCD) && (NB_SCREENS > 1)
- {
- .width = BMPWIDTH_remote_default_icons,
- .height = BMPHEIGHT_remote_default_icons,
- .data = (unsigned char*)remote_default_icons,
- },
+ &bm_remote_default_icons,
#endif
};
@@ -74,11 +66,11 @@ struct iconset {
} iconsets[Iconset_Count][NB_SCREENS];
#define ICON_HEIGHT(screen) (!iconsets[Iconset_user][screen].loaded ? \
- inbuilt_iconset[screen] : iconsets[Iconset_user][screen].bmp).height \
+ (*(inbuilt_iconset[screen])) : iconsets[Iconset_user][screen].bmp).height \
/ Icon_Last_Themeable
#define ICON_WIDTH(screen) (!iconsets[Iconset_user][screen].loaded ? \
- inbuilt_iconset[screen] : iconsets[Iconset_user][screen].bmp).width
+ (*(inbuilt_iconset[screen])) : iconsets[Iconset_user][screen].bmp).width
/* x,y in letters, not pixles */
void screen_put_icon(struct screen * display,
@@ -140,7 +132,7 @@ void screen_put_iconxy(struct screen * display,
}
else
{
- iconset = &inbuilt_iconset[screen];
+ iconset = inbuilt_iconset[screen];
}
/* add some left padding to the icons if they are on the edge */
if (xpos == 0)