Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
- 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
|
|
|
|
Also rename arrKeys variable to keys.
|
|
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.
|
|
|
|
Split unicode routines from text.
Testing: add munit submodule, move translation units with main functions
to separate folder, make corresponding changes in Makefile. Make simple
test for unicode handling routine.
Remove _vimrc_local.
test.c: optimize includes.
Add test run to .travis.yml.
|
|
Introduce Pause mechanics and mention it in README.md.
Makefile: replace unnecessary "-MMD -MP" with just "-MD" flag, so it
allows to compile with tcc too.
Refactor: Rename game.isStarted field to game.started field. Move
arrKeys container to engine.c and remove it from main.c. Refactor char
iterator in utf8to32_strcpy function.
|
|
|
|
Refactor controls a little: move key repeat clocks reset to the keys
handler.
Refactor field: rename rotation function (add "clockwise" postfix).
|
|
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,
|
|
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.
|
|
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.
|
|
Move timers to struct game. Partially move field painting to draw
manager.
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|