From 427eaad642c9132af393dd43c5e5b406c064a772 Mon Sep 17 00:00:00 2001 From: James Lupiani Date: Mon, 12 May 2014 12:02:31 -0500 Subject: [PATCH] Fixes #158 via anonymous user --- code/XFileParser.cpp | 3 +++ code/XFileParser.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/code/XFileParser.cpp b/code/XFileParser.cpp index 018be3102..36e70bc1c 100644 --- a/code/XFileParser.cpp +++ b/code/XFileParser.cpp @@ -136,6 +136,9 @@ XFileParser::XFileParser( const std::vector& pBuffer) ThrowException( boost::str( boost::format( "Unknown float size %1% specified in xfile header.") % mBinaryFloatSize)); + // The x format specifies size in bits, but we work in bytes + mBinaryFloatSize /= 8; + P += 16; // If this is a compressed X file, apply the inflate algorithm to it diff --git a/code/XFileParser.h b/code/XFileParser.h index 784dd0479..900555f32 100644 --- a/code/XFileParser.h +++ b/code/XFileParser.h @@ -144,7 +144,7 @@ protected: protected: unsigned int mMajorVersion, mMinorVersion; ///< version numbers bool mIsBinaryFormat; ///< true if the file is in binary, false if it's in text form - unsigned int mBinaryFloatSize; ///< float size, either 32 or 64 bits + unsigned int mBinaryFloatSize; ///< float size in bytes, either 4 or 8 // counter for number arrays in binary format unsigned int mBinaryNumCount;