diff --git a/MAKE.bat b/MAKE.bat
index 3de7506..2abae6b 100644
--- a/MAKE.bat
+++ b/MAKE.bat
@@ -819,7 +819,7 @@ rem editor
if "!editor!"=="yes" (
set edit=-DCOOK_ON_DEMAND
rem set edit=-DUI_LESSER_SPACING -DUI_ICONS_SMALL !edit!
-!echo! editor && !cc! !o! editor.exe engine\editor.c !edit! -Iengine/joint !args! || set rc=1
+!echo! editor && !cc! !o! editor.exe engine\editor.c engine\v4k.c !edit! -Iengine/joint !args! || set rc=1
rem if "!cc!"=="cl" (
rem set plug_export=/LD
diff --git a/README.md b/README.md
index 47b3275..50026c7 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-
![V·4·K](https://v4k.dev/logo.png)
+
Envision, Prototype, Perfect
diff --git a/bind/v4k.lua b/bind/v4k.lua
index 107db3d..94a547b 100644
--- a/bind/v4k.lua
+++ b/bind/v4k.lua
@@ -1529,6 +1529,72 @@ ffi.cdef([[
//lcpp INF [0000] vec2: macro name but used as C declaration in:API vec2 window_dpi();
//lcpp INF [0000] vec2: macro name but used as C declaration in:STATIC vec2 window_dpi();
//lcpp INF [0000] vec2: macro name but used as C declaration in: vec2 window_dpi();
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_open_map_t; API editor_open_map_t *editor_open_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; API int editor_open(const void *obj); API void editor_setopen(const void *obj, int value); API void editor_altopen(const void *obj); API void editor_noopen(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_open_map_t; API editor_open_map_t *editor_open_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; API int editor_open(const void *obj); API void editor_setopen(const void *obj, int value); API void editor_altopen(const void *obj); API void editor_noopen(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_open_map_t; STATIC editor_open_map_t *editor_open_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; STATIC int editor_open(const void *obj); STATIC void editor_setopen(const void *obj, int value); STATIC void editor_altopen(const void *obj); STATIC void editor_noopen(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_open_map_t; STATIC editor_open_map_t *editor_open_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; STATIC int editor_open(const void *obj); STATIC void editor_setopen(const void *obj, int value); STATIC void editor_altopen(const void *obj); STATIC void editor_noopen(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_open_map_t; editor_open_map_t *editor_open_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_open(const void *obj); void editor_setopen(const void *obj, int value); void editor_altopen(const void *obj); void editor_noopen(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_open_map_t; editor_open_map_t *editor_open_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_open(const void *obj); void editor_setopen(const void *obj, int value); void editor_altopen(const void *obj); void editor_noopen(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_selected_map_t; API editor_selected_map_t *editor_selected_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; API int editor_selected(const void *obj); API void editor_setselected(const void *obj, int value); API void editor_altselected(const void *obj); API void editor_noselected(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_selected_map_t; API editor_selected_map_t *editor_selected_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; API int editor_selected(const void *obj); API void editor_setselected(const void *obj, int value); API void editor_altselected(const void *obj); API void editor_noselected(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_selected_map_t; STATIC editor_selected_map_t *editor_selected_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; STATIC int editor_selected(const void *obj); STATIC void editor_setselected(const void *obj, int value); STATIC void editor_altselected(const void *obj); STATIC void editor_noselected(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_selected_map_t; STATIC editor_selected_map_t *editor_selected_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; STATIC int editor_selected(const void *obj); STATIC void editor_setselected(const void *obj, int value); STATIC void editor_altselected(const void *obj); STATIC void editor_noselected(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_selected_map_t; editor_selected_map_t *editor_selected_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_selected(const void *obj); void editor_setselected(const void *obj, int value); void editor_altselected(const void *obj); void editor_noselected(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_selected_map_t; editor_selected_map_t *editor_selected_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_selected(const void *obj); void editor_setselected(const void *obj, int value); void editor_altselected(const void *obj); void editor_noselected(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_changed_map_t; API editor_changed_map_t *editor_changed_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; API int editor_changed(const void *obj); API void editor_setchanged(const void *obj, int value); API void editor_altchanged(const void *obj); API void editor_nochanged(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_changed_map_t; API editor_changed_map_t *editor_changed_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; API int editor_changed(const void *obj); API void editor_setchanged(const void *obj, int value); API void editor_altchanged(const void *obj); API void editor_nochanged(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_changed_map_t; STATIC editor_changed_map_t *editor_changed_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; STATIC int editor_changed(const void *obj); STATIC void editor_setchanged(const void *obj, int value); STATIC void editor_altchanged(const void *obj); STATIC void editor_nochanged(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_changed_map_t; STATIC editor_changed_map_t *editor_changed_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; STATIC int editor_changed(const void *obj); STATIC void editor_setchanged(const void *obj, int value); STATIC void editor_altchanged(const void *obj); STATIC void editor_nochanged(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_changed_map_t; editor_changed_map_t *editor_changed_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_changed(const void *obj); void editor_setchanged(const void *obj, int value); void editor_altchanged(const void *obj); void editor_nochanged(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_changed_map_t; editor_changed_map_t *editor_changed_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_changed(const void *obj); void editor_setchanged(const void *obj, int value); void editor_altchanged(const void *obj); void editor_nochanged(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_popup_map_t; API editor_popup_map_t *editor_popup_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; API int editor_popup(const void *obj); API void editor_setpopup(const void *obj, int value); API void editor_altpopup(const void *obj); API void editor_nopopup(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_popup_map_t; API editor_popup_map_t *editor_popup_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; API int editor_popup(const void *obj); API void editor_setpopup(const void *obj, int value); API void editor_altpopup(const void *obj); API void editor_nopopup(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_popup_map_t; STATIC editor_popup_map_t *editor_popup_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; STATIC int editor_popup(const void *obj); STATIC void editor_setpopup(const void *obj, int value); STATIC void editor_altpopup(const void *obj); STATIC void editor_nopopup(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_popup_map_t; STATIC editor_popup_map_t *editor_popup_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; STATIC int editor_popup(const void *obj); STATIC void editor_setpopup(const void *obj, int value); STATIC void editor_altpopup(const void *obj); STATIC void editor_nopopup(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_popup_map_t; editor_popup_map_t *editor_popup_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_popup(const void *obj); void editor_setpopup(const void *obj, int value); void editor_altpopup(const void *obj); void editor_nopopup(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_popup_map_t; editor_popup_map_t *editor_popup_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_popup(const void *obj); void editor_setpopup(const void *obj, int value); void editor_altpopup(const void *obj); void editor_nopopup(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_bookmarked_map_t; API editor_bookmarked_map_t *editor_bookmarked_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; API int editor_bookmarked(const void *obj); API void editor_setbookmarked(const void *obj, int value); API void editor_altbookmarked(const void *obj); API void editor_nobookmarked(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_bookmarked_map_t; API editor_bookmarked_map_t *editor_bookmarked_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; API int editor_bookmarked(const void *obj); API void editor_setbookmarked(const void *obj, int value); API void editor_altbookmarked(const void *obj); API void editor_nobookmarked(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_bookmarked_map_t; STATIC editor_bookmarked_map_t *editor_bookmarked_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; STATIC int editor_bookmarked(const void *obj); STATIC void editor_setbookmarked(const void *obj, int value); STATIC void editor_altbookmarked(const void *obj); STATIC void editor_nobookmarked(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_bookmarked_map_t; STATIC editor_bookmarked_map_t *editor_bookmarked_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; STATIC int editor_bookmarked(const void *obj); STATIC void editor_setbookmarked(const void *obj, int value); STATIC void editor_altbookmarked(const void *obj); STATIC void editor_nobookmarked(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_bookmarked_map_t; editor_bookmarked_map_t *editor_bookmarked_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_bookmarked(const void *obj); void editor_setbookmarked(const void *obj, int value); void editor_altbookmarked(const void *obj); void editor_nobookmarked(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_bookmarked_map_t; editor_bookmarked_map_t *editor_bookmarked_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_bookmarked(const void *obj); void editor_setbookmarked(const void *obj, int value); void editor_altbookmarked(const void *obj); void editor_nobookmarked(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_visible_map_t; API editor_visible_map_t *editor_visible_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; API int editor_visible(const void *obj); API void editor_setvisible(const void *obj, int value); API void editor_altvisible(const void *obj); API void editor_novisible(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_visible_map_t; API editor_visible_map_t *editor_visible_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; API int editor_visible(const void *obj); API void editor_setvisible(const void *obj, int value); API void editor_altvisible(const void *obj); API void editor_novisible(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_visible_map_t; STATIC editor_visible_map_t *editor_visible_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; STATIC int editor_visible(const void *obj); STATIC void editor_setvisible(const void *obj, int value); STATIC void editor_altvisible(const void *obj); STATIC void editor_novisible(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_visible_map_t; STATIC editor_visible_map_t *editor_visible_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; STATIC int editor_visible(const void *obj); STATIC void editor_setvisible(const void *obj, int value); STATIC void editor_altvisible(const void *obj); STATIC void editor_novisible(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_visible_map_t; editor_visible_map_t *editor_visible_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_visible(const void *obj); void editor_setvisible(const void *obj, int value); void editor_altvisible(const void *obj); void editor_novisible(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_visible_map_t; editor_visible_map_t *editor_visible_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_visible(const void *obj); void editor_setvisible(const void *obj, int value); void editor_altvisible(const void *obj); void editor_novisible(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_script_map_t; API editor_script_map_t *editor_script_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; API int editor_script(const void *obj); API void editor_setscript(const void *obj, int value); API void editor_altscript(const void *obj); API void editor_noscript(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_script_map_t; API editor_script_map_t *editor_script_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; API int editor_script(const void *obj); API void editor_setscript(const void *obj, int value); API void editor_altscript(const void *obj); API void editor_noscript(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_script_map_t; STATIC editor_script_map_t *editor_script_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; STATIC int editor_script(const void *obj); STATIC void editor_setscript(const void *obj, int value); STATIC void editor_altscript(const void *obj); STATIC void editor_noscript(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_script_map_t; STATIC editor_script_map_t *editor_script_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; STATIC int editor_script(const void *obj); STATIC void editor_setscript(const void *obj, int value); STATIC void editor_altscript(const void *obj); STATIC void editor_noscript(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_script_map_t; editor_script_map_t *editor_script_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_script(const void *obj); void editor_setscript(const void *obj, int value); void editor_altscript(const void *obj); void editor_noscript(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_script_map_t; editor_script_map_t *editor_script_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_script(const void *obj); void editor_setscript(const void *obj, int value); void editor_altscript(const void *obj); void editor_noscript(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_event_map_t; API editor_event_map_t *editor_event_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; API int editor_event(const void *obj); API void editor_setevent(const void *obj, int value); API void editor_altevent(const void *obj); API void editor_noevent(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_event_map_t; API editor_event_map_t *editor_event_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; API int editor_event(const void *obj); API void editor_setevent(const void *obj, int value); API void editor_altevent(const void *obj); API void editor_noevent(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_event_map_t; STATIC editor_event_map_t *editor_event_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; STATIC int editor_event(const void *obj); STATIC void editor_setevent(const void *obj, int value); STATIC void editor_altevent(const void *obj); STATIC void editor_noevent(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_event_map_t; STATIC editor_event_map_t *editor_event_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; STATIC int editor_event(const void *obj); STATIC void editor_setevent(const void *obj, int value); STATIC void editor_altevent(const void *obj); STATIC void editor_noevent(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_event_map_t; editor_event_map_t *editor_event_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_event(const void *obj); void editor_setevent(const void *obj, int value); void editor_altevent(const void *obj); void editor_noevent(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_event_map_t; editor_event_map_t *editor_event_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_event(const void *obj); void editor_setevent(const void *obj, int value); void editor_altevent(const void *obj); void editor_noevent(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; char* val; } tmp, *ptr; char** tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_iconinstance_map_t; API editor_iconinstance_map_t *editor_iconinstance_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; API char* editor_iconinstance(const void *obj); API void editor_seticoninstance(const void *obj, char* value); API void editor_alticoninstance(const void *obj); API void editor_noiconinstance(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; char* val; } tmp, *ptr; char** tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_iconinstance_map_t; API editor_iconinstance_map_t *editor_iconinstance_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; API char* editor_iconinstance(const void *obj); API void editor_seticoninstance(const void *obj, char* value); API void editor_alticoninstance(const void *obj); API void editor_noiconinstance(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; char* val; } tmp, *ptr; char** tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_iconinstance_map_t; STATIC editor_iconinstance_map_t *editor_iconinstance_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; STATIC char* editor_iconinstance(const void *obj); STATIC void editor_seticoninstance(const void *obj, char* value); STATIC void editor_alticoninstance(const void *obj); STATIC void editor_noiconinstance(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; char* val; } tmp, *ptr; char** tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_iconinstance_map_t; STATIC editor_iconinstance_map_t *editor_iconinstance_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; STATIC char* editor_iconinstance(const void *obj); STATIC void editor_seticoninstance(const void *obj, char* value); STATIC void editor_alticoninstance(const void *obj); STATIC void editor_noiconinstance(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; char* val; } tmp, *ptr; char** tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_iconinstance_map_t; editor_iconinstance_map_t *editor_iconinstance_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; char* editor_iconinstance(const void *obj); void editor_seticoninstance(const void *obj, char* value); void editor_alticoninstance(const void *obj); void editor_noiconinstance(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; char* val; } tmp, *ptr; char** tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_iconinstance_map_t; editor_iconinstance_map_t *editor_iconinstance_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; char* editor_iconinstance(const void *obj); void editor_seticoninstance(const void *obj, char* value); void editor_alticoninstance(const void *obj); void editor_noiconinstance(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; char* val; } tmp, *ptr; char** tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_iconclass_map_t; API editor_iconclass_map_t *editor_iconclass_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; API char* editor_iconclass(const void *obj); API void editor_seticonclass(const void *obj, char* value); API void editor_alticonclass(const void *obj); API void editor_noiconclass(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; char* val; } tmp, *ptr; char** tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_iconclass_map_t; API editor_iconclass_map_t *editor_iconclass_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; API char* editor_iconclass(const void *obj); API void editor_seticonclass(const void *obj, char* value); API void editor_alticonclass(const void *obj); API void editor_noiconclass(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; char* val; } tmp, *ptr; char** tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_iconclass_map_t; STATIC editor_iconclass_map_t *editor_iconclass_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; STATIC char* editor_iconclass(const void *obj); STATIC void editor_seticonclass(const void *obj, char* value); STATIC void editor_alticonclass(const void *obj); STATIC void editor_noiconclass(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; char* val; } tmp, *ptr; char** tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_iconclass_map_t; STATIC editor_iconclass_map_t *editor_iconclass_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; STATIC char* editor_iconclass(const void *obj); STATIC void editor_seticonclass(const void *obj, char* value); STATIC void editor_alticonclass(const void *obj); STATIC void editor_noiconclass(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; char* val; } tmp, *ptr; char** tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_iconclass_map_t; editor_iconclass_map_t *editor_iconclass_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; char* editor_iconclass(const void *obj); void editor_seticonclass(const void *obj, char* value); void editor_alticonclass(const void *obj); void editor_noiconclass(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; char* val; } tmp, *ptr; char** tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_iconclass_map_t; editor_iconclass_map_t *editor_iconclass_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; char* editor_iconclass(const void *obj); void editor_seticonclass(const void *obj, char* value); void editor_alticonclass(const void *obj); void editor_noiconclass(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_treeoffsety_map_t; API editor_treeoffsety_map_t *editor_treeoffsety_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; API int editor_treeoffsety(const void *obj); API void editor_settreeoffsety(const void *obj, int value); API void editor_alttreeoffsety(const void *obj); API void editor_notreeoffsety(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_treeoffsety_map_t; API editor_treeoffsety_map_t *editor_treeoffsety_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; API int editor_treeoffsety(const void *obj); API void editor_settreeoffsety(const void *obj, int value); API void editor_alttreeoffsety(const void *obj); API void editor_notreeoffsety(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_treeoffsety_map_t; STATIC editor_treeoffsety_map_t *editor_treeoffsety_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; STATIC int editor_treeoffsety(const void *obj); STATIC void editor_settreeoffsety(const void *obj, int value); STATIC void editor_alttreeoffsety(const void *obj); STATIC void editor_notreeoffsety(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_treeoffsety_map_t; STATIC editor_treeoffsety_map_t *editor_treeoffsety_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; STATIC int editor_treeoffsety(const void *obj); STATIC void editor_settreeoffsety(const void *obj, int value); STATIC void editor_alttreeoffsety(const void *obj); STATIC void editor_notreeoffsety(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_treeoffsety_map_t; editor_treeoffsety_map_t *editor_treeoffsety_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_treeoffsety(const void *obj); void editor_settreeoffsety(const void *obj, int value); void editor_alttreeoffsety(const void *obj); void editor_notreeoffsety(void *obj);;
+//lcpp INF [0000] map: macro name but used as C declaration in:typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_treeoffsety_map_t; editor_treeoffsety_map_t *editor_treeoffsety_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_treeoffsety(const void *obj); void editor_settreeoffsety(const void *obj, int value); void editor_alttreeoffsety(const void *obj); void editor_notreeoffsety(void *obj);;
//lcpp INF [0000] vec3: macro name but used as C declaration in:API vec3 editor_pick(float mouse_x, float mouse_y);
//lcpp INF [0000] vec3: macro name but used as C declaration in:STATIC vec3 editor_pick(float mouse_x, float mouse_y);
//lcpp INF [0000] vec3: macro name but used as C declaration in: vec3 editor_pick(float mouse_x, float mouse_y);
@@ -1805,10 +1871,10 @@ typedef float mat44[16];
void print33( float *m );
void print34( float *m );
void print44( float *m );
-uintptr_t id_make(void *ptr);
-void * id_handle(uintptr_t id);
-void id_dispose(uintptr_t id);
-bool id_valid(uintptr_t id);
+ uintptr_t id_make(void *ptr);
+ void * id_handle(uintptr_t id);
+ void id_dispose(uintptr_t id);
+ bool id_valid(uintptr_t id);
typedef struct obj { struct { ifdef(debug, const char *objname;) union { uintptr_t objheader; struct { uintptr_t objtype:8; uintptr_t objsizew:8; uintptr_t objrefs:8; uintptr_t objheap:1; uintptr_t objcomps:1; uintptr_t objunused:64-8-8-8-1-1-16-3; uintptr_t objid:16+3; }; }; struct obj** objchildren; }; } obj;
typedef struct entity { struct { struct { ifdef(debug, const char *objname;) union { uintptr_t objheader; struct { uintptr_t objtype:8; uintptr_t objsizew:8; uintptr_t objrefs:8; uintptr_t objheap:1; uintptr_t objcomps:1; uintptr_t objunused:64-8-8-8-1-1-16-3; uintptr_t objid:16+3; }; }; struct obj** objchildren; }; union { struct { uintptr_t objenabled:32, objflagged:32; }; uintptr_t cflags; }; void *c[32]; }; } entity;
obj *objtmp;
@@ -1824,8 +1890,10 @@ void* obj_free(void *o);
extern int (*obj_tick[256])();
extern int (*obj_draw[256])();
extern int (*obj_lerp[256])();
- extern int (*obj_edit[256])();
extern int (*obj_aabb[256])();
+ extern int (*obj_edit[256])();
+ extern int (*obj_menu[256])();
+ extern char* (*obj_icon[256])();
extern const char*OBJTYPES[256];
uintptr_t obj_header(const void *o);
uintptr_t obj_id(const void *o);
@@ -3118,7 +3186,7 @@ unsigned play;
bool paused;
struct atlas_t *a;
} sprite_t;
-enum { OBJTYPE_sprite_t = 10 }; typedef struct { unsigned static_assert_on_L__LINE__ : !!(10 <= 255); } static_assert_on_Lconcat(_L,3777)___COUNTER__; typedef struct { unsigned static_assert_on_L__LINE__ : !!(sizeof(sprite_t)); } static_assert_on_Lconcat(_L,3777)___COUNTER__;;
+enum { OBJTYPE_sprite_t = 10 }; typedef struct { unsigned static_assert_on_L__LINE__ : !!(10 <= 255); } static_assert_on_Lconcat(_L,3780)___COUNTER__; typedef struct { unsigned static_assert_on_L__LINE__ : !!(sizeof(sprite_t)); } static_assert_on_Lconcat(_L,3780)___COUNTER__;;
void sprite_ctor(sprite_t *s);
void sprite_dtor(sprite_t *s);
void sprite_tick(sprite_t *s);
@@ -3491,6 +3559,53 @@ CURSOR_SW_AUTO,
void window_cursor_shape(unsigned shape);
const char *window_clipboard();
void window_setclipboard(const char *text);
+typedef struct editor_bind_t {
+const char *command;
+const char *bindings;
+void (*fn)();
+} editor_bind_t;
+ void editor_addbind(editor_bind_t bind);
+typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_open_map_t; editor_open_map_t *editor_open_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_open(const void *obj); void editor_setopen(const void *obj, int value); void editor_altopen(const void *obj); void editor_noopen(void *obj);;
+typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_selected_map_t; editor_selected_map_t *editor_selected_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_selected(const void *obj); void editor_setselected(const void *obj, int value); void editor_altselected(const void *obj); void editor_noselected(void *obj);;
+typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_changed_map_t; editor_changed_map_t *editor_changed_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_changed(const void *obj); void editor_setchanged(const void *obj, int value); void editor_altchanged(const void *obj); void editor_nochanged(void *obj);;
+typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_popup_map_t; editor_popup_map_t *editor_popup_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_popup(const void *obj); void editor_setpopup(const void *obj, int value); void editor_altpopup(const void *obj); void editor_nopopup(void *obj);;
+typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_bookmarked_map_t; editor_bookmarked_map_t *editor_bookmarked_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_bookmarked(const void *obj); void editor_setbookmarked(const void *obj, int value); void editor_altbookmarked(const void *obj); void editor_nobookmarked(void *obj);;
+typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_visible_map_t; editor_visible_map_t *editor_visible_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_visible(const void *obj); void editor_setvisible(const void *obj, int value); void editor_altvisible(const void *obj); void editor_novisible(void *obj);;
+typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_script_map_t; editor_script_map_t *editor_script_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_script(const void *obj); void editor_setscript(const void *obj, int value); void editor_altscript(const void *obj); void editor_noscript(void *obj);;
+typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_event_map_t; editor_event_map_t *editor_event_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_event(const void *obj); void editor_setevent(const void *obj, int value); void editor_altevent(const void *obj); void editor_noevent(void *obj);;
+typedef struct { map base; struct { pair p; void* key; char* val; } tmp, *ptr; char** tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_iconinstance_map_t; editor_iconinstance_map_t *editor_iconinstance_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; char* editor_iconinstance(const void *obj); void editor_seticoninstance(const void *obj, char* value); void editor_alticoninstance(const void *obj); void editor_noiconinstance(void *obj);;
+typedef struct { map base; struct { pair p; void* key; char* val; } tmp, *ptr; char** tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_iconclass_map_t; editor_iconclass_map_t *editor_iconclass_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; char* editor_iconclass(const void *obj); void editor_seticonclass(const void *obj, char* value); void editor_alticonclass(const void *obj); void editor_noiconclass(void *obj);;
+typedef struct { map base; struct { pair p; void* key; int val; } tmp, *ptr; int* tmpval; int (*typed_cmp)(void*, void*); uint64_t (*typed_hash)(void*); } * editor_treeoffsety_map_t; editor_treeoffsety_map_t *editor_treeoffsety_struct { map base; struct { pair p; key; val; } tmp, *ptr; * tmpval; int (*typed_cmp)(, ); uint64_t (*typed_hash)(); } *; int editor_treeoffsety(const void *obj); void editor_settreeoffsety(const void *obj, int value); void editor_alttreeoffsety(const void *obj); void editor_notreeoffsety(void *obj);;
+ void editor_destroy_properties(void *o);
+ void editor_load_on_boot(void);
+ void editor_save_on_quit(void);
+enum {
+EDITOR_PANEL,
+EDITOR_WINDOW,
+EDITOR_WINDOW_NK,
+EDITOR_WINDOW_NK_SMALL,
+};
+ int editor_begin(const char *title, int mode);
+ int editor_end(int mode);
+ int editor_filter();
+ void editor_select(const char *mask);
+ void editor_unselect();
+ void editor_select_aabb(aabb box);
+ void editor_selectgroup(obj *first, obj *last);
+ void* editor_first_selected();
+ void* editor_last_selected();
+ void editor_addtoworld(obj *o);
+ void editor_watch(const void *o);
+ void* editor_spawn(const char *ini);
+ void editor_spawn1();
+ void editor_destroy_selected();
+ void editor_inspect(obj *o);
+ int editor_send(const char *cmd);
+ const char* editor_recv(int jobid, double timeout_ss);
+ void editor_pump();
+ void editor_symbol(int x, int y, const char *sym);
+ void editor_frame( void (*game)(unsigned, float, double) );
+ void editor_gizmos(int dim);
int editor_send(const char *command);
vec3 editor_pick(float mouse_x, float mouse_y);
char* editor_path(const char *path);
diff --git a/engine/editor.c b/engine/editor.c
index aaf7378..c74a773 100644
--- a/engine/editor.c
+++ b/engine/editor.c
@@ -1,7 +1,19 @@
-#define COOK_ON_DEMAND 1 // @fixme: these directives should be on client, not within v4k.dll
-#define ENABLE_AUTOTESTS 1
-#include "v4k.c"
-//#include "../tools/labs/objtests.h"
+#include "v4k.h"
+#include "split/3rd_icon_mdi.h"
+
+#if 0 // v4k_pack proposal
+static __thread char* mpin;
+static __thread unsigned mpinlen;
+static __thread char mpinbuf[256];
+static __thread char* mpout;
+static __thread unsigned mpoutlen;
+static __thread char mpoutbuf[256];
+#define PACKMSG(...) (msgpack_new(mpin = mpinbuf, mpinlen = sizeof(mpinbuf)), mpinlen = msgpack(__VA_ARGS__), cobs_encode(mpin, mpinlen, mpout = mpoutbuf, mpoutlen = cobs_bounds(mpinlen)), mpout)
+#define UNPACKMSG(ptr,fmt,...) (mpin = (char*)ptr, mpinlen = strlen(ptr), mpout = mpoutbuf, mpoutlen = sizeof(mpoutbuf), mpoutlen = cobs_decode(mpin, mpinlen, mpout, mpoutlen), msgunpack_new(mpout, mpoutlen) && msgunpack(fmt, __VA_ARGS__))
+#endif
+
+TODO("COOK_ON_DEMAND 1: this directive should be on client, not within v4k.dll");
+TODO("ENABLE_AUTOTESTS 1: this directive should be on client, not within v4k.dll");
// ----------------------------------------------------------------------------
@@ -56,16 +68,6 @@ TODO("obj: free obj_components()/payload2");
TODO("pack: mp2json, json2mp");
TODO("pack: simplify msgpack API, make it growth similar to va()")
-#if 0 // v4k_pack proposal
-static __thread char* mpin;
-static __thread unsigned mpinlen;
-static __thread char mpinbuf[256];
-static __thread char* mpout;
-static __thread unsigned mpoutlen;
-static __thread char mpoutbuf[256];
-#define PACKMSG(...) (msgpack_new(mpin = mpinbuf, mpinlen = sizeof(mpinbuf)), mpinlen = msgpack(__VA_ARGS__), cobs_encode(mpin, mpinlen, mpout = mpoutbuf, mpoutlen = cobs_bounds(mpinlen)), mpout)
-#define UNPACKMSG(ptr,fmt,...) (mpin = (char*)ptr, mpinlen = strlen(ptr), mpout = mpoutbuf, mpoutlen = sizeof(mpoutbuf), mpoutlen = cobs_decode(mpin, mpinlen, mpout, mpoutlen), msgunpack_new(mpout, mpoutlen) && msgunpack(fmt, __VA_ARGS__))
-#endif
TODO("serialize array(types)")
TODO("serialize map(char*,types)")
@@ -82,6 +84,7 @@ TODO("bug: lite key bindings are being sent to editor")
TODO("bug: not sending quit signal to lite neither at window close nor editor close (see: temporary files)")
TODO("bug: missing search results window")
TODO("bug: missing code completions popup")
+
// TODO("eval: https://github.com/drmargarido/linters")
// TODO("eval: https://github.com/monolifed/theme16")
// TODO("eval: https://github.com/vincens2005/lite-formatters")
@@ -90,76 +93,6 @@ TODO("bug: missing code completions popup")
// https://github.com/rxi/lite/commit/236a585756cb9fa70130eee6c9a604780aced424 > suru.png
// https://github.com/rxi/lite/commit/f90b00748e1fe1cd2340aaa06d2526a1b2ea54ec
-void editor_gizmos(int dim) {
- // debugdraw
- if(dim == 2) ddraw_push_2d();
- ddraw_ontop_push(0);
-
- // draw gizmos, aabbs, markers, etc
- for each_map_ptr(*editor_selected_map(),void*,o,int,selected) {
- if( !*selected ) continue;
-
- void *obj = *o;
-
- // get transform
- vec3 *p = NULL;
- vec3 *r = NULL;
- vec3 *s = NULL;
- aabb *a = NULL;
-
- for each_objmember(obj,TYPE,NAME,PTR) {
- /**/ if( !strcmp(NAME, "position") ) p = PTR;
- else if( !strcmp(NAME, "pos") ) p = PTR;
- else if( !strcmp(NAME, "rotation") ) r = PTR;
- else if( !strcmp(NAME, "rot") ) r = PTR;
- else if( !strcmp(NAME, "scale") ) s = PTR;
- else if( !strcmp(NAME, "sca") ) s = PTR;
- else if( !strcmp(NAME, "aabb") ) a = PTR;
- }
-
- ddraw_ontop(0);
-
- // bounding box 3d
- if( 0 ) {
- aabb box;
- if( obj_hasmethod(*o, aabb) && obj_aabb(*o, &box) ) {
- ddraw_color_push(YELLOW);
- ddraw_aabb(box.min, box.max);
- ddraw_color_pop();
- }
- }
-
- // position marker
- if( p ) {
- static map(void*, vec3) prev_dir = 0;
- do_once map_init_ptr(prev_dir);
- vec3* dir = map_find_or_add(prev_dir, obj, vec3(1,0,0));
-
- static map(void*, vec3) prev_pos = 0;
- do_once map_init_ptr(prev_pos);
- vec3* found = map_find_or_add(prev_pos, obj, *p), fwd = sub3(*p, *found);
- if( (fwd.y = 0, len3sq(fwd)) ) {
- *found = *p;
- *dir = norm3(fwd);
- }
-
- // float diameter = len2( sub2(vec2(box->max.x,box->max.z), vec2(box->min.x,box->min.z) ));
- // float radius = diameter * 0.5;
- ddraw_position_dir(*p, *dir, 1);
- }
-
- ddraw_ontop(1);
-
- // transform gizmo
- if( p && r && s ) {
- gizmo(p,r,s);
- }
- }
-
- ddraw_ontop_pop();
- if(dim == 2) ddraw_pop_2d();
-}
-
// ----------------------------------------------------------------------------
// demo
diff --git a/engine/joint/v4k.h b/engine/joint/v4k.h
index 0b6fccf..8284964 100644
--- a/engine/joint/v4k.h
+++ b/engine/joint/v4k.h
@@ -15168,10 +15168,10 @@ API void print44( float *m );
// factory of handle ids
// convert between hard refs (pointers) and weak refs (ids)
-uintptr_t id_make(void *ptr);
-void * id_handle(uintptr_t id);
-void id_dispose(uintptr_t id);
-bool id_valid(uintptr_t id);
+API uintptr_t id_make(void *ptr);
+API void * id_handle(uintptr_t id);
+API void id_dispose(uintptr_t id);
+API bool id_valid(uintptr_t id);
// configuration:
// ideally, these two should be 32 each. they were changed to fit our OBJHEADER bits
@@ -15376,8 +15376,11 @@ API extern int (*obj_tick[256])(); ///-
API extern int (*obj_draw[256])(); ///-
API extern int (*obj_lerp[256])(); ///-
-API extern int (*obj_edit[256])(); ///-
+
API extern int (*obj_aabb[256])(); ///-
+API extern int (*obj_edit[256])(); ///-
+API extern int (*obj_menu[256])(); ///-
+API extern char* (*obj_icon[256])(); ///-
API extern const char*OBJTYPES[256]; /// -
@@ -18550,6 +18553,93 @@ API void window_setclipboard(const char *text);
// in-game editor
// - rlyeh, public domain.
+#define EDITOR_VERSION "2023.10"
+
+// ----------------------------------------------------------------------------
+
+typedef struct editor_bind_t {
+ const char *command;
+ const char *bindings;
+ void (*fn)();
+} editor_bind_t;
+
+API void editor_addbind(editor_bind_t bind);
+
+#define EDITOR_BIND(CMD,KEYS,...) \
+ void macro(editor_bind_##CMD##_fn_)() { __VA_ARGS__ }; AUTORUN { array_push(editor_binds, ((editor_bind_t){#CMD,KEYS,macro(editor_bind_##CMD##_fn_)}) ); }
+
+// ----------------------------------------------------------------------------
+
+#define EDITOR_PROPERTYDEF(T,property_name) \
+ typedef map(void*,T) editor_##property_name##_map_t; \
+API editor_##property_name##_map_t *editor_##property_name##_map(); \
+API T editor_##property_name(const void *obj); \
+API void editor_set##property_name(const void *obj, T value); \
+API void editor_alt##property_name(const void *obj); \
+API void editor_no##property_name(void *obj);
+
+EDITOR_PROPERTYDEF(int, open); // whether object is tree opened in tree editor
+EDITOR_PROPERTYDEF(int, selected); // whether object is displaying a contextual popup or not
+EDITOR_PROPERTYDEF(int, changed); // whether object is displaying a contextual popup or not
+EDITOR_PROPERTYDEF(int, popup); // whether object is displaying a contextual popup or not
+EDITOR_PROPERTYDEF(int, bookmarked);
+EDITOR_PROPERTYDEF(int, visible);
+EDITOR_PROPERTYDEF(int, script);
+EDITOR_PROPERTYDEF(int, event);
+EDITOR_PROPERTYDEF(char*,iconinstance);
+EDITOR_PROPERTYDEF(char*,iconclass);
+EDITOR_PROPERTYDEF(int, treeoffsety);
+
+API void editor_destroy_properties(void *o);
+API void editor_load_on_boot(void);
+API void editor_save_on_quit(void);
+
+// ----------------------------------------------------------------------------
+
+enum {
+ EDITOR_PANEL,
+ EDITOR_WINDOW,
+ EDITOR_WINDOW_NK,
+ EDITOR_WINDOW_NK_SMALL,
+};
+
+API int editor_begin(const char *title, int mode);
+API int editor_end(int mode);
+
+API int editor_filter();
+API void editor_select(const char *mask);
+API void editor_unselect(); // same than editor_select("!**");
+
+API void editor_select_aabb(aabb box);
+API void editor_selectgroup(obj *first, obj *last);
+API void* editor_first_selected();
+API void* editor_last_selected();
+
+// ----------------------------------------------------------------------------------------
+
+API void editor_addtoworld(obj *o);
+API void editor_watch(const void *o);
+API void* editor_spawn(const char *ini); // deprecate?
+API void editor_spawn1();
+
+API void editor_destroy_selected();
+API void editor_inspect(obj *o);
+
+// ----------------------------------------------------------------------------------------
+// tty
+
+API int editor_send(const char *cmd); // return job-id
+API const char* editor_recv(int jobid, double timeout_ss);
+API void editor_pump();
+
+// ----------------------------------------------------------------------------------------
+
+API void editor_symbol(int x, int y, const char *sym);
+API void editor_frame( void (*game)(unsigned, float, double) );
+API void editor_gizmos(int dim);
+
+// ----------------------------------------------------------------------------------------
+
API int editor_send(const char *command);
//API void editor();
@@ -345789,6 +345879,7 @@ rpmalloc_linker_reference(void) {
#line 0
// editor_script
#define GLEQ_IMPLEMENTATION
+#define GlyphSet GlyphSet_ // linux
#line 1 "3rd_lite_sys_gleq.h"
/*
* GLEQ - A basic event queue for GLFW 3
@@ -354045,6 +354136,8 @@ cook_script_t cook_script(const char *rules, const char *infile, const char *out
}
#endif
} else {
+ // if( script && script[0] ) system(script); //< @todo: un-comment this line if we want to get the shell command prints invoked per entry
+
// ... else bypass infile->outfile
char** INFILE = map_find(symbols, "INFILE");
cs.outfile = *INFILE;
@@ -372232,7 +372325,6 @@ void curve_end( curve_t *c, int k ) {
}
vec3 curve_eval(curve_t *c, float dt, unsigned *color) {
- unsigned nil; if(!color) color = &nil;
dt = clampf(dt, 0.0f, 1.0f);
int l = (int)(array_count(c->indices) - 1);
int p = (int)(dt * l);
@@ -372240,7 +372332,7 @@ vec3 curve_eval(curve_t *c, float dt, unsigned *color) {
t %= (array_count(c->indices)-1);
vec3 pos = mix3(c->samples[t], c->samples[t+1], dt * l - p);
- *color = c->colors[t];
+ if(color) *color = c->colors[t];
return pos;
}
@@ -376157,19 +376249,11 @@ void v4k_init() {
// ----------------------------------------------------------------------------
-#define EDITOR_VERSION "2023.10"
-
-// ----------------------------------------------------------------------------
-
-typedef struct editor_bind_t {
- const char *command;
- const char *bindings;
- void (*fn)();
-} editor_bind_t;
-
array(editor_bind_t) editor_binds;
-#define EDITOR_BIND(CMD,KEYS,...) void macro(editor_bind_##CMD##_fn_)() { __VA_ARGS__ }; AUTORUN { array_push(editor_binds, ((editor_bind_t){#CMD,KEYS,macro(editor_bind_##CMD##_fn_)}) ); }
+void editor_addbind(editor_bind_t bind) {
+ array_push(editor_binds, bind);
+}
// ----------------------------------------------------------------------------
@@ -376177,8 +376261,7 @@ typedef void (*editor_no_property)(void *);
array(void*) editor_persist_kv;
array(editor_no_property) editor_no_properties;
-#define EDITOR_PROPERTY(property_name,T,defaults) \
-typedef map(void*,T) editor_##property_name##_map_t; \
+#define EDITOR_PROPERTY(T,property_name,defaults) \
editor_##property_name##_map_t *editor_##property_name##_map() { \
static editor_##property_name##_map_t map = 0; do_once map_init_ptr(map); \
return ↦ \
@@ -376199,16 +376282,17 @@ void editor_no##property_name(void *obj) { \
} \
AUTORUN { array_push(editor_persist_kv, #T); array_push(editor_persist_kv, editor_##property_name##_map()); array_push(editor_no_properties, editor_no##property_name); }
-EDITOR_PROPERTY(open, int, 0); // whether object is tree opened in tree editor
-EDITOR_PROPERTY(selected, int, 0); // whether object is displaying a contextual popup or not
-EDITOR_PROPERTY(changed, int, 0); // whether object is displaying a contextual popup or not
-EDITOR_PROPERTY(popup, int, 0); // whether object is displaying a contextual popup or not
-EDITOR_PROPERTY(visible, int, 0);
-EDITOR_PROPERTY(script, int, 0);
-EDITOR_PROPERTY(event, int, 0);
-EDITOR_PROPERTY(iconinstance, char*, 0);
-EDITOR_PROPERTY(iconclass, char*, 0);
-EDITOR_PROPERTY(treeoffsety, int, 0);
+EDITOR_PROPERTY(int, open, 0); // whether object is tree opened in tree editor
+EDITOR_PROPERTY(int, selected, 0); // whether object is displaying a contextual popup or not
+EDITOR_PROPERTY(int, changed, 0); // whether object is displaying a contextual popup or not
+EDITOR_PROPERTY(int, popup, 0); // whether object is displaying a contextual popup or not
+EDITOR_PROPERTY(int, bookmarked, 0);
+EDITOR_PROPERTY(int, visible, 0);
+EDITOR_PROPERTY(int, script, 0);
+EDITOR_PROPERTY(int, event, 0);
+EDITOR_PROPERTY(char*, iconinstance, 0);
+EDITOR_PROPERTY(char*, iconclass, 0);
+EDITOR_PROPERTY(int, treeoffsety, 0);
// new prop: breakpoint: request to break on any given node
// new prop: persist: objects with this property will be saved on disk
@@ -376268,13 +376352,6 @@ struct editor_t {
.hz_high = 60, .hz_medium = 18, .hz_low = 5,
};
-enum {
- EDITOR_PANEL,
- EDITOR_WINDOW,
- EDITOR_WINDOW_NK,
- EDITOR_WINDOW_NK_SMALL,
-};
-
int editor_begin(const char *title, int mode) {
if( mode == 0 ) return ui_panel(title, PANEL_OPEN);
if( mode == 1 ) return ui_window(title, 0);
@@ -376854,6 +376931,77 @@ void editor_frame( void (*game)(unsigned, float, double) ) {
// draw ui filter (note: render at end-of-frame, so it's hopefully on-top)
editor_filter();
}
+
+
+void editor_gizmos(int dim) {
+ // debugdraw
+ if(dim == 2) ddraw_push_2d();
+ ddraw_ontop_push(0);
+
+ // draw gizmos, aabbs, markers, etc
+ for each_map_ptr(*editor_selected_map(),void*,o,int,selected) {
+ if( !*selected ) continue;
+
+ void *obj = *o;
+
+ // get transform
+ vec3 *p = NULL;
+ vec3 *r = NULL;
+ vec3 *s = NULL;
+ aabb *a = NULL;
+
+ for each_objmember(obj,TYPE,NAME,PTR) {
+ /**/ if( !strcmp(NAME, "position") ) p = PTR;
+ else if( !strcmp(NAME, "pos") ) p = PTR;
+ else if( !strcmp(NAME, "rotation") ) r = PTR;
+ else if( !strcmp(NAME, "rot") ) r = PTR;
+ else if( !strcmp(NAME, "scale") ) s = PTR;
+ else if( !strcmp(NAME, "sca") ) s = PTR;
+ else if( !strcmp(NAME, "aabb") ) a = PTR;
+ }
+
+ ddraw_ontop(0);
+
+ // bounding box 3d
+ if( 0 ) {
+ aabb box;
+ if( obj_hasmethod(*o, aabb) && obj_aabb(*o, &box) ) {
+ ddraw_color_push(YELLOW);
+ ddraw_aabb(box.min, box.max);
+ ddraw_color_pop();
+ }
+ }
+
+ // position marker
+ if( p ) {
+ static map(void*, vec3) prev_dir = 0;
+ do_once map_init_ptr(prev_dir);
+ vec3* dir = map_find_or_add(prev_dir, obj, vec3(1,0,0));
+
+ static map(void*, vec3) prev_pos = 0;
+ do_once map_init_ptr(prev_pos);
+ vec3* found = map_find_or_add(prev_pos, obj, *p), fwd = sub3(*p, *found);
+ if( (fwd.y = 0, len3sq(fwd)) ) {
+ *found = *p;
+ *dir = norm3(fwd);
+ }
+
+ // float diameter = len2( sub2(vec2(box->max.x,box->max.z), vec2(box->min.x,box->min.z) ));
+ // float radius = diameter * 0.5;
+ ddraw_position_dir(*p, *dir, 1);
+ }
+
+ ddraw_ontop(1);
+
+ // transform gizmo
+ if( p && r && s ) {
+ gizmo(p,r,s);
+ }
+ }
+
+ ddraw_ontop_pop();
+ if(dim == 2) ddraw_pop_2d();
+}
#line 0
#line 1 "v4k_editor_scene.h"
#define SCENE_ICON ICON_MDI_FILE_TREE
@@ -376861,8 +377009,6 @@ void editor_frame( void (*game)(unsigned, float, double) ) {
EDITOR_BIND(scene, "held(CTRL)&down(1)", { ui_show(SCENE_TITLE, ui_visible(SCENE_TITLE) ^ true); });
-EDITOR_PROPERTY(bookmarked, int, 0);
-
EDITOR_BIND(node_new, "down(INS)", { editor_spawn1(); } );
EDITOR_BIND(node_del, "down(DEL)", { editor_destroy_selected(); } );
EDITOR_BIND(node_save, "held(CTRL)&down(S)", { puts("@todo"); } );
diff --git a/engine/split/v4k.x.inl b/engine/split/v4k.x.inl
index 0e2c85d..578ae18 100644
--- a/engine/split/v4k.x.inl
+++ b/engine/split/v4k.x.inl
@@ -212,6 +212,7 @@ static char *ui_filter = 0;
{{FILE:3rd_icon_mdi.h}}
// editor_script
#define GLEQ_IMPLEMENTATION
+#define GlyphSet GlyphSet_ // linux
{{FILE:3rd_lite_sys_gleq.h}}
{{FILE:3rd_lite_sys.h}}
{{FILE:3rd_lite.h}}
diff --git a/engine/split/v4k_cook.c b/engine/split/v4k_cook.c
index de55148..4a18dd3 100644
--- a/engine/split/v4k_cook.c
+++ b/engine/split/v4k_cook.c
@@ -323,6 +323,8 @@ cook_script_t cook_script(const char *rules, const char *infile, const char *out
}
#endif
} else {
+ // if( script && script[0] ) system(script); //< @todo: un-comment this line if we want to get the shell command prints invoked per entry
+
// ... else bypass infile->outfile
char** INFILE = map_find(symbols, "INFILE");
cs.outfile = *INFILE;
diff --git a/engine/split/v4k_editor.c b/engine/split/v4k_editor.c
index 62d80ff..1b10364 100644
--- a/engine/split/v4k_editor.c
+++ b/engine/split/v4k_editor.c
@@ -42,19 +42,11 @@
// ----------------------------------------------------------------------------
-#define EDITOR_VERSION "2023.10"
-
-// ----------------------------------------------------------------------------
-
-typedef struct editor_bind_t {
- const char *command;
- const char *bindings;
- void (*fn)();
-} editor_bind_t;
-
array(editor_bind_t) editor_binds;
-#define EDITOR_BIND(CMD,KEYS,...) void macro(editor_bind_##CMD##_fn_)() { __VA_ARGS__ }; AUTORUN { array_push(editor_binds, ((editor_bind_t){#CMD,KEYS,macro(editor_bind_##CMD##_fn_)}) ); }
+void editor_addbind(editor_bind_t bind) {
+ array_push(editor_binds, bind);
+}
// ----------------------------------------------------------------------------
@@ -62,8 +54,7 @@ typedef void (*editor_no_property)(void *);
array(void*) editor_persist_kv;
array(editor_no_property) editor_no_properties;
-#define EDITOR_PROPERTY(property_name,T,defaults) \
-typedef map(void*,T) editor_##property_name##_map_t; \
+#define EDITOR_PROPERTY(T,property_name,defaults) \
editor_##property_name##_map_t *editor_##property_name##_map() { \
static editor_##property_name##_map_t map = 0; do_once map_init_ptr(map); \
return ↦ \
@@ -84,16 +75,17 @@ void editor_no##property_name(void *obj) { \
} \
AUTORUN { array_push(editor_persist_kv, #T); array_push(editor_persist_kv, editor_##property_name##_map()); array_push(editor_no_properties, editor_no##property_name); }
-EDITOR_PROPERTY(open, int, 0); // whether object is tree opened in tree editor
-EDITOR_PROPERTY(selected, int, 0); // whether object is displaying a contextual popup or not
-EDITOR_PROPERTY(changed, int, 0); // whether object is displaying a contextual popup or not
-EDITOR_PROPERTY(popup, int, 0); // whether object is displaying a contextual popup or not
-EDITOR_PROPERTY(visible, int, 0);
-EDITOR_PROPERTY(script, int, 0);
-EDITOR_PROPERTY(event, int, 0);
-EDITOR_PROPERTY(iconinstance, char*, 0);
-EDITOR_PROPERTY(iconclass, char*, 0);
-EDITOR_PROPERTY(treeoffsety, int, 0);
+EDITOR_PROPERTY(int, open, 0); // whether object is tree opened in tree editor
+EDITOR_PROPERTY(int, selected, 0); // whether object is displaying a contextual popup or not
+EDITOR_PROPERTY(int, changed, 0); // whether object is displaying a contextual popup or not
+EDITOR_PROPERTY(int, popup, 0); // whether object is displaying a contextual popup or not
+EDITOR_PROPERTY(int, bookmarked, 0);
+EDITOR_PROPERTY(int, visible, 0);
+EDITOR_PROPERTY(int, script, 0);
+EDITOR_PROPERTY(int, event, 0);
+EDITOR_PROPERTY(char*, iconinstance, 0);
+EDITOR_PROPERTY(char*, iconclass, 0);
+EDITOR_PROPERTY(int, treeoffsety, 0);
// new prop: breakpoint: request to break on any given node
// new prop: persist: objects with this property will be saved on disk
@@ -153,13 +145,6 @@ struct editor_t {
.hz_high = 60, .hz_medium = 18, .hz_low = 5,
};
-enum {
- EDITOR_PANEL,
- EDITOR_WINDOW,
- EDITOR_WINDOW_NK,
- EDITOR_WINDOW_NK_SMALL,
-};
-
int editor_begin(const char *title, int mode) {
if( mode == 0 ) return ui_panel(title, PANEL_OPEN);
if( mode == 1 ) return ui_window(title, 0);
@@ -739,3 +724,74 @@ void editor_frame( void (*game)(unsigned, float, double) ) {
// draw ui filter (note: render at end-of-frame, so it's hopefully on-top)
editor_filter();
}
+
+
+void editor_gizmos(int dim) {
+ // debugdraw
+ if(dim == 2) ddraw_push_2d();
+ ddraw_ontop_push(0);
+
+ // draw gizmos, aabbs, markers, etc
+ for each_map_ptr(*editor_selected_map(),void*,o,int,selected) {
+ if( !*selected ) continue;
+
+ void *obj = *o;
+
+ // get transform
+ vec3 *p = NULL;
+ vec3 *r = NULL;
+ vec3 *s = NULL;
+ aabb *a = NULL;
+
+ for each_objmember(obj,TYPE,NAME,PTR) {
+ /**/ if( !strcmp(NAME, "position") ) p = PTR;
+ else if( !strcmp(NAME, "pos") ) p = PTR;
+ else if( !strcmp(NAME, "rotation") ) r = PTR;
+ else if( !strcmp(NAME, "rot") ) r = PTR;
+ else if( !strcmp(NAME, "scale") ) s = PTR;
+ else if( !strcmp(NAME, "sca") ) s = PTR;
+ else if( !strcmp(NAME, "aabb") ) a = PTR;
+ }
+
+ ddraw_ontop(0);
+
+ // bounding box 3d
+ if( 0 ) {
+ aabb box;
+ if( obj_hasmethod(*o, aabb) && obj_aabb(*o, &box) ) {
+ ddraw_color_push(YELLOW);
+ ddraw_aabb(box.min, box.max);
+ ddraw_color_pop();
+ }
+ }
+
+ // position marker
+ if( p ) {
+ static map(void*, vec3) prev_dir = 0;
+ do_once map_init_ptr(prev_dir);
+ vec3* dir = map_find_or_add(prev_dir, obj, vec3(1,0,0));
+
+ static map(void*, vec3) prev_pos = 0;
+ do_once map_init_ptr(prev_pos);
+ vec3* found = map_find_or_add(prev_pos, obj, *p), fwd = sub3(*p, *found);
+ if( (fwd.y = 0, len3sq(fwd)) ) {
+ *found = *p;
+ *dir = norm3(fwd);
+ }
+
+ // float diameter = len2( sub2(vec2(box->max.x,box->max.z), vec2(box->min.x,box->min.z) ));
+ // float radius = diameter * 0.5;
+ ddraw_position_dir(*p, *dir, 1);
+ }
+
+ ddraw_ontop(1);
+
+ // transform gizmo
+ if( p && r && s ) {
+ gizmo(p,r,s);
+ }
+ }
+
+ ddraw_ontop_pop();
+ if(dim == 2) ddraw_pop_2d();
+}
diff --git a/engine/split/v4k_editor.h b/engine/split/v4k_editor.h
index d1f5bd4..3e12382 100644
--- a/engine/split/v4k_editor.h
+++ b/engine/split/v4k_editor.h
@@ -2,6 +2,93 @@
// in-game editor
// - rlyeh, public domain.
+#define EDITOR_VERSION "2023.10"
+
+// ----------------------------------------------------------------------------
+
+typedef struct editor_bind_t {
+ const char *command;
+ const char *bindings;
+ void (*fn)();
+} editor_bind_t;
+
+API void editor_addbind(editor_bind_t bind);
+
+#define EDITOR_BIND(CMD,KEYS,...) \
+ void macro(editor_bind_##CMD##_fn_)() { __VA_ARGS__ }; AUTORUN { array_push(editor_binds, ((editor_bind_t){#CMD,KEYS,macro(editor_bind_##CMD##_fn_)}) ); }
+
+// ----------------------------------------------------------------------------
+
+#define EDITOR_PROPERTYDEF(T,property_name) \
+ typedef map(void*,T) editor_##property_name##_map_t; \
+API editor_##property_name##_map_t *editor_##property_name##_map(); \
+API T editor_##property_name(const void *obj); \
+API void editor_set##property_name(const void *obj, T value); \
+API void editor_alt##property_name(const void *obj); \
+API void editor_no##property_name(void *obj);
+
+EDITOR_PROPERTYDEF(int, open); // whether object is tree opened in tree editor
+EDITOR_PROPERTYDEF(int, selected); // whether object is displaying a contextual popup or not
+EDITOR_PROPERTYDEF(int, changed); // whether object is displaying a contextual popup or not
+EDITOR_PROPERTYDEF(int, popup); // whether object is displaying a contextual popup or not
+EDITOR_PROPERTYDEF(int, bookmarked);
+EDITOR_PROPERTYDEF(int, visible);
+EDITOR_PROPERTYDEF(int, script);
+EDITOR_PROPERTYDEF(int, event);
+EDITOR_PROPERTYDEF(char*,iconinstance);
+EDITOR_PROPERTYDEF(char*,iconclass);
+EDITOR_PROPERTYDEF(int, treeoffsety);
+
+API void editor_destroy_properties(void *o);
+API void editor_load_on_boot(void);
+API void editor_save_on_quit(void);
+
+// ----------------------------------------------------------------------------
+
+enum {
+ EDITOR_PANEL,
+ EDITOR_WINDOW,
+ EDITOR_WINDOW_NK,
+ EDITOR_WINDOW_NK_SMALL,
+};
+
+API int editor_begin(const char *title, int mode);
+API int editor_end(int mode);
+
+API int editor_filter();
+API void editor_select(const char *mask);
+API void editor_unselect(); // same than editor_select("!**");
+
+API void editor_select_aabb(aabb box);
+API void editor_selectgroup(obj *first, obj *last);
+API void* editor_first_selected();
+API void* editor_last_selected();
+
+// ----------------------------------------------------------------------------------------
+
+API void editor_addtoworld(obj *o);
+API void editor_watch(const void *o);
+API void* editor_spawn(const char *ini); // deprecate?
+API void editor_spawn1();
+
+API void editor_destroy_selected();
+API void editor_inspect(obj *o);
+
+// ----------------------------------------------------------------------------------------
+// tty
+
+API int editor_send(const char *cmd); // return job-id
+API const char* editor_recv(int jobid, double timeout_ss);
+API void editor_pump();
+
+// ----------------------------------------------------------------------------------------
+
+API void editor_symbol(int x, int y, const char *sym);
+API void editor_frame( void (*game)(unsigned, float, double) );
+API void editor_gizmos(int dim);
+
+// ----------------------------------------------------------------------------------------
+
API int editor_send(const char *command);
//API void editor();
diff --git a/engine/split/v4k_editor_scene.h b/engine/split/v4k_editor_scene.h
index 4528b3d..e6e1e85 100644
--- a/engine/split/v4k_editor_scene.h
+++ b/engine/split/v4k_editor_scene.h
@@ -3,8 +3,6 @@
EDITOR_BIND(scene, "held(CTRL)&down(1)", { ui_show(SCENE_TITLE, ui_visible(SCENE_TITLE) ^ true); });
-EDITOR_PROPERTY(bookmarked, int, 0);
-
EDITOR_BIND(node_new, "down(INS)", { editor_spawn1(); } );
EDITOR_BIND(node_del, "down(DEL)", { editor_destroy_selected(); } );
EDITOR_BIND(node_save, "held(CTRL)&down(S)", { puts("@todo"); } );
diff --git a/engine/split/v4k_obj.h b/engine/split/v4k_obj.h
index 40361f4..3384876 100644
--- a/engine/split/v4k_obj.h
+++ b/engine/split/v4k_obj.h
@@ -2,10 +2,10 @@
// factory of handle ids
// convert between hard refs (pointers) and weak refs (ids)
-uintptr_t id_make(void *ptr);
-void * id_handle(uintptr_t id);
-void id_dispose(uintptr_t id);
-bool id_valid(uintptr_t id);
+API uintptr_t id_make(void *ptr);
+API void * id_handle(uintptr_t id);
+API void id_dispose(uintptr_t id);
+API bool id_valid(uintptr_t id);
// configuration:
// ideally, these two should be 32 each. they were changed to fit our OBJHEADER bits
@@ -210,8 +210,11 @@ API extern int (*obj_tick[256])(); ///-
API extern int (*obj_draw[256])(); ///-
API extern int (*obj_lerp[256])(); ///-
-API extern int (*obj_edit[256])(); ///-
+
API extern int (*obj_aabb[256])(); ///-
+API extern int (*obj_edit[256])(); ///-
+API extern int (*obj_menu[256])(); ///-
+API extern char* (*obj_icon[256])(); ///-
API extern const char*OBJTYPES[256]; /// -
diff --git a/engine/split/v4k_time.c b/engine/split/v4k_time.c
index 5c94480..de0529d 100644
--- a/engine/split/v4k_time.c
+++ b/engine/split/v4k_time.c
@@ -615,7 +615,6 @@ void curve_end( curve_t *c, int k ) {
}
vec3 curve_eval(curve_t *c, float dt, unsigned *color) {
- unsigned nil; if(!color) color = &nil;
dt = clampf(dt, 0.0f, 1.0f);
int l = (int)(array_count(c->indices) - 1);
int p = (int)(dt * l);
@@ -623,7 +622,7 @@ vec3 curve_eval(curve_t *c, float dt, unsigned *color) {
t %= (array_count(c->indices)-1);
vec3 pos = mix3(c->samples[t], c->samples[t+1], dt * l - p);
- *color = c->colors[t];
+ if(color) *color = c->colors[t];
return pos;
}
diff --git a/engine/v4k b/engine/v4k
index 41bc0c4..31575c0 100644
--- a/engine/v4k
+++ b/engine/v4k
@@ -327183,6 +327183,7 @@ rpmalloc_linker_reference(void) {
#line 0
// editor_script
#define GLEQ_IMPLEMENTATION
+#define GlyphSet GlyphSet_ // linux
#line 1 "3rd_lite_sys_gleq.h"
/*
* GLEQ - A basic event queue for GLFW 3
diff --git a/engine/v4k.c b/engine/v4k.c
index 184c413..ed38695 100644
--- a/engine/v4k.c
+++ b/engine/v4k.c
@@ -6399,6 +6399,8 @@ cook_script_t cook_script(const char *rules, const char *infile, const char *out
}
#endif
} else {
+ // if( script && script[0] ) system(script); //< @todo: un-comment this line if we want to get the shell command prints invoked per entry
+
// ... else bypass infile->outfile
char** INFILE = map_find(symbols, "INFILE");
cs.outfile = *INFILE;
@@ -24586,7 +24588,6 @@ void curve_end( curve_t *c, int k ) {
}
vec3 curve_eval(curve_t *c, float dt, unsigned *color) {
- unsigned nil; if(!color) color = &nil;
dt = clampf(dt, 0.0f, 1.0f);
int l = (int)(array_count(c->indices) - 1);
int p = (int)(dt * l);
@@ -24594,7 +24595,7 @@ vec3 curve_eval(curve_t *c, float dt, unsigned *color) {
t %= (array_count(c->indices)-1);
vec3 pos = mix3(c->samples[t], c->samples[t+1], dt * l - p);
- *color = c->colors[t];
+ if(color) *color = c->colors[t];
return pos;
}
@@ -28511,19 +28512,11 @@ void v4k_init() {
// ----------------------------------------------------------------------------
-#define EDITOR_VERSION "2023.10"
-
-// ----------------------------------------------------------------------------
-
-typedef struct editor_bind_t {
- const char *command;
- const char *bindings;
- void (*fn)();
-} editor_bind_t;
-
array(editor_bind_t) editor_binds;
-#define EDITOR_BIND(CMD,KEYS,...) void macro(editor_bind_##CMD##_fn_)() { __VA_ARGS__ }; AUTORUN { array_push(editor_binds, ((editor_bind_t){#CMD,KEYS,macro(editor_bind_##CMD##_fn_)}) ); }
+void editor_addbind(editor_bind_t bind) {
+ array_push(editor_binds, bind);
+}
// ----------------------------------------------------------------------------
@@ -28531,8 +28524,7 @@ typedef void (*editor_no_property)(void *);
array(void*) editor_persist_kv;
array(editor_no_property) editor_no_properties;
-#define EDITOR_PROPERTY(property_name,T,defaults) \
-typedef map(void*,T) editor_##property_name##_map_t; \
+#define EDITOR_PROPERTY(T,property_name,defaults) \
editor_##property_name##_map_t *editor_##property_name##_map() { \
static editor_##property_name##_map_t map = 0; do_once map_init_ptr(map); \
return ↦ \
@@ -28553,16 +28545,17 @@ void editor_no##property_name(void *obj) { \
} \
AUTORUN { array_push(editor_persist_kv, #T); array_push(editor_persist_kv, editor_##property_name##_map()); array_push(editor_no_properties, editor_no##property_name); }
-EDITOR_PROPERTY(open, int, 0); // whether object is tree opened in tree editor
-EDITOR_PROPERTY(selected, int, 0); // whether object is displaying a contextual popup or not
-EDITOR_PROPERTY(changed, int, 0); // whether object is displaying a contextual popup or not
-EDITOR_PROPERTY(popup, int, 0); // whether object is displaying a contextual popup or not
-EDITOR_PROPERTY(visible, int, 0);
-EDITOR_PROPERTY(script, int, 0);
-EDITOR_PROPERTY(event, int, 0);
-EDITOR_PROPERTY(iconinstance, char*, 0);
-EDITOR_PROPERTY(iconclass, char*, 0);
-EDITOR_PROPERTY(treeoffsety, int, 0);
+EDITOR_PROPERTY(int, open, 0); // whether object is tree opened in tree editor
+EDITOR_PROPERTY(int, selected, 0); // whether object is displaying a contextual popup or not
+EDITOR_PROPERTY(int, changed, 0); // whether object is displaying a contextual popup or not
+EDITOR_PROPERTY(int, popup, 0); // whether object is displaying a contextual popup or not
+EDITOR_PROPERTY(int, bookmarked, 0);
+EDITOR_PROPERTY(int, visible, 0);
+EDITOR_PROPERTY(int, script, 0);
+EDITOR_PROPERTY(int, event, 0);
+EDITOR_PROPERTY(char*, iconinstance, 0);
+EDITOR_PROPERTY(char*, iconclass, 0);
+EDITOR_PROPERTY(int, treeoffsety, 0);
// new prop: breakpoint: request to break on any given node
// new prop: persist: objects with this property will be saved on disk
@@ -28622,13 +28615,6 @@ struct editor_t {
.hz_high = 60, .hz_medium = 18, .hz_low = 5,
};
-enum {
- EDITOR_PANEL,
- EDITOR_WINDOW,
- EDITOR_WINDOW_NK,
- EDITOR_WINDOW_NK_SMALL,
-};
-
int editor_begin(const char *title, int mode) {
if( mode == 0 ) return ui_panel(title, PANEL_OPEN);
if( mode == 1 ) return ui_window(title, 0);
@@ -29208,6 +29194,77 @@ void editor_frame( void (*game)(unsigned, float, double) ) {
// draw ui filter (note: render at end-of-frame, so it's hopefully on-top)
editor_filter();
}
+
+
+void editor_gizmos(int dim) {
+ // debugdraw
+ if(dim == 2) ddraw_push_2d();
+ ddraw_ontop_push(0);
+
+ // draw gizmos, aabbs, markers, etc
+ for each_map_ptr(*editor_selected_map(),void*,o,int,selected) {
+ if( !*selected ) continue;
+
+ void *obj = *o;
+
+ // get transform
+ vec3 *p = NULL;
+ vec3 *r = NULL;
+ vec3 *s = NULL;
+ aabb *a = NULL;
+
+ for each_objmember(obj,TYPE,NAME,PTR) {
+ /**/ if( !strcmp(NAME, "position") ) p = PTR;
+ else if( !strcmp(NAME, "pos") ) p = PTR;
+ else if( !strcmp(NAME, "rotation") ) r = PTR;
+ else if( !strcmp(NAME, "rot") ) r = PTR;
+ else if( !strcmp(NAME, "scale") ) s = PTR;
+ else if( !strcmp(NAME, "sca") ) s = PTR;
+ else if( !strcmp(NAME, "aabb") ) a = PTR;
+ }
+
+ ddraw_ontop(0);
+
+ // bounding box 3d
+ if( 0 ) {
+ aabb box;
+ if( obj_hasmethod(*o, aabb) && obj_aabb(*o, &box) ) {
+ ddraw_color_push(YELLOW);
+ ddraw_aabb(box.min, box.max);
+ ddraw_color_pop();
+ }
+ }
+
+ // position marker
+ if( p ) {
+ static map(void*, vec3) prev_dir = 0;
+ do_once map_init_ptr(prev_dir);
+ vec3* dir = map_find_or_add(prev_dir, obj, vec3(1,0,0));
+
+ static map(void*, vec3) prev_pos = 0;
+ do_once map_init_ptr(prev_pos);
+ vec3* found = map_find_or_add(prev_pos, obj, *p), fwd = sub3(*p, *found);
+ if( (fwd.y = 0, len3sq(fwd)) ) {
+ *found = *p;
+ *dir = norm3(fwd);
+ }
+
+ // float diameter = len2( sub2(vec2(box->max.x,box->max.z), vec2(box->min.x,box->min.z) ));
+ // float radius = diameter * 0.5;
+ ddraw_position_dir(*p, *dir, 1);
+ }
+
+ ddraw_ontop(1);
+
+ // transform gizmo
+ if( p && r && s ) {
+ gizmo(p,r,s);
+ }
+ }
+
+ ddraw_ontop_pop();
+ if(dim == 2) ddraw_pop_2d();
+}
#line 0
#line 1 "v4k_editor_scene.h"
#define SCENE_ICON ICON_MDI_FILE_TREE
@@ -29215,8 +29272,6 @@ void editor_frame( void (*game)(unsigned, float, double) ) {
EDITOR_BIND(scene, "held(CTRL)&down(1)", { ui_show(SCENE_TITLE, ui_visible(SCENE_TITLE) ^ true); });
-EDITOR_PROPERTY(bookmarked, int, 0);
-
EDITOR_BIND(node_new, "down(INS)", { editor_spawn1(); } );
EDITOR_BIND(node_del, "down(DEL)", { editor_destroy_selected(); } );
EDITOR_BIND(node_save, "held(CTRL)&down(S)", { puts("@todo"); } );
diff --git a/engine/v4k.h b/engine/v4k.h
index 94e3bd1..6364ea3 100644
--- a/engine/v4k.h
+++ b/engine/v4k.h
@@ -1235,10 +1235,10 @@ API void print44( float *m );
// factory of handle ids
// convert between hard refs (pointers) and weak refs (ids)
-uintptr_t id_make(void *ptr);
-void * id_handle(uintptr_t id);
-void id_dispose(uintptr_t id);
-bool id_valid(uintptr_t id);
+API uintptr_t id_make(void *ptr);
+API void * id_handle(uintptr_t id);
+API void id_dispose(uintptr_t id);
+API bool id_valid(uintptr_t id);
// configuration:
// ideally, these two should be 32 each. they were changed to fit our OBJHEADER bits
@@ -1443,8 +1443,11 @@ API extern int (*obj_tick[256])(); ///-
API extern int (*obj_draw[256])(); ///-
API extern int (*obj_lerp[256])(); ///-
-API extern int (*obj_edit[256])(); ///-
+
API extern int (*obj_aabb[256])(); ///-
+API extern int (*obj_edit[256])(); ///-
+API extern int (*obj_menu[256])(); ///-
+API extern char* (*obj_icon[256])(); ///-
API extern const char*OBJTYPES[256]; /// -
@@ -4617,6 +4620,93 @@ API void window_setclipboard(const char *text);
// in-game editor
// - rlyeh, public domain.
+#define EDITOR_VERSION "2023.10"
+
+// ----------------------------------------------------------------------------
+
+typedef struct editor_bind_t {
+ const char *command;
+ const char *bindings;
+ void (*fn)();
+} editor_bind_t;
+
+API void editor_addbind(editor_bind_t bind);
+
+#define EDITOR_BIND(CMD,KEYS,...) \
+ void macro(editor_bind_##CMD##_fn_)() { __VA_ARGS__ }; AUTORUN { array_push(editor_binds, ((editor_bind_t){#CMD,KEYS,macro(editor_bind_##CMD##_fn_)}) ); }
+
+// ----------------------------------------------------------------------------
+
+#define EDITOR_PROPERTYDEF(T,property_name) \
+ typedef map(void*,T) editor_##property_name##_map_t; \
+API editor_##property_name##_map_t *editor_##property_name##_map(); \
+API T editor_##property_name(const void *obj); \
+API void editor_set##property_name(const void *obj, T value); \
+API void editor_alt##property_name(const void *obj); \
+API void editor_no##property_name(void *obj);
+
+EDITOR_PROPERTYDEF(int, open); // whether object is tree opened in tree editor
+EDITOR_PROPERTYDEF(int, selected); // whether object is displaying a contextual popup or not
+EDITOR_PROPERTYDEF(int, changed); // whether object is displaying a contextual popup or not
+EDITOR_PROPERTYDEF(int, popup); // whether object is displaying a contextual popup or not
+EDITOR_PROPERTYDEF(int, bookmarked);
+EDITOR_PROPERTYDEF(int, visible);
+EDITOR_PROPERTYDEF(int, script);
+EDITOR_PROPERTYDEF(int, event);
+EDITOR_PROPERTYDEF(char*,iconinstance);
+EDITOR_PROPERTYDEF(char*,iconclass);
+EDITOR_PROPERTYDEF(int, treeoffsety);
+
+API void editor_destroy_properties(void *o);
+API void editor_load_on_boot(void);
+API void editor_save_on_quit(void);
+
+// ----------------------------------------------------------------------------
+
+enum {
+ EDITOR_PANEL,
+ EDITOR_WINDOW,
+ EDITOR_WINDOW_NK,
+ EDITOR_WINDOW_NK_SMALL,
+};
+
+API int editor_begin(const char *title, int mode);
+API int editor_end(int mode);
+
+API int editor_filter();
+API void editor_select(const char *mask);
+API void editor_unselect(); // same than editor_select("!**");
+
+API void editor_select_aabb(aabb box);
+API void editor_selectgroup(obj *first, obj *last);
+API void* editor_first_selected();
+API void* editor_last_selected();
+
+// ----------------------------------------------------------------------------------------
+
+API void editor_addtoworld(obj *o);
+API void editor_watch(const void *o);
+API void* editor_spawn(const char *ini); // deprecate?
+API void editor_spawn1();
+
+API void editor_destroy_selected();
+API void editor_inspect(obj *o);
+
+// ----------------------------------------------------------------------------------------
+// tty
+
+API int editor_send(const char *cmd); // return job-id
+API const char* editor_recv(int jobid, double timeout_ss);
+API void editor_pump();
+
+// ----------------------------------------------------------------------------------------
+
+API void editor_symbol(int x, int y, const char *sym);
+API void editor_frame( void (*game)(unsigned, float, double) );
+API void editor_gizmos(int dim);
+
+// ----------------------------------------------------------------------------------------
+
API int editor_send(const char *command);
//API void editor();
diff --git a/tools/ark.osx b/tools/ark.osx
new file mode 100644
index 0000000..f3a1dd8
Binary files /dev/null and b/tools/ark.osx differ
diff --git a/tools/ase2ini.c b/tools/ase2ini.c
index 2dc7aa3..938c7ad 100644
--- a/tools/ase2ini.c
+++ b/tools/ase2ini.c
@@ -118,6 +118,8 @@ char* strcatf(char **src_, const char *fmt, ...) {
#define DIR_C
#include "3rd_archive.h"
+#define MALLOC(sz) ATLAS_REALLOC(0,(sz))
+#define FREE(p) ATLAS_REALLOC((p),0)
#define BASE64_C
#include "3rd_base64.h"
@@ -218,7 +220,7 @@ int main(int argc, char* argv[]) {
}
for( int i = 0; i < array_count(files); ++i)
- ATLAS_FREE(files[i], 0);
+ ATLAS_REALLOC(files[i], 0);
array_free(files);
return error ? fprintf(stderr, "%s\n", error), -1 : 0;
diff --git a/tools/ase2ini.osx b/tools/ase2ini.osx
new file mode 100644
index 0000000..38969da
Binary files /dev/null and b/tools/ase2ini.osx differ
diff --git a/tools/cook.linux b/tools/cook.linux
index b313a9c..71dbcec 100644
Binary files a/tools/cook.linux and b/tools/cook.linux differ
diff --git a/tools/cook.osx b/tools/cook.osx
index adc18e8..1684d0a 100755
Binary files a/tools/cook.osx and b/tools/cook.osx differ