mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
quiet warnings
This commit is contained in:
parent
3f142b7290
commit
40b87171a9
4 changed files with 9 additions and 8 deletions
|
@ -1272,9 +1272,9 @@ void RenderablePolyVoxEntityItem::recomputeMesh() {
|
|||
gpu::Element(gpu::VEC3, gpu::FLOAT, gpu::RAW)));
|
||||
|
||||
std::vector<model::Mesh::Part> parts;
|
||||
parts.emplace_back(model::Mesh::Part(0, // startIndex
|
||||
vecIndices.size(), // numIndices
|
||||
0, // baseVertex
|
||||
parts.emplace_back(model::Mesh::Part((model::Index)0, // startIndex
|
||||
(model::Index)vecIndices.size(), // numIndices
|
||||
(model::Index)0, // baseVertex
|
||||
model::Mesh::TRIANGLES)); // topology
|
||||
mesh->setPartBuffer(gpu::BufferView(new gpu::Buffer(parts.size() * sizeof(model::Mesh::Part),
|
||||
(gpu::Byte*) parts.data()), gpu::Element::PART_DRAWCALL));
|
||||
|
|
|
@ -54,7 +54,8 @@ template<class T> QVariant readBinaryArray(QDataStream& in, int& position) {
|
|||
in.readRawData(compressed.data() + sizeof(quint32), compressedLength);
|
||||
position += compressedLength;
|
||||
arrayData = qUncompress(compressed);
|
||||
if (arrayData.isEmpty() || arrayData.size() != (sizeof(T) * arrayLength)) { // answers empty byte array if corrupt
|
||||
if (arrayData.isEmpty() ||
|
||||
(unsigned int)arrayData.size() != (sizeof(T) * arrayLength)) { // answers empty byte array if corrupt
|
||||
throw QString("corrupt fbx file");
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -75,7 +75,7 @@ bool writeOBJToTextStream(QTextStream& out, QList<MeshPointer> meshes) {
|
|||
const gpu::BufferView& indexBuffer = mesh->getIndexBuffer();
|
||||
// const gpu::BufferView& vertexBuffer = mesh->getVertexBuffer();
|
||||
|
||||
int partCount = mesh->getNumParts();
|
||||
size_t partCount = mesh->getNumParts();
|
||||
qDebug() << "writeOBJToTextStream part count is" << partCount;
|
||||
for (int partIndex = 0; partIndex < partCount; partIndex++) {
|
||||
const model::Mesh::Part& part = partBuffer.get<model::Mesh::Part>(partIndex);
|
||||
|
@ -88,11 +88,11 @@ bool writeOBJToTextStream(QTextStream& out, QList<MeshPointer> meshes) {
|
|||
indexItr += part._startIndex;
|
||||
|
||||
int indexCount = 0;
|
||||
while (indexItr != indexBuffer.cend<uint32_t>() && indexItr != part._numIndices) {
|
||||
while (indexItr != indexBuffer.cend<uint32_t>() && (indexItr != part._numIndices)) {
|
||||
uint32_t index0 = *indexItr;
|
||||
indexItr++;
|
||||
indexCount++;
|
||||
if (indexItr == indexBuffer.cend<uint32_t>() || indexItr == part._numIndices) {
|
||||
if (indexItr == indexBuffer.cend<uint32_t>() || (indexItr == part._numIndices)) {
|
||||
qDebug() << "OBJWriter -- index buffer length isn't multiple of 3";
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ public:
|
|||
|
||||
MeshPointer getMeshPointer() const { return _mesh; }
|
||||
|
||||
Q_INVOKABLE int getNumVertices() const { return _mesh->getNumVertices(); }
|
||||
Q_INVOKABLE int getNumVertices() const { (int)return _mesh->getNumVertices(); }
|
||||
Q_INVOKABLE glm::vec3 getPos3(int index) const { return _mesh->getPos3(index); }
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue