rename render/ files to UpperCamelCase to match client convention

The render/ tree was the only place in the client still using kebab-case
filenames. Brings ~80 files in line with the rest of src/client/
(BuildPreviewController, TransformHandler, etc.). Directories kept as
they were (name-pass/, fx-pass/, passes/, utils/, debug/) since the
codebase already mixes those.

Two collisions surfaced and got resolved: render/types/ is a directory,
not a file, so its imports kept the lowercase form; and the sed pass
incidentally normalized core/pathfinding imports, which had to be
reverted since that file is actually lowercase on disk despite some
imports having referenced it as ./Types under macOS case-insensitive
resolution.
This commit is contained in:
evanpelle
2026-05-17 21:21:05 -07:00
parent 5a9694e2bd
commit 4cd22a9b5c
88 changed files with 244 additions and 244 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
import { Colord } from "colord";
import { GameView } from "../core/game/GameView";
import { uploadFrameData } from "./render/frame/upload";
import { uploadFrameData } from "./render/frame/Upload";
import { PlayerStatic, GameView as WebGLGameView } from "./render/gl";
const PALETTE_SIZE = 4096;
@@ -23,7 +23,7 @@ import {
MouseUpEvent,
} from "../InputHandler";
import { GameView as WebGLGameView, buildNukeTrajectory } from "../render/gl";
import type { SAMInfo } from "../render/gl/utils/nuke-trajectory";
import type { SAMInfo } from "../render/gl/utils/NukeTrajectory";
import type { GhostPreviewData } from "../render/types";
import { TransformHandler } from "../TransformHandler";
import {
@@ -13,7 +13,7 @@ import { GameView } from "../../core/game/GameView";
import { Controller } from "../Controller";
import { MouseMoveEvent } from "../InputHandler";
import { GameView as WebGLGameView } from "../render/gl";
import { OWNER_MASK } from "../render/gl/utils/tile-codec";
import { OWNER_MASK } from "../render/gl/utils/TileCodec";
import { TransformHandler } from "../TransformHandler";
export class HoverHighlightController implements Controller {
+8 -8
View File
@@ -2,19 +2,19 @@
export type { FrameData } from "../types";
// Shared derive functions
export { computeAllianceClusters } from "./derive/alliance-clusters";
export { computeAllianceClusters } from "./derive/AllianceClusters";
export {
extractAttackRings,
extractAttackRingsFromIds,
} from "./derive/attack-rings";
} from "./derive/AttackRings";
export {
extractNukeTelegraphs,
extractNukeTelegraphsFromIds,
} from "./derive/nuke-telegraphs";
export { computePlayerStatus } from "./derive/player-status";
export { buildRelationMatrix, buildTeamMap } from "./derive/relation-matrix";
} from "./derive/NukeTelegraphs";
export { computePlayerStatus } from "./derive/PlayerStatus";
export { buildRelationMatrix, buildTeamMap } from "./derive/RelationMatrix";
// Upload
export type { RelationMatrixResult } from "./derive/relation-matrix";
export { uploadFrameData } from "./upload";
export type { FrameUploadTarget, UploadOptions } from "./upload";
export type { RelationMatrixResult } from "./derive/RelationMatrix";
export { uploadFrameData } from "./Upload";
export type { FrameUploadTarget, UploadOptions } from "./Upload";
@@ -28,10 +28,10 @@ import type {
GameViewEventMap,
GameViewEventType,
RadialMenuItem,
} from "./events";
import type { SpawnCenter } from "./passes/spawn-overlay-pass";
import type { RenderSettings } from "./render-settings";
import { GPURenderer } from "./renderer";
} from "./Events";
import type { SpawnCenter } from "./passes/SpawnOverlayPass";
import { GPURenderer } from "./Renderer";
import type { RenderSettings } from "./RenderSettings";
export class GameView {
private renderer: GPURenderer;
@@ -25,52 +25,52 @@ import type {
TilePair,
UnitState,
} from "../types";
import { Camera } from "./camera";
import type { RadialMenuItem } from "./events";
import { BarPass } from "./passes/bar-pass";
import { BorderComputePass } from "./passes/border-compute-pass";
import { BorderStampPass } from "./passes/border-stamp-pass";
import { ConquestPopupPass } from "./passes/conquest-popup-pass";
import { CoordinateGridPass } from "./passes/coordinate-grid-pass";
import { CrosshairPass } from "./passes/crosshair-pass";
import { FalloutBloomPass } from "./passes/fallout-bloom-pass";
import { FalloutLightPass } from "./passes/fallout-light-pass";
import { Camera } from "./Camera";
import type { RadialMenuItem } from "./Events";
import { BarPass } from "./passes/BarPass";
import { BorderComputePass } from "./passes/BorderComputePass";
import { BorderStampPass } from "./passes/BorderStampPass";
import { ConquestPopupPass } from "./passes/ConquestPopupPass";
import { CoordinateGridPass } from "./passes/CoordinateGridPass";
import { CrosshairPass } from "./passes/CrosshairPass";
import { FalloutBloomPass } from "./passes/FalloutBloomPass";
import { FalloutLightPass } from "./passes/FalloutLightPass";
import { FxPass } from "./passes/fx-pass";
import { LightmapPass } from "./passes/lightmap-pass";
import { MoveIndicatorPass } from "./passes/move-indicator-pass";
import { LightmapPass } from "./passes/LightmapPass";
import { MoveIndicatorPass } from "./passes/MoveIndicatorPass";
import { NamePass } from "./passes/name-pass";
import { NightCompositePass } from "./passes/night-composite-pass";
import { NukeTelegraphPass } from "./passes/nuke-telegraph-pass";
import { NukeTrajectoryPass } from "./passes/nuke-trajectory-pass";
import { PointLightPass } from "./passes/point-light-pass";
import { RadialMenuPass } from "./passes/radial-menu-pass";
import { RailroadPass } from "./passes/railroad-pass";
import { RangeCirclePass } from "./passes/range-circle-pass";
import { SAMRadiusPass } from "./passes/sam-radius-pass";
import { SelectionBoxPass } from "./passes/selection-box-pass";
import type { SpawnCenter } from "./passes/spawn-overlay-pass";
import { SpawnOverlayPass } from "./passes/spawn-overlay-pass";
import { StructureLevelPass } from "./passes/structure-level-pass";
import { StructurePass } from "./passes/structure-pass";
import { TerrainPass } from "./passes/terrain-pass";
import { TerritoryPass } from "./passes/territory-pass";
import { TrailPass } from "./passes/trail-pass";
import { UnitPass } from "./passes/unit-pass";
import { createRenderSettings, type RenderSettings } from "./render-settings";
import { AffiliationPalette } from "./utils/affiliation";
import { buildTerrainRGBA, getPaletteSize } from "./utils/color-utils";
import { NightCompositePass } from "./passes/NightCompositePass";
import { NukeTelegraphPass } from "./passes/NukeTelegraphPass";
import { NukeTrajectoryPass } from "./passes/NukeTrajectoryPass";
import { PointLightPass } from "./passes/PointLightPass";
import { RadialMenuPass } from "./passes/RadialMenuPass";
import { RailroadPass } from "./passes/RailroadPass";
import { RangeCirclePass } from "./passes/RangeCirclePass";
import { SAMRadiusPass } from "./passes/SamRadiusPass";
import { SelectionBoxPass } from "./passes/SelectionBoxPass";
import type { SpawnCenter } from "./passes/SpawnOverlayPass";
import { SpawnOverlayPass } from "./passes/SpawnOverlayPass";
import { StructureLevelPass } from "./passes/StructureLevelPass";
import { StructurePass } from "./passes/StructurePass";
import { TerrainPass } from "./passes/TerrainPass";
import { TerritoryPass } from "./passes/TerritoryPass";
import { TrailPass } from "./passes/TrailPass";
import { UnitPass } from "./passes/UnitPass";
import { createRenderSettings, type RenderSettings } from "./RenderSettings";
import { AffiliationPalette } from "./utils/Affiliation";
import { buildTerrainRGBA, getPaletteSize } from "./utils/ColorUtils";
import {
createTexture2D,
toScreen,
toTarget,
type RenderTarget,
} from "./utils/gl-utils";
} from "./utils/GlUtils";
import {
createGPUResources,
disposeGPUResources,
type GPUResources,
} from "./utils/gpu-resources";
import { HeatManager } from "./utils/heat-manager";
} from "./utils/GpuResources";
import { HeatManager } from "./utils/HeatManager";
/** Ghost types that trigger SAM radius overlay (matches upstream SAMRadiusLayer). */
const SAM_RADIUS_GHOST_TYPES = new Set([
@@ -166,7 +166,7 @@ export class GPURenderer {
// Warship selection — supports any number of selections.
private selectedUnitIds: number[] = [];
/** Reusable scratch buffer of {x,y,r,g,b} for the selection-box pass. */
private readonly selectionBoxEntries: import("./passes/selection-box-pass").SelectionEntry[] =
private readonly selectionBoxEntries: import("./passes/SelectionBoxPass").SelectionEntry[] =
[];
constructor(
@@ -1,4 +1,4 @@
import type { ConfigProp } from "./config-prop";
import type { ConfigProp } from "./ConfigProp";
export interface FolderNode {
kind: "folder";
@@ -1,10 +1,10 @@
import type { RenderSettings } from "../render-settings";
import type { DebugNode } from "./folder";
import { folder } from "./folder";
import { color } from "./props/color";
import { select } from "./props/select";
import { slider } from "./props/slider";
import { toggle } from "./props/toggle";
import type { RenderSettings } from "../RenderSettings";
import type { DebugNode } from "./Folder";
import { folder } from "./Folder";
import { color } from "./props/Color";
import { select } from "./props/Select";
import { slider } from "./props/Slider";
import { toggle } from "./props/Toggle";
export function buildTree(s: RenderSettings, d: RenderSettings): DebugNode[] {
return [
@@ -1,6 +1,6 @@
import GUI from "lil-gui";
import type { ConfigProp } from "./config-prop";
import type { DebugNode, FolderNode } from "./folder";
import type { ConfigProp } from "./ConfigProp";
import type { DebugNode, FolderNode } from "./Folder";
/** Walk the debug tree, drawing each node onto the GUI. Returns all leaf props. */
export function walkTree(nodes: DebugNode[], parent: GUI): ConfigProp[] {
@@ -1,8 +1,8 @@
import GUI, { FunctionController } from "lil-gui";
import type { RenderSettings } from "../render-settings";
import { createRenderSettings, dumpSettings } from "../render-settings";
import { deepAssign } from "../settings-utils";
import type { ConfigProp } from "./config-prop";
import type { RenderSettings } from "../RenderSettings";
import { createRenderSettings, dumpSettings } from "../RenderSettings";
import { deepAssign } from "../SettingsUtils";
import type { ConfigProp } from "./ConfigProp";
// ---------------------------------------------------------------------------
// Draggable title bar
+5 -5
View File
@@ -1,9 +1,9 @@
import GUI from "lil-gui";
import type { RenderSettings } from "../render-settings";
import { createRenderSettings } from "../render-settings";
import { buildTree } from "./layout";
import { walkTree } from "./tree";
import { makeDraggable, wireActions, wireModifiedIndicators } from "./wiring";
import type { RenderSettings } from "../RenderSettings";
import { createRenderSettings } from "../RenderSettings";
import { buildTree } from "./Layout";
import { walkTree } from "./Tree";
import { makeDraggable, wireActions, wireModifiedIndicators } from "./Wiring";
export function createDebugGui(
settings: RenderSettings,
@@ -1,6 +1,6 @@
import type GUI from "lil-gui";
import type { ColorController, Controller } from "lil-gui";
import type { ConfigProp } from "../config-prop";
import type { ConfigProp } from "../ConfigProp";
export function color<T extends Record<string, unknown>>(
target: T,
@@ -1,6 +1,6 @@
import type GUI from "lil-gui";
import type { Controller } from "lil-gui";
import type { ConfigProp } from "../config-prop";
import type { ConfigProp } from "../ConfigProp";
export function select<T extends Record<string, unknown>>(
target: T,
@@ -1,6 +1,6 @@
import type GUI from "lil-gui";
import type { Controller } from "lil-gui";
import type { ConfigProp } from "../config-prop";
import type { ConfigProp } from "../ConfigProp";
export function slider<T extends Record<string, unknown>>(
target: T,
@@ -1,6 +1,6 @@
import type GUI from "lil-gui";
import type { Controller } from "lil-gui";
import type { ConfigProp } from "../config-prop";
import type { ConfigProp } from "../ConfigProp";
export function toggle<T extends Record<string, unknown>>(
target: T,
+9 -9
View File
@@ -7,15 +7,15 @@ export type {
MapScrollEvent,
RadialMenuItem,
RadialMenuSelectEvent,
} from "./events";
export { GameView } from "./game-view";
export type { SpawnCenter } from "./passes/spawn-overlay-pass";
export { createRenderSettings, dumpSettings } from "./render-settings";
export type { RenderSettings } from "./render-settings";
export { deepAssign, deepDiff } from "./settings-utils";
export { buildTerrainRGBA, getPaletteSize } from "./utils/color-utils";
export { buildNukeTrajectory, samRange } from "./utils/nuke-trajectory";
export type { SAMInfo } from "./utils/nuke-trajectory";
} from "./Events";
export { GameView } from "./GameView";
export type { SpawnCenter } from "./passes/SpawnOverlayPass";
export { createRenderSettings, dumpSettings } from "./RenderSettings";
export type { RenderSettings } from "./RenderSettings";
export { deepAssign, deepDiff } from "./SettingsUtils";
export { buildTerrainRGBA, getPaletteSize } from "./utils/ColorUtils";
export { buildNukeTrajectory, samRange } from "./utils/NukeTrajectory";
export type { SAMInfo } from "./utils/NukeTrajectory";
// Re-export shared types used in the public API
export type {
@@ -15,11 +15,11 @@ import {
DELETION_MARK_DURATION,
missileReadiness,
WARSHIP_MAX_HEALTH,
} from "../../game-constants";
} from "../../GameConstants";
import type { RendererConfig, UnitState } from "../../types";
import { UT_MISSILE_SILO, UT_SAM_LAUNCHER } from "../../types";
import type { RenderSettings } from "../render-settings";
import { createProgram } from "../utils/gl-utils";
import type { RenderSettings } from "../RenderSettings";
import { createProgram } from "../utils/GlUtils";
import barFragSrc from "../shaders/bar/bar.frag.glsl?raw";
import barVertSrc from "../shaders/bar/bar.vert.glsl?raw";
@@ -12,7 +12,7 @@
* computed once here via an N-tile Chebyshev radius expansion.
*/
import type { RenderSettings } from "../render-settings";
import type { RenderSettings } from "../RenderSettings";
import borderComputeFragSrc from "../shaders/border-compute/border-compute.frag.glsl?raw";
import fullscreenNoUvVertSrc from "../shaders/shared/fullscreen-no-uv.vert.glsl?raw";
import {
@@ -20,8 +20,8 @@ import {
createProgram,
createTexture2D,
shaderSrc,
} from "../utils/gl-utils";
import { TILE_DEFINES } from "../utils/tile-codec";
} from "../utils/GlUtils";
import { TILE_DEFINES } from "../utils/TileCodec";
const MAX_DEFENSE_POSTS = 64;
@@ -6,10 +6,10 @@
* from the BorderComputePass RGBA8 buffer.
*/
import type { RenderSettings } from "../render-settings";
import { getPaletteSize } from "../utils/color-utils";
import { createMapQuad, createProgram, shaderSrc } from "../utils/gl-utils";
import { TILE_DEFINES } from "../utils/tile-codec";
import type { RenderSettings } from "../RenderSettings";
import { getPaletteSize } from "../utils/ColorUtils";
import { createMapQuad, createProgram, shaderSrc } from "../utils/GlUtils";
import { TILE_DEFINES } from "../utils/TileCodec";
import borderStampFragSrc from "../shaders/day-night/border-stamp.frag.glsl?raw";
import borderStampVertSrc from "../shaders/day-night/border-stamp.vert.glsl?raw";
@@ -7,13 +7,13 @@
*/
import type { BonusEvent, ConquestFx } from "../../types";
import type { RenderSettings } from "../render-settings";
import { createProgram } from "../utils/gl-utils";
import type { GlyphTables } from "./name-pass/atlas-data";
import { buildGlyphTables, parseAtlasData } from "./name-pass/atlas-data";
import { buildGlyphMetricsTex } from "./name-pass/data-textures";
import { layoutString } from "./name-pass/text-layout";
import { CHAR_RANGE, MAX_CHARS } from "./name-pass/types";
import type { RenderSettings } from "../RenderSettings";
import { createProgram } from "../utils/GlUtils";
import type { GlyphTables } from "./name-pass/AtlasData";
import { buildGlyphTables, parseAtlasData } from "./name-pass/AtlasData";
import { buildGlyphMetricsTex } from "./name-pass/DataTextures";
import { layoutString } from "./name-pass/TextLayout";
import { CHAR_RANGE, MAX_CHARS } from "./name-pass/Types";
import { assetUrl } from "src/core/AssetUrls";
import fragSrc from "../shaders/conquest-popup/conquest-popup.frag.glsl?raw";
@@ -6,8 +6,8 @@
* the upstream game's CoordinateGridLayer.
*/
import type { RenderSettings } from "../render-settings";
import { createMapQuad, createProgram } from "../utils/gl-utils";
import type { RenderSettings } from "../RenderSettings";
import { createMapQuad, createProgram } from "../utils/GlUtils";
import gridFragSrc from "../shaders/grid/grid.frag.glsl?raw";
import overlayVertSrc from "../shaders/map-overlay/overlay.vert.glsl?raw";
@@ -8,7 +8,7 @@
import type { GhostPreviewData } from "../../types";
import { UT_MIRV, UT_WARSHIP } from "../../types";
import { createProgram } from "../utils/gl-utils";
import { createProgram } from "../utils/GlUtils";
import fragSrc from "../shaders/crosshair/crosshair.frag.glsl?raw";
import vertSrc from "../shaders/crosshair/crosshair.vert.glsl?raw";
@@ -9,15 +9,15 @@
* Heat management is handled by HeatManager (shared with LightmapPass).
*/
import type { RenderSettings } from "../render-settings";
import type { RenderSettings } from "../RenderSettings";
import {
createFullscreenQuad,
createMapQuad,
createProgram,
shaderSrc,
} from "../utils/gl-utils";
import type { HeatManager } from "../utils/heat-manager";
import { TILE_DEFINES } from "../utils/tile-codec";
} from "../utils/GlUtils";
import type { HeatManager } from "../utils/HeatManager";
import { TILE_DEFINES } from "../utils/TileCodec";
import compositeFragSrc from "../shaders/fallout-bloom/composite.frag.glsl?raw";
import compositeVertSrc from "../shaders/fallout-bloom/composite.vert.glsl?raw";
@@ -6,15 +6,15 @@
* 2. Composite into the target lightmap FBO via camera-projected map quad (additive)
*/
import type { RenderSettings } from "../render-settings";
import type { RenderSettings } from "../RenderSettings";
import {
createFullscreenQuad,
createMapQuad,
createProgram,
shaderSrc,
} from "../utils/gl-utils";
import type { HeatManager } from "../utils/heat-manager";
import { TILE_DEFINES } from "../utils/tile-codec";
} from "../utils/GlUtils";
import type { HeatManager } from "../utils/HeatManager";
import { TILE_DEFINES } from "../utils/TileCodec";
import falloutCompositeFragSrc from "../shaders/day-night/fallout-composite.frag.glsl?raw";
import falloutCompositeVertSrc from "../shaders/day-night/fallout-composite.vert.glsl?raw";
@@ -5,10 +5,10 @@
* Delegates light rendering to PointLightPass and FalloutLightPass.
*/
import type { RenderSettings } from "../render-settings";
import { createFullscreenQuad, createProgram } from "../utils/gl-utils";
import type { FalloutLightPass } from "./fallout-light-pass";
import type { PointLightPass } from "./point-light-pass";
import type { RenderSettings } from "../RenderSettings";
import { createFullscreenQuad, createProgram } from "../utils/GlUtils";
import type { FalloutLightPass } from "./FalloutLightPass";
import type { PointLightPass } from "./PointLightPass";
import blurFragSrc from "../shaders/shared/blur.frag.glsl?raw";
import fullscreenVertSrc from "../shaders/shared/fullscreen.vert.glsl?raw";
@@ -4,8 +4,8 @@
* but rendered via SDF in a fragment shader.
*/
import type { RenderSettings } from "../render-settings";
import { createProgram } from "../utils/gl-utils";
import type { RenderSettings } from "../RenderSettings";
import { createProgram } from "../utils/GlUtils";
import fragSrc from "../shaders/move-indicator/move-indicator.frag.glsl?raw";
import vertSrc from "../shaders/move-indicator/move-indicator.vert.glsl?raw";
@@ -9,8 +9,8 @@
* multiplication by ~1.0 so the pass runs continuously with no threshold.
*/
import type { RenderSettings } from "../render-settings";
import { createFullscreenQuad, createProgram } from "../utils/gl-utils";
import type { RenderSettings } from "../RenderSettings";
import { createFullscreenQuad, createProgram } from "../utils/GlUtils";
import compositeFragSrc from "../shaders/day-night/composite.frag.glsl?raw";
import fullscreenVertSrc from "../shaders/shared/fullscreen.vert.glsl?raw";
@@ -7,9 +7,9 @@
*/
import type { NukeTelegraphData } from "../../types";
import { DynamicInstanceBuffer } from "../dynamic-buffer";
import type { RenderSettings } from "../render-settings";
import { createProgram } from "../utils/gl-utils";
import { DynamicInstanceBuffer } from "../DynamicBuffer";
import type { RenderSettings } from "../RenderSettings";
import { createProgram } from "../utils/GlUtils";
import fragSrc from "../shaders/nuke-telegraph/nuke-telegraph.frag.glsl?raw";
import vertSrc from "../shaders/nuke-telegraph/nuke-telegraph.vert.glsl?raw";
@@ -11,8 +11,8 @@
*/
import type { NukeTrajectoryData } from "../../types";
import type { RenderSettings } from "../render-settings";
import { createProgram } from "../utils/gl-utils";
import type { RenderSettings } from "../RenderSettings";
import { createProgram } from "../utils/GlUtils";
import markerFragSrc from "../shaders/nuke-trajectory/nuke-trajectory-marker.frag.glsl?raw";
import markerVertSrc from "../shaders/nuke-trajectory/nuke-trajectory-marker.vert.glsl?raw";
@@ -22,8 +22,8 @@ import {
UT_TRANSPORT,
UT_WARSHIP,
} from "../../types";
import type { RenderSettings } from "../render-settings";
import { createProgram, shaderSrc } from "../utils/gl-utils";
import type { RenderSettings } from "../RenderSettings";
import { createProgram, shaderSrc } from "../utils/GlUtils";
import lightFragSrc from "../shaders/day-night/light.frag.glsl?raw";
import lightVertSrc from "../shaders/day-night/light.vert.glsl?raw";
@@ -12,8 +12,8 @@
* 3. Icons: instanced quads sampling the emoji atlas
*/
import type { RadialMenuItem } from "../events";
import { createProgram } from "../utils/gl-utils";
import type { RadialMenuItem } from "../Events";
import { createProgram } from "../utils/GlUtils";
import arcFragSrc from "../shaders/radial-menu/arcs.frag.glsl?raw";
import arcVertSrc from "../shaders/radial-menu/arcs.vert.glsl?raw";
@@ -17,17 +17,17 @@
*/
import type { GhostPreviewData } from "../../types";
import type { RenderSettings } from "../render-settings";
import type { RenderSettings } from "../RenderSettings";
import overlayVertSrc from "../shaders/map-overlay/overlay.vert.glsl?raw";
import railroadFragSrc from "../shaders/railroad/railroad.frag.glsl?raw";
import { getPaletteSize } from "../utils/color-utils";
import { getPaletteSize } from "../utils/ColorUtils";
import {
createMapQuad,
createProgram,
createTexture2D,
shaderSrc,
} from "../utils/gl-utils";
import { TILE_DEFINES } from "../utils/tile-codec";
} from "../utils/GlUtils";
import { TILE_DEFINES } from "../utils/TileCodec";
// ---------------------------------------------------------------------------
// Rail orientation (0-5) → texture value (1-6, 0=none)
@@ -7,7 +7,7 @@
*/
import type { GhostPreviewData } from "../../types";
import { createProgram } from "../utils/gl-utils";
import { createProgram } from "../utils/GlUtils";
import fragSrc from "../shaders/range-circle/range-circle.frag.glsl?raw";
import vertSrc from "../shaders/range-circle/range-circle.vert.glsl?raw";
@@ -15,10 +15,10 @@
import type { UnitState } from "../../types";
import { UT_SAM_LAUNCHER } from "../../types";
import { DynamicInstanceBuffer } from "../dynamic-buffer";
import type { RenderSettings } from "../render-settings";
import { createProgram } from "../utils/gl-utils";
import { samRange } from "../utils/nuke-trajectory";
import { DynamicInstanceBuffer } from "../DynamicBuffer";
import type { RenderSettings } from "../RenderSettings";
import { createProgram } from "../utils/GlUtils";
import { samRange } from "../utils/NukeTrajectory";
import fragSrc from "../shaders/sam-radius/sam-radius.frag.glsl?raw";
import vertSrc from "../shaders/sam-radius/sam-radius.vert.glsl?raw";
@@ -6,7 +6,7 @@
* this ever becomes hot we could swap to instanced rendering.
*/
import { createProgram } from "../utils/gl-utils";
import { createProgram } from "../utils/GlUtils";
import fragSrc from "../shaders/selection-box/selection-box.frag.glsl?raw";
import vertSrc from "../shaders/selection-box/selection-box.vert.glsl?raw";
@@ -11,9 +11,9 @@
* effects in tile-space coordinates.
*/
import type { RenderSettings } from "../render-settings";
import { createMapQuad, createProgram, shaderSrc } from "../utils/gl-utils";
import { TILE_DEFINES } from "../utils/tile-codec";
import type { RenderSettings } from "../RenderSettings";
import { createMapQuad, createProgram, shaderSrc } from "../utils/GlUtils";
import { TILE_DEFINES } from "../utils/TileCodec";
import overlayVertSrc from "../shaders/map-overlay/overlay.vert.glsl?raw";
import spawnFragSrc from "../shaders/spawn-overlay/spawn-overlay.frag.glsl?raw";
@@ -17,14 +17,14 @@ import {
UT_PORT,
UT_SAM_LAUNCHER,
} from "../../types";
import { DynamicInstanceBuffer } from "../dynamic-buffer";
import type { RenderSettings } from "../render-settings";
import { createProgram } from "../utils/gl-utils";
import type { GlyphTables } from "./name-pass/atlas-data";
import { buildGlyphTables, parseAtlasData } from "./name-pass/atlas-data";
import { buildGlyphMetricsTex } from "./name-pass/data-textures";
import { layoutString } from "./name-pass/text-layout";
import { CHAR_RANGE, MAX_CHARS } from "./name-pass/types";
import { DynamicInstanceBuffer } from "../DynamicBuffer";
import type { RenderSettings } from "../RenderSettings";
import { createProgram } from "../utils/GlUtils";
import type { GlyphTables } from "./name-pass/AtlasData";
import { buildGlyphTables, parseAtlasData } from "./name-pass/AtlasData";
import { buildGlyphMetricsTex } from "./name-pass/DataTextures";
import { layoutString } from "./name-pass/TextLayout";
import { CHAR_RANGE, MAX_CHARS } from "./name-pass/Types";
import { assetUrl } from "src/core/AssetUrls";
import fragSrc from "../shaders/structure-level/structure-level.frag.glsl?raw";
@@ -23,10 +23,10 @@ import {
UT_PORT,
UT_SAM_LAUNCHER,
} from "../../types";
import { DynamicInstanceBuffer } from "../dynamic-buffer";
import type { RenderSettings } from "../render-settings";
import { getPaletteSize } from "../utils/color-utils";
import { createProgram, shaderSrc } from "../utils/gl-utils";
import { DynamicInstanceBuffer } from "../DynamicBuffer";
import type { RenderSettings } from "../RenderSettings";
import { getPaletteSize } from "../utils/ColorUtils";
import { createProgram, shaderSrc } from "../utils/GlUtils";
import { assetUrl } from "src/core/AssetUrls";
import structureFragSrc from "../shaders/structure/structure.frag.glsl?raw";
@@ -16,7 +16,7 @@ import {
createProgram,
createTexture2D,
shaderSrc,
} from "../utils/gl-utils";
} from "../utils/GlUtils";
// ---------------------------------------------------------------------------
// TerrainPass
@@ -13,10 +13,10 @@
*/
import type { TilePair } from "../../types";
import type { RenderSettings } from "../render-settings";
import { getPaletteSize } from "../utils/color-utils";
import { createMapQuad, createProgram, shaderSrc } from "../utils/gl-utils";
import { OWNER_MASK, TILE_DEFINES } from "../utils/tile-codec";
import type { RenderSettings } from "../RenderSettings";
import { getPaletteSize } from "../utils/ColorUtils";
import { createMapQuad, createProgram, shaderSrc } from "../utils/GlUtils";
import { OWNER_MASK, TILE_DEFINES } from "../utils/TileCodec";
import overlayVertSrc from "../shaders/map-overlay/overlay.vert.glsl?raw";
import territoryFragSrc from "../shaders/map-overlay/territory.frag.glsl?raw";
@@ -6,10 +6,10 @@
* Always draws at full brightness (after night composite).
*/
import type { RenderSettings } from "../render-settings";
import { getPaletteSize } from "../utils/color-utils";
import { createMapQuad, createProgram, shaderSrc } from "../utils/gl-utils";
import { TILE_DEFINES } from "../utils/tile-codec";
import type { RenderSettings } from "../RenderSettings";
import { getPaletteSize } from "../utils/ColorUtils";
import { createMapQuad, createProgram, shaderSrc } from "../utils/GlUtils";
import { TILE_DEFINES } from "../utils/TileCodec";
import overlayVertSrc from "../shaders/map-overlay/overlay.vert.glsl?raw";
import trailFragSrc from "../shaders/map-overlay/trail.frag.glsl?raw";
@@ -47,12 +47,12 @@ import {
UT_TRANSPORT,
UT_WARSHIP,
} from "../../types";
import { DynamicInstanceBuffer } from "../dynamic-buffer";
import type { RenderSettings } from "../render-settings";
import { DynamicInstanceBuffer } from "../DynamicBuffer";
import type { RenderSettings } from "../RenderSettings";
import unitFragSrc from "../shaders/unit/unit.frag.glsl?raw";
import unitVertSrc from "../shaders/unit/unit.vert.glsl?raw";
import { getPaletteSize } from "../utils/color-utils";
import { createProgram, shaderSrc } from "../utils/gl-utils";
import { getPaletteSize } from "../utils/ColorUtils";
import { createProgram, shaderSrc } from "../utils/GlUtils";
const unitAtlasUrl = assetUrl("atlases/unit-atlas.png");
@@ -6,9 +6,9 @@
*/
import type { AttackRingInput } from "../../../types";
import { DynamicInstanceBuffer } from "../../dynamic-buffer";
import type { RenderSettings } from "../../render-settings";
import { createProgram } from "../../utils/gl-utils";
import { DynamicInstanceBuffer } from "../../DynamicBuffer";
import type { RenderSettings } from "../../RenderSettings";
import { createProgram } from "../../utils/GlUtils";
import attackRingFragSrc from "../../shaders/fx/attack-ring.frag.glsl?raw";
import attackRingVertSrc from "../../shaders/fx/attack-ring.vert.glsl?raw";
@@ -5,9 +5,9 @@
* Uses an SDF circle rendered in a unit quad, no texture required.
*/
import { DynamicInstanceBuffer } from "../../dynamic-buffer";
import type { RenderSettings } from "../../render-settings";
import { createProgram } from "../../utils/gl-utils";
import { DynamicInstanceBuffer } from "../../DynamicBuffer";
import type { RenderSettings } from "../../RenderSettings";
import { createProgram } from "../../utils/GlUtils";
import shockwaveFragSrc from "../../shaders/fx/shockwave.frag.glsl?raw";
import shockwaveVertSrc from "../../shaders/fx/shockwave.vert.glsl?raw";
@@ -6,7 +6,7 @@
* Pre-built by generate-sprite-atlases.mjs.
*/
import { MS_PER_TICK, NUKE_EXPLOSION_RADII } from "../../../game-constants";
import { MS_PER_TICK, NUKE_EXPLOSION_RADII } from "../../../GameConstants";
import type { ConquestFx, DeadUnitFx, RendererConfig } from "../../../types";
import {
STRUCTURE_TYPES,
@@ -14,9 +14,9 @@ import {
UT_TRAIN,
UT_WARSHIP,
} from "../../../types";
import { DynamicInstanceBuffer } from "../../dynamic-buffer";
import type { RenderSettings } from "../../render-settings";
import { createProgram, shaderSrc } from "../../utils/gl-utils";
import { DynamicInstanceBuffer } from "../../DynamicBuffer";
import type { RenderSettings } from "../../RenderSettings";
import { createProgram, shaderSrc } from "../../utils/GlUtils";
import fxAtlasMeta from "resources/atlases/fx-atlas-meta.json";
import { assetUrl } from "src/core/AssetUrls";
+5 -5
View File
@@ -8,17 +8,17 @@
* interceptions) are coordinated here so each sub-pass stays self-contained.
*/
import { MS_PER_TICK, NUKE_EXPLOSION_RADII } from "../../../game-constants";
import { MS_PER_TICK, NUKE_EXPLOSION_RADII } from "../../../GameConstants";
import type {
AttackRingInput,
ConquestFx,
DeadUnitFx,
RendererConfig,
} from "../../../types";
import type { RenderSettings } from "../../render-settings";
import { FxAttackRingPass } from "./fx-attack-ring-pass";
import { FxShockwavePass } from "./fx-shockwave-pass";
import { FxSpritePass } from "./fx-sprite-pass";
import type { RenderSettings } from "../../RenderSettings";
import { FxAttackRingPass } from "./FxAttackRingPass";
import { FxShockwavePass } from "./FxShockwavePass";
import { FxSpritePass } from "./FxSpritePass";
export type { AttackRingInput } from "../../../types";
@@ -6,8 +6,8 @@
import emojiAtlasMeta from "resources/atlases/emoji-atlas-meta.json";
import flagAtlasMeta from "resources/atlases/flag-atlas-meta.json";
import atlasData from "resources/atlases/msdf-atlas.json";
import type { BMChar, BMKerning, ParsedAtlas } from "./types";
import { CHAR_RANGE } from "./types";
import type { BMChar, BMKerning, ParsedAtlas } from "./Types";
import { CHAR_RANGE } from "./Types";
// ---------------------------------------------------------------------------
// Atlas parsing
@@ -3,9 +3,9 @@
* Uses createTexture2D from gl-utils to eliminate boilerplate.
*/
import { createTexture2D } from "../../utils/gl-utils";
import type { ParsedAtlas } from "./types";
import { CHAR_RANGE, LINES_PER_PLAYER, MAX_CHARS } from "./types";
import { createTexture2D } from "../../utils/GlUtils";
import type { ParsedAtlas } from "./Types";
import { CHAR_RANGE, LINES_PER_PLAYER, MAX_CHARS } from "./Types";
/** Glyph metrics: CHAR_RANGE x 2, RGBA32F. Static — uploaded once. */
export function buildGlyphMetricsTex(
@@ -6,11 +6,11 @@
*/
import flagAtlasMeta from "resources/atlases/flag-atlas-meta.json";
import type { RenderSettings } from "../../render-settings";
import type { RenderSettings } from "../../RenderSettings";
import debugBoxFragSrc from "../../shaders/name/debug-box.frag.glsl?raw";
import debugBoxVertSrc from "../../shaders/name/debug-box.vert.glsl?raw";
import { createProgram } from "../../utils/gl-utils";
import type { ParsedAtlas } from "./types";
import { createProgram } from "../../utils/GlUtils";
import type { ParsedAtlas } from "./Types";
export class DebugProgram {
private gl: WebGL2RenderingContext;
@@ -8,11 +8,11 @@
import emojiAtlasMeta from "resources/atlases/emoji-atlas-meta.json";
import flagAtlasMeta from "resources/atlases/flag-atlas-meta.json";
import { assetUrl } from "src/core/AssetUrls";
import type { RenderSettings } from "../../render-settings";
import type { RenderSettings } from "../../RenderSettings";
import iconFragSrc from "../../shaders/name/icon.frag.glsl?raw";
import iconVertSrc from "../../shaders/name/icon.vert.glsl?raw";
import { createProgram } from "../../utils/gl-utils";
import type { ParsedAtlas } from "./types";
import { createProgram } from "../../utils/GlUtils";
import type { ParsedAtlas } from "./Types";
const emojiAtlasUrl = assetUrl("atlases/emoji-atlas.png");
const flagAtlasUrl = assetUrl("atlases/flag-atlas.png");
@@ -11,11 +11,11 @@
import statusAtlasMeta from "resources/atlases/status-atlas-meta.json";
import { assetUrl } from "src/core/AssetUrls";
import type { RenderSettings } from "../../render-settings";
import type { RenderSettings } from "../../RenderSettings";
import statusFragSrc from "../../shaders/name/status-icon.frag.glsl?raw";
import statusVertSrc from "../../shaders/name/status-icon.vert.glsl?raw";
import { createProgram } from "../../utils/gl-utils";
import type { ParsedAtlas } from "./types";
import { createProgram } from "../../utils/GlUtils";
import type { ParsedAtlas } from "./Types";
const statusAtlasUrl = assetUrl("atlases/status-atlas.png");
@@ -3,8 +3,8 @@
* No WebGL dependency.
*/
import type { GlyphTables } from "./atlas-data";
import { CHAR_RANGE, MAX_CHARS } from "./types";
import type { GlyphTables } from "./AtlasData";
import { CHAR_RANGE, MAX_CHARS } from "./Types";
export interface LayoutResult {
charCodes: Uint8Array; // char code per slot (MAX_CHARS, zero-padded)
@@ -7,12 +7,12 @@
*/
import { assetUrl } from "src/core/AssetUrls";
import type { RenderSettings } from "../../render-settings";
import type { RenderSettings } from "../../RenderSettings";
import nameFragSrc from "../../shaders/name/name.frag.glsl?raw";
import nameVertSrc from "../../shaders/name/name.vert.glsl?raw";
import { createProgram, shaderSrc } from "../../utils/gl-utils";
import type { ParsedAtlas } from "./types";
import { LINES_PER_PLAYER, MAX_CHARS } from "./types";
import { createProgram, shaderSrc } from "../../utils/GlUtils";
import type { ParsedAtlas } from "./Types";
import { LINES_PER_PLAYER, MAX_CHARS } from "./Types";
const atlasUrl = assetUrl("atlases/msdf-atlas.png");
+12 -12
View File
@@ -24,30 +24,30 @@ import type {
RendererConfig,
} from "../../../types";
import { PlayerTypeEnum } from "../../../types";
import type { RenderSettings } from "../../render-settings";
import { createFullscreenQuad } from "../../utils/gl-utils";
import type { RenderSettings } from "../../RenderSettings";
import { createFullscreenQuad } from "../../utils/GlUtils";
import type { GlyphTables } from "./atlas-data";
import type { GlyphTables } from "./AtlasData";
import {
buildEmojiLookup,
buildFlagLookup,
buildGlyphTables,
buildKernTable,
parseAtlasData,
} from "./atlas-data";
} from "./AtlasData";
import {
buildCursorTex,
buildGlyphMetricsTex,
buildPlayerDataTex,
buildStringTex,
} from "./data-textures";
import { DebugProgram } from "./debug-program";
import { IconProgram } from "./icon-program";
import { StatusIconProgram } from "./status-icon-program";
import { formatTroops, layoutString } from "./text-layout";
import { TextProgram } from "./text-program";
import type { PlayerSlot } from "./types";
import { LINES_PER_PLAYER, MAX_CHARS } from "./types";
} from "./DataTextures";
import { DebugProgram } from "./DebugProgram";
import { IconProgram } from "./IconProgram";
import { StatusIconProgram } from "./StatusIconProgram";
import { formatTroops, layoutString } from "./TextLayout";
import { TextProgram } from "./TextProgram";
import type { PlayerSlot } from "./Types";
import { LINES_PER_PLAYER, MAX_CHARS } from "./Types";
export class NamePass {
private gl: WebGL2RenderingContext;
@@ -8,8 +8,8 @@
* Rebuilt when localPlayerID or relationship data changes.
*/
import { getPaletteSize } from "./color-utils";
import { createTexture2D } from "./gl-utils";
import { getPaletteSize } from "./ColorUtils";
import { createTexture2D } from "./GlUtils";
// Relationship constants (must match adapter.ts)
const RELATION_NEUTRAL = 0;
@@ -5,7 +5,7 @@
* construction-order dependencies between passes.
*/
import { createTexture2D } from "./gl-utils";
import { createTexture2D } from "./GlUtils";
export interface GPUResources {
tileTex: WebGLTexture; // R16UI — tile ownership + flags
@@ -8,14 +8,14 @@
* (fallout light reads heat). Shared heat textures come from GPUResources.
*/
import type { RenderSettings } from "../render-settings";
import type { RenderSettings } from "../RenderSettings";
import {
createFullscreenQuad,
createProgram,
createTexture2D,
shaderSrc,
} from "./gl-utils";
import { FALLOUT_BIT, TILE_DEFINES } from "./tile-codec";
} from "./GlUtils";
import { FALLOUT_BIT, TILE_DEFINES } from "./TileCodec";
import heatDecayFragSrc from "../shaders/fallout-bloom/heat-decay.frag.glsl?raw";
import fullscreenNoUvVertSrc from "../shaders/shared/fullscreen-no-uv.vert.glsl?raw";
@@ -1,4 +1,4 @@
import type { FrameEvents } from "./frame-events";
import type { FrameEvents } from "./FrameEvents";
import type {
AttackRingInput,
NameEntry,
@@ -7,7 +7,7 @@ import type {
PlayerStatusData,
TilePair,
UnitState,
} from "./renderer";
} from "./Renderer";
/**
* FrameData the boundary contract between game integration and features.
@@ -3,7 +3,7 @@ import type {
DeadUnitFx,
PlayerState,
UnitState,
} from "./renderer";
} from "./Renderer";
// ── Supporting event types ──────────────────────────────────────────────
@@ -1,5 +1,5 @@
import type { FrameData } from "./frame-data";
import type { PlayerStatic } from "./renderer";
import type { FrameData } from "./FrameData";
import type { PlayerStatic } from "./Renderer";
/**
* Static per-session metadata. Set once at game-start, never changes.
@@ -7,7 +7,7 @@ import type {
RendererConfig,
TilePair,
UnitState,
} from "./renderer";
} from "./Renderer";
/** Chunk index entry — one per chunk in the file */
export interface ChunkIndexEntry {
+11 -11
View File
@@ -1,5 +1,5 @@
// Renderer types (units, players, tiles, names, config)
export { PlayerTypeEnum, TrainType } from "./renderer";
export { PlayerTypeEnum, TrainType } from "./Renderer";
export type {
AllianceData,
AttackData,
@@ -17,13 +17,13 @@ export type {
RendererConfig,
TilePair,
UnitState,
} from "./renderer";
} from "./Renderer";
// Frame data — boundary contract between game integration and features
export type { FrameData } from "./frame-data";
export type { FrameData } from "./FrameData";
// Frame events — per-frame ephemeral events (rendering FX + stats events)
export { EMPTY_FRAME_EVENTS } from "./frame-events";
export { EMPTY_FRAME_EVENTS } from "./FrameEvents";
export type {
AllianceBrokenEvent,
AllianceExpiredEvent,
@@ -36,13 +36,13 @@ export type {
NukeIncomingEvent,
TargetEvent,
WinEvent,
} from "./frame-events";
} from "./FrameEvents";
// Frame source — mode-agnostic subscription interface
export type { FrameSource, GameStartConfig } from "./frame-source";
export type { FrameSource, GameStartConfig } from "./FrameSource";
// Game update types
export type { GameStartInfo, GameUpdateViewData } from "./game";
export type { GameStartInfo, GameUpdateViewData } from "./Game";
// Replay types (header, frames, codec helpers)
export type {
@@ -58,10 +58,10 @@ export type {
ReplayHeader,
StreamableReplayInfo,
TrainPlanRecord,
} from "./replay";
} from "./Replay";
// Game update type constants and event payloads (shared between shim + codec)
export { GameUpdateType, MessageType } from "./game-updates";
export { GameUpdateType, MessageType } from "./GameUpdates";
export type {
AllianceExpiredUpdate,
AllianceReplyUpdate,
@@ -81,7 +81,7 @@ export type {
UnitEventUpdate,
UnitIncomingUpdate,
WinUpdate,
} from "./game-updates";
} from "./GameUpdates";
// Unit type string constants and derived sets
export {
@@ -105,4 +105,4 @@ export {
UT_TRAIN,
UT_TRANSPORT,
UT_WARSHIP,
} from "./unit-type";
} from "./UnitType";
+7 -7
View File
@@ -26,13 +26,13 @@ import { UnitGrid, UnitPredicate } from "../../core/game/UnitGrid";
import { ClientID, GameID, Player, PlayerCosmetics } from "../../core/Schemas";
import { formatPlayerDisplayName } from "../../core/Util";
import { WorkerClient } from "../../core/worker/WorkerClient";
import { computeAllianceClusters } from "../render/frame/derive/alliance-clusters";
import { extractAttackRings } from "../render/frame/derive/attack-rings";
import { extractNukeTelegraphs } from "../render/frame/derive/nuke-telegraphs";
import { computePlayerStatus } from "../render/frame/derive/player-status";
import { buildRelationMatrix } from "../render/frame/derive/relation-matrix";
import { RailroadCache } from "../render/frame/railroad-cache";
import { TrailManager } from "../render/frame/trail-manager";
import { computeAllianceClusters } from "../render/frame/derive/AllianceClusters";
import { extractAttackRings } from "../render/frame/derive/AttackRings";
import { extractNukeTelegraphs } from "../render/frame/derive/NukeTelegraphs";
import { computePlayerStatus } from "../render/frame/derive/PlayerStatus";
import { buildRelationMatrix } from "../render/frame/derive/RelationMatrix";
import { RailroadCache } from "../render/frame/RailroadCache";
import { TrailManager } from "../render/frame/TrailManager";
import type { FrameData, NameEntry, TilePair } from "../render/types";
import { STRUCTURE_TYPES } from "../render/types";
import { PlayerView } from "./PlayerView";
@@ -12,7 +12,7 @@
*/
import { describe, expect, it } from "vitest";
import { computePlayerStatus } from "../../../../../src/client/render/frame/derive/player-status";
import { computePlayerStatus } from "../../../../../src/client/render/frame/derive/PlayerStatus";
import type {
PlayerState,
UnitState,