From 30df5445c762767263c3312560624476bac74c02 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Mar 2019 01:57:07 -1100 Subject: [PATCH] struct games_state *rs, --- src/cc/tetris.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cc/tetris.c b/src/cc/tetris.c index 4dbb71f89..1b039dc6f 100644 --- a/src/cc/tetris.c +++ b/src/cc/tetris.c @@ -295,7 +295,7 @@ static void tg_hold(struct games_state *rs,tetris_game *obj) /* Perform the action specified by the move. */ -static void tg_handle_move(tetris_game *obj, tetris_move move) +static void tg_handle_move(struct games_state *rs,tetris_game *obj, tetris_move move) { switch (move) { case TM_LEFT: @@ -305,7 +305,7 @@ static void tg_handle_move(tetris_game *obj, tetris_move move) tg_move(obj, 1); break; case TM_DROP: - tg_down(obj); + tg_down(rs,obj); break; case TM_CLOCK: tg_rotate(obj, 1); @@ -314,7 +314,7 @@ static void tg_handle_move(tetris_game *obj, tetris_move move) tg_rotate(obj, -1); break; case TM_HOLD: - tg_hold(obj); + tg_hold(rs,obj); break; default: // pass @@ -420,7 +420,7 @@ bool tg_tick(struct games_state *rs,tetris_game *obj, tetris_move move) tg_do_gravity_tick(rs,obj); // Handle input. - tg_handle_move(obj, move); + tg_handle_move(rs,obj, move); // Check for cleared lines lines_cleared = tg_check_lines(obj); @@ -444,7 +444,7 @@ void tg_init(struct games_state *rs,tetris_game *obj, int rows, int cols) obj->lines_remaining = LINES_PER_LEVEL; //srand(time(NULL)); tg_new_falling(rs,obj); - tg_new_falling(ts,obj); + tg_new_falling(rs,obj); obj->stored.typ = -1; obj->stored.ori = 0; obj->stored.loc.row = 0; @@ -728,9 +728,9 @@ int tetris(int argc, char **argv) fclose(f); } else { // Otherwise create new game. - tg = tg_create(22, 10); + tg = tg_create(rs,22, 10); }*/ - tg = tg_create(22, 10); + tg = tg_create(rs,22, 10); // NCURSES initialization: initscr(); // initialize curses