summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2006-07-13 21:34:36 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2006-07-13 21:34:36 +0000
commitaea41cc22110f25679609fe28a5d4d6677eb3662 (patch)
tree0bfe7847e8db75df3c8816ed9fccac82f4420f85
parent3c357a84076eaa0534d60b08f9fa3ead3cc291e9 (diff)
downloadrockbox-aea41cc22110f25679609fe28a5d4d6677eb3662.tar.gz
rockbox-aea41cc22110f25679609fe28a5d4d6677eb3662.zip
Patch #5630 by Andreas Mattsson - Minimize WPS subline swap time shift
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10211 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/gwps-common.c14
-rw-r--r--docs/CREDITS1
2 files changed, 10 insertions, 5 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index 171784c0ad..8501b36011 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -1592,6 +1592,7 @@ bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset,
bool update_line;
bool only_one_subline;
bool new_subline_refresh;
+ bool reset_subline;
int search;
int search_start;
struct wps_data *data = gwps->data;
@@ -1650,16 +1651,17 @@ bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset,
for (i = 0; i < WPS_MAX_LINES; i++)
{
+ reset_subline = (data->curr_subline[i] == SUBLINE_RESET);
new_subline_refresh = false;
only_one_subline = false;
/* if time to advance to next sub-line */
if (TIME_AFTER(current_tick, data->subline_expire_time[i] - 1) ||
- (data->curr_subline[i] == SUBLINE_RESET))
+ reset_subline)
{
/* search all sublines until the next subline with time > 0
is found or we get back to the subline we started with */
- if (data->curr_subline[i] == SUBLINE_RESET)
+ if (reset_subline)
search_start = 0;
else
search_start = data->curr_subline[i];
@@ -1669,7 +1671,7 @@ bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset,
/* wrap around if beyond last defined subline or WPS_MAX_SUBLINES */
if ((!data->format_lines[i][data->curr_subline[i]]) ||
- (data->curr_subline[i] == WPS_MAX_SUBLINES))
+ reset_subline)
{
if (data->curr_subline[i] == 1)
only_one_subline = true;
@@ -1682,7 +1684,8 @@ bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset,
only_one_subline)
{
/* no other subline with a time > 0 exists */
- data->subline_expire_time[i] = current_tick + 100 * HZ;
+ data->subline_expire_time[i] = (reset_subline?
+ current_tick : data->subline_expire_time[i]) + 100 * HZ;
break;
}
else
@@ -1700,7 +1703,8 @@ bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset,
if (data->time_mult[i][data->curr_subline[i]] > 0)
{
new_subline_refresh = true;
- data->subline_expire_time[i] = current_tick +
+ data->subline_expire_time[i] = (reset_subline?
+ current_tick : data->subline_expire_time[i]) +
BASE_SUBLINE_TIME * data->time_mult[i][data->curr_subline[i]];
break;
}
diff --git a/docs/CREDITS b/docs/CREDITS
index 6566d5962b..3e9dc85b3d 100644
--- a/docs/CREDITS
+++ b/docs/CREDITS
@@ -211,3 +211,4 @@ Alistair Marshall
Karl Ove Hufthammer
VĂ­ctor Zabalza
Ulrich Pegelow
+Andreas Mattsson