1
0

Rename IMeshLoader::setPreferredIndexType to setIndexTypeHint and give it a new enum.

Giving the loader it's own enum allowed me to add more options. 
EITH_OPTIMAL which reduces buffers back to 16-bit if they don't need 32-bit.
Using that in obj loader.
Also 32-bit meshes with EMT_PARALLAX_MAP_SOLID material should now work in obj loader (untested as I got no test-case)


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6340 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien
2022-04-19 13:10:16 +00:00
parent d484711f2e
commit 24f2a1e9ab
4 changed files with 37 additions and 19 deletions

View File

@@ -42,7 +42,9 @@ private:
struct SObjMtl
{
SObjMtl(irr::video::E_INDEX_TYPE indexType) : IndexType(indexType), Meshbuffer(0), Bumpiness (1.0f), Illumination(0),
SObjMtl(E_INDEX_TYPE_HINT typeHint)
: IndexType(typeHint == EITH_16BIT ? video::EIT_16BIT : video::EIT_32BIT)
, Meshbuffer(0), Bumpiness (1.0f), Illumination(0),
RecalculateNormals(false)
{
Meshbuffer = new CDynamicMeshBuffer(irr::video::EVT_STANDARD, IndexType);