commit
39e048dea6
|
@ -99,27 +99,24 @@ ObjFile::Model *ObjFileParser::GetModel() const {
|
|||
}
|
||||
void ignoreNewLines(IOStreamBuffer<char> &streamBuffer, std::vector<char> &buffer)
|
||||
{
|
||||
std::vector<char> buf(buffer);
|
||||
auto copyPosition = buffer.begin();
|
||||
auto curPosition = buf.cbegin();
|
||||
do
|
||||
{
|
||||
while (*curPosition != '\n'&&*curPosition != '\\')
|
||||
{
|
||||
++curPosition;
|
||||
}
|
||||
if (*curPosition == '\\')
|
||||
{
|
||||
copyPosition = std::copy(buf.cbegin(), curPosition, copyPosition);
|
||||
*(copyPosition++) = ' ';
|
||||
do
|
||||
{
|
||||
streamBuffer.getNextLine(buf);
|
||||
} while (buf[0] == '\n');
|
||||
curPosition = buf.cbegin();
|
||||
}
|
||||
} while (*curPosition != '\n');
|
||||
std::copy(buf.cbegin(), curPosition, copyPosition);
|
||||
auto curPosition = buffer.begin();
|
||||
do
|
||||
{
|
||||
while (*curPosition!='\n'&&*curPosition!='\\')
|
||||
{
|
||||
++curPosition;
|
||||
}
|
||||
if (*curPosition=='\\')
|
||||
{
|
||||
std::vector<char> tempBuf;
|
||||
do
|
||||
{
|
||||
streamBuffer.getNextLine(tempBuf);
|
||||
} while (tempBuf[0]=='\n');
|
||||
*curPosition = ' ';
|
||||
std::copy(tempBuf.cbegin(), tempBuf.cend(), ++curPosition);
|
||||
}
|
||||
} while (*curPosition!='\n');
|
||||
}
|
||||
// -------------------------------------------------------------------
|
||||
// File parsing method.
|
||||
|
|
Loading…
Reference in New Issue