-
Notifications
You must be signed in to change notification settings - Fork 2
/
EffectManager.h
61 lines (52 loc) · 1.64 KB
/
EffectManager.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
60
#pragma once
#include "singletonBase.h"
#include <list>
#define MAX_EFFECT 200
class EffectManager : public singletonBase<EffectManager>
{
private:
struct tagEffect {
string imgKey;
POINT ptPos;
int interval;
int count;
int maxFrameX;
int frameX;
int currentAlpha;
int toAlpha;
float currentSize;
float destSize;
bool isFrameImage;
bool isReset;
bool isAppear;
int width;
int height;
int alphaSpeed;
bool isRelative;
bool isAlpha;
bool isStretch;
bool isPingPong;
};
private:
tagEffect* _effects[MAX_EFFECT];
list<tagEffect*> _listEffectBack;
list<tagEffect*> _listEffectFront;
list<tagEffect*>::iterator iter;
public:
const string smokeEff = "DigSmoke";
const string walkEff = "Walk1";
const string explodeEff = "bossSlimeExplode";
public:
void init();
void release();
void update();
void renderBack(HDC hdc);
void renderFront(HDC hdc);
void ShowEffectFrame(string _imgKey, POINT ptPos, bool isRelative = false);
void ShowEffectFrame(string _imgKey, POINT ptPos, int frameInterval, bool isRelative = false);
void ShowEffectFrame(string _imgKey, POINT ptPos, int frameInterval, float size, bool isRelative = false);
// size example : 0.5f -> 1.0f
void ShowEffectAlphaSize(string _imgKey, POINT ptPos, float fromSizeA, float toSizeB, int fromAlphaA, int toAlphaB, bool isRelative = false);
void ShowEffectAlphaSize(string _imgKey, POINT ptPos, float fromSizeA, float toSizeB, int fromAlphaA, int toAlphaB, int waitCount, bool isRelative = false);
void ShowEffectAlpha(string _imgKey, POINT ptPos, int fromAlphaA, int toAlphaB, int alphaSpeed, int waitCount, bool isRelative = false, bool isPingPong = false);
};