Commit fb9366b4 authored by hybrid's avatar hybrid

Made obj group support optional via SceneParameter.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1264 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 96a5c452
......@@ -95,13 +95,22 @@ namespace scene
/** Use it like this:
\code
//this way you'll choose to flip alpha textures
SceneManager->()->setAttribute(
SceneManager->getParameters()->setAttribute(
scene::DMF_FLIP_ALPHA_TEXTURES, true);
\endcode
**/
const c8* const DMF_FLIP_ALPHA_TEXTURES = "DMF_FlipAlpha";
//! Flag to avoid loading group structures in .obj files
/** Use it like this:
\code
SceneManager->getParameters()->setAttribute(scene::OBJ_LOADER_IGNORE_GROUPS, true);
\endcode
**/
const c8* const OBJ_LOADER_IGNORE_GROUPS = "OBJ_IgnoreGroups";
//! Flag set as parameter when the scene manager is used as editor
/** In this way special animators like deletion animators can be stopped from
deleting scene nodes for example */
......
......@@ -12,6 +12,7 @@
#include "SMeshBuffer.h"
#include "SAnimatedMesh.h"
#include "IReadFile.h"
#include "IAttributes.h"
#include "fast_atof.h"
#include "coreutil.h"
#include "irrMap.h"
......@@ -94,6 +95,7 @@ IAnimatedMesh* COBJMeshFileLoader::createMesh(io::IReadFile* file)
// Process obj information
const c8* bufPtr = buf;
core::stringc grpName;
bool useGroups = !SceneManager->getParameters()->getAttributeAsBool(OBJ_LOADER_IGNORE_GROUPS);
while(bufPtr != bufEnd)
{
switch(bufPtr[0])
......@@ -139,6 +141,7 @@ IAnimatedMesh* COBJMeshFileLoader::createMesh(io::IReadFile* file)
{
c8 grp[WORD_BUFFER_LENGTH];
bufPtr = goAndCopyNextWord(grp, bufPtr, WORD_BUFFER_LENGTH, bufEnd);
if (useGroups)
grpName = grp;
}
break;
......
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