@@ -72,10 +72,10 @@ WaterClass GetEffectiveWaterClass(TileIndex tile)
|
||||
NOT_REACHED();
|
||||
}
|
||||
|
||||
static const uint16 _ship_sprites[] = {0x0E5D, 0x0E55, 0x0E65, 0x0E6D};
|
||||
static const uint16_t _ship_sprites[] = {0x0E5D, 0x0E55, 0x0E65, 0x0E6D};
|
||||
|
||||
template <>
|
||||
bool IsValidImageIndex<VEH_SHIP>(uint8 image_index)
|
||||
bool IsValidImageIndex<VEH_SHIP>(uint8_t image_index)
|
||||
{
|
||||
return image_index < lengthof(_ship_sprites);
|
||||
}
|
||||
@@ -88,7 +88,7 @@ static inline TrackBits GetTileShipTrackStatus(TileIndex tile)
|
||||
static void GetShipIcon(EngineID engine, EngineImageType image_type, VehicleSpriteSeq *result)
|
||||
{
|
||||
const Engine *e = Engine::Get(engine);
|
||||
uint8 spritenum = e->u.ship.image_index;
|
||||
uint8_t spritenum = e->u.ship.image_index;
|
||||
|
||||
if (is_custom_sprite(spritenum)) {
|
||||
GetCustomVehicleIcon(engine, DIR_W, image_type, result);
|
||||
@@ -138,7 +138,7 @@ void GetShipSpriteSize(EngineID engine, uint &width, uint &height, int &xoffs, i
|
||||
|
||||
void Ship::GetImage(Direction direction, EngineImageType image_type, VehicleSpriteSeq *result) const
|
||||
{
|
||||
uint8 spritenum = this->spritenum;
|
||||
uint8_t spritenum = this->spritenum;
|
||||
|
||||
if (image_type == EIT_ON_MAP) direction = this->rotation;
|
||||
|
||||
@@ -327,7 +327,7 @@ TileIndex Ship::GetOrderStationLocation(StationID station)
|
||||
|
||||
void Ship::UpdateDeltaXY()
|
||||
{
|
||||
static const int8 _delta_xy_table[8][4] = {
|
||||
static const int8_t _delta_xy_table[8][4] = {
|
||||
/* y_extent, x_extent, y_offs, x_offs */
|
||||
{ 6, 6, -3, -3}, // N
|
||||
{ 6, 32, -3, -16}, // NE
|
||||
@@ -339,7 +339,7 @@ void Ship::UpdateDeltaXY()
|
||||
{32, 6, -16, -3}, // NW
|
||||
};
|
||||
|
||||
const int8 *bb = _delta_xy_table[this->rotation];
|
||||
const int8_t *bb = _delta_xy_table[this->rotation];
|
||||
this->x_offs = bb[3];
|
||||
this->y_offs = bb[2];
|
||||
this->x_extent = bb[1];
|
||||
@@ -382,7 +382,7 @@ int Ship::GetEffectiveMaxSpeed() const
|
||||
}
|
||||
|
||||
/* clamp speed to be no less than lower of 5mph and 1/8 of base speed */
|
||||
return std::max<uint16>(max_speed, std::min<uint16>(10, (this->vcache.cached_max_speed + 7) >> 3));
|
||||
return std::max<uint16_t>(max_speed, std::min<uint16_t>(10, (this->vcache.cached_max_speed + 7) >> 3));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -587,7 +587,7 @@ static Track ChooseShipTrack(Ship *v, TileIndex tile, DiagDirection enterdir, Tr
|
||||
}
|
||||
}
|
||||
DEBUG_UPDATESTATECHECKSUM("ChooseShipTrack: v: %u, path_found: %d, track: %d", v->index, path_found, track);
|
||||
UpdateStateChecksum((((uint64) v->index) << 32) | (path_found << 16) | track);
|
||||
UpdateStateChecksum((((uint64_t) v->index) << 32) | (path_found << 16) | track);
|
||||
|
||||
v->HandlePathfindingResult(path_found);
|
||||
return track;
|
||||
@@ -1096,7 +1096,7 @@ static void ShipController(Ship *v)
|
||||
bool Ship::Tick()
|
||||
{
|
||||
DEBUG_UPDATESTATECHECKSUM("Ship::Tick: v: %u, x: %d, y: %d", this->index, this->x_pos, this->y_pos);
|
||||
UpdateStateChecksum((((uint64) this->x_pos) << 32) | this->y_pos);
|
||||
UpdateStateChecksum((((uint64_t) this->x_pos) << 32) | this->y_pos);
|
||||
if (!((this->vehstatus & VS_STOPPED) || this->IsWaitingInDepot())) this->running_ticks++;
|
||||
|
||||
ShipController(this);
|
||||
|
Reference in New Issue
Block a user