mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +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);
|
QByteArray uncompressed = qUncompress(compressed);
|
||||||
QDataStream uncompressedIn(uncompressed);
|
QDataStream uncompressedIn(uncompressed);
|
||||||
uncompressedIn.setByteOrder(QDataStream::LittleEndian);
|
uncompressedIn.setByteOrder(QDataStream::LittleEndian);
|
||||||
|
uncompressedIn.setVersion(QDataStream::Qt_4_5); // for single/double precision switch
|
||||||
for (int i = 0; i < arrayLength; i++) {
|
for (int i = 0; i < arrayLength; i++) {
|
||||||
T value;
|
T value;
|
||||||
uncompressedIn >> value;
|
uncompressedIn >> value;
|
||||||
|
@ -132,7 +133,7 @@ FBXNode parseFBXNode(QDataStream& in) {
|
||||||
if (endOffset < MIN_VALID_OFFSET || nameLength == 0) {
|
if (endOffset < MIN_VALID_OFFSET || nameLength == 0) {
|
||||||
// use a null name to indicate a null node
|
// use a null name to indicate a null node
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
node.name = in.device()->read(nameLength);
|
node.name = in.device()->read(nameLength);
|
||||||
|
|
||||||
for (int i = 0; i < propertyCount; i++) {
|
for (int i = 0; i < propertyCount; i++) {
|
||||||
|
@ -155,6 +156,7 @@ FBXNode parseFBXNode(QDataStream& in) {
|
||||||
FBXNode parseFBX(QIODevice* device) {
|
FBXNode parseFBX(QIODevice* device) {
|
||||||
QDataStream in(device);
|
QDataStream in(device);
|
||||||
in.setByteOrder(QDataStream::LittleEndian);
|
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
|
// see http://code.blender.org/index.php/2013/08/fbx-binary-file-format-specification/ for an explanation
|
||||||
// of the FBX format
|
// of the FBX format
|
||||||
|
|
Loading…
Reference in a new issue