Extra House ID's

Use an extra unused bit in m3 to boost the max number of house types from 512 to 1024. So-far everything works, construction stages and animations appear unaffacted by my hubris.
This commit is contained in:
reldred
2021-04-10 21:16:09 +09:30
parent fcded2aff7
commit 51c0b222cc
2 changed files with 3 additions and 3 deletions

View File

@@ -47,7 +47,7 @@ static inline void SetTownIndex(TileIndex t, TownID index)
static inline HouseID GetCleanHouseType(TileIndex t)
{
assert_tile(IsTileType(t, MP_HOUSE), t);
return _m[t].m4 | (GB(_m[t].m3, 6, 1) << 8);
return _m[t].m4 | (GB(_m[t].m3, 5, 2) << 8);
}
/**
@@ -71,7 +71,7 @@ static inline void SetHouseType(TileIndex t, HouseID house_id)
{
assert_tile(IsTileType(t, MP_HOUSE), t);
_m[t].m4 = GB(house_id, 0, 8);
SB(_m[t].m3, 6, 1, GB(house_id, 8, 1));
SB(_m[t].m3, 5, 2, GB(house_id, 8, 2));
}
/**