summaryrefslogtreecommitdiff
path: root/src/main/game/cell.c
diff options
context:
space:
mode:
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;