Codechange: Shuffle members of Vehicle to reduce size.

This reduces space wasted due to member alignment.
This commit is contained in:
Peter Nelson
2024-03-14 20:40:33 +00:00
committed by Peter Nelson
parent 3fc7b3b9a0
commit 322ca6ef54
4 changed files with 16 additions and 18 deletions

View File

@@ -85,21 +85,20 @@ struct TrainCache {
* 'Train' is either a loco or a wagon.
*/
struct Train final : public GroundVehicle<Train, VEH_TRAIN> {
uint16_t flags;
uint16_t crash_anim_pos; ///< Crash animation counter.
uint16_t wait_counter; ///< Ticks waiting in front of a signal, ticks being stuck or a counter for forced proceeding through signals.
TrainCache tcache;
/* Link between the two ends of a multiheaded engine */
Train *other_multiheaded_part;
uint16_t crash_anim_pos; ///< Crash animation counter.
RailTypes compatible_railtypes;
RailType railtype;
uint16_t flags;
TrackBits track;
TrainForceProceeding force_proceed;
RailType railtype;
RailTypes compatible_railtypes;
/** Ticks waiting in front of a signal, ticks being stuck or a counter for forced proceeding through signals. */
uint16_t wait_counter;
/** We don't want GCC to zero our struct! It already is zeroed and has an index! */
Train() : GroundVehicleBase() {}