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