genworld_gui.c
changeset 5052 afa697e85f79
parent 5048 0223e3641590
child 5213 f493c647f079
equal deleted inserted replaced
5051:0ea8270d080b 5052:afa697e85f79
   817 		_tp.current = progress;
   817 		_tp.current = progress;
   818 		_tp.total   = total;
   818 		_tp.total   = total;
   819 		_tp.percent = percent_table[class];
   819 		_tp.percent = percent_table[class];
   820 	}
   820 	}
   821 
   821 
   822 	/* Don't update the screen too often. So update it once in the
   822 	/* Don't update the screen too often. So update it once in every 200ms.
   823 	 * _patches.progress_update_interval. However, the _tick_counter
   823 	 * However, the _tick_counter increases by 8 every 30ms, so compensate
   824 	 * increases with 8 every 30ms, so compensate for that. */
   824 	 * for that. */
   825 	if (!_network_dedicated && _tp.timer != 0 && _timer_counter - _tp.timer < (_patches.progress_update_interval * 8 / 30)) return;
   825 	if (!_network_dedicated && _tp.timer != 0 && _timer_counter - _tp.timer < (200 * 8 / 30)) return;
   826 
   826 
   827 	/* Percentage is about the number of completed tasks, so 'current - 1' */
   827 	/* Percentage is about the number of completed tasks, so 'current - 1' */
   828 	_tp.percent = percent_table[class] + (percent_table[class + 1] - percent_table[class]) * (_tp.current == 0 ? 0 : _tp.current - 1) / _tp.total;
   828 	_tp.percent = percent_table[class] + (percent_table[class + 1] - percent_table[class]) * (_tp.current == 0 ? 0 : _tp.current - 1) / _tp.total;
   829 	_tp.timer = _timer_counter;
   829 	_tp.timer = _timer_counter;
   830 
   830