summaryrefslogtreecommitdiff
path: root/road.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-05 10:19:33 +0000
committertron <tron@openttd.org>2006-03-05 10:19:33 +0000
commitcc4f5b4e6f8c99eb94dfb5513b4dc807440adf09 (patch)
treea52b37172cae58e82f096386586bea359126dd70 /road.h
parent5913c3931bbb1ccb8283061a23f83d96c6ed1a38 (diff)
downloadopenttd-cc4f5b4e6f8c99eb94dfb5513b4dc807440adf09.tar.xz
(svn r3763) Adapt to the new 'map accessors go in foo_map.h'-scheme
Diffstat (limited to 'road.h')
-rw-r--r--road.h85
1 files changed, 0 insertions, 85 deletions
diff --git a/road.h b/road.h
deleted file mode 100644
index 7ad38d90c..000000000
--- a/road.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* $Id$ */
-
-#ifndef ROAD_H
-#define ROAD_H
-
-#include "macros.h"
-#include "rail.h"
-#include "tile.h"
-
-typedef enum RoadBits {
- ROAD_NW = 1,
- ROAD_SW = 2,
- ROAD_SE = 4,
- ROAD_NE = 8,
- ROAD_X = ROAD_SW | ROAD_NE,
- ROAD_Y = ROAD_NW | ROAD_SE,
- ROAD_ALL = ROAD_X | ROAD_Y
-} RoadBits;
-
-static inline RoadBits ComplementRoadBits(RoadBits r)
-{
- return ROAD_ALL ^ r;
-}
-
-static inline RoadBits GetRoadBits(TileIndex tile)
-{
- return GB(_m[tile].m5, 0, 4);
-}
-
-static inline RoadBits GetCrossingRoadBits(TileIndex tile)
-{
- return _m[tile].m5 & 8 ? ROAD_Y : ROAD_X;
-}
-
-static inline TrackBits GetCrossingRailBits(TileIndex tile)
-{
- return _m[tile].m5 & 8 ? TRACK_BIT_X : TRACK_BIT_Y;
-}
-
-
-typedef enum RoadType {
- ROAD_NORMAL,
- ROAD_CROSSING,
- ROAD_DEPOT
-} RoadType;
-
-static inline RoadType GetRoadType(TileIndex tile)
-{
- return GB(_m[tile].m5, 4, 4);
-}
-
-
-static inline void MakeRoadNormal(TileIndex t, Owner owner, RoadBits bits, uint town)
-{
- SetTileType(t, MP_STREET);
- SetTileOwner(t, owner);
- _m[t].m2 = town;
- _m[t].m3 = 0;
- _m[t].m4 = 0 << 7 | 0 << 4 | 0;
- _m[t].m5 = ROAD_NORMAL << 4 | bits;
-}
-
-
-static inline void MakeRoadCrossing(TileIndex t, Owner road, Owner rail, Axis roaddir, RailType rt, uint town)
-{
- SetTileType(t, MP_STREET);
- SetTileOwner(t, rail);
- _m[t].m2 = town;
- _m[t].m3 = road;
- _m[t].m4 = 0 << 7 | 0 << 4 | rt;
- _m[t].m5 = ROAD_CROSSING << 4 | roaddir << 3 | 0 << 2;
-}
-
-
-static inline void MakeRoadDepot(TileIndex t, Owner owner, DiagDirection dir)
-{
- SetTileType(t, MP_STREET);
- SetTileOwner(t, owner);
- _m[t].m2 = 0;
- _m[t].m3 = 0;
- _m[t].m4 = 0;
- _m[t].m5 = ROAD_DEPOT << 4 | dir;
-}
-
-#endif