summaryrefslogtreecommitdiff
path: root/src/main/game/domain/board.c
diff options
context:
space:
mode:
authorAlessandro Iezzi <aiezzi@alessandroiezzi.it>2025-05-22 18:59:46 +0200
committerAlessandro Iezzi <aiezzi@alessandroiezzi.it>2025-05-22 18:59:46 +0200
commita22c967a59a1e17663790db72f2d24edafc6199a (patch)
tree5aa0a60a4cba2b314f019bb0499a091e79f3fc13 /src/main/game/domain/board.c
parentcec27feccd1d3232ceae2bf284f66071d36cc96a (diff)
downloadtris-a22c967a59a1e17663790db72f2d24edafc6199a.tar.gz
tris-a22c967a59a1e17663790db72f2d24edafc6199a.zip
Remove the rendiring process of the lines
I've moved that inside the game rendering function.
Diffstat (limited to 'src/main/game/domain/board.c')
-rw-r--r--src/main/game/domain/board.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/game/domain/board.c b/src/main/game/domain/board.c
index e7ae40f..82b1784 100644
--- a/src/main/game/domain/board.c
+++ b/src/main/game/domain/board.c
@@ -20,6 +20,7 @@
#include <stdlib.h>
#include <log.h>
#include "board.h"
+#include "../../util/list.h"
static Log *log = NULL;
@@ -31,7 +32,7 @@ init_log(void)
}
Board *
-board_new(void)
+board_new(float left, float right, float top, float bottom, float box_size)
{
init_log();
@@ -45,5 +46,15 @@ board_new(void)
board->wining_color = color_new(0.0f, 0.5f, 0.0f, 1.0f);
board->draft_color = color_new(0.1f, 0.3f, 0.5f, 1.0f);
+ board->lines = list_create();
+
+ /* Vertical lines */
+ list_add(board->lines, engine_line_new(left + box_size, top, left + box_size, bottom));
+ list_add(board->lines, engine_line_new(right - box_size, top, right - box_size, bottom));
+
+ /* Horizontal lines */
+ list_add(board->lines, engine_line_new(left, top + box_size, right, top + box_size));
+ list_add(board->lines, engine_line_new(left, bottom - box_size, right, bottom - box_size));
+
return board;
}