mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 18:10:37 +02:00
use timers rather than relying on update calls
This commit is contained in:
parent
a668ed0409
commit
1e6b2682c9
1 changed files with 5 additions and 3 deletions
|
@ -3984,7 +3984,7 @@ var updateTotalWork = 0;
|
||||||
|
|
||||||
var UPDATE_PERFORMANCE_DEBUGGING = false;
|
var UPDATE_PERFORMANCE_DEBUGGING = false;
|
||||||
|
|
||||||
function updateWrapper(){
|
var updateWrapper = function () {
|
||||||
|
|
||||||
intervalCount++;
|
intervalCount++;
|
||||||
var thisInterval = Date.now();
|
var thisInterval = Date.now();
|
||||||
|
@ -4032,12 +4032,14 @@ function updateWrapper(){
|
||||||
updateTotalWork = 0;
|
updateTotalWork = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Script.setTimeout(updateWrapper, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
Script.update.connect(updateWrapper);
|
// Script.update.connect(updateWrapper);
|
||||||
|
Script.setTimeout(updateWrapper, 16);
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
Menu.removeMenuItem("Developer", "Show Grab Sphere");
|
Menu.removeMenuItem("Developer", "Show Grab Sphere");
|
||||||
Script.update.disconnect(updateWrapper);
|
// Script.update.disconnect(updateWrapper);
|
||||||
rightController.cleanup();
|
rightController.cleanup();
|
||||||
leftController.cleanup();
|
leftController.cleanup();
|
||||||
Controller.disableMapping(MAPPING_NAME);
|
Controller.disableMapping(MAPPING_NAME);
|
||||||
|
|
Loading…
Reference in a new issue