diff options
author | KUDr <kudr@openttd.org> | 2006-05-27 16:12:16 +0000 |
---|---|---|
committer | KUDr <kudr@openttd.org> | 2006-05-27 16:12:16 +0000 |
commit | 5e73dce0e71791b87e5b096a890578eefcc26639 (patch) | |
tree | e4580db6e03032a997fce1392929b7190dc3b03d /rail.h | |
parent | 3d01010440440cfbffd1e5d3b0cf1f23f0503a76 (diff) | |
download | openttd-5e73dce0e71791b87e5b096a890578eefcc26639.tar.xz |
(svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
Diffstat (limited to 'rail.h')
-rw-r--r-- | rail.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -33,6 +33,7 @@ typedef enum Trackdirs { /** These are a combination of tracks and directions. Values are 0-5 in one direction (corresponding to the Track enum) and 8-13 in the other direction. */ typedef enum TrackdirBits { + TRACKDIR_BIT_NONE = 0x0, TRACKDIR_BIT_X_NE = 0x1, TRACKDIR_BIT_Y_SE = 0x2, TRACKDIR_BIT_UPPER_E = 0x4, @@ -216,13 +217,13 @@ static inline Trackdir TrackToTrackdir(Track track) { return (Trackdir)track; } * Returns a TrackdirBit mask that contains the two TrackdirBits that * correspond with the given Track (one for each direction). */ -static inline TrackdirBits TrackToTrackdirBits(Track track) { Trackdir td = TrackToTrackdir(track); return TrackdirToTrackdirBits(td) | TrackdirToTrackdirBits(ReverseTrackdir(td));} +static inline TrackdirBits TrackToTrackdirBits(Track track) { Trackdir td = TrackToTrackdir(track); return (TrackdirBits)(TrackdirToTrackdirBits(td) | TrackdirToTrackdirBits(ReverseTrackdir(td)));} /** * Discards all directional information from the given TrackdirBits. Any * Track which is present in either direction will be present in the result. */ -static inline TrackBits TrackdirBitsToTrackBits(TrackdirBits bits) { return bits | (bits >> 8); } +static inline TrackBits TrackdirBitsToTrackBits(TrackdirBits bits) { return (TrackBits)(bits | (bits >> 8)); } /** * Maps a trackdir to the trackdir that you will end up on if you go straight |