From cff276db71cbe41a728db56f0cf921c027c55cad Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 28 Oct 2023 15:35:20 +0300 Subject: [PATCH] engine: client: mod_dbghulls: reduce dependency on global loadmodel pointer --- engine/client/mod_dbghulls.c | 2 +- engine/common/mod_bmodel.c | 2 +- engine/common/mod_local.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/client/mod_dbghulls.c b/engine/client/mod_dbghulls.c index e1c7e6f2..3b5dd2b5 100644 --- a/engine/client/mod_dbghulls.c +++ b/engine/client/mod_dbghulls.c @@ -659,7 +659,7 @@ static void make_hull_windings( hull_t *hull, hull_model_t *model ) Con_Reportf( "%i hull polys\n", model->num_polys ); } -void Mod_InitDebugHulls( void ) +void Mod_InitDebugHulls( model_t *loadmodel ) { int i; diff --git a/engine/common/mod_bmodel.c b/engine/common/mod_bmodel.c index 0c57d5ae..6fd1aad4 100644 --- a/engine/common/mod_bmodel.c +++ b/engine/common/mod_bmodel.c @@ -2989,7 +2989,7 @@ qboolean Mod_LoadBmodelLumps( const byte *mod_base, qboolean isworld ) { loadmodel = mod; // restore pointer to world #if !XASH_DEDICATED - Mod_InitDebugHulls(); // FIXME: build hulls for separate bmodels (shells, medkits etc) + Mod_InitDebugHulls( mod ); // FIXME: build hulls for separate bmodels (shells, medkits etc) world.deluxedata = bmod->deluxedata_out; // deluxemap data pointer world.shadowdata = bmod->shadowdata_out; // occlusion data pointer #endif // XASH_DEDICATED diff --git a/engine/common/mod_local.h b/engine/common/mod_local.h index 40a34ce4..d4a0a544 100644 --- a/engine/common/mod_local.h +++ b/engine/common/mod_local.h @@ -164,7 +164,7 @@ void Mod_PrintWorldStats_f( void ); // // mod_dbghulls.c // -void Mod_InitDebugHulls( void ); +void Mod_InitDebugHulls( model_t *mod ); void Mod_CreatePolygonsForHull( int hullnum ); void Mod_ReleaseHullPolygons( void );