summaryrefslogtreecommitdiff
path: root/src/painter.c
AgeCommit message (Collapse)Author
2019-08-13Add const qualifiers to some painter functionsOxore
2019-08-06Bring dependency on libf8 to painter module onlyOxore
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-12-07Fix lines longer than 80 chars, fix codestyle.plOxore
codestyle.pl: limit to `src` and `include` dirs only.
2018-12-06Add simple documentation in comments, refactor.Oxore
Change all `unsigned int` and `unsigned long` types to `size_t`. Fix names alignment in headers. Add documentation and simple description: Painter - painter.h Main - tetris.c Unicode - unicode.h IDList - idlist.h Engine - engine.c Minor changes: tetris.c - fix indentation and code blocks separation with newlines, remove unused includes. idlist.h - fix structure field name alignment. field.h, engine.c - define aliases for ghost and active shapes indexes in the field. engine.c - rename menuTick to snake case, fix curly braces style of functions. Makefile - switch SFML deprecated warnings off.
2018-07-11Migrate displayable text to utf32Oxore
2018-07-09Introduce phantom shape, refactor fieldOxore
Introduce phantom shape feature, yay! Refactor field: rename attribute of invisible empty cells, remove "color" member from struct shape, introduce shape movement functions with embedded collision checking and success reporting,
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.