mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-02-12 02:49:20 +00:00
debug.disableBulkOperations & debug.disableDynamicTickrate
This commit is contained in:
parent
328de2b033
commit
ae5763be9b
@ -60,7 +60,7 @@ export class DynamicTickrate {
|
|||||||
* Increases the tick rate marginally
|
* Increases the tick rate marginally
|
||||||
*/
|
*/
|
||||||
increaseTickRate() {
|
increaseTickRate() {
|
||||||
if (G_IS_DEV && globalConfig.debug.renderForTrailer) {
|
if (G_IS_DEV && globalConfig.debug.renderForTrailer || globalConfig.debug.disableDynamicTickrate) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ export class DynamicTickrate {
|
|||||||
* Decreases the tick rate marginally
|
* Decreases the tick rate marginally
|
||||||
*/
|
*/
|
||||||
decreaseTickRate() {
|
decreaseTickRate() {
|
||||||
if (G_IS_DEV && globalConfig.debug.renderForTrailer) {
|
if (G_IS_DEV && globalConfig.debug.renderForTrailer || globalConfig.debug.disableDynamicTickrate) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import { createLogger } from "../core/logging";
|
|||||||
import { MetaBeltBaseBuilding, arrayBeltVariantToRotation } from "./buildings/belt_base";
|
import { MetaBeltBaseBuilding, arrayBeltVariantToRotation } from "./buildings/belt_base";
|
||||||
import { SOUNDS } from "../platform/sound";
|
import { SOUNDS } from "../platform/sound";
|
||||||
import { round2Digits } from "../core/utils";
|
import { round2Digits } from "../core/utils";
|
||||||
|
import { globalConfig } from "../core/config";
|
||||||
|
|
||||||
const logger = createLogger("ingame/logic");
|
const logger = createLogger("ingame/logic");
|
||||||
|
|
||||||
@ -199,12 +200,15 @@ export class GameLogic {
|
|||||||
performBulkOperation(operation) {
|
performBulkOperation(operation) {
|
||||||
logger.log("Running bulk operation ...");
|
logger.log("Running bulk operation ...");
|
||||||
assert(!this.root.bulkOperationRunning, "Can not run two bulk operations twice");
|
assert(!this.root.bulkOperationRunning, "Can not run two bulk operations twice");
|
||||||
this.root.bulkOperationRunning = true;
|
this.root.bulkOperationRunning = true && !globalConfig.debug.disableBulkOperations;
|
||||||
const now = performanceNow();
|
const now = performanceNow();
|
||||||
const returnValue = operation();
|
const returnValue = operation();
|
||||||
const duration = performanceNow() - now;
|
const duration = performanceNow() - now;
|
||||||
logger.log("Done in", round2Digits(duration), "ms");
|
logger.log("Done in", round2Digits(duration), "ms");
|
||||||
assert(this.root.bulkOperationRunning, "Bulk operation = false while bulk operation was running");
|
assert(
|
||||||
|
this.root.bulkOperationRunning || globalConfig.debug.disableBulkOperations,
|
||||||
|
"Bulk operation = false while bulk operation was running"
|
||||||
|
);
|
||||||
this.root.bulkOperationRunning = false;
|
this.root.bulkOperationRunning = false;
|
||||||
this.root.signals.bulkOperationFinished.dispatch();
|
this.root.signals.bulkOperationFinished.dispatch();
|
||||||
return returnValue;
|
return returnValue;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user