fixed some warnings

This commit is contained in:
Anakin 2017-01-26 19:44:12 +01:00
parent fe374cb8f6
commit 121f5c47f1
2 changed files with 7 additions and 7 deletions

View File

@ -104,7 +104,7 @@ void GeometryEngine::loadFile(QString filePath)
vertexData += segmentIterator->vertices; vertexData += segmentIterator->vertices;
indexData += segmentIterator->indices; indexData += segmentIterator->indices;
if (segmentIterator->textureIndex < m_materials->size() && m_materials->at(segmentIterator->textureIndex).transparent) if (segmentIterator->textureIndex < (unsigned) m_materials->size() && m_materials->at(segmentIterator->textureIndex).transparent)
m_drawList.push_back(new_info); m_drawList.push_back(new_info);
else else
m_drawList.push_front(new_info); m_drawList.push_front(new_info);
@ -184,11 +184,11 @@ void GeometryEngine::drawGeometry(QOpenGLShaderProgram *program, bool wireframe)
{ {
bool tmp_transparent(false); bool tmp_transparent(false);
bool tmp_specular(false); bool tmp_specular(false);
float shininess; float shininess(0.0);
QVector3D specularColor; QVector3D specularColor;
// bind the correct texture // bind the correct texture
if (it.textureIndex < m_materials->size() && m_materials->at(it.textureIndex).texture0 != Q_NULLPTR) if (it.textureIndex < (unsigned) m_materials->size() && m_materials->at(it.textureIndex).texture0 != Q_NULLPTR)
{ {
m_materials->at(it.textureIndex).texture0->bind(); m_materials->at(it.textureIndex).texture0->bind();
tmp_transparent = m_materials->at(it.textureIndex).transparent; tmp_transparent = m_materials->at(it.textureIndex).transparent;

View File

@ -504,7 +504,7 @@ void MshFile::analyseSegmChunks(Model * dataDestination, std::list<ChunkHeader*>
m_file.seekg(it->position); m_file.seekg(it->position);
m_file.read(F2V(tmp_size), sizeof(tmp_size)); m_file.read(F2V(tmp_size), sizeof(tmp_size));
if (tmp_size < new_segment->vertices.size()) if (tmp_size < (unsigned) new_segment->vertices.size())
{ {
emit sendMessage("WARNING: too less normals " + QString::number(tmp_size) + " < " + QString::number(new_segment->vertices.size()), 1); emit sendMessage("WARNING: too less normals " + QString::number(tmp_size) + " < " + QString::number(new_segment->vertices.size()), 1);
@ -512,7 +512,7 @@ void MshFile::analyseSegmChunks(Model * dataDestination, std::list<ChunkHeader*>
for (unsigned int j = 0; j < 3; j++) for (unsigned int j = 0; j < 3; j++)
new_segment->vertices[i - 1].vertexNormal[j] = 0; new_segment->vertices[i - 1].vertexNormal[j] = 0;
} }
else if (tmp_size > new_segment->vertices.size()) else if (tmp_size > (unsigned) new_segment->vertices.size())
{ {
emit sendMessage("WARNING: too many normals " + QString::number(tmp_size) + " > " + QString::number(new_segment->vertices.size()), 1); emit sendMessage("WARNING: too many normals " + QString::number(tmp_size) + " > " + QString::number(new_segment->vertices.size()), 1);
tmp_size = new_segment->vertices.size(); tmp_size = new_segment->vertices.size();
@ -696,7 +696,7 @@ void MshFile::readUV(Segment * dataDestination, std::streampos position)
m_file.seekg(position); m_file.seekg(position);
m_file.read(F2V(tmp_size), sizeof(tmp_size)); m_file.read(F2V(tmp_size), sizeof(tmp_size));
if (tmp_size < dataDestination->vertices.size()) if (tmp_size < (unsigned) dataDestination->vertices.size())
{ {
emit sendMessage("WARNING: too less UVs " + QString::number(tmp_size) + " < " + QString::number(dataDestination->vertices.size()),1); emit sendMessage("WARNING: too less UVs " + QString::number(tmp_size) + " < " + QString::number(dataDestination->vertices.size()),1);
@ -704,7 +704,7 @@ void MshFile::readUV(Segment * dataDestination, std::streampos position)
for (unsigned int j = 0; j < 2; j++) for (unsigned int j = 0; j < 2; j++)
dataDestination->vertices[i - 1].texCoord[j] = 0; dataDestination->vertices[i - 1].texCoord[j] = 0;
} }
else if (tmp_size > dataDestination->vertices.size()) else if (tmp_size > (unsigned) dataDestination->vertices.size())
{ {
emit sendMessage("WARNING: too many UVs " + QString::number(tmp_size) + " > " + QString::number(dataDestination->vertices.size()), 1); emit sendMessage("WARNING: too many UVs " + QString::number(tmp_size) + " > " + QString::number(dataDestination->vertices.size()), 1);
tmp_size = dataDestination->vertices.size(); tmp_size = dataDestination->vertices.size();