girst [Tue, 22 May 2018 12:41:09 +0000 (14:41 +0200)]
game loop (restartable), fix memory leak
if we set respawn, we need to break out of the loop, otherwise `i' gets
->next'ed until i == NULL. then, spawn_item() will malloc() a new item,
and `i' was not freed(), but just NULL'd.
girst [Sat, 19 May 2018 23:18:42 +0000 (01:18 +0200)]
minor in-code cleanup, documentation
i wanted to remove the 'only draw diff'-todo and looked into where i was
calling show_playfield(). i didn't call it anywhere where i expected it,
so i fired up gdb. gdb told me show_playfield() gets called from the
input loop after the switch(getchar()). i was puzzled about that,
because it fired even when no keys were pressed. then i noticed that
everytime the signal handler fires, a STX (ASCII 0x02) gets pushed onto
stdin. WHO FIGURES?! i was unable to find anything in the
documentation of sigaction or on the internet that indicates this!