Merge branch 'master' into jgrpp
Remove 'byte' typedef
This commit is contained in:
@@ -692,7 +692,7 @@ static int UpdateAircraftSpeed(Aircraft *v, uint speed_limit = SPEED_LIMIT_NONE,
|
||||
* ~ acceleration * 77 (km-ish/h / 256)
|
||||
*/
|
||||
uint spd = v->acceleration * 77;
|
||||
byte t;
|
||||
uint8_t t;
|
||||
|
||||
/* Adjust speed limits by plane speed factor to prevent taxiing
|
||||
* and take-off speeds being too low. */
|
||||
@@ -710,7 +710,7 @@ static int UpdateAircraftSpeed(Aircraft *v, uint speed_limit = SPEED_LIMIT_NONE,
|
||||
speed_limit = v->vcache.cached_max_speed;
|
||||
}
|
||||
|
||||
v->subspeed = (t = v->subspeed) + (byte)spd;
|
||||
v->subspeed = (t = v->subspeed) + (uint8_t)spd;
|
||||
|
||||
/* Aircraft's current speed is used twice so that very fast planes are
|
||||
* forced to slow down rapidly in the short distance needed. The magic
|
||||
@@ -737,7 +737,7 @@ static int UpdateAircraftSpeed(Aircraft *v, uint speed_limit = SPEED_LIMIT_NONE,
|
||||
spd = v->GetOldAdvanceSpeed(spd);
|
||||
|
||||
spd += v->progress;
|
||||
v->progress = (byte)spd;
|
||||
v->progress = (uint8_t)spd;
|
||||
return spd >> 8;
|
||||
}
|
||||
|
||||
@@ -861,7 +861,7 @@ template int GetAircraftFlightLevel(Aircraft *v, bool takeoff);
|
||||
* @param rotation The rotation of the airport.
|
||||
* @return The index of the entry point
|
||||
*/
|
||||
static byte AircraftGetEntryPoint(const Aircraft *v, const AirportFTAClass *apc, Direction rotation)
|
||||
static uint8_t AircraftGetEntryPoint(const Aircraft *v, const AirportFTAClass *apc, Direction rotation)
|
||||
{
|
||||
assert(v != nullptr);
|
||||
assert(apc != nullptr);
|
||||
@@ -1775,7 +1775,7 @@ static void AircraftEventHandler_Flying(Aircraft *v, const AirportFTAClass *apc)
|
||||
/* {32,FLYING,NOTHING_block,37}, {32,LANDING,N,33}, {32,HELILANDING,N,41},
|
||||
* if it is an airplane, look for LANDING, for helicopter HELILANDING
|
||||
* it is possible to choose from multiple landing runways, so loop until a free one is found */
|
||||
byte landingtype = (v->subtype == AIR_HELICOPTER) ? HELILANDING : LANDING;
|
||||
uint8_t landingtype = (v->subtype == AIR_HELICOPTER) ? HELILANDING : LANDING;
|
||||
const AirportFTA *current = apc->layout[v->pos].next;
|
||||
while (current != nullptr) {
|
||||
if (current->heading == landingtype) {
|
||||
@@ -1922,8 +1922,8 @@ static bool AirportMove(Aircraft *v, const AirportFTAClass *apc)
|
||||
const AirportFTA *current = &apc->layout[v->pos];
|
||||
/* we have arrived in an important state (eg terminal, hangar, etc.) */
|
||||
if (current->heading == v->state) {
|
||||
byte prev_pos = v->pos; // location could be changed in state, so save it before-hand
|
||||
byte prev_state = v->state;
|
||||
uint8_t prev_pos = v->pos; // location could be changed in state, so save it before-hand
|
||||
uint8_t prev_state = v->state;
|
||||
_aircraft_state_handlers[v->state](v, apc);
|
||||
if (v->state != FLYING) v->previous_pos = prev_pos;
|
||||
if (v->state != prev_state || v->pos != prev_pos) UpdateAircraftCache(v);
|
||||
@@ -2059,7 +2059,7 @@ static const MovementTerminalMapping _airport_terminal_mapping[] = {
|
||||
* @param last_terminal Terminal number to stop examining.
|
||||
* @return A terminal or helipad has been found, and has been assigned to the aircraft.
|
||||
*/
|
||||
static bool FreeTerminal(Aircraft *v, byte i, byte last_terminal)
|
||||
static bool FreeTerminal(Aircraft *v, uint8_t i, uint8_t last_terminal)
|
||||
{
|
||||
assert(last_terminal <= lengthof(_airport_terminal_mapping));
|
||||
Station *st = Station::Get(v->targetairport);
|
||||
@@ -2259,8 +2259,8 @@ bool Aircraft::Tick()
|
||||
}
|
||||
|
||||
if (HasBit(this->vcache.cached_veh_flags, VCF_REDRAW_ON_SPEED_CHANGE)) {
|
||||
extern byte MapAircraftMovementState(const Aircraft *v);
|
||||
byte state = MapAircraftMovementState(this);
|
||||
extern uint8_t MapAircraftMovementState(const Aircraft *v);
|
||||
uint8_t state = MapAircraftMovementState(this);
|
||||
if (state != this->acache.image_movement_state) {
|
||||
this->InvalidateImageCacheOfChain();
|
||||
this->acache.image_movement_state = state;
|
||||
@@ -2317,7 +2317,7 @@ void UpdateAirplanesOnNewStation(const Station *st)
|
||||
if (!st->airport.HasHangar()) RemoveOrderFromAllVehicles(OT_GOTO_DEPOT, st->index, true);
|
||||
}
|
||||
|
||||
const char *AirportMovementStateToString(byte state)
|
||||
const char *AirportMovementStateToString(uint8_t state)
|
||||
{
|
||||
#define AMS(s) case s: return #s;
|
||||
switch (state) {
|
||||
|
Reference in New Issue
Block a user