@codexo/exojs-tilemap 0.19.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/README.md +7 -163
  2. package/index.d.ts +1 -0
  3. package/index.js +1 -0
  4. package/package.json +12 -20
  5. package/dist/esm/ChunkSource.d.ts +0 -33
  6. package/dist/esm/ChunkSource.d.ts.map +0 -1
  7. package/dist/esm/ChunkStreamer.d.ts +0 -104
  8. package/dist/esm/ChunkStreamer.d.ts.map +0 -1
  9. package/dist/esm/ChunkStreamer.js +0 -229
  10. package/dist/esm/ChunkStreamer.js.map +0 -1
  11. package/dist/esm/ImageLayer.d.ts +0 -89
  12. package/dist/esm/ImageLayer.d.ts.map +0 -1
  13. package/dist/esm/ImageLayer.js +0 -74
  14. package/dist/esm/ImageLayer.js.map +0 -1
  15. package/dist/esm/ImageLayerNode.d.ts +0 -91
  16. package/dist/esm/ImageLayerNode.d.ts.map +0 -1
  17. package/dist/esm/ImageLayerNode.js +0 -210
  18. package/dist/esm/ImageLayerNode.js.map +0 -1
  19. package/dist/esm/MapObject.d.ts +0 -70
  20. package/dist/esm/MapObject.d.ts.map +0 -1
  21. package/dist/esm/MapObject.js +0 -34
  22. package/dist/esm/MapObject.js.map +0 -1
  23. package/dist/esm/MapObjectSpawner.d.ts +0 -133
  24. package/dist/esm/MapObjectSpawner.d.ts.map +0 -1
  25. package/dist/esm/MapObjectSpawner.js +0 -147
  26. package/dist/esm/MapObjectSpawner.js.map +0 -1
  27. package/dist/esm/MapSpawnSession.d.ts +0 -46
  28. package/dist/esm/MapSpawnSession.d.ts.map +0 -1
  29. package/dist/esm/MapSpawnSession.js +0 -88
  30. package/dist/esm/MapSpawnSession.js.map +0 -1
  31. package/dist/esm/MapWorld.d.ts +0 -134
  32. package/dist/esm/MapWorld.d.ts.map +0 -1
  33. package/dist/esm/MapWorld.js +0 -150
  34. package/dist/esm/MapWorld.js.map +0 -1
  35. package/dist/esm/MapWorldRuntime.d.ts +0 -180
  36. package/dist/esm/MapWorldRuntime.d.ts.map +0 -1
  37. package/dist/esm/MapWorldRuntime.js +0 -261
  38. package/dist/esm/MapWorldRuntime.js.map +0 -1
  39. package/dist/esm/ObjectLayer.d.ts +0 -379
  40. package/dist/esm/ObjectLayer.d.ts.map +0 -1
  41. package/dist/esm/ObjectLayer.js +0 -221
  42. package/dist/esm/ObjectLayer.js.map +0 -1
  43. package/dist/esm/SampledChunkSource.d.ts +0 -43
  44. package/dist/esm/SampledChunkSource.d.ts.map +0 -1
  45. package/dist/esm/SampledChunkSource.js +0 -48
  46. package/dist/esm/SampledChunkSource.js.map +0 -1
  47. package/dist/esm/TileAnimator.d.ts +0 -72
  48. package/dist/esm/TileAnimator.d.ts.map +0 -1
  49. package/dist/esm/TileAnimator.js +0 -158
  50. package/dist/esm/TileAnimator.js.map +0 -1
  51. package/dist/esm/TileChunk.d.ts +0 -103
  52. package/dist/esm/TileChunk.d.ts.map +0 -1
  53. package/dist/esm/TileChunk.js +0 -194
  54. package/dist/esm/TileChunk.js.map +0 -1
  55. package/dist/esm/TileChunkNode.d.ts +0 -2
  56. package/dist/esm/TileChunkNode.d.ts.map +0 -1
  57. package/dist/esm/TileChunkNode.js +0 -145
  58. package/dist/esm/TileChunkNode.js.map +0 -1
  59. package/dist/esm/TileLayer.d.ts +0 -286
  60. package/dist/esm/TileLayer.d.ts.map +0 -1
  61. package/dist/esm/TileLayer.js +0 -526
  62. package/dist/esm/TileLayer.js.map +0 -1
  63. package/dist/esm/TileLayerNode.d.ts +0 -129
  64. package/dist/esm/TileLayerNode.d.ts.map +0 -1
  65. package/dist/esm/TileLayerNode.js +0 -245
  66. package/dist/esm/TileLayerNode.js.map +0 -1
  67. package/dist/esm/TileMap.d.ts +0 -317
  68. package/dist/esm/TileMap.d.ts.map +0 -1
  69. package/dist/esm/TileMap.js +0 -406
  70. package/dist/esm/TileMap.js.map +0 -1
  71. package/dist/esm/TileMapBand.d.ts +0 -80
  72. package/dist/esm/TileMapBand.d.ts.map +0 -1
  73. package/dist/esm/TileMapBand.js +0 -155
  74. package/dist/esm/TileMapBand.js.map +0 -1
  75. package/dist/esm/TileMapNode.d.ts +0 -92
  76. package/dist/esm/TileMapNode.d.ts.map +0 -1
  77. package/dist/esm/TileMapNode.js +0 -134
  78. package/dist/esm/TileMapNode.js.map +0 -1
  79. package/dist/esm/TileMapView.d.ts +0 -248
  80. package/dist/esm/TileMapView.d.ts.map +0 -1
  81. package/dist/esm/TileMapView.js +0 -394
  82. package/dist/esm/TileMapView.js.map +0 -1
  83. package/dist/esm/TileProjection.d.ts +0 -59
  84. package/dist/esm/TileProjection.d.ts.map +0 -1
  85. package/dist/esm/TileProjection.js +0 -106
  86. package/dist/esm/TileProjection.js.map +0 -1
  87. package/dist/esm/TileSet.d.ts +0 -116
  88. package/dist/esm/TileSet.d.ts.map +0 -1
  89. package/dist/esm/TileSet.js +0 -168
  90. package/dist/esm/TileSet.js.map +0 -1
  91. package/dist/esm/WangSet.d.ts +0 -80
  92. package/dist/esm/WangSet.d.ts.map +0 -1
  93. package/dist/esm/WangSet.js +0 -73
  94. package/dist/esm/WangSet.js.map +0 -1
  95. package/dist/esm/WorkerSampledChunkSource.d.ts +0 -94
  96. package/dist/esm/WorkerSampledChunkSource.d.ts.map +0 -1
  97. package/dist/esm/WorkerSampledChunkSource.js +0 -113
  98. package/dist/esm/WorkerSampledChunkSource.js.map +0 -1
  99. package/dist/esm/autoTile.d.ts +0 -88
  100. package/dist/esm/autoTile.d.ts.map +0 -1
  101. package/dist/esm/autoTile.js +0 -173
  102. package/dist/esm/autoTile.js.map +0 -1
  103. package/dist/esm/chunkGeometry.d.ts +0 -2
  104. package/dist/esm/chunkGeometry.d.ts.map +0 -1
  105. package/dist/esm/chunkGeometry.js +0 -116
  106. package/dist/esm/chunkGeometry.js.map +0 -1
  107. package/dist/esm/index.d.ts +0 -2
  108. package/dist/esm/index.d.ts.map +0 -1
  109. package/dist/esm/index.js +0 -27
  110. package/dist/esm/nodeBounds.d.ts +0 -2
  111. package/dist/esm/nodeBounds.d.ts.map +0 -1
  112. package/dist/esm/nodeBounds.js +0 -40
  113. package/dist/esm/nodeBounds.js.map +0 -1
  114. package/dist/esm/pixelSnap.d.ts +0 -2
  115. package/dist/esm/pixelSnap.d.ts.map +0 -1
  116. package/dist/esm/pixelSnap.js +0 -21
  117. package/dist/esm/pixelSnap.js.map +0 -1
  118. package/dist/esm/projectObject.d.ts +0 -4
  119. package/dist/esm/projectObject.d.ts.map +0 -1
  120. package/dist/esm/projectObject.js +0 -87
  121. package/dist/esm/projectObject.js.map +0 -1
  122. package/dist/esm/public.d.ts +0 -48
  123. package/dist/esm/public.d.ts.map +0 -1
  124. package/dist/esm/tileCollision.d.ts +0 -190
  125. package/dist/esm/tileCollision.d.ts.map +0 -1
  126. package/dist/esm/tileCollision.js +0 -399
  127. package/dist/esm/tileCollision.js.map +0 -1
  128. package/dist/esm/tileWord.d.ts +0 -2
  129. package/dist/esm/tileWord.d.ts.map +0 -1
  130. package/dist/esm/tileWord.js +0 -16
  131. package/dist/esm/tileWord.js.map +0 -1
  132. package/dist/esm/tilemapExtension.d.ts +0 -20
  133. package/dist/esm/tilemapExtension.d.ts.map +0 -1
  134. package/dist/esm/tilemapExtension.js +0 -53
  135. package/dist/esm/tilemapExtension.js.map +0 -1
  136. package/dist/esm/tilemapSerializers.d.ts +0 -2
  137. package/dist/esm/tilemapSerializers.d.ts.map +0 -1
  138. package/dist/esm/tilemapSerializers.js +0 -54
  139. package/dist/esm/tilemapSerializers.js.map +0 -1
  140. package/dist/esm/types.d.ts +0 -231
  141. package/dist/esm/types.d.ts.map +0 -1
  142. package/dist/esm/types.js +0 -129
  143. package/dist/esm/types.js.map +0 -1
  144. package/dist/esm/webgl2/WebGl2TileChunkRenderer.d.ts +0 -2
  145. package/dist/esm/webgl2/WebGl2TileChunkRenderer.d.ts.map +0 -1
  146. package/dist/esm/webgl2/WebGl2TileChunkRenderer.js +0 -376
  147. package/dist/esm/webgl2/WebGl2TileChunkRenderer.js.map +0 -1
  148. package/dist/esm/webgl2/shaders/tile-chunk.frag.js +0 -6
  149. package/dist/esm/webgl2/shaders/tile-chunk.frag.js.map +0 -1
  150. package/dist/esm/webgl2/shaders/tile-chunk.vert.js +0 -6
  151. package/dist/esm/webgl2/shaders/tile-chunk.vert.js.map +0 -1
  152. package/dist/esm/webgpu/WebGpuTileChunkRenderer.d.ts +0 -2
  153. package/dist/esm/webgpu/WebGpuTileChunkRenderer.d.ts.map +0 -1
  154. package/dist/esm/webgpu/WebGpuTileChunkRenderer.js +0 -539
  155. package/dist/esm/webgpu/WebGpuTileChunkRenderer.js.map +0 -1
  156. package/dist/esm/webgpu/shaders/tile-chunk.wgsl.js +0 -6
  157. package/dist/esm/webgpu/shaders/tile-chunk.wgsl.js.map +0 -1
