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
|
||||
*/
|
||||
increaseTickRate() {
|
||||
if (G_IS_DEV && globalConfig.debug.renderForTrailer) {
|
||||
if (G_IS_DEV && globalConfig.debug.renderForTrailer || globalConfig.debug.disableDynamicTickrate) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@ export class DynamicTickrate {
|
||||
* Decreases the tick rate marginally
|
||||
*/
|
||||
decreaseTickRate() {
|
||||
if (G_IS_DEV && globalConfig.debug.renderForTrailer) {
|
||||
if (G_IS_DEV && globalConfig.debug.renderForTrailer || globalConfig.debug.disableDynamicTickrate) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -8,6 +8,7 @@ import { createLogger } from "../core/logging";
|
||||
import { MetaBeltBaseBuilding, arrayBeltVariantToRotation } from "./buildings/belt_base";
|
||||
import { SOUNDS } from "../platform/sound";
|
||||
import { round2Digits } from "../core/utils";
|
||||
import { globalConfig } from "../core/config";
|
||||
|
||||
const logger = createLogger("ingame/logic");
|
||||
|
||||
@ -199,12 +200,15 @@ export class GameLogic {
|
||||
performBulkOperation(operation) {
|
||||
logger.log("Running bulk operation ...");
|
||||
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 returnValue = operation();
|
||||
const duration = performanceNow() - now;
|
||||
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.signals.bulkOperationFinished.dispatch();
|
||||
return returnValue;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user