mirror of https://github.com/OpenTTD/OpenTTD
(svn r20402) -Codechange: rename the airport/station class id to something slightly more generic
parent
6d6939f844
commit
2d3ee123af
|
@ -175,7 +175,7 @@
|
||||||
if (spec == NULL) {
|
if (spec == NULL) {
|
||||||
DEBUG(grf, 1, "%s returned an invalid station ID for 'AI construction/purchase selection (18)' callback", file->filename);
|
DEBUG(grf, 1, "%s returned an invalid station ID for 'AI construction/purchase selection (18)' callback", file->filename);
|
||||||
} else {
|
} else {
|
||||||
p2 |= spec->sclass | index << 8;
|
p2 |= spec->cls_id | index << 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1151,7 +1151,7 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte
|
||||||
|
|
||||||
/* Swap classid because we read it in BE meaning WAYP or DFLT */
|
/* Swap classid because we read it in BE meaning WAYP or DFLT */
|
||||||
uint32 classid = buf->ReadDWord();
|
uint32 classid = buf->ReadDWord();
|
||||||
(*spec)->sclass = AllocateStationClass(BSWAP32(classid));
|
(*spec)->cls_id = AllocateStationClass(BSWAP32(classid));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4270,8 +4270,8 @@ static void FeatureNewName(ByteReader *buf)
|
||||||
if (_cur_grffile->stations == NULL || _cur_grffile->stations[GB(id, 0, 8)] == NULL) {
|
if (_cur_grffile->stations == NULL || _cur_grffile->stations[GB(id, 0, 8)] == NULL) {
|
||||||
grfmsg(1, "FeatureNewName: Attempt to name undefined station 0x%X, ignoring", GB(id, 0, 8));
|
grfmsg(1, "FeatureNewName: Attempt to name undefined station 0x%X, ignoring", GB(id, 0, 8));
|
||||||
} else {
|
} else {
|
||||||
StationClassID sclass = _cur_grffile->stations[GB(id, 0, 8)]->sclass;
|
StationClassID cls_id = _cur_grffile->stations[GB(id, 0, 8)]->cls_id;
|
||||||
SetStationClassName(sclass, AddGRFString(_cur_grffile->grfid, id, lang, new_scheme, name, STR_UNDEFINED));
|
SetStationClassName(cls_id, AddGRFString(_cur_grffile->grfid, id, lang, new_scheme, name, STR_UNDEFINED));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -153,8 +153,8 @@ uint GetNumAirportsInClass(AirportClassID id)
|
||||||
*/
|
*/
|
||||||
static void BindAirportSpecToClass(AirportSpec *as)
|
static void BindAirportSpecToClass(AirportSpec *as)
|
||||||
{
|
{
|
||||||
assert(as->aclass < APC_MAX);
|
assert(as->cls_id < APC_MAX);
|
||||||
AirportClass *airport_class = &_airport_classes[as->aclass];
|
AirportClass *airport_class = &_airport_classes[as->cls_id];
|
||||||
|
|
||||||
int i = airport_class->airports++;
|
int i = airport_class->airports++;
|
||||||
airport_class->spec = ReallocT(airport_class->spec, airport_class->airports);
|
airport_class->spec = ReallocT(airport_class->spec, airport_class->airports);
|
||||||
|
|
|
@ -72,7 +72,7 @@ struct AirportSpec {
|
||||||
Year max_year; ///< last year the airport is available
|
Year max_year; ///< last year the airport is available
|
||||||
StringID name; ///< name of this airport
|
StringID name; ///< name of this airport
|
||||||
TTDPAirportType ttd_airport_type; ///< ttdpatch airport type (Small/Large/Helipad/Oilrig)
|
TTDPAirportType ttd_airport_type; ///< ttdpatch airport type (Small/Large/Helipad/Oilrig)
|
||||||
AirportClassID aclass; ///< the class to which this airport type belongs
|
AirportClassID cls_id; ///< the class to which this airport type belongs
|
||||||
SpriteID preview_sprite; ///< preview sprite for this airport
|
SpriteID preview_sprite; ///< preview sprite for this airport
|
||||||
/* Newgrf data */
|
/* Newgrf data */
|
||||||
bool enabled; ///< entity still avaible (by default true).newgrf can disable it, though
|
bool enabled; ///< entity still avaible (by default true).newgrf can disable it, though
|
||||||
|
|
|
@ -176,8 +176,8 @@ void SetCustomStationSpec(StationSpec *statspec)
|
||||||
/* If the station has already been allocated, don't reallocate it. */
|
/* If the station has already been allocated, don't reallocate it. */
|
||||||
if (statspec->allocated) return;
|
if (statspec->allocated) return;
|
||||||
|
|
||||||
assert(statspec->sclass < STAT_CLASS_MAX);
|
assert(statspec->cls_id < STAT_CLASS_MAX);
|
||||||
station_class = &_station_classes[statspec->sclass];
|
station_class = &_station_classes[statspec->cls_id];
|
||||||
|
|
||||||
i = station_class->stations++;
|
i = station_class->stations++;
|
||||||
station_class->spec = ReallocT(station_class->spec, station_class->stations);
|
station_class->spec = ReallocT(station_class->spec, station_class->stations);
|
||||||
|
@ -606,7 +606,7 @@ static const SpriteGroup *StationResolveReal(const ResolverObject *object, const
|
||||||
uint cargo = 0;
|
uint cargo = 0;
|
||||||
CargoID cargo_type = object->u.station.cargo_type;
|
CargoID cargo_type = object->u.station.cargo_type;
|
||||||
|
|
||||||
if (bst == NULL || statspec->sclass == STAT_CLASS_WAYP) {
|
if (bst == NULL || statspec->cls_id == STAT_CLASS_WAYP) {
|
||||||
return group->loading[0];
|
return group->loading[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,8 +51,8 @@ struct StationSpec {
|
||||||
|
|
||||||
bool allocated; ///< Flag whether this station has been added to a station class list
|
bool allocated; ///< Flag whether this station has been added to a station class list
|
||||||
|
|
||||||
StationClassID sclass; ///< The class to which this spec belongs.
|
StationClassID cls_id; ///< The class to which this spec belongs.
|
||||||
StringID name; ///< Name of this station.
|
StringID name; ///< Name of this station.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bitmask of number of platforms available for the station.
|
* Bitmask of number of platforms available for the station.
|
||||||
|
|
|
@ -2801,7 +2801,7 @@ static void GetTileDesc_Station(TileIndex tile, TileDesc *td)
|
||||||
const StationSpec *spec = GetStationSpec(tile);
|
const StationSpec *spec = GetStationSpec(tile);
|
||||||
|
|
||||||
if (spec != NULL) {
|
if (spec != NULL) {
|
||||||
td->station_class = GetStationClassName(spec->sclass);
|
td->station_class = GetStationClassName(spec->cls_id);
|
||||||
td->station_name = spec->name;
|
td->station_name = spec->name;
|
||||||
|
|
||||||
if (spec->grf_prop.grffile != NULL) {
|
if (spec->grf_prop.grffile != NULL) {
|
||||||
|
|
Loading…
Reference in New Issue