Skip to content
Snippets Groups Projects
Commit 0215859a authored by Jonas Karlsson's avatar Jonas Karlsson
Browse files

readMeshData: print exact header error


It can be helpful to know that the issue is that the mesh is created
using a too old or new version.

Change-Id: I246a9136ad503b9879ab4e1bbac0d60989f797ba
Reviewed-by: default avatarAndy Nichols <andy.nichols@qt.io>
parent 9d0982ad
No related branches found
No related tags found
No related merge requests found
......@@ -104,6 +104,14 @@ quint64 MeshInternal::readMeshData(QIODevice *device, quint64 offset, Mesh *mesh
inputStream >> header->fileId >> header->fileVersion >> header->flags >> header->sizeInBytes;
if (!header->isValid()) {
qWarning() << "Mesh data invalid";
if (header->fileId == MeshDataHeader::FILE_ID) {
if (header->fileVersion > MeshDataHeader::FILE_VERSION)
qWarning() << "File version " << header->fileVersion << " newer than " << MeshDataHeader::FILE_VERSION;
if (header->fileVersion < MeshDataHeader::LEGACY_MESH_FILE_VERSION)
qWarning() << "File version " << header->fileVersion << " older than " << MeshDataHeader::LEGACY_MESH_FILE_VERSION;
} else {
qWarning() << "Invalid file ID" << header->fileId;
}
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment