summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-08-07 21:10:57 +0000
committerrubidium <rubidium@openttd.org>2010-08-07 21:10:57 +0000
commit2d3ee123af3c41faf9870abfc8d579c97cc50f2f (patch)
tree2af2196fabea14d3a3fd24575c84c360807b0d36
parent6d6939f844783e4e2d6a844aa53e0e059303f2f3 (diff)
downloadopenttd-2d3ee123af3c41faf9870abfc8d579c97cc50f2f.tar.xz
(svn r20402) -Codechange: rename the airport/station class id to something slightly more generic
-rw-r--r--src/ai/api/ai_rail.cpp2
-rw-r--r--src/newgrf.cpp6
-rw-r--r--src/newgrf_airport.cpp4
-rw-r--r--src/newgrf_airport.h2
-rw-r--r--src/newgrf_station.cpp6
-rw-r--r--src/newgrf_station.h4
-rw-r--r--src/station_cmd.cpp2
7 files changed, 13 insertions, 13 deletions
diff --git a/src/ai/api/ai_rail.cpp b/src/ai/api/ai_rail.cpp
index 4443120cc..592d6ddd4 100644
--- a/src/ai/api/ai_rail.cpp
+++ b/src/ai/api/ai_rail.cpp
@@ -175,7 +175,7 @@
if (spec == NULL) {
DEBUG(grf, 1, "%s returned an invalid station ID for 'AI construction/purchase selection (18)' callback", file->filename);
} else {
- p2 |= spec->sclass | index << 8;
+ p2 |= spec->cls_id | index << 8;
}
}
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 9e28e70d4..505f3ee50 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -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 */
uint32 classid = buf->ReadDWord();
- (*spec)->sclass = AllocateStationClass(BSWAP32(classid));
+ (*spec)->cls_id = AllocateStationClass(BSWAP32(classid));
break;
}
@@ -4270,8 +4270,8 @@ static void FeatureNewName(ByteReader *buf)
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));
} else {
- StationClassID sclass = _cur_grffile->stations[GB(id, 0, 8)]->sclass;
- SetStationClassName(sclass, AddGRFString(_cur_grffile->grfid, id, lang, new_scheme, name, STR_UNDEFINED));
+ StationClassID cls_id = _cur_grffile->stations[GB(id, 0, 8)]->cls_id;
+ SetStationClassName(cls_id, AddGRFString(_cur_grffile->grfid, id, lang, new_scheme, name, STR_UNDEFINED));
}
break;
diff --git a/src/newgrf_airport.cpp b/src/newgrf_airport.cpp
index 23e6dff3d..221c54e23 100644
--- a/src/newgrf_airport.cpp
+++ b/src/newgrf_airport.cpp
@@ -153,8 +153,8 @@ uint GetNumAirportsInClass(AirportClassID id)
*/
static void BindAirportSpecToClass(AirportSpec *as)
{
- assert(as->aclass < APC_MAX);
- AirportClass *airport_class = &_airport_classes[as->aclass];
+ assert(as->cls_id < APC_MAX);
+ AirportClass *airport_class = &_airport_classes[as->cls_id];
int i = airport_class->airports++;
airport_class->spec = ReallocT(airport_class->spec, airport_class->airports);
diff --git a/src/newgrf_airport.h b/src/newgrf_airport.h
index def946907..1e542886d 100644
--- a/src/newgrf_airport.h
+++ b/src/newgrf_airport.h
@@ -72,7 +72,7 @@ struct AirportSpec {
Year max_year; ///< last year the airport is available
StringID name; ///< name of this airport
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
/* Newgrf data */
bool enabled; ///< entity still avaible (by default true).newgrf can disable it, though
diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp
index 90d76c1bf..e341bd43f 100644
--- a/src/newgrf_station.cpp
+++ b/src/newgrf_station.cpp
@@ -176,8 +176,8 @@ void SetCustomStationSpec(StationSpec *statspec)
/* If the station has already been allocated, don't reallocate it. */
if (statspec->allocated) return;
- assert(statspec->sclass < STAT_CLASS_MAX);
- station_class = &_station_classes[statspec->sclass];
+ assert(statspec->cls_id < STAT_CLASS_MAX);
+ station_class = &_station_classes[statspec->cls_id];
i = 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;
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];
}
diff --git a/src/newgrf_station.h b/src/newgrf_station.h
index 99e3c55ae..b80584d8e 100644
--- a/src/newgrf_station.h
+++ b/src/newgrf_station.h
@@ -51,8 +51,8 @@ struct StationSpec {
bool allocated; ///< Flag whether this station has been added to a station class list
- StationClassID sclass; ///< The class to which this spec belongs.
- StringID name; ///< Name of this station.
+ StationClassID cls_id; ///< The class to which this spec belongs.
+ StringID name; ///< Name of this station.
/**
* Bitmask of number of platforms available for the station.
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 28fe6ce74..25e456062 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2801,7 +2801,7 @@ static void GetTileDesc_Station(TileIndex tile, TileDesc *td)
const StationSpec *spec = GetStationSpec(tile);
if (spec != NULL) {
- td->station_class = GetStationClassName(spec->sclass);
+ td->station_class = GetStationClassName(spec->cls_id);
td->station_name = spec->name;
if (spec->grf_prop.grffile != NULL) {