From 21a0a44853451f3d791bafc80c01deab0ff4c79e Mon Sep 17 00:00:00 2001 From: Oxore Date: Mon, 2 Jul 2018 23:11:26 +0300 Subject: Introduce draw manager, refactor main Move timers to struct game. Partially move field painting to draw manager. --- include/field.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'include/field.h') 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); -- cgit v1.2.3