summaryrefslogtreecommitdiff
path: root/include/engine.h
AgeCommit message (Collapse)Author
2019-07-28Refactor idlist, move all global vars to local scopeOxore
- 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
2018-07-09Finish painter, refactor game logic & keys handlingOxore
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.
2018-07-03Refactor field, refactor next shape drawingOxore
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.
2018-07-02Introduce draw manager, refactor mainOxore
Move timers to struct game. Partially move field painting to draw manager.
2018-06-30Move all field&shape related funcs to field classOxore
2018-06-25Major refactoringOxore
Fix memleak in KeyMap, fix memleak caused by loading a yaml file in main.c. Change Copyright information. Rename functions.c and .h to engine.c and .h. Take field and shape related functions to separate file (still not all of them) and refactor them a lot. Refactor collision detection. Add more warnings. Add sanitizer option commented out.