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/idlist.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 include/idlist.h (limited to 'include/idlist.h') diff --git a/include/idlist.h b/include/idlist.h new file mode 100644 index 0000000..d1badc7 --- /dev/null +++ b/include/idlist.h @@ -0,0 +1,12 @@ +struct idlist { + unsigned long id; + void *obj; + struct idlist *next; + struct idlist *prev; +}; + +struct idlist *list_new(); +struct idlist *list_append(struct idlist *list); +struct idlist *list_get(const struct idlist *list, unsigned long id); +void list_rm_node(struct idlist *node); +void list_foreach(struct idlist *list, void (*job)(void *)); -- cgit v1.2.3