From 8b5dc677e3cfa5a56a2ef7c3c244e9faeb0e7ce0 Mon Sep 17 00:00:00 2001 From: HarrievG Date: Tue, 16 Aug 2022 20:26:37 +0200 Subject: [PATCH] - fixed asserts while converting gltf meshes primitives --- neo/idlib/MapFile_gltf.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/neo/idlib/MapFile_gltf.cpp b/neo/idlib/MapFile_gltf.cpp index 0afa42d0..e0b72323 100644 --- a/neo/idlib/MapFile_gltf.cpp +++ b/neo/idlib/MapFile_gltf.cpp @@ -238,6 +238,9 @@ MapPolygonMesh* MapPolygonMesh::ConvertFromMeshGltf( const gltfMesh_Primitive* p if( attrAcc->typeSize == 2 ) { uint16_t vec[4]; + + assert( sizeof( vec ) == (attrAcc->typeSize * 4) ); + for( int i = 0; i < attrAcc->count; i++ ) { bin.Read( ( void* )( &vec[0] ), attrAcc->typeSize ); @@ -260,7 +263,7 @@ MapPolygonMesh* MapPolygonMesh::ConvertFromMeshGltf( const gltfMesh_Primitive* p uint8_t vec[4]; for( int i = 0; i < attrAcc->count; i++ ) { - assert( sizeof( vec ) == attrAcc->typeSize ); + assert( sizeof( vec ) == (attrAcc->typeSize * 4) ); bin.Read( ( void* )( &vec[0] ), attrAcc->typeSize ); bin.Read( ( void* )( &vec[1] ), attrAcc->typeSize );