From ffd18bf9d4a20dd8f315b4960105352d857b23dc Mon Sep 17 00:00:00 2001 From: Robert Beckebans Date: Sun, 26 Jun 2022 13:24:55 +0200 Subject: [PATCH] Fixed duplication of glTF models --- neo/renderer/Model.cpp | 2 +- neo/renderer/ModelManager.cpp | 1 - neo/renderer/Model_gltf.cpp | 15 +++++++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/neo/renderer/Model.cpp b/neo/renderer/Model.cpp index 0c56853f..8ab03312 100644 --- a/neo/renderer/Model.cpp +++ b/neo/renderer/Model.cpp @@ -178,7 +178,7 @@ void idRenderModelStatic::List() const totalTris += surf->geometry->numIndexes / 3; totalVerts += surf->geometry->numVerts; } - common->Printf( "%c%4ik %3i %4i %4i %s", closed, totalBytes / 1024, NumSurfaces(), totalVerts, totalTris, Name() ); + common->Printf( "%c%4ik %3i %4i %4i '%s'", closed, totalBytes / 1024, NumSurfaces(), totalVerts, totalTris, Name() ); if( IsDynamicModel() == DM_CACHED ) { diff --git a/neo/renderer/ModelManager.cpp b/neo/renderer/ModelManager.cpp index 621a111f..22a1b38a 100644 --- a/neo/renderer/ModelManager.cpp +++ b/neo/renderer/ModelManager.cpp @@ -345,7 +345,6 @@ idRenderModel* idRenderModelManagerLocal::GetModel( const char* _modelName, bool if( ( extension.Icmp( GLTF_GLB_EXT ) == 0 ) || ( extension.Icmp( GLTF_EXT ) == 0 ) ) { model = new( TAG_MODEL ) idRenderModelGLTF; - } // RB: Collada DAE and Wavefront OBJ else if( ( extension.Icmp( "dae" ) == 0 ) || ( extension.Icmp( "obj" ) == 0 ) // RB: Collada DAE and Wavefront OBJ diff --git a/neo/renderer/Model_gltf.cpp b/neo/renderer/Model_gltf.cpp index 7e6ac464..1e4b0c3f 100644 --- a/neo/renderer/Model_gltf.cpp +++ b/neo/renderer/Model_gltf.cpp @@ -152,6 +152,7 @@ void idRenderModelGLTF::MakeMD5Mesh( ) //If no nodeName/nodeId is given, all primitives active in default scene will be added as surfaces. void idRenderModelGLTF::InitFromFile( const char* fileName ) { + name = fileName; hasAnimations = false; fileExclusive = false; root = nullptr; @@ -266,6 +267,7 @@ bool idRenderModelGLTF::LoadBinaryModel( idFile* file, const ID_TIME_T sourceTim #if 1 idStr dataFilename; file->ReadString( dataFilename ); + name = dataFilename; if( gltfParser->currentFile.Length( ) ) { @@ -429,18 +431,23 @@ void idRenderModelGLTF::CreateBuffers() void idRenderModelGLTF::Print() const { - common->Warning( "The method or operation is not implemented." ); + idRenderModelStatic::Print(); + + // TODO } void idRenderModelGLTF::List() const { - common->Warning( "The method or operation is not implemented." ); + idRenderModelStatic::List(); + + // TODO } int idRenderModelGLTF::Memory() const { - common->Warning( "The method or operation is not implemented." ); - return -1; + return idRenderModelStatic::Memory(); + + // TODO } dynamicModel_t idRenderModelGLTF::IsDynamicModel() const