From 421f4721be2f88b672aee12ab49e69b0bbdb97f2 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 11 Apr 2021 12:34:25 +0100 Subject: [PATCH] Fix formatting --- src/openrct2/paint/Paint.h | 16 ++++++++-------- src/openrct2/world/Map.cpp | 6 ++---- src/openrct2/world/Map.h | 15 ++++++++++++--- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/openrct2/paint/Paint.h b/src/openrct2/paint/Paint.h index 451f207fa9..be52df7c8a 100644 --- a/src/openrct2/paint/Paint.h +++ b/src/openrct2/paint/Paint.h @@ -236,16 +236,16 @@ paint_struct* PaintAddImageAsChild( const CoordsXYZ& boundBoxOffset); paint_struct* PaintAddImageAsParentRotated( - paint_session* session, uint8_t direction, uint32_t image_id, int32_t x_offset, int32_t y_offset, int32_t bound_box_length_x, - int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset); + paint_session* session, uint8_t direction, uint32_t image_id, int32_t x_offset, int32_t y_offset, + int32_t bound_box_length_x, int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset); paint_struct* PaintAddImageAsParentRotated( - paint_session* session, uint8_t direction, uint32_t image_id, int32_t x_offset, int32_t y_offset, int32_t bound_box_length_x, - int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, int32_t bound_box_offset_x, - int32_t bound_box_offset_y, int32_t bound_box_offset_z); + paint_session* session, uint8_t direction, uint32_t image_id, int32_t x_offset, int32_t y_offset, + int32_t bound_box_length_x, int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, + int32_t bound_box_offset_x, int32_t bound_box_offset_y, int32_t bound_box_offset_z); paint_struct* PaintAddImageAsChildRotated( - paint_session* session, uint8_t direction, uint32_t image_id, int32_t x_offset, int32_t y_offset, int32_t bound_box_length_x, - int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, int32_t bound_box_offset_x, - int32_t bound_box_offset_y, int32_t bound_box_offset_z); + paint_session* session, uint8_t direction, uint32_t image_id, int32_t x_offset, int32_t y_offset, + int32_t bound_box_length_x, int32_t bound_box_length_y, int32_t bound_box_length_z, int32_t z_offset, + int32_t bound_box_offset_x, int32_t bound_box_offset_y, int32_t bound_box_offset_z); void paint_util_push_tunnel_rotated(paint_session* session, uint8_t direction, uint16_t height, uint8_t type); diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index ecd164fb1c..e95c00365c 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -904,8 +904,7 @@ int32_t tile_element_get_corner_height(const SurfaceElement* surfaceElement, int uint8_t map_get_lowest_land_height(const MapRange& range) { MapRange validRange = { std::max(range.GetLeft(), 32), std::max(range.GetTop(), 32), - std::min(range.GetRight(), GetMapSizeMaxXY()), - std::min(range.GetBottom(), GetMapSizeMaxXY()) }; + std::min(range.GetRight(), GetMapSizeMaxXY()), std::min(range.GetBottom(), GetMapSizeMaxXY()) }; uint8_t min_height = 0xFF; for (int32_t yi = validRange.GetTop(); yi <= validRange.GetBottom(); yi += COORDS_XY_STEP) @@ -934,8 +933,7 @@ uint8_t map_get_lowest_land_height(const MapRange& range) uint8_t map_get_highest_land_height(const MapRange& range) { MapRange validRange = { std::max(range.GetLeft(), 32), std::max(range.GetTop(), 32), - std::min(range.GetRight(), GetMapSizeMaxXY()), - std::min(range.GetBottom(), GetMapSizeMaxXY()) }; + std::min(range.GetRight(), GetMapSizeMaxXY()), std::min(range.GetBottom(), GetMapSizeMaxXY()) }; uint8_t max_height = 0; for (int32_t yi = validRange.GetTop(); yi <= validRange.GetBottom(); yi += COORDS_XY_STEP) diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index 00a2325352..2786994818 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -104,9 +104,18 @@ extern uint16_t gGrassSceneryTileLoopPosition; extern int32_t gMapSize; extern int32_t gMapBaseZ; -inline int32_t GetMapSizeUnits() { return (gMapSize - 1) * COORDS_XY_STEP; } -inline int32_t GetMapSizeMinus2() { return (gMapSize * COORDS_XY_STEP) + MAXIMUM_MAP_SIZE_PRACTICAL; } -inline int32_t GetMapSizeMaxXY() { return GetMapSizeUnits() - 1; } +inline int32_t GetMapSizeUnits() +{ + return (gMapSize - 1) * COORDS_XY_STEP; +} +inline int32_t GetMapSizeMinus2() +{ + return (gMapSize * COORDS_XY_STEP) + MAXIMUM_MAP_SIZE_PRACTICAL; +} +inline int32_t GetMapSizeMaxXY() +{ + return GetMapSizeUnits() - 1; +} extern uint16_t gMapSelectFlags; extern uint16_t gMapSelectType;