diff options
author | tron <tron@openttd.org> | 2006-03-19 17:15:33 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-03-19 17:15:33 +0000 |
commit | a751a796e13606d8ebd1a8fe720ff72e0b4c1b11 (patch) | |
tree | c0004e9fad3662ad459f4f0543ef414afdb47304 /road_cmd.c | |
parent | 7b21893adb7e2368a2402f2640164f3a4482cf5d (diff) | |
download | openttd-a751a796e13606d8ebd1a8fe720ff72e0b4c1b11.tar.xz |
(svn r3984) Add a function to get the road axis of a level crossing
Diffstat (limited to 'road_cmd.c')
-rw-r--r-- | road_cmd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/road_cmd.c b/road_cmd.c index 79c3e213c..3108c4536 100644 --- a/road_cmd.c +++ b/road_cmd.c @@ -778,7 +778,7 @@ static void DrawTile_Road(TileInfo *ti) image = GetRailTypeInfo(GetRailTypeCrossing(ti->tile))->base_sprites.crossing; - if (GB(ti->map5, 3, 1) == 0) image++; /* direction */ + if (GetCrossingRoadAxis(ti->tile) == AXIS_X) image++; if ((ti->map5 & 4) != 0) image += 2; @@ -1048,7 +1048,8 @@ static uint32 GetTileTrackStatus_Road(TileIndex tile, TransportType mode) 0 : _road_trackbits[GetRoadBits(tile)] * 0x101; case ROAD_CROSSING: { - uint32 r = (_m[tile].m5 & 8 ? 0x202 : 0x101); + uint32 r = (GetCrossingRoadAxis(tile) == AXIS_X ? TRACK_BIT_X : TRACK_BIT_Y) * 0x101; + if (_m[tile].m5 & 4) r *= 0x10001; return r; } |