mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Tidy the vessels layer on the draw port: shared pose key, lazy pose, frame reasons, sprite order
The camera pose key moves to render/camera/poseSignature.js, Cesium-free, and iconOrientation's cameraPoseSignature builds the same key through it. The vessels frame hook reads the pose only when a pass runs or a moved camera could still need its trailing pass, and the unused focus scratch point goes. The draw port takes the frame port's requestRender, so a GPU icon set's own frames (its images packed into the atlas) are asked for under the reason icons:<set id> in the frame diagnostics, where the vessels layer's own ais-vessels-icons reason used to be. Other draw requests are unchanged. A host with no registerSpriteSet still draws the ships and warns once. The vessels draw test now checks the sprite order finds the set's host, and that a torn-down layer draws a new set registered in the old one's place. The new motion, icon book and pose key tests join the format check.
This commit is contained in:
1 parent
7a9c7b4d96
commit
1c8cf240c4
14 files changed
+334
-76
No files matched your search
@@ -139,13 +139,18 @@ const ANCHORS = {
|
||||
* sets by id, a version that changes with them, the scene's 3D tilesets and
|
||||
* the clamp-state watch the frame loop runs after each draw.
|
||||
* @param {{scene: object, report: (error: unknown) => void,
|
||||
* capabilities?: ReadonlySet<string>}} options `capabilities` gate the
|
||||
* GPU icon sets' members (by default they all are).
|
||||
* capabilities?: ReadonlySet<string>,
|
||||
* requestRender?: (reason: string) => void}} options `capabilities` gate
|
||||
* the GPU icon sets' members (by default they all are); `requestRender`,
|
||||
* the frame port's, asks for the frames a GPU icon set needs on its own
|
||||
* (its images packed), under the reason `icons:<set id>` (by default the
|
||||
* scene's, with no reason).
|
||||
*/
|
||||
export function createCesiumDraw({
|
||||
scene,
|
||||
report,
|
||||
capabilities = new Set(GPU_ICON_CAPABILITIES),
|
||||
requestRender: requestFrame = null,
|
||||
}) {
|
||||
const sets = new Map();
|
||||
// Bumped on every change to the sets or what they hold.
|
||||
@@ -322,7 +327,11 @@ export function createCesiumDraw({
|
||||
toColor,
|
||||
imageOf: (record, image) => iconImage(record, image),
|
||||
peekImage: (image) => atlases.get(image.atlas)?.[image.slot],
|
||||
requestRender,
|
||||
requestRender: (reason) => {
|
||||
if (!live()) return;
|
||||
if (requestFrame) requestFrame(reason);
|
||||
else scene.requestRender();
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user