From 596c69f9cf686b6258f7a9a45d93cff9b0671a8d Mon Sep 17 00:00:00 2001 From: Skyler Lehmkuhl Date: Thu, 9 Feb 2012 10:00:22 -0500 Subject: [PATCH] Changed HTML5 to use fixed-size frames. --- base.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/base.js b/base.js index bb364d9..59f4615 100644 --- a/base.js +++ b/base.js @@ -32,6 +32,7 @@ function _timerBase () { this.remove = function (item) { delete this.funcs[item._id]; } + this.nextime = new Date().getTime() this.iterate = function() { canvas = Buffers[DrawingBuffer]; @@ -59,10 +60,14 @@ function _timerBase () { Buffers[1-DrawingBuffer].style.visibility='hidden'; Buffers[DrawingBuffer].style.visibility='visible'; _lastmouse=[_root._xmouse,_root._ymouse] + this.nextime = this.nextime+1000/fps + setTimeout('Timer.iterate()', this.nextime-new Date().getTime()) } } - setInterval('Timer.iterate()', 1000/fps) + setTimeout('Timer.iterate()', 1000/fps) + + //setInterval('Timer.iterate()', 1000/fps) } function _eventBase () {