(svn r24166) -Codechange: Turn NewGRFClass::Get(Tid, uint) and GetCount(Tid) into non-static members GetSpec(uint) and GetSpecCount().

This commit is contained in:
frosch
2012-04-22 16:28:14 +00:00
parent cb43494488
commit 0f0e7e43cf
9 changed files with 72 additions and 80 deletions

View File

@@ -744,7 +744,7 @@ static CommandCost CheckFlatLandRailStation(TileArea tile_area, DoCommandFlag fl
int allowed_z = -1;
uint invalid_dirs = 5 << axis;
const StationSpec *statspec = StationClass::Get(spec_class, spec_index);
const StationSpec *statspec = StationClass::Get(spec_class)->GetSpec(spec_index);
bool slope_cb = statspec != NULL && HasBit(statspec->callback_mask, CBM_STATION_SLOPE_CHECK);
TILE_AREA_LOOP(tile_cur, tile_area) {
@@ -1106,7 +1106,7 @@ CommandCost CmdBuildRailStation(TileIndex tile_org, DoCommandFlag flags, uint32
/* Check if the given station class is valid */
if ((uint)spec_class >= StationClass::GetCount() || spec_class == STAT_CLASS_WAYP) return CMD_ERROR;
if (spec_index >= StationClass::GetCount(spec_class)) return CMD_ERROR;
if (spec_index >= StationClass::Get(spec_class)->GetSpecCount()) return CMD_ERROR;
if (plat_len == 0 || numtracks == 0) return CMD_ERROR;
int w_org, h_org;
@@ -1175,7 +1175,7 @@ CommandCost CmdBuildRailStation(TileIndex tile_org, DoCommandFlag flags, uint32
}
/* Check if we can allocate a custom stationspec to this station */
const StationSpec *statspec = StationClass::Get(spec_class, spec_index);
const StationSpec *statspec = StationClass::Get(spec_class)->GetSpec(spec_index);
int specindex = AllocateSpecToStation(statspec, st, (flags & DC_EXEC) != 0);
if (specindex == -1) return_cmd_error(STR_ERROR_TOO_MANY_STATION_SPECS);