diff options
author | Oxore <oxore@protonmail.com> | 2017-06-20 21:01:53 +0700 |
---|---|---|
committer | Oxore <oxore@protonmail.com> | 2017-06-20 21:01:53 +0700 |
commit | cd2650182ce710ae7fdfae2c68b91c417d54bc60 (patch) | |
tree | a6e008ccac1c9b2e85925c6aea51d78ab3ef7e6a /src/include/common.h | |
parent | 2af11c35bb687c89fdb35e8d6f45327fc8a842b9 (diff) |
Major refactoring!
Diffstat (limited to 'src/include/common.h')
-rw-r--r-- | src/include/common.h | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/src/include/common.h b/src/include/common.h index e7624c7..c606560 100644 --- a/src/include/common.h +++ b/src/include/common.h @@ -6,20 +6,40 @@ #include <SFML/System.h> #include <SFML/Window/Keyboard.h> #include <stdio.h> -#include <time.h> #include <stdlib.h> +#include <stdint.h> +#include <string.h> +#include <time.h> #include "functions.h" #include "tet_conf.h" -//#define EXIT_FAILURE -1 -//#define EXIT_SUCCESS 0 - struct tCell { - short a; // active/empty state of cell - sfColor fColor, oColor; // fill and outline color of cell + uint8_t a; // active/empty state of cell + sfColor fColor; // fill color +}; +struct tCell fldCAtt[20][10];// fld cells attributes + + +/* + * shape coords + * y + * ^. . . . + * |. . . . + * |. . . . + * |. . . . + * 0------->x + * + */ + +struct activeShape { + int x; // x coord of shape's left side + int y; // y coord of shape's bottom + int r; // rotate state, one of four + int t; // shape type + sfColor fColor; // shape color + uint8_t c[4][4]; // array of shape cells }; -struct tCell activeShape[4][4]; // 4x4 block of active crawling shape -struct tCell fld_rAttr[20][10];// fld cells attributes +struct activeShape actiSh; #endif |