forked from ValveSoftware/source-sdk-2013
-
Notifications
You must be signed in to change notification settings - Fork 165
Expand file tree
/
Copy pathflashlighteffect.h
More file actions
72 lines (51 loc) · 1.65 KB
/
flashlighteffect.h
File metadata and controls
72 lines (51 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//========= 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();
#ifdef MAPBASE
float m_flHeadlightScale;
color32 m_clrHeadlightColors;
void SetScale(float scale);
void SetColor(color32 color);
#endif
virtual void UpdateLight(const Vector &vecPos, const Vector &vecDir, const Vector &vecRight, const Vector &vecUp, int nDistance);
};
#endif // FLASHLIGHTEFFECT_H