diff options
Diffstat (limited to 'apps/gui/skin_engine/skin_parser.c')
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index 414da44581..4363a293c8 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c | |||
@@ -1986,7 +1986,6 @@ static void skin_data_reset(struct wps_data *wps_data) | |||
1986 | static bool load_skin_bmp(struct wps_data *wps_data, struct bitmap *bitmap, char* bmpdir) | 1986 | static bool load_skin_bmp(struct wps_data *wps_data, struct bitmap *bitmap, char* bmpdir) |
1987 | { | 1987 | { |
1988 | (void)wps_data; /* only needed for remote targets */ | 1988 | (void)wps_data; /* only needed for remote targets */ |
1989 | bool loaded = false; | ||
1990 | char img_path[MAX_PATH]; | 1989 | char img_path[MAX_PATH]; |
1991 | get_image_filename(bitmap->data, bmpdir, | 1990 | get_image_filename(bitmap->data, bmpdir, |
1992 | img_path, sizeof(img_path)); | 1991 | img_path, sizeof(img_path)); |
@@ -2008,19 +2007,19 @@ static bool load_skin_bmp(struct wps_data *wps_data, struct bitmap *bitmap, char | |||
2008 | if (ret > 0) | 2007 | if (ret > 0) |
2009 | { | 2008 | { |
2010 | skin_buffer_increment(ret, true); | 2009 | skin_buffer_increment(ret, true); |
2011 | loaded = true; | 2010 | return true; |
2012 | } | 2011 | } |
2013 | else | 2012 | else |
2014 | { | 2013 | { |
2015 | /* Abort if we can't load an image */ | 2014 | /* Abort if we can't load an image */ |
2016 | loaded = false; | 2015 | return false; |
2017 | } | 2016 | } |
2018 | return loaded; | ||
2019 | } | 2017 | } |
2020 | 2018 | ||
2021 | static bool load_skin_bitmaps(struct wps_data *wps_data, char *bmpdir) | 2019 | static bool load_skin_bitmaps(struct wps_data *wps_data, char *bmpdir) |
2022 | { | 2020 | { |
2023 | struct skin_token_list *list; | 2021 | struct skin_token_list *list; |
2022 | bool retval = true; /* return false if a single image failed to load */ | ||
2024 | /* do the progressbars */ | 2023 | /* do the progressbars */ |
2025 | list = wps_data->progressbars; | 2024 | list = wps_data->progressbars; |
2026 | while (list) | 2025 | while (list) |
@@ -2029,6 +2028,8 @@ static bool load_skin_bitmaps(struct wps_data *wps_data, char *bmpdir) | |||
2029 | if (pb->bm.data) | 2028 | if (pb->bm.data) |
2030 | { | 2029 | { |
2031 | pb->have_bitmap_pb = load_skin_bmp(wps_data, &pb->bm, bmpdir); | 2030 | pb->have_bitmap_pb = load_skin_bmp(wps_data, &pb->bm, bmpdir); |
2031 | if (!pb->have_bitmap_pb) /* no success */ | ||
2032 | retval = false; | ||
2032 | } | 2033 | } |
2033 | list = list->next; | 2034 | list = list->next; |
2034 | } | 2035 | } |
@@ -2042,6 +2043,8 @@ static bool load_skin_bitmaps(struct wps_data *wps_data, char *bmpdir) | |||
2042 | img->loaded = load_skin_bmp(wps_data, &img->bm, bmpdir); | 2043 | img->loaded = load_skin_bmp(wps_data, &img->bm, bmpdir); |
2043 | if (img->loaded) | 2044 | if (img->loaded) |
2044 | img->subimage_height = img->bm.height / img->num_subimages; | 2045 | img->subimage_height = img->bm.height / img->num_subimages; |
2046 | else | ||
2047 | retval = false; | ||
2045 | } | 2048 | } |
2046 | list = list->next; | 2049 | list = list->next; |
2047 | } | 2050 | } |
@@ -2053,13 +2056,15 @@ static bool load_skin_bitmaps(struct wps_data *wps_data, char *bmpdir) | |||
2053 | */ | 2056 | */ |
2054 | if (wps_data->backdrop) | 2057 | if (wps_data->backdrop) |
2055 | { | 2058 | { |
2059 | bool needed = wps_data->backdrop[0] != '-'; | ||
2056 | wps_data->backdrop = skin_backdrop_load(wps_data->backdrop, | 2060 | wps_data->backdrop = skin_backdrop_load(wps_data->backdrop, |
2057 | bmpdir, curr_screen); | 2061 | bmpdir, curr_screen); |
2062 | if (!wps_data->backdrop && needed) | ||
2063 | retval = false; | ||
2058 | } | 2064 | } |
2059 | #endif /* has backdrop support */ | 2065 | #endif /* has backdrop support */ |
2060 | 2066 | ||
2061 | /* If we got here, everything was OK */ | 2067 | return retval; |
2062 | return true; | ||
2063 | } | 2068 | } |
2064 | 2069 | ||
2065 | #endif /* HAVE_LCD_BITMAP */ | 2070 | #endif /* HAVE_LCD_BITMAP */ |