sped up the application
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Sat, 7 Aug 2021 17:05:47 +0000 (12:05 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Sat, 7 Aug 2021 17:05:47 +0000 (12:05 -0500)
site/index.html
src/app.onyx
src/config.onyx
src/main.onyx

index 0d1d02ba0f1e146b0eb5c6ffa0e52033c37931da..dfefdadeeadbb246adb205e48960b9fc76e8c905 100644 (file)
@@ -1,3 +1,4 @@
+<!DOCTYPE html>
 <html>
     <head>
         <title>Wasm-32 Decompiler</title>
index 1baad432ddc877abbe55e3e478914a87b88b6657..244d0e0569172430042590dd3a2dfd2b57d7aa3b 100644 (file)
@@ -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) {
 }
 
index 1e642cbe86b1f28caa29146cd04800ff6258295e..d9c8cf49e5854a9aeee567f4c6c17fc09334ffba 100644 (file)
@@ -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 {
index 15006860b3a694d4da5e3a86e02e6271bc741d83..802b8310d3e9d05eef848083508c4d28e2e10aee 100644 (file)
@@ -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();
         }