aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2017-01-28 15:35:50 +1300
committerDavid Phillips <david@sighup.nz>2017-01-28 15:35:55 +1300
commitd7952dacbfa087dd70b574ccab69d3647ad21063 (patch)
tree64a7e7a9a70dd324cccef76665af7f5b551cde0c
parentb14637cc99e5fbed179307e8448dd618be6e461d (diff)
downloadtetris-d7952dacbfa087dd70b574ccab69d3647ad21063.tar.xz
Last adjustments: petty whitespace fixes
-rw-r--r--tetris.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/tetris.c b/tetris.c
index a33f219..cc42e8c 100644
--- a/tetris.c
+++ b/tetris.c
@@ -94,11 +94,11 @@ hit_floor(int x, int y, struct piece *held, struct colour* (*board)[WIDTH_CELLS]
py = 0;
while (py < 4 && (*held->bitmap)[px][py] == 0)
py++;
-
+
/* column has no cells? no collision possible. NEXT! */
if (py == 4)
continue;
-
+
while (py < 4 && (*held->bitmap)[px][py])
py++;
@@ -142,7 +142,6 @@ new_piece(struct piece *held)
update_bitmap(held);
}
-
void
rotate(struct piece *held, int direction)
{
@@ -157,7 +156,6 @@ rotate(struct piece *held, int direction)
update_bitmap(held);
}
-
void
clear_rows(struct colour* (*board)[WIDTH_CELLS][HEIGHT_CELLS])
{
@@ -173,11 +171,11 @@ clear_rows(struct colour* (*board)[WIDTH_CELLS][HEIGHT_CELLS])
}
if (!row)
continue;
-
+
for (y1 = y; y1 > 0; y1--)
for (x1 = 0; x1 < WIDTH_CELLS; x1++)
(*board)[x1][y1] = (*board)[x1][y1-1];
-
+
for (x1 = 0; x1 < WIDTH_CELLS; x1++)
(*board)[x1][y1] = &(palette[0]);
}
@@ -196,16 +194,16 @@ main_loop()
int last_y = 1;
struct piece held;
new_piece(&held);
-
+
for (y = 0; y < HEIGHT_CELLS; y++)
for (x = 0; x < WIDTH_CELLS; x++)
board[x][y] = &(palette[0]);
-
+
running = true;
last_x = last_y = x = y = 0;
SDL_AddTimer(500, &gravity_callback, NULL);
char lockout;
-
+
while (running) {
lockout = 0;
clear_rows(&board);