diff options
author | truelight <truelight@openttd.org> | 2007-06-22 20:04:21 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2007-06-22 20:04:21 +0000 |
commit | 2e19d3cf78c759e9583ac113c7a66f3e3e16ccb5 (patch) | |
tree | 487e36c90385f72fecad8d7a35fdb2c0192bec39 /src/genworld_gui.cpp | |
parent | e90b072c11f842839af974c4db4cff5c42cb49ae (diff) | |
download | openttd-2e19d3cf78c759e9583ac113c7a66f3e3e16ccb5.tar.xz |
(svn r10276) -Codechange: made a counter based on milliseconds and independent of the game-state to base double-click and TGP Generation Process on
-Codechange: renamed _timer_counter to _palette_animation_counter, as that is what it is
Diffstat (limited to 'src/genworld_gui.cpp')
-rw-r--r-- | src/genworld_gui.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index 4163d168a..43b204161 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -875,14 +875,12 @@ static void _SetGeneratingWorldProgress(gwp_class cls, uint progress, uint total _tp.percent = percent_table[cls]; } - /* Don't update the screen too often. So update it once in every 200ms. - * However, the _tick_counter increases by 8 every 30ms, so compensate - * for that. */ - if (!_network_dedicated && _tp.timer != 0 && _timer_counter - _tp.timer < (200 * 8 / 30)) return; + /* Don't update the screen too often. So update it once in every 200ms */ + if (!_network_dedicated && _tp.timer != 0 && _realtime_tick - _tp.timer < 200) return; /* Percentage is about the number of completed tasks, so 'current - 1' */ _tp.percent = percent_table[cls] + (percent_table[cls + 1] - percent_table[cls]) * (_tp.current == 0 ? 0 : _tp.current - 1) / _tp.total; - _tp.timer = _timer_counter; + _tp.timer = _realtime_tick; if (_network_dedicated) { static uint last_percent = 0; |