I have a bit of a problem understanding this piece of code, from town_cmd.c :
Code: Select all
static void MakeTownHouseBigger(TileIndex tile)
{
uint flags = _housetypeInfos[_m[tile].m4].more_flags;
if (flags & 8) MakeSingleHouseBigger(TILE_ADDXY(tile, 0, 0));
if (flags & 4) MakeSingleHouseBigger(TILE_ADDXY(tile, 0, 1));
if (flags & 2) MakeSingleHouseBigger(TILE_ADDXY(tile, 1, 0));
if (flags & 1) MakeSingleHouseBigger(TILE_ADDXY(tile, 1, 1));
}
I understand the flags & 8,4,2,1 thing (checkng for a bit) but i'm puzzled about the TILE_ADDXY macro.
The point is : I think it is about coordinates, but I don't know where the tiles will be added.
Code: Select all
/\
/ \
/\A /\
/ \/ \
\B /\C /
\/ \/
\D /
\/
So, first of all, am I in A,B,C or D?
If flag = 8, what will it do? I'm in B and it will add in C?
Or else

That is one of the last things I need to figure out before next release...
So please, any hint, pointer, suggestion, documentation will be more then welcome!