-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCAnimation.h
60 lines (45 loc) · 1.04 KB
/
CAnimation.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
class CTexture;
class CAnimator;
class CObj;
struct tAnimFrm
{
CTexture* pTex;
wstring strName;
wstring strRelativeTexPath;
Vec vSize;
float fDuration;
};
class CAnimation
{
private:
CAnimator* m_pAnimator;
wstring m_strName;
vector<tAnimFrm> m_vecFrm;
int m_iCuridx;
float m_fAddTime;
bool m_bFinish;
bool m_bFlip; // Flip image horizontally
float m_fEffectTime;
float m_fEffectAddTime;
public:
const wstring& GetName() { return m_strName; }
CObj* GetOwner();
bool IsFinished() { return m_bFinish; }
bool IsFlip() { return m_bFlip; }
void Filp(bool _bFlip) { m_bFlip = _bFlip; }
void StartEffect(float _time);
public:
void Reset();
void Save(const wstring& _strRelativeFolderPath);
void Load(const wstring& _strRelativeFilePath);
private:
void Create(const wstring& _strAnimName, const wstring& _strRelativePath, float _fDuration, UINT _iFrmCount);
public:
void Update();
void Render(HDC _dc);
public:
CAnimation();
~CAnimation();
friend class CAnimator;
};