(svn r4723) - Newstations: add TileIndex parameter to station resolver.
--- a/newgrf_station.c Wed May 03 21:07:44 2006 +0000
+++ b/newgrf_station.c Wed May 03 21:19:21 2006 +0000
@@ -225,7 +225,7 @@
}
}
-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;
--- a/newgrf_station.h Wed May 03 21:07:44 2006 +0000
+++ b/newgrf_station.h Wed May 03 21:19:21 2006 +0000
@@ -98,7 +98,7 @@
/* 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);
--- a/rail_cmd.c Wed May 03 21:07:44 2006 +0000
+++ b/rail_cmd.c Wed May 03 21:19:21 2006 +0000
@@ -1324,7 +1324,7 @@
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
--- a/station_cmd.c Wed May 03 21:07:44 2006 +0000
+++ b/station_cmd.c Wed May 03 21:19:21 2006 +0000
@@ -1989,7 +1989,7 @@
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)];
--- a/waypoint.c Wed May 03 21:07:44 2006 +0000
+++ b/waypoint.c Wed May 03 21:19:21 2006 +0000
@@ -405,7 +405,7 @@
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];