(svn r4754) - Newstations: expose default station display data via a function so we can use it (rarely) in other places.
--- a/rail_cmd.c Sat May 06 20:29:31 2006 +0000
+++ b/rail_cmd.c Sat May 06 20:33:22 2006 +0000
@@ -1336,7 +1336,12 @@
if (callback != CALLBACK_FAILED) tile = callback;
}
- cust = &statspec->renderdata[(tile < statspec->tiles ? tile : 0) + GetWaypointAxis(ti->tile)];
+ if (statspec->renderdata == NULL) {
+ cust = GetStationTileLayout(tile);
+ relocation -= 0x42D;
+ } else {
+ cust = &statspec->renderdata[(tile < statspec->tiles ? tile : 0) + GetWaypointAxis(ti->tile)];
+ }
/* If there is no sprite layout, we fall back to the default waypoint graphics. */
if (cust != NULL && cust->seq != NULL) {
--- a/station.h Sat May 06 20:29:31 2006 +0000
+++ b/station.h Sat May 06 20:33:22 2006 +0000
@@ -199,6 +199,7 @@
uint GetStationPlatforms(const Station *st, TileIndex tile);
+const DrawTileSprites *GetStationTileLayout(byte gfx);
void StationPickerDrawSprite(int x, int y, RailType railtype, int image);
RoadStop * GetRoadStopByTile(TileIndex tile, RoadStopType type);
--- a/station_cmd.c Sat May 06 20:29:31 2006 +0000
+++ b/station_cmd.c Sat May 06 20:33:22 2006 +0000
@@ -1977,6 +1977,10 @@
#include "table/station_land.h"
+const DrawTileSprites *GetStationTileLayout(byte gfx)
+{
+ return &_station_display_datas[gfx];
+}
extern uint16 _custom_sprites_base;