[client] Clean up a stray reference to the renderer

Reaching into the renderer internals for r_worldmodel doesn't work when
the plugins are not static.
This commit is contained in:
Bill Currie 2021-12-21 00:36:42 +09:00
parent 194f958666
commit 2d109e615b
4 changed files with 22 additions and 5 deletions

View file

@ -71,4 +71,7 @@ extern float cl_realtime;
void CL_Particles_Init (void);
struct model_s;
void CL_LoadPointFile (const struct model_s *model);
#endif // __client_particles_h_

View file

@ -222,15 +222,15 @@ add_particle (ptype_t type, vec4f_t pos, vec4f_t vel, float live, int color,
particle_new (type, part_tex_dot, pos, 1, vel, live, color, 1, ramp);
}
static void
pointfile_f (void)
void
CL_LoadPointFile (const model_t *model)
{
const char *name;
char *mapname;
int c;
QFile *f;
mapname = strdup (r_worldentity.renderer.model->path);
mapname = strdup (model->path);
if (!mapname)
Sys_Error ("Can't duplicate mapname!");
QFS_StripExtension (mapname, mapname);
@ -1272,8 +1272,6 @@ CL_Particles_Init (void)
{
mtwist_seed (&mt, 0xdeadbeef);
cl_psystem = r_funcs->ParticleSystem ();
Cmd_AddCommand ("pointfile", pointfile_f,
"Load a pointfile to determine map leaks.");
easter_eggs = Cvar_Get ("easter_eggs", "0", CVAR_NONE, easter_eggs_f,
"Enables easter eggs.");
particles_style = Cvar_Get ("particles_style", "1", CVAR_ARCHIVE,

View file

@ -424,6 +424,12 @@ CL_NextDemo (void)
cls.demonum++;
}
static void
pointfile_f (void)
{
CL_LoadPointFile (cl.worldmodel);
}
static void
CL_PrintEntities_f (void)
{
@ -604,6 +610,8 @@ CL_Init (cbuf_t *cbuf)
V_Init ();
Cmd_AddCommand ("pointfile", pointfile_f,
"Load a pointfile to determine map leaks.");
Cmd_AddCommand ("entities", CL_PrintEntities_f, "No Description");
Cmd_AddCommand ("disconnect", CL_Disconnect_f, "No Description");
Cmd_AddCommand ("maplist", Con_Maplist_f, "List available maps");

View file

@ -237,6 +237,12 @@ CL_Quit_f (void)
Sys_Quit ();
}
static void
pointfile_f (void)
{
CL_LoadPointFile (cl.worldmodel);
}
static void
CL_Version_f (void)
{
@ -1229,6 +1235,8 @@ CL_Init (void)
cl.players = calloc (MAX_CLIENTS, sizeof (player_info_t));
// register our commands
Cmd_AddCommand ("pointfile", pointfile_f,
"Load a pointfile to determine map leaks.");
Cmd_AddCommand ("version", CL_Version_f, "Report version information");
Cmd_AddCommand ("changing", CL_Changing_f, "Used when maps are changing");
Cmd_AddCommand ("disconnect", CL_Disconnect_f, "Disconnect from server");