1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-02-12 10:59:23 +00:00

fix debug.disableDynamicTickrate

This commit is contained in:
Dimava 2020-06-05 10:31:08 +03:00
parent 06282b65c5
commit f5daacfa8f

View File

@ -60,11 +60,12 @@ export class DynamicTickrate {
* Increases the tick rate marginally * Increases the tick rate marginally
*/ */
increaseTickRate() { increaseTickRate() {
if (G_IS_DEV && globalConfig.debug.renderForTrailer || globalConfig.debug.disableDynamicTickrate) { const desiredFps = this.root.app.settings.getDesiredFps();
if ((G_IS_DEV && globalConfig.debug.renderForTrailer) || globalConfig.debug.disableDynamicTickrate) {
this.setTickRate(Math_round(Math_min(desiredFps, this.currentTickRate * 1.2)));
return; return;
} }
const desiredFps = this.root.app.settings.getDesiredFps();
this.setTickRate(Math_round(Math_min(desiredFps, this.currentTickRate * 1.2))); this.setTickRate(Math_round(Math_min(desiredFps, this.currentTickRate * 1.2)));
} }
@ -72,11 +73,12 @@ export class DynamicTickrate {
* Decreases the tick rate marginally * Decreases the tick rate marginally
*/ */
decreaseTickRate() { decreaseTickRate() {
if (G_IS_DEV && globalConfig.debug.renderForTrailer || globalConfig.debug.disableDynamicTickrate) { const desiredFps = this.root.app.settings.getDesiredFps();
if ((G_IS_DEV && globalConfig.debug.renderForTrailer) || globalConfig.debug.disableDynamicTickrate) {
this.setTickRate(Math_round(Math_max(desiredFps, this.currentTickRate * 0.8)));
return; return;
} }
const desiredFps = this.root.app.settings.getDesiredFps();
this.setTickRate(Math_round(Math_max(desiredFps / 2, this.currentTickRate * 0.8))); this.setTickRate(Math_round(Math_max(desiredFps / 2, this.currentTickRate * 0.8)));
} }