Unreal: Use C++11 range-based for loop
parent
d238597459
commit
896ab8eee2
|
@ -171,9 +171,7 @@ void UnrealImporter::InternReadFile( const std::string& pFile,
|
||||||
|
|
||||||
// collect triangles
|
// collect triangles
|
||||||
std::vector<Unreal::Triangle> triangles(numTris);
|
std::vector<Unreal::Triangle> triangles(numTris);
|
||||||
for (std::vector<Unreal::Triangle>::iterator it = triangles.begin(), end = triangles.end();it != end; ++it) {
|
for (auto & tri : triangles) {
|
||||||
Unreal::Triangle& tri = *it;
|
|
||||||
|
|
||||||
for (unsigned int i = 0; i < 3;++i) {
|
for (unsigned int i = 0; i < 3;++i) {
|
||||||
|
|
||||||
tri.mVertex[i] = d_reader.GetI2();
|
tri.mVertex[i] = d_reader.GetI2();
|
||||||
|
@ -222,9 +220,9 @@ void UnrealImporter::InternReadFile( const std::string& pFile,
|
||||||
|
|
||||||
// collect vertices
|
// collect vertices
|
||||||
std::vector<aiVector3D> vertices(numVert);
|
std::vector<aiVector3D> vertices(numVert);
|
||||||
for (std::vector<aiVector3D>::iterator it = vertices.begin(), end = vertices.end(); it != end; ++it) {
|
for (auto &vertex : vertices) {
|
||||||
int32_t val = a_reader.GetI4();
|
int32_t val = a_reader.GetI4();
|
||||||
Unreal::DecompressVertex(*it,val);
|
Unreal::DecompressVertex(vertex ,val);
|
||||||
}
|
}
|
||||||
|
|
||||||
// list of textures.
|
// list of textures.
|
||||||
|
@ -330,8 +328,7 @@ void UnrealImporter::InternReadFile( const std::string& pFile,
|
||||||
materials.reserve(textures.size()*2+5);
|
materials.reserve(textures.size()*2+5);
|
||||||
|
|
||||||
// find out how many output meshes and materials we'll have and build material indices
|
// find out how many output meshes and materials we'll have and build material indices
|
||||||
for (std::vector<Unreal::Triangle>::iterator it = triangles.begin(), end = triangles.end();it != end; ++it) {
|
for (Unreal::Triangle &tri : triangles) {
|
||||||
Unreal::Triangle& tri = *it;
|
|
||||||
Unreal::TempMat mat(tri);
|
Unreal::TempMat mat(tri);
|
||||||
std::vector<Unreal::TempMat>::iterator nt = std::find(materials.begin(),materials.end(),mat);
|
std::vector<Unreal::TempMat>::iterator nt = std::find(materials.begin(),materials.end(),mat);
|
||||||
if (nt == materials.end()) {
|
if (nt == materials.end()) {
|
||||||
|
@ -418,8 +415,7 @@ void UnrealImporter::InternReadFile( const std::string& pFile,
|
||||||
}
|
}
|
||||||
|
|
||||||
// fill them.
|
// fill them.
|
||||||
for (std::vector<Unreal::Triangle>::iterator it = triangles.begin(), end = triangles.end();it != end; ++it) {
|
for (const Unreal::Triangle &tri : triangles) {
|
||||||
Unreal::Triangle& tri = *it;
|
|
||||||
Unreal::TempMat mat(tri);
|
Unreal::TempMat mat(tri);
|
||||||
std::vector<Unreal::TempMat>::iterator nt = std::find(materials.begin(),materials.end(),mat);
|
std::vector<Unreal::TempMat>::iterator nt = std::find(materials.begin(),materials.end(),mat);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue