ref: gl: cache worldmodel pointer instead of accessing it through gp_cl pointer

This commit is contained in:
Alibek Omarov
2026-04-06 11:07:08 +05:00
parent 9d22827395
commit abda0a07c2
2 changed files with 4 additions and 1 deletions

View File

@@ -249,6 +249,7 @@ typedef struct
vec3_t modelorg; // relative to viewpoint
// get from engine
model_t *worldmodel;
world_static_t *world;
cl_entity_t *entities;
movevars_t *movevars;
@@ -770,7 +771,7 @@ static inline int GL_MaxTextureUnits( void )
return Q_min( glConfig.max_texture_units, MAX_TEXTURE_UNITS );
}
#define WORLDMODEL (gp_cl->models[1])
#define WORLDMODEL (tr.worldmodel)
//
// renderer cvars

View File

@@ -108,6 +108,8 @@ void R_NewMap( void )
texture_t *tx;
int i;
tr.worldmodel = gp_cl->models[1];
R_ClearDecals(); // clear all level decals
R_StudioResetPlayerModels();