Changeset - r28175:1fe2794b9bc5
[Not reviewed]
master
0 3 0
Tyler Trahan - 13 months ago 2023-11-20 17:00:34
tyler@tylertrahan.com
Codechange: Define a TickCounter variable type for TimerGameTick::counter
3 files changed with 4 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/timer/timer_game_tick.cpp
Show inline comments
 
@@ -16,7 +16,7 @@
 

	
 
#include "../safeguards.h"
 

	
 
uint64_t TimerGameTick::counter = 0;
 
TimerGameTick::TickCounter TimerGameTick::counter = 0;
 

	
 
template<>
 
void IntervalTimer<TimerGameTick>::Elapsed(TimerGameTick::TElapsed delta)
src/timer/timer_game_tick.h
Show inline comments
 
@@ -22,6 +22,7 @@
 
class TimerGameTick {
 
public:
 
	using Ticks = int32_t; ///< The type to store ticks in
 
	using TickCounter = uint64_t; ///< The type that the tick counter is stored in
 

	
 
	using TPeriod = uint;
 
	using TElapsed = uint;
 
@@ -29,7 +30,7 @@ public:
 
		uint elapsed;
 
	};
 

	
 
	static uint64_t counter; ///< Monotonic counter, in ticks, since start of game.
 
	static TickCounter counter; ///< Monotonic counter, in ticks, since start of game.
 
};
 

	
 
/**
src/vehicle_base.h
Show inline comments
 
@@ -331,7 +331,7 @@ public:
 

	
 
	StationID last_station_visited;     ///< The last station we stopped at.
 
	StationID last_loading_station;     ///< Last station the vehicle has stopped at and could possibly leave from with any cargo loaded.
 
	uint64_t last_loading_tick;         ///< Last time (based on TimerGameTick counter) the vehicle has stopped at a station and could possibly leave with any cargo loaded.
 
	TimerGameTick::TickCounter last_loading_tick; ///< Last TimerGameTick::counter tick that the vehicle has stopped at a station and could possibly leave with any cargo loaded.
 

	
 
	CargoID cargo_type;                 ///< type of cargo this vehicle is carrying
 
	byte cargo_subtype;                 ///< Used for livery refits (NewGRF variations)
0 comments (0 inline, 0 general)