diff options
Diffstat (limited to 'apps/plugins/pictureflow/pictureflow.c')
-rw-r--r-- | apps/plugins/pictureflow/pictureflow.c | 40 |
1 files changed, 27 insertions, 13 deletions
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 | ||
281 | const struct picture logos[]={ | ||
282 | {pictureflow_logo, BMPWIDTH_pictureflow_logo, BMPHEIGHT_pictureflow_logo}, | ||
283 | }; | ||
284 | |||
285 | enum show_album_name_values { album_name_hide = 0, album_name_bottom, | 280 | enum show_album_name_values { album_name_hide = 0, album_name_bottom, |
286 | album_name_top }; | 281 | album_name_top }; |
287 | static char* show_album_name_conf[] = | 282 | static char* show_album_name_conf[] = |
@@ -927,9 +922,24 @@ bool get_albumart_for_index_from_db(const int slide_index, char *buf, | |||
927 | */ | 922 | */ |
928 | void draw_splashscreen(void) | 923 | void 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 | } |