mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Recast: light variable name cleanup
Enforce consistency
This commit is contained in:
parent
602fa7d1ec
commit
d7235a799a
@ -242,32 +242,32 @@ int rcGetChunksOverlappingRect(const rcChunkyTriMesh* cm,
|
||||
return n;
|
||||
}
|
||||
|
||||
int rcGetChunksOverlappingRect(const rcChunkyTriMesh * cm, float bmin[2], float bmax[2], int * ids, const int maxIds, int& count_returned, int & current_idx)
|
||||
int rcGetChunksOverlappingRect(const rcChunkyTriMesh * cm, float bmin[2], float bmax[2], int * ids, const int maxIds, int& currentCount, int& currentNode)
|
||||
{
|
||||
// Traverse tree
|
||||
while (current_idx < cm->nnodes)
|
||||
while (currentNode < cm->nnodes)
|
||||
{
|
||||
const rcChunkyTriMeshNode* node = &cm->nodes[current_idx];
|
||||
const rcChunkyTriMeshNode* node = &cm->nodes[currentNode];
|
||||
const bool overlap = checkOverlapRect(bmin, bmax, node->bmin, node->bmax);
|
||||
const bool isLeafNode = node->i >= 0;
|
||||
|
||||
if (isLeafNode && overlap)
|
||||
{
|
||||
if (count_returned < maxIds)
|
||||
if (currentCount < maxIds)
|
||||
{
|
||||
ids[count_returned] = current_idx;
|
||||
count_returned++;
|
||||
ids[currentCount] = currentNode;
|
||||
currentCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (overlap || isLeafNode)
|
||||
current_idx++;
|
||||
currentNode++;
|
||||
else
|
||||
{
|
||||
const int escapeIndex = -node->i;
|
||||
current_idx += escapeIndex;
|
||||
currentNode += escapeIndex;
|
||||
}
|
||||
if (count_returned == maxIds)
|
||||
if (currentCount == maxIds)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -999,17 +999,17 @@ unsigned char* Editor_TileMesh::buildTileMesh(const int tx, const int ty, const
|
||||
}
|
||||
#else //NOTE(warmist): algo with limited return but can be reinvoked to continue the query
|
||||
int cid[1024];//NOTE: we don't grow it but we reuse it (e.g. like a yieldable function or iterator or sth)
|
||||
int current_node = 0;
|
||||
int currentNode = 0;
|
||||
|
||||
bool done = false;
|
||||
m_tileTriCount = 0;
|
||||
do{
|
||||
int current_count = 0;
|
||||
done=rcGetChunksOverlappingRect(chunkyMesh, tbmin, tbmax, cid, 1024,current_count,current_node);
|
||||
for (int i = 0; i < current_count; ++i)
|
||||
int currentCount = 0;
|
||||
done=rcGetChunksOverlappingRect(chunkyMesh, tbmin, tbmax, cid, 1024,currentCount,currentNode);
|
||||
for (int i = 0; i < currentCount; ++i)
|
||||
{
|
||||
const rcChunkyTriMeshNode& node = chunkyMesh->nodes[cid[i]];
|
||||
const int* ctris = &chunkyMesh->tris[node.i * 3];
|
||||
const int* ctris = &chunkyMesh->tris[node.i*3];
|
||||
const int nctris = node.n;
|
||||
|
||||
m_tileTriCount += nctris;
|
||||
|
@ -53,7 +53,7 @@ bool rcCreateChunkyTriMesh(const float* verts, const int* tris, int ntris,
|
||||
int rcGetChunksOverlappingRect(const rcChunkyTriMesh* cm, float bmin[2], float bmax[2], int* ids, const int maxIds);
|
||||
|
||||
/// Returns the chunk indices which overlap the input rectable. Return value is "we are done". Can be reinvoked to continue
|
||||
int rcGetChunksOverlappingRect(const rcChunkyTriMesh* cm, float bmin[2], float bmax[2], int* ids, const int maxIds,int& count_returned,int& current_idx);
|
||||
int rcGetChunksOverlappingRect(const rcChunkyTriMesh* cm, float bmin[2], float bmax[2], int* ids, const int maxIds,int& currentCount,int& currentNode);
|
||||
|
||||
/// Returns the chunk indices which overlap the input segment.
|
||||
int rcGetChunksOverlappingSegment(const rcChunkyTriMesh* cm, float p[2], float q[2], int* ids, const int maxIds);
|
||||
|
Loading…
x
Reference in New Issue
Block a user