mirror of
https://github.com/FWGS/xash3d-fwgs
synced 2024-11-22 01:45:19 +01:00
engine: client: implement v_dark in engine, instead of making it ref-specific
This commit is contained in:
parent
bd3dc71f39
commit
cb3b16e2ec
@ -1543,6 +1543,42 @@ void CL_SendConsistencyInfo( sizebuf_t *msg )
|
||||
MSG_WriteOneBit( msg, 0 );
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
CL_StartDark
|
||||
==================
|
||||
*/
|
||||
static void CL_StartDark( void )
|
||||
{
|
||||
if( Cvar_VariableValue( "v_dark" ))
|
||||
{
|
||||
screenfade_t *sf = &clgame.fade;
|
||||
float fadetime = 5.0f;
|
||||
client_textmessage_t *title;
|
||||
|
||||
title = CL_TextMessageGet( "GAMETITLE" );
|
||||
if( Host_IsQuakeCompatible( ))
|
||||
fadetime = 1.0f;
|
||||
|
||||
if( title )
|
||||
{
|
||||
// get settings from titles.txt
|
||||
sf->fadeEnd = title->holdtime + title->fadeout;
|
||||
sf->fadeReset = title->fadeout;
|
||||
}
|
||||
else sf->fadeEnd = sf->fadeReset = fadetime;
|
||||
|
||||
sf->fadeFlags = FFADE_IN;
|
||||
sf->fader = sf->fadeg = sf->fadeb = 0;
|
||||
sf->fadealpha = 255;
|
||||
sf->fadeSpeed = (float)sf->fadealpha / sf->fadeReset;
|
||||
sf->fadeReset += cl.time;
|
||||
sf->fadeEnd += sf->fadeReset;
|
||||
|
||||
Cvar_SetValue( "v_dark", 0.0f );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
CL_RegisterResources
|
||||
@ -1592,6 +1628,9 @@ void CL_RegisterResources( sizebuf_t *msg )
|
||||
// tell rendering system we have a new set of models.
|
||||
ref.dllFuncs.R_NewMap ();
|
||||
|
||||
// check if this map must start from dark screen
|
||||
CL_StartDark ();
|
||||
|
||||
CL_SetupOverviewParams();
|
||||
|
||||
// release unused SpriteTextures
|
||||
|
@ -124,34 +124,6 @@ void R_NewMap( void )
|
||||
R_ParseDetailTextures( filepath );
|
||||
}
|
||||
|
||||
if( gEngfuncs.pfnGetCvarFloat( "v_dark" ))
|
||||
{
|
||||
screenfade_t *sf = gEngfuncs.GetScreenFade();
|
||||
float fadetime = 5.0f;
|
||||
client_textmessage_t *title;
|
||||
|
||||
title = gEngfuncs.pfnTextMessageGet( "GAMETITLE" );
|
||||
if( ENGINE_GET_PARM( PARM_QUAKE_COMPATIBLE ))
|
||||
fadetime = 1.0f;
|
||||
|
||||
if( title )
|
||||
{
|
||||
// get settings from titles.txt
|
||||
sf->fadeEnd = title->holdtime + title->fadeout;
|
||||
sf->fadeReset = title->fadeout;
|
||||
}
|
||||
else sf->fadeEnd = sf->fadeReset = fadetime;
|
||||
|
||||
sf->fadeFlags = FFADE_IN;
|
||||
sf->fader = sf->fadeg = sf->fadeb = 0;
|
||||
sf->fadealpha = 255;
|
||||
sf->fadeSpeed = (float)sf->fadealpha / sf->fadeReset;
|
||||
sf->fadeReset += gpGlobals->time;
|
||||
sf->fadeEnd += sf->fadeReset;
|
||||
|
||||
gEngfuncs.Cvar_SetValue( "v_dark", 0.0f );
|
||||
}
|
||||
|
||||
// clear out efrags in case the level hasn't been reloaded
|
||||
for( i = 0; i < WORLDMODEL->numleafs; i++ )
|
||||
WORLDMODEL->leafs[i+1].efrags = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user