Changeset - r18261:0aa61ca7490f
[Not reviewed]
master
0 12 0
rubidium - 13 years ago 2011-11-04 11:36:10
rubidium@openttd.org
(svn r23107) -Codechange: let GetSlopePixelZ and TerraformTile tile type functions use int z as well
12 files changed with 26 insertions and 26 deletions:
0 comments (0 inline, 0 general)
src/clear_cmd.cpp
Show inline comments
 
@@ -107,7 +107,7 @@ static void DrawTile_Clear(TileInfo *ti)
 
	DrawBridgeMiddle(ti);
 
}
 

	
 
static uint GetSlopePixelZ_Clear(TileIndex tile, uint x, uint y)
 
static int GetSlopePixelZ_Clear(TileIndex tile, uint x, uint y)
 
{
 
	int z;
 
	Slope tileh = GetTilePixelSlope(tile, &z);
 
@@ -361,7 +361,7 @@ static void ChangeTileOwner_Clear(TileIn
 
	return;
 
}
 

	
 
static CommandCost TerraformTile_Clear(TileIndex tile, DoCommandFlag flags, uint z_new, Slope tileh_new)
 
static CommandCost TerraformTile_Clear(TileIndex tile, DoCommandFlag flags, int z_new, Slope tileh_new)
 
{
 
	return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
 
}
src/industry_cmd.cpp
Show inline comments
 
@@ -364,7 +364,7 @@ static void DrawTile_Industry(TileInfo *
 
	}
 
}
 

	
 
static uint GetSlopePixelZ_Industry(TileIndex tile, uint x, uint y)
 
static int GetSlopePixelZ_Industry(TileIndex tile, uint x, uint y)
 
{
 
	return GetTileMaxPixelZ(tile);
 
}
 
@@ -2715,7 +2715,7 @@ bool IndustrySpec::UsesSmoothEconomy() c
 
		!(HasBit(this->callback_mask, CBM_IND_MONTHLYPROD_CHANGE) || HasBit(this->callback_mask, CBM_IND_PRODUCTION_CHANGE));            // production change callbacks
 
}
 

	
 
static CommandCost TerraformTile_Industry(TileIndex tile, DoCommandFlag flags, uint z_new, Slope tileh_new)
 
static CommandCost TerraformTile_Industry(TileIndex tile, DoCommandFlag flags, int z_new, Slope tileh_new)
 
