From 45b2d8802d1e8fcc47fd1148adb7b1173ad5b311 Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Sat, 22 Mar 2008 00:31:22 +0000 Subject: Reduce the shocking amount of RAM my viewports implementation was using. The first version stored an array of lines for each of the 16 possible viewports (MAX_VIEWPORTS * the number of lines on the LCD with a 5-pixel high font). This version reverts back to a single global array of lines, with each viewport specifying the first and last lines as indexes into that array. This also turns out to be simpler, reducing binsize a little as well. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16735 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/wps_debug.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'apps/gui/wps_debug.c') diff --git a/apps/gui/wps_debug.c b/apps/gui/wps_debug.c index 0c13fd2c22..9bff1d23ae 100644 --- a/apps/gui/wps_debug.c +++ b/apps/gui/wps_debug.c @@ -502,7 +502,8 @@ static void print_line_info(struct wps_data *data) DEBUGF("Number of viewports : %d\n", data->num_viewports); for (v = 0; v < data->num_viewports; v++) { - DEBUGF("vp %d: Number of lines: %d\n", v, data->viewports[v].num_lines); + DEBUGF("vp %d: First line: %d\n", v, data->viewports[v].first_line); + DEBUGF("vp %d: Last line: %d\n", v, data->viewports[v].last_line); } DEBUGF("Number of sublines : %d\n", data->num_sublines); DEBUGF("Number of tokens : %d\n", data->num_tokens); @@ -517,7 +518,7 @@ static void print_line_info(struct wps_data *data) data->viewports[v].vp.y, data->viewports[v].vp.width, data->viewports[v].vp.height); - for (i = 0, line = data->viewports[v].lines; i < data->viewports[v].num_lines; i++,line++) + for (i = data->viewports[v].first_line, line = &data->lines[data->viewports[v].first_line]; i <= data->viewports[v].last_line; i++,line++) { DEBUGF("Line %2d (num_sublines=%d, first_subline=%d)\n", i, line->num_sublines, line->first_subline_idx); @@ -527,7 +528,7 @@ static void print_line_info(struct wps_data *data) { DEBUGF(" Subline %d: first_token=%3d, last_token=%3d", j, subline->first_token_idx, - wps_last_token_index(data, v, i, j)); + wps_last_token_index(data, i, j)); if (subline->line_type & WPS_REFRESH_SCROLL) DEBUGF(", scrolled"); -- cgit v1.2.3