Merge branch 'master' into jgrpp
Remove 'byte' typedef
This commit is contained in:
@@ -177,10 +177,10 @@ static CommandCost IsValidTileForWaypoint(TileIndex tile, Axis axis, StationID *
|
||||
return CommandCost();
|
||||
}
|
||||
|
||||
extern void GetStationLayout(byte *layout, uint numtracks, uint plat_len, const StationSpec *statspec);
|
||||
extern void GetStationLayout(uint8_t *layout, uint numtracks, uint plat_len, const StationSpec *statspec);
|
||||
extern CommandCost FindJoiningWaypoint(StationID existing_station, StationID station_to_join, bool adjacent, TileArea ta, Waypoint **wp, bool is_road);
|
||||
extern CommandCost CanExpandRailStation(const BaseStation *st, TileArea &new_ta);
|
||||
extern CommandCost IsRailStationBridgeAboveOk(TileIndex tile, const StationSpec *statspec, byte layout);
|
||||
extern CommandCost IsRailStationBridgeAboveOk(TileIndex tile, const StationSpec *statspec, uint8_t layout);
|
||||
|
||||
/**
|
||||
* Convert existing rail to waypoint. Eg build a waypoint station over
|
||||
@@ -205,8 +205,8 @@ CommandCost CmdBuildRailWaypoint(TileIndex start_tile, DoCommandFlag flags, uint
|
||||
{
|
||||
/* Unpack parameters */
|
||||
Axis axis = Extract<Axis, 6, 1>(p1);
|
||||
byte width = GB(p1, 8, 8);
|
||||
byte height = GB(p1, 16, 8);
|
||||
uint8_t width = GB(p1, 8, 8);
|
||||
uint8_t height = GB(p1, 16, 8);
|
||||
bool adjacent = HasBit(p1, 24);
|
||||
|
||||
StationClassID spec_class = Extract<StationClassID, 0, 8>(p2);
|
||||
@@ -219,7 +219,7 @@ CommandCost CmdBuildRailWaypoint(TileIndex start_tile, DoCommandFlag flags, uint
|
||||
if (spec_index >= StationClass::Get(spec_class)->GetSpecCount()) return CMD_ERROR;
|
||||
|
||||
/* The number of parts to build */
|
||||
byte count = axis == AXIS_X ? height : width;
|
||||
uint8_t count = axis == AXIS_X ? height : width;
|
||||
|
||||
if ((axis == AXIS_X ? width : height) != 1) return CMD_ERROR;
|
||||
if (count == 0 || count > _settings_game.station.station_spread) return CMD_ERROR;
|
||||
@@ -231,7 +231,7 @@ CommandCost CmdBuildRailWaypoint(TileIndex start_tile, DoCommandFlag flags, uint
|
||||
if (distant_join && (!_settings_game.station.distant_join_stations || !Waypoint::IsValidID(station_to_join))) return CMD_ERROR;
|
||||
|
||||
const StationSpec *spec = StationClass::Get(spec_class)->GetSpec(spec_index);
|
||||
byte *layout_ptr = AllocaM(byte, count);
|
||||
uint8_t *layout_ptr = AllocaM(uint8_t, count);
|
||||
if (spec == nullptr) {
|
||||
/* The layout must be 0 for the 'normal' waypoints by design. */
|
||||
memset(layout_ptr, 0, count);
|
||||
@@ -306,12 +306,12 @@ CommandCost CmdBuildRailWaypoint(TileIndex start_tile, DoCommandFlag flags, uint
|
||||
|
||||
wp->UpdateVirtCoord();
|
||||
|
||||
byte map_spec_index = AllocateSpecToStation(spec, wp, true);
|
||||
uint8_t map_spec_index = AllocateSpecToStation(spec, wp, true);
|
||||
|
||||
Company *c = Company::Get(wp->owner);
|
||||
for (int i = 0; i < count; i++) {
|
||||
TileIndex tile = start_tile + i * offset;
|
||||
byte old_specindex = HasStationTileRail(tile) ? GetCustomStationSpecIndex(tile) : 0;
|
||||
uint8_t old_specindex = HasStationTileRail(tile) ? GetCustomStationSpecIndex(tile) : 0;
|
||||
if (!HasStationTileRail(tile)) c->infrastructure.station++;
|
||||
bool reserved = IsTileType(tile, MP_RAILWAY) ?
|
||||
HasBit(GetRailReservationTrackBits(tile), AxisToTrack(axis)) :
|
||||
@@ -361,8 +361,8 @@ CommandCost CmdBuildRailWaypoint(TileIndex start_tile, DoCommandFlag flags, uint
|
||||
CommandCost CmdBuildRoadWaypoint(TileIndex start_tile, DoCommandFlag flags, uint32_t p1, uint32_t p2, uint64_t p3, const char *text, const CommandAuxiliaryBase *aux_data)
|
||||
{
|
||||
StationID station_to_join = GB(p2, 16, 16);
|
||||
byte width = GB(p1, 0, 8);
|
||||
byte height = GB(p1, 8, 8);
|
||||
uint8_t width = GB(p1, 0, 8);
|
||||
uint8_t height = GB(p1, 8, 8);
|
||||
bool adjacent = HasBit(p1, 16);
|
||||
Axis axis = Extract<Axis, 17, 1>(p1);
|
||||
|
||||
@@ -376,7 +376,7 @@ CommandCost CmdBuildRoadWaypoint(TileIndex start_tile, DoCommandFlag flags, uint
|
||||
const RoadStopSpec *spec = RoadStopClass::Get(spec_class)->GetSpec(spec_index);
|
||||
|
||||
/* The number of parts to build */
|
||||
byte count = axis == AXIS_X ? height : width;
|
||||
uint8_t count = axis == AXIS_X ? height : width;
|
||||
|
||||
if ((axis == AXIS_X ? width : height) != 1) return CMD_ERROR;
|
||||
if (count == 0 || count > _settings_game.station.station_spread) return CMD_ERROR;
|
||||
@@ -455,7 +455,7 @@ CommandCost CmdBuildRoadWaypoint(TileIndex start_tile, DoCommandFlag flags, uint
|
||||
|
||||
wp->UpdateVirtCoord();
|
||||
|
||||
byte map_spec_index = AllocateRoadStopSpecToStation(spec, wp, true);
|
||||
uint8_t map_spec_index = AllocateRoadStopSpecToStation(spec, wp, true);
|
||||
|
||||
/* Check every tile in the area. */
|
||||
for (TileIndex cur_tile : roadstop_area) {
|
||||
|
Reference in New Issue
Block a user