diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp index e5d5e845fd..2d268dde83 100644 --- a/src/tree_cmd.cpp +++ b/src/tree_cmd.cpp @@ -187,9 +187,10 @@ struct BlobHarmonic { /** * Creates a star-shaped polygon originating from (0, 0) as defined by the given harmonics. + * The shape is placed into a pre-allocated span so the caller controls allocation. * @param radius The maximum radius of the polygon. May be smaller, but will not be larger. * @param harmonics Harmonics data for the polygon. - * @param shape Shape to fill with points. + * @param[out] shape Shape to fill with points. */ static void CreateStarShapedPolygon(const int radius, std::span harmonics, std::span shape) { @@ -218,6 +219,7 @@ static void CreateStarShapedPolygon(const int radius, std::span shape) { @@ -291,6 +293,8 @@ static void PlaceTreeGroups(uint num_groups) { static constexpr uint GROVE_SEGMENTS = 16; ///< How many segments make up the tree group. static constexpr uint GROVE_RADIUS = 16; ///< Maximum radius of tree groups. + + /* Shape in which trees may be contained. Array is here to reduce allocations. */ std::array grove; do {