Adding double precision import support for formats that can be exported

This commit is contained in:
Chris Russ
2016-07-16 12:14:36 +10:00
parent fa1d6d8c55
commit 05a6ee6473
26 changed files with 204 additions and 233 deletions

View File

@@ -1326,7 +1326,7 @@ unsigned int XFileParser::ReadInt()
}
// ------------------------------------------------------------------------------------------------
float XFileParser::ReadFloat()
ai_real XFileParser::ReadFloat()
{
if( mIsBinaryFormat)
{
@@ -1343,7 +1343,7 @@ float XFileParser::ReadFloat()
if( mBinaryFloatSize == 8)
{
if( End - P >= 8) {
float result = (float) (*(double*) P);
ai_real result = (ai_real) (*(double*) P);
P += 8;
return result;
} else {
@@ -1353,7 +1353,7 @@ float XFileParser::ReadFloat()
} else
{
if( End - P >= 4) {
float result = *(float*) P;
ai_real result = *(ai_real*) P;
P += 4;
return result;
} else {
@@ -1372,17 +1372,17 @@ float XFileParser::ReadFloat()
{
P += 9;
CheckForSeparator();
return 0.0f;
return 0.0;
} else
if( strncmp( P, "1.#QNAN0", 8) == 0)
{
P += 8;
CheckForSeparator();
return 0.0f;
return 0.0;
}
float result = 0.0f;
P = fast_atoreal_move<float>( P, result);
ai_real result = 0.0;
P = fast_atoreal_move<ai_real>( P, result);
CheckForSeparator();