From 3f17c5f046b1f8e72b59269943ce6ffad5526fa0 Mon Sep 17 00:00:00 2001 From: hybrid Date: Fri, 23 Jan 2009 22:43:09 +0000 Subject: [PATCH] New scene parameter to ignore b3d file mipmap flag. In case your b3d files load textures without mipmaps unintentionally you should set this flag to true. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2136 dfc29bdd-3216-0410-991c-e03cc46cb475 --- changes.txt | 4 ++++ include/SceneParameters.h | 15 ++++++++++++--- source/Irrlicht/CB3DMeshFileLoader.cpp | 3 ++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/changes.txt b/changes.txt index 94ccf564..31a2a8d8 100644 --- a/changes.txt +++ b/changes.txt @@ -1,5 +1,9 @@ Changes in version 1.6 + - New scene parameter B3D_LOADER_IGNORE_MIPMAP_FLAG to ignore the often missing mipmap flag in b3d files. If this parameter is true, the old pre Irrlicht-1.5 behavior is restored. + + - Added Mipmap LOD Bias attribute to MaterialLayer. + - Added ColorMask support to selectively disable color planes on rendering. - Added support for all available depth test functions. diff --git a/include/SceneParameters.h b/include/SceneParameters.h index 17b336a2..2ef8e742 100644 --- a/include/SceneParameters.h +++ b/include/SceneParameters.h @@ -108,13 +108,22 @@ namespace scene //! Flag to avoid loading group structures in .obj files /** Use it like this: - \code - SceneManager->getParameters()->setAttribute(scene::OBJ_LOADER_IGNORE_GROUPS, true); + \code + SceneManager->getParameters()->setAttribute(scene::OBJ_LOADER_IGNORE_GROUPS, true); \endcode - **/ + **/ const c8* const OBJ_LOADER_IGNORE_GROUPS = "OBJ_IgnoreGroups"; + //! Flag to ignore the b3d file's mipmapping flag + /** Instead Irrlicht's texture creation flag is used. Use it like this: + \code + SceneManager->getParameters()->setAttribute(scene::B3D_LOADER_IGNORE_MIPMAP_FLAG, true); + \endcode + **/ + const c8* const B3D_LOADER_IGNORE_MIPMAP_FLAG = "B3D_IgnoreMipmapFlag"; + + //! 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 */ diff --git a/source/Irrlicht/CB3DMeshFileLoader.cpp b/source/Irrlicht/CB3DMeshFileLoader.cpp index 092cb831..c7cc5829 100644 --- a/source/Irrlicht/CB3DMeshFileLoader.cpp +++ b/source/Irrlicht/CB3DMeshFileLoader.cpp @@ -907,7 +907,8 @@ void CB3DMeshFileLoader::loadTextures(SB3dMaterial& material) const SB3dTexture* B3dTexture = material.Textures[i]; if (B3dTexture && B3dTexture->TextureName.size() && !material.Material.getTexture(i)) { - SceneManager->getVideoDriver()->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, (B3dTexture->Flags & 0x8) ? true:false); + if (!SceneManager->getParameters()->getAttributeAsBool(B3D_LOADER_IGNORE_MIPMAP_FLAG)) + SceneManager->getVideoDriver()->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, (B3dTexture->Flags & 0x8) ? true:false); material.Material.setTexture(i, SceneManager->getVideoDriver()->getTexture( B3dTexture->TextureName.c_str() )); if (material.Textures[i]->Flags & 0x10) // Clamp U material.Material.TextureLayer[i].TextureWrap=video::ETC_CLAMP;