aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2025-02-28 14:07:27 -0500
committerSam Anthony <sam@samanthony.xyz>2025-02-28 14:07:27 -0500
commit9008c00fdfd144363fc6b8665d1a24d53a0a5092 (patch)
tree42fabdefe2a2db4e81191b7b32f73e6001f980b0
parent5beba4bea306dc0bbae9d1092fa187514ca96d98 (diff)
downloadvolute-9008c00fdfd144363fc6b8665d1a24d53a0a5092.zip
init Engine struct
-rw-r--r--Makefile4
-rw-r--r--engine.c9
-rw-r--r--engine.h2
3 files changed, 13 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index ec8d58b..37303d1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
CFLAGS = -std=c99 -Wall -Wextra -pedantic -Wno-deprecated-declarations -D_XOPEN_SOURCE=700L
LDFLAGS = -lSDL2 -lSDL2_ttf
-SRC = main.c microui.c renderer.c widget.c ui.c unit.c
+SRC = main.c microui.c renderer.c widget.c ui.c unit.c engine.c
OBJ = ${SRC:.c=.o}
all: volute
@@ -23,4 +23,4 @@ volute: ${OBJ}
%.o: %.c
${CC} -c ${CFLAGS} $<
-${OBJ}: microui.h renderer.h widget.h ui.h unit.h
+${OBJ}: microui.h renderer.h widget.h ui.h unit.h engine.h
diff --git a/engine.c b/engine.c
new file mode 100644
index 0000000..a7fbf11
--- /dev/null
+++ b/engine.c
@@ -0,0 +1,9 @@
+#include <string.h>
+
+#include "unit.h"
+#include "engine.h"
+
+void
+init_engine(Engine *e) {
+ memset(e, 0, sizeof(*e));
+}
diff --git a/engine.h b/engine.h
index 73b9746..3ec3dcf 100644
--- a/engine.h
+++ b/engine.h
@@ -4,3 +4,5 @@ typedef struct {
Pressure map;
Fraction ve;
} Engine;
+
+void init_engine(Engine *e);