mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-08 23:34:15 +00:00
(svn r23723) -Codechange: speedup flood checks a bit
This commit is contained in:
parent
4027e58ba3
commit
b9e19cc6c1
@ -697,8 +697,8 @@ void GenerateObjects()
|
||||
assert(tile < MapSize());
|
||||
break;
|
||||
}
|
||||
tile = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDiagDir(dir));
|
||||
if (tile == INVALID_TILE) break;
|
||||
tile += TileOffsByDiagDir(dir);
|
||||
if (!IsValidTile(tile)) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1148,8 +1148,8 @@ void TileLoop_Water(TileIndex tile)
|
||||
switch (GetFloodingBehaviour(tile)) {
|
||||
case FLOOD_ACTIVE:
|
||||
for (Direction dir = DIR_BEGIN; dir < DIR_END; dir++) {
|
||||
TileIndex dest = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDir(dir));
|
||||
if (dest == INVALID_TILE) continue;
|
||||
TileIndex dest = tile + TileOffsByDir(dir);
|
||||
if (!IsValidTile(dest)) continue;
|
||||
/* do not try to flood water tiles - increases performance a lot */
|
||||
if (IsTileType(dest, MP_WATER)) continue;
|
||||
|
||||
@ -1167,8 +1167,8 @@ void TileLoop_Water(TileIndex tile)
|
||||
Slope slope_here = GetFoundationSlope(tile) & ~SLOPE_HALFTILE_MASK & ~SLOPE_STEEP;
|
||||
uint dir;
|
||||
FOR_EACH_SET_BIT(dir, _flood_from_dirs[slope_here]) {
|
||||
TileIndex dest = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDir((Direction)dir));
|
||||
if (dest == INVALID_TILE) continue;
|
||||
TileIndex dest = tile + TileOffsByDir(dir);
|
||||
if (!IsValidTile(dest)) continue;
|
||||
|
||||
FloodingBehaviour dest_behaviour = GetFloodingBehaviour(dest);
|
||||
if ((dest_behaviour == FLOOD_ACTIVE) || (dest_behaviour == FLOOD_PASSIVE)) return;
|
||||
|
Loading…
Reference in New Issue
Block a user