-
Notifications
You must be signed in to change notification settings - Fork 5
/
IVEffects.h
59 lines (54 loc) · 1.02 KB
/
IVEffects.h
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
#pragma once
#include "Vector.h"
#include "MiscDefinitions.h"
struct ColorRGBExp32
{
byte r, g, b;
signed char exponent;
};
struct dlight_t
{
int flags;
Vector origin;
float radius;
ColorRGBExp32 color;
float die;
float decay;
float minlight;
int key;
int style;
Vector m_Direction;
float m_InnerAngle;
float m_OuterAngle;
float GetRadius( ) const
{
return radius;
}
float GetRadiusSquared( ) const
{
return radius * radius;
}
float IsRadiusGreaterThanZero( ) const
{
return radius > 0.0f;
}
};
class IVEffects
{
public:
dlight_t* CL_AllocDlight( int key )
{
typedef dlight_t*( __thiscall* OriginalFn )( PVOID, int );
return call_vfunc<OriginalFn>( this, 4 )( this, key );
}
dlight_t* CL_AllocElight( int key )
{
typedef dlight_t*( __thiscall* OriginalFn )( PVOID, int );
return call_vfunc<OriginalFn>( this, 5 )( this, key );
}
dlight_t* GetElightByKey( int key )
{
typedef dlight_t*( __thiscall* OriginalFn )( PVOID, int );
return call_vfunc<OriginalFn>( this, 8 )( this, key );
}
};