summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/clear_cmd.cpp4
-rw-r--r--src/industry_cmd.cpp4
-rw-r--r--src/object_cmd.cpp4
-rw-r--r--src/rail_cmd.cpp4
-rw-r--r--src/road_cmd.cpp4
-rw-r--r--src/station_cmd.cpp4
-rw-r--r--src/tile_cmd.h4
-rw-r--r--src/town_cmd.cpp4
-rw-r--r--src/tree_cmd.cpp4
-rw-r--r--src/tunnelbridge_cmd.cpp8
-rw-r--r--src/void_cmd.cpp4
-rw-r--r--src/water_cmd.cpp4
12 files changed, 26 insertions, 26 deletions
diff --git a/src/clear_cmd.cpp b/src/clear_cmd.cpp
index b5c110808..2bc1a8267 100644
--- a/src/clear_cmd.cpp
+++ b/src/clear_cmd.cpp
@@ -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(TileIndex tile, Owner old_owner, Owner new_own
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);
}
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index e42e87e51..7ebca2368 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -364,7 +364,7 @@ static void DrawTile_Industry(TileInfo *ti)
}
}
-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() const
!(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:
diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp
index 722cb6893..d07385214 100644
--- a/src/object_cmd.cpp
+++ b/src/object_cmd.cpp
@@ -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(TileIndex tile, Owner old_owner, Owner new_ow
}
}
-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);
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index b323ad02a..efbb1ad73 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -2335,7 +2335,7 @@ void DrawTrainDepotSprite(int x, int y, int dir, RailType railtype)
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 TestAutoslopeOnRailTile(TileIndex tile, uint flags, uint z_ol
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);
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index 8d0878c04..2a6eb3bea 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -1337,7 +1337,7 @@ void UpdateNearestTownForRoadTiles(bool invalidate)
}
}
-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(TileIndex tile, Owner old_owner, Owner new_owne
}
}
-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)) {
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 9a930d87c..de018f491 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2756,7 +2756,7 @@ void StationPickerDrawSprite(int x, int y, StationType st, RailType railtype, Ro
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 tile, DoCommandFlag flags)
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.
diff --git a/src/tile_cmd.h b/src/tile_cmd.h
index bdab10621..7dae7a1ca 100644
--- a/src/tile_cmd.h
+++ b/src/tile_cmd.h
@@ -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(TileIndex tile, Slope tileh);
* @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.
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 6ea51fcc4..8323e9e63 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -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);
diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp
index 61d3bf912..852823c3e 100644
--- a/src/tree_cmd.cpp
+++ b/src/tree_cmd.cpp
@@ -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);
}
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index fd6b5f9c6..8edfdc810 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -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 VehicleEnter_TunnelBridge(Vehicle *v, TileIndex ti
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_TunnelBridge(TileIndex tile, DoCommandFlag flag
/* 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? */
diff --git a/src/void_cmd.cpp b/src/void_cmd.cpp
index fb36d90cf..80c0fbeb6 100644
--- a/src/void_cmd.cpp
+++ b/src/void_cmd.cpp
@@ -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_Void(TileIndex tile, TransportType mode, u
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);
}
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp
index b06d5c590..e5e159b56 100644
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -794,7 +794,7 @@ void DrawShipDepotSprite(int x, int y, Axis axis, DepotPart part)
}
-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 VehicleEnter_Water(Vehicle *v, TileIndex tile, int
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);