1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-09-19 20:16:10 +08:00

Added original SDK code for Alien Swarm.

This commit is contained in:
Scott Ehlert
2010-07-22 01:46:14 -05:00
commit c0a96ff1e8
3740 changed files with 1243478 additions and 0 deletions

View File

@ -0,0 +1,49 @@
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#include "cbase.h"
#include "ParticleSphereRenderer.h"
#include "materialsystem/IMaterialVar.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
CParticleSphereRenderer::CParticleSphereRenderer()
{
m_vBaseColor.Init();
memset( &m_AmbientLight, 0, sizeof( m_AmbientLight ) );
memset( &m_DirectionalLight, 0, sizeof( m_DirectionalLight ) );
m_bUsingPixelShaders = false;
m_iLastTickStartRenderCalled = -1;
m_pParticleMgr = NULL;
}
void CParticleSphereRenderer::Init( CParticleMgr *pParticleMgr, IMaterial *pMaterial )
{
m_pParticleMgr = pParticleMgr;
// Figure out how we need to draw.
bool bFound = false;
IMaterialVar *pVar = pMaterial->FindVar( "$USINGPIXELSHADER", &bFound, false );
if( bFound && pVar && pVar->GetIntValue() )
m_bUsingPixelShaders = true;
else
m_bUsingPixelShaders = false;
}
void CParticleSphereRenderer::StartRender( VMatrix &effectMatrix )
{
// We're about to be rendered.. set our directional lighting parameters for this particle system.
if ( m_pParticleMgr )
{
m_pParticleMgr->SetDirectionalLightInfo( m_DirectionalLight );
}
m_iLastTickStartRenderCalled = gpGlobals->tickcount;
}