//----------------------------------------------------------------------------- // Purpose: Input handler that does the screen fade. //----------------------------------------------------------------------------- void CEnvFade::InputFade( inputdata_t &inputdata ) { int fadeFlags = 0; if ( m_spawnflags & SF_FADE_IN ) { fadeFlags |= FFADE_IN; } else { fadeFlags |= FFADE_OUT; } if ( m_spawnflags & SF_FADE_MODULATE ) { fadeFlags |= FFADE_MODULATE; } if ( m_spawnflags & SF_FADE_ONLYONE ) { if ( inputdata.pActivator->IsNetClient() ) { UTIL_ScreenFade( inputdata.pActivator, m_clrRender, Duration(), HoldTime(), fadeFlags ); } } else { UTIL_ScreenFadeAll( m_clrRender, Duration(), HoldTime(), fadeFlags ); } m_OnBeginFade.FireOutput( inputdata.pActivator, this ); }
//----------------------------------------------------------------------------- // Purpose: Input handler that does the screen fade. //----------------------------------------------------------------------------- void CEnvFade::InputFade( inputdata_t &inputdata ) { int fadeFlags = 0; if ( m_spawnflags & SF_FADE_IN ) { fadeFlags |= FFADE_IN; } else { fadeFlags |= FFADE_OUT; } if ( m_spawnflags & SF_FADE_MODULATE ) { fadeFlags |= FFADE_MODULATE; } if ( m_spawnflags & SF_FADE_STAYOUT ) { fadeFlags |= FFADE_STAYOUT; } if ( m_spawnflags & SF_FADE_ONLYONE ) { #ifdef INFESTED_DLL //if ( inputdata.pActivator->Classify() == CLASS_ASW_MARINE ) //{ // CASW_Marine *pMarine = static_cast<CASW_Marine*>( inputdata.pActivator ); // CASW_Player *pPlayer = pMarine->GetCommander(); // if ( pPlayer && pMarine->IsInhabited() ) // { // UTIL_ScreenFade( pPlayer, m_clrRender, Duration(), HoldTime(), fadeFlags ); // } //} #else if ( inputdata.pActivator->IsNetClient() ) { UTIL_ScreenFade( inputdata.pActivator, m_clrRender, Duration(), HoldTime(), fadeFlags ); } #endif } else { UTIL_ScreenFadeAll( m_clrRender, Duration(), HoldTime(), fadeFlags|FFADE_PURGE ); } m_OnBeginFade.FireOutput( inputdata.pActivator, this ); }
void CFade::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) { int fadeFlags = 0; if ( !(pev->spawnflags & SF_FADE_IN) ) fadeFlags |= FFADE_OUT; if ( pev->spawnflags & SF_FADE_MODULATE ) fadeFlags |= FFADE_MODULATE; if ( pev->spawnflags & SF_FADE_ONLYONE ) { if ( pActivator->IsNetClient() ) { UTIL_ScreenFade( pActivator, pev->rendercolor, Duration(), HoldTime(), pev->renderamt, fadeFlags ); } } else { UTIL_ScreenFadeAll( pev->rendercolor, Duration(), HoldTime(), pev->renderamt, fadeFlags ); } SUB_UseTargets( this, USE_TOGGLE, 0 ); }