2006-03-24 08:00:45 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
#include "industry.h"
|
|
|
|
#include "macros.h"
|
|
|
|
#include "tile.h"
|
|
|
|
|
|
|
|
|
|
|
|
static inline uint GetIndustryIndex(TileIndex t)
|
|
|
|
{
|
2006-03-30 09:29:01 +00:00
|
|
|
assert(IsTileType(t, MP_INDUSTRY));
|
2006-03-24 08:00:45 +00:00
|
|
|
return _m[t].m2;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline Industry* GetIndustryByTile(TileIndex t)
|
|
|
|
{
|
|
|
|
return GetIndustry(GetIndustryIndex(t));
|
|
|
|
}
|
2006-03-24 13:31:17 +00:00
|
|
|
|
|
|
|
|
2006-03-30 09:29:01 +00:00
|
|
|
static inline bool IsIndustryCompleted(TileIndex t)
|
2006-03-24 13:46:45 +00:00
|
|
|
{
|
2006-03-30 09:29:01 +00:00
|
|
|
assert(IsTileType(t, MP_INDUSTRY));
|
|
|
|
return HASBIT(_m[t].m1, 7);
|
2006-03-24 13:46:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-03-25 10:38:28 +00:00
|
|
|
static inline uint GetIndustryGfx(TileIndex t)
|
|
|
|
{
|
2006-03-30 09:29:01 +00:00
|
|
|
assert(IsTileType(t, MP_INDUSTRY));
|
2006-03-25 10:38:28 +00:00
|
|
|
return _m[t].m5;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void SetIndustryGfx(TileIndex t, uint gfx)
|
|
|
|
{
|
2006-03-30 09:29:01 +00:00
|
|
|
assert(IsTileType(t, MP_INDUSTRY));
|
2006-03-25 10:38:28 +00:00
|
|
|
_m[t].m5 = gfx;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-03-24 13:31:17 +00:00
|
|
|
static inline void MakeIndustry(TileIndex t, uint index, uint gfx)
|
|
|
|
{
|
|
|
|
SetTileType(t, MP_INDUSTRY);
|
|
|
|
_m[t].m1 = 0;
|
|
|
|
_m[t].m2 = index;
|
|
|
|
_m[t].m3 = 0;
|
|
|
|
_m[t].m4 = 0;
|
|
|
|
_m[t].m5 = gfx;
|
|
|
|
}
|