From 96033e9fc002e1b30bb9eec0da4cedffc0ce9558 Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Sat, 11 Aug 2012 04:39:47 +0200 Subject: [PATCH] - fbx: fix stupid typos killing the decompression logic. --- code/FBXParser.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/code/FBXParser.cpp b/code/FBXParser.cpp index be7292fd7..368ee7a23 100644 --- a/code/FBXParser.cpp +++ b/code/FBXParser.cpp @@ -618,7 +618,7 @@ void ParseVectorDataArray(std::vector& out, const Element& el) const uint32_t count3 = count / 3; out.reserve(count3); - if (type != 'd') { + if (type == 'd') { const double* d = reinterpret_cast(&buff[0]); for (unsigned int i = 0; i < count3; ++i, d += 3) { out.push_back(aiVector3D(static_cast(d[0]), @@ -626,7 +626,7 @@ void ParseVectorDataArray(std::vector& out, const Element& el) static_cast(d[2]))); } } - else if (type != 'f') { + else if (type == 'f') { const float* f = reinterpret_cast(&buff[0]); for (unsigned int i = 0; i < count3; ++i, f += 3) { out.push_back(aiVector3D(f[0],f[1],f[2])); @@ -698,7 +698,7 @@ void ParseVectorDataArray(std::vector& out, const Element& el) const uint32_t count4 = count / 4; out.reserve(count4); - if (type != 'd') { + if (type == 'd') { const double* d = reinterpret_cast(&buff[0]); for (unsigned int i = 0; i < count4; ++i, d += 4) { out.push_back(aiColor4D(static_cast(d[0]), @@ -707,7 +707,7 @@ void ParseVectorDataArray(std::vector& out, const Element& el) static_cast(d[3]))); } } - else if (type != 'f') { + else if (type == 'f') { const float* f = reinterpret_cast(&buff[0]); for (unsigned int i = 0; i < count4; ++i, f += 4) { out.push_back(aiColor4D(f[0],f[1],f[2],f[3])); @@ -777,14 +777,14 @@ void ParseVectorDataArray(std::vector& out, const Element& el) const uint32_t count2 = count / 2; out.reserve(count2); - if (type != 'd') { + if (type == 'd') { const double* d = reinterpret_cast(&buff[0]); for (unsigned int i = 0; i < count2; ++i, d += 2) { out.push_back(aiVector2D(static_cast(d[0]), static_cast(d[1]))); } } - else if (type != 'f') { + else if (type == 'f') { const float* f = reinterpret_cast(&buff[0]); for (unsigned int i = 0; i < count2; ++i, f += 2) { out.push_back(aiVector2D(f[0],f[1])); @@ -904,13 +904,13 @@ void ParseVectorDataArray(std::vector& out, const Element& el) ai_assert(data == end); ai_assert(buff.size() == count * (type == 'd' ? 8 : 4)); - if (type != 'd') { + if (type == 'd') { const double* d = reinterpret_cast(&buff[0]); for (unsigned int i = 0; i < count; ++i, ++d) { out.push_back(static_cast(*d)); } } - else if (type != 'f') { + else if (type == 'f') { const float* f = reinterpret_cast(&buff[0]); for (unsigned int i = 0; i < count; ++i, ++f) { out.push_back(*f);