summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2019-10-29 00:48:04 -0400
committerAndrew Opalach <andrew@akon.city> 2019-10-29 00:48:04 -0400
commit5bc319e1a26b7d07728a364bd6c86b5a32ddcc2d (patch)
treeba22455c86cdf1c7f7132b6bbf5411d64578884b /lib
parentd5ac165fdeb7b0c596a1d95845262b68f35e14d7 (diff)
downloadcetris-5bc319e1a26b7d07728a364bd6c86b5a32ddcc2d.tar.gz
cetris-5bc319e1a26b7d07728a364bd6c86b5a32ddcc2d.tar.bz2
cetris-5bc319e1a26b7d07728a364bd6c86b5a32ddcc2d.zip
refactor sdl ui
Diffstat (limited to 'lib')
-rw-r--r--lib/cetris.c6
-rw-r--r--lib/timer.c2
2 files changed, 3 insertions, 5 deletions
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 <cetris.h>
#ifdef _WIN32
-#include <window.h>
+#include <windows.h>
#if CETRIS_HI_RES
DWORD WINAPI cetris_game_loop(void* data) {