mirror of
https://github.com/jmarshall23/DoomRTX.git
synced 2026-08-16 00:01:53 +02:00
Added setAnim to camera. Added global fog set via worldspawn.
This commit is contained in:
@@ -49,6 +49,41 @@ CLASS_DECLARATION( idEntity, idWorldspawn )
|
||||
EVENT( EV_SafeRemove, idWorldspawn::Event_Remove )
|
||||
END_CLASS
|
||||
|
||||
static renderGlobalFogMode_t ParseGlobalFogMode( const char *mode ) {
|
||||
if ( !idStr::Icmp( mode, "linear" ) ) {
|
||||
return RENDER_GLOBAL_FOG_LINEAR;
|
||||
}
|
||||
if ( !idStr::Icmp( mode, "exp2" ) ) {
|
||||
return RENDER_GLOBAL_FOG_EXP2;
|
||||
}
|
||||
return RENDER_GLOBAL_FOG_EXP;
|
||||
}
|
||||
|
||||
static void SetWorldspawnGlobalFogParms( const idDict &spawnArgs ) {
|
||||
idVec3 color;
|
||||
idStr mode;
|
||||
|
||||
memset( &gameLocal.globalFogParms, 0, sizeof( gameLocal.globalFogParms ) );
|
||||
gameLocal.globalFogParms.mode = RENDER_GLOBAL_FOG_EXP;
|
||||
gameLocal.globalFogParms.density = 1.0f;
|
||||
gameLocal.globalFogParms.end = 1.0f;
|
||||
gameLocal.globalFogParms.color.Set( 0.0f, 0.0f, 0.0f, 1.0f );
|
||||
|
||||
gameLocal.globalFogParms.enabled = spawnArgs.GetBool( "globalFog", spawnArgs.GetString( "fog_global", "0" ) );
|
||||
|
||||
if ( spawnArgs.GetString( "globalFogMode", "", mode ) || spawnArgs.GetString( "fog_mode", "", mode ) ) {
|
||||
gameLocal.globalFogParms.mode = ParseGlobalFogMode( mode.c_str() );
|
||||
}
|
||||
|
||||
gameLocal.globalFogParms.density = spawnArgs.GetFloat( "globalFogDensity", spawnArgs.GetString( "fog_density", va( "%f", gameLocal.globalFogParms.density ) ) );
|
||||
gameLocal.globalFogParms.start = spawnArgs.GetFloat( "globalFogStart", spawnArgs.GetString( "fog_start", va( "%f", gameLocal.globalFogParms.start ) ) );
|
||||
gameLocal.globalFogParms.end = spawnArgs.GetFloat( "globalFogEnd", spawnArgs.GetString( "fog_end", va( "%f", gameLocal.globalFogParms.end ) ) );
|
||||
|
||||
if ( spawnArgs.GetVector( "globalFogColor", spawnArgs.GetString( "fog_color", "0 0 0" ), color ) ) {
|
||||
gameLocal.globalFogParms.color.Set( color.x, color.y, color.z, spawnArgs.GetFloat( "globalFogAlpha", spawnArgs.GetString( "fog_alpha", "1" ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
idWorldspawn::Spawn
|
||||
@@ -64,6 +99,7 @@ void idWorldspawn::Spawn( void ) {
|
||||
gameLocal.world = this;
|
||||
|
||||
g_gravity.SetFloat( spawnArgs.GetFloat( "gravity", va( "%f", DEFAULT_GRAVITY ) ) );
|
||||
SetWorldspawnGlobalFogParms( spawnArgs );
|
||||
|
||||
// disable stamina on hell levels
|
||||
if ( spawnArgs.GetBool( "no_stamina" ) ) {
|
||||
@@ -115,6 +151,7 @@ void idWorldspawn::Restore( idRestoreGame *savefile ) {
|
||||
assert( gameLocal.world == this );
|
||||
|
||||
g_gravity.SetFloat( spawnArgs.GetFloat( "gravity", va( "%f", DEFAULT_GRAVITY ) ) );
|
||||
SetWorldspawnGlobalFogParms( spawnArgs );
|
||||
|
||||
// disable stamina on hell levels
|
||||
if ( spawnArgs.GetBool( "no_stamina" ) ) {
|
||||
|
||||
Reference in New Issue
Block a user