diff options
author | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2007-04-25 13:09:56 +0000 |
---|---|---|
committer | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2007-04-25 13:09:56 +0000 |
commit | 2a2b8d8a8234633779dca0fff5e7ce23ad4c48ed (patch) | |
tree | e6ffe49977691b83484dc66e67eac51e50ff85d3 /apps/gui | |
parent | 70e2846241a8ab9dd6aa570762086c3111ac0463 (diff) | |
download | rockbox-2a2b8d8a8234633779dca0fff5e7ce23ad4c48ed.tar.gz rockbox-2a2b8d8a8234633779dca0fff5e7ce23ad4c48ed.zip |
Make bitmaps use the right format in a RWPS and prevent a backdrop tag in a RWPS from clearing the main display's backdrop. This also allows future backdrop support for LCD remotes by making the parsing code aware of whether the display for a WPS is a remote or not.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13261 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui')
-rw-r--r-- | apps/gui/gwps.c | 3 | ||||
-rw-r--r-- | apps/gui/gwps.h | 5 | ||||
-rw-r--r-- | apps/gui/wps_parser.c | 32 |
3 files changed, 32 insertions, 8 deletions
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index 5d91de2285..e46f804af8 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c | |||
@@ -741,6 +741,9 @@ void gui_sync_wps_init(void) | |||
741 | FOR_NB_SCREENS(i) | 741 | FOR_NB_SCREENS(i) |
742 | { | 742 | { |
743 | wps_data_init(&wps_datas[i]); | 743 | wps_data_init(&wps_datas[i]); |
744 | #ifdef HAVE_REMOTE_LCD | ||
745 | wps_datas[i].remote_wps = (i != 0); | ||
746 | #endif | ||
744 | gui_wps_init(&gui_wps[i]); | 747 | gui_wps_init(&gui_wps[i]); |
745 | gui_wps_set_data(&gui_wps[i], &wps_datas[i]); | 748 | gui_wps_set_data(&gui_wps[i], &wps_datas[i]); |
746 | gui_wps_set_statusbar(&gui_wps[i], &statusbars.statusbars[i]); | 749 | gui_wps_set_statusbar(&gui_wps[i], &statusbars.statusbars[i]); |
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h index 7d82179da8..5fa2acfea9 100644 --- a/apps/gui/gwps.h +++ b/apps/gui/gwps.h | |||
@@ -312,6 +312,11 @@ struct wps_data | |||
312 | unsigned short wps_progress_pat[8]; | 312 | unsigned short wps_progress_pat[8]; |
313 | bool full_line_progressbar; | 313 | bool full_line_progressbar; |
314 | #endif | 314 | #endif |
315 | |||
316 | #ifdef HAVE_REMOTE_LCD | ||
317 | bool remote_wps; | ||
318 | #endif | ||
319 | |||
315 | /* Number of lines in the WPS. During WPS parsing, this is | 320 | /* Number of lines in the WPS. During WPS parsing, this is |
316 | the index of the line being parsed. */ | 321 | the index of the line being parsed. */ |
317 | int num_lines; | 322 | int num_lines; |
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c index ec98d95ee4..b6cda91e74 100644 --- a/apps/gui/wps_parser.c +++ b/apps/gui/wps_parser.c | |||
@@ -311,9 +311,17 @@ static bool load_bitmap(struct wps_data *wps_data, | |||
311 | char* filename, | 311 | char* filename, |
312 | struct bitmap *bm) | 312 | struct bitmap *bm) |
313 | { | 313 | { |
314 | int format; | ||
315 | #ifdef HAVE_REMOTE_LCD | ||
316 | if (wps_data->remote_wps) | ||
317 | format = FORMAT_ANY|FORMAT_REMOTE; | ||
318 | else | ||
319 | #endif | ||
320 | format = FORMAT_ANY|FORMAT_TRANSPARENT; | ||
321 | |||
314 | int ret = read_bmp_file(filename, bm, | 322 | int ret = read_bmp_file(filename, bm, |
315 | wps_data->img_buf_free, | 323 | wps_data->img_buf_free, |
316 | FORMAT_ANY|FORMAT_TRANSPARENT); | 324 | format); |
317 | 325 | ||
318 | if (ret > 0) | 326 | if (ret > 0) |
319 | { | 327 | { |
@@ -840,9 +848,14 @@ void wps_data_init(struct wps_data *wps_data) | |||
840 | 848 | ||
841 | static void wps_reset(struct wps_data *data) | 849 | static void wps_reset(struct wps_data *data) |
842 | { | 850 | { |
851 | #ifdef HAVE_REMOTE_LCD | ||
852 | bool rwps = data->remote_wps; /* remember whether the data is for a RWPS */ | ||
853 | #endif | ||
843 | memset(data, 0, sizeof(*data)); | 854 | memset(data, 0, sizeof(*data)); |
844 | data->wps_loaded = false; | ||
845 | wps_data_init(data); | 855 | wps_data_init(data); |
856 | #ifdef HAVE_REMOTE_LCD | ||
857 | data->remote_wps = rwps; | ||
858 | #endif | ||
846 | } | 859 | } |
847 | 860 | ||
848 | #ifdef HAVE_LCD_BITMAP | 861 | #ifdef HAVE_LCD_BITMAP |
@@ -896,12 +909,15 @@ static void load_wps_bitmaps(struct wps_data *wps_data, char *bmpdir) | |||
896 | } | 909 | } |
897 | 910 | ||
898 | #if LCD_DEPTH > 1 | 911 | #if LCD_DEPTH > 1 |
899 | if (backdrop_bmp_name) | 912 | #ifdef HAVE_REMOTE_LCD |
900 | { | 913 | if (!wps_data->remote_wps) |
901 | get_image_filename(backdrop_bmp_name, bmpdir, | 914 | #endif |
902 | img_path, sizeof(img_path)); | 915 | if (backdrop_bmp_name) |
903 | load_wps_backdrop(img_path); | 916 | { |
904 | } | 917 | get_image_filename(backdrop_bmp_name, bmpdir, |
918 | img_path, sizeof(img_path)); | ||
919 | load_wps_backdrop(img_path); | ||
920 | } | ||
905 | #endif | 921 | #endif |
906 | } | 922 | } |
907 | 923 | ||