Mark input data structures as const. (#625)

This commit is contained in:
andriyDev 2023-04-20 16:16:35 -07:00 committed by GitHub
parent f4a65fd317
commit 6d1f9711b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 9 deletions

View File

@ -1083,7 +1083,7 @@ int rcGetHeightFieldSpanCount(rcContext* context, const rcHeightfield& heightfie
/// @param[out] compactHeightfield The resulting compact heightfield. (Must be pre-allocated.)
/// @returns True if the operation completed successfully.
bool rcBuildCompactHeightfield(rcContext* context, int walkableHeight, int walkableClimb,
rcHeightfield& heightfield, rcCompactHeightfield& compactHeightfield);
const rcHeightfield& heightfield, rcCompactHeightfield& compactHeightfield);
/// Erodes the walkable area within the heightfield by the specified radius.
/// @ingroup recast
@ -1256,7 +1256,7 @@ inline int rcGetDirForOffset(int offsetX, int offsetZ)
/// to be considered walkable. [Limit: >= 3] [Units: vx]
/// @param[out] lset The resulting layer set. (Must be pre-allocated.)
/// @returns True if the operation completed successfully.
bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf,
bool rcBuildHeightfieldLayers(rcContext* ctx, const rcCompactHeightfield& chf,
int borderSize, int walkableHeight,
rcHeightfieldLayerSet& lset);
@ -1271,7 +1271,7 @@ bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf,
/// @param[out] cset The resulting contour set. (Must be pre-allocated.)
/// @param[in] buildFlags The build flags. (See: #rcBuildContoursFlags)
/// @returns True if the operation completed successfully.
bool rcBuildContours(rcContext* ctx, rcCompactHeightfield& chf,
bool rcBuildContours(rcContext* ctx, const rcCompactHeightfield& chf,
float maxError, int maxEdgeLen,
rcContourSet& cset, int buildFlags = RC_CONTOUR_TESS_WALL_EDGES);
@ -1283,7 +1283,7 @@ bool rcBuildContours(rcContext* ctx, rcCompactHeightfield& chf,
/// contour to polygon conversion process. [Limit: >= 3]
/// @param[out] mesh The resulting polygon mesh. (Must be re-allocated.)
/// @returns True if the operation completed successfully.
bool rcBuildPolyMesh(rcContext* ctx, rcContourSet& cset, const int nvp, rcPolyMesh& mesh);
bool rcBuildPolyMesh(rcContext* ctx, const rcContourSet& cset, const int nvp, rcPolyMesh& mesh);
/// Merges multiple polygon meshes into a single mesh.
/// @ingroup recast

View File

@ -401,7 +401,7 @@ int rcGetHeightFieldSpanCount(rcContext* context, const rcHeightfield& heightfie
}
bool rcBuildCompactHeightfield(rcContext* context, const int walkableHeight, const int walkableClimb,
rcHeightfield& heightfield, rcCompactHeightfield& compactHeightfield)
const rcHeightfield& heightfield, rcCompactHeightfield& compactHeightfield)
{
rcAssert(context);

View File

@ -101,7 +101,7 @@ static int getCornerHeight(int x, int y, int i, int dir,
}
static void walkContour(int x, int y, int i,
rcCompactHeightfield& chf,
const rcCompactHeightfield& chf,
unsigned char* flags, rcIntArray& points)
{
// Choose the first non-connected edge
@ -820,7 +820,7 @@ static void mergeRegionHoles(rcContext* ctx, rcContourRegion& region)
/// See the #rcConfig documentation for more information on the configuration parameters.
///
/// @see rcAllocContourSet, rcCompactHeightfield, rcContourSet, rcConfig
bool rcBuildContours(rcContext* ctx, rcCompactHeightfield& chf,
bool rcBuildContours(rcContext* ctx, const rcCompactHeightfield& chf,
const float maxError, const int maxEdgeLen,
rcContourSet& cset, const int buildFlags)
{

View File

@ -101,7 +101,7 @@ struct rcLayerSweepSpan
/// See the #rcConfig documentation for more information on the configuration parameters.
///
/// @see rcAllocHeightfieldLayerSet, rcCompactHeightfield, rcHeightfieldLayerSet, rcConfig
bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf,
bool rcBuildHeightfieldLayers(rcContext* ctx, const rcCompactHeightfield& chf,
const int borderSize, const int walkableHeight,
rcHeightfieldLayerSet& lset)
{

View File

@ -986,7 +986,7 @@ static bool removeVertex(rcContext* ctx, rcPolyMesh& mesh, const unsigned short
/// limit must be retricted to <= #DT_VERTS_PER_POLYGON.
///
/// @see rcAllocPolyMesh, rcContourSet, rcPolyMesh, rcConfig
bool rcBuildPolyMesh(rcContext* ctx, rcContourSet& cset, const int nvp, rcPolyMesh& mesh)
bool rcBuildPolyMesh(rcContext* ctx, const rcContourSet& cset, const int nvp, rcPolyMesh& mesh)
{
rcAssert(ctx);