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.

78 lines
1.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #if !defined( C_WORLD_H )
  8. #define C_WORLD_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "c_baseentity.h"
  13. #if defined( CLIENT_DLL )
  14. #define CWorld C_World
  15. #endif
  16. class C_World : public C_BaseEntity
  17. {
  18. public:
  19. DECLARE_CLASS( C_World, C_BaseEntity );
  20. DECLARE_CLIENTCLASS();
  21. C_World( void );
  22. ~C_World( void );
  23. // Override the factory create/delete functions since the world is a singleton.
  24. virtual bool Init( int entnum, int iSerialNum );
  25. virtual void Release();
  26. virtual void Precache();
  27. virtual void Spawn();
  28. // Don't worry about adding the world to the collision list; it's already there
  29. virtual CollideType_t GetCollideType( void ) { return ENTITY_SHOULD_NOT_COLLIDE; }
  30. virtual void OnDataChanged( DataUpdateType_t updateType );
  31. virtual void PreDataUpdate( DataUpdateType_t updateType );
  32. float GetWaveHeight() const;
  33. const char *GetDetailSpriteMaterial() const;
  34. public:
  35. enum
  36. {
  37. MAX_DETAIL_SPRITE_MATERIAL_NAME_LENGTH = 256,
  38. };
  39. float m_flWaveHeight;
  40. Vector m_WorldMins;
  41. Vector m_WorldMaxs;
  42. bool m_bStartDark;
  43. float m_flMaxOccludeeArea;
  44. float m_flMinOccluderArea;
  45. float m_flMinPropScreenSpaceWidth;
  46. float m_flMaxPropScreenSpaceWidth;
  47. bool m_bColdWorld;
  48. private:
  49. void RegisterSharedActivities( void );
  50. char m_iszDetailSpriteMaterial[MAX_DETAIL_SPRITE_MATERIAL_NAME_LENGTH];
  51. };
  52. inline float C_World::GetWaveHeight() const
  53. {
  54. return m_flWaveHeight;
  55. }
  56. inline const char *C_World::GetDetailSpriteMaterial() const
  57. {
  58. return m_iszDetailSpriteMaterial;
  59. }
  60. void ClientWorldFactoryInit();
  61. void ClientWorldFactoryShutdown();
  62. C_World* GetClientWorldEntity();
  63. #endif // C_WORLD_H