diff options
Diffstat (limited to 'src/slope_func.h')
-rw-r--r-- | src/slope_func.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/slope_func.h b/src/slope_func.h index c36c89efd..d231a4d08 100644 --- a/src/slope_func.h +++ b/src/slope_func.h @@ -159,11 +159,22 @@ static inline Corner GetHalftileSlopeCorner(Slope s) * @param s The #Slope. * @return Relative height of highest corner. */ -static inline uint GetSlopeMaxPixelZ(Slope s) +static inline uint GetSlopeMaxZ(Slope s) { if (s == SLOPE_FLAT) return 0; - if (IsSteepSlope(s)) return 2 * TILE_HEIGHT; - return TILE_HEIGHT; + if (IsSteepSlope(s)) return 2; + return 1; +} + +/** + * Returns the height of the highest corner of a slope relative to TileZ (= minimal height) + * + * @param s The #Slope. + * @return Relative height of highest corner. + */ +static inline uint GetSlopeMaxPixelZ(Slope s) +{ + return GetSlopeMaxZ(s) * TILE_HEIGHT; } /** |