Codechange: Make TileIndex a "strong" typedef to give it a distinct type.

This is accomplished by changing it to a single member struct with the
appropriate operator overloads to make it all work with not too much
source modifications.
This commit is contained in:
Michael Lutz
2021-11-06 23:11:22 +01:00
parent 4fc055d6e9
commit b0990fcff7
23 changed files with 160 additions and 33 deletions

View File

@@ -204,7 +204,7 @@ static inline TileIndex TileVirtXY(uint x, uint y)
*/
static inline uint TileX(TileIndex tile)
{
return tile & MapMaxX();
return tile.value & MapMaxX();
}
/**
@@ -214,7 +214,7 @@ static inline uint TileX(TileIndex tile)
*/
static inline uint TileY(TileIndex tile)
{
return tile >> MapLogX();
return tile.value >> MapLogX();
}
/**