From 6c07f11992db915ce04f72c691813bfb4b4fd3c1 Mon Sep 17 00:00:00 2001 From: John Alanbrook Date: Fri, 23 Jan 2026 15:06:10 -0600 Subject: [PATCH] new --- core.cm | 2 +- datastream.c | 3 --- input.cm | 2 +- input/router.cm | 8 ++++---- mersenne.c | 5 +---- sdl_gpu.cm | 2 +- staef.c | 6 ++++-- transform.c | 15 +++++---------- tween.cm | 2 +- 9 files changed, 18 insertions(+), 27 deletions(-) diff --git a/core.cm b/core.cm index fd4bdbce..359267a5 100644 --- a/core.cm +++ b/core.cm @@ -188,7 +188,7 @@ function _main_loop() { cmd: 'imgui', draw: function(ui) { if (_config.imgui) _config.imgui(ui) - if (_config.editor) { + if (is_function(_config.editor)) { debug_imgui.render(ui, null, render_result.plan, stats) _config.editor(ui) } diff --git a/datastream.c b/datastream.c index 489c6b1d..2f409fde 100644 --- a/datastream.c +++ b/datastream.c @@ -64,15 +64,12 @@ JSC_CCALL(datastream_advance, ds_advance(js2datastream(js,self), js2number(js,ar JSC_CCALL(datastream_duration, return number2js(js,ds_length(js2datastream(js,self)))) JSC_CCALL(datastream_framerate, return number2js(js,plm_get_framerate(js2datastream(js,self)->plm))) -JSC_GETSET_CALLBACK(datastream, callback) - static const JSCFunctionListEntry js_datastream_funcs[] = { MIST_FUNC_DEF(datastream, time, 0), MIST_FUNC_DEF(datastream, seek, 1), MIST_FUNC_DEF(datastream, advance, 1), MIST_FUNC_DEF(datastream, duration, 0), MIST_FUNC_DEF(datastream, framerate, 0), - CGETSET_ADD(datastream, callback), }; static void render_frame(plm_t *mpeg, plm_frame_t *frame, void *d) { diff --git a/input.cm b/input.cm index a108837b..463a68a4 100644 --- a/input.cm +++ b/input.cm @@ -113,7 +113,7 @@ function create_user(index, config) { // Dispatch action to current target dispatch: function(action, data) { - var target = this.target + var target = this.target() if (target && target.on_input) { target.on_input(action, data) } diff --git a/input/router.cm b/input/router.cm index 3d90f985..5c592cb4 100644 --- a/input/router.cm +++ b/input/router.cm @@ -2,12 +2,12 @@ var time = use('time') // Valid emacs keys -var valid_emacs_keys = [ +/*var valid_emacs_keys = [ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'return', 'enter', 'space', 'escape', 'tab', 'backspace', 'delete', 'up', 'down', 'left', 'right', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' -] +]*/ var emacs_special = { 'return': 'RET', 'enter': 'RET', 'space': 'SPC', 'escape': 'ESC', @@ -143,11 +143,11 @@ function emacs_stage() { continue } - if (find(valid_emacs_keys, ev.control) == null) { +/* if (find(valid_emacs_keys, ev.control) == null) { push(output, ev) continue } - +*/ // Only process if we have modifiers OR waiting for chord if (!ev.mods?.ctrl && !ev.mods?.alt && !prefix) { push(output, ev) diff --git a/mersenne.c b/mersenne.c index 41647273..430b44f0 100644 --- a/mersenne.c +++ b/mersenne.c @@ -124,10 +124,7 @@ static JSValue js_mersenne_use_call(JSContext *js, JSValueConst new_target, int JS_SetOpaque(obj, mrand); // Store seed as a read-only property - JS_DefinePropertyValueStr(js, obj, "seed", - JS_NewFloat64(js, seed), - JS_PROP_ENUMERABLE | JS_PROP_CONFIGURABLE // Read-only (no WRITABLE) - ); + JS_SetPropertyStr(js, obj, "seed", JS_NewFloat64(js, seed)); return obj; } diff --git a/sdl_gpu.cm b/sdl_gpu.cm index f17940f8..329f0ed5 100644 --- a/sdl_gpu.cm +++ b/sdl_gpu.cm @@ -281,7 +281,7 @@ function _load_shaders() { function _create_pipelines() { // Sprite pipeline (alpha blend) - _pipelines.sprite_alpha =gpu_mod.graphics_pipeline(_gpu, { + _pipelines.sprite_alpha = gpu_mod.graphics_pipeline(_gpu, { vertex: _sprite_vert, fragment: _sprite_frag, primitive: "triangle", diff --git a/staef.c b/staef.c index 203cf116..c60fc05e 100644 --- a/staef.c +++ b/staef.c @@ -796,7 +796,7 @@ JSC_CCALL(staef_font_make_text_buffer, ) // Font property getters/setters -JSC_GETSET(font, linegap, number) +/*JSC_GETSET(font, linegap, number) JSC_GETSET(font, ascent, number) JSC_GETSET(font, descent, number) JSC_GETSET(font, line_height, number) @@ -804,12 +804,13 @@ JSC_GETSET(font, height, number) JSC_GETSET(font, range_px, number) JSC_GETSET(font, sharpness, number) JSC_GETSET(font, mode, number) +*/ // Font methods static const JSCFunctionListEntry js_font_funcs[] = { MIST_FUNC_DEF(staef_font, text_size, 5), MIST_FUNC_DEF(staef_font, make_text_buffer, 6), - CGETSET_ADD(font, linegap), + /*CGETSET_ADD(font, linegap), CGETSET_ADD(font, ascent), CGETSET_ADD(font, descent), CGETSET_ADD(font, line_height), @@ -817,6 +818,7 @@ static const JSCFunctionListEntry js_font_funcs[] = { CGETSET_ADD(font, range_px), CGETSET_ADD(font, sharpness), CGETSET_ADD(font, mode), + */ }; // Font constructor function diff --git a/transform.c b/transform.c index 08ad4221..147e8c03 100644 --- a/transform.c +++ b/transform.c @@ -195,11 +195,6 @@ static void js_transform_mark(JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark QJSCLASSMARK_EXTERN(transform,) -// TRANSFORM GETTER/SETTER FUNCTIONS -JSC_GETSET_APPLY(transform, pos, vec3) -JSC_GETSET_APPLY(transform, scale, vec3) -JSC_GETSET_APPLY(transform, rotation, quat) - static JSValue js_transform_get_change_hook(JSContext *js, JSValueConst self) { transform *t = js2transform(js,self); @@ -362,11 +357,11 @@ JSC_CCALL(transform_children, ) static const JSCFunctionListEntry js_transform_funcs[] = { - CGETSET_ADD(transform, pos), - CGETSET_ADD(transform, scale), - CGETSET_ADD(transform, rotation), - CGETSET_ADD(transform, parent), - CGETSET_ADD(transform, change_hook), +// CGETSET_ADD(transform, pos), +// CGETSET_ADD(transform, scale), +// CGETSET_ADD(transform, rotation), +// CGETSET_ADD(transform, parent), +// CGETSET_ADD(transform, change_hook), MIST_FUNC_DEF(transform, trs, 3), MIST_FUNC_DEF(transform, phys2d, 3), MIST_FUNC_DEF(transform, move, 1), diff --git a/tween.cm b/tween.cm index 47b55409..2fed6d5d 100644 --- a/tween.cm +++ b/tween.cm @@ -229,7 +229,7 @@ function Timeline() { // Live update loop for fire-and-forget tweens function live_update_loop() { - TweenEngine.update() + if (is_function(TweenEngine.update)) TweenEngine.update() $delay(live_update_loop, rate) }