diff options
Diffstat (limited to 'code/AssetLib/MDL/MDLLoader.cpp')
-rw-r--r-- | code/AssetLib/MDL/MDLLoader.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/code/AssetLib/MDL/MDLLoader.cpp b/code/AssetLib/MDL/MDLLoader.cpp index 40725b1f7..9839bf41c 100644 --- a/code/AssetLib/MDL/MDLLoader.cpp +++ b/code/AssetLib/MDL/MDLLoader.cpp @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2024, assimp team +Copyright (c) 2006-2025, assimp team All rights reserved. @@ -48,10 +48,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_MDL_IMPORTER -#include "AssetLib/MDL/MDLLoader.h" +#include "MDLLoader.h" #include "AssetLib/MD2/MD2FileData.h" -#include "AssetLib/MDL/HalfLife/HL1MDLLoader.h" -#include "AssetLib/MDL/MDLDefaultColorMap.h" +#include "HalfLife/HL1MDLLoader.h" +#include "MDLDefaultColorMap.h" #include <assimp/StringUtils.h> #include <assimp/importerdesc.h> @@ -268,8 +268,8 @@ void MDLImporter::InternReadFile(const std::string &pFile, // Now rotate the whole scene 90 degrees around the x axis to convert to internal coordinate system pScene->mRootNode->mTransformation = aiMatrix4x4( 1.f, 0.f, 0.f, 0.f, - 0.f, 0.f, 1.f, 0.f, - 0.f, -1.f, 0.f, 0.f, + 0.f, 0.f, 1.f, 0.f, + 0.f, -1.f, 0.f, 0.f, 0.f, 0.f, 0.f, 1.f); } @@ -325,13 +325,13 @@ void MDLImporter::SizeCheck(const void *szPos, const char *szFile, unsigned int // Validate a quake file header void MDLImporter::ValidateHeader_Quake1(const MDL::Header *pcHeader) { // some values may not be nullptr - if (!pcHeader->num_frames) + if (pcHeader->num_frames <= 0) throw DeadlyImportError("[Quake 1 MDL] There are no frames in the file"); - if (!pcHeader->num_verts) + if (pcHeader->num_verts <= 0) throw DeadlyImportError("[Quake 1 MDL] There are no vertices in the file"); - if (!pcHeader->num_tris) + if (pcHeader->num_tris <= 0) throw DeadlyImportError("[Quake 1 MDL] There are no triangles in the file"); // check whether the maxima are exceeded ...however, this applies for Quake 1 MDLs only @@ -420,7 +420,7 @@ void MDLImporter::InternReadFile_Quake1() { } // go to the end of the skin section / the beginning of the next skin bool overflow = false; - if (pcHeader->skinwidth != 0 || pcHeader->skinheight != 0) { + if (pcHeader->skinwidth != 0 && pcHeader->skinheight != 0) { if ((pcHeader->skinheight > INT_MAX / pcHeader->skinwidth) || (pcHeader->skinwidth > INT_MAX / pcHeader->skinheight)){ overflow = true; } |