The renderer seam: clicks go to the newest tool, recession and display groups through the contract, drawing at parity with Cesium

- Clicks: when two tools want the globe's clicks, the newest takes them and the older is told and turns itself off; a click is decided when it arrives, and ambient selection fires only when no tool holds the pointer. The "map is busy" paths and their strings are removed.
- Recession: the limb fade is shared (src/render/recession.js) and reaches icon and model sets through SetSpec.recede; tuning applies on the next frame.
- Display panel groups are published through src/ui/displayGroups.js; the Weather group and src/viewWeather.js are removed.
- Draw port: a set whose icons only move is moved in place, and models that did not change are not restyled each frame, so moving fleets cost what they did when drawn directly; an untinted, fully opaque model is drawn without a colour.
- Conformance: input.lease.lost checks the new lease inside onLost and reports a throwing onLost; draw.sets.recede covers model sets.
- QA scripts read the renderer host instead of internals the seam replaced.
This commit is contained in:
Sameh Khamis committed 2026-11-15 17:03:09 -08:00
1 parent a0d299523d
commit 0ab31d4fb8
130 files changed
+5438 -1674

No files matched your search

+39
View File
@@ -327,6 +327,45 @@ test('a model stands on the floor its icon is lifted above', () => {
layer.destroy();
});
test('a model that did not change is not written, nor built anew to find that out', () => {
const { layer, frame } = readyLayer({ display: { models3d: true } });
const tram = transitModelSpec(set, { mode: 'tram' });
// Reads of what only the draw item takes (its scales): a model whose item
// is built again reads them.
let shapeReads = 0;
const spec = new Proxy(tram, {
get(target, key) {
if (key === 'scale' || key === 'scaleXYZ') shapeReads += 1;
return target[key];
},
});
const tint = [1, 0, 0, 1];
const item = itemAt(10, spec, { pickId: 't', tint });
const items = new Map([['t', item]]);
const models = frame(items, 0);
const writes = models.writes;
shapeReads = 0;
for (let at = 2; at < 6; at++) layer.frame(items, at);
assert.equal(models.writes, writes, 'nothing written');
assert.equal(shapeReads, 0, 'no draw item built');
// A move, a turn and a route colour the layer changes in its own array
// are each written.
item.position = add(item.position, { x: 1, y: 0, z: 0 });
layer.frame(items, 6);
assert.equal(models.writes, writes + 1, 'a move is written');
item.headingDeg += 10;
layer.frame(items, 7);
assert.equal(models.writes, writes + 2, 'a turn is written');
tint[2] = 1;
layer.frame(items, 8);
assert.equal(models.writes, writes + 3, 'a colour changed in place');
assert.deepEqual(models.items.get('t').maskColor, [1, 0, 1, 1]);
layer.frame(items, 9);
assert.equal(models.writes, writes + 3, 'and then nothing');
layer.destroy();
});
test('under NVG/FLIR models draw unlit white, and lit again on exit, without loading again', () => {
const display = { models3d: true, irBoost: false };
const { layer, frame } = readyLayer({ display });