From 5451a2a8a0ed04af6ee1c432db3a478d91a801c2 Mon Sep 17 00:00:00 2001 From: cutealien Date: Wed, 8 Jan 2020 11:14:57 +0000 Subject: [PATCH] Switch to 32bit meshes in CPLYMeshFileLoader now at > 65536 vertices. 65536th vertex has index 65535 which is still fine, was going 1 too low in last commit. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6053 dfc29bdd-3216-0410-991c-e03cc46cb475 --- changes.txt | 1 + source/Irrlicht/CPLYMeshFileLoader.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changes.txt b/changes.txt index 2dd72643..d8d146b9 100644 --- a/changes.txt +++ b/changes.txt @@ -1,5 +1,6 @@ -------------------------- Changes in 1.9 (not yet released) +- Fix CPLYMeshFileLoader checking for wrong vertex count when switching between 16/32 bit. Thanks @randomMesh for reporting. - Fix bug that AnimatedMeshSceneNode ignored ReadOnlyMaterials flag when checking materials for transparent render passes. - Unify checks if materials should use transparent render pass with new IVideoDriver::needsTransparentRenderPass function. - Material.ZWriteEnable is now of type E_ZWRITE instead of bool. This allows now setting materials to always "on" independent of material type and transparency. diff --git a/source/Irrlicht/CPLYMeshFileLoader.cpp b/source/Irrlicht/CPLYMeshFileLoader.cpp index 94674c6d..f1540956 100644 --- a/source/Irrlicht/CPLYMeshFileLoader.cpp +++ b/source/Irrlicht/CPLYMeshFileLoader.cpp @@ -230,7 +230,7 @@ IAnimatedMesh* CPLYMeshFileLoader::createMesh(io::IReadFile* file) if (continueReading) { // create a mesh buffer - CDynamicMeshBuffer *mb = new CDynamicMeshBuffer(video::EVT_STANDARD, vertCount > 65535 ? video::EIT_32BIT : video::EIT_16BIT); + CDynamicMeshBuffer *mb = new CDynamicMeshBuffer(video::EVT_STANDARD, vertCount > 65536 ? video::EIT_32BIT : video::EIT_16BIT); mb->getVertexBuffer().reallocate(vertCount); mb->getIndexBuffer().reallocate(vertCount); mb->setHardwareMappingHint(EHM_STATIC);