mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Fix #5843
This commit is contained in:
@@ -2112,7 +2112,9 @@ async function runWasm(wasmPath, consoleElement, extraForeignImports, wasmMemory
|
|||||||
wasmMemoryInterface.setMemory(exports.memory);
|
wasmMemoryInterface.setMemory(exports.memory);
|
||||||
}
|
}
|
||||||
|
|
||||||
exports._start();
|
if (exports._start) {
|
||||||
|
exports._start();
|
||||||
|
}
|
||||||
|
|
||||||
// Define a `@export step :: proc(delta_time: 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.
|
// in your app and it will get called every frame.
|
||||||
@@ -2130,7 +2132,9 @@ async function runWasm(wasmPath, consoleElement, extraForeignImports, wasmMemory
|
|||||||
prevTimeStamp = currTimeStamp;
|
prevTimeStamp = currTimeStamp;
|
||||||
|
|
||||||
if (!exports.step(dt, odin_ctx)) {
|
if (!exports.step(dt, odin_ctx)) {
|
||||||
exports._end();
|
if (exports._end) {
|
||||||
|
exports._end();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2139,7 +2143,9 @@ async function runWasm(wasmPath, consoleElement, extraForeignImports, wasmMemory
|
|||||||
|
|
||||||
window.requestAnimationFrame(step);
|
window.requestAnimationFrame(step);
|
||||||
} else {
|
} else {
|
||||||
exports._end();
|
if (exports._end) {
|
||||||
|
exports._end();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user