Set default for MeshLoader IndexTypeHint to EITH_OPTIMAL.

Did some tests and the overhead speed cost on loading and rendering where both not really measurable even in a pretty huge scene.
While some Irrlicht parts might still have a problem with 32-bit meshes (octree for example, also some meshmanipulator functions), it's probably still less of a problem than having broken meshes and just a nicer default. Also the troubling parts in Irrlicht can be improved over time.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6343 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien
2022-04-19 21:44:50 +00:00
parent 3ce2f0c0dd
commit dd36699ad2
2 changed files with 8 additions and 4 deletions

View File

@ -30,7 +30,7 @@ class IMeshLoader : public virtual IReferenceCounted
public:
//! Constructor
IMeshLoader() : TextureLoader(0), IndexTypeHint(EITH_16BIT) {}
IMeshLoader() : TextureLoader(0), IndexTypeHint(EITH_OPTIMAL) {}
//! Destructor
virtual ~IMeshLoader()
@ -82,21 +82,24 @@ public:
enum E_INDEX_TYPE_HINT
{
//! Prefer to use 16-bit index buffers even if it breaks the mesh
//! The default (and only option) before Irrlicht 1.9
EITH_16BIT,
//! Allow using 32-bit index buffers
EITH_32BIT,
//! Allow 32-bit, but copy back to 16-bit when 32 is not needed.
//! So tiny overhead on loading, but meshes are later more optimal
//! So tiny overhead (sometimes extra allocation+copying) on loading,
//! but meshes are later more optimal.
//! Default since Irrlicht 1.9
EITH_OPTIMAL
};
//! Give loader a hint if you would prefer 16 or 32 bit meshbuffers.
/**
Generally Irrlicht works with 16-bit meshbuffers so far.
Rendering 32-bit meshbuffers works, other functions like
Before Irrlicht 1.9 Irrlicht worked mostly with 16-bit meshbuffers.
Rendering 32-bit meshbuffers works, but some functions like
mesh-writing and mesh manipulation might not work yet.
NOTE: Most loaders will ignore this hint so far, but hopefully
will care about it in the future.