diff options
Diffstat (limited to 'apps/gui/gwps-common.c')
-rw-r--r-- | apps/gui/gwps-common.c | 14 |
1 files changed, 9 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, | |||
1592 | bool update_line; | 1592 | bool update_line; |
1593 | bool only_one_subline; | 1593 | bool only_one_subline; |
1594 | bool new_subline_refresh; | 1594 | bool new_subline_refresh; |
1595 | bool reset_subline; | ||
1595 | int search; | 1596 | int search; |
1596 | int search_start; | 1597 | int search_start; |
1597 | struct wps_data *data = gwps->data; | 1598 | struct wps_data *data = gwps->data; |
@@ -1650,16 +1651,17 @@ bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset, | |||
1650 | 1651 | ||
1651 | for (i = 0; i < WPS_MAX_LINES; i++) | 1652 | for (i = 0; i < WPS_MAX_LINES; i++) |
1652 | { | 1653 | { |
1654 | reset_subline = (data->curr_subline[i] == SUBLINE_RESET); | ||
1653 | new_subline_refresh = false; | 1655 | new_subline_refresh = false; |
1654 | only_one_subline = false; | 1656 | only_one_subline = false; |
1655 | 1657 | ||
1656 | /* if time to advance to next sub-line */ | 1658 | /* if time to advance to next sub-line */ |
1657 | if (TIME_AFTER(current_tick, data->subline_expire_time[i] - 1) || | 1659 | if (TIME_AFTER(current_tick, data->subline_expire_time[i] - 1) || |
1658 | (data->curr_subline[i] == SUBLINE_RESET)) | 1660 | reset_subline) |
1659 | { | 1661 | { |
1660 | /* search all sublines until the next subline with time > 0 | 1662 | /* search all sublines until the next subline with time > 0 |
1661 | is found or we get back to the subline we started with */ | 1663 | is found or we get back to the subline we started with */ |
1662 | if (data->curr_subline[i] == SUBLINE_RESET) | 1664 | if (reset_subline) |
1663 | search_start = 0; | 1665 | search_start = 0; |
1664 | else | 1666 | else |
1665 | search_start = data->curr_subline[i]; | 1667 | search_start = data->curr_subline[i]; |
@@ -1669,7 +1671,7 @@ bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset, | |||
1669 | 1671 | ||
1670 | /* wrap around if beyond last defined subline or WPS_MAX_SUBLINES */ | 1672 | /* wrap around if beyond last defined subline or WPS_MAX_SUBLINES */ |
1671 | if ((!data->format_lines[i][data->curr_subline[i]]) || | 1673 | if ((!data->format_lines[i][data->curr_subline[i]]) || |
1672 | (data->curr_subline[i] == WPS_MAX_SUBLINES)) | 1674 | reset_subline) |
1673 | { | 1675 | { |
1674 | if (data->curr_subline[i] == 1) | 1676 | if (data->curr_subline[i] == 1) |
1675 | only_one_subline = true; | 1677 | only_one_subline = true; |
@@ -1682,7 +1684,8 @@ bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset, | |||
1682 | only_one_subline) | 1684 | only_one_subline) |
1683 | { | 1685 | { |
1684 | /* no other subline with a time > 0 exists */ | 1686 | /* no other subline with a time > 0 exists */ |
1685 | data->subline_expire_time[i] = current_tick + 100 * HZ; | 1687 | data->subline_expire_time[i] = (reset_subline? |
1688 | current_tick : data->subline_expire_time[i]) + 100 * HZ; | ||
1686 | break; | 1689 | break; |
1687 | } | 1690 | } |
1688 | else | 1691 | else |
@@ -1700,7 +1703,8 @@ bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset, | |||
1700 | if (data->time_mult[i][data->curr_subline[i]] > 0) | 1703 | if (data->time_mult[i][data->curr_subline[i]] > 0) |
1701 | { | 1704 | { |
1702 | new_subline_refresh = true; | 1705 | new_subline_refresh = true; |
1703 | data->subline_expire_time[i] = current_tick + | 1706 | data->subline_expire_time[i] = (reset_subline? |
1707 | current_tick : data->subline_expire_time[i]) + | ||
1704 | BASE_SUBLINE_TIME * data->time_mult[i][data->curr_subline[i]]; | 1708 | BASE_SUBLINE_TIME * data->time_mult[i][data->curr_subline[i]]; |
1705 | break; | 1709 | break; |
1706 | } | 1710 | } |