summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2023-11-17 15:56:04 +0100
committerChristian Soffke <christian.soffke@gmail.com>2023-11-18 10:29:47 -0500
commit35f9a5b41501502d6bb21cad64be515a73bc360c (patch)
treed366f9d6e324a79679b939954872438c9260cec9
parent51148279373fd903c87536362540f89097bef7f3 (diff)
downloadrockbox-35f9a5b41501502d6bb21cad64be515a73bc360c.tar.gz
rockbox-35f9a5b41501502d6bb21cad64be515a73bc360c.zip
Skin Engine: Fix loading images with same file name
Looks like this was a regression introduced in 01cbb79. The duplicate img uses an existing buflib handle for the data, but still didn't have access to the dimensions from the bitmap struct. Test case: DancePuffDuo theme for Sansa E200. Only one dancepuff was displayed. Thank you to goatikins for reporting the issue. Change-Id: I32c3ebd1f00738f7db52e7a66f98c4ab3489ee4a
-rw-r--r--apps/gui/skin_engine/skin_parser.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index a7e55c2e0e..4d1526fcbc 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -2007,6 +2007,7 @@ static bool load_skin_bitmaps(struct wps_data *wps_data, char *bmpdir)
2007 { 2007 {
2008 struct skin_token_list *imglist = SKINOFFSETTOPTR(skin_buffer, list->next); 2008 struct skin_token_list *imglist = SKINOFFSETTOPTR(skin_buffer, list->next);
2009 img->subimage_height = img->bm.height / img->num_subimages; 2009 img->subimage_height = img->bm.height / img->num_subimages;
2010 struct bitmap* loaded_bm = &img->bm;
2010 while (imglist) 2011 while (imglist)
2011 { 2012 {
2012 token = SKINOFFSETTOPTR(skin_buffer, imglist->token); 2013 token = SKINOFFSETTOPTR(skin_buffer, imglist->token);
@@ -2016,6 +2017,7 @@ static bool load_skin_bitmaps(struct wps_data *wps_data, char *bmpdir)
2016 { 2017 {
2017 img->loaded = true; 2018 img->loaded = true;
2018 img->buflib_handle = handle; 2019 img->buflib_handle = handle;
2020 img->bm = *loaded_bm;
2019 img->subimage_height = img->bm.height / img->num_subimages; 2021 img->subimage_height = img->bm.height / img->num_subimages;
2020 } 2022 }
2021 } 2023 }