mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 12:04:18 +02:00
Fixed bug in decoding: newer versions of Qt streaming use whatever precision
the stream is set at for both floats and doubles.
This commit is contained in:
parent
e54a828b17
commit
9c2d851650
1 changed files with 3 additions and 1 deletions
|
@ -41,6 +41,7 @@ template<class T> QVariant readArray(QDataStream& in) {
|
|||
QByteArray uncompressed = qUncompress(compressed);
|
||||
QDataStream uncompressedIn(uncompressed);
|
||||
uncompressedIn.setByteOrder(QDataStream::LittleEndian);
|
||||
uncompressedIn.setVersion(QDataStream::Qt_4_5); // for single/double precision switch
|
||||
for (int i = 0; i < arrayLength; i++) {
|
||||
T value;
|
||||
uncompressedIn >> value;
|
||||
|
@ -132,7 +133,7 @@ FBXNode parseFBXNode(QDataStream& in) {
|
|||
if (endOffset < MIN_VALID_OFFSET || nameLength == 0) {
|
||||
// use a null name to indicate a null node
|
||||
return node;
|
||||
}
|
||||
}
|
||||
node.name = in.device()->read(nameLength);
|
||||
|
||||
for (int i = 0; i < propertyCount; i++) {
|
||||
|
@ -155,6 +156,7 @@ FBXNode parseFBXNode(QDataStream& in) {
|
|||
FBXNode parseFBX(QIODevice* device) {
|
||||
QDataStream in(device);
|
||||
in.setByteOrder(QDataStream::LittleEndian);
|
||||
in.setVersion(QDataStream::Qt_4_5); // for single/double precision switch
|
||||
|
||||
// see http://code.blender.org/index.php/2013/08/fbx-binary-file-format-specification/ for an explanation
|
||||
// of the FBX format
|
||||
|
|
Loading…
Reference in a new issue