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.zip rockbox-2a2b8d8a8234633779dca0fff5e7ce23ad4c48ed.tar.gz rockbox-2a2b8d8a8234633779dca0fff5e7ce23ad4c48ed.tar.bz2 rockbox-2a2b8d8a8234633779dca0fff5e7ce23ad4c48ed.tar.xz | |
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 5d91de2..e46f804 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c @@ -741,6 +741,9 @@ void gui_sync_wps_init(void) FOR_NB_SCREENS(i) { wps_data_init(&wps_datas[i]); +#ifdef HAVE_REMOTE_LCD + wps_datas[i].remote_wps = (i != 0); +#endif gui_wps_init(&gui_wps[i]); gui_wps_set_data(&gui_wps[i], &wps_datas[i]); gui_wps_set_statusbar(&gui_wps[i], &statusbars.statusbars[i]); diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h index 7d82179..5fa2acf 100644 --- a/apps/gui/gwps.h +++ b/apps/gui/gwps.h @@ -312,6 +312,11 @@ struct wps_data unsigned short wps_progress_pat[8]; bool full_line_progressbar; #endif + +#ifdef HAVE_REMOTE_LCD + bool remote_wps; +#endif + /* Number of lines in the WPS. During WPS parsing, this is the index of the line being parsed. */ int num_lines; diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c index ec98d95..b6cda91 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, char* filename, struct bitmap *bm) { + int format; +#ifdef HAVE_REMOTE_LCD + if (wps_data->remote_wps) + format = FORMAT_ANY|FORMAT_REMOTE; + else +#endif + format = FORMAT_ANY|FORMAT_TRANSPARENT; + int ret = read_bmp_file(filename, bm, wps_data->img_buf_free, - FORMAT_ANY|FORMAT_TRANSPARENT); + format); if (ret > 0) { @@ -840,9 +848,14 @@ void wps_data_init(struct wps_data *wps_data) static void wps_reset(struct wps_data *data) { +#ifdef HAVE_REMOTE_LCD + bool rwps = data->remote_wps; /* remember whether the data is for a RWPS */ +#endif memset(data, 0, sizeof(*data)); - data->wps_loaded = false; wps_data_init(data); +#ifdef HAVE_REMOTE_LCD + data->remote_wps = rwps; +#endif } #ifdef HAVE_LCD_BITMAP @@ -896,12 +909,15 @@ static void load_wps_bitmaps(struct wps_data *wps_data, char *bmpdir) } #if LCD_DEPTH > 1 - if (backdrop_bmp_name) - { - get_image_filename(backdrop_bmp_name, bmpdir, - img_path, sizeof(img_path)); - load_wps_backdrop(img_path); - } +#ifdef HAVE_REMOTE_LCD + if (!wps_data->remote_wps) +#endif + if (backdrop_bmp_name) + { + get_image_filename(backdrop_bmp_name, bmpdir, + img_path, sizeof(img_path)); + load_wps_backdrop(img_path); + } #endif } |