From e809d5bbd063b3f5cd7a955c7c99417e02845c39 Mon Sep 17 00:00:00 2001
From: AnonymusRaccoon
Date: Fri, 21 Feb 2020 17:55:22 +0100
Subject: [PATCH 1/2] Starting the ui lib
---
CMakeLists.txt | 2 +-
Makefile | 2 +-
lib/gamacon | 2 +-
prefabs/game.gcprefab | 2 ++
4 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6422ef6..0f5b72c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -198,7 +198,7 @@ add_executable(My3D
lib/xmlparser/src/xmlparser.c
lib/xmlparser/src/xmlproperties.c
src/game_loader.c
- main.c)
+ main.c lib/gamacon/include/errors.h lib/gamacon/src/ui/button.c lib/gamacon/src/ui/setup_ui.c lib/gamacon/include/ui.h)
add_compile_options(-W -Wall -Wextra -Wshadow)
diff --git a/Makefile b/Makefile
index bf65782..8976365 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,7 @@ CC = gcc
all: build
-build: $(OBJ)
+$(NAME): $(OBJ)
$(MAKE) -C lib/gamacon
$(MAKE) -C lib/my
$(MAKE) -C lib/xmlparser
diff --git a/lib/gamacon b/lib/gamacon
index 1b3b69b..1a11c50 160000
--- a/lib/gamacon
+++ b/lib/gamacon
@@ -1 +1 @@
-Subproject commit 1b3b69b65b298eea3c4b98a3ce6392c54be1c1ed
+Subproject commit 1a11c5074a4d40df9c0bb1cdf9af4d275bc1a3dc
diff --git a/prefabs/game.gcprefab b/prefabs/game.gcprefab
index 20a1235..d7216f4 100644
--- a/prefabs/game.gcprefab
+++ b/prefabs/game.gcprefab
@@ -1,9 +1,11 @@
+
+
From b53c402626dc058d722aae3e485940a34b3da437 Mon Sep 17 00:00:00 2001
From: AnonymusRaccoon
Date: Tue, 25 Feb 2020 18:09:11 +0100
Subject: [PATCH 2/2] Making buttons
---
CMakeLists.txt | 2 +-
lib/gamacon | 2 +-
prefabs/game.gcprefab | 2 +-
src/game_loader.c | 4 ++++
src/interface.c | 10 ++++++++++
5 files changed, 17 insertions(+), 3 deletions(-)
create mode 100644 src/interface.c
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0f5b72c..19fc38b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -198,7 +198,7 @@ add_executable(My3D
lib/xmlparser/src/xmlparser.c
lib/xmlparser/src/xmlproperties.c
src/game_loader.c
- main.c lib/gamacon/include/errors.h lib/gamacon/src/ui/button.c lib/gamacon/src/ui/setup_ui.c lib/gamacon/include/ui.h)
+ main.c lib/gamacon/include/errors.h lib/gamacon/src/ui/button.c lib/gamacon/src/ui/setup_ui.c lib/gamacon/include/ui.h src/interface.c lib/gamacon/src/components/clickable_component.c lib/gamacon/include/components/clickable_component.h lib/gamacon/src/systems/clickable_system.c)
add_compile_options(-W -Wall -Wextra -Wshadow)
diff --git a/lib/gamacon b/lib/gamacon
index 1a11c50..a9ea841 160000
--- a/lib/gamacon
+++ b/lib/gamacon
@@ -1 +1 @@
-Subproject commit 1a11c5074a4d40df9c0bb1cdf9af4d275bc1a3dc
+Subproject commit a9ea84135c870db6ddd8ec571771549975a039aa
diff --git a/prefabs/game.gcprefab b/prefabs/game.gcprefab
index d7216f4..c58b3a1 100644
--- a/prefabs/game.gcprefab
+++ b/prefabs/game.gcprefab
@@ -5,7 +5,7 @@
-
+
diff --git a/src/game_loader.c b/src/game_loader.c
index 28d50a0..2a04858 100644
--- a/src/game_loader.c
+++ b/src/game_loader.c
@@ -12,12 +12,16 @@
#include
#include
+void test(gc_engine *engine, int entity_id);
+
int register_customcmps(gc_engine *engine)
{
engine->finish_physics(engine);
+ engine->add_callback(engine, "test", &test);
return (0);
}
+
int create_game_scene(gc_engine *engine, const char *map)
{
gc_scene *scene;
diff --git a/src/interface.c b/src/interface.c
new file mode 100644
index 0000000..8a0f9d4
--- /dev/null
+++ b/src/interface.c
@@ -0,0 +1,10 @@
+//
+// Created by anonymus-raccoon on 2/24/20.
+//
+
+#include "engine.h"
+
+void test(gc_engine *engine, int entity_id)
+{
+ printf("Test called.\n");
+}
\ No newline at end of file