From dc753ff2db5234dcfbac0eea4250e68d4455aef0 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Tue, 22 Oct 2019 12:56:52 -0400 Subject: greatly imporve memory usage of a game instance (5704 -> 788 bytes) --- frontends/gl/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'frontends/gl') diff --git a/frontends/gl/main.c b/frontends/gl/main.c index a9edd35..c1c6c2d 100644 --- a/frontends/gl/main.c +++ b/frontends/gl/main.c @@ -56,8 +56,8 @@ GLuint indices[] = { 1, 2, 3 // second triangle }; -rbg_color colors[8] = { - {0.0f, 0.0f, 0.0f}, // Black +rbg_color colors[7] = { + //{0.0f, 0.0f, 0.0f}, // Black {0.127f,0.219f,0.255f}, // Aqua {0.61f,0.153f,0.112f}, // Olive {0.177f,0.13f,0.201f}, // Purple @@ -236,8 +236,8 @@ int main(void) { glBindVertexArray(block.vao); for (int x = 0; x < CETRIS_BOARD_X; x++) { for (int y = 0; y < CETRIS_BOARD_Y; y++) { - if (cetris.board[x][y].occupied) { - update_block(&block, x, y, cetris.board[x][y].c); + if (cetris.board[x][y].flags & SLOT_OCCUPIED) { + update_block(&block, x, y, cetris.board[x][y].color); glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0); } } -- cgit v1.2.3-101-g0448