summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine/skin_parser.c
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-10-04 14:23:04 +0100
committerAidan MacDonald <amachronic@protonmail.com>2022-11-23 10:07:29 -0500
commit3815ef805010486c091c1c38221dcbf898590a8d (patch)
treeed7e6f9aff20660999166b193b851063e0f28693 /apps/gui/skin_engine/skin_parser.c
parent830436a282e49caea4bd15bfa8c133b4c5d422dd (diff)
downloadrockbox-3815ef805010486c091c1c38221dcbf898590a8d.tar.gz
rockbox-3815ef805010486c091c1c38221dcbf898590a8d.zip
skin engine: Remove albumart viewport field
The viewport field in albumart is unnecessary, but for a different reason than eg. the progressbar was. The skin engine draws images by going over a global list of images shared between all viewports. Prior to drawing a viewport, every image is marked "not displayed." When an image display tag is encountered during rendering this mark is set to the index of the subimage to be displayed. The albumart is handled similarily, by setting a handle to -1 and then updating it when the %Cd tag is encountered. The albumart is not drawn unless the handle is set to >= 0 by the %Cd tag. So we don't need to track or check viewports at all, because only the viewport that contains the %Cd tag will ever draw the albumart. Change-Id: Ibc0233d168012759325d3c16dc317de9ad3dcf6c
Diffstat (limited to 'apps/gui/skin_engine/skin_parser.c')
-rw-r--r--apps/gui/skin_engine/skin_parser.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index 9fb15d8e56..3e91536411 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -1317,7 +1317,6 @@ static int parse_albumart_load(struct skin_element* element,
1317 if (!isdefault(param3) && param3->type == PERCENT) 1317 if (!isdefault(param3) && param3->type == PERCENT)
1318 aa->height = param3->data.number * curr_vp->vp.height / 1000; 1318 aa->height = param3->data.number * curr_vp->vp.height / 1000;
1319 1319
1320 aa->vp = PTRTOSKINOFFSET(skin_buffer, &curr_vp->vp);
1321 aa->draw_handle = -1; 1320 aa->draw_handle = -1;
1322 1321
1323 /* if we got here, we parsed everything ok .. ! */ 1322 /* if we got here, we parsed everything ok .. ! */
@@ -2405,13 +2404,6 @@ static int skin_element_callback(struct skin_element* element, void* data)
2405 break; 2404 break;
2406#endif 2405#endif
2407#ifdef HAVE_ALBUMART 2406#ifdef HAVE_ALBUMART
2408 case SKIN_TOKEN_ALBUMART_DISPLAY:
2409 if (SKINOFFSETTOPTR(skin_buffer, wps_data->albumart))
2410 {
2411 struct skin_albumart *aa = SKINOFFSETTOPTR(skin_buffer, wps_data->albumart);
2412 aa->vp = PTRTOSKINOFFSET(skin_buffer, &curr_vp->vp);
2413 }
2414 break;
2415 case SKIN_TOKEN_ALBUMART_LOAD: 2407 case SKIN_TOKEN_ALBUMART_LOAD:
2416 function = parse_albumart_load; 2408 function = parse_albumart_load;
2417 break; 2409 break;