Merge branch 'master' into jgrpp

# Conflicts:
#	src/landscape.cpp
#	src/landscape.h
#	src/misc_gui.cpp
#	src/newgrf_commons.cpp
#	src/order_cmd.cpp
#	src/pathfinder/yapf/yapf_base.hpp
#	src/station_cmd.cpp
#	src/tunnelbridge_cmd.cpp
#	src/vehicle.cpp
#	src/water_cmd.cpp
#	src/window.cpp
This commit is contained in:
Jonathan G Rennison
2024-03-09 21:44:36 +00:00
119 changed files with 1359 additions and 1148 deletions

View File

@@ -269,26 +269,34 @@ inline void SetAnimationFrame(TileIndex t, byte frame)
_me[t].m7 = frame;
}
Slope GetTileSlope(TileIndex tile, int *h = nullptr);
std::tuple<Slope, int> GetTileSlopeZ(TileIndex tile);
int GetTileZ(TileIndex tile);
int GetTileMaxZ(TileIndex tile);
bool IsTileFlat(TileIndex tile, int *h = nullptr);
/**
* Return the slope of a given tile
* Return the slope of a given tile inside the map.
* @param tile Tile to compute slope of
* @param h If not \c nullptr, pointer to storage of z height
* @return Slope of the tile, except for the HALFTILE part
*/
inline Slope GetTilePixelSlope(TileIndex tile, int *h)
inline Slope GetTileSlope(TileIndex tile)
{
Slope s = GetTileSlope(tile, h);
if (h != nullptr) *h *= TILE_HEIGHT;
return s;
return std::get<0>(GetTileSlopeZ(tile));
}
Slope GetTilePixelSlopeOutsideMap(int x, int y, int *h);
/**
* Return the slope of a given tile
* @param tile Tile to compute slope of
* @return Slope of the tile, except for the HALFTILE part, and the z height.
*/
inline std::tuple<Slope, int> GetTilePixelSlope(TileIndex tile)
{
auto [s, h] = GetTileSlopeZ(tile);
return {s, h * TILE_HEIGHT};
}
std::tuple<Slope, int> GetTilePixelSlopeOutsideMap(int x, int y);
/**
* Get bottom height of the tile