From 391080d2e61025910b879967876b6340ff443aec Mon Sep 17 00:00:00 2001 From: "DESKTOP-HEFITKI\\Iraj" <1mohtashamiraj@gmail.com> Date: Thu, 1 Jul 2021 15:01:39 +0430 Subject: [PATCH 1/2] Update Gitignore exclude x64 folder generate by build --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0a999d3aa..7849cab65 100644 --- a/.gitignore +++ b/.gitignore @@ -25,7 +25,7 @@ CMakeSettings.json # Output bin/ lib/ - +x64/ # QtCreator CMakeLists.txt.user From 3cbd31900c9ce9d893747e25112d212cab938a70 Mon Sep 17 00:00:00 2001 From: arkeon Date: Thu, 1 Jul 2021 17:23:21 +0200 Subject: [PATCH 2/2] Manage /R/N lines ends correctly on binary files, tested with solidworks PLY export --- code/AssetLib/Ply/PlyParser.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/AssetLib/Ply/PlyParser.cpp b/code/AssetLib/Ply/PlyParser.cpp index 59cb6b976..8af0edfdc 100644 --- a/code/AssetLib/Ply/PlyParser.cpp +++ b/code/AssetLib/Ply/PlyParser.cpp @@ -419,8 +419,7 @@ bool PLY::DOM::ParseHeader(IOStreamBuffer &streamBuffer, std::vector if (PLY::Element::ParseElement(streamBuffer, buffer, &out)) { // add the element to the list of elements alElements.push_back(out); - } else if ( TokenMatch(buffer, "end_header\r", 11) || //checks for header end with /r/n ending - TokenMatch(buffer, "end_header", 10)) { //checks for /n ending, if it doesn't end with /r/n + } else if (TokenMatch(buffer, "end_header", 10)) { //checks for /n ending, if it doesn't end with /r/n // we have reached the end of the header break; } else { @@ -501,6 +500,11 @@ bool PLY::DOM::ParseInstanceBinary(IOStreamBuffer &streamBuffer, DOM *p_pc } streamBuffer.getNextBlock(buffer); + + // remove first char if it's /n in case of file with /r/n + if (((char *)&buffer[0])[0] == '\n') + buffer.erase(buffer.begin(), buffer.begin() + 1); + unsigned int bufferSize = static_cast(buffer.size()); const char *pCur = (char *)&buffer[0]; if (!p_pcOut->ParseElementInstanceListsBinary(streamBuffer, buffer, pCur, bufferSize, loader, p_bBE)) {