mirror of
https://github.com/sexybiggetje/pixdisp.git
synced 2024-11-22 02:21:02 +01:00
Fix binding for getDelta()
This commit is contained in:
parent
c2515869e3
commit
13961a2f8e
1 changed files with 5 additions and 5 deletions
|
@ -54,27 +54,27 @@ class VMController
|
||||||
'drawCircle': this.driver.drawCircle.bind( this.driver ),
|
'drawCircle': this.driver.drawCircle.bind( this.driver ),
|
||||||
'write': this.driver.write.bind( this.driver ),
|
'write': this.driver.write.bind( this.driver ),
|
||||||
|
|
||||||
'delta': this.getDelta.bind( this ),
|
'getDelta': this.getDelta.bind( this ),
|
||||||
'run': this.run.bind( this )
|
'run': this.run.bind( this )
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
runScript( ) {
|
runScript( ) {
|
||||||
|
|
||||||
let delta = 0;
|
let deltaLocal = 0;
|
||||||
let tmd = this.getTimeData();
|
let tmd = this.getTimeData();
|
||||||
|
|
||||||
delta = tmd - this.previousTime;
|
deltaLocal = tmd - this.previousTime;
|
||||||
|
|
||||||
this.previousTime = tmd;
|
this.previousTime = tmd;
|
||||||
|
|
||||||
this.delta = delta / 1000000;
|
this.delta = deltaLocal / 1000000;
|
||||||
|
|
||||||
this.vm.run( this.runningVmScript, 'pixdisp-sandbox.js' );
|
this.vm.run( this.runningVmScript, 'pixdisp-sandbox.js' );
|
||||||
|
|
||||||
if ( this.runNextFrame === true ) {
|
if ( this.runNextFrame === true ) {
|
||||||
this.runNextFrame = false;
|
this.runNextFrame = false;
|
||||||
setTimeout( this.runScript.bind( this ), 1 );
|
setTimeout( this.runScript.bind( this ), 1000 / 60 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue