From cd92a5171dd67b795a6fed4c2e635aed8262a876 Mon Sep 17 00:00:00 2001 From: Oxore Date: Fri, 1 Dec 2017 07:25:32 +0300 Subject: More structure wrapping, more refactoring --- include/common.h | 6 ++++++ include/functions.h | 9 ++++----- include/tet_conf.h | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/common.h b/include/common.h index 8108e11..5f64a2b 100644 --- a/include/common.h +++ b/include/common.h @@ -55,6 +55,12 @@ typedef struct Window { sfEvent event; } Window; +typedef struct Game { + int isStarted; + int scoreCurrent; + int level; +} Game; + typedef struct Text { sfFont *font; sfText *text; diff --git a/include/functions.h b/include/functions.h index 8f7618e..0ed6f1d 100644 --- a/include/functions.h +++ b/include/functions.h @@ -17,14 +17,13 @@ void rotateShape(); int linesRmScore(); void scoreDisplay(int s, Text *textScore); void colorizeFld(); -void colorizeActiSh(); +void colorizeActive(); void drawFld(sfRenderWindow *window); -void menuTick(); -void colorizeRandom(); -void gameover(); +void colorizeRandom(Field *fld); +void gameover(Game *game); void genNextShape(); void copyShape(Shape *localSh); void drawNextShape(); -void cleanupFld(); +void freeFld(); #endif diff --git a/include/tet_conf.h b/include/tet_conf.h index 50b17ff..a5f4957 100644 --- a/include/tet_conf.h +++ b/include/tet_conf.h @@ -13,6 +13,7 @@ // first repeat move when long push #define moveRepeatLatency2 30000 // microseconds, for Left, Right and Down // arrows, the rest repeat move when long push +#define basicLatency 500000 /* -- cgit v1.2.3