summaryrefslogtreecommitdiff
path: root/road_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 /road_cmd.c
parentecb6f670b0dc4b522fd712657db125162689cf4f (diff)
downloadopenttd-ca120eedad11f826b63bb5505a0f1f61aad740d4.tar.xz
(svn r40) Final slope graphics fix
Diffstat (limited to 'road_cmd.c')
-rw-r--r--road_cmd.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/road_cmd.c b/road_cmd.c
index 29e259734..07692c33d 100644
--- a/road_cmd.c
+++ b/road_cmd.c
@@ -875,7 +875,29 @@ uint GetSlopeZ_Road(TileInfo *ti)
}
return GetPartialZ(ti->x&0xF, ti->y&0xF, th) + z;
}
- return z;
+ return z; // normal Z if no slope
+}
+
+uint GetSlopeTileh_Road(TileInfo *ti)
+{
+ // check if it's a foundation
+ if (ti->tileh != 0) {
+ if ((ti->map5 & 0xE0) == 0) { /* road or crossing */
+ uint f = GetRoadFoundation(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 & 0xF0) == 0x20) {
+ // depot
+ return 0;
+ }
+ }
+ return ti->tileh;
}
static void GetAcceptedCargo_Road(uint tile, AcceptedCargo *ac)
@@ -1129,4 +1151,5 @@ const TileTypeProcs _tile_type_road_procs = {
NULL, /* get_produced_cargo_proc */
VehicleEnter_Road, /* vehicle_enter_tile_proc */
VehicleLeave_Road, /* vehicle_leave_tile_proc */
+ GetSlopeTileh_Road, /* get_slope_tileh_proc */
};