Fixes https://gitlab.com/xonotic/darkplaces/-/issues/366
Starting CL_MeshEntities any later can cause the bug during r_restart.
ca03733fba98709e25d9a02882ac947f4144af6a effectively added dependency
of the Models module on the CL_MeshEntities module,
at least in certain situations where starting the Models module
results in calls to Draw_CachePic() and DrawQ_*()
which trigger the bug when they call Mod_Mesh_GetTexture().
Signed-off-by: bones_was_here <bones_was_here@xa.org.au>
}
}
-static void CL_MeshEntities_Init(void)
+void CL_MeshEntities_Init(void)
{
int i;
entity_t *ent;
CL_UpdateRenderEntity(&ent->render);
}
cl_meshentities[MESH_UI].render.flags = RENDER_NOSELFSHADOW;
- R_RegisterModule("cl_meshentities", CL_MeshEntities_Start, CL_MeshEntities_Shutdown, CL_MeshEntities_Restart, CL_MeshEntities_Restart, CL_MeshEntities_Restart);
+ R_RegisterModule("CL_MeshEntities", CL_MeshEntities_Start, CL_MeshEntities_Shutdown, CL_MeshEntities_Restart, CL_MeshEntities_Restart, CL_MeshEntities_Restart);
}
void CL_MeshEntities_Scene_Clear(void)
CL_Parse_Init();
CL_Particles_Init();
CL_Screen_Init();
- CL_MeshEntities_Init();
CL_Video_Init();
extern const char *cl_meshentitynames[NUM_MESHENTITIES];
#define CL_Mesh_Scene() (&cl_meshentitymodels[MESH_SCENE])
#define CL_Mesh_UI() (&cl_meshentitymodels[MESH_UI])
+void CL_MeshEntities_Init(void);
void CL_MeshEntities_Scene_Clear(void);
void CL_MeshEntities_Scene_AddRenderEntity(void);
void CL_MeshEntities_Scene_FinalizeRenderEntity(void);
R_Particles_Init();
R_Explosion_Init();
R_LightningBeams_Init();
+ CL_MeshEntities_Init();
Mod_RenderInit();
}