(svn r6406) -Codechange: Rename TileOffsByDir to TileOffsByDiagDir because it accepts

DiagDirections, and add TileOffsByDir that handles Directions.
-Codechange: Make the treeloop use TileOffsByDir().
This commit is contained in:
Darkvater
2006-09-05 23:21:41 +00:00
parent a53c92464f
commit 7e4d0f112e
29 changed files with 111 additions and 102 deletions

19
map.c
View File

@@ -120,11 +120,22 @@ uint TileAddWrap(TileIndex tile, int addx, int addy)
return INVALID_TILE;
}
const TileIndexDiffC _tileoffs_by_diagdir[] = {
{-1, 0}, // DIAGDIR_NE
{ 0, 1}, // DIAGDIR_SE
{ 1, 0}, // DIAGDIR_SW
{ 0, -1} // DIAGDIR_NW
};
const TileIndexDiffC _tileoffs_by_dir[] = {
{-1, 0},
{ 0, 1},
{ 1, 0},
{ 0, -1}
{-1, -1}, // DIR_N
{-1, 0}, // DIR_NE
{-1, 1}, // DIR_E
{ 0, 1}, // DIR_SE
{ 1, 1}, // DIR_S
{ 1, 0}, // DIR_SW
{ 1, -1}, // DIR_W
{ 0, -1} // DIR_NW
};
uint DistanceManhattan(TileIndex t0, TileIndex t1)