(svn r3846) Add functions to set the type of stuff (clear, water, rail, road) under bridges

This commit is contained in:
tron
2006-03-13 12:55:20 +00:00
parent 1067069e33
commit e8ccd9641f
5 changed files with 67 additions and 33 deletions

37
bridge_map.h Normal file
View File

@@ -0,0 +1,37 @@
/* $Id$ */
#ifndef BRIDGE_MAP_H
#define BRIDGE_MAP_H
#include "macros.h"
#include "map.h"
#include "rail.h"
#include "tile.h"
static inline void SetClearUnderBridge(TileIndex t)
{
SetTileOwner(t, OWNER_NONE);
SB(_m[t].m5, 3, 3, 0 << 2 | 0);
}
static inline void SetWaterUnderBridge(TileIndex t)
{
SetTileOwner(t, OWNER_WATER);
SB(_m[t].m5, 3, 3, 0 << 2 | 1);
}
static inline void SetRailUnderBridge(TileIndex t, Owner o, RailType r)
{
SetTileOwner(t, o);
SB(_m[t].m5, 3, 3, 1 << 2 | TRANSPORT_RAIL);
SB(_m[t].m3, 0, 4, r);
}
static inline void SetRoadUnderBridge(TileIndex t, Owner o)
{
SetTileOwner(t, o);
SB(_m[t].m5, 3, 3, 1 << 2 | TRANSPORT_ROAD);
}
#endif