From: Brendan Hansen Date: Sat, 7 Aug 2021 17:05:47 +0000 (-0500) Subject: sped up the application X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=4459ab3fb4698711f224f421d58e4f86384793d8;p=onyx-wasm-analyzer.git sped up the application --- diff --git a/site/index.html b/site/index.html index 0d1d02b..dfefdad 100644 --- a/site/index.html +++ b/site/index.html @@ -1,3 +1,4 @@ + Wasm-32 Decompiler diff --git a/src/app.onyx b/src/app.onyx index 1baad43..244d0e0 100644 --- a/src/app.onyx +++ b/src/app.onyx @@ -293,6 +293,10 @@ handle_event :: (event: ^events.Event) { } } +needs_update :: () -> bool { + return ui.has_active_animation() || debug_log_y_offset != debug_log_y_offset_target; +} + update :: (dt: f32) { } diff --git a/src/config.onyx b/src/config.onyx index 1e642cb..d9c8cf4 100644 --- a/src/config.onyx +++ b/src/config.onyx @@ -4,6 +4,8 @@ package config use package immediate_mode { Color4 } +ONLY_UPDATE_ON_EVENTS :: true + color_scheme_file :: "/res/colors_light.json" Colors : struct { diff --git a/src/main.onyx b/src/main.onyx index 1500686..802b831 100644 --- a/src/main.onyx +++ b/src/main.onyx @@ -2,6 +2,7 @@ #private_file events :: package js_events #private_file config :: package config #private_file app :: package app +#private_file ui :: package ui main :: (args: [] cstr) { app.init(); @@ -21,7 +22,7 @@ main :: (args: [] cstr) { last_time = now; #if #defined(config.ONLY_UPDATE_ON_EVENTS) { - if poll_events() { + if poll_events() || app.needs_update() { app.update(dt); app.draw(); }