Changeset - r3741:8dc6982326a9
[Not reviewed]
master
0 5 0
peter1138 - 19 years ago 2006-05-03 21:19:21
peter1138@openttd.org
(svn r4723) - Newstations: add TileIndex parameter to station resolver.
5 files changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
newgrf_station.c
Show inline comments
 
@@ -222,13 +222,13 @@ static const RealSpriteGroup *ResolveSta
 
		case SGT_RANDOMIZED:
 
			DEBUG(grf, 6)("I don't know how to handle random spritegroups yet!");
 
			return NULL;
 
	}
 
}
 

	
 
uint32 GetCustomStationRelocation(const StationSpec *statspec, const Station *st, byte ctype)
 
SpriteID GetCustomStationRelocation(const StationSpec *statspec, const Station *st, TileIndex tile, byte ctype)
 
{
 
	const RealSpriteGroup *rsg = ResolveStationSpriteGroup(statspec->spritegroup[ctype], st);
 
	if (rsg == NULL) return 0;
 

	
 
	if (rsg->num_loading != 0) return rsg->loading[0]->g.result.sprite;
 
	if (rsg->num_loaded  != 0) return rsg->loaded[0]->g.result.sprite;
newgrf_station.h
Show inline comments
 
@@ -95,13 +95,13 @@ uint GetNumCustomStations(StationClassID
 
void SetCustomStationSpec(StationSpec *statspec);
 
const StationSpec *GetCustomStationSpec(StationClassID sclass, uint station);
 

	
 
/* Get sprite offset for a given custom station and station structure (may be
 
 * NULL if ctype is set - that means we are in a build dialog). The station
 
 * structure is used for variational sprite groups. */
 
uint32 GetCustomStationRelocation(const StationSpec *statspec, const Station *st, byte ctype);
 
SpriteID GetCustomStationRelocation(const StationSpec *statspec, const Station *st, TileIndex tile, byte ctype);
 

	
 
/* Allocate a StationSpec to a Station. This is called once per build operation. */
 
int AllocateSpecToStation(const StationSpec *statspec, Station *st, bool exec);
 

	
 
/* Deallocate a StationSpec from a Station. Called when removing a single station tile. */
 
bool DeallocateSpecFromStation(Station *st, byte specindex);
rail_cmd.c
Show inline comments
 
@@ -1321,13 +1321,13 @@ static void DrawTile_Track(TileInfo *ti)
 
			const StationSpec *statspec = GetCustomStationSpec(STAT_CLASS_WAYP, stat_id);
 

	
 
			if (statspec != NULL) {
 
				DrawTileSeqStruct const *seq;
 
				// emulate station tile - open with building
 
				const DrawTileSprites *cust = &statspec->renderdata[2 + GetWaypointAxis(ti->tile)];
 
				uint32 relocation = GetCustomStationRelocation(statspec, ComposeWaypointStation(ti->tile), 0);
 
				uint32 relocation = GetCustomStationRelocation(statspec, ComposeWaypointStation(ti->tile), ti->tile, 0);
 

	
 
				/* We don't touch the 0x8000 bit. In all this
 
				 * waypoint code, it is used to indicate that
 
				 * we should offset by railtype, but we always
 
				 * do that for custom ground sprites and never
 
				 * for station sprites. And in the drawing
station_cmd.c
Show inline comments
 
@@ -1986,13 +1986,13 @@ static void DrawTile_Station(TileInfo *t
 

	
 
		//debug("Cust-o-mized %p", statspec);
 

	
 
		if (statspec != NULL) {
 
			uint tile = GetStationGfx(ti->tile);
 

	
 
			relocation = GetCustomStationRelocation(statspec, st, 0);
 
			relocation = GetCustomStationRelocation(statspec, st, ti->tile, 0);
 

	
 
			/* Ensure the chosen tile layout is valid for this custom station */
 
			t = &statspec->renderdata[tile < statspec->tiles ? tile : GetRailStationAxis(ti->tile)];
 
		}
 
	}
 

	
waypoint.c
Show inline comments
 
@@ -402,13 +402,13 @@ void DrawWaypointSprite(int x, int y, in
 
		// stat is NULL for default waypoints and when waypoint graphics are
 
		// not loaded.
 
		DrawDefaultWaypointSprite(x, y, railtype);
 
		return;
 
	}
 

	
 
	relocation = GetCustomStationRelocation(statspec, NULL, 1);
 
	relocation = GetCustomStationRelocation(statspec, NULL, INVALID_TILE, 1);
 
	// emulate station tile - open with building
 
	// add 1 to get the other direction
 
	cust = &statspec->renderdata[2];
 

	
 
	img = cust->ground_sprite;
 
	img += (img < _custom_sprites_base) ? rti->total_offset : rti->custom_ground_offset;
0 comments (0 inline, 0 general)