1
0
Fork 0
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:
Teruaki Kawashima 2010-09-29 13:23:24 +00:00
parent 5b2d7e23a0
commit 717f0bd982

View file

@ -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;
@ -332,6 +330,12 @@ static int parse_image_load(struct skin_element *element,
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);
if (!item) if (!item)
@ -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)