forked from len0rd/rockbox
Improve clearing of pictures in conditional constructs. This fixes improper clearing of pictures used in several conditionals or in nested conditionals (FS#7856).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15663 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
4acae4da03
commit
720cfe3954
4 changed files with 11 additions and 37 deletions
|
@ -1390,7 +1390,7 @@ static bool evaluate_conditional(struct gui_wps *gwps, int *token_index)
|
||||||
|
|
||||||
struct wps_data *data = gwps->data;
|
struct wps_data *data = gwps->data;
|
||||||
|
|
||||||
int i;
|
int i, cond_end;
|
||||||
int cond_index = *token_index;
|
int cond_index = *token_index;
|
||||||
char result[128], *value;
|
char result[128], *value;
|
||||||
unsigned char num_options = data->tokens[cond_index].value.i & 0xFF;
|
unsigned char num_options = data->tokens[cond_index].value.i & 0xFF;
|
||||||
|
@ -1429,22 +1429,19 @@ static bool evaluate_conditional(struct gui_wps *gwps, int *token_index)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cond_end = find_conditional_end(data, cond_index + 2);
|
||||||
|
for (i = cond_index + 3; i < cond_end; i++)
|
||||||
|
{
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
/* clear all pictures in the conditional */
|
/* clear all pictures in the conditional and nested ones */
|
||||||
for (i = 0; i < MAX_IMAGES; i++)
|
if (data->tokens[i].type == WPS_TOKEN_IMAGE_PRELOAD_DISPLAY)
|
||||||
{
|
clear_image_pos(gwps, data->tokens[i].value.i);
|
||||||
if (data->img[i].cond_index == cond_index)
|
|
||||||
clear_image_pos(gwps, i);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_ALBUMART
|
#ifdef HAVE_ALBUMART
|
||||||
if (data->wps_uses_albumart != WPS_ALBUMART_NONE &&
|
if (data->tokens[i].type == WPS_TOKEN_ALBUMART_DISPLAY)
|
||||||
data->albumart_cond_index == cond_index)
|
draw_album_art(gwps, audio_current_aa_hid(), true);
|
||||||
{
|
|
||||||
draw_album_art(gwps, audio_current_aa_hid(), true);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,9 +66,6 @@ struct gui_img{
|
||||||
bool loaded; /* load state */
|
bool loaded; /* load state */
|
||||||
bool display; /* is to be displayed */
|
bool display; /* is to be displayed */
|
||||||
bool always_display; /* not using the preload/display mechanism */
|
bool always_display; /* not using the preload/display mechanism */
|
||||||
|
|
||||||
/* the index of the conditional the image is in */
|
|
||||||
unsigned short cond_index;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct prog_img{ /*progressbar image*/
|
struct prog_img{ /*progressbar image*/
|
||||||
|
|
|
@ -559,20 +559,6 @@ static void print_wps_strings(struct wps_data *data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
|
||||||
static void print_img_cond_indexes(struct wps_data *data)
|
|
||||||
{
|
|
||||||
DEBUGF("Image conditional indexes:\n");
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < MAX_IMAGES; i++)
|
|
||||||
{
|
|
||||||
if (data->img[i].cond_index)
|
|
||||||
DEBUGF("%2d: %d\n", i, data->img[i].cond_index);
|
|
||||||
}
|
|
||||||
DEBUGF("\n");
|
|
||||||
}
|
|
||||||
#endif /*HAVE_LCD_BITMAP */
|
|
||||||
|
|
||||||
void print_debug_info(struct wps_data *data, int fail, int line)
|
void print_debug_info(struct wps_data *data, int fail, int line)
|
||||||
{
|
{
|
||||||
#if defined(SIMULATOR) || defined(__PCTOOL__)
|
#if defined(SIMULATOR) || defined(__PCTOOL__)
|
||||||
|
@ -581,9 +567,6 @@ void print_debug_info(struct wps_data *data, int fail, int line)
|
||||||
dump_wps_tokens(data);
|
dump_wps_tokens(data);
|
||||||
print_wps_strings(data);
|
print_wps_strings(data);
|
||||||
print_line_info(data);
|
print_line_info(data);
|
||||||
#ifdef HAVE_LCD_BITMAP
|
|
||||||
if (wps_verbose_level > 2) print_img_cond_indexes(data);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif /* SIMULATOR */
|
#endif /* SIMULATOR */
|
||||||
|
|
||||||
|
|
|
@ -426,6 +426,7 @@ static int parse_image_display(const char *wps_bufptr,
|
||||||
struct wps_token *token,
|
struct wps_token *token,
|
||||||
struct wps_data *wps_data)
|
struct wps_data *wps_data)
|
||||||
{
|
{
|
||||||
|
(void)wps_data;
|
||||||
int n = get_image_id(*wps_bufptr);
|
int n = get_image_id(*wps_bufptr);
|
||||||
|
|
||||||
if (n == -1)
|
if (n == -1)
|
||||||
|
@ -436,10 +437,6 @@ static int parse_image_display(const char *wps_bufptr,
|
||||||
|
|
||||||
token->value.i = n;
|
token->value.i = n;
|
||||||
|
|
||||||
/* if the image is in a conditional, remember it */
|
|
||||||
if (level >= 0)
|
|
||||||
wps_data->img[n].cond_index = condindex[level];
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue