forked from len0rd/rockbox
explicitly set img->using_preloaded_icons in parse_image_load() and don't rely on parse_image_display().
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28184 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
5b2d7e23a0
commit
717f0bd982
1 changed files with 9 additions and 5 deletions
|
@ -248,11 +248,8 @@ static int parse_image_display(struct skin_element *element,
|
||||||
id->label = label;
|
id->label = label;
|
||||||
id->offset = 0;
|
id->offset = 0;
|
||||||
id->token = NULL;
|
id->token = NULL;
|
||||||
img->using_preloaded_icons = false;
|
if (img->using_preloaded_icons)
|
||||||
if (!strcmp(img->bm.data, "__list_icons__"))
|
|
||||||
{
|
{
|
||||||
img->num_subimages = Icon_Last_Themeable;
|
|
||||||
img->using_preloaded_icons = true;
|
|
||||||
token->type = SKIN_TOKEN_IMAGE_DISPLAY_LISTICON;
|
token->type = SKIN_TOKEN_IMAGE_DISPLAY_LISTICON;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -317,6 +314,7 @@ static int parse_image_load(struct skin_element *element,
|
||||||
img->num_subimages = 1;
|
img->num_subimages = 1;
|
||||||
img->always_display = false;
|
img->always_display = false;
|
||||||
img->display = -1;
|
img->display = -1;
|
||||||
|
img->using_preloaded_icons = false;
|
||||||
|
|
||||||
/* save current viewport */
|
/* save current viewport */
|
||||||
img->vp = &curr_vp->vp;
|
img->vp = &curr_vp->vp;
|
||||||
|
@ -331,6 +329,12 @@ static int parse_image_load(struct skin_element *element,
|
||||||
if (img->num_subimages <= 0)
|
if (img->num_subimages <= 0)
|
||||||
return WPS_ERROR_INVALID_PARAM;
|
return WPS_ERROR_INVALID_PARAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!strcmp(img->bm.data, "__list_icons__"))
|
||||||
|
{
|
||||||
|
img->num_subimages = Icon_Last_Themeable;
|
||||||
|
img->using_preloaded_icons = true;
|
||||||
|
}
|
||||||
|
|
||||||
struct skin_token_list *item =
|
struct skin_token_list *item =
|
||||||
(struct skin_token_list *)new_skin_token_list_item(NULL, img);
|
(struct skin_token_list *)new_skin_token_list_item(NULL, img);
|
||||||
|
@ -1064,7 +1068,7 @@ static bool load_skin_bmp(struct wps_data *wps_data, struct bitmap *bitmap, char
|
||||||
fd = open(img_path, O_RDONLY);
|
fd = open(img_path, O_RDONLY);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return false;
|
return false;
|
||||||
size_t buf_size = read_bmp_file(img_path, bitmap, 0,
|
size_t buf_size = read_bmp_fd(fd, bitmap, 0,
|
||||||
format|FORMAT_RETURN_SIZE, NULL);
|
format|FORMAT_RETURN_SIZE, NULL);
|
||||||
char* imgbuf = (char*)skin_buffer_alloc(buf_size);
|
char* imgbuf = (char*)skin_buffer_alloc(buf_size);
|
||||||
if (!imgbuf)
|
if (!imgbuf)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue