summaryrefslogtreecommitdiff
path: root/rail_cmd.c
diff options
context:
space:
mode:
authordominik <dominik@openttd.org>2004-08-13 18:27:33 +0000
committerdominik <dominik@openttd.org>2004-08-13 18:27:33 +0000
commitca120eedad11f826b63bb5505a0f1f61aad740d4 (patch)
tree5791137b0f2b6552ea4bc03afa5cadaf28cf52de /rail_cmd.c
parentecb6f670b0dc4b522fd712657db125162689cf4f (diff)
downloadopenttd-ca120eedad11f826b63bb5505a0f1f61aad740d4.tar.xz
(svn r40) Final slope graphics fix
Diffstat (limited to 'rail_cmd.c')
-rw-r--r--rail_cmd.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/rail_cmd.c b/rail_cmd.c
index 66200d307..dd6fd90a9 100644
--- a/rail_cmd.c
+++ b/rail_cmd.c
@@ -1694,6 +1694,28 @@ uint GetSlopeZ_Track(TileInfo *ti)
return z;
}
+uint GetSlopeTileh_Track(TileInfo *ti)
+{
+ // check if it's a foundation
+ if (ti->tileh != 0) {
+ if ((ti->map5 & 0x80) == 0) {
+ uint f = GetRailFoundation(ti->tileh, ti->map5 & 0x3F);
+ if (f != 0) {
+ if (f < 15) {
+ // leveled foundation
+ return 0;
+ }
+ // inclined foundation
+ return _inclined_tileh[f - 15];
+ }
+ } else if ((ti->map5 & 0xC0) == 0xC0) {
+ // depot or checkpoint
+ return 0;
+ }
+ }
+ return ti->tileh;
+}
+
static void GetAcceptedCargo_Track(uint tile, AcceptedCargo *ac)
{
/* not used */
@@ -1949,4 +1971,5 @@ const TileTypeProcs _tile_type_rail_procs = {
NULL, /* get_produced_cargo_proc */
VehicleEnter_Track, /* vehicle_enter_tile_proc */
NULL, /* vehicle_leave_tile_proc */
+ GetSlopeTileh_Track, /* get_slope_tileh_proc */
};