- Workaround: ASCII XFiles aren't as strict on separator chars as before anymore. Should allow some more files to be parsed correctly.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@825 67173fc5-114c-0410-ac8e-9d2fd5bffc1fpull/1/head
parent
136ef7609d
commit
8aac702e1e
|
@ -1000,6 +1000,22 @@ void XFileParser::CheckForSeparator()
|
||||||
ThrowException( "Separator character (';' or ',') expected.");
|
ThrowException( "Separator character (';' or ',') expected.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
// tests and possibly consumes a separator char, but does nothing if there was no separator
|
||||||
|
void XFileParser::TestForSeparator()
|
||||||
|
{
|
||||||
|
if( mIsBinaryFormat)
|
||||||
|
return;
|
||||||
|
|
||||||
|
FindNextNoneWhiteSpace();
|
||||||
|
if( P >= End)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// test and skip
|
||||||
|
if( *P == ';' || *P == ',')
|
||||||
|
P++;
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void XFileParser::readHeadOfDataObject( std::string* poName)
|
void XFileParser::readHeadOfDataObject( std::string* poName)
|
||||||
{
|
{
|
||||||
|
@ -1332,7 +1348,7 @@ aiVector2D XFileParser::ReadVector2()
|
||||||
aiVector2D vector;
|
aiVector2D vector;
|
||||||
vector.x = ReadFloat();
|
vector.x = ReadFloat();
|
||||||
vector.y = ReadFloat();
|
vector.y = ReadFloat();
|
||||||
CheckForSeparator();
|
TestForSeparator();
|
||||||
|
|
||||||
return vector;
|
return vector;
|
||||||
}
|
}
|
||||||
|
@ -1344,7 +1360,7 @@ aiVector3D XFileParser::ReadVector3()
|
||||||
vector.x = ReadFloat();
|
vector.x = ReadFloat();
|
||||||
vector.y = ReadFloat();
|
vector.y = ReadFloat();
|
||||||
vector.z = ReadFloat();
|
vector.z = ReadFloat();
|
||||||
CheckForSeparator();
|
TestForSeparator();
|
||||||
|
|
||||||
return vector;
|
return vector;
|
||||||
}
|
}
|
||||||
|
@ -1357,7 +1373,7 @@ aiColor4D XFileParser::ReadRGBA()
|
||||||
color.g = ReadFloat();
|
color.g = ReadFloat();
|
||||||
color.b = ReadFloat();
|
color.b = ReadFloat();
|
||||||
color.a = ReadFloat();
|
color.a = ReadFloat();
|
||||||
CheckForSeparator();
|
TestForSeparator();
|
||||||
|
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
@ -1369,7 +1385,7 @@ aiColor3D XFileParser::ReadRGB()
|
||||||
color.r = ReadFloat();
|
color.r = ReadFloat();
|
||||||
color.g = ReadFloat();
|
color.g = ReadFloat();
|
||||||
color.b = ReadFloat();
|
color.b = ReadFloat();
|
||||||
CheckForSeparator();
|
TestForSeparator();
|
||||||
|
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,6 +116,9 @@ protected:
|
||||||
//! checks for a separator char, either a ',' or a ';'
|
//! checks for a separator char, either a ',' or a ';'
|
||||||
void CheckForSeparator();
|
void CheckForSeparator();
|
||||||
|
|
||||||
|
/// tests and possibly consumes a separator char, but does nothing if there was no separator
|
||||||
|
void TestForSeparator();
|
||||||
|
|
||||||
//! reads a x file style string
|
//! reads a x file style string
|
||||||
void GetNextTokenAsString( std::string& poString);
|
void GetNextTokenAsString( std::string& poString);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue