From 1a0886d852bb8a0d9428dc6f54c1e503d06073a0 Mon Sep 17 00:00:00 2001 From: Oxore Date: Sun, 28 Jul 2019 21:23:27 +0300 Subject: Refactor idlist, move all global vars to local scope - Replace list_foreach with LIST_FOREACH macro. - Remove `game` global variable and make it local everywhere. - Move global vars `fld`, `nxt` and `texts` into `game` struct. - Add `static` qualifier to engine.c's specific global vars. - Move `sfRenderWindow window` global var to local scope --- include/common.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/common.h') diff --git a/include/common.h b/include/common.h index 2273e4d..140044d 100644 --- a/include/common.h +++ b/include/common.h @@ -1,3 +1,5 @@ +struct field; + struct game { size_t level; int started; @@ -14,4 +16,8 @@ struct game { sfClock *repPushDown; // repeat latency when hold Down arrow sfClock *repKeyLeft; // repeat latency when hold Left arrow sfClock *repKeyRight; // repeat latency when hold Right arrow + + struct field *fld; + struct field *nxt; + struct idlist *texts; }; -- cgit v1.2.3