From 73ec96ee907f0a8ebdeec20f2058de705b00d65d Mon Sep 17 00:00:00 2001 From: Oxore Date: Mon, 9 Jul 2018 01:06:04 +0300 Subject: Finish painter, refactor game logic & keys handling Add dependencies in Makefile: now it tracks headers too! Introduce texts in painter. Delegate all the window painting to the painter. Refactor texts from yaml parsing. Remove overcomplicated keymaps and lists of keymaps of... Whatever! Just let em go! Simple idlist with foreach is more than enough. Make displayable values be separate text objects which consists only of a number value that rendered every tick and then displayed. Refactor game logic: make state machine look much obvious with transition functions. Refactor long if-else and switch-case statement chains: replace them with arrays of values (it actually takes more lines of code :P) Refactor keys handling: shorten and separate shape moving code to functions. --- include/tet_conf.h | 49 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 17 deletions(-) (limited to 'include/tet_conf.h') diff --git a/include/tet_conf.h b/include/tet_conf.h index 14a8c2a..c5a6153 100644 --- a/include/tet_conf.h +++ b/include/tet_conf.h @@ -16,23 +16,38 @@ // 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 -#define L00LATENCY 800000 -#define L01LATENCY 716667 -#define L02LATENCY 633334 -#define L03LATENCY 550000 -#define L04LATENCY 466667 -#define L05LATENCY 383334 -#define L06LATENCY 300000 -#define L07LATENCY 216667 -#define L08LATENCY 133334 -#define L09LATENCY 100000 -#define L10LATENCY 83334 -#define L13LATENCY 66667 -#define L16LATENCY 50000 -#define L19LATENCY 33334 -#define L29LATENCY 16667 -#define PUT_LATENCY 300000 +#define basicLatency 500000 +#define L00LATENCY 800000 +#define L01LATENCY 716667 +#define L02LATENCY 633334 +#define L03LATENCY 550000 +#define L04LATENCY 466667 +#define L05LATENCY 383334 +#define L06LATENCY 300000 +#define L07LATENCY 216667 +#define L08LATENCY 133334 +#define L09LATENCY 100000 +#define L10LATENCY 83334 +#define L11LATENCY L10LATENCY +#define L12LATENCY L10LATENCY +#define L13LATENCY 66667 +#define L14LATENCY L13LATENCY +#define L15LATENCY L13LATENCY +#define L16LATENCY 50000 +#define L17LATENCY L16LATENCY +#define L18LATENCY L16LATENCY +#define L19LATENCY 33334 +#define L20LATENCY L19LATENCY +#define L21LATENCY L19LATENCY +#define L22LATENCY L19LATENCY +#define L23LATENCY L19LATENCY +#define L24LATENCY L19LATENCY +#define L25LATENCY L19LATENCY +#define L26LATENCY L19LATENCY +#define L27LATENCY L19LATENCY +#define L28LATENCY L19LATENCY +#define L29LATENCY 16667 +#define PUT_LATENCY 300000 #define RM_1LINES_SCORE 40 #define RM_2LINES_SCORE 100 #define RM_3LINES_SCORE 300 -- cgit v1.2.3