This commit is contained in:
2026-01-23 15:06:10 -06:00
parent 4f7e7ab591
commit 6c07f11992
9 changed files with 18 additions and 27 deletions

View File

@@ -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)
}

View File

@@ -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) {

View File

@@ -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)
}

View File

@@ -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)

View File

@@ -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;
}

View File

@@ -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",

View File

@@ -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

View File

@@ -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),

View File

@@ -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)
}