diff options
author | Charles Pigott <charlespigott@googlemail.com> | 2019-04-21 22:25:54 +0100 |
---|---|---|
committer | PeterN <peter@fuzzle.org> | 2019-04-29 17:40:22 +0100 |
commit | 69a6c494bfb81e332e63376f4577a104a5a8e679 (patch) | |
tree | cd34f49260fc2ac6cd825082f8d34f37e2e21f76 /src/vehicle_type.h | |
parent | 96a47877104d99e117b9fd97e43908f9e9567ec5 (diff) | |
download | openttd-69a6c494bfb81e332e63376f4577a104a5a8e679.tar.xz |
Codechange: Set VehicleType's base type to byte instead of using VehicleTypeByte
Diffstat (limited to 'src/vehicle_type.h')
-rw-r--r-- | src/vehicle_type.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/vehicle_type.h b/src/vehicle_type.h index 1bc5bcef4..74bd5660d 100644 --- a/src/vehicle_type.h +++ b/src/vehicle_type.h @@ -19,8 +19,8 @@ typedef uint32 VehicleID; static const int GROUND_ACCELERATION = 9800; ///< Acceleration due to gravity, 9.8 m/s^2 -/** Available vehicle types. */ -enum VehicleType { +/** Available vehicle types. It needs to be 8bits, because we save and load it as such */ +enum VehicleType : byte { VEH_BEGIN, VEH_TRAIN = VEH_BEGIN, ///< %Train vehicle type. @@ -39,8 +39,6 @@ enum VehicleType { DECLARE_POSTFIX_INCREMENT(VehicleType) /** Helper information for extract tool. */ template <> struct EnumPropsT<VehicleType> : MakeEnumPropsT<VehicleType, byte, VEH_TRAIN, VEH_END, VEH_INVALID, 3> {}; -/** It needs to be 8bits, because we save and load it as such */ -typedef SimpleTinyEnumT<VehicleType, byte> VehicleTypeByte; struct Vehicle; struct Train; @@ -53,7 +51,7 @@ struct DisasterVehicle; /** Base vehicle class. */ struct BaseVehicle { - VehicleTypeByte type; ///< Type of vehicle + VehicleType type; ///< Type of vehicle }; static const VehicleID INVALID_VEHICLE = 0xFFFFF; ///< Constant representing a non-existing vehicle. |