From 2d6649e700cf40b5a2b89ebe7d8fa7d318ee68e3 Mon Sep 17 00:00:00 2001 From: Quinn Date: Wed, 29 Jan 2025 18:03:15 +0100 Subject: [PATCH] fix: bottom row not being cleared in double row --- src/game/tetromino/placing.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/game/tetromino/placing.c b/src/game/tetromino/placing.c index 82a4178..4679fe1 100644 --- a/src/game/tetromino/placing.c +++ b/src/game/tetromino/placing.c @@ -1,6 +1,7 @@ #include "placing.h" #include +#include #include "../../window/colour.h" #include "../game.h" @@ -31,13 +32,16 @@ static void clear_rows(Row* row) { // zero out the cache for (int8_t x = 0; x < COLUMNS; x++) - row_cache[x].packed = 0; + row[i][x].packed = 0; // write the cached address to a row starting from the top - row[filled] = row_cache; - filled++; + row[filled++] = row_cache; row[i] = row[i - filled]; + y--; } + + if (filled > 0) + printf("filled: %i\n", filled); } // sets a shape to the screen