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:
evanpelle
2026-05-16 20:28:59 -07:00
parent 923cba8c2d
commit 5002dfdc2a
3 changed files with 109 additions and 274 deletions
+7
View File
@@ -39,6 +39,7 @@ import {
DoGroundAttackEvent,
DoRequestAllianceEvent,
DoRetaliateAttackEvent,
GhostPreviewUpdatedEvent,
InputHandler,
MouseMoveEvent,
MouseUpEvent,
@@ -346,6 +347,12 @@ function mountWebGLDebugRenderer(
view.showMoveIndicator(tx, ty, firstUnit.owner().smallID());
});
// Build-mode ghost preview: forward the per-frame state to the renderer's
// ghost passes (structure outline, range circle, rail snap, crosshair).
eventBus.on(GhostPreviewUpdatedEvent, (e) => {
view.updateGhostPreview(e.data);
});
// Warship selection boxes: forward UnitSelectionEvent to the renderer's
// SelectionBoxPass for both single and multi selections.
eventBus.on(UnitSelectionEvent, (e) => {