industry_map.h
author Darkvater
Sun, 26 Mar 2006 22:41:56 +0000
changeset 3346 a0d4def7d934
parent 3331 da6bbabbb6cc
child 3369 cab209754317
permissions -rw-r--r--
(svn r4130) - CodeChange: Add proper semantics for TownID for such variables instead of using the general uint16-type. We probably need to change GetTown() and IsTownIndex() as well to use TownID.
/* $Id$ */

#include "industry.h"
#include "macros.h"
#include "tile.h"


static inline uint GetIndustryIndex(TileIndex t)
{
	return _m[t].m2;
}

static inline Industry* GetIndustryByTile(TileIndex t)
{
	return GetIndustry(GetIndustryIndex(t));
}


static inline bool IsIndustryCompleted(TileIndex tile)
{
	return HASBIT(_m[tile].m1, 7);
}


static inline uint GetIndustryGfx(TileIndex t)
{
	return _m[t].m5;
}

static inline void SetIndustryGfx(TileIndex t, uint gfx)
{
	_m[t].m5 = gfx;
}


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;
}