diff options
| author | 2019-10-29 22:05:15 -0400 | |
|---|---|---|
| committer | 2019-10-29 22:05:15 -0400 | |
| commit | 88273a11a0f2d93bd04ef02cbc875a47926bf7c0 (patch) | |
| tree | 7daf70165b30976b1c41ebbaa4f29c061829b3b9 /lib | |
| parent | 0727b1e4c3eef30710738127326349eb44b608df (diff) | |
| download | cetris-88273a11a0f2d93bd04ef02cbc875a47926bf7c0.tar.gz cetris-88273a11a0f2d93bd04ef02cbc875a47926bf7c0.tar.bz2 cetris-88273a11a0f2d93bd04ef02cbc875a47926bf7c0.zip | |
optimize rendering, and make events queues
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/cetris.c | 4 | ||||
| -rw-r--r-- | lib/cetris.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/cetris.c b/lib/cetris.c index c6aeeea..e2acdec 100644 --- a/lib/cetris.c +++ b/lib/cetris.c @@ -226,7 +226,7 @@ static void lock_current(cetris_game *g) { } g->current.locked = true; - g->lock_event = true; + g->lock_event++; update_board(g); } @@ -394,7 +394,7 @@ void update_board(cetris_game *g) { g->lines += lines_cleared; if (lines_cleared > 0) { g->line_combo++; - g->line_event = true; + g->line_event++; } if (g->lines >= (g->level * 10)) { g->level++; diff --git a/lib/cetris.h b/lib/cetris.h index 22723b0..435a98d 100644 --- a/lib/cetris.h +++ b/lib/cetris.h @@ -144,8 +144,8 @@ struct cetris_game { bool game_over; // events - bool line_event; - bool lock_event; + uint8_t line_event; + uint8_t lock_event; // scoring flags bool tspin; |