diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/flashlighteffect.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/client/flashlighteffect.h')
| -rw-r--r-- | game/client/flashlighteffect.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/game/client/flashlighteffect.h b/game/client/flashlighteffect.h new file mode 100644 index 0000000..d291c38 --- /dev/null +++ b/game/client/flashlighteffect.h @@ -0,0 +1,64 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//=============================================================================// + +#ifndef FLASHLIGHTEFFECT_H +#define FLASHLIGHTEFFECT_H +#ifdef _WIN32 +#pragma once +#endif + +struct dlight_t; + + +class CFlashlightEffect +{ +public: + + CFlashlightEffect(int nEntIndex = 0); + virtual ~CFlashlightEffect(); + + virtual void UpdateLight(const Vector &vecPos, const Vector &vecDir, const Vector &vecRight, const Vector &vecUp, int nDistance); + void TurnOn(); + void TurnOff(); + bool IsOn( void ) { return m_bIsOn; } + + ClientShadowHandle_t GetFlashlightHandle( void ) { return m_FlashlightHandle; } + void SetFlashlightHandle( ClientShadowHandle_t Handle ) { m_FlashlightHandle = Handle; } + +protected: + + void LightOff(); + void LightOffOld(); + void LightOffNew(); + + void UpdateLightNew(const Vector &vecPos, const Vector &vecDir, const Vector &vecRight, const Vector &vecUp); + void UpdateLightOld(const Vector &vecPos, const Vector &vecDir, int nDistance); + + bool m_bIsOn; + int m_nEntIndex; + ClientShadowHandle_t m_FlashlightHandle; + + // Vehicle headlight dynamic light pointer + dlight_t *m_pPointLight; + float m_flDistMod; + + // Texture for flashlight + CTextureReference m_FlashlightTexture; +}; + +class CHeadlightEffect : public CFlashlightEffect +{ +public: + + CHeadlightEffect(); + ~CHeadlightEffect(); + + virtual void UpdateLight(const Vector &vecPos, const Vector &vecDir, const Vector &vecRight, const Vector &vecUp, int nDistance); +}; + + + +#endif // FLASHLIGHTEFFECT_H |