summaryrefslogtreecommitdiff
path: root/src/main/game/cell.c
diff options
context:
space:
mode:
authorAlessandro Iezzi <aiezzi@alessandroiezzi.it>2025-05-21 23:32:50 +0200
committerAlessandro Iezzi <aiezzi@alessandroiezzi.it>2025-05-21 23:32:50 +0200
commit7288bdd42360109f26a684431fa286ea265d07a4 (patch)
tree2dc070a742a3f61accbcf6f9afd8449d34dbd01c /src/main/game/cell.c
parent56ee373d51e6d3acf3e284a59c8f852913b82e64 (diff)
downloadtris-7288bdd42360109f26a684431fa286ea265d07a4.tar.gz
tris-7288bdd42360109f26a684431fa286ea265d07a4.zip
Remove util.* for the liblog
Diffstat (limited to 'src/main/game/cell.c')
-rw-r--r--src/main/game/cell.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/main/game/cell.c b/src/main/game/cell.c
index 892dd47..53d051a 100644
--- a/src/main/game/cell.c
+++ b/src/main/game/cell.c
@@ -19,15 +19,26 @@
#include <stdlib.h>
#include <stdbool.h>
+#include <log.h>
#include "cell.h"
-#include "../util.h"
+
+static Log *log = NULL;
+
+static void
+init_log(void)
+{
+ if (log != NULL) return;
+ log = log_create("Cell");
+}
Cell *
cell_new(float left, float right, float top, float bottom)
{
+ init_log();
+
Cell *cell = malloc(sizeof(Cell));
if (cell == NULL) {
- log_error("Error allocating memory for cell");
+ log_error(log, "Error allocating memory for cell");
exit(EXIT_FAILURE);
}
cell->left = left;