From 8cb74438bc7c282f1ac9803afd1d1f9e68af17ae Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Wed, 2 Sep 2009 02:55:33 +0000 Subject: Almost the last of the skin ram wastage fixing... This one moved the line/subline handling into the alloced buffer and links them more sensibly with their viewports. now it works something like this: a skin is a list of viewports, each viewport has a list of lines, each line is a list of sublines, each subline has an *index* of its first and last tokens... git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22602 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/skin_engine/wps_internals.h | 43 +++++++++++------------------------- 1 file changed, 13 insertions(+), 30 deletions(-) (limited to 'apps/gui/skin_engine/wps_internals.h') diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h index fbd18b9f73..bcc68a88f0 100644 --- a/apps/gui/skin_engine/wps_internals.h +++ b/apps/gui/skin_engine/wps_internals.h @@ -160,12 +160,16 @@ struct wps_subline { Tokens of this subline end where tokens for the next subline begin. */ unsigned short first_token_idx; + unsigned short last_token_idx; /* Bit or'ed WPS_REFRESH_xxx */ unsigned char line_type; /* How long the subline should be displayed, in 10ths of sec */ unsigned char time_mult; + + /* pointer to the next subline in this line */ + struct wps_subline *next; }; /* Description of a line on the WPS. A line is a set of sublines. @@ -173,19 +177,18 @@ struct wps_subline { the next subline of the line is displayed. And so on. */ struct wps_line { - /* Number of sublines in this line */ - signed char num_sublines; - - /* Number (0-based) of the subline within this line currently being displayed */ - signed char curr_subline; - - /* Index of the first subline of this line in the subline array. - Sublines for this line end where sublines for the next line begin. */ - unsigned short first_subline_idx; + /* Linked list of all the sublines on this line, + * a line *must* have at least one subline so no need to add an extra pointer */ + struct wps_subline sublines; + /* pointer to the current subline */ + struct wps_subline *curr_subline; /* When the next subline of this line should be displayed (absolute time value in ticks) */ long subline_expire_time; + + /* pointer to the next line */ + struct wps_line *next; }; #define VP_DRAW_HIDEABLE 0x1 @@ -196,9 +199,7 @@ struct wps_line { struct skin_viewport { struct viewport vp; /* The LCD viewport struct */ struct progressbar *pb; - /* Indexes of the first and last lines belonging to this viewport in the - lines[] array */ - int first_line, last_line; + struct wps_line *lines; char hidden_flags; char label; }; @@ -259,20 +260,8 @@ struct wps_data bool remote_wps; #endif - /* Number of lines in the WPS. During WPS parsing, this is - the index of the line being parsed. */ - int num_lines; - - /* Number of viewports in the WPS */ struct skin_token_list *viewports; - struct wps_line lines[WPS_MAX_LINES]; - - /* Total number of sublines in the WPS. During WPS parsing, this is - the index of the subline where the parsed tokens are added to. */ - int num_sublines; - struct wps_subline sublines[WPS_MAX_SUBLINES]; - /* Total number of tokens in the WPS. During WPS parsing, this is the index of the token being parsed. */ int num_tokens; @@ -286,12 +275,6 @@ struct wps_data unsigned int button_time_volume; }; -/* Returns the index of the last subline's token in the token array. - line - 0-based line number - subline - 0-based subline number within the line - */ -int skin_last_token_index(struct wps_data *data, int line, int subline); - /* wps_data end */ /* wps_state -- cgit v1.2.3