forked from sstokic-tgm/Gladiatorcheatz-Public
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNadeTracer.hpp
62 lines (50 loc) · 1.02 KB
/
NadeTracer.hpp
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
#pragma once
#include "harCs.hpp"
#include "Drawing.hpp"
#include <set>
class Timer
{
private:
__int64 initialTS, currentTS;
float secsPerCount;
public:
Timer()
{
__int64 countsPerSec = initialTS = currentTS = 0;
QueryPerformanceFrequency((LARGE_INTEGER*)&countsPerSec);
if (countsPerSec == 0)
secsPerCount = 1.0f;
else
secsPerCount = 1.0f / (float)countsPerSec;
}
inline void init()
{
QueryPerformanceCounter((LARGE_INTEGER*)&initialTS);
}
inline float diff()
{
QueryPerformanceCounter((LARGE_INTEGER*)¤tTS);
return ((float)currentTS - (float)initialTS)*secsPerCount;
}
};
struct TraceObj
{
TraceObj() = default;
TraceObj(Color, unsigned int);
Color colorTrace;
unsigned int maxLength;
std::vector<Vector3> vecTracePoints;
Timer timerPointLock;
};
class NadeTracer
{
private:
Drawing *m_crtaj;
std::unordered_map<Entity*, TraceObj> mapGrenades;
std::set<Entity*> setGrenadeExists;
public:
NadeTracer(Drawing*);
void addTracer(Entity*, Color, unsigned int);
void draw();
void clear();
};