Commit d27e4a28 authored by hybrid's avatar hybrid

Make semicolon checks less strict, fixing some issues with not absolutely...

Make semicolon checks less strict, fixing some issues with not absolutely correct .x files (which are loaded by MView, though).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2224 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 32009322
...@@ -538,8 +538,8 @@ bool CXMeshFileLoader::parseDataObjectTemplate() ...@@ -538,8 +538,8 @@ bool CXMeshFileLoader::parseDataObjectTemplate()
if (!readHeadOfDataObject(&name)) if (!readHeadOfDataObject(&name))
{ {
os::Printer::log("Left delimiter in template data object missing.", os::Printer::log("Left delimiter in template data object missing.",
name.c_str(), ELL_ERROR); name.c_str(), ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -581,7 +581,7 @@ bool CXMeshFileLoader::parseDataObjectFrame(CSkinnedMesh::SJoint *Parent) ...@@ -581,7 +581,7 @@ bool CXMeshFileLoader::parseDataObjectFrame(CSkinnedMesh::SJoint *Parent)
if (!readHeadOfDataObject(&name)) if (!readHeadOfDataObject(&name))
{ {
os::Printer::log("No opening brace in Frame found in x file", ELL_WARNING); os::Printer::log("No opening brace in Frame found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -632,7 +632,7 @@ bool CXMeshFileLoader::parseDataObjectFrame(CSkinnedMesh::SJoint *Parent) ...@@ -632,7 +632,7 @@ bool CXMeshFileLoader::parseDataObjectFrame(CSkinnedMesh::SJoint *Parent)
if (objectName.size() == 0) if (objectName.size() == 0)
{ {
os::Printer::log("Unexpected ending found in Frame in x file.", ELL_WARNING); os::Printer::log("Unexpected ending found in Frame in x file.", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
else else
...@@ -695,7 +695,7 @@ bool CXMeshFileLoader::parseDataObjectTransformationMatrix(core::matrix4 &mat) ...@@ -695,7 +695,7 @@ bool CXMeshFileLoader::parseDataObjectTransformationMatrix(core::matrix4 &mat)
if (!readHeadOfDataObject()) if (!readHeadOfDataObject())
{ {
os::Printer::log("No opening brace in Transformation Matrix found in x file", ELL_WARNING); os::Printer::log("No opening brace in Transformation Matrix found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -704,14 +704,13 @@ bool CXMeshFileLoader::parseDataObjectTransformationMatrix(core::matrix4 &mat) ...@@ -704,14 +704,13 @@ bool CXMeshFileLoader::parseDataObjectTransformationMatrix(core::matrix4 &mat)
if (!checkForOneFollowingSemicolons()) if (!checkForOneFollowingSemicolons())
{ {
os::Printer::log("No finishing semicolon in Transformation Matrix found in x file", ELL_WARNING); os::Printer::log("No finishing semicolon in Transformation Matrix found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false;
} }
if (!checkForClosingBrace()) if (!checkForClosingBrace())
{ {
os::Printer::log("No closing brace in Transformation Matrix found in x file", ELL_WARNING); os::Printer::log("No closing brace in Transformation Matrix found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -729,7 +728,7 @@ bool CXMeshFileLoader::parseDataObjectMesh(SXMesh &mesh) ...@@ -729,7 +728,7 @@ bool CXMeshFileLoader::parseDataObjectMesh(SXMesh &mesh)
os::Printer::log("CXFileReader: Reading mesh"); os::Printer::log("CXFileReader: Reading mesh");
#endif #endif
os::Printer::log("No opening brace in Mesh found in x file", ELL_WARNING); os::Printer::log("No opening brace in Mesh found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -751,8 +750,7 @@ bool CXMeshFileLoader::parseDataObjectMesh(SXMesh &mesh) ...@@ -751,8 +750,7 @@ bool CXMeshFileLoader::parseDataObjectMesh(SXMesh &mesh)
if (!checkForTwoFollowingSemicolons()) if (!checkForTwoFollowingSemicolons())
{ {
os::Printer::log("No finishing semicolon in Mesh Vertex Array found in x file", ELL_WARNING); os::Printer::log("No finishing semicolon in Mesh Vertex Array found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false;
} }
// read faces // read faces
...@@ -773,7 +771,7 @@ bool CXMeshFileLoader::parseDataObjectMesh(SXMesh &mesh) ...@@ -773,7 +771,7 @@ bool CXMeshFileLoader::parseDataObjectMesh(SXMesh &mesh)
if (fcnt < 3) if (fcnt < 3)
{ {
os::Printer::log("Invalid face count (<3) found in Mesh x file reader.", ELL_WARNING); os::Printer::log("Invalid face count (<3) found in Mesh x file reader.", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -807,8 +805,7 @@ bool CXMeshFileLoader::parseDataObjectMesh(SXMesh &mesh) ...@@ -807,8 +805,7 @@ bool CXMeshFileLoader::parseDataObjectMesh(SXMesh &mesh)
if (!checkForTwoFollowingSemicolons()) if (!checkForTwoFollowingSemicolons())
{ {
os::Printer::log("No finishing semicolon in Mesh Face Array found in x file", ELL_WARNING); os::Printer::log("No finishing semicolon in Mesh Face Array found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false;
} }
// here, other data objects may follow // here, other data objects may follow
...@@ -820,7 +817,7 @@ bool CXMeshFileLoader::parseDataObjectMesh(SXMesh &mesh) ...@@ -820,7 +817,7 @@ bool CXMeshFileLoader::parseDataObjectMesh(SXMesh &mesh)
if (objectName.size() == 0) if (objectName.size() == 0)
{ {
os::Printer::log("Unexpected ending found in Mesh in x file.", ELL_WARNING); os::Printer::log("Unexpected ending found in Mesh in x file.", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
else else
...@@ -983,14 +980,12 @@ bool CXMeshFileLoader::parseDataObjectMesh(SXMesh &mesh) ...@@ -983,14 +980,12 @@ bool CXMeshFileLoader::parseDataObjectMesh(SXMesh &mesh)
if (!checkForOneFollowingSemicolons()) if (!checkForOneFollowingSemicolons())
{ {
os::Printer::log("No finishing semicolon in DeclData found.", ELL_WARNING); os::Printer::log("No finishing semicolon in DeclData found.", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
delete [] data;
return false;
} }
if (!checkForClosingBrace()) if (!checkForClosingBrace())
{ {
os::Printer::log("No closing brace in DeclData.", ELL_WARNING); os::Printer::log("No closing brace in DeclData.", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
delete [] data; delete [] data;
return false; return false;
} }
...@@ -1015,7 +1010,7 @@ bool CXMeshFileLoader::parseDataObjectMesh(SXMesh &mesh) ...@@ -1015,7 +1010,7 @@ bool CXMeshFileLoader::parseDataObjectMesh(SXMesh &mesh)
if (!readHeadOfDataObject()) if (!readHeadOfDataObject())
{ {
os::Printer::log("No starting brace in FVFData found.", ELL_WARNING); os::Printer::log("No starting brace in FVFData found.", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
const u32 dataformat = readInt(); const u32 dataformat = readInt();
...@@ -1038,13 +1033,12 @@ bool CXMeshFileLoader::parseDataObjectMesh(SXMesh &mesh) ...@@ -1038,13 +1033,12 @@ bool CXMeshFileLoader::parseDataObjectMesh(SXMesh &mesh)
if (!checkForOneFollowingSemicolons()) if (!checkForOneFollowingSemicolons())
{ {
os::Printer::log("No finishing semicolon in FVFData found.", ELL_WARNING); os::Printer::log("No finishing semicolon in FVFData found.", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false;
} }
if (!checkForClosingBrace()) if (!checkForClosingBrace())
{ {
os::Printer::log("No closing brace in FVFData found in x file", ELL_WARNING); os::Printer::log("No closing brace in FVFData found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
} }
...@@ -1083,7 +1077,7 @@ bool CXMeshFileLoader::parseDataObjectSkinWeights(SXMesh &mesh) ...@@ -1083,7 +1077,7 @@ bool CXMeshFileLoader::parseDataObjectSkinWeights(SXMesh &mesh)
if (!readHeadOfDataObject()) if (!readHeadOfDataObject())
{ {
os::Printer::log("No opening brace in Skin Weights found in .x file", ELL_WARNING); os::Printer::log("No opening brace in Skin Weights found in .x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -1092,7 +1086,7 @@ bool CXMeshFileLoader::parseDataObjectSkinWeights(SXMesh &mesh) ...@@ -1092,7 +1086,7 @@ bool CXMeshFileLoader::parseDataObjectSkinWeights(SXMesh &mesh)
if (!getNextTokenAsString(TransformNodeName)) if (!getNextTokenAsString(TransformNodeName))
{ {
os::Printer::log("Unknown syntax while reading transfrom node name string in .x file", ELL_WARNING); os::Printer::log("Unknown syntax while reading transfrom node name string in .x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -1160,14 +1154,13 @@ bool CXMeshFileLoader::parseDataObjectSkinWeights(SXMesh &mesh) ...@@ -1160,14 +1154,13 @@ bool CXMeshFileLoader::parseDataObjectSkinWeights(SXMesh &mesh)
if (!checkForOneFollowingSemicolons()) if (!checkForOneFollowingSemicolons())
{ {
os::Printer::log("No finishing semicolon in Skin Weights found in x file", ELL_WARNING); os::Printer::log("No finishing semicolon in Skin Weights found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false;
} }
if (!checkForClosingBrace()) if (!checkForClosingBrace())
{ {
os::Printer::log("No closing brace in Skin Weights found in x file", ELL_WARNING); os::Printer::log("No closing brace in Skin Weights found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -1184,7 +1177,7 @@ bool CXMeshFileLoader::parseDataObjectSkinMeshHeader(SXMesh& mesh) ...@@ -1184,7 +1177,7 @@ bool CXMeshFileLoader::parseDataObjectSkinMeshHeader(SXMesh& mesh)
if (!readHeadOfDataObject()) if (!readHeadOfDataObject())
{ {
os::Printer::log("No opening brace in Skin Mesh header found in .x file", ELL_WARNING); os::Printer::log("No opening brace in Skin Mesh header found in .x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -1198,7 +1191,7 @@ bool CXMeshFileLoader::parseDataObjectSkinMeshHeader(SXMesh& mesh) ...@@ -1198,7 +1191,7 @@ bool CXMeshFileLoader::parseDataObjectSkinMeshHeader(SXMesh& mesh)
if (!checkForClosingBrace()) if (!checkForClosingBrace())
{ {
os::Printer::log("No closing brace in skin mesh header in x file", ELL_WARNING); os::Printer::log("No closing brace in skin mesh header in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -1215,7 +1208,7 @@ bool CXMeshFileLoader::parseDataObjectMeshNormals(SXMesh &mesh) ...@@ -1215,7 +1208,7 @@ bool CXMeshFileLoader::parseDataObjectMeshNormals(SXMesh &mesh)
if (!readHeadOfDataObject()) if (!readHeadOfDataObject())
{ {
os::Printer::log("No opening brace in Mesh Normals found in x file", ELL_WARNING); os::Printer::log("No opening brace in Mesh Normals found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -1231,8 +1224,7 @@ bool CXMeshFileLoader::parseDataObjectMeshNormals(SXMesh &mesh) ...@@ -1231,8 +1224,7 @@ bool CXMeshFileLoader::parseDataObjectMeshNormals(SXMesh &mesh)
if (!checkForTwoFollowingSemicolons()) if (!checkForTwoFollowingSemicolons())
{ {
os::Printer::log("No finishing semicolon in Mesh Normals Array found in x file", ELL_WARNING); os::Printer::log("No finishing semicolon in Mesh Normals Array found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false;
} }
core::array<u32> normalIndices; core::array<u32> normalIndices;
...@@ -1252,7 +1244,7 @@ bool CXMeshFileLoader::parseDataObjectMeshNormals(SXMesh &mesh) ...@@ -1252,7 +1244,7 @@ bool CXMeshFileLoader::parseDataObjectMeshNormals(SXMesh &mesh)
if (indexcount != mesh.IndexCountPerFace[k]) if (indexcount != mesh.IndexCountPerFace[k])
{ {
os::Printer::log("Not matching normal and face index count found in x file", ELL_WARNING); os::Printer::log("Not matching normal and face index count found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -1284,14 +1276,13 @@ bool CXMeshFileLoader::parseDataObjectMeshNormals(SXMesh &mesh) ...@@ -1284,14 +1276,13 @@ bool CXMeshFileLoader::parseDataObjectMeshNormals(SXMesh &mesh)
if (!checkForTwoFollowingSemicolons()) if (!checkForTwoFollowingSemicolons())
{ {
os::Printer::log("No finishing semicolon in Mesh Face Normals Array found in x file", ELL_WARNING); os::Printer::log("No finishing semicolon in Mesh Face Normals Array found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false;
} }
if (!checkForClosingBrace()) if (!checkForClosingBrace())
{ {
os::Printer::log("No closing brace in Mesh Normals found in x file", ELL_WARNING); os::Printer::log("No closing brace in Mesh Normals found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -1308,7 +1299,7 @@ bool CXMeshFileLoader::parseDataObjectMeshTextureCoords(SXMesh &mesh) ...@@ -1308,7 +1299,7 @@ bool CXMeshFileLoader::parseDataObjectMeshTextureCoords(SXMesh &mesh)
if (!readHeadOfDataObject()) if (!readHeadOfDataObject())
{ {
os::Printer::log("No opening brace in Mesh Texture Coordinates found in x file", ELL_WARNING); os::Printer::log("No opening brace in Mesh Texture Coordinates found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -1319,14 +1310,13 @@ bool CXMeshFileLoader::parseDataObjectMeshTextureCoords(SXMesh &mesh) ...@@ -1319,14 +1310,13 @@ bool CXMeshFileLoader::parseDataObjectMeshTextureCoords(SXMesh &mesh)
if (!checkForTwoFollowingSemicolons()) if (!checkForTwoFollowingSemicolons())
{ {
os::Printer::log("No finishing semicolon in Mesh Texture Coordinates Array found in x file", ELL_WARNING); os::Printer::log("No finishing semicolon in Mesh Texture Coordinates Array found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false;
} }
if (!checkForClosingBrace()) if (!checkForClosingBrace())
{ {
os::Printer::log("No closing brace in Mesh Texture Coordinates Array found in x file", ELL_WARNING); os::Printer::log("No closing brace in Mesh Texture Coordinates Array found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -1343,7 +1333,7 @@ bool CXMeshFileLoader::parseDataObjectMeshVertexColors(SXMesh &mesh) ...@@ -1343,7 +1333,7 @@ bool CXMeshFileLoader::parseDataObjectMeshVertexColors(SXMesh &mesh)
if (!readHeadOfDataObject()) if (!readHeadOfDataObject())
{ {
os::Printer::log("No opening brace for Mesh Vertex Colors found in x file", ELL_WARNING); os::Printer::log("No opening brace for Mesh Vertex Colors found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -1355,7 +1345,7 @@ bool CXMeshFileLoader::parseDataObjectMeshVertexColors(SXMesh &mesh) ...@@ -1355,7 +1345,7 @@ bool CXMeshFileLoader::parseDataObjectMeshVertexColors(SXMesh &mesh)
if (Index>=mesh.Vertices.size()) if (Index>=mesh.Vertices.size())
{ {
os::Printer::log("index value in parseDataObjectMeshVertexColors out of bounds", ELL_WARNING); os::Printer::log("index value in parseDataObjectMeshVertexColors out of bounds", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
readRGBA(mesh.Vertices[Index].Color); readRGBA(mesh.Vertices[Index].Color);
...@@ -1365,14 +1355,13 @@ bool CXMeshFileLoader::parseDataObjectMeshVertexColors(SXMesh &mesh) ...@@ -1365,14 +1355,13 @@ bool CXMeshFileLoader::parseDataObjectMeshVertexColors(SXMesh &mesh)
if (!checkForOneFollowingSemicolons()) if (!checkForOneFollowingSemicolons())
{ {
os::Printer::log("No finishing semicolon in Mesh Vertex Colors Array found in x file", ELL_WARNING); os::Printer::log("No finishing semicolon in Mesh Vertex Colors Array found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false;
} }
if (!checkForClosingBrace()) if (!checkForClosingBrace())
{ {
os::Printer::log("No closing brace in Mesh Texture Coordinates Array found in x file", ELL_WARNING); os::Printer::log("No closing brace in Mesh Texture Coordinates Array found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -1389,7 +1378,7 @@ bool CXMeshFileLoader::parseDataObjectMeshMaterialList(SXMesh &mesh) ...@@ -1389,7 +1378,7 @@ bool CXMeshFileLoader::parseDataObjectMeshMaterialList(SXMesh &mesh)
if (!readHeadOfDataObject()) if (!readHeadOfDataObject())
{ {
os::Printer::log("No opening brace in Mesh Material List found in x file", ELL_WARNING); os::Printer::log("No opening brace in Mesh Material List found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -1435,7 +1424,7 @@ bool CXMeshFileLoader::parseDataObjectMeshMaterialList(SXMesh &mesh) ...@@ -1435,7 +1424,7 @@ bool CXMeshFileLoader::parseDataObjectMeshMaterialList(SXMesh &mesh)
if (objectName.size() == 0) if (objectName.size() == 0)
{ {
os::Printer::log("Unexpected ending found in Mesh Material list in .x file.", ELL_WARNING); os::Printer::log("Unexpected ending found in Mesh Material list in .x file.", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
else else
...@@ -1485,7 +1474,7 @@ bool CXMeshFileLoader::parseDataObjectMaterial(video::SMaterial& material) ...@@ -1485,7 +1474,7 @@ bool CXMeshFileLoader::parseDataObjectMaterial(video::SMaterial& material)
if (!readHeadOfDataObject()) if (!readHeadOfDataObject())
{ {
os::Printer::log("No opening brace in Mesh Material found in .x file", ELL_WARNING); os::Printer::log("No opening brace in Mesh Material found in .x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -1510,7 +1499,7 @@ bool CXMeshFileLoader::parseDataObjectMaterial(video::SMaterial& material) ...@@ -1510,7 +1499,7 @@ bool CXMeshFileLoader::parseDataObjectMaterial(video::SMaterial& material)
if (objectName.size() == 0) if (objectName.size() == 0)
{ {
os::Printer::log("Unexpected ending found in Mesh Material in .x file.", ELL_WARNING); os::Printer::log("Unexpected ending found in Mesh Material in .x file.", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
else else
...@@ -1590,7 +1579,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationSet() ...@@ -1590,7 +1579,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationSet()
if (!readHeadOfDataObject(&AnimationName)) if (!readHeadOfDataObject(&AnimationName))
{ {
os::Printer::log("No opening brace in Animation Set found in x file", ELL_WARNING); os::Printer::log("No opening brace in Animation Set found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -1601,7 +1590,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationSet() ...@@ -1601,7 +1590,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationSet()
if (objectName.size() == 0) if (objectName.size() == 0)
{ {
os::Printer::log("Unexpected ending found in Animation set in x file.", ELL_WARNING); os::Printer::log("Unexpected ending found in Animation set in x file.", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
else else
...@@ -1635,7 +1624,7 @@ bool CXMeshFileLoader::parseDataObjectAnimation() ...@@ -1635,7 +1624,7 @@ bool CXMeshFileLoader::parseDataObjectAnimation()
if (!readHeadOfDataObject()) if (!readHeadOfDataObject())
{ {
os::Printer::log("No opening brace in Animation found in x file", ELL_WARNING); os::Printer::log("No opening brace in Animation found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -1652,7 +1641,7 @@ bool CXMeshFileLoader::parseDataObjectAnimation() ...@@ -1652,7 +1641,7 @@ bool CXMeshFileLoader::parseDataObjectAnimation()
if (objectName.size() == 0) if (objectName.size() == 0)
{ {
os::Printer::log("Unexpected ending found in Animation in x file.", ELL_WARNING); os::Printer::log("Unexpected ending found in Animation in x file.", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
else else
...@@ -1682,7 +1671,7 @@ bool CXMeshFileLoader::parseDataObjectAnimation() ...@@ -1682,7 +1671,7 @@ bool CXMeshFileLoader::parseDataObjectAnimation()
if (!checkForClosingBrace()) if (!checkForClosingBrace())
{ {
os::Printer::log("Unexpected ending found in Animation in x file.", ELL_WARNING); os::Printer::log("Unexpected ending found in Animation in x file.", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
} }
...@@ -1754,7 +1743,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationKey(ISkinnedMesh::SJoint *joint) ...@@ -1754,7 +1743,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationKey(ISkinnedMesh::SJoint *joint)
if (!readHeadOfDataObject()) if (!readHeadOfDataObject())
{ {
os::Printer::log("No opening brace in Animation Key found in x file", ELL_WARNING); os::Printer::log("No opening brace in Animation Key found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -1765,7 +1754,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationKey(ISkinnedMesh::SJoint *joint) ...@@ -1765,7 +1754,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationKey(ISkinnedMesh::SJoint *joint)
if (keyType > 4) if (keyType > 4)
{ {
os::Printer::log("Unknown key type found in Animation Key in x file", ELL_WARNING); os::Printer::log("Unknown key type found in Animation Key in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -1793,7 +1782,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationKey(ISkinnedMesh::SJoint *joint) ...@@ -1793,7 +1782,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationKey(ISkinnedMesh::SJoint *joint)
if (readInt() != 4) if (readInt() != 4)
{ {
os::Printer::log("Expected 4 numbers in animation key in x file", ELL_WARNING); os::Printer::log("Expected 4 numbers in animation key in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -1805,8 +1794,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationKey(ISkinnedMesh::SJoint *joint) ...@@ -1805,8 +1794,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationKey(ISkinnedMesh::SJoint *joint)
if (!checkForTwoFollowingSemicolons()) if (!checkForTwoFollowingSemicolons())
{ {
os::Printer::log("No finishing semicolon after quaternion animation key in x file", ELL_WARNING); os::Printer::log("No finishing semicolon after quaternion animation key in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false;
} }
ISkinnedMesh::SRotationKey *key=AnimatedMesh->createRotationKey(joint); ISkinnedMesh::SRotationKey *key=AnimatedMesh->createRotationKey(joint);
...@@ -1823,7 +1811,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationKey(ISkinnedMesh::SJoint *joint) ...@@ -1823,7 +1811,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationKey(ISkinnedMesh::SJoint *joint)
if (readInt() != 3) if (readInt() != 3)
{ {
os::Printer::log("Expected 3 numbers in animation key in x file", ELL_WARNING); os::Printer::log("Expected 3 numbers in animation key in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -1833,8 +1821,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationKey(ISkinnedMesh::SJoint *joint) ...@@ -1833,8 +1821,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationKey(ISkinnedMesh::SJoint *joint)
if (!checkForTwoFollowingSemicolons()) if (!checkForTwoFollowingSemicolons())
{ {
os::Printer::log("No finishing semicolon after vector animation key in x file", ELL_WARNING); os::Printer::log("No finishing semicolon after vector animation key in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false;
} }
if (keyType==2) if (keyType==2)
...@@ -1860,7 +1847,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationKey(ISkinnedMesh::SJoint *joint) ...@@ -1860,7 +1847,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationKey(ISkinnedMesh::SJoint *joint)
if (readInt() != 16) if (readInt() != 16)
{ {
os::Printer::log("Expected 16 numbers in animation key in x file", ELL_WARNING); os::Printer::log("Expected 16 numbers in animation key in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -1873,8 +1860,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationKey(ISkinnedMesh::SJoint *joint) ...@@ -1873,8 +1860,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationKey(ISkinnedMesh::SJoint *joint)
if (!checkForOneFollowingSemicolons()) if (!checkForOneFollowingSemicolons())
{ {
os::Printer::log("No finishing semicolon after matrix animation key in x file", ELL_WARNING); os::Printer::log("No finishing semicolon after matrix animation key in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false;
} }
//core::vector3df rotation = mat.getRotationDegrees(); //core::vector3df rotation = mat.getRotationDegrees();
...@@ -1912,7 +1898,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationKey(ISkinnedMesh::SJoint *joint) ...@@ -1912,7 +1898,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationKey(ISkinnedMesh::SJoint *joint)
if (!checkForClosingBrace()) if (!checkForClosingBrace())
{ {
os::Printer::log("No closing brace in animation key in x file", ELL_WARNING); os::Printer::log("No closing brace in animation key in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -1929,21 +1915,21 @@ bool CXMeshFileLoader::parseDataObjectTextureFilename(core::stringc& texturename ...@@ -1929,21 +1915,21 @@ bool CXMeshFileLoader::parseDataObjectTextureFilename(core::stringc& texturename
if (!readHeadOfDataObject()) if (!readHeadOfDataObject())
{ {
os::Printer::log("No opening brace in Texture filename found in x file", ELL_WARNING); os::Printer::log("No opening brace in Texture filename found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
if (!getNextTokenAsString(texturename)) if (!getNextTokenAsString(texturename))
{ {
os::Printer::log("Unknown syntax while reading texture filename string in x file", ELL_WARNING); os::Printer::log("Unknown syntax while reading texture filename string in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
if (!checkForClosingBrace()) if (!checkForClosingBrace())
{ {
os::Printer::log("No closing brace in Texture filename found in x file", ELL_WARNING); os::Printer::log("No closing brace in Texture filename found in x file", ELL_WARNING);
os::Printer::log("Line", core::stringc(Line).c_str(), ELL_ERROR); os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING);
return false; return false;
} }
...@@ -2000,7 +1986,13 @@ bool CXMeshFileLoader::checkForOneFollowingSemicolons() ...@@ -2000,7 +1986,13 @@ bool CXMeshFileLoader::checkForOneFollowingSemicolons()
if (BinaryFormat) if (BinaryFormat)
return true; return true;
return (getNextToken() == ";"); if (getNextToken() == ";")
return true;
else
{
--P;
return false;
}
} }
...@@ -2013,8 +2005,11 @@ bool CXMeshFileLoader::checkForTwoFollowingSemicolons() ...@@ -2013,8 +2005,11 @@ bool CXMeshFileLoader::checkForTwoFollowingSemicolons()
for (u32 k=0; k<2; ++k) for (u32 k=0; k<2; ++k)
{ {
if (getNextToken() != ";") if (getNextToken() != ";")
{
--P;
return false; return false;
} }
}
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment