Be warned I am a RTCW coding noob (and I haven’t touched any C in 3 years), but I wonder why this isn’t working? It’s suppossed to turn distance fog on/off fast (in 260 msec) each 6 seconds, to create a lightning effect on a fogged sky. Bet I don’t even need to have 2 functions, but still, shouldn’t it be working?
/*
CG_DrawStLightning
*/
static void CG_DrawStLightning (void)
{
int flashTime;
flashTime = cg.time + 260;
if ( cg.time >= flashTime )
{
trap_Cvar_Set("r_wolffog", "1");
}
}
/*
CG_DrawStormEffect
*/
static void CG_DrawStormEffect (void)
{
int nextTime = 0;
if ( cg.time == nextTime )
{
trap_Cvar_Set("r_wolffog", "0");
CG_DrawStLightning();
nextTime = nextTime + 6000;
}
}
CG_DrawStormEffect is being called in CG_DrawActive. All functions are in cg_draw.c.
<font size=-1>[ This Message was edited by: DiaZ on 2002-10-03 18:02 ]</font>