From 52a99ea5f67c8e6ad10a77bb83f002ec9f2f2ed0 Mon Sep 17 00:00:00 2001 From: Robert Beckebans Date: Sun, 19 Jun 2022 22:25:33 +0200 Subject: [PATCH 1/2] Astyle --- neo/renderer/Model_gltf.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/neo/renderer/Model_gltf.cpp b/neo/renderer/Model_gltf.cpp index 05835304..68bb4d5b 100644 --- a/neo/renderer/Model_gltf.cpp +++ b/neo/renderer/Model_gltf.cpp @@ -50,7 +50,7 @@ MapPolygonMesh* MapPolygonMesh::ConvertFromMeshGltf( const gltfMesh_Primitive* p gltfAccessor* accessor = _data->AccessorList()[prim->indices]; gltfBufferView* bv = _data->BufferViewList()[accessor->bufferView]; gltfData* data = bv->parent; - + // files import as y-up. Use this transform to change the model to z-up. idMat3 rotation = idAngles( 0.0f, 0.0f, 90.0f ).ToMat3( ); idMat4 axisTransform( rotation, vec3_origin ); @@ -317,7 +317,7 @@ void ProcessSceneNode( idMapEntity* newEntity, gltfNode* node, idMat4& trans, gl origin.y = node->translation.y; origin.z = node->translation.z; #endif - + // files import as y-up. Use this transform to change the model to z-up. idMat3 rotation = idAngles( 0.0f, 0.0f, 90.0f ).ToMat3( ); idMat4 axisTransform( rotation, vec3_origin ); @@ -445,7 +445,7 @@ void idRenderModelGLTF::ProcessNode( gltfNode* modelNode, idMat4 trans, gltfData gltfData::ResolveNodeMatrix( modelNode ); idMat4 curTrans = trans * modelNode->matrix; - gltfMesh *targetMesh = meshList[modelNode->mesh]; + gltfMesh* targetMesh = meshList[modelNode->mesh]; for( auto prim : targetMesh->primitives ) { @@ -522,7 +522,7 @@ void idRenderModelGLTF::InitFromFile( const char* fileName ) } gltfParser->Load( gltfFileName ); } - else + else { gltfParser->Load( gltfFileName ); } @@ -532,32 +532,33 @@ void idRenderModelGLTF::InitFromFile( const char* fileName ) gltfData* data = gltfParser->currentAsset; bounds.Clear(); - + int sceneId = data->DefaultScene(); assert( sceneId >= 0 ); - if ( !meshName[0] ) + if( !meshName[0] ) { - auto & nodeList = data->NodeList(); + auto& nodeList = data->NodeList(); for( auto& nodeID : data->SceneList()[sceneId]->nodes ) { - gltfNode *modelNode = nodeList[nodeID]; - assert ( modelNode ); + gltfNode* modelNode = nodeList[nodeID]; + assert( modelNode ); ProcessNode( modelNode, mat4_identity, data ); } } else { - gltfNode *modelNode = data->GetNode( "models", meshName ); - if ( modelNode ) + gltfNode* modelNode = data->GetNode( "models", meshName ); + if( modelNode ) { ProcessNode( modelNode, mat4_identity, data ); } } - if ( surfaces.Num( ) <= 0 ) { + if( surfaces.Num( ) <= 0 ) + { common->Warning( "Couldn't load model: '%s'", name.c_str( ) ); MakeDefaultModel( ); return; From 57b0b9620f97102afba86695d1b27d97a3001ea4 Mon Sep 17 00:00:00 2001 From: Robert Beckebans Date: Mon, 20 Jun 2022 20:55:50 +0200 Subject: [PATCH 2/2] Fixed idassert in Release builds --- neo/idlib/gltfParser.h | 28 ++++++++++++++++++++++++++++ neo/idlib/sys/sys_assert.h | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/neo/idlib/gltfParser.h b/neo/idlib/gltfParser.h index fe1685f3..4b30d436 100644 --- a/neo/idlib/gltfParser.h +++ b/neo/idlib/gltfParser.h @@ -1,3 +1,31 @@ +/* +=========================================================================== + +Doom 3 BFG Edition GPL Source Code +Copyright (C) 2022 Harrie van Ginneken + +This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code"). + +Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Doom 3 BFG Edition Source Code. If not, see . + +In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below. + +If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. + +=========================================================================== +*/ + #pragma once #include "containers/StrList.h" #include diff --git a/neo/idlib/sys/sys_assert.h b/neo/idlib/sys/sys_assert.h index 6db64f25..045a23b8 100644 --- a/neo/idlib/sys/sys_assert.h +++ b/neo/idlib/sys/sys_assert.h @@ -71,7 +71,7 @@ bool AssertFailed( const char* file, int line, const char* expression ); //====================== assert in release mode ======================= - #define idassert( x ) { (()0); } + #define idassert( x ) { ( ( void )0 ); } #undef assert