Merge branch 'master' into jgrpp
Remove 'byte' typedef
This commit is contained in:
16
src/train.h
16
src/train.h
@@ -51,7 +51,7 @@ enum VehicleRailFlags {
|
||||
};
|
||||
|
||||
/** Modes for ignoring signals. */
|
||||
enum TrainForceProceeding : byte {
|
||||
enum TrainForceProceeding : uint8_t {
|
||||
TFP_NONE = 0, ///< Normal operation.
|
||||
TFP_STUCK = 1, ///< Proceed till next signal, but ignore being stuck till then. This includes force leaving depots.
|
||||
TFP_SIGNAL = 2, ///< Ignore next signal, after the signal ignore being stuck.
|
||||
@@ -76,7 +76,7 @@ enum RealisticBrakingConstants {
|
||||
RBC_BRAKE_POWER_PER_LENGTH = 15000, ///< Additional power-based brake force per unit of train length (excludes maglevs)
|
||||
};
|
||||
|
||||
byte FreightWagonMult(CargoID cargo);
|
||||
uint8_t FreightWagonMult(CargoID cargo);
|
||||
|
||||
void CheckTrainsLengths();
|
||||
|
||||
@@ -97,7 +97,7 @@ inline int GetTrainRealisticBrakingTargetDecelerationLimit(int acceleration_type
|
||||
}
|
||||
|
||||
/** Flags for TrainCache::cached_tflags */
|
||||
enum TrainCacheFlags : byte {
|
||||
enum TrainCacheFlags : uint8_t {
|
||||
TCF_NONE = 0, ///< No flags
|
||||
TCF_TILT = 0x01, ///< Train can tilt; feature provides a bonus in curves.
|
||||
TCF_RL_BRAKING = 0x02, ///< Train realistic braking (movement physics) in effect for this vehicle
|
||||
@@ -119,7 +119,7 @@ struct TrainCache {
|
||||
uint16_t cached_uncapped_decel; ///< Uncapped cached deceleration for realistic braking lookahead purposes
|
||||
uint8_t cached_deceleration; ///< Cached deceleration for realistic braking lookahead purposes
|
||||
|
||||
byte user_def_data; ///< Cached property 0x25. Can be set by Callback 0x36.
|
||||
uint8_t user_def_data; ///< Cached property 0x25. Can be set by Callback 0x36.
|
||||
|
||||
int16_t cached_curve_speed_mod; ///< curve speed modifier of the entire train
|
||||
uint16_t cached_max_curve_speed; ///< max consist speed limited by curves
|
||||
@@ -142,7 +142,7 @@ struct Train final : public GroundVehicle<Train, VEH_TRAIN> {
|
||||
RailTypes compatible_railtypes;
|
||||
|
||||
TrainForceProceeding force_proceed;
|
||||
byte critical_breakdown_count; ///< Counter for the number of critical breakdowns since last service
|
||||
uint8_t critical_breakdown_count; ///< Counter for the number of critical breakdowns since last service
|
||||
|
||||
/** Ticks waiting in front of a signal, ticks being stuck or a counter for forced proceeding through signals. */
|
||||
uint16_t wait_counter;
|
||||
@@ -402,7 +402,7 @@ protected: // These functions should not be called outside acceleration code.
|
||||
* Allows to know the tractive effort value that this vehicle will use.
|
||||
* @return Tractive effort value from the engine.
|
||||
*/
|
||||
inline byte GetTractiveEffort() const
|
||||
inline uint8_t GetTractiveEffort() const
|
||||
{
|
||||
return GetVehicleProperty(this, PROP_TRAIN_TRACTIVE_EFFORT, RailVehInfo(this->engine_type)->tractive_effort);
|
||||
}
|
||||
@@ -411,7 +411,7 @@ protected: // These functions should not be called outside acceleration code.
|
||||
* Gets the area used for calculating air drag.
|
||||
* @return Area of the engine in m^2.
|
||||
*/
|
||||
inline byte GetAirDragArea() const
|
||||
inline uint8_t GetAirDragArea() const
|
||||
{
|
||||
/* Air drag is higher in tunnels due to the limited cross-section. */
|
||||
return (this->track & TRACK_BIT_WORMHOLE && this->vehstatus & VS_HIDDEN) ? 28 : 14;
|
||||
@@ -421,7 +421,7 @@ protected: // These functions should not be called outside acceleration code.
|
||||
* Gets the air drag coefficient of this vehicle.
|
||||
* @return Air drag value from the engine.
|
||||
*/
|
||||
inline byte GetAirDrag() const
|
||||
inline uint8_t GetAirDrag() const
|
||||
{
|
||||
return RailVehInfo(this->engine_type)->air_drag;
|
||||
}
|
||||
|
Reference in New Issue
Block a user