Changeset - r18248:133cf25ab512
[Not reviewed]
master
0 5 0
rubidium - 13 years ago 2011-11-04 10:23:48
rubidium@openttd.org
(svn r23094) -Codechange: add a default NULL to GetFoundationSlope and use it
5 files changed with 7 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/landscape.h
Show inline comments
 
@@ -36,7 +36,7 @@ byte LowestSnowLine();
 
void ClearSnowLine();
 

	
 
int GetSlopeZInCorner(Slope tileh, Corner corner);
 
Slope GetFoundationSlope(TileIndex tile, uint *z);
 
Slope GetFoundationSlope(TileIndex tile, uint *z = NULL);
 

	
 
uint GetPartialPixelZ(int x, int y, Slope corners);
 
uint GetSlopePixelZ(int x, int y);
 
@@ -66,8 +66,9 @@ static inline int GetSlopePixelZInCorner
 
 */
 
static inline Slope GetFoundationPixelSlope(TileIndex tile, uint *z)
 
{
 
	assert(z != NULL);
 
	Slope s = GetFoundationSlope(tile, z);
 
	if (z != NULL) *z *= TILE_HEIGHT;
 
	*z *= TILE_HEIGHT;
 
	return s;
 
}
 

	
src/road.cpp
Show inline comments
 
@@ -32,7 +32,7 @@ static bool IsPossibleCrossing(const Til
 
	return (IsTileType(tile, MP_RAILWAY) &&
 
		GetRailTileType(tile) == RAIL_TILE_NORMAL &&
 
		GetTrackBits(tile) == (ax == AXIS_X ? TRACK_BIT_Y : TRACK_BIT_X) &&
 
		GetFoundationPixelSlope(tile, NULL) == SLOPE_FLAT);
 
		GetFoundationSlope(tile) == SLOPE_FLAT);
 
}
 

	
 
/**
src/road_cmd.cpp
Show inline comments
 
@@ -1410,7 +1410,7 @@ static void TileLoop_Road(TileIndex tile
 
			if (t->road_build_months != 0 &&
 
					(DistanceManhattan(t->xy, tile) < 8 || grp != HZB_TOWN_EDGE) &&
 
					IsNormalRoad(tile) && !HasAtMostOneBit(GetAllRoadBits(tile))) {
 
				if (GetFoundationPixelSlope(tile, NULL) == SLOPE_FLAT && EnsureNoVehicleOnGround(tile).Succeeded() && Chance16(1, 40)) {
 
				if (GetFoundationSlope(tile) == SLOPE_FLAT && EnsureNoVehicleOnGround(tile).Succeeded() && Chance16(1, 40)) {
 
					StartRoadWorks(tile);
 

	
 
					SndPlayTileFx(SND_21_JACKHAMMER, tile);
src/town_cmd.cpp
Show inline comments
 
@@ -787,7 +787,7 @@ static bool IsRoadAllowedHere(Town *t, T
 
		}
 
	}
 

	
 
	Slope cur_slope = _settings_game.construction.build_on_slopes ? GetFoundationPixelSlope(tile, NULL) : GetTileSlope(tile);
 
	Slope cur_slope = _settings_game.construction.build_on_slopes ? GetFoundationSlope(tile) : GetTileSlope(tile);
 
	bool ret = !IsNeighborRoadTile(tile, dir, t->layout == TL_ORIGINAL ? 1 : 2);
 
	if (cur_slope == SLOPE_FLAT) return ret;
 

	
src/water_cmd.cpp
Show inline comments
 
@@ -1090,7 +1090,7 @@ void TileLoop_Water(TileIndex tile)
 
			break;
 

	
 
		case FLOOD_DRYUP: {
 
			Slope slope_here = GetFoundationPixelSlope(tile, NULL) & ~SLOPE_HALFTILE_MASK & ~SLOPE_STEEP;
 
			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));
0 comments (0 inline, 0 general)