summaryrefslogtreecommitdiff
path: root/rail_cmd.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-05-07 10:58:53 +0000
committerpeter1138 <peter1138@openttd.org>2006-05-07 10:58:53 +0000
commit31a54a6835c6950d943bc0434653d555392a56af (patch)
tree28a6067bb4eb207cd3c7980dc477b8d7bffaed2c /rail_cmd.c
parent24854be59e4150d08b3797c775b2cdcafcd73791 (diff)
downloadopenttd-31a54a6835c6950d943bc0434653d555392a56af.tar.xz
(svn r4767) - Newstations: fix loading / use of custom ground sprites
Diffstat (limited to 'rail_cmd.c')
-rw-r--r--rail_cmd.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/rail_cmd.c b/rail_cmd.c
index f88267841..c85019ff6 100644
--- a/rail_cmd.c
+++ b/rail_cmd.c
@@ -30,8 +30,6 @@
#include "newgrf_callbacks.h"
#include "newgrf_station.h"
-extern uint16 _custom_sprites_base;
-
const byte _track_sloped_sprites[14] = {
14, 15, 22, 13,
0, 21, 17, 12,
@@ -1338,7 +1336,6 @@ static void DrawTile_Track(TileInfo *ti)
if (statspec->renderdata == NULL) {
cust = GetStationTileLayout(tile);
- relocation -= 0x42D;
} else {
cust = &statspec->renderdata[(tile < statspec->tiles ? tile : 0) + GetWaypointAxis(ti->tile)];
}
@@ -1346,7 +1343,13 @@ static void DrawTile_Track(TileInfo *ti)
/* If there is no sprite layout, we fall back to the default waypoint graphics. */
if (cust != NULL && cust->seq != NULL) {
image = cust->ground_sprite;
- image += (image < _custom_sprites_base) ? rti->total_offset : rti->custom_ground_offset;
+ if (HASBIT(image, 31)) {
+ CLRBIT(image, 31);
+ image += GetCustomStationGroundRelocation(statspec, st, ti->tile);
+ image += rti->custom_ground_offset;
+ } else {
+ image += rti->total_offset;
+ }
DrawGroundSprite(image);