mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-01 10:03:24 +00:00
delete Pixi build-ghost rendering from StructureIconsLayer
The WebGL ghost (StructurePass + RangeCirclePass + RailroadPass +
CrosshairPass) is fed via GhostPreviewUpdatedEvent and looks correct;
the Pixi-rendered ghost was a duplicate.
Strip the Pixi side out of StructureIconsLayer:
- delete imports for pixi.js / pixi-filters / colord plugins / Theme /
SpriteFactory / StructureDrawingUtils / bitmapFont / renderNumber
- delete fields: pixicanvas, ghostStage, rootStage, renderer,
rendererInitialized, theme, factory, filterRedArray, rebuildPending,
and the Pixi half of ghostUnit (container, priceText, priceBg,
priceGroup, priceBox, range, rangeLevel, targetingAlly) — now just
{ buildableUnit }
- delete methods: setupRenderer, redraw, rendererOrGLContextLost,
resizeCanvas, renderLayer, shouldTransform, updateGhostPrice,
updateGhostRange, plus the Pixi guts of moveGhost /
createGhostStructure / clearGhostStructure
init() is now sync; the per-RAF state checks move to a tick()-driven
syncGhostState() + renderGhost() (renderGhost still re-queries
buildables, just no longer paints anything).
Net: ~250 LOC gone, no canvas2D drawing left in the layer. The
canvas2D map canvas itself has no remaining writers — ready to be
deleted in a follow-up.
This commit is contained in:
@@ -96,6 +96,17 @@ export class GhostStructureChangedEvent implements GameEvent {
|
||||
constructor(public readonly ghostStructure: PlayerBuildableUnitType | null) {}
|
||||
}
|
||||
|
||||
/**
|
||||
* Per-frame ghost preview state for the WebGL renderer. Emitted by the
|
||||
* canvas2D ghost layer; consumed in ClientGameRunner.mountWebGLDebugRenderer
|
||||
* to push to view.updateGhostPreview. `data` is null when no ghost is active.
|
||||
*/
|
||||
export class GhostPreviewUpdatedEvent implements GameEvent {
|
||||
constructor(
|
||||
public readonly data: import("./render/types").GhostPreviewData | null,
|
||||
) {}
|
||||
}
|
||||
|
||||
export class ConfirmGhostStructureEvent implements GameEvent {}
|
||||
|
||||
export class SwapRocketDirectionEvent implements GameEvent {
|
||||
|
||||
Reference in New Issue
Block a user