From 4a616d97df64bb99a84674e5b6e907001c9e23fc Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 29 Sep 2024 10:14:56 +0100 Subject: [PATCH] Pass delta time instead of current time to odin.js `step` --- core/sys/wasm/js/odin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/sys/wasm/js/odin.js b/core/sys/wasm/js/odin.js index bf002da74..6f086e595 100644 --- a/core/sys/wasm/js/odin.js +++ b/core/sys/wasm/js/odin.js @@ -1933,7 +1933,7 @@ async function runWasm(wasmPath, consoleElement, extraForeignImports, wasmMemory exports._start(); - // Define a `@export step :: proc(current_type: f64) -> (keep_going: bool) {` + // Define a `@export step :: proc(delta_time: f64) -> (keep_going: bool) {` // in your app and it will get called every frame. // return `false` to stop the execution of the module. if (exports.step) { @@ -1955,7 +1955,7 @@ async function runWasm(wasmPath, consoleElement, extraForeignImports, wasmMemory } event_temp.data = null; - if (!exports.step(currTimeStamp*0.001, odin_ctx)) { + if (!exports.step(dt, odin_ctx)) { exports._end(); return; }