From dd712a0df9e4b963e895bec7ffb664f3d68e2d70 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 14 Apr 2026 21:23:56 +0500 Subject: [PATCH] engine: update Mod_PointInLeaf signature for RefAPI --- engine/client/ref_common.c | 7 +------ engine/ref_api.h | 2 +- ref/gl/gl_rmain.c | 2 +- ref/gl/gl_rsurf.c | 2 +- ref/soft/r_main.c | 2 +- ref/soft/r_misc.c | 2 +- 6 files changed, 6 insertions(+), 11 deletions(-) diff --git a/engine/client/ref_common.c b/engine/client/ref_common.c index 197fc57c..03933cac 100644 --- a/engine/client/ref_common.c +++ b/engine/client/ref_common.c @@ -322,11 +322,6 @@ static qboolean R_Init_Video_( ref_graphic_apis_t type ) return R_Init_Video( type ); } -static mleaf_t *pfnMod_PointInLeaf( const vec3_t p, mnode_t *node ) -{ - // FIXME: get rid of this on next RefAPI update - return Mod_PointInLeaf( p, node, cl.models[1] ); -} static const ref_api_t gEngfuncs = { @@ -368,7 +363,7 @@ static const ref_api_t gEngfuncs = Mod_SampleSizeForFace, Mod_BoxVisible, - pfnMod_PointInLeaf, + Mod_PointInLeaf, R_DrawWorldHull, R_DrawModelHull, diff --git a/engine/ref_api.h b/engine/ref_api.h index 4567ac7c..571946bf 100644 --- a/engine/ref_api.h +++ b/engine/ref_api.h @@ -397,7 +397,7 @@ typedef struct ref_api_s // brushes int (*Mod_SampleSizeForFace)( const struct msurface_s *surf ); qboolean (*Mod_BoxVisible)( const vec3_t mins, const vec3_t maxs, const byte *visbits ); - mleaf_t *(*Mod_PointInLeaf)( const vec3_t p, mnode_t *node ); + mleaf_t *(*Mod_PointInLeaf)( const vec3_t p, mnode_t *node, struct model_s *mod ); void (*R_DrawWorldHull)( void ); void (*R_DrawModelHull)( model_t *mod ); diff --git a/ref/gl/gl_rmain.c b/ref/gl/gl_rmain.c index cac9f83f..fcfcf638 100644 --- a/ref/gl/gl_rmain.c +++ b/ref/gl/gl_rmain.c @@ -511,7 +511,7 @@ R_FindViewLeaf void R_FindViewLeaf( void ) { RI.oldviewleaf = RI.viewleaf; - RI.viewleaf = gEngfuncs.Mod_PointInLeaf( RI.rvp.vieworigin, WORLDMODEL->nodes ); + RI.viewleaf = gEngfuncs.Mod_PointInLeaf( RI.rvp.vieworigin, WORLDMODEL->nodes, WORLDMODEL ); } /* diff --git a/ref/gl/gl_rsurf.c b/ref/gl/gl_rsurf.c index cbe4d82d..e39cd644 100644 --- a/ref/gl/gl_rsurf.c +++ b/ref/gl/gl_rsurf.c @@ -3770,7 +3770,7 @@ void R_MarkLeaves( void ) else VectorSet( test, RI.rvp.vieworigin[0], RI.rvp.vieworigin[1], RI.rvp.vieworigin[2] + 16.0f ); - leaf = gEngfuncs.Mod_PointInLeaf( test, WORLDMODEL->nodes ); + leaf = gEngfuncs.Mod_PointInLeaf( test, WORLDMODEL->nodes, WORLDMODEL ); if(( leaf->contents != CONTENTS_SOLID ) && ( RI.viewleaf != leaf )) force = true; diff --git a/ref/soft/r_main.c b/ref/soft/r_main.c index 3d63ea12..ebae4757 100644 --- a/ref/soft/r_main.c +++ b/ref/soft/r_main.c @@ -474,7 +474,7 @@ R_FindViewLeaf void R_FindViewLeaf( void ) { RI.oldviewleaf = RI.viewleaf; - RI.viewleaf = gEngfuncs.Mod_PointInLeaf( RI.rvp.vieworigin, WORLDMODEL->nodes ); + RI.viewleaf = gEngfuncs.Mod_PointInLeaf( RI.rvp.vieworigin, WORLDMODEL->nodes, WORLDMODEL ); } /* diff --git a/ref/soft/r_misc.c b/ref/soft/r_misc.c index 7a95ee22..8ca0531f 100644 --- a/ref/soft/r_misc.c +++ b/ref/soft/r_misc.c @@ -293,7 +293,7 @@ void R_SetupFrameQ( void ) // current viewleaf if( FBitSet( RI.rvp.flags, RF_DRAW_WORLD )) { - RI.viewleaf = gEngfuncs.Mod_PointInLeaf( RI.rvp.vieworigin, WORLDMODEL->nodes ); + RI.viewleaf = gEngfuncs.Mod_PointInLeaf( RI.rvp.vieworigin, WORLDMODEL->nodes, WORLDMODEL ); r_viewcluster = RI.viewleaf->cluster; }