diff options
| author | Dave Chapman <dave@dchapman.com> | 2008-03-22 00:31:22 +0000 |
|---|---|---|
| committer | Dave Chapman <dave@dchapman.com> | 2008-03-22 00:31:22 +0000 |
| commit | 45b2d8802d1e8fcc47fd1148adb7b1173ad5b311 (patch) | |
| tree | 849eea4153daaf7dfafd571ca6b93b6f985b1ff9 /apps/gui/wps_debug.c | |
| parent | 7ee63e22c58f4a7017136871e7b55dd702c5f460 (diff) | |
| download | rockbox-45b2d8802d1e8fcc47fd1148adb7b1173ad5b311.zip rockbox-45b2d8802d1e8fcc47fd1148adb7b1173ad5b311.tar.gz rockbox-45b2d8802d1e8fcc47fd1148adb7b1173ad5b311.tar.bz2 rockbox-45b2d8802d1e8fcc47fd1148adb7b1173ad5b311.tar.xz | |
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
Diffstat (limited to 'apps/gui/wps_debug.c')
| -rw-r--r-- | apps/gui/wps_debug.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/gui/wps_debug.c b/apps/gui/wps_debug.c index 0c13fd2..9bff1d2 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"); |