Utility/OBJParser: Abort parsing when there's more than one error per two line
Former-commit-id: 5b4cad994aa57293e8099c006619d3fb0c7429b1 [formerly 79c2ce8fe15176f91d2078866798ddd6f78ce044] Former-commit-id: 12e75819f8d65b980199a803f0f8138061ea644d
This commit is contained in:
@@ -168,7 +168,7 @@ namespace Nz
|
||||
NazaraWarning(message + " at line #" + String::Number(m_lineCount));
|
||||
}
|
||||
|
||||
inline void OBJParser::UnrecognizedLine(bool error)
|
||||
inline bool OBJParser::UnrecognizedLine(bool error)
|
||||
{
|
||||
String message = "Unrecognized \"" + m_currentLine + '"';
|
||||
|
||||
@@ -176,6 +176,16 @@ namespace Nz
|
||||
Error(message);
|
||||
else
|
||||
Warning(message);
|
||||
|
||||
m_errorCount++;
|
||||
|
||||
if (m_lineCount > 20 && (m_errorCount * 100 / m_lineCount) > 50)
|
||||
{
|
||||
NazaraError("Aborting parsing because of error percentage");
|
||||
return false; //< Abort parsing if error percentage is too high
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user