blob: 9e1a847773dcee79e38cb1c47d808bf497d5dfc4 (
plain)
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
|
/*
* Types
*
* */
typedef struct Cell {
char a; // active/empty state of cell
sfColor fColor; // fill color
} Cell;
/*
* shape coords
* y
* ^. . . .
* |. . . .
* |. . . .
* |. . . .
* 0------->x
*
*/
typedef struct Shape {
int x; // x coord of shape's left side
int y; // y coord of shape's bottom
int t; // shape type
sfColor fColor; // shape color
char c[4][4]; // array of logic shape cells
sfRectangleShape *p[4][4]; // array of physical shape cells
sfVector2f cSize; // shape rectangles size variable x/y
} Shape;
typedef struct Field {
sfVector2i pos;
sfColor fColor; // shape color
Cell c[25][10]; // array of logic shape cells
sfRectangleShape *p[25][10]; // array of physical shape cells
int cOutThick; // Field rectangles outline thickness
sfVector2f cSize; // shape rectangles size variable x/y
sfVector2i size;
} Field;
typedef struct Window {
sfVideoMode mode;
sfRenderWindow *window;
sfEvent event;
} Window;
typedef struct Game {
int isStarted;
int scoreCurrent;
int level;
int lines;
} Game;
/* ======== text.[c|h] types =========== */
typedef struct List {
void *obj;
void *next;
void *prev;
} List;
typedef struct Pair {
void *k;
void *v;
} Pair;
typedef struct KeyMap {
Pair *pair;
void *next;
void *prev;
} KeyMap;
typedef struct Text {
char *font;
char *type;
char *scene;
char *text;
void *sfText;
} Text;
|