{
 
	if (AutoslopeEnabled()) {
 
		/* We imitate here TTDP's behaviour:
src/object_cmd.cpp
Show inline comments
 
@@ -381,7 +381,7 @@ static void DrawTile_Object(TileInfo *ti
 
	if (spec->flags & OBJECT_FLAG_ALLOW_UNDER_BRIDGE) DrawBridgeMiddle(ti);
 
}
 

	
 
static uint GetSlopePixelZ_Object(TileIndex tile, uint x, uint y)
 
static int GetSlopePixelZ_Object(TileIndex tile, uint x, uint y)
 
{
 
	if (IsOwnedLand(tile)) {
 
		int z;
 
@@ -716,7 +716,7 @@ static void ChangeTileOwner_Object(TileI
 
	}
 
}
 

	
 
static CommandCost TerraformTile_Object(TileIndex tile, DoCommandFlag flags, uint z_new, Slope tileh_new)
 
static CommandCost TerraformTile_Object(TileIndex tile, DoCommandFlag flags, int z_new, Slope tileh_new)
 
{
 
	ObjectType type = GetObjectType(tile);
 

	
src/rail_cmd.cpp
Show inline comments
 
@@ -2335,7 +2335,7 @@ void DrawTrainDepotSprite(int x, int y, 
 
	DrawRailTileSeqInGUI(x, y, dts, offset, 0, palette);
 
}
 

	
 
static uint GetSlopePixelZ_Track(TileIndex tile, uint x, uint y)
 
static int GetSlopePixelZ_Track(TileIndex tile, uint x, uint y)
 
{
 
	if (IsPlainRail(tile)) {
 
		int z;
 
@@ -2826,7 +2826,7 @@ static CommandCost TestAutoslopeOnRailTi
 
	return  cost;
 
}
 

	
 
static CommandCost TerraformTile_Track(TileIndex tile, DoCommandFlag flags, uint z_new, Slope tileh_new)
 
static CommandCost TerraformTile_Track(TileIndex tile, DoCommandFlag flags, int z_new, Slope tileh_new)
 
{
 
	int z_old;
 
	Slope tileh_old = GetTileSlope(tile, &z_old);
src/road_cmd.cpp
Show inline comments
 
@@ -1337,7 +1337,7 @@ void UpdateNearestTownForRoadTiles(bool 
 
	}
 
}
 

	
 
static uint GetSlopePixelZ_Road(TileIndex tile, uint x, uint y)
 
static int GetSlopePixelZ_Road(TileIndex tile, uint x, uint y)
 
{
 

	
 
	if (IsNormalRoad(tile)) {
 
@@ -1677,7 +1677,7 @@ static void ChangeTileOwner_Road(TileInd
 
	}
 
}
 

	
 
static CommandCost TerraformTile_Road(TileIndex tile, DoCommandFlag flags, uint z_new, Slope tileh_new)
 
static CommandCost TerraformTile_Road(TileIndex tile, DoCommandFlag flags, int z_new, Slope tileh_new)
 
{
 
	if (_settings_game.construction.build_on_slopes && AutoslopeEnabled()) {
 
		switch (GetRoadTileType(tile)) {
src/station_cmd.cpp
Show inline comments
 
@@ -2756,7 +2756,7 @@ void StationPickerDrawSprite(int x, int 
 
	DrawRailTileSeqInGUI(x, y, t, st == STATION_WAYPOINT ? 0 : total_offset, 0, pal);
 
}
 

	
 
static uint GetSlopePixelZ_Station(TileIndex tile, uint x, uint y)
 
static int GetSlopePixelZ_Station(TileIndex tile, uint x, uint y)
 
{
 
	return GetTileMaxPixelZ(tile);
 
}
 
@@ -3589,7 +3589,7 @@ CommandCost ClearTile_Station(TileIndex 
 
	return CMD_ERROR;
 
}
 

	
 
static CommandCost TerraformTile_Station(TileIndex tile, DoCommandFlag flags, uint z_new, Slope tileh_new)
 
static CommandCost TerraformTile_Station(TileIndex tile, DoCommandFlag flags, int z_new, Slope tileh_new)
 
{
 
	if (_settings_game.construction.build_on_slopes && AutoslopeEnabled()) {
 
		/* TODO: If you implement newgrf callback 149 'land slope check', you have to decide what to do with it here.
src/tile_cmd.h
Show inline comments
 
@@ -70,7 +70,7 @@ struct TileDesc {
 
 * @param ti Information about the tile to draw
 
 */
 
typedef void DrawTileProc(TileInfo *ti);
 
typedef uint GetSlopeZProc(TileIndex tile, uint x, uint y);
 
typedef int GetSlopeZProc(TileIndex tile, uint x, uint y);
 
typedef CommandCost ClearTileProc(TileIndex tile, DoCommandFlag flags);
 

	
 
/**
 
@@ -133,7 +133,7 @@ typedef Foundation GetFoundationProc(Til
 
 * @param tileh_new Slope after terraforming.
 
 * @return Error code or extra cost for terraforming (like clearing land, building foundations, etc., but not the terraforming itself.)
 
 */
 
typedef CommandCost TerraformTileProc(TileIndex tile, DoCommandFlag flags, uint z_new, Slope tileh_new);
 
typedef CommandCost TerraformTileProc(TileIndex tile, DoCommandFlag flags, int z_new, Slope tileh_new);
 

	
 
/**
 
 * Set of callback functions for performing tile operations of a given tile type.
src/town_cmd.cpp
Show inline comments
 
@@ -255,7 +255,7 @@ static void DrawTile_Town(TileInfo *ti)
 
	}
 
}
 

	
 
static uint GetSlopePixelZ_Town(TileIndex tile, uint x, uint y)
 
static int GetSlopePixelZ_Town(TileIndex tile, uint x, uint y)
 
{
 
	return GetTileMaxPixelZ(tile);
 
}
 
@@ -3046,7 +3046,7 @@ void TownsYearlyLoop()
 
	}
 
}
 

	
 
static CommandCost TerraformTile_Town(TileIndex tile, DoCommandFlag flags, uint z_new, Slope tileh_new)
 
static CommandCost TerraformTile_Town(TileIndex tile, DoCommandFlag flags, int z_new, Slope tileh_new)
 
{
 
	if (AutoslopeEnabled()) {
 
		HouseID house = GetHouseType(tile);
src/tree_cmd.cpp
Show inline comments
 
@@ -516,7 +516,7 @@ static void DrawTile_Trees(TileInfo *ti)
 
}
 

	
 

	
 
static uint GetSlopePixelZ_Trees(TileIndex tile, uint x, uint y)
 
static int GetSlopePixelZ_Trees(TileIndex tile, uint x, uint y)
 
{
 
	int z;
 
	Slope tileh = GetTilePixelSlope(tile, &z);
 
@@ -776,7 +776,7 @@ void InitializeTrees()
 
	_trees_tick_ctr = 0;
 
}
 

	
 
static CommandCost TerraformTile_Trees(TileIndex tile, DoCommandFlag flags, uint z_new, Slope tileh_new)
 
static CommandCost TerraformTile_Trees(TileIndex tile, DoCommandFlag flags, int z_new, Slope tileh_new)
 
{
 
	return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
 
}
src/tunnelbridge_cmd.cpp
Show inline comments
 
@@ -1359,7 +1359,7 @@ void DrawBridgeMiddle(const TileInfo *ti
 
}
 

	
 

	
 
static uint GetSlopePixelZ_TunnelBridge(TileIndex tile, uint x, uint y)
 
static int GetSlopePixelZ_TunnelBridge(TileIndex tile, uint x, uint y)
 
{
 
	int z;
 
	Slope tileh = GetTilePixelSlope(tile, &z);
 
@@ -1673,7 +1673,7 @@ static VehicleEnterTileStatus VehicleEnt
 
	return VETSB_CONTINUE;
 
}
 

	
 
static CommandCost TerraformTile_TunnelBridge(TileIndex tile, DoCommandFlag flags, uint z_new, Slope tileh_new)
 
static CommandCost TerraformTile_TunnelBridge(TileIndex tile, DoCommandFlag flags, int z_new, Slope tileh_new)
 
{
 
	if (_settings_game.construction.build_on_slopes && AutoslopeEnabled() && IsBridge(tile) && GetTunnelBridgeTransportType(tile) != TRANSPORT_WATER) {
 
		DiagDirection direction = GetTunnelBridgeDirection(tile);
 
@@ -1685,10 +1685,10 @@ static CommandCost TerraformTile_TunnelB
 
		/* Check if new slope is valid for bridges in general (so we can safely call GetBridgeFoundation()) */
 
		if ((direction == DIAGDIR_NW) || (direction == DIAGDIR_NE)) {
 
			CheckBridgeSlopeSouth(axis, &tileh_old, &z_old);
 
			res = CheckBridgeSlopeSouth(axis, &tileh_new, (int*)&z_new);
 
			res = CheckBridgeSlopeSouth(axis, &tileh_new, &z_new);
 
		} else {
 
			CheckBridgeSlopeNorth(axis, &tileh_old, &z_old);
 
			res = CheckBridgeSlopeNorth(axis, &tileh_new, (int*)&z_new);
 
			res = CheckBridgeSlopeNorth(axis, &tileh_new, &z_new);
 
		}
 

	
 
		/* Surface slope is valid and remains unchanged? */
src/void_cmd.cpp
Show inline comments
 
@@ -23,7 +23,7 @@ static void DrawTile_Void(TileInfo *ti)
 
}
 

	
 

	
 
static uint GetSlopePixelZ_Void(TileIndex tile, uint x, uint y)
 
static int GetSlopePixelZ_Void(TileIndex tile, uint x, uint y)
 
{
 
	return TilePixelHeight(tile);
 
}
 
@@ -60,7 +60,7 @@ static TrackStatus GetTileTrackStatus_Vo
 
	return 0;
 
}
 

	
 
