aboutsummaryrefslogtreecommitdiff
path: root/src/runtime.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-04-30 10:34:43 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-04-30 10:34:43 -0700
commitbcaf98582784d114d616067bcfb304e4037ec19f (patch)
tree024652d842e3cf42f913776c875ea8c0347dad1c /src/runtime.js
parentc544c870d3cab2bcddda428d57807c389e8b04b1 (diff)
show missing preloaded image/audio files only once
Diffstat (limited to 'src/runtime.js')
-rw-r--r--src/runtime.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/runtime.js b/src/runtime.js
index 5e3dcdcc..0674f624 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -315,6 +315,14 @@ var Runtime = {
return ret;
},
+ warnOnce: function(text) {
+ if (!warnOnce.shown) warnOnce.shown = {};
+ if (!warnOnce.shown[text]) {
+ warnOnce.shown[text] = 1;
+ Module.printErr(text);
+ }
+ },
+
#if RUNTIME_DEBUG
debug: true, // Switch to false at runtime to disable logging at the right times