New IMeshTextureLoader interface
Posted: Sun Mar 02, 2014 1:21 am
I've added today a rather large patch to svn: http://sourceforge.net/p/irrlicht/code/4703/
This adds a new interface called IMeshTextureLoader which can be used by MeshLoaders to find textures:
http://sourceforge.net/p/irrlicht/code/ ... reLoader.h
This affects for now the following meshloaders: 3DS, B3D, CSM, Collada, DMF, LMTS, LWO, MY3d, OBJ, OCT, Ogre, SMF, X.
Not using the new interface are: MS3D, CIrrMeshFileLoader, MDL, MD2, MD3 and BSP. Those continue to work as they did. I hope I'll get to those as well some day, but they are a little more tricky than the rest.
The idea behind the interface is:
a) Unify code. We had over a dozen independent implementation doing the same stuff in different ways before and nearly each one was incomplete.
b) Replacing old texture-path attributes like B3D_TEXTURE_PATH with one function: IMeshTextureLoader::setTexturePath. So now meshloaders like .X can also use custom texture paths. The attributes will be deprecated soon.
c) Allowing to set custom textureloaders. That can be used for all kind of stuff. For example you can call the old textureloader and when it fails you can now add some deliberate error-handling. Or you can set the textureloader to 0 and prevent textureloading for a format completely (useful for servers).
Unfortunately I don't have test-models for most meshloaders, so I can't do too much testing myself. Which means I would welcome if people test this patch. Also certainly all feedback is welcome - especially if I maybe forget some situations.
This adds a new interface called IMeshTextureLoader which can be used by MeshLoaders to find textures:
http://sourceforge.net/p/irrlicht/code/ ... reLoader.h
This affects for now the following meshloaders: 3DS, B3D, CSM, Collada, DMF, LMTS, LWO, MY3d, OBJ, OCT, Ogre, SMF, X.
Not using the new interface are: MS3D, CIrrMeshFileLoader, MDL, MD2, MD3 and BSP. Those continue to work as they did. I hope I'll get to those as well some day, but they are a little more tricky than the rest.
The idea behind the interface is:
a) Unify code. We had over a dozen independent implementation doing the same stuff in different ways before and nearly each one was incomplete.
b) Replacing old texture-path attributes like B3D_TEXTURE_PATH with one function: IMeshTextureLoader::setTexturePath. So now meshloaders like .X can also use custom texture paths. The attributes will be deprecated soon.
c) Allowing to set custom textureloaders. That can be used for all kind of stuff. For example you can call the old textureloader and when it fails you can now add some deliberate error-handling. Or you can set the textureloader to 0 and prevent textureloading for a format completely (useful for servers).
Unfortunately I don't have test-models for most meshloaders, so I can't do too much testing myself. Which means I would welcome if people test this patch. Also certainly all feedback is welcome - especially if I maybe forget some situations.