Commit 95771197 authored by hybrid's avatar hybrid

Fixed problems with missing (default) strings in the obj loader and copyright statement.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1627 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 2fcc151d
...@@ -135,7 +135,12 @@ IAnimatedMesh* COBJMeshFileLoader::createMesh(io::IReadFile* file) ...@@ -135,7 +135,12 @@ IAnimatedMesh* COBJMeshFileLoader::createMesh(io::IReadFile* file)
os::Printer::log("Loaded group start",grp); os::Printer::log("Loaded group start",grp);
#endif #endif
if (useGroups) if (useGroups)
grpName = grp; {
if (0 != grp[0])
grpName = grp;
else
grpName = "default";
}
} }
break; break;
...@@ -687,24 +692,28 @@ COBJMeshFileLoader::SObjMtl* COBJMeshFileLoader::findMtl(const core::stringc& mt ...@@ -687,24 +692,28 @@ COBJMeshFileLoader::SObjMtl* COBJMeshFileLoader::findMtl(const core::stringc& mt
//! skip space characters and stop on first non-space //! skip space characters and stop on first non-space
const c8* COBJMeshFileLoader::goFirstWord(const c8* buf, const c8* const bufEnd) const c8* COBJMeshFileLoader::goFirstWord(const c8* buf, const c8* const bufEnd, bool acrossNewlines)
{ {
// skip space characters // skip space characters
while((buf != bufEnd) && core::isspace(*buf)) if (acrossNewlines)
++buf; while((buf != bufEnd) && core::isspace(*buf))
++buf;
else
while((buf != bufEnd) && core::isspace(*buf) && (*buf != '\n'))
++buf;
return buf; return buf;
} }
//! skip current word and stop at beginning of next one //! skip current word and stop at beginning of next one
const c8* COBJMeshFileLoader::goNextWord(const c8* buf, const c8* const bufEnd) const c8* COBJMeshFileLoader::goNextWord(const c8* buf, const c8* const bufEnd, bool acrossNewlines)
{ {
// skip current word // skip current word
while(( buf != bufEnd ) && !core::isspace(*buf)) while(( buf != bufEnd ) && !core::isspace(*buf))
++buf; ++buf;
return goFirstWord(buf, bufEnd); return goFirstWord(buf, bufEnd, acrossNewlines);
} }
...@@ -768,7 +777,7 @@ core::stringc COBJMeshFileLoader::copyLine(const c8* inBuf, const c8* bufEnd) ...@@ -768,7 +777,7 @@ core::stringc COBJMeshFileLoader::copyLine(const c8* inBuf, const c8* bufEnd)
const c8* COBJMeshFileLoader::goAndCopyNextWord(c8* outBuf, const c8* inBuf, u32 outBufLength, const c8* bufEnd) const c8* COBJMeshFileLoader::goAndCopyNextWord(c8* outBuf, const c8* inBuf, u32 outBufLength, const c8* bufEnd)
{ {
inBuf = goNextWord(inBuf, bufEnd); inBuf = goNextWord(inBuf, bufEnd, false);
copyWord(outBuf, inBuf, outBufLength, bufEnd); copyWord(outBuf, inBuf, outBufLength, bufEnd);
return inBuf; return inBuf;
} }
......
...@@ -74,9 +74,9 @@ private: ...@@ -74,9 +74,9 @@ private:
const c8* readTextures(const c8* bufPtr, const c8* const bufEnd, SObjMtl* currMaterial, const core::stringc& relPath); const c8* readTextures(const c8* bufPtr, const c8* const bufEnd, SObjMtl* currMaterial, const core::stringc& relPath);
// returns a pointer to the first printable character available in the buffer // returns a pointer to the first printable character available in the buffer
const c8* goFirstWord(const c8* buf, const c8* const bufEnd); const c8* goFirstWord(const c8* buf, const c8* const bufEnd, bool acrossNewlines=true);
// returns a pointer to the first printable character after the first non-printable // returns a pointer to the first printable character after the first non-printable
const c8* goNextWord(const c8* buf, const c8* const bufEnd); const c8* goNextWord(const c8* buf, const c8* const bufEnd, bool acrossNewlines=true);
// returns a pointer to the next printable character after the first line break // returns a pointer to the next printable character after the first line break
const c8* goNextLine(const c8* buf, const c8* const bufEnd); const c8* goNextLine(const c8* buf, const c8* const bufEnd);
// copies the current word from the inBuf to the outBuf // copies the current word from the inBuf to the outBuf
......
// Copyright (C) 2002-2008 Nikolaus Gebhardt // Copyright (C) 2008 Christian Stehno
// This file is part of the "Irrlicht Engine". // This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h // For conditions of distribution and use, see copyright notice in irrlicht.h
......
// Copyright (C) 2002-2008 Nikolaus Gebhardt // Copyright (C) 2008 Christian Stehno
// This file is part of the "Irrlicht Engine". // This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h // For conditions of distribution and use, see copyright notice in irrlicht.h
......
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