NXEngine v1.0.0.6
[NXEngine.git] / screeneffect.h
blobace22f6eccc44b6426dc0168d383eaec14f3bcec
2 #ifndef _SCREENEFFECT_H
3 #define _SCREENEFFECT_H
6 // screeneffects are a simple draw overlay used w/ things such as flashes and such.
7 class ScreenEffect
9 public:
10 ScreenEffect() { enabled = false; }
11 virtual ~ScreenEffect() { }
12 virtual void Draw() = 0;
14 bool enabled;
16 protected:
17 int state;
18 int timer;
22 // FlashScreen simply flashes the screen white several times,
23 // and is used in various places such as when Misery casts spells.
24 struct SE_FlashScreen : public ScreenEffect
26 void Start();
27 void Draw();
29 int flashes_left;
30 bool flashstate;
34 // Starflash is a full-screen white explosion in the shape of a '+',
35 // used when some bosses are defeated.
36 struct SE_Starflash : public ScreenEffect
38 void Start(int x, int y);
39 void Draw();
41 int centerx, centery;
42 int size, speed;
46 // Fade is the fade-in/out used on every stage transistion/TRA.
47 struct SE_Fade : public ScreenEffect
49 SE_Fade();
51 void Start(int fadedir, int dir, int spr=SPR_FADE_DIAMOND);
52 void Draw(void);
53 void set_full(int dir);
54 int getstate(void);
56 struct
58 int fadedir;
59 int sweepdir;
60 int curframe;
61 int sprite;
62 } fade;
65 #define FADE_IN 0
66 #define FADE_OUT 1
68 // these directions correspond to the FAI/FAO parameters.
69 #define FADE_LEFT 0
70 #define FADE_UP 1
71 #define FADE_RIGHT 2
72 #define FADE_DOWN 3
73 #define FADE_CENTER 4
75 #define FS_NO_FADE 0 // no fade is active
76 #define FS_FADING 1 // currently fading in or out
77 #define FS_FADED_OUT 2 // completely faded out
80 namespace ScreenEffects
82 void Draw(void);
83 void Stop();
87 extern SE_FlashScreen flashscreen;
88 extern SE_Starflash starflash;
89 extern SE_Fade fade;
91 #endif