1 | /* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */ |
2 | /* If you are missing that file, acquire a complete release at teeworlds.com. */ |
3 | #ifndef GAME_CLIENT_COMPONENTS_DAMAGEIND_H |
4 | #define GAME_CLIENT_COMPONENTS_DAMAGEIND_H |
5 | #include <base/color.h> |
6 | #include <base/vmath.h> |
7 | #include <game/client/component.h> |
8 | |
9 | class CDamageInd : public CComponent |
10 | { |
11 | int64_t m_Lastupdate; |
12 | struct CItem |
13 | { |
14 | vec2 m_Pos; |
15 | vec2 m_Dir; |
16 | float m_StartTime; |
17 | float m_StartAngle; |
18 | ColorRGBA m_Color; |
19 | float m_StartAlpha; |
20 | }; |
21 | |
22 | enum |
23 | { |
24 | MAX_ITEMS = 64, |
25 | }; |
26 | |
27 | CItem m_aItems[MAX_ITEMS]; |
28 | int m_NumItems; |
29 | |
30 | CItem *CreateI(); |
31 | void DestroyI(CItem *pItem); |
32 | |
33 | int m_DmgIndQuadContainerIndex; |
34 | |
35 | public: |
36 | CDamageInd(); |
37 | virtual int Sizeof() const override { return sizeof(*this); } |
38 | |
39 | void Create(vec2 Pos, vec2 Dir, float Alpha); |
40 | void Reset(); |
41 | virtual void OnRender() override; |
42 | virtual void OnInit() override; |
43 | }; |
44 | #endif |
45 | |