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.

64 lines
1.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef FLASHLIGHTEFFECT_H
  7. #define FLASHLIGHTEFFECT_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. struct dlight_t;
  12. class CFlashlightEffect
  13. {
  14. public:
  15. CFlashlightEffect(int nEntIndex = 0);
  16. virtual ~CFlashlightEffect();
  17. virtual void UpdateLight(const Vector &vecPos, const Vector &vecDir, const Vector &vecRight, const Vector &vecUp, int nDistance);
  18. void TurnOn();
  19. void TurnOff();
  20. bool IsOn( void ) { return m_bIsOn; }
  21. ClientShadowHandle_t GetFlashlightHandle( void ) { return m_FlashlightHandle; }
  22. void SetFlashlightHandle( ClientShadowHandle_t Handle ) { m_FlashlightHandle = Handle; }
  23. protected:
  24. void LightOff();
  25. void LightOffOld();
  26. void LightOffNew();
  27. void UpdateLightNew(const Vector &vecPos, const Vector &vecDir, const Vector &vecRight, const Vector &vecUp);
  28. void UpdateLightOld(const Vector &vecPos, const Vector &vecDir, int nDistance);
  29. bool m_bIsOn;
  30. int m_nEntIndex;
  31. ClientShadowHandle_t m_FlashlightHandle;
  32. // Vehicle headlight dynamic light pointer
  33. dlight_t *m_pPointLight;
  34. float m_flDistMod;
  35. // Texture for flashlight
  36. CTextureReference m_FlashlightTexture;
  37. };
  38. class CHeadlightEffect : public CFlashlightEffect
  39. {
  40. public:
  41. CHeadlightEffect();
  42. ~CHeadlightEffect();
  43. virtual void UpdateLight(const Vector &vecPos, const Vector &vecDir, const Vector &vecRight, const Vector &vecUp, int nDistance);
  44. };
  45. #endif // FLASHLIGHTEFFECT_H