summaryrefslogtreecommitdiff
path: root/include/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/common.h')
-rw-r--r--include/common.h37
1 files changed, 30 insertions, 7 deletions
diff --git a/include/common.h b/include/common.h
index 5a3d63e..37ede42 100644
--- a/include/common.h
+++ b/include/common.h
@@ -12,11 +12,10 @@
#include <time.h>
#include "tet_conf.h"
-typedef struct tCell {
+typedef struct Cell {
uint8_t a; // active/empty state of cell
sfColor fColor; // fill color
-} tCell;
-tCell fldCAtt[25][10];// fld cells attributes
+} Cell;
/*
@@ -30,13 +29,37 @@ tCell fldCAtt[25][10];// fld cells attributes
*
*/
-typedef struct shapeSt {
+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
- uint8_t c[4][4]; // array of shape cells
-} shapeSt;
-shapeSt actiSh, nxtShape;
+ uint8_t 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;
+Shape active, next;
+
+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 Text {
+ sfFont *font;
+ sfText *text;
+ sfVector2f pos;
+} Text;
#endif