Check for fog functions before calling them.

Not all renderers support fog.
This commit is contained in:
Bill Currie 2012-02-26 14:05:13 +09:00
parent 6ea4e6617a
commit a0e143e601
2 changed files with 6 additions and 3 deletions

View file

@ -325,7 +325,8 @@ CL_NewMap (const char *mapname)
if (cl.edicts) {
cl.worldspawn = PL_ObjectAtIndex (cl.edicts, 0);
CL_LoadSky ();
r_funcs->Fog_ParseWorldspawn (cl.worldspawn);
if (r_funcs->Fog_ParseWorldspawn)
r_funcs->Fog_ParseWorldspawn (cl.worldspawn);
}
}
@ -1141,7 +1142,8 @@ CL_ParseServerMessage (void)
blue = MSG_ReadByte (net_message) / 255.0;
time = (short) MSG_ReadShort (net_message) / 100.0;
time = max (0.0, time);
r_funcs->Fog_Update (density, red, green, blue, time);
if (r_funcs->Fog_Update)
r_funcs->Fog_Update (density, red, green, blue, time);
}
break;
case svc_spawnbaseline2:

View file

@ -312,7 +312,8 @@ CL_NewMap (const char *mapname)
if (cl.edicts) {
cl.worldspawn = PL_ObjectAtIndex (cl.edicts, 0);
CL_LoadSky ();
r_funcs->Fog_ParseWorldspawn (cl.worldspawn);
if (r_funcs->Fog_ParseWorldspawn)
r_funcs->Fog_ParseWorldspawn (cl.worldspawn);
}
}