mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-24 23:23:04 +00:00
Optimize mover rendering and segment plan pipeline
This commit is contained in:
@@ -484,9 +484,15 @@ export class GameRenderer {
|
||||
}
|
||||
|
||||
const tickLayerDurations: Record<string, number> = {};
|
||||
const layerCounters: Record<string, Record<string, number>> = {};
|
||||
|
||||
for (const layer of this.layers) {
|
||||
if (!layer.tick) {
|
||||
const counters = layer.getPerfCounters?.();
|
||||
if (counters && Object.keys(counters).length > 0) {
|
||||
const label = layer.constructor?.name ?? "UnknownLayer";
|
||||
layerCounters[label] = counters;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -510,8 +516,16 @@ export class GameRenderer {
|
||||
const label = layer.constructor?.name ?? "UnknownLayer";
|
||||
tickLayerDurations[label] = (tickLayerDurations[label] ?? 0) + duration;
|
||||
}
|
||||
|
||||
const counters = layer.getPerfCounters?.();
|
||||
if (counters && Object.keys(counters).length > 0) {
|
||||
const label = layer.constructor?.name ?? "UnknownLayer";
|
||||
layerCounters[label] = counters;
|
||||
}
|
||||
}
|
||||
|
||||
this.performanceOverlay.updateLayerCounters(layerCounters);
|
||||
|
||||
if (shouldProfileTick) {
|
||||
this.performanceOverlay.updateTickLayerMetrics(tickLayerDurations);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user