mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Turn macros GetCompanyHQSize and IncreaseCompanyHQSize into functions.
parent
0eb6964311
commit
68016031cf
|
@ -134,22 +134,29 @@ void BuildObject(ObjectType type, TileIndex tile, CompanyID owner, Town *town, u
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Increase the animation stage of a whole structure.
|
* Increase the HQ size.
|
||||||
* @param tile The tile of the structure.
|
* @param tile The (northern) tile of the company HQ.
|
||||||
*/
|
*/
|
||||||
static void IncreaseAnimationStage(TileIndex tile)
|
static void IncreaseCompanyHQSize(TileIndex tile)
|
||||||
{
|
{
|
||||||
TileArea ta = Object::GetByTile(tile)->location;
|
TileArea ta = Object::GetByTile(tile)->location;
|
||||||
for (TileIndex t : ta) {
|
for (TileIndex t : ta) {
|
||||||
|
/* We encode the company HQ size in the animation state. */
|
||||||
SetAnimationFrame(t, GetAnimationFrame(t) + 1);
|
SetAnimationFrame(t, GetAnimationFrame(t) + 1);
|
||||||
MarkTileDirtyByTile(t);
|
MarkTileDirtyByTile(t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** We encode the company HQ size in the animation stage. */
|
/**
|
||||||
#define GetCompanyHQSize GetAnimationFrame
|
* Get the size of the HQ.
|
||||||
/** We encode the company HQ size in the animation stage. */
|
* @param tile The (northern) tile of the company HQ.
|
||||||
#define IncreaseCompanyHQSize IncreaseAnimationStage
|
* @return HQ size.
|
||||||
|
*/
|
||||||
|
static uint8_t GetCompanyHQSize(TileIndex tile)
|
||||||
|
{
|
||||||
|
/* We encode the company HQ size in the animation state. */
|
||||||
|
return GetAnimationFrame(tile);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the CompanyHQ to the state associated with the given score
|
* Update the CompanyHQ to the state associated with the given score
|
||||||
|
|
Loading…
Reference in New Issue