Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.1 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose : Singleton manager for color correction on the client
  4. //
  5. // $NoKeywords: $
  6. //===========================================================================//
  7. #include "cbase.h"
  8. #include "spatialentitymgr.h"
  9. #include "c_spatialentity.h"
  10. // Gets called each frame
  11. void CSpatialEntityMgr::Update( float frametime )
  12. {
  13. if ( m_SpatialEntities.Count() <= 0 )
  14. return;
  15. m_SpatialEntities[ 0 ]->ResetAccumulation();
  16. for ( int i = 0; i < m_SpatialEntities.Count(); ++i )
  17. {
  18. m_SpatialEntities[ i ]->Accumulate();
  19. }
  20. m_SpatialEntities[ 0 ]->ApplyAccumulation();
  21. }
  22. //------------------------------------------------------------------------------
  23. // Creates, destroys spatial entities
  24. //------------------------------------------------------------------------------
  25. void CSpatialEntityMgr::AddSpatialEntity( C_SpatialEntity *pSpatialEntity )
  26. {
  27. m_SpatialEntities.AddToTail( pSpatialEntity );
  28. }
  29. void CSpatialEntityMgr::RemoveSpatialEntity( C_SpatialEntity *pSpatialEntity )
  30. {
  31. m_SpatialEntities.FindAndRemove( pSpatialEntity );
  32. }