From cb71e6f5f24bfeb9bc8f3a93e8cd4e03f8875de0 Mon Sep 17 00:00:00 2001 From: kimmi Date: Tue, 20 Mar 2012 20:42:16 +0000 Subject: [PATCH] =?UTF-8?q?Bugfix=20:=20pcGroupTris=20isn't=20really=20con?= =?UTF-8?q?st,=20removed=20const=20and=20const=5Fcast=20(=20merged=20from?= =?UTF-8?q?=20GitHub,=20thanks=20to=20Riku=20Palom=C3=A4ki=20).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1216 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/MDLFileData.h | 2 +- code/MDLLoader.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/MDLFileData.h b/code/MDLFileData.h index b9b28af7d..fd7754e0a 100644 --- a/code/MDLFileData.h +++ b/code/MDLFileData.h @@ -846,7 +846,7 @@ struct IntGroupInfo_MDL7 BE_NCONST MDL::TexCoord_MDL7* pcGroupUVs; //! Points to the beginning of the triangle section - BE_NCONST MDL::Triangle_MDL7* pcGroupTris; + MDL::Triangle_MDL7* pcGroupTris; //! Points to the beginning of the vertex section BE_NCONST MDL::Vertex_MDL7* pcGroupVerts; diff --git a/code/MDLLoader.cpp b/code/MDLLoader.cpp index 672d88bea..4b46329be 100644 --- a/code/MDLLoader.cpp +++ b/code/MDLLoader.cpp @@ -191,7 +191,7 @@ void MDLImporter::InternReadFile( const std::string& pFile, iGSFileVersion = 7; InternReadFile_3DGS_MDL7(); } - // IDST/IDSQ Format (CS:S/HLČ, etc ...) + // IDST/IDSQ Format (CS:S/HL^2, etc ...) else if (AI_MDL_MAGIC_NUMBER_BE_HL2a == iMagicWord || AI_MDL_MAGIC_NUMBER_LE_HL2a == iMagicWord || AI_MDL_MAGIC_NUMBER_BE_HL2b == iMagicWord || AI_MDL_MAGIC_NUMBER_LE_HL2b == iMagicWord) { @@ -970,7 +970,7 @@ void MDLImporter::ReadFaces_3DGS_MDL7(const MDL::IntGroupInfo_MDL7& groupInfo, MDL::IntGroupData_MDL7& groupData) { const MDL::Header_MDL7 *pcHeader = (const MDL::Header_MDL7*)this->mBuffer; - BE_NCONST MDL::Triangle_MDL7* pcGroupTris = groupInfo.pcGroupTris; + MDL::Triangle_MDL7* pcGroupTris = groupInfo.pcGroupTris; // iterate through all triangles and build valid display lists unsigned int iOutIndex = 0; @@ -986,7 +986,7 @@ void MDLImporter::ReadFaces_3DGS_MDL7(const MDL::IntGroupInfo_MDL7& groupInfo, unsigned int iIndex = pcGroupTris->v_index[c]; if(iIndex > (unsigned int)groupInfo.pcGroup->numverts) { // (we might need to read this section a second time - to process frame vertices correctly) - const_cast(pcGroupTris)->v_index[c] = iIndex = groupInfo.pcGroup->numverts-1; + pcGroupTris->v_index[c] = iIndex = groupInfo.pcGroup->numverts-1; DefaultLogger::get()->warn("Index overflow in MDL7 vertex list"); } @@ -1083,7 +1083,7 @@ void MDLImporter::ReadFaces_3DGS_MDL7(const MDL::IntGroupInfo_MDL7& groupInfo, } } // get the next triangle in the list - pcGroupTris = (BE_NCONST MDL::Triangle_MDL7*)((const char*)pcGroupTris + pcHeader->triangle_stc_size); + pcGroupTris = (MDL::Triangle_MDL7*)((const char*)pcGroupTris + pcHeader->triangle_stc_size); } } @@ -1422,7 +1422,7 @@ void MDLImporter::InternReadFile_3DGS_MDL7( ) szCurrent += pcHeader->skinpoint_stc_size * groupInfo.pcGroup->num_stpts; // now get a pointer to all triangle in the group - groupInfo.pcGroupTris = (BE_NCONST MDL::Triangle_MDL7*)szCurrent; + groupInfo.pcGroupTris = (Triangle_MDL7*)szCurrent; szCurrent += pcHeader->triangle_stc_size * groupInfo.pcGroup->numtris; // now get a pointer to all vertices in the group