summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorAndrew Mahone <andrew.mahone@gmail.com>2009-05-23 07:55:14 +0000
committerAndrew Mahone <andrew.mahone@gmail.com>2009-05-23 07:55:14 +0000
commit802ea462d052f191a6fb4c6998c84fda934a522f (patch)
treee366a35823dafa646187fb0329682581dc3ff4ac /apps
parent9be554cb6a2a7c9ca0a4aea5c6b1967b76347f91 (diff)
downloadrockbox-802ea462d052f191a6fb4c6998c84fda934a522f.tar.gz
rockbox-802ea462d052f191a6fb4c6998c84fda934a522f.zip
Load PictureFlow logo from disk, discarding it after splash screen is done and freeing the used space for the slide cache.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21051 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/bitmaps/native/SOURCES9
-rw-r--r--apps/plugins/pictureflow/pictureflow.c40
2 files changed, 27 insertions, 22 deletions
diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES
index c46d176469..8270161ac4 100644
--- a/apps/plugins/bitmaps/native/SOURCES
+++ b/apps/plugins/bitmaps/native/SOURCES
@@ -692,15 +692,6 @@ matrix_bold.bmp
692matrix_normal.bmp 692matrix_normal.bmp
693#endif 693#endif
694 694
695/* pictureflow */
696#if defined(HAVE_LCD_BITMAP) && defined(HAVE_TAGCACHE)
697#if (LCD_WIDTH < 200)
698pictureflow_logo.100x18x16.bmp
699#else
700pictureflow_logo.193x34x16.bmp
701#endif
702#endif
703
704/* Sliding puzzle */ 695/* Sliding puzzle */
705#if (LCD_WIDTH != LCD_HEIGHT) 696#if (LCD_WIDTH != LCD_HEIGHT)
706#define SMALLER_DIMENSION ((LCD_WIDTH < LCD_HEIGHT) ? LCD_WIDTH : LCD_HEIGHT) 697#define SMALLER_DIMENSION ((LCD_WIDTH < LCD_HEIGHT) ? LCD_WIDTH : LCD_HEIGHT)
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c
index 2bf8c20802..a1ad3d2776 100644
--- a/apps/plugins/pictureflow/pictureflow.c
+++ b/apps/plugins/pictureflow/pictureflow.c
@@ -29,8 +29,6 @@
29#include "lib/pluginlib_actions.h" 29#include "lib/pluginlib_actions.h"
30#include "lib/helper.h" 30#include "lib/helper.h"
31#include "lib/configfile.h" 31#include "lib/configfile.h"
32#include "lib/picture.h"
33#include "pluginbitmaps/pictureflow_logo.h"
34#include "lib/grey.h" 32#include "lib/grey.h"
35#include "lib/feature_wrappers.h" 33#include "lib/feature_wrappers.h"
36#include "lib/buflib.h" 34#include "lib/buflib.h"
@@ -222,6 +220,7 @@ typedef fb_data pix_t;
222 220
223#define EMPTY_SLIDE CACHE_PREFIX "/emptyslide.pfraw" 221#define EMPTY_SLIDE CACHE_PREFIX "/emptyslide.pfraw"
224#define EMPTY_SLIDE_BMP PLUGIN_DEMOS_DIR "/pictureflow_emptyslide.bmp" 222#define EMPTY_SLIDE_BMP PLUGIN_DEMOS_DIR "/pictureflow_emptyslide.bmp"
223#define SPLASH_BMP PLUGIN_DEMOS_DIR "/pictureflow_splash.bmp"
225 224
226/* Error return values */ 225/* Error return values */
227#define ERROR_NO_ALBUMS -1 226#define ERROR_NO_ALBUMS -1
@@ -278,10 +277,6 @@ struct pfraw_header {
278 int32_t height; /* bmap height in pixels */ 277 int32_t height; /* bmap height in pixels */
279}; 278};
280 279
281const struct picture logos[]={
282 {pictureflow_logo, BMPWIDTH_pictureflow_logo, BMPHEIGHT_pictureflow_logo},
283};
284
285enum show_album_name_values { album_name_hide = 0, album_name_bottom, 280enum show_album_name_values { album_name_hide = 0, album_name_bottom,
286 album_name_top }; 281 album_name_top };
287static char* show_album_name_conf[] = 282static char* show_album_name_conf[] =
@@ -927,9 +922,24 @@ bool get_albumart_for_index_from_db(const int slide_index, char *buf,
927 */ 922 */
928void draw_splashscreen(void) 923void draw_splashscreen(void)
929{ 924{
925 unsigned char * buf_tmp = buf;
926 size_t buf_tmp_size = buf_size;
930 struct screen* display = rb->screens[0]; 927 struct screen* display = rb->screens[0];
931 const struct picture* logo = &(logos[display->screen_type]); 928#if FB_DATA_SZ > 1
932 929 ALIGN_BUFFER(buf_tmp, buf_tmp_size, sizeof(fb_data));
930#endif
931 struct bitmap logo = {
932#if LCD_WIDTH < 200
933 .width = 100,
934 .height = 18,
935#else
936 .width = 193,
937 .height = 34,
938#endif
939 .data = buf_tmp
940 };
941 int ret = rb->read_bmp_file(SPLASH_BMP, &logo, buf_tmp_size, FORMAT_NATIVE,
942 NULL);
933#if LCD_DEPTH > 1 943#if LCD_DEPTH > 1
934 rb->lcd_set_background(N_BRIGHT(0)); 944 rb->lcd_set_background(N_BRIGHT(0));
935 rb->lcd_set_foreground(N_BRIGHT(255)); 945 rb->lcd_set_foreground(N_BRIGHT(255));
@@ -938,13 +948,17 @@ void draw_splashscreen(void)
938#endif 948#endif
939 rb->lcd_clear_display(); 949 rb->lcd_clear_display();
940 950
951 if (ret > 0)
952 {
941#if LCD_DEPTH == 1 /* Mono LCDs need the logo inverted */ 953#if LCD_DEPTH == 1 /* Mono LCDs need the logo inverted */
942 rb->lcd_set_drawmode(PICTUREFLOW_DRMODE ^ DRMODE_INVERSEVID); 954 rb->lcd_set_drawmode(PICTUREFLOW_DRMODE ^ DRMODE_INVERSEVID);
943 picture_draw(display, logo, (LCD_WIDTH - logo->width) / 2, 10);
944 rb->lcd_set_drawmode(PICTUREFLOW_DRMODE);
945#else
946 picture_draw(display, logo, (LCD_WIDTH - logo->width) / 2, 10);
947#endif 955#endif
956 display->bitmap(logo.data, (LCD_WIDTH - logo.width) / 2, 10,
957 logo.width, logo.height);
958#if LCD_DEPTH == 1 /* Mono LCDs need the logo inverted */
959 rb->lcd_set_drawmode(PICTUREFLOW_DRMODE);
960#endif
961 }
948 962
949 rb->lcd_update(); 963 rb->lcd_update();
950} 964}