Codechange: move tick-counter into TimerGameTick (#10712)
This commit is contained in:
@@ -67,8 +67,6 @@ void TimerManager<TimerGameCalendar>::Elapsed(TimerGameCalendar::TElapsed delta)
|
||||
{
|
||||
assert(delta == 1);
|
||||
|
||||
_tick_counter++;
|
||||
|
||||
if (_game_mode == GM_MENU) return;
|
||||
|
||||
TimerGameCalendar::date_fract++;
|
||||
|
@@ -16,6 +16,8 @@
|
||||
|
||||
#include "safeguards.h"
|
||||
|
||||
uint64 TimerGameTick::counter = 0;
|
||||
|
||||
template<>
|
||||
void IntervalTimer<TimerGameTick>::Elapsed(TimerGameTick::TElapsed delta)
|
||||
{
|
||||
@@ -51,6 +53,8 @@ void TimeoutTimer<TimerGameTick>::Elapsed(TimerGameTick::TElapsed delta)
|
||||
template<>
|
||||
void TimerManager<TimerGameTick>::Elapsed(TimerGameTick::TElapsed delta)
|
||||
{
|
||||
TimerGameTick::counter++;
|
||||
|
||||
for (auto timer : TimerManager<TimerGameTick>::GetTimers()) {
|
||||
timer->Elapsed(delta);
|
||||
}
|
||||
|
@@ -29,6 +29,8 @@ public:
|
||||
struct TStorage {
|
||||
uint elapsed;
|
||||
};
|
||||
|
||||
static uint64 counter; ///< Monotonic counter, in ticks, since start of game.
|
||||
};
|
||||
|
||||
#endif /* TIMER_GAME_TICK_H */
|
||||
|
Reference in New Issue
Block a user