annotate lamertetris/sources/shape.h @ 6:542e305f23f4

arkanoid-trix-debian-dir
author prymula <prymula76@outlook.com>
date Wed, 31 Jan 2024 20:40:57 +0100
parents 2787f5e749ae
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
prymula <prymula76@outlook.com>
parents:
diff changeset
1 #include <SDL2/SDL.h>
prymula <prymula76@outlook.com>
parents:
diff changeset
2 #include <stdio.h>
prymula <prymula76@outlook.com>
parents:
diff changeset
3
prymula <prymula76@outlook.com>
parents:
diff changeset
4 #ifndef SZLAM_H
prymula <prymula76@outlook.com>
parents:
diff changeset
5 #define SZLAM_H
prymula <prymula76@outlook.com>
parents:
diff changeset
6
prymula <prymula76@outlook.com>
parents:
diff changeset
7 class Shape {
prymula <prymula76@outlook.com>
parents:
diff changeset
8 public:
prymula <prymula76@outlook.com>
parents:
diff changeset
9 Shape();
prymula <prymula76@outlook.com>
parents:
diff changeset
10 SDL_Surface * createField(int w,int h, int r, int g, int b);
prymula <prymula76@outlook.com>
parents:
diff changeset
11 void setColor(int color, int *r, int *g, int*b);
prymula <prymula76@outlook.com>
parents:
diff changeset
12 char elements [7][16][4] = {
prymula <prymula76@outlook.com>
parents:
diff changeset
13 {
prymula <prymula76@outlook.com>
parents:
diff changeset
14 {1,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
15 {1,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
16 {1,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
17 {1,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
18
prymula <prymula76@outlook.com>
parents:
diff changeset
19 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
20 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
21 {1,1,1,1},
prymula <prymula76@outlook.com>
parents:
diff changeset
22 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
23
prymula <prymula76@outlook.com>
parents:
diff changeset
24 {1,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
25 {1,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
26 {1,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
27 {1,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
28
prymula <prymula76@outlook.com>
parents:
diff changeset
29 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
30 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
31 {1,1,1,1},
prymula <prymula76@outlook.com>
parents:
diff changeset
32 {0,0,0,0}
prymula <prymula76@outlook.com>
parents:
diff changeset
33 },
prymula <prymula76@outlook.com>
parents:
diff changeset
34 {
prymula <prymula76@outlook.com>
parents:
diff changeset
35 {1,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
36 {1,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
37 {1,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
38 {1,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
39
prymula <prymula76@outlook.com>
parents:
diff changeset
40 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
41 {1,1,1,1},
prymula <prymula76@outlook.com>
parents:
diff changeset
42 {0,0,0,1},
prymula <prymula76@outlook.com>
parents:
diff changeset
43 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
44
prymula <prymula76@outlook.com>
parents:
diff changeset
45 {0,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
46 {0,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
47 {0,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
48 {1,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
49
prymula <prymula76@outlook.com>
parents:
diff changeset
50 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
51 {1,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
52 {1,1,1,1},
prymula <prymula76@outlook.com>
parents:
diff changeset
53 {0,0,0,0}
prymula <prymula76@outlook.com>
parents:
diff changeset
54 },
prymula <prymula76@outlook.com>
parents:
diff changeset
55
prymula <prymula76@outlook.com>
parents:
diff changeset
56 {
prymula <prymula76@outlook.com>
parents:
diff changeset
57 {1,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
58 {0,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
59 {0,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
60 {0,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
61
prymula <prymula76@outlook.com>
parents:
diff changeset
62 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
63 {0,0,0,1},
prymula <prymula76@outlook.com>
parents:
diff changeset
64 {1,1,1,1},
prymula <prymula76@outlook.com>
parents:
diff changeset
65 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
66
prymula <prymula76@outlook.com>
parents:
diff changeset
67 {1,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
68 {1,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
69 {1,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
70 {1,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
71
prymula <prymula76@outlook.com>
parents:
diff changeset
72 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
73 {1,1,1,1},
prymula <prymula76@outlook.com>
parents:
diff changeset
74 {1,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
75 {0,0,0,0}
prymula <prymula76@outlook.com>
parents:
diff changeset
76 },
prymula <prymula76@outlook.com>
parents:
diff changeset
77
prymula <prymula76@outlook.com>
parents:
diff changeset
78 {
prymula <prymula76@outlook.com>
parents:
diff changeset
79 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
80 {1,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
81 {1,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
82 {1,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
83
prymula <prymula76@outlook.com>
parents:
diff changeset
84 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
85 {1,1,1,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
86 {0,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
87 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
88
prymula <prymula76@outlook.com>
parents:
diff changeset
89 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
90 {0,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
91 {1,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
92 {0,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
93
prymula <prymula76@outlook.com>
parents:
diff changeset
94 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
95 {0,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
96 {1,1,1,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
97 {0,0,0,0}
prymula <prymula76@outlook.com>
parents:
diff changeset
98 },
prymula <prymula76@outlook.com>
parents:
diff changeset
99 {
prymula <prymula76@outlook.com>
parents:
diff changeset
100 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
101 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
102 {1,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
103 {1,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
104
prymula <prymula76@outlook.com>
parents:
diff changeset
105 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
106 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
107 {1,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
108 {1,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
109
prymula <prymula76@outlook.com>
parents:
diff changeset
110 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
111 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
112 {1,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
113 {1,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
114
prymula <prymula76@outlook.com>
parents:
diff changeset
115 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
116 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
117 {1,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
118 {1,1,0,0}
prymula <prymula76@outlook.com>
parents:
diff changeset
119 },
prymula <prymula76@outlook.com>
parents:
diff changeset
120 {
prymula <prymula76@outlook.com>
parents:
diff changeset
121 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
122 {0,1,1,1},
prymula <prymula76@outlook.com>
parents:
diff changeset
123 {1,1,1,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
124 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
125
prymula <prymula76@outlook.com>
parents:
diff changeset
126 {1,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
127 {1,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
128 {1,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
129 {0,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
130
prymula <prymula76@outlook.com>
parents:
diff changeset
131 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
132 {0,1,1,1},
prymula <prymula76@outlook.com>
parents:
diff changeset
133 {1,1,1,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
134 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
135
prymula <prymula76@outlook.com>
parents:
diff changeset
136 {1,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
137 {1,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
138 {1,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
139 {0,1,0,0}
prymula <prymula76@outlook.com>
parents:
diff changeset
140
prymula <prymula76@outlook.com>
parents:
diff changeset
141 },
prymula <prymula76@outlook.com>
parents:
diff changeset
142 {
prymula <prymula76@outlook.com>
parents:
diff changeset
143 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
144 {1,1,1,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
145 {0,1,1,1},
prymula <prymula76@outlook.com>
parents:
diff changeset
146 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
147
prymula <prymula76@outlook.com>
parents:
diff changeset
148 {0,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
149 {1,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
150 {1,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
151 {1,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
152
prymula <prymula76@outlook.com>
parents:
diff changeset
153 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
154 {1,1,1,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
155 {0,1,1,1},
prymula <prymula76@outlook.com>
parents:
diff changeset
156 {0,0,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
157
prymula <prymula76@outlook.com>
parents:
diff changeset
158 {0,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
159 {1,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
160 {1,1,0,0},
prymula <prymula76@outlook.com>
parents:
diff changeset
161 {1,0,0,0}
prymula <prymula76@outlook.com>
parents:
diff changeset
162
prymula <prymula76@outlook.com>
parents:
diff changeset
163 }
prymula <prymula76@outlook.com>
parents:
diff changeset
164
prymula <prymula76@outlook.com>
parents:
diff changeset
165 };
prymula <prymula76@outlook.com>
parents:
diff changeset
166 private:
prymula <prymula76@outlook.com>
parents:
diff changeset
167 SDL_Surface * createBoxMask(int width, int height);
prymula <prymula76@outlook.com>
parents:
diff changeset
168
prymula <prymula76@outlook.com>
parents:
diff changeset
169 };
prymula <prymula76@outlook.com>
parents:
diff changeset
170
prymula <prymula76@outlook.com>
parents:
diff changeset
171 #endif // szlam