Skip to content

Commit 4482eb3

Browse files
committed
some code refactor
1 parent 6a5d83a commit 4482eb3

File tree

2 files changed

+11
-25
lines changed

2 files changed

+11
-25
lines changed

src/game/client/components/comp_pulse/afk_aura.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
#include "afk_aura.h"
2-
#include <base/math.h>
32
#include <game/client/gameclient.h>
43
#include <game/client/components/effects.h>
54

6-
CAfkAura::CAfkAura()
7-
{
8-
m_LastMovementTime = 0.0f;
9-
m_LastPosition = vec2(0, 0);
10-
m_AuraPosition = vec2(0, 0);
11-
m_AuraActive = false;
12-
m_AuraParticlesCreated = false;
13-
}
145

15-
void CAfkAura::OnInit(){}
6+
void CAfkAura::OnInit() {}
167

178
void CAfkAura::OnRender()
189
{
@@ -77,9 +68,8 @@ void CAfkAura::OnRender()
7768
GameClient()->m_aClients[ClientId].m_RenderInfo.m_ColorBody.g,
7869
GameClient()->m_aClients[ClientId].m_RenderInfo.m_ColorBody.b,
7970
1.0f
80-
);
71+
);
8172

8273
GameClient()->m_Effects.AfkAura(m_AuraPosition, Alpha, BodyColor);
8374
}
84-
}
85-
75+
}

src/game/client/components/comp_pulse/afk_aura.h

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,18 @@
66

77
class CAfkAura : public CComponent
88
{
9-
public:
10-
CAfkAura();
9+
float m_LastMovementTime = 0.0f;
10+
vec2 m_LastPosition = vec2(0, 0);
11+
vec2 m_AuraPosition = vec2(0, 0);
12+
bool m_AuraActive = false;
13+
bool m_AuraParticlesCreated = false;
14+
float m_FadeOutStartTime;
1115

16+
public:
1217
virtual void OnRender() override;
1318

1419
virtual int Sizeof() const override { return sizeof(*this); }
1520
virtual void OnInit() override;
16-
17-
18-
private:
19-
float m_LastMovementTime;
20-
vec2 m_LastPosition;
21-
vec2 m_AuraPosition;
22-
bool m_AuraActive;
23-
bool m_AuraParticlesCreated;
24-
float m_FadeOutStartTime;
2521
};
2622

27-
#endif
23+
#endif

0 commit comments

Comments
 (0)