From 0b8c135d1167cfba7ebc1c2f174b9a3106240c0e Mon Sep 17 00:00:00 2001 From: Katajisto Date: Sat, 17 Oct 2026 15:08:33 +0300 Subject: [PATCH] fixes --- src/editor/trile_editor.jai | 3 --- src/main.jai | 27 +++++++++++++++++---------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/editor/trile_editor.jai b/src/editor/trile_editor.jai index d8ccd16..3ff58ca 100644 --- a/src/editor/trile_editor.jai +++ b/src/editor/trile_editor.jai @@ -419,10 +419,7 @@ get_tiling_neighbor_trile :: () -> *Trile { } draw_trile_editor :: () { - // A trile is drawn in the light of the world it will sit in. environment := New(Environment,, temp); - curworld := get_current_world(); - if curworld.valid environment = world_environment(*curworld.world); view := add_view(.{camera = get_trile_editor_camera(), environment = environment, draw_world = false}); mesh, ok := get_trile_mesh(editor_current_trile.name); diff --git a/src/main.jai b/src/main.jai index 47f11fe..7aa1bc6 100644 --- a/src/main.jai +++ b/src/main.jai @@ -108,6 +108,7 @@ init :: () { #if OS != .WASM { Thread.init(*g_mixer.mutex); } audio_init_thread_context(); saudio_setup(*(saudio_desc.{ + logger = .{ func = slog_func }, stream_cb = sokol_audio_callback, num_channels = 2, @@ -230,21 +231,28 @@ frame :: () { if delta_time_accumulator > (4.0/60.0) then delta_time_accumulator = 4.0/60.0; } - if should_tick_game && !settings_menu_blocks_game() { - game_tick_per_frame(delta_time); - while delta_time_accumulator > (1.0/480.0) { - game_tick(1.0/480.0); - tick_particles(1.0/480.0); - delta_time_accumulator -= (1.0/480.0); - } - } for event: Input.events_this_frame { GR.getrect_handle_event(event); } + tick_ui(); + if should_tick_game && !settings_menu_blocks_game () { + firstTick := true; + while delta_time_accumulator > (1.0/480.0) { + game_tick(1.0/480.0); + if firstTick { + input_per_frame_event_and_flag_update(); + firstTick = false; + } + tick_particles(1.0/480.0); + delta_time_accumulator -= (1.0/480.0); + } + } else { + input_per_frame_event_and_flag_update(); + } + add_frame_profiling_point("After game ticks"); - tick_ui(); add_frame_profiling_point("After UI tick"); if should_tick_game then game_draw(); @@ -272,7 +280,6 @@ frame :: () { #if OS != .WASM { profiler_update(); } reset_temporary_storage(); frame_end_time := get_time(); - input_per_frame_event_and_flag_update(); } cleanup :: () {