Try to fix purecsqc map loading issues.
This commit is contained in:
parent
f2d54f30d8
commit
e104d6cf58
3 changed files with 30 additions and 10 deletions
|
@ -1452,7 +1452,7 @@ qboolean CL_MayLerp(void);
|
||||||
//
|
//
|
||||||
#ifdef CSQC_DAT
|
#ifdef CSQC_DAT
|
||||||
qboolean CSQC_Inited(void);
|
qboolean CSQC_Inited(void);
|
||||||
void CSQC_RendererRestarted(void);
|
void CSQC_RendererRestarted(qboolean initing);
|
||||||
qboolean CSQC_UnconnectedOkay(qboolean inprinciple);
|
qboolean CSQC_UnconnectedOkay(qboolean inprinciple);
|
||||||
qboolean CSQC_UnconnectedInit(void);
|
qboolean CSQC_UnconnectedInit(void);
|
||||||
qboolean CSQC_CheckDownload(const char *name, unsigned int checksum, size_t checksize); //reports whether we already have a usable csprogs.dat
|
qboolean CSQC_CheckDownload(const char *name, unsigned int checksum, size_t checksize); //reports whether we already have a usable csprogs.dat
|
||||||
|
|
|
@ -793,7 +793,7 @@ static model_t *CSQC_GetModelForIndex(int index)
|
||||||
else if (index < 0 && index > -MAX_CSMODELS)
|
else if (index < 0 && index > -MAX_CSMODELS)
|
||||||
{
|
{
|
||||||
if (!cl.model_csqcprecache[-index])
|
if (!cl.model_csqcprecache[-index])
|
||||||
cl.model_csqcprecache[-index] = Mod_ForName(Mod_FixName(cl.model_csqcname[-index], csqc_world.worldmodel->publicname), MLV_WARN);
|
cl.model_csqcprecache[-index] = Mod_ForName(Mod_FixName(cl.model_csqcname[-index], csqc_world.worldmodel?csqc_world.worldmodel->publicname:NULL), MLV_WARN);
|
||||||
return cl.model_csqcprecache[-index];
|
return cl.model_csqcprecache[-index];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2770,7 +2770,8 @@ static void QCBUILTIN PF_R_RenderScene(pubprogfuncs_t *prinst, struct globalvars
|
||||||
{
|
{
|
||||||
csqc_worldchanged = false;
|
csqc_worldchanged = false;
|
||||||
cl.worldmodel = r_worldentity.model = csqc_world.worldmodel;
|
cl.worldmodel = r_worldentity.model = csqc_world.worldmodel;
|
||||||
FS_LoadMapPackFile(cl.worldmodel->name, cl.worldmodel->archive);
|
if (cl.worldmodel)
|
||||||
|
FS_LoadMapPackFile(cl.worldmodel->name, cl.worldmodel->archive);
|
||||||
Surf_NewMap(csqc_world.worldmodel);
|
Surf_NewMap(csqc_world.worldmodel);
|
||||||
CL_UpdateWindowTitle();
|
CL_UpdateWindowTitle();
|
||||||
|
|
||||||
|
@ -8552,7 +8553,7 @@ qboolean CSQC_Init (qboolean anycsqc, const char *csprogsname, unsigned int chec
|
||||||
|
|
||||||
csqc_world.physicstime = 0.1;
|
csqc_world.physicstime = 0.1;
|
||||||
|
|
||||||
CSQC_RendererRestarted();
|
CSQC_RendererRestarted(true);
|
||||||
|
|
||||||
if (cls.state == ca_disconnected)
|
if (cls.state == ca_disconnected)
|
||||||
CSQC_WorldLoaded();
|
CSQC_WorldLoaded();
|
||||||
|
@ -8561,17 +8562,36 @@ qboolean CSQC_Init (qboolean anycsqc, const char *csprogsname, unsigned int chec
|
||||||
return true; //success!
|
return true; //success!
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSQC_RendererRestarted(void)
|
void CSQC_RendererRestarted(qboolean initing)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
if (!csqcprogs)
|
if (!csqcprogs)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
csqc_world.worldmodel = cl.worldmodel;
|
if (initing)
|
||||||
|
|
||||||
for (i = 0; i < MAX_CSMODELS; i++)
|
|
||||||
{
|
{
|
||||||
cl.model_csqcprecache[i] = NULL;
|
//called at startup
|
||||||
|
if (csqc_worldchanged)
|
||||||
|
{
|
||||||
|
csqc_worldchanged = false;
|
||||||
|
cl.worldmodel = r_worldentity.model = csqc_world.worldmodel;
|
||||||
|
if (cl.worldmodel)
|
||||||
|
FS_LoadMapPackFile(cl.worldmodel->name, cl.worldmodel->archive);
|
||||||
|
Surf_NewMap(csqc_world.worldmodel);
|
||||||
|
CL_UpdateWindowTitle();
|
||||||
|
|
||||||
|
World_RBE_Shutdown(&csqc_world);
|
||||||
|
World_RBE_Start(&csqc_world);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ //FIXME: this might be awkward in the purecsqc case.
|
||||||
|
csqc_world.worldmodel = cl.worldmodel;
|
||||||
|
|
||||||
|
for (i = 0; i < MAX_CSMODELS; i++)
|
||||||
|
{
|
||||||
|
cl.model_csqcprecache[i] = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//FIXME: registered shaders
|
//FIXME: registered shaders
|
||||||
|
|
|
@ -1895,7 +1895,7 @@ TRACE(("dbg: R_ApplyRenderer: efrags\n"));
|
||||||
#endif
|
#endif
|
||||||
#ifdef CSQC_DAT
|
#ifdef CSQC_DAT
|
||||||
Shader_DoReload();
|
Shader_DoReload();
|
||||||
CSQC_RendererRestarted();
|
CSQC_RendererRestarted(false);
|
||||||
#endif
|
#endif
|
||||||
#ifdef MENU_DAT
|
#ifdef MENU_DAT
|
||||||
MP_RendererRestarted();
|
MP_RendererRestarted();
|
||||||
|
|
Loading…
Reference in a new issue