src/rail_map.h
branchnoai
changeset 9724 b39bc69bb2f2
parent 9723 eee46cb39750
child 9732 f8eb3e208514
--- a/src/rail_map.h	Wed Jan 09 18:11:12 2008 +0000
+++ b/src/rail_map.h	Sun Feb 03 20:17:54 2008 +0000
@@ -375,6 +375,18 @@
 		SIGNAL_STATE_GREEN : SIGNAL_STATE_RED;
 }
 
+/**
+ * Sets the state of the signal along the given trackdir.
+ */
+static inline void SetSignalStateByTrackdir(TileIndex tile, Trackdir trackdir, SignalState state)
+{
+	if (state == SIGNAL_STATE_GREEN) { // set 1
+		SetSignalStates(tile, GetSignalStates(tile) | SignalAlongTrackdir(trackdir));
+	} else {
+		SetSignalStates(tile, GetSignalStates(tile) & ~SignalAlongTrackdir(trackdir));
+	}
+}
+
 
 /**
  * Return the rail type of tile, or INVALID_RAILTYPE if this is no rail tile.
@@ -396,7 +408,7 @@
 	RAIL_GROUND_FENCE_HORIZ1 = 10, ///< Grass with a fence at the southern side
 	RAIL_GROUND_FENCE_HORIZ2 = 11, ///< Grass with a fence at the northern side
 	RAIL_GROUND_ICE_DESERT   = 12, ///< Icy or sandy
-	RAIL_GROUND_WATER        = 13, ///< Grass with a fence and water on the lower halftile
+	RAIL_GROUND_WATER        = 13, ///< Grass with a fence and shore or water on the free halftile
 };
 
 static inline void SetRailGroundType(TileIndex t, RailGroundType rgt)