From 75d123b79dc894f2c2de43f25009b5fa84a00eec Mon Sep 17 00:00:00 2001 From: Oxore Date: Thu, 30 Nov 2017 15:45:43 +0300 Subject: Redefine structures with typedef; A bit of code movement --- src/include/common.h | 14 ++++++-------- src/include/functions.h | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'src/include') diff --git a/src/include/common.h b/src/include/common.h index bc3911a..5a3d63e 100644 --- a/src/include/common.h +++ b/src/include/common.h @@ -12,11 +12,11 @@ #include #include "tet_conf.h" -struct tCell { +typedef struct tCell { uint8_t a; // active/empty state of cell sfColor fColor; // fill color -}; -struct tCell fldCAtt[25][10];// fld cells attributes +} tCell; +tCell fldCAtt[25][10];// fld cells attributes /* @@ -30,15 +30,13 @@ struct tCell fldCAtt[25][10];// fld cells attributes * */ -struct shapeSt { +typedef struct shapeSt { 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 -}; - -struct shapeSt actiSh; -struct shapeSt nxtShape; +} shapeSt; +shapeSt actiSh, nxtShape; #endif diff --git a/src/include/functions.h b/src/include/functions.h index 3a27f82..ef9d42f 100644 --- a/src/include/functions.h +++ b/src/include/functions.h @@ -25,6 +25,6 @@ void gameover(); void genNextShape(); void copyShape(struct shapeSt *localSh); void drawNextShape(); -void cleanup(); +void cleanupFld(); #endif -- cgit v1.2.3