From 65e62141a955420e10c22b14579c99aa07027e29 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 16 Jun 2014 14:43:45 -0700 Subject: skip a frame if Module.preMainLoop returns false --- src/library_browser.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/library_browser.js b/src/library_browser.js index 8e86371e..357bd96b 100644 --- a/src/library_browser.js +++ b/src/library_browser.js @@ -44,7 +44,12 @@ mergeInto(LibraryManager.library, { }, runIter: function(func) { if (ABORT) return; - if (Module['preMainLoop']) Module['preMainLoop'](); + if (Module['preMainLoop']) { + var preRet = Module['preMainLoop'](); + if (preRet === false) { + return; // |return false| skips a frame + } + } try { func(); } catch (e) { -- cgit v1.2.3-18-g5258