summaryrefslogtreecommitdiff
path: root/apps
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
parent61f61c97738a3f0e279b7c31f9096a5aaa977291 (diff)
downloadrockbox-9a70c42241c70e57bbe739f45d254c67bacc83e7.zip
rockbox-9a70c42241c70e57bbe739f45d254c67bacc83e7.tar.gz
rockbox-9a70c42241c70e57bbe739f45d254c67bacc83e7.tar.bz2
rockbox-9a70c42241c70e57bbe739f45d254c67bacc83e7.tar.xz
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')
-rw-r--r--apps/bitmaps/bitmaps.make8
-rw-r--r--apps/gui/icon.c20
-rw-r--r--apps/gui/usb_screen.c18
-rw-r--r--apps/misc.c6
-rw-r--r--apps/plugins/bitmaps/pluginbitmaps.make8
5 files changed, 24 insertions, 36 deletions
diff --git a/apps/bitmaps/bitmaps.make b/apps/bitmaps/bitmaps.make
index 945ca82..159c31b 100644
--- a/apps/bitmaps/bitmaps.make
+++ b/apps/bitmaps/bitmaps.make
@@ -36,16 +36,16 @@ $(BMPHFILES): $(BMPOBJ)
# pattern rules to create .c files from .bmp, one for each subdir:
$(BUILDDIR)/apps/bitmaps/mono/%.c: $(ROOTDIR)/apps/bitmaps/mono/%.bmp $(TOOLSDIR)/bmp2rb
$(SILENT)mkdir -p $(dir $@) $(BMPINCDIR)
- $(call PRINTS,BMP2RB $(<F))$(BMP2RB_MONO) -h $(BMPINCDIR) $< > $@
+ $(call PRINTS,BMP2RB $(<F))$(BMP2RB_MONO) -b -h $(BMPINCDIR) $< > $@
$(BUILDDIR)/apps/bitmaps/native/%.c: $(ROOTDIR)/apps/bitmaps/native/%.bmp $(TOOLSDIR)/bmp2rb
$(SILENT)mkdir -p $(dir $@) $(BMPINCDIR)
- $(call PRINTS,BMP2RB $(<F))$(BMP2RB_NATIVE) -h $(BMPINCDIR) $< > $@
+ $(call PRINTS,BMP2RB $(<F))$(BMP2RB_NATIVE) -b -h $(BMPINCDIR) $< > $@
$(BUILDDIR)/apps/bitmaps/remote_mono/%.c: $(ROOTDIR)/apps/bitmaps/remote_mono/%.bmp $(TOOLSDIR)/bmp2rb
$(SILENT)mkdir -p $(dir $@) $(BMPINCDIR)
- $(call PRINTS,BMP2RB $(<F))$(BMP2RB_REMOTEMONO) -h $(BMPINCDIR) $< > $@
+ $(call PRINTS,BMP2RB $(<F))$(BMP2RB_REMOTEMONO) -b -h $(BMPINCDIR) $< > $@
$(BUILDDIR)/apps/bitmaps/remote_native/%.c: $(ROOTDIR)/apps/bitmaps/remote_native/%.bmp $(TOOLSDIR)/bmp2rb
$(SILENT)mkdir -p $(dir $@) $(BMPINCDIR)
- $(call PRINTS,BMP2RB $(<F))$(BMP2RB_REMOTENATIVE) -h $(BMPINCDIR) $< > $@
+ $(call PRINTS,BMP2RB $(<F))$(BMP2RB_REMOTENATIVE) -b -h $(BMPINCDIR) $< > $@
diff --git a/apps/gui/icon.c b/apps/gui/icon.c
index 5684ff0..a9075b1 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)
diff --git a/apps/gui/usb_screen.c b/apps/gui/usb_screen.c
index 2b7d472..002f455 100644
--- a/apps/gui/usb_screen.c
+++ b/apps/gui/usb_screen.c
@@ -184,6 +184,12 @@ static void usb_screen_fix_viewports(struct screen *screen,
static void usb_screens_draw(struct usb_screen_vps_t *usb_screen_vps_ar)
{
+ static const struct bitmap* logos[NB_SCREENS] = {
+ &bm_usblogo,
+#ifdef HAVE_RE
+ &bm_remote_usblogo,
+#endif
+ };
FOR_NB_SCREENS(i)
{
struct screen *screen = &screens[i];
@@ -200,17 +206,9 @@ static void usb_screens_draw(struct usb_screen_vps_t *usb_screen_vps_ar)
#ifdef HAVE_LCD_BITMAP
screen->set_viewport(logo);
-#ifdef HAVE_REMOTE_LCD
- if (i == SCREEN_REMOTE)
- {
- screen->bitmap(remote_usblogo, 0, 0, logo->width,
- logo->height);
- }
- else
-#endif
+ screen->bmp(logos[i], 0, 0);
+ if (i == SCREEN_MAIN)
{
- screen->transparent_bitmap(usblogo, 0, 0, logo->width,
- logo->height);
#ifdef USB_ENABLE_HID
if (usb_hid)
{
diff --git a/apps/misc.c b/apps/misc.c
index 72457cd..271e4e1 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -691,11 +691,9 @@ int show_logo( void )
lcd_getstringsize((unsigned char *)"A", &font_w, &font_h);
lcd_putsxy((LCD_WIDTH/2) - ((strlen(version)*font_w)/2),
0, (unsigned char *)version);
- lcd_bitmap(rockboxlogo, (LCD_WIDTH - BMPWIDTH_rockboxlogo) / 2, 16,
- BMPWIDTH_rockboxlogo, BMPHEIGHT_rockboxlogo);
+ lcd_bmp(&bm_rockboxlogo, (LCD_WIDTH - BMPWIDTH_rockboxlogo) / 2, 16);
#else
- lcd_bitmap(rockboxlogo, (LCD_WIDTH - BMPWIDTH_rockboxlogo) / 2, 10,
- BMPWIDTH_rockboxlogo, BMPHEIGHT_rockboxlogo);
+ lcd_bmp(&bm_rockboxlogo, (LCD_WIDTH - BMPWIDTH_rockboxlogo) / 2, 10);
lcd_setfont(FONT_SYSFIXED);
lcd_getstringsize((unsigned char *)"A", &font_w, &font_h);
lcd_putsxy((LCD_WIDTH/2) - ((strlen(version)*font_w)/2),
diff --git a/apps/plugins/bitmaps/pluginbitmaps.make b/apps/plugins/bitmaps/pluginbitmaps.make
index f9b4adb..85536ed 100644
--- a/apps/plugins/bitmaps/pluginbitmaps.make
+++ b/apps/plugins/bitmaps/pluginbitmaps.make
@@ -43,18 +43,18 @@ $(PLUGINBITMAPLIB): $(PLUGIN_BITMAPS)
# pattern rules to create .c files from .bmp, one for each subdir:
$(BUILDDIR)/apps/plugins/bitmaps/mono/%.c: $(ROOTDIR)/apps/plugins/bitmaps/mono/%.bmp $(TOOLSDIR)/bmp2rb
$(SILENT)mkdir -p $(dir $@) $(PBMPINCDIR)
- $(call PRINTS,BMP2RB $(<F))$(BMP2RB_MONO) -h $(PBMPINCDIR) $< > $@
+ $(call PRINTS,BMP2RB $(<F))$(BMP2RB_MONO) -b -h $(PBMPINCDIR) $< > $@
$(BUILDDIR)/apps/plugins/bitmaps/native/%.c: $(ROOTDIR)/apps/plugins/bitmaps/native/%.bmp $(TOOLSDIR)/bmp2rb
$(SILENT)mkdir -p $(dir $@) $(PBMPINCDIR)
- $(call PRINTS,BMP2RB $(<F))$(BMP2RB_NATIVE) -h $(PBMPINCDIR) $< > $@
+ $(call PRINTS,BMP2RB $(<F))$(BMP2RB_NATIVE) -b -h $(PBMPINCDIR) $< > $@
$(BUILDDIR)/apps/plugins/bitmaps/remote_mono/%.c: $(ROOTDIR)/apps/plugins/bitmaps/remote_mono/%.bmp $(TOOLSDIR)/bmp2rb
$(SILENT)mkdir -p $(dir $@) $(PBMPINCDIR)
- $(call PRINTS,BMP2RB $(<F))$(BMP2RB_REMOTEMONO) -h $(PBMPINCDIR) $< > $@
+ $(call PRINTS,BMP2RB $(<F))$(BMP2RB_REMOTEMONO) -b -h $(PBMPINCDIR) $< > $@
$(BUILDDIR)/apps/plugins/bitmaps/remote_native/%.c: $(ROOTDIR)/apps/plugins/bitmaps/remote_native/%.bmp $(TOOLSDIR)/bmp2rb
$(SILENT)mkdir -p $(dir $@) $(PBMPINCDIR)
- $(call PRINTS,BMP2RB $(<F))$(BMP2RB_REMOTENATIVE) -h $(PBMPINCDIR) $< > $@
+ $(call PRINTS,BMP2RB $(<F))$(BMP2RB_REMOTENATIVE) -b -h $(PBMPINCDIR) $< > $@
endif