@@ -1,129 +0,0 @@
1
- import type { ReadonlyRectangle } from '@codexo/exojs';
2
- import { Container } from '@codexo/exojs';
3
- import { PixelSnapMode } from '@codexo/exojs/renderer-sdk';
4
- import type { TileLayer } from './TileLayer';
5
- /**
6
- * Options for a {@link TileLayerNode}. All optional; reserved for forward
7
- * compatibility.
8
- * @advanced
9
- */
10
- export interface TileLayerNodeOptions {
11
- /**
12
- * Whether the layer's chunk nodes participate in per-chunk view culling.
13
- * Defaults to `true`. Disable only for tiny, always-on-screen layers where
14
- * the per-chunk bounds test is pure overhead.
15
- */
16
- readonly cullable?: boolean;
17
- }
18
- /**
19
- * A scene node that renders one generic {@link TileLayer} as a
20
- * {@link Container} of per-chunk {@link TileChunkNode} drawables.
21
- *
22
- * Orthogonal chunks become one child each. Isometric chunks become diagonal
23
- * slices ordered across storage boundaries, preserving painter order and
24
- * texture runs. Each drawable has its own culling bounds. The layer's pixel
25
- * `offset`, `visible` and `opacity` are all read live from the runtime layer on
26
- * every frame (no rebuild required).
27
- *
28
- * A `parallax` factor other than `1` makes this node's rendered position
29
- * camera-dependent, resolved per frame in {@link _collectContent} by patching
30
- * the node position against the camera centre, then restoring it - the cull
31
- * test runs before that patch, so a bounded layer with parallax would be
32
- * culled at its static base-offset bounds while actually rendering elsewhere.
33
- * Such a layer therefore opts out of view culling (`cullable = false`), same
34
- * as an unbounded layer (exactly like {@link import('./ImageLayerNode').ImageLayerNode}).
35
- *
36
- * The node references - but never owns - the {@link TileLayer}: destroying it
37
- * frees its chunk nodes and their cached geometry but leaves the layer, map,
38
- * and Loader-owned textures intact.
39
- *
40
- * Structural changes made via `_adoptChunk`/`_evictChunk` (chunk streaming)
41
- * are picked up incrementally as they happen, without a full rebuild.
42
- * {@link TileLayerNode.refresh} remains available for callers that mutate
43
- * chunk structure by other means (e.g. a bulk edit that bypasses
44
- * `_adoptChunk`/`_evictChunk`) and need a full resync. In-place tile edits to
45
- * existing chunks are picked up automatically via chunk revisions.
46
- *
47
- * @advanced
48
- */
49
- export declare class TileLayerNode extends Container {
50
- private readonly _layer;
51
- private readonly _cullChunks;
52
- private readonly _chunkNodes;
53
- private _syncedOpacity;
54
- private _syncedTint;
55
- private _pixelSnapMode;
56
- /**
57
- * Bound once so `TileLayer._addStructuralListener`/`_removeStructuralListener`
58
- * add and remove the SAME function reference. Incrementally adds/removes
59
- * the `TileChunkNode` child for exactly the chunk that changed - never
60
- * triggers a full {@link refresh}, so every other chunk node's
61
- * revision-cached geometry survives untouched.
62
- */
63
- private readonly _onStructuralChange;
64
- constructor(layer: TileLayer, options?: TileLayerNodeOptions);
65
- /** The runtime layer this node renders. */
66
- get layer(): TileLayer;
67
- /**
68
- * Render-only pixel-snap mode applied to every chunk node in this layer (and
69
- * to chunks rebuilt later by {@link refresh}). Each chunk's rendered origin is
70
- * snapped to the active render target's device-pixel grid; because chunk
71
- * origins are integer multiples of the integer tile pitch from the same layer
72
- * origin, the whole grid stays exact and adjacent chunks cannot drift apart.
73
- *
74
- * Purely visual: tile data, the layer offset, chunk content revisions, and
75
- * culling bounds are never changed. `PixelSnapMode.Geometry` and `PixelSnapMode.Position` both resolve
76
- * to coherent origin snapping for tile chunks (chunk quads are already on the
77
- * integer pixel grid by construction). Setting the current value is a no-op;
78
- * an invalid value throws and leaves the prior mode unchanged.
79
- *
80
- * Defaults to `Geometry` because a tile grid is made of quads that share
81
- * their edges: left unsnapped, a boundary landing between two device pixels
82
- * is sampled across both, so the seams blur and shimmer as the view moves.
83
- * Set `None` to opt out.
84
- *
85
- * @default PixelSnapMode.Geometry
86
- * @stable
87
- */
88
- get pixelSnapMode(): PixelSnapMode;
89
- set pixelSnapMode(mode: PixelSnapMode);
90
- /**
91
- * Rebuild the chunk-node children from the layer's current loaded chunks.
92
- * Call after structural mutation that creates or empties chunks. In-place
93
- * tile edits to existing chunks do not need a refresh.
94
- */
95
- refresh(): this;
96
- /**
97
- * Recomputed lazily on read, so it writes `_localBounds` directly rather than
98
- * going through `setLocalBounds`: an invalidating write inside a getter
99
- * would re-dirty the node on every read.
100
- */
101
- getLocalBounds(): ReadonlyRectangle;
102
- destroy(): void;
103
- private _buildChunkNodes;
104
- /**
105
- * Construct the configured draw nodes for `chunk` - shared by
106
- * the initial bulk build ({@link _buildChunkNodes}) and the incremental
107
- * structural-listener handler, so a future constructor argument or
108
- * per-node setting only needs to be added in one place.
109
- */
110
- private _addChunkNodes;
111
- private _sortChunks;
112
- private _createChunkNode;
113
- /**
114
- * Compute and apply this layer's live tint (opacity as alpha, `tintColor`
115
- * as RGB multiply) to a single chunk node. Used both by {@link _syncTint}'s
116
- * bulk pass and by the structural-listener handler for a freshly-added
117
- * node - a node added between two "nothing changed" full syncs must still
118
- * receive the current tint, which a change-detection-guarded bulk pass
119
- * alone would skip.
120
- */
121
- private _applyTint;
122
- /**
123
- * Propagate the layer's live opacity and tint colour onto every chunk
124
- * render tint if either changed since the last call. Opacity drives the
125
- * tint alpha; `tintColor` (`0xRRGGBB`) multiplies the RGB (white = no tint).
126
- */
127
- private _syncTint;
128
- }
129
- //# sourceMappingURL=TileLayerNode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"T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AC,gBAAgB;IAYxB;;;;;;;OAOG;IACH,OAAO,CAAC,UAAU;IAQlB;;;;OAIG;IACH,OAAO,CAAC,SAAS;CAelB"}
@@ -1,245 +0,0 @@
1
- import { TileChunkNode } from "./TileChunkNode.js";
2
- import { assertPixelSnapMode } from "./pixelSnap.js";
3
- import { aggregateChildLocalBounds } from "./nodeBounds.js";
4
- import { PixelSnapMode } from "@codexo/exojs/renderer-sdk";
5
- import { Container } from "@codexo/exojs";
6
-
7
- //#region src/TileLayerNode.ts
8
- /**
9
- * A scene node that renders one generic {@link TileLayer} as a
10
- * {@link Container} of per-chunk {@link TileChunkNode} drawables.
11
- *
12
- * Orthogonal chunks become one child each. Isometric chunks become diagonal
13
- * slices ordered across storage boundaries, preserving painter order and
14
- * texture runs. Each drawable has its own culling bounds. The layer's pixel
15
- * `offset`, `visible` and `opacity` are all read live from the runtime layer on
16
- * every frame (no rebuild required).
17
- *
18
- * A `parallax` factor other than `1` makes this node's rendered position
19
- * camera-dependent, resolved per frame in {@link _collectContent} by patching
20
- * the node position against the camera centre, then restoring it - the cull
21
- * test runs before that patch, so a bounded layer with parallax would be
22
- * culled at its static base-offset bounds while actually rendering elsewhere.
23
- * Such a layer therefore opts out of view culling (`cullable = false`), same
24
- * as an unbounded layer (exactly like {@link import('./ImageLayerNode').ImageLayerNode}).
25
- *
26
- * The node references - but never owns - the {@link TileLayer}: destroying it
27
- * frees its chunk nodes and their cached geometry but leaves the layer, map,
28
- * and Loader-owned textures intact.
29
- *
30
- * Structural changes made via `_adoptChunk`/`_evictChunk` (chunk streaming)
31
- * are picked up incrementally as they happen, without a full rebuild.
32
- * {@link TileLayerNode.refresh} remains available for callers that mutate
33
- * chunk structure by other means (e.g. a bulk edit that bypasses
34
- * `_adoptChunk`/`_evictChunk`) and need a full resync. In-place tile edits to
35
- * existing chunks are picked up automatically via chunk revisions.
36
- *
37
- * @advanced
38
- */
39
- var TileLayerNode = class extends Container {
40
- _layer;
41
- _cullChunks;
42
- _chunkNodes = [];
43
- _syncedOpacity = -1;
44
- _syncedTint = void 0;
45
- _pixelSnapMode = PixelSnapMode.Geometry;
46
- /**
47
- * Bound once so `TileLayer._addStructuralListener`/`_removeStructuralListener`
48
- * add and remove the SAME function reference. Incrementally adds/removes
49
- * the `TileChunkNode` child for exactly the chunk that changed - never
50
- * triggers a full {@link refresh}, so every other chunk node's
51
- * revision-cached geometry survives untouched.
52
- */
53
- _onStructuralChange = (event) => {
54
- for (let i = this._chunkNodes.length - 1; i >= 0; i--) {
55
- const node = this._chunkNodes[i];
56
- if (!node) continue;
57
- if (node.chunkX !== event.cx || node.chunkY !== event.cy) continue;
58
- this._chunkNodes.splice(i, 1);
59
- this.removeChild(node);
60
- node.destroy();
61
- }
62
- if (event.chunk !== null && !event.chunk.empty) this._addChunkNodes(event.chunk);
63
- this._sortChunks();
64
- };
65
- constructor(layer, options) {
66
- super();
67
- this._layer = layer;
68
- this._cullChunks = options?.cullable ?? true;
69
- this.setPosition(layer.offsetX, layer.offsetY);
70
- this._buildChunkNodes();
71
- if (!this._layer.bounded || layer.parallaxX !== 1 || layer.parallaxY !== 1 || layer.parallaxScale !== 1) this.cullable = false;
72
- this._layer._addStructuralListener(this._onStructuralChange);
73
- }
74
- /** The runtime layer this node renders. */
75
- get layer() {
76
- return this._layer;
77
- }
78
- /**
79
- * Render-only pixel-snap mode applied to every chunk node in this layer (and
80
- * to chunks rebuilt later by {@link refresh}). Each chunk's rendered origin is
81
- * snapped to the active render target's device-pixel grid; because chunk
82
- * origins are integer multiples of the integer tile pitch from the same layer
83
- * origin, the whole grid stays exact and adjacent chunks cannot drift apart.
84
- *
85
- * Purely visual: tile data, the layer offset, chunk content revisions, and
86
- * culling bounds are never changed. `PixelSnapMode.Geometry` and `PixelSnapMode.Position` both resolve
87
- * to coherent origin snapping for tile chunks (chunk quads are already on the
88
- * integer pixel grid by construction). Setting the current value is a no-op;
89
- * an invalid value throws and leaves the prior mode unchanged.
90
- *
91
- * Defaults to `Geometry` because a tile grid is made of quads that share
92
- * their edges: left unsnapped, a boundary landing between two device pixels
93
- * is sampled across both, so the seams blur and shimmer as the view moves.
94
- * Set `None` to opt out.
95
- *
96
- * @default PixelSnapMode.Geometry
97
- * @stable
98
- */
99
- get pixelSnapMode() {
100
- return this._pixelSnapMode;
101
- }
102
- set pixelSnapMode(mode) {
103
- if (mode === this._pixelSnapMode) return;
104
- assertPixelSnapMode(mode);
105
- this._pixelSnapMode = mode;
106
- for (const chunk of this._chunkNodes) chunk.pixelSnapMode = mode;
107
- }
108
- /**
109
- * Rebuild the chunk-node children from the layer's current loaded chunks.
110
- * Call after structural mutation that creates or empties chunks. In-place
111
- * tile edits to existing chunks do not need a refresh.
112
- */
113
- refresh() {
114
- const previous = [...this._chunkNodes];
115
- this.removeChildren();
116
- this._chunkNodes.length = 0;
117
- for (const child of previous) child.destroy();
118
- this._syncedOpacity = -1;
119
- this._syncedTint = void 0;
120
- this._buildChunkNodes();
121
- return this;
122
- }
123
- /** The chunk render nodes owned by this layer node, in build order. @internal */
124
- get chunkNodes() {
125
- return this._chunkNodes;
126
- }
127
- /**
128
- * Recomputed lazily on read, so it writes `_localBounds` directly rather than
129
- * going through `setLocalBounds`: an invalidating write inside a getter
130
- * would re-dirty the node on every read.
131
- */
132
- getLocalBounds() {
133
- const bounds = this._localBounds;
134
- const { pixelHeight, pixelWidth } = this._layer;
135
- if (this._layer.projection.orientation === "isometric") {
136
- bounds.set(0, 0, 0, 0);
137
- aggregateChildLocalBounds(this._chunkNodes, bounds);
138
- } else if (pixelWidth !== void 0 && pixelHeight !== void 0) bounds.set(this._layer.projection.originX, this._layer.projection.originY, pixelWidth, pixelHeight);
139
- else if (this._chunkNodes.length > 0) aggregateChildLocalBounds(this._chunkNodes, bounds);
140
- return bounds;
141
- }
142
- /** @internal */
143
- _collectContent(builder) {
144
- if (!this._layer.visible) return;
145
- this._syncTint();
146
- const layer = this._layer;
147
- const patchesPosition = layer.parallaxX !== 1 || layer.parallaxY !== 1;
148
- const patchesScale = layer.parallaxScale !== 1;
149
- if (patchesPosition || patchesScale) {
150
- const camCenter = builder.view.center;
151
- const prevScaleX = this.scale.x;
152
- const prevScaleY = this.scale.y;
153
- if (patchesPosition) {
154
- this.x = layer.offsetX + camCenter.x * (1 - layer.parallaxX);
155
- this.y = layer.offsetY + camCenter.y * (1 - layer.parallaxY);
156
- } else this.setPosition(layer.offsetX, layer.offsetY);
157
- if (patchesScale) this.setScale(prevScaleX * layer.parallaxScale, prevScaleY * layer.parallaxScale);
158
- try {
159
- super._collectContent(builder);
160
- } finally {
161
- if (patchesPosition) this.setPosition(layer.offsetX, layer.offsetY);
162
- if (patchesScale) this.setScale(prevScaleX, prevScaleY);
163
- }
164
- } else {
165
- this.setPosition(layer.offsetX, layer.offsetY);
166
- super._collectContent(builder);
167
- }
168
- }
169
- destroy() {
170
- this._layer._removeStructuralListener(this._onStructuralChange);
171
- const children = [...this._chunkNodes];
172
- this._chunkNodes.length = 0;
173
- super.destroy();
174
- for (const child of children) child.destroy();
175
- }
176
- _buildChunkNodes() {
177
- const layer = this._layer;
178
- for (const chunk of layer.loadedChunks()) {
179
- if (chunk.empty) continue;
180
- this._addChunkNodes(chunk);
181
- }
182
- this._sortChunks();
183
- this._syncTint();
184
- }
185
- /**
186
- * Construct the configured draw nodes for `chunk` - shared by
187
- * the initial bulk build ({@link _buildChunkNodes}) and the incremental
188
- * structural-listener handler, so a future constructor argument or
189
- * per-node setting only needs to be added in one place.
190
- */
191
- _addChunkNodes(chunk) {
192
- const iso = this._layer.projection.orientation === "isometric";
193
- const count = iso ? chunk.width + chunk.height - 1 : 1;
194
- for (let i = 0; i < count; i++) {
195
- const node = this._createChunkNode(chunk, iso ? i : void 0);
196
- this._chunkNodes.push(node);
197
- this.addChild(node);
198
- this._applyTint(node);
199
- }
200
- }
201
- _sortChunks() {
202
- if (this._layer.projection.orientation !== "isometric") return;
203
- this._chunkNodes.sort((a, b) => a.depth - b.depth || a.firstColumn - b.firstColumn);
204
- for (const [index, node] of this._chunkNodes.entries()) this.setChildIndex(node, index);
205
- }
206
- _createChunkNode(chunk, diagonal) {
207
- const layer = this._layer;
208
- const node = new TileChunkNode(chunk, layer.tilesets, layer.tileWidth, layer.tileHeight, layer.chunkWidth, layer.chunkHeight, layer.projection, diagonal);
209
- node.cullable = this._cullChunks;
210
- node.pixelSnapMode = this._pixelSnapMode;
211
- return node;
212
- }
213
- /**
214
- * Compute and apply this layer's live tint (opacity as alpha, `tintColor`
215
- * as RGB multiply) to a single chunk node. Used both by {@link _syncTint}'s
216
- * bulk pass and by the structural-listener handler for a freshly-added
217
- * node - a node added between two "nothing changed" full syncs must still
218
- * receive the current tint, which a change-detection-guarded bulk pass
219
- * alone would skip.
220
- */
221
- _applyTint(node) {
222
- const tintColor = this._layer.tintColor;
223
- const r = tintColor === null ? 255 : tintColor >> 16 & 255;
224
- const g = tintColor === null ? 255 : tintColor >> 8 & 255;
225
- const b = tintColor === null ? 255 : tintColor & 255;
226
- node.tint.set(r, g, b, this._layer.opacity);
227
- }
228
- /**
229
- * Propagate the layer's live opacity and tint colour onto every chunk
230
- * render tint if either changed since the last call. Opacity drives the
231
- * tint alpha; `tintColor` (`0xRRGGBB`) multiplies the RGB (white = no tint).
232
- */
233
- _syncTint() {
234
- const opacity = this._layer.opacity;
235
- const tintColor = this._layer.tintColor;
236
- if (opacity === this._syncedOpacity && tintColor === this._syncedTint) return;
237
- for (const child of this._chunkNodes) this._applyTint(child);
238
- this._syncedOpacity = opacity;
239
- this._syncedTint = tintColor;
240
- }
241
- };
242
-
243
- //#endregion
244
- export { TileLayerNode };
245
- //# sourceMappingURL=TileLayerNode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TileLayerNode.js","names":[],"sources":["../../src/TileLayerNode.ts"],"sourcesContent":["import type { ReadonlyRectangle } from '@codexo/exojs';\nimport { Container } from '@codexo/exojs';\nimport { PixelSnapMode, type RenderPlanBuilder } from '@codexo/exojs/renderer-sdk';\n\nimport { aggregateChildLocalBounds } from './nodeBounds';\nimport { assertPixelSnapMode } from './pixelSnap';\nimport type { ReadonlyTileChunk } from './TileChunk';\nimport { TileChunkNode } from './TileChunkNode';\nimport type { ChunkStructuralEvent, TileLayer } from './TileLayer';\n\n/**\n * Options for a {@link TileLayerNode}. All optional; reserved for forward\n * compatibility.\n * @advanced\n */\nexport interface TileLayerNodeOptions {\n /**\n * Whether the layer's chunk nodes participate in per-chunk view culling.\n * Defaults to `true`. Disable only for tiny, always-on-screen layers where\n * the per-chunk bounds test is pure overhead.\n */\n readonly cullable?: boolean;\n}\n\n/**\n * A scene node that renders one generic {@link TileLayer} as a\n * {@link Container} of per-chunk {@link TileChunkNode} drawables.\n *\n * Orthogonal chunks become one child each. Isometric chunks become diagonal\n * slices ordered across storage boundaries, preserving painter order and\n * texture runs. Each drawable has its own culling bounds. The layer's pixel\n * `offset`, `visible` and `opacity` are all read live from the runtime layer on\n * every frame (no rebuild required).\n *\n * A `parallax` factor other than `1` makes this node's rendered position\n * camera-dependent, resolved per frame in {@link _collectContent} by patching\n * the node position against the camera centre, then restoring it - the cull\n * test runs before that patch, so a bounded layer with parallax would be\n * culled at its static base-offset bounds while actually rendering elsewhere.\n * Such a layer therefore opts out of view culling (`cullable = false`), same\n * as an unbounded layer (exactly like {@link import('./ImageLayerNode').ImageLayerNode}).\n *\n * The node references - but never owns - the {@link TileLayer}: destroying it\n * frees its chunk nodes and their cached geometry but leaves the layer, map,\n * and Loader-owned textures intact.\n *\n * Structural changes made via `_adoptChunk`/`_evictChunk` (chunk streaming)\n * are picked up incrementally as they happen, without a full rebuild.\n * {@link TileLayerNode.refresh} remains available for callers that mutate\n * chunk structure by other means (e.g. a bulk edit that bypasses\n * `_adoptChunk`/`_evictChunk`) and need a full resync. In-place tile edits to\n * existing chunks are picked up automatically via chunk revisions.\n *\n * @advanced\n */\nexport class TileLayerNode extends Container {\n private readonly _layer: TileLayer;\n private readonly _cullChunks: boolean;\n private readonly _chunkNodes: TileChunkNode[] = [];\n private _syncedOpacity = -1;\n private _syncedTint: number | null | undefined = undefined;\n private _pixelSnapMode: PixelSnapMode = PixelSnapMode.Geometry;\n\n /**\n * Bound once so `TileLayer._addStructuralListener`/`_removeStructuralListener`\n * add and remove the SAME function reference. Incrementally adds/removes\n * the `TileChunkNode` child for exactly the chunk that changed - never\n * triggers a full {@link refresh}, so every other chunk node's\n * revision-cached geometry survives untouched.\n */\n private readonly _onStructuralChange = (event: ChunkStructuralEvent): void => {\n for (let i = this._chunkNodes.length - 1; i >= 0; i--) {\n const node = this._chunkNodes[i];\n if (!node) continue;\n if (node.chunkX !== event.cx || node.chunkY !== event.cy) continue;\n this._chunkNodes.splice(i, 1);\n this.removeChild(node);\n node.destroy();\n }\n if (event.chunk !== null && !event.chunk.empty) this._addChunkNodes(event.chunk);\n this._sortChunks();\n };\n\n public constructor(layer: TileLayer, options?: TileLayerNodeOptions) {\n super();\n\n this._layer = layer;\n this._cullChunks = options?.cullable ?? true;\n\n this.setPosition(layer.offsetX, layer.offsetY);\n this._buildChunkNodes();\n\n if (!this._layer.bounded || layer.parallaxX !== 1 || layer.parallaxY !== 1 || layer.parallaxScale !== 1) {\n this.cullable = false;\n }\n\n this._layer._addStructuralListener(this._onStructuralChange);\n }\n\n /** The runtime layer this node renders. */\n public get layer(): TileLayer {\n return this._layer;\n }\n\n /**\n * Render-only pixel-snap mode applied to every chunk node in this layer (and\n * to chunks rebuilt later by {@link refresh}). Each chunk's rendered origin is\n * snapped to the active render target's device-pixel grid; because chunk\n * origins are integer multiples of the integer tile pitch from the same layer\n * origin, the whole grid stays exact and adjacent chunks cannot drift apart.\n *\n * Purely visual: tile data, the layer offset, chunk content revisions, and\n * culling bounds are never changed. `PixelSnapMode.Geometry` and `PixelSnapMode.Position` both resolve\n * to coherent origin snapping for tile chunks (chunk quads are already on the\n * integer pixel grid by construction). Setting the current value is a no-op;\n * an invalid value throws and leaves the prior mode unchanged.\n *\n * Defaults to `Geometry` because a tile grid is made of quads that share\n * their edges: left unsnapped, a boundary landing between two device pixels\n * is sampled across both, so the seams blur and shimmer as the view moves.\n * Set `None` to opt out.\n *\n * @default PixelSnapMode.Geometry\n * @stable\n */\n public get pixelSnapMode(): PixelSnapMode {\n return this._pixelSnapMode;\n }\n\n public set pixelSnapMode(mode: PixelSnapMode) {\n if (mode === this._pixelSnapMode) {\n return;\n }\n\n assertPixelSnapMode(mode);\n this._pixelSnapMode = mode;\n\n for (const chunk of this._chunkNodes) {\n chunk.pixelSnapMode = mode;\n }\n }\n\n /**\n * Rebuild the chunk-node children from the layer's current loaded chunks.\n * Call after structural mutation that creates or empties chunks. In-place\n * tile edits to existing chunks do not need a refresh.\n */\n public refresh(): this {\n const previous = [...this._chunkNodes];\n\n this.removeChildren();\n this._chunkNodes.length = 0;\n\n for (const child of previous) {\n child.destroy();\n }\n\n this._syncedOpacity = -1;\n this._syncedTint = undefined;\n this._buildChunkNodes();\n\n return this;\n }\n\n /** The chunk render nodes owned by this layer node, in build order. @internal */\n public get chunkNodes(): readonly TileChunkNode[] {\n return this._chunkNodes;\n }\n\n /**\n * Recomputed lazily on read, so it writes `_localBounds` directly rather than\n * going through `setLocalBounds`: an invalidating write inside a getter\n * would re-dirty the node on every read.\n */\n public override getLocalBounds(): ReadonlyRectangle {\n const bounds = this._localBounds;\n\n // Reading the pixel extents directly (rather than gating on `bounded`)\n // is what narrows them to numbers - `bounded` is a plain boolean getter.\n const { pixelHeight, pixelWidth } = this._layer;\n\n if (this._layer.projection.orientation === 'isometric') {\n bounds.set(0, 0, 0, 0);\n aggregateChildLocalBounds(this._chunkNodes, bounds);\n } else if (pixelWidth !== undefined && pixelHeight !== undefined) {\n bounds.set(this._layer.projection.originX, this._layer.projection.originY, pixelWidth, pixelHeight);\n } else if (this._chunkNodes.length > 0) {\n aggregateChildLocalBounds(this._chunkNodes, bounds);\n }\n\n return bounds;\n }\n\n /** @internal */\n protected override _collectContent(builder: RenderPlanBuilder): void {\n if (!this._layer.visible) {\n return;\n }\n\n this._syncTint();\n\n const layer = this._layer;\n\n const patchesPosition = layer.parallaxX !== 1 || layer.parallaxY !== 1;\n const patchesScale = layer.parallaxScale !== 1;\n\n // `offsetX`/`offsetY` are live, mutable fields (`TileColliderStreamer` and\n // `pixelToTile` already read them per call) - re-read here every frame so a\n // runtime-moved layer's rendering follows its collision rather than freezing\n // at the position it had when this node was constructed.\n if (patchesPosition || patchesScale) {\n const camCenter = builder.view.center;\n const prevScaleX = this.scale.x;\n const prevScaleY = this.scale.y;\n\n if (patchesPosition) {\n this.x = layer.offsetX + camCenter.x * (1 - layer.parallaxX);\n this.y = layer.offsetY + camCenter.y * (1 - layer.parallaxY);\n } else {\n this.setPosition(layer.offsetX, layer.offsetY);\n }\n\n if (patchesScale) {\n this.setScale(prevScaleX * layer.parallaxScale, prevScaleY * layer.parallaxScale);\n }\n\n try {\n super._collectContent(builder);\n } finally {\n if (patchesPosition) {\n this.setPosition(layer.offsetX, layer.offsetY);\n }\n\n if (patchesScale) {\n this.setScale(prevScaleX, prevScaleY);\n }\n }\n } else {\n this.setPosition(layer.offsetX, layer.offsetY);\n super._collectContent(builder);\n }\n }\n\n public override destroy(): void {\n this._layer._removeStructuralListener(this._onStructuralChange);\n\n const children = [...this._chunkNodes];\n\n this._chunkNodes.length = 0;\n\n super.destroy();\n\n for (const child of children) {\n child.destroy();\n }\n }\n\n private _buildChunkNodes(): void {\n const layer = this._layer;\n\n for (const chunk of layer.loadedChunks()) {\n if (chunk.empty) {\n continue;\n }\n\n this._addChunkNodes(chunk);\n }\n\n this._sortChunks();\n this._syncTint();\n }\n\n /**\n * Construct the configured draw nodes for `chunk` - shared by\n * the initial bulk build ({@link _buildChunkNodes}) and the incremental\n * structural-listener handler, so a future constructor argument or\n * per-node setting only needs to be added in one place.\n */\n private _addChunkNodes(chunk: ReadonlyTileChunk): void {\n const iso = this._layer.projection.orientation === 'isometric';\n const count = iso ? chunk.width + chunk.height - 1 : 1;\n for (let i = 0; i < count; i++) {\n const node = this._createChunkNode(chunk, iso ? i : undefined);\n this._chunkNodes.push(node);\n this.addChild(node);\n this._applyTint(node);\n }\n }\n\n private _sortChunks(): void {\n if (this._layer.projection.orientation !== 'isometric') return;\n this._chunkNodes.sort((a, b) => a.depth - b.depth || a.firstColumn - b.firstColumn);\n for (const [index, node] of this._chunkNodes.entries()) this.setChildIndex(node, index);\n }\n\n private _createChunkNode(chunk: ReadonlyTileChunk, diagonal?: number): TileChunkNode {\n const layer = this._layer;\n const node = new TileChunkNode(chunk, layer.tilesets, layer.tileWidth, layer.tileHeight, layer.chunkWidth, layer.chunkHeight, layer.projection, diagonal);\n\n node.cullable = this._cullChunks;\n // Unconditional: a chunk built after the layer was set to `None` has to\n // inherit that too, not just a non-default mode.\n node.pixelSnapMode = this._pixelSnapMode;\n\n return node;\n }\n\n /**\n * Compute and apply this layer's live tint (opacity as alpha, `tintColor`\n * as RGB multiply) to a single chunk node. Used both by {@link _syncTint}'s\n * bulk pass and by the structural-listener handler for a freshly-added\n * node - a node added between two \"nothing changed\" full syncs must still\n * receive the current tint, which a change-detection-guarded bulk pass\n * alone would skip.\n */\n private _applyTint(node: TileChunkNode): void {\n const tintColor = this._layer.tintColor;\n const r = tintColor === null ? 255 : (tintColor >> 16) & 0xff;\n const g = tintColor === null ? 255 : (tintColor >> 8) & 0xff;\n const b = tintColor === null ? 255 : tintColor & 0xff;\n node.tint.set(r, g, b, this._layer.opacity);\n }\n\n /**\n * Propagate the layer's live opacity and tint colour onto every chunk\n * render tint if either changed since the last call. Opacity drives the\n * tint alpha; `tintColor` (`0xRRGGBB`) multiplies the RGB (white = no tint).\n */\n private _syncTint(): void {\n const opacity = this._layer.opacity;\n const tintColor = this._layer.tintColor;\n\n if (opacity === this._syncedOpacity && tintColor === this._syncedTint) {\n return;\n }\n\n for (const child of this._chunkNodes) {\n this._applyTint(child);\n }\n\n this._syncedOpacity = opacity;\n this._syncedTint = tintColor;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA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