skin engine: Remove viewport_colour viewport field

Yet again, no need to store the viewport because we already know
it -- and this time the render code is obviously relying on that
assumption.

Change-Id: Id5eb7cd9999fbe1efccd54bd8f0fd3c8a3011c8e
This commit is contained in:
Aidan MacDonald 2022-10-04 14:10:43 +01:00
parent 9368844ad1
commit 830436a282
3 changed files with 2 additions and 8 deletions

View file

@ -747,7 +747,6 @@ static int parse_viewportcolour(struct skin_element *element,
&colour->colour)) &colour->colour))
return -1; return -1;
} }
colour->vp = PTRTOSKINOFFSET(skin_buffer, &curr_vp->vp);
token->value.data = PTRTOSKINOFFSET(skin_buffer, colour); token->value.data = PTRTOSKINOFFSET(skin_buffer, colour);
if (element->line == curr_viewport_element->line) if (element->line == curr_viewport_element->line)
{ {

View file

@ -110,9 +110,7 @@ static bool do_non_text_tags(struct gui_wps *gwps, struct skin_draw_info *info,
{ {
struct viewport_colour *col = SKINOFFSETTOPTR(skin_buffer, token->value.data); struct viewport_colour *col = SKINOFFSETTOPTR(skin_buffer, token->value.data);
if (!col) return false; if (!col) return false;
struct viewport *vp = SKINOFFSETTOPTR(skin_buffer, col->vp); skin_vp->vp.fg_pattern = col->colour;
if (!vp) return false;
vp->fg_pattern = col->colour;
skin_vp->fgbg_changed = true; skin_vp->fgbg_changed = true;
} }
break; break;
@ -120,9 +118,7 @@ static bool do_non_text_tags(struct gui_wps *gwps, struct skin_draw_info *info,
{ {
struct viewport_colour *col = SKINOFFSETTOPTR(skin_buffer, token->value.data); struct viewport_colour *col = SKINOFFSETTOPTR(skin_buffer, token->value.data);
if (!col) return false; if (!col) return false;
struct viewport *vp = SKINOFFSETTOPTR(skin_buffer, col->vp); skin_vp->vp.bg_pattern = col->colour;
if (!vp) return false;
vp->bg_pattern = col->colour;
skin_vp->fgbg_changed = true; skin_vp->fgbg_changed = true;
} }
break; break;

View file

@ -196,7 +196,6 @@ struct skin_viewport {
#endif #endif
}; };
struct viewport_colour { struct viewport_colour {
OFFSETTYPE(struct viewport *) vp;
unsigned colour; unsigned colour;
}; };