forked from retrofw/cavestory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
floattext.h
executable file
·55 lines (38 loc) · 865 Bytes
/
floattext.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
#ifndef _FLOATTEXT_H
#define _FLOATTEXT_H
#define FT_Y_START -4 // this starts it exactly centered, since the font is 8px tall
#define FT_Y_HOLD -19
#define FT_Y_RISEAWAY (FT_Y_HOLD - 8)
enum FloatTextStates
{
FT_IDLE,
FT_RISE,
FT_HOLD,
FT_SCROLL_AWAY,
};
class FloatText
{
public:
FloatText(int sprite);
~FloatText();
void Reset();
void AddQty(int amt);
bool IsScrollingAway();
void UpdatePos(Object *assoc_object);
static void DrawAll();
static void DeleteAll();
static void ResetAll(void);
bool ObjectDestroyed;
private:
void Draw();
uint8_t state;
int yoff; // how much we've risen
int shownAmount;
int sprite; // allows selecting font
int timer;
SDL_Rect cliprect;
int objX, objY; // the center pixel of the associated object (de-CSFd)
FloatText *next, *prev;
static FloatText *first, *last;
};
#endif