-
Notifications
You must be signed in to change notification settings - Fork 36
/
screeneffect.h
92 lines (68 loc) · 1.61 KB
/
screeneffect.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#ifndef _SCREENEFFECT_H
#define _SCREENEFFECT_H
// screeneffects are a simple draw overlay used w/ things such as flashes and such.
class ScreenEffect
{
public:
ScreenEffect() { enabled = false; }
virtual ~ScreenEffect() { }
virtual void Draw() = 0;
bool enabled;
protected:
int state;
int timer;
};
// FlashScreen simply flashes the screen white several times,
// and is used in various places such as when Misery casts spells.
struct SE_FlashScreen : public ScreenEffect
{
void Start();
void Draw();
int flashes_left;
bool flashstate;
};
// Starflash is a full-screen white explosion in the shape of a '+',
// used when some bosses are defeated.
struct SE_Starflash : public ScreenEffect
{
void Start(int x, int y);
void Draw();
int centerx, centery;
int size, speed;
};
// Fade is the fade-in/out used on every stage transistion/TRA.
struct SE_Fade : public ScreenEffect
{
SE_Fade();
void Start(int fadedir, int dir, int spr=SPR_FADE_DIAMOND);
void Draw(void);
void set_full(int dir);
int getstate(void);
struct
{
int fadedir;
int sweepdir;
int curframe;
int sprite;
} fade;
};
#define FADE_IN 0
#define FADE_OUT 1
// these directions correspond to the FAI/FAO parameters.
#define FADE_LEFT 0
#define FADE_UP 1
#define FADE_RIGHT 2
#define FADE_DOWN 3
#define FADE_CENTER 4
#define FS_NO_FADE 0 // no fade is active
#define FS_FADING 1 // currently fading in or out
#define FS_FADED_OUT 2 // completely faded out
namespace ScreenEffects
{
void Draw(void);
void Stop();
};
extern SE_FlashScreen flashscreen;
extern SE_Starflash starflash;
extern SE_Fade fade;
#endif