From 6c78f181b5d2931baeae328af625f03dc9bec0c1 Mon Sep 17 00:00:00 2001 From: hecks <42101236+hecktest@users.noreply.github.com> Date: Thu, 29 Jul 2021 05:05:34 +0200 Subject: [PATCH] Fix .x material slot parsing Co-authored-by: hecktest <> --- source/Irrlicht/CXMeshFileLoader.cpp | 17 +++++++++++++---- source/Irrlicht/CXMeshFileLoader.h | 8 -------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/source/Irrlicht/CXMeshFileLoader.cpp b/source/Irrlicht/CXMeshFileLoader.cpp index 547a5129..27c4e369 100644 --- a/source/Irrlicht/CXMeshFileLoader.cpp +++ b/source/Irrlicht/CXMeshFileLoader.cpp @@ -89,7 +89,6 @@ IAnimatedMesh* CXMeshFileLoader::createMesh(io::IReadFile* file) P=0; End=0; CurFrame=0; - TemplateMaterials.clear(); delete [] Buffer; Buffer = 0; @@ -519,6 +518,11 @@ bool CXMeshFileLoader::parseDataObject() return parseDataObjectAnimationTicksPerSecond(); } else + if (objectName == "Material") + { + return parseUnknownDataObject(); + } + else if (objectName == "}") { os::Printer::log("} found in dataObject", ELL_WARNING); @@ -1455,12 +1459,17 @@ bool CXMeshFileLoader::parseDataObjectMeshMaterialList(SXMesh &mesh) { // template materials now available thanks to joeWright objectName = getNextToken(); - for (u32 i=0; i Meshes; - core::array TemplateMaterials; - u32 MajorVersion; u32 MinorVersion; bool BinaryFormat;