diff options
author | Thomas Martitz <kugel@rockbox.org> | 2011-11-13 15:37:16 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2011-11-13 15:37:16 +0000 |
commit | 9a70c42241c70e57bbe739f45d254c67bacc83e7 (patch) | |
tree | 2387eebfd2f3ad83c5e4e69d6d39fd37f234d928 /apps/gui/icon.c | |
parent | 61f61c97738a3f0e279b7c31f9096a5aaa977291 (diff) | |
download | rockbox-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.c | 20 |
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 @@ | |||
44 | /* We dont actually do anything with these pointers, | 44 | /* We dont actually do anything with these pointers, |
45 | but they need to be grouped like this to save code | 45 | but they need to be grouped like this to save code |
46 | so storing them as void* is ok. (stops compile warning) */ | 46 | so storing them as void* is ok. (stops compile warning) */ |
47 | static const struct bitmap inbuilt_iconset[NB_SCREENS] = | 47 | static const struct bitmap *inbuilt_iconset[NB_SCREENS] = |
48 | { | 48 | { |
49 | { | 49 | &bm_default_icons, |
50 | .width = BMPWIDTH_default_icons, | ||
51 | .height = BMPHEIGHT_default_icons, | ||
52 | .data = (unsigned char*)default_icons, | ||
53 | }, | ||
54 | #if defined(HAVE_REMOTE_LCD) && (NB_SCREENS > 1) | 50 | #if defined(HAVE_REMOTE_LCD) && (NB_SCREENS > 1) |
55 | { | 51 | &bm_remote_default_icons, |
56 | .width = BMPWIDTH_remote_default_icons, | ||
57 | .height = BMPHEIGHT_remote_default_icons, | ||
58 | .data = (unsigned char*)remote_default_icons, | ||
59 | }, | ||
60 | #endif | 52 | #endif |
61 | }; | 53 | }; |
62 | 54 | ||
@@ -74,11 +66,11 @@ struct iconset { | |||
74 | } iconsets[Iconset_Count][NB_SCREENS]; | 66 | } iconsets[Iconset_Count][NB_SCREENS]; |
75 | 67 | ||
76 | #define ICON_HEIGHT(screen) (!iconsets[Iconset_user][screen].loaded ? \ | 68 | #define ICON_HEIGHT(screen) (!iconsets[Iconset_user][screen].loaded ? \ |
77 | inbuilt_iconset[screen] : iconsets[Iconset_user][screen].bmp).height \ | 69 | (*(inbuilt_iconset[screen])) : iconsets[Iconset_user][screen].bmp).height \ |
78 | / Icon_Last_Themeable | 70 | / Icon_Last_Themeable |
79 | 71 | ||
80 | #define ICON_WIDTH(screen) (!iconsets[Iconset_user][screen].loaded ? \ | 72 | #define ICON_WIDTH(screen) (!iconsets[Iconset_user][screen].loaded ? \ |
81 | inbuilt_iconset[screen] : iconsets[Iconset_user][screen].bmp).width | 73 | (*(inbuilt_iconset[screen])) : iconsets[Iconset_user][screen].bmp).width |
82 | 74 | ||
83 | /* x,y in letters, not pixles */ | 75 | /* x,y in letters, not pixles */ |
84 | void screen_put_icon(struct screen * display, | 76 | void screen_put_icon(struct screen * display, |
@@ -140,7 +132,7 @@ void screen_put_iconxy(struct screen * display, | |||
140 | } | 132 | } |
141 | else | 133 | else |
142 | { | 134 | { |
143 | iconset = &inbuilt_iconset[screen]; | 135 | iconset = inbuilt_iconset[screen]; |
144 | } | 136 | } |
145 | /* add some left padding to the icons if they are on the edge */ | 137 | /* add some left padding to the icons if they are on the edge */ |
146 | if (xpos == 0) | 138 | if (xpos == 0) |