Changeset - r18849:190a54fab452
[Not reviewed]
master
0 1 0
truebrain - 13 years ago 2012-01-01 19:20:08
truebrain@openttd.org
(svn r23708) -Codechange: apply the same trick as r23701 to GetTileSlope(), gaining similar benefits
1 file changed with 5 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/tile_map.cpp
Show inline comments
 
@@ -19,14 +19,17 @@
 
 * @return Slope of the tile, except for the HALFTILE part
 
 */
 
Slope GetTileSlope(TileIndex tile, int *h)
 
{
 
	assert(tile < MapSize());
 

	
 
	if (TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY() ||
 
			(_settings_game.construction.freeform_edges && (TileX(tile) == 0 || TileY(tile) == 0))) {
 
	uint x = TileX(tile);
 
	uint y = TileY(tile);
 

	
 
	if (x == MapMaxX() || y == MapMaxY() ||
 
			((x == 0 || y == 0) && _settings_game.construction.freeform_edges)) {
 
		if (h != NULL) *h = TileHeight(tile);
 
		return SLOPE_FLAT;
 
	}
 

	
 
	int a = TileHeight(tile); // Height of the N corner
 
	int min = a; // Minimal height of all corners examined so far
0 comments (0 inline, 0 general)