summaryrefslogtreecommitdiff
path: root/include/field.h
diff options
context:
space:
mode:
authorOxore <oxore@protonmail.com>2018-07-02 23:11:26 +0300
committerOxore <oxore@protonmail.com>2018-07-02 23:11:26 +0300
commit21a0a44853451f3d791bafc80c01deab0ff4c79e (patch)
tree7636e99380c570d903db114ad2834f8bbd93fd7b /include/field.h
parentbb9d1873ad414b09efdd7c8bf6798b431adb3cb2 (diff)
Introduce draw manager, refactor main
Move timers to struct game. Partially move field painting to draw manager.
Diffstat (limited to 'include/field.h')
-rw-r--r--include/field.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/field.h b/include/field.h
index 6e1c928..f037d41 100644
--- a/include/field.h
+++ b/include/field.h
@@ -1,11 +1,15 @@
-#define FLD_SIZE_Y 22
-#define FLD_SIZE_X 10
+#define FLD_SIZE_Y 22
+#define FLD_SIZE_X 10
#define FLD_BOUND_Y FLD_SIZE_Y + 3
#define FLD_BOUND_X FLD_SIZE_X
+#define FLD_POS (sfVector2i){.x = 10, .y = 10+550-24}
+#define FLD_SIZE (sfVector2f){.x = FLD_SIZE_X, .y = FLD_SIZE_Y}
+#define CELL_SIZE (sfVector2f){.x = 23, .y = 23}
struct cell {
char a; // active/empty state of cell
sfColor fColor; // fill color
+ unsigned int color;
};
@@ -39,13 +43,13 @@ struct shape {
struct field {
sfVector2i pos;
- sfColor fColor; // shape color
struct cell c[FLD_BOUND_Y][FLD_SIZE_X]; // array of logic shape cells
- sfRectangleShape *p[FLD_BOUND_Y][FLD_SIZE_X]; // array of physical shape cells
+ sfRectangleShape *p[FLD_SIZE_Y][FLD_SIZE_X]; // array of physical shape cells
int cOutThick; // Field rectangles outline thickness
sfVector2f cSize; // shape rectangles size variable x/y
sfVector2i size;
sfVector2i bound;
+ unsigned int id;
};
void init_field(struct field *fld);