From d13d4ece9a2befd9ce27e9a0831148dd988637f3 Mon Sep 17 00:00:00 2001 From: John Alanbrook Date: Fri, 16 Dec 2022 19:54:08 +0000 Subject: [PATCH] Add scheme gui_hook --- source/engine/gameobject.c | 1 + source/engine/mrbffi.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/source/engine/gameobject.c b/source/engine/gameobject.c index 9a5b1ac..7169480 100644 --- a/source/engine/gameobject.c +++ b/source/engine/gameobject.c @@ -118,6 +118,7 @@ void gameobject_makefromprefab(char *path) { FILE *fprefab = fopen(path, "rb"); if (fprefab == NULL) { + YughError("Could not find prefab %s.", path); return; } diff --git a/source/engine/mrbffi.c b/source/engine/mrbffi.c index 3ec513d..01d824c 100644 --- a/source/engine/mrbffi.c +++ b/source/engine/mrbffi.c @@ -179,6 +179,13 @@ s7_pointer s7_sound_cmd(s7_scheme *sc, s7_pointer args) { return args; } +s7_pointer s7_gui_hook(s7_scheme *sc, s7_pointer args) { + s7_pointer cb = s7_car(args); + script_call_sym(cb); + + return cb; +} + /* mrb_value mrb_nuke_cb(mrb_state *mrb, mrb_value self) { mrb_float win; @@ -214,5 +221,6 @@ void ffi_load() { S7_FUNC(gen_cmd, 2); S7_FUNC(sys_cmd, 1); S7_FUNC(sound_cmd, 2); + S7_FUNC(gui_hook, 1); }