author | rubidium |
Wed, 09 Jan 2008 09:45:45 +0000 | |
changeset 8720 | 4e60c30e2006 |
parent 8634 | 5ffca02f9115 |
child 8732 | b18f578f7c16 |
permissions | -rw-r--r-- |
3069
0e6aca11c3da
(svn r3658) Add functions and symbolic names to retrieve road tile types and road pieces
tron
parents:
diff
changeset
|
1 |
/* $Id$ */ |
0e6aca11c3da
(svn r3658) Add functions and symbolic names to retrieve road tile types and road pieces
tron
parents:
diff
changeset
|
2 |
|
8598
14ae80fe4c8f
(svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
8424
diff
changeset
|
3 |
/** @file road_func.h Functions related to roads. */ |
5838
9c3129cb019b
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5726
diff
changeset
|
4 |
|
8598
14ae80fe4c8f
(svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
8424
diff
changeset
|
5 |
#ifndef ROAD_FUNC_H |
14ae80fe4c8f
(svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
8424
diff
changeset
|
6 |
#define ROAD_FUNC_H |
7157
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
7 |
|
8609
8c0c3e9dd6a0
(svn r11674) -Codechange: refactor some functions out of macros.h into more logical locations.
rubidium
parents:
8598
diff
changeset
|
8 |
#include "core/bitmath_func.hpp" |
8598
14ae80fe4c8f
(svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
8424
diff
changeset
|
9 |
#include "road_type.h" |
8634
5ffca02f9115
(svn r11700) -Codechange: reduce the amount of unnecessary includes.
rubidium
parents:
8609
diff
changeset
|
10 |
#include "direction_func.h" |
7157
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
11 |
|
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
12 |
/** |
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
13 |
* Whether the given roadtype is valid. |
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
14 |
* @param rt the roadtype to check for validness |
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
15 |
* @return true if and only if valid |
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
16 |
*/ |
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
17 |
static inline bool IsValidRoadType(RoadType rt) |
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
18 |
{ |
7187
f7dc3204d457
(svn r9923) -Add: support for Action 0 Road vehicles, property 1C, bit 0.
rubidium
parents:
7157
diff
changeset
|
19 |
return rt == ROADTYPE_ROAD || rt == ROADTYPE_TRAM; |
7157
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
20 |
} |
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
21 |
|
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
22 |
/** |
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
23 |
* Are the given bits pointing to valid roadtypes? |
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
24 |
* @param rts the roadtypes to check for validness |
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
25 |
* @return true if and only if valid |
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
26 |
*/ |
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
27 |
static inline bool AreValidRoadTypes(RoadTypes rts) |
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
28 |
{ |
8424
4a488a90ccab
(svn r11481) -Codechange: Rename the HASBIT function to fit with the naming style
skidd13
parents:
8137
diff
changeset
|
29 |
return HasBit(rts, ROADTYPE_ROAD) || HasBit(rts, ROADTYPE_TRAM); |
7157
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
30 |
} |
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
31 |
|
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
32 |
/** |
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
33 |
* Maps a RoadType to the corresponding RoadTypes value |
7891
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
34 |
* |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
35 |
* @param rt the roadtype to get the roadtypes from |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
36 |
* @return the roadtypes with the given roadtype |
7157
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
37 |
*/ |
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
38 |
static inline RoadTypes RoadTypeToRoadTypes(RoadType rt) |
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
39 |
{ |
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
40 |
return (RoadTypes)(1 << rt); |
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
41 |
} |
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
42 |
|
7891
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
43 |
/** |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
44 |
* Returns the RoadTypes which are not present in the given RoadTypes |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
45 |
* |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
46 |
* This function returns the complement of a given RoadTypes. |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
47 |
* |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
48 |
* @param r The given RoadTypes |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
49 |
* @return The complement of the given RoadTypes |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
50 |
* @note The unused value ROADTYPES_HWAY will be used, too. |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
51 |
*/ |
7157
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
52 |
static inline RoadTypes ComplementRoadTypes(RoadTypes r) |
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
53 |
{ |
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
54 |
return (RoadTypes)(ROADTYPES_ALL ^ r); |
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
55 |
} |
270bc5b64e08
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents:
6889
diff
changeset
|
56 |
|
5838
9c3129cb019b
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5726
diff
changeset
|
57 |
|
7891
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
58 |
/** |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
59 |
* Calculate the complement of a RoadBits value |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
60 |
* |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
61 |
* Simply flips all bits in the RoadBits value to get the complement |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
62 |
* of the RoadBits. |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
63 |
* |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
64 |
* @param r The given RoadBits value |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
65 |
* @return the complement |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
66 |
*/ |
3103
fb7f22d3bc9b
(svn r3698) Add GetCrossingRailBits() and ComplementRoadBits(). Simplify the code by using them
tron
parents:
3099
diff
changeset
|
67 |
static inline RoadBits ComplementRoadBits(RoadBits r) |
fb7f22d3bc9b
(svn r3698) Add GetCrossingRailBits() and ComplementRoadBits(). Simplify the code by using them
tron
parents:
3099
diff
changeset
|
68 |
{ |
3900
4984308f9125
(svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
3795
diff
changeset
|
69 |
return (RoadBits)(ROAD_ALL ^ r); |
3103
fb7f22d3bc9b
(svn r3698) Add GetCrossingRailBits() and ComplementRoadBits(). Simplify the code by using them
tron
parents:
3099
diff
changeset
|
70 |
} |
fb7f22d3bc9b
(svn r3698) Add GetCrossingRailBits() and ComplementRoadBits(). Simplify the code by using them
tron
parents:
3099
diff
changeset
|
71 |
|
7891
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
72 |
/** |
8137
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
73 |
* Calculate the mirrored RoadBits |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
74 |
* |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
75 |
* Simply move the bits to their new position. |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
76 |
* |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
77 |
* @param r The given RoadBits value |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
78 |
* @return the mirrored |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
79 |
*/ |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
80 |
static inline RoadBits MirrorRoadBits(RoadBits r) |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
81 |
{ |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
82 |
return (RoadBits)(GB(r, 0, 2) << 2 | GB(r, 2, 2)); |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
83 |
} |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
84 |
|
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
85 |
/** |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
86 |
* Calculate rotated RoadBits |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
87 |
* |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
88 |
* Move the Roadbits clockwise til they are in their final position. |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
89 |
* |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
90 |
* @param r The given RoadBits value |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
91 |
* @param rot The given Rotation angle |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
92 |
* @return the rotated |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
93 |
*/ |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
94 |
static inline RoadBits RotateRoadBits(RoadBits r, DiagDirDiff rot) |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
95 |
{ |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
96 |
for (; rot > (DiagDirDiff)0; rot--){ |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
97 |
r = (RoadBits)(GB(r, 0, 1) << 3 | GB(r, 1, 3)); |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
98 |
} |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
99 |
return r; |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
100 |
} |
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
101 |
|
67a9579abd74
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
8062
diff
changeset
|
102 |
/** |
7891
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
103 |
* Create the road-part which belongs to the given DiagDirection |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
104 |
* |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
105 |
* This function returns a RoadBits value which belongs to |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
106 |
* the given DiagDirection. |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
107 |
* |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
108 |
* @param d The DiagDirection |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
109 |
* @return The result RoadBits which the selected road-part set |
5aac5be5fc2c
(svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents:
7187
diff
changeset
|
110 |
*/ |
3146
36523d434783
(svn r3766) Add a function to get the RoadBits from an arbitrary tile
tron
parents:
3145
diff
changeset
|
111 |
static inline RoadBits DiagDirToRoadBits(DiagDirection d) |
36523d434783
(svn r3766) Add a function to get the RoadBits from an arbitrary tile
tron
parents:
3145
diff
changeset
|
112 |
{ |
8062
9eb6efa04d44
(svn r11091) -Codechange: Partial rewrite of the road management code of towns, in order to make it more readable and with improved performance. (FS#1161 by skidd13)
belugas
parents:
7891
diff
changeset
|
113 |
return (RoadBits)(ROAD_NW << (3 ^ d)); |
3146
36523d434783
(svn r3766) Add a function to get the RoadBits from an arbitrary tile
tron
parents:
3145
diff
changeset
|
114 |
} |
36523d434783
(svn r3766) Add a function to get the RoadBits from an arbitrary tile
tron
parents:
3145
diff
changeset
|
115 |
|
8598
14ae80fe4c8f
(svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
8424
diff
changeset
|
116 |
#endif /* ROAD_FUNC_H */ |