-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscrolling_text.h
48 lines (35 loc) · 1.2 KB
/
scrolling_text.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
#ifndef SCROLLING_TEXT_H
#define SCROLLING_TEXT_H
#include <string.h>
#include <SDL.h>
#include <SDL_ttf.h>
#include "bullet.h"
#define s_text_duration 500
#define s_text_frames 25
#define TEXT_BUFFER 256
#define COLOR_ENEMY_DAMAGE 255, 0, 0
#define COLOR_SHIP_DAMAGE 0, 0, 255
#define COLOR_WEAPON 0, 0, 255
#define COLOR_UPGRADE 0, 128, 0
#define COLOR_DOWNGRADE 255, 0, 0
typedef struct scrolling_text scrolling_text;
struct scrolling_text
{
char text[TEXT_BUFFER];
SDL_Color color;
double x;
double y;
Uint32 start_time;
scrolling_text *next;
scrolling_text *prev;
};
extern int init_scrolling_text();
extern scrolling_text *new_scrolling_text(const double x, const double y, const char *text,
const Uint8 r, const Uint8 g, const Uint8 b);
extern scrolling_text *new_scrolling_int(const double x, const double y, const int value,
const Uint8 r, const Uint8 g, const Uint8 b);
extern void free_scrolling_text(scrolling_text *scr_text);
extern void blit_all_scrolling_texts(SDL_Surface *dst);
extern void extend_all_scrolling_texts_timestamp(const Uint32 time);
extern void free_all_scrolling_texts(void);
#endif