From ed8127a72e1a2d2703372d5b5dfa8d96703ec3bb Mon Sep 17 00:00:00 2001 From: Oxore Date: Tue, 3 Jul 2018 15:11:54 +0300 Subject: Refactor field, refactor next shape drawing Refactor field functions names. Transfer next shape drawing to painter. Introduce idlist struct with foreach function. Refactor config. Introduce color map array instead of "switch case" statement bloating while coloring rectangles. Decouple field and shape structs from SFML sfVector2 structs by introducing own vector2i and vector2ui structs. Also remove sfRectangleShape members form field an shape structs. --- include/common.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'include/common.h') diff --git a/include/common.h b/include/common.h index 7a85dbc..098ea9e 100644 --- a/include/common.h +++ b/include/common.h @@ -1,13 +1,13 @@ struct game { - int isStarted; - int scoreCurrent; - int level; - int moveLatency; - int lines; - sfClock *gameTick; - sfClock *putTick; - sfClock *mTick; - sfClock *repPushDown; // Clock for repeat latency when Down arrow long push - sfClock *repKeyLeft; // Clock for repeat latency when Left arrow long push - sfClock *repKeyRight; // Clock for repeat latency when Left arrow long push + unsigned int level; + int isStarted; + int scoreCurrent; + int moveLatency; + int lines; + sfClock *gameTick; + sfClock *putTick; + sfClock *mTick; + sfClock *repPushDown; // repeat latency when hold Down arrow + sfClock *repKeyLeft; // repeat latency when hold Left arrow + sfClock *repKeyRight; // repeat latency when hold Left arrow }; -- cgit v1.2.3