From 5bc319e1a26b7d07728a364bd6c86b5a32ddcc2d Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Tue, 29 Oct 2019 00:48:04 -0400 Subject: refactor sdl ui --- lib/cetris.c | 6 ++---- lib/timer.c | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/cetris.c b/lib/cetris.c index 288b82b..3bff1f1 100644 --- a/lib/cetris.c +++ b/lib/cetris.c @@ -403,9 +403,9 @@ void update_board(cetris_game *g) { CETRIS_EXPORT void hold_piece(cetris_game *g) { if (g->current.held) return; if (g->piece_held) { - tetrimino tmp = g->current; + uint8_t tmp = g->current.t; g->current = g->held; - g->held = tmp; + set_piece(g, tmp, &g->held); } else { set_piece(g, g->current.t, &g->held); g->piece_held = true; @@ -582,5 +582,3 @@ CETRIS_EXPORT bool update_game_tick(cetris_game *g) { return true; } - - diff --git a/lib/timer.c b/lib/timer.c index 0a1504c..8b7b221 100644 --- a/lib/timer.c +++ b/lib/timer.c @@ -1,7 +1,7 @@ #include #ifdef _WIN32 -#include +#include #if CETRIS_HI_RES DWORD WINAPI cetris_game_loop(void* data) { -- cgit v1.2.3-101-g0448