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.

92 lines
3.3 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose: Deals with singleton
  4. //
  5. // $Revision: $
  6. // $NoKeywords: $
  7. //===========================================================================//
  8. #if !defined( DETAILOBJECTSYSTEM_H )
  9. #define DETAILOBJECTSYSTEM_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "igamesystem.h"
  14. #include "icliententityinternal.h"
  15. #include "engine/ivmodelrender.h"
  16. #include "mathlib/vector.h"
  17. #include "ivrenderview.h"
  18. struct model_t;
  19. struct WorldListLeafData_t;
  20. struct DistanceFadeInfo_t;
  21. //-----------------------------------------------------------------------------
  22. // Info used when building lists of detail objects to render
  23. //-----------------------------------------------------------------------------
  24. struct DetailRenderableInfo_t
  25. {
  26. IClientRenderable *m_pRenderable;
  27. int m_nLeafIndex;
  28. RenderGroup_t m_nRenderGroup;
  29. RenderableInstance_t m_InstanceData;
  30. };
  31. typedef CUtlVectorFixedGrowable< DetailRenderableInfo_t, 2048 > DetailRenderableList_t;
  32. //-----------------------------------------------------------------------------
  33. // Responsible for managing detail objects
  34. //-----------------------------------------------------------------------------
  35. abstract_class IDetailObjectSystem : public IGameSystem
  36. {
  37. public:
  38. // How many detail models (as opposed to sprites) are there in the level?
  39. virtual int GetDetailModelCount() const = 0;
  40. // Gets a particular detail object
  41. virtual IClientRenderable* GetDetailModel( int idx ) = 0;
  42. // Computes the detail prop fade info
  43. virtual float ComputeDetailFadeInfo( DistanceFadeInfo_t *pInfo ) = 0;
  44. // Builds a list of renderable info for all detail objects to render
  45. virtual void BuildRenderingData( DetailRenderableList_t &list, const SetupRenderInfo_t &info, float flDetailDist, const DistanceFadeInfo_t &fadeInfo ) = 0;
  46. // Call this before rendering translucent detail objects
  47. virtual void BeginTranslucentDetailRendering( ) = 0;
  48. // Renders all translucent detail objects in a particular set of leaves
  49. virtual void RenderTranslucentDetailObjects( const DistanceFadeInfo_t &info, const Vector &viewOrigin, const Vector &viewForward, const Vector &viewRight, const Vector &viewUp, int nLeafCount, LeafIndex_t *pLeafList ) =0;
  50. // Renders all translucent detail objects in a particular leaf up to a particular point
  51. virtual void RenderTranslucentDetailObjectsInLeaf( const DistanceFadeInfo_t &info, const Vector &viewOrigin, const Vector &viewForward, const Vector &viewRight, const Vector &viewUp, int nLeaf, const Vector *pVecClosestPoint ) = 0;
  52. #if defined(_PS3)
  53. virtual bool ShouldDrawDetailObjects( void ) = 0;
  54. virtual void GetDetailFadeValues( float &flDetailFadeStart, float &flDetailFadeEnd ) = 0;
  55. virtual int GetDetailObjectsCount( void ) = 0;
  56. virtual void *GetDetailObjectsBase( void ) = 0;
  57. virtual void *GetDetailObjectsOriginOffset( void ) = 0;
  58. virtual int GetCDetailModelStride( void ) = 0;
  59. #endif
  60. };
  61. //-----------------------------------------------------------------------------
  62. // System for dealing with detail objects
  63. //-----------------------------------------------------------------------------
  64. extern IDetailObjectSystem *g_pDetailObjectSystem;
  65. inline IDetailObjectSystem* DetailObjectSystem()
  66. {
  67. return g_pDetailObjectSystem;
  68. }
  69. #endif // DETAILOBJECTSYSTEM_H