Codechange: add and use TileOffsByAxis(...) over TileOffsByDir(DiagDirToAxis(...))

This commit is contained in:
Rubidium
2024-10-23 06:56:34 +02:00
committed by rubidium42
parent 7a71df2952
commit 38c9eb76a0
4 changed files with 23 additions and 3 deletions
+6
View File
@@ -108,6 +108,12 @@ TileIndex TileAddWrap(TileIndex tile, int addx, int addy)
return TileXY(x, y);
}
/** 'Lookup table' for tile offsets given an Axis */
extern const TileIndexDiffC _tileoffs_by_axis[] = {
{ 1, 0}, ///< AXIS_X
{ 0, 1}, ///< AXIS_Y
};
/** 'Lookup table' for tile offsets given a DiagDirection */
extern const TileIndexDiffC _tileoffs_by_diagdir[] = {
{-1, 0}, ///< DIAGDIR_NE