Fix warnings about implicit conversion loses integer precision (#17220)

This commit is contained in:
mogemimi 2017-01-19 10:41:57 +09:00 committed by minggo
parent 86ef735e60
commit dad9929aad
1 changed files with 3 additions and 3 deletions

View File

@ -436,7 +436,7 @@ void Terrain::calculateNormal()
_indices.push_back (nLocIndex + _imageWidth+1); _indices.push_back (nLocIndex + _imageWidth+1);
} }
} }
for (unsigned int i = 0, size = _indices.size(); i < size; i += 3) { for (size_t i = 0, size = _indices.size(); i < size; i += 3) {
unsigned int Index0 = _indices[i]; unsigned int Index0 = _indices[i];
unsigned int Index1 = _indices[i + 1]; unsigned int Index1 = _indices[i + 1];
unsigned int Index2 = _indices[i + 2]; unsigned int Index2 = _indices[i + 2];
@ -450,8 +450,8 @@ void Terrain::calculateNormal()
_vertices[Index2]._normal += Normal; _vertices[Index2]._normal += Normal;
} }
for (unsigned int i = 0, size = _vertices.size(); i < size; ++i) { for (auto &vertex : _vertices) {
_vertices[i]._normal.normalize(); vertex._normal.normalize();
} }
//global indices no need at all //global indices no need at all
_indices.clear(); _indices.clear();