(svn r4932) - Codechange: (r4931): move GetTileMaxZ to tile.[ch] instead of lingering it in tunnelbridge_cmd.c. Might be needed some day for some other backport commit (Tron). 0.4
authorDarkvater
Sat, 20 May 2006 20:56:31 +0000
branch0.4
changeset 10023 4a72310c9cf5
parent 10022 9cb1a8fd9155
child 10024 cec4977c086d
(svn r4932) - Codechange: (r4931): move GetTileMaxZ to tile.[ch] instead of lingering it in tunnelbridge_cmd.c. Might be needed some day for some other backport commit (Tron).
tile.c
tile.h
tunnelbridge_cmd.c
--- a/tile.c	Sat May 20 20:16:08 2006 +0000
+++ b/tile.c	Sat May 20 20:56:31 2006 +0000
@@ -68,3 +68,19 @@
 	GetTileSlope(tile, &h);
 	return h;
 }
+
+uint GetTileMaxZ(TileIndex t)
+{
+	uint max;
+	uint h;
+
+	h = TileHeight(t);
+	max = h;
+	h = TileHeight(t + TileDiffXY(1, 0));
+	if (h > max) max = h;
+	h = TileHeight(t + TileDiffXY(0, 1));
+	if (h > max) max = h;
+	h = TileHeight(t + TileDiffXY(1, 1));
+	if (h > max) max = h;
+	return max * 8;
+}
--- a/tile.h	Sat May 20 20:16:08 2006 +0000
+++ b/tile.h	Sat May 20 20:56:31 2006 +0000
@@ -50,6 +50,7 @@
 uint GetTileh(uint n, uint w, uint e, uint s, uint *h);
 uint GetTileSlope(TileIndex tile, uint *h);
 uint GetTileZ(TileIndex tile);
+uint GetTileMaxZ(TileIndex tile);
 
 static inline bool CorrectZ(uint tileh)
 {
--- a/tunnelbridge_cmd.c	Sat May 20 20:16:08 2006 +0000
+++ b/tunnelbridge_cmd.c	Sat May 20 20:56:31 2006 +0000
@@ -1208,23 +1208,6 @@
 static inline bool IsTransportUnderBridge(TileIndex t) {return HASBIT(_m[t].m5, 5);}
 static inline uint GetBridgeAxis(TileIndex t) {return GB(_m[t].m5, 0, 1);}
 
-static uint GetTileMaxZ(TileIndex t)
-{
-	uint max;
-	uint h;
-
-	h = TileHeight(t);
-	max = h;
-	h = TileHeight(t + TileDiffXY(1, 0));
-	if (h > max) max = h;
-	h = TileHeight(t + TileDiffXY(0, 1));
-	if (h > max) max = h;
-	h = TileHeight(t + TileDiffXY(1, 1));
-	if (h > max) max = h;
-	return max * 8;
-}
-
-
 static uint GetSlopeZ_TunnelBridge(const TileInfo* ti)
 {
 	TileIndex tile = ti->tile;