Team Fortress 2 Source Code as on 22/4/2020
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.

73 lines
2.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Revision: $
  6. // $NoKeywords: $
  7. //
  8. // This file contains code to allow us to associate client data with bsp leaves.
  9. //
  10. //=============================================================================//
  11. #if !defined( ICLIENTLEAFSYSTEM_H )
  12. #define ICLIENTLEAFSYSTEM_H
  13. #ifdef _WIN32
  14. #pragma once
  15. #endif
  16. #include "client_render_handle.h"
  17. //-----------------------------------------------------------------------------
  18. // Render groups
  19. //-----------------------------------------------------------------------------
  20. enum RenderGroup_Config_t
  21. {
  22. // Number of buckets that are used to hold opaque entities
  23. // and opaque static props by size. The bucketing should be used to reduce overdraw.
  24. RENDER_GROUP_CFG_NUM_OPAQUE_ENT_BUCKETS = 4,
  25. };
  26. enum RenderGroup_t
  27. {
  28. RENDER_GROUP_OPAQUE_STATIC_HUGE = 0, // Huge static prop
  29. RENDER_GROUP_OPAQUE_ENTITY_HUGE = 1, // Huge opaque entity
  30. RENDER_GROUP_OPAQUE_STATIC = RENDER_GROUP_OPAQUE_STATIC_HUGE + ( RENDER_GROUP_CFG_NUM_OPAQUE_ENT_BUCKETS - 1 ) * 2,
  31. RENDER_GROUP_OPAQUE_ENTITY, // Opaque entity (smallest size, or default)
  32. RENDER_GROUP_TRANSLUCENT_ENTITY,
  33. RENDER_GROUP_TWOPASS, // Implied opaque and translucent in two passes
  34. RENDER_GROUP_VIEW_MODEL_OPAQUE, // Solid weapon view models
  35. RENDER_GROUP_VIEW_MODEL_TRANSLUCENT, // Transparent overlays etc
  36. RENDER_GROUP_OPAQUE_BRUSH, // Brushes
  37. RENDER_GROUP_OTHER, // Unclassfied. Won't get drawn.
  38. // This one's always gotta be last
  39. RENDER_GROUP_COUNT
  40. };
  41. #define CLIENTLEAFSYSTEM_INTERFACE_VERSION_1 "ClientLeafSystem001"
  42. #define CLIENTLEAFSYSTEM_INTERFACE_VERSION "ClientLeafSystem002"
  43. //-----------------------------------------------------------------------------
  44. // The client leaf system
  45. //-----------------------------------------------------------------------------
  46. abstract_class IClientLeafSystemEngine
  47. {
  48. public:
  49. // Adds and removes renderables from the leaf lists
  50. // CreateRenderableHandle stores the handle inside pRenderable.
  51. virtual void CreateRenderableHandle( IClientRenderable* pRenderable, bool bIsStaticProp = false ) = 0;
  52. virtual void RemoveRenderable( ClientRenderHandle_t handle ) = 0;
  53. virtual void AddRenderableToLeaves( ClientRenderHandle_t renderable, int nLeafCount, unsigned short *pLeaves ) = 0;
  54. virtual void ChangeRenderableRenderGroup( ClientRenderHandle_t handle, RenderGroup_t group ) = 0;
  55. };
  56. #endif // ICLIENTLEAFSYSTEM_H