Skip to content

Commit

Permalink
xrLC: 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 83440c9 commit ad729c8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions src/Common/NvMender2003/NVMeshMender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,14 @@ void MeshMender::ProcessNormals(TriangleList& possibleNeighbors,


//reset each triangle to prepare for smoothing group building
for( unsigned int i = 0; i < possibleNeighbors.size(); ++i )
for(u32 i = 0; i < possibleNeighbors.size(); ++i )
{
m_Triangles[ possibleNeighbors[i] ].Reset();
}

//now start building groups
CanSmoothNormalsChecker canSmoothNormalsChecker;
for( i = 0; i < possibleNeighbors.size(); ++i )
for(u32 i = 0; i < possibleNeighbors.size(); ++i )
{
Triangle* currTri = &(m_Triangles[ possibleNeighbors[i] ]);
assert(currTri);
Expand All @@ -236,7 +236,7 @@ void MeshMender::ProcessNormals(TriangleList& possibleNeighbors,

xr_vector<D3DXVECTOR3> groupNormalVectors;

for( i = 0; i < neighborGroups.size(); ++i )
for(u32 i = 0; i < neighborGroups.size(); ++i )
{
//for each group, calculate the group normal
TriangleList& curGroup = neighborGroups[ i ];
Expand All @@ -256,7 +256,7 @@ void MeshMender::ProcessNormals(TriangleList& possibleNeighbors,
//next step, ensure that triangles in different groups are not
//sharing vertices. and give the shared vertex their new group vector
xr_set<size_t> otherGroupsIndices;
for( i = 0; i < neighborGroups.size(); ++i )
for(u32 i = 0; i < neighborGroups.size(); ++i )
{
TriangleList& curGroup = neighborGroups[ i ];
xr_set<size_t> thisGroupIndices;
Expand Down Expand Up @@ -313,14 +313,14 @@ void MeshMender::ProcessTangents(TriangleList& possibleNeighbors,


//reset each triangle to prepare for smoothing group building
for(unsigned int i =0; i < possibleNeighbors.size(); ++i)
for(u32 i =0; i < possibleNeighbors.size(); ++i)
{
m_Triangles[ possibleNeighbors[i] ].Reset();
}

//now start building groups
CanSmoothTangentsChecker canSmoothTangentsChecker;
for(i =0; i < possibleNeighbors.size(); ++i)
for(u32 i =0; i < possibleNeighbors.size(); ++i)
{
Triangle* currTri = &(m_Triangles[ possibleNeighbors[i] ]);
assert(currTri);
Expand All @@ -336,7 +336,7 @@ void MeshMender::ProcessTangents(TriangleList& possibleNeighbors,
xr_vector<D3DXVECTOR3> groupTangentVectors;


for(i=0; i<neighborGroups.size(); ++i)
for(u32 i=0; i<neighborGroups.size(); ++i)
{
D3DXVECTOR3 gtang(0,0,0);
for(unsigned int t = 0; t < neighborGroups[i].size(); ++t)//for each triangle in the group,
Expand All @@ -351,7 +351,7 @@ void MeshMender::ProcessTangents(TriangleList& possibleNeighbors,
//next step, ensure that triangles in different groups are not
//sharing vertices. and give the shared vertex their new group vector
xr_set<size_t> otherGroupsIndices;
for( i = 0; i < neighborGroups.size(); ++i )
for(u32 i = 0; i < neighborGroups.size(); ++i )
{
TriangleList& curGroup = neighborGroups[ i ];
xr_set<size_t> thisGroupIndices;
Expand Down Expand Up @@ -410,14 +410,14 @@ void MeshMender::ProcessBinormals(TriangleList& possibleNeighbors,


//reset each triangle to prepare for smoothing group building
for(unsigned int i =0; i < possibleNeighbors.size(); ++i )
for(u32 i =0; i < possibleNeighbors.size(); ++i )
{
m_Triangles[ possibleNeighbors[i] ].Reset();
}

//now start building groups
CanSmoothBinormalsChecker canSmoothBinormalsChecker;
for(i =0; i < possibleNeighbors.size(); ++i )
for(u32 i =0; i < possibleNeighbors.size(); ++i )
{
Triangle* currTri = &(m_Triangles[ possibleNeighbors[i] ]);
assert(currTri);
Expand All @@ -433,7 +433,7 @@ void MeshMender::ProcessBinormals(TriangleList& possibleNeighbors,
xr_vector<D3DXVECTOR3> groupBinormalVectors;


for(i=0; i<neighborGroups.size(); ++i)
for(u32 i=0; i<neighborGroups.size(); ++i)
{
D3DXVECTOR3 gbinormal(0,0,0);
for(unsigned int t = 0; t < neighborGroups[i].size(); ++t)//for each triangle in the group,
Expand All @@ -448,7 +448,7 @@ void MeshMender::ProcessBinormals(TriangleList& possibleNeighbors,
//next step, ensure that triangles in different groups are not
//sharing vertices. and give the shared vertex their new group vector
xr_set<size_t> otherGroupsIndices;
for( i = 0; i < neighborGroups.size(); ++i )
for(u32 i = 0; i < neighborGroups.size(); ++i )
{
TriangleList& curGroup = neighborGroups[ i ];
xr_set<size_t> thisGroupIndices;
Expand Down
4 changes: 2 additions & 2 deletions src/utils/xrLC/xrOptimizeCFORM_qslim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void SimplifyCFORM (CDB::CollectorPacked& CL)

// constraint material&sector vertex
Ivector2 f_rm[3]={{0,1}, {1,2}, {2,0}};
for (f_idx=0; f_idx<slim->valid_faces; f_idx++){
for (u32 f_idx=0; f_idx<slim->valid_faces; f_idx++){
if (mdl->face_is_valid(f_idx)){
MxFace& base_f = mdl->face(f_idx);
for (u32 edge_idx=0; edge_idx<3; edge_idx++){
Expand Down Expand Up @@ -154,7 +154,7 @@ void SimplifyCFORM (CDB::CollectorPacked& CL)
mdl->compact_vertices ();

// rebuild CDB
for (f_idx=0; f_idx<mdl->face_count(); f_idx++){
for (u32 f_idx=0; f_idx<mdl->face_count(); f_idx++){
if (mdl->face_is_valid(f_idx)){
MxFace& F = mdl->face(f_idx);
face_props& FP = FPs[f_idx];
Expand Down

0 comments on commit ad729c8

Please sign in to comment.