mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-12-02 20:37:13 -05:00
Merge branch 'html5-fps' into rewrite/master
This commit is contained in:
commit
9c8142b769
1 changed files with 12 additions and 0 deletions
|
@ -66,6 +66,18 @@ class Main extends Sprite
|
|||
|
||||
function init(?event:Event):Void
|
||||
{
|
||||
#if web
|
||||
untyped js.Syntax.code("
|
||||
window.requestAnimationFrame = function(callback, element) {
|
||||
var currTime = new Date().getTime();
|
||||
var timeToCall = 0;
|
||||
var id = window.setTimeout(function() { callback(currTime + timeToCall); },
|
||||
timeToCall);
|
||||
lastTime = currTime + timeToCall;
|
||||
return id;
|
||||
}");
|
||||
#end
|
||||
|
||||
if (hasEventListener(Event.ADDED_TO_STAGE))
|
||||
{
|
||||
removeEventListener(Event.ADDED_TO_STAGE, init);
|
||||
|
|
Loading…
Reference in a new issue