Changeset - r15727:185692d46434
[Not reviewed]
master
0 3 0
rubidium - 14 years ago 2010-08-07 21:39:30
rubidium@openttd.org
(svn r20404) -Codechange: remove the need for StationSpec::allocated
3 files changed with 7 insertions and 9 deletions:
0 comments (0 inline, 0 general)
src/newgrf.cpp
Show inline comments
 
@@ -3885,6 +3885,11 @@ static void StationMapSpriteGroup(ByteRe
 
			continue;
 
		}
 

	
 
		if (statspec->grf_prop.grffile != NULL) {
 
			grfmsg(1, "StationMapSpriteGroup: Station with ID 0x%02X mapped multiple times, skipping", stations[i]);
 
			continue;
 
		}
 

	
 
		statspec->spritegroup[CT_DEFAULT] = _cur_grffile->spritegroups[groupid];
 
		statspec->grf_prop.grffile = _cur_grffile;
 
		statspec->grf_prop.local_id = stations[i];
src/newgrf_station.cpp
Show inline comments
 
@@ -173,9 +173,6 @@ void SetCustomStationSpec(StationSpec *s
 
	StationClass *station_class;
 
	int i;
 

	
 
	/* If the station has already been allocated, don't reallocate it. */
 
	if (statspec->allocated) return;
 

	
 
	assert(statspec->cls_id < STAT_CLASS_MAX);
 
	station_class = &_station_classes[statspec->cls_id];
 

	
 
@@ -183,7 +180,6 @@ void SetCustomStationSpec(StationSpec *s
 
	station_class->spec = ReallocT(station_class->spec, station_class->stations);
 

	
 
	station_class->spec[i] = statspec;
 
	statspec->allocated = true;
 
}
 

	
 
/**
src/newgrf_station.h
Show inline comments
 
@@ -48,11 +48,8 @@ typedef byte *StationLayout;
 
/** Station specification. */
 
struct StationSpec {
 
	GRFFilePropsBase grf_prop; ///< Properties related the the grf file
 

	
 
	bool allocated; ///< Flag whether this station has been added to a station class list
 

	
 
	StationClassID cls_id;    ///< 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.
0 comments (0 inline, 0 general)