Skip to content

Commit

Permalink
xrCDB: Fix conformance in For loop scope (#104).
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrocaster committed Jan 15, 2016
1 parent b1e139d commit 35bd837
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/xrCDB/Frustum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ void CFrustum::CreateOccluder(Fvector* p, int count, Fvector& vBase, CFrustum& c
for (int j=0; j<count; j++) cls[j]=_abs(P.classify(p[j]));

// test edges to see which lies directly on plane
for (j=0; j<count; j++) {
for (int j=0; j<count; j++) {
if (cls[j]<EPS_L)
{
int next = j+1; if (next>=count) next=0;
Expand All @@ -272,7 +272,7 @@ void CFrustum::CreateOccluder(Fvector* p, int count, Fvector& vBase, CFrustum& c
// here we have all edges marked accordenly to 'open' / 'closed' classification
_clear ();
_add (p[0],p[1],p[2]); // main plane
for (i=0; i<count; i++)
for (int i=0; i<count; i++)
{
if (!edge[i]) {
int next = i+1; if (next>=count) next=0;
Expand Down Expand Up @@ -300,7 +300,7 @@ sPoly* CFrustum::ClipPoly(sPoly& S, sPoly& D) const
cls[src->size()] = cls[0];
src->push_back((*src)[0]);
Fvector D; float denum,t;
for (j=0; j<src->size()-1; j++)
for (u32 j=0; j<src->size()-1; j++)
{
if ((*src)[j].similar((*src)[j+1],EPS_S)) continue;

Expand Down
2 changes: 1 addition & 1 deletion src/xrCDB/OPC_AABBTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ bool AABBTreeNode::Subdivide(AABBTreeBuilder* builder)

// Compute variances
Point Vars(0.0f, 0.0f, 0.0f);
for(i=0;i<mNbPrimitives;i++)
for(udword i=0;i<mNbPrimitives;i++)
{
udword Index = mNodePrimitives[i];
float Cx = builder->GetSplittingValue(Index, 0);
Expand Down
10 changes: 5 additions & 5 deletions src/xrCDB/OPC_OptimizedTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ bool AABBNoLeafTree::Build(AABBTree* tree)
mExtentsCoeff.y = 1.0f / EQuantCoeff.y; \
mExtentsCoeff.z = 1.0f / EQuantCoeff.z;

#define PERFORM_QUANTIZATION \
#define PERFORM_QUANTIZATION(i)\
/* Quantize */ \
((float*)mNodes[i].mAABB.mCenter)[0] = sword(Nodes[i].mAABB.mCenter.x * CQuantCoeff.x); \
((float*)mNodes[i].mAABB.mCenter)[1] = sword(Nodes[i].mAABB.mCenter.y * CQuantCoeff.y); \
Expand Down Expand Up @@ -460,9 +460,9 @@ bool AABBQuantizedTree::Build(AABBTree* tree)

// Quantize
uintptr_t Data;
for(i=0;i<mNbNodes;i++)
for (udword i = 0; i<mNbNodes; i++)
{
PERFORM_QUANTIZATION
PERFORM_QUANTIZATION(i)
REMAP_DATA(mData)
}

Expand Down Expand Up @@ -538,9 +538,9 @@ bool AABBQuantizedNoLeafTree::Build(AABBTree* tree)

// Quantize
uintptr_t Data;
for(i=0;i<mNbNodes;i++)
for(udword i = 0; i<mNbNodes; i++)
{
PERFORM_QUANTIZATION
PERFORM_QUANTIZATION(i)
REMAP_DATA(mData)
REMAP_DATA(mData2)
}
Expand Down

0 comments on commit 35bd837

Please sign in to comment.