summaryrefslogtreecommitdiff
path: root/station_cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'station_cmd.c')
-rw-r--r--station_cmd.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/station_cmd.c b/station_cmd.c
index 8d8ce56ea..a0f1460d4 100644
--- a/station_cmd.c
+++ b/station_cmd.c
@@ -994,12 +994,33 @@ void SetCustomStation(byte local_stid, struct StationSpec *spec)
memcpy(&_waypoint_data[stid], spec, sizeof(*spec));
}
-DrawTileSprites *GetCustomStationRenderdata(uint32 classid, byte stid)
+struct StationSpec *GetCustomStation(uint32 classid, byte stid)
{
assert(classid == 'WAYP');
if (stid > _waypoint_highest_id)
return NULL;
- return _waypoint_data[stid].renderdata;
+ return &_waypoint_data[stid];
+}
+
+uint32 GetCustomStationRelocation(struct StationSpec *spec, byte ctype)
+{
+ assert(spec->classid == 'WAYP');
+
+ /* In the future, variational spritegroups will kick in through this
+ * accessor. */
+
+ if (spec->relocation[ctype].loading_count != 0) {
+ return spec->relocation[ctype].loading[0];
+ } else if (spec->relocation[ctype].loading_count != 0) {
+ return spec->relocation[ctype].loaded[0];
+ } else {
+ error("Custom station 0x%08x::0x%02x has no sprites associated.",
+ spec->grfid, spec->localidx);
+ /* This is what gets subscribed of dtss->image in grfspecial.c,
+ * so it's probably kinda "default offset". Try to use it as
+ * emergency measure. */
+ return 0x42D;
+ }
}
int GetCustomStationsCount(uint32 classid)