static CommandCost TerraformTile_Void(TileIndex tile, DoCommandFlag flags, uint z_new, Slope tileh_new)
 
static CommandCost TerraformTile_Void(TileIndex tile, DoCommandFlag flags, int z_new, Slope tileh_new)
 
{
 
	return_cmd_error(STR_ERROR_OFF_EDGE_OF_MAP);
 
}
src/water_cmd.cpp
Show inline comments
 
@@ -794,7 +794,7 @@ void DrawShipDepotSprite(int x, int y, A
 
}
 

	
 

	
 
static uint GetSlopePixelZ_Water(TileIndex tile, uint x, uint y)
 
static int GetSlopePixelZ_Water(TileIndex tile, uint x, uint y)
 
{
 
	int z;
 
	Slope tileh = GetTilePixelSlope(tile, &z);
 
@@ -1202,7 +1202,7 @@ static VehicleEnterTileStatus VehicleEnt
 
	return VETSB_CONTINUE;
 
}
 

	
 
static CommandCost TerraformTile_Water(TileIndex tile, DoCommandFlag flags, uint z_new, Slope tileh_new)
 
static CommandCost TerraformTile_Water(TileIndex tile, DoCommandFlag flags, int z_new, Slope tileh_new)
 
{
 
	/* Canals can't be terraformed */
 
	if (IsWaterTile(tile) && IsCanal(tile)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_CANAL_FIRST);
0 comments (0 inline, 0 general)