mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 08:42:21 +00:00
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:
1 parent
a0d299523d
commit
0ab31d4fb8
130 files changed
+5438
-1674
No files matched your search
@@ -20,7 +20,7 @@ test('the stub passes the conformance suite', async () => {
|
||||
.filter((r) => r.status === 'skip')
|
||||
.map((r) => r.id);
|
||||
// It draws only models into pixels, so the sweep's, a lit shape's, a line outline's, a
|
||||
// split line's, a draped outlined line's and the blends' (over a drawn shape), video tiles' and the weather's pixels (drawn, and by scene time) go unread; its camera takes no user gestures: the drag and wheel scripts are for a
|
||||
// split line's, a draped outlined line's and the blends' (over a drawn shape), video tiles', the weather's pixels (drawn, and by scene time) and an encoded capture go unread; its camera takes no user gestures: the drag and wheel scripts are for a
|
||||
// camera that does (a controller over it, say).
|
||||
assert.deepEqual(skipped, [
|
||||
'effects.screenModulation.pixels',
|
||||
@@ -33,6 +33,8 @@ test('the stub passes the conformance suite', async () => {
|
||||
'globe.imagery.video',
|
||||
'globe.weather.drawn',
|
||||
'globe.weather.sceneTime',
|
||||
'renderer.capture',
|
||||
'effects.setStyleParams',
|
||||
...CAMERA_SCRIPTS.filter(usesInput).map((s) => `camera.trace.${s.name}`),
|
||||
]);
|
||||
});
|
||||
@@ -346,3 +348,67 @@ test('a lit-shape check that fails still shows the globe again', async () => {
|
||||
assert.equal(report.results[0].status, 'fail');
|
||||
assert.deepEqual(shown, [true]);
|
||||
});
|
||||
|
||||
/** One check over the stub with `change` made to each renderer it makes. */
|
||||
async function checkWith(id, change, extra = {}) {
|
||||
const base = createStubHarness();
|
||||
const report = await runConformance(
|
||||
{
|
||||
...base,
|
||||
...extra,
|
||||
create: async (options) => {
|
||||
const r = await base.create(options);
|
||||
change(r);
|
||||
return r;
|
||||
},
|
||||
},
|
||||
{ only: (c) => c === id },
|
||||
);
|
||||
return report.results[0];
|
||||
}
|
||||
|
||||
test('the resize check fails a renderer whose resize does not follow its container', async () => {
|
||||
assert.equal((await checkWith('renderer.resize', () => {})).status, 'pass');
|
||||
const result = await checkWith('renderer.resize', (r) => {
|
||||
r.resize = () => {};
|
||||
});
|
||||
assert.equal(result.status, 'fail', result.detail);
|
||||
});
|
||||
|
||||
test('the progress check fails a renderer that never says what it loads', async () => {
|
||||
assert.equal((await checkWith('globe.progress', () => {})).status, 'pass');
|
||||
const result = await checkWith('globe.progress', (r) => {
|
||||
r.globe.on = () => () => {};
|
||||
});
|
||||
assert.equal(result.status, 'fail', result.detail);
|
||||
});
|
||||
|
||||
test('the after-destroy check fails a renderer whose sets keep items once it is destroyed', async () => {
|
||||
assert.equal(
|
||||
(await checkWith('renderer.afterDestroy', () => {})).status,
|
||||
'pass',
|
||||
);
|
||||
const result = await checkWith('renderer.afterDestroy', (r) => {
|
||||
const points = r.draw.points;
|
||||
r.draw.points = (spec) => {
|
||||
const set = points(spec);
|
||||
let held = 0;
|
||||
set.set = (items) => (held = items.length);
|
||||
set.upsert = (items) => (held += items.length);
|
||||
set.size = () => held;
|
||||
return set;
|
||||
};
|
||||
});
|
||||
assert.equal(result.status, 'fail', result.detail);
|
||||
});
|
||||
|
||||
test('the stub keeps a set’s `recede` as given and as changed', () => {
|
||||
const r = createStubRenderer({ capabilities: ['models'] });
|
||||
r.draw.icons({ id: 'i', recede: { scaleFloor: 0.6 } });
|
||||
const models = r.draw.models({ id: 'm', recede: {} });
|
||||
assert.deepEqual(r.testing.setRecord('i').spec.recede, { scaleFloor: 0.6 });
|
||||
assert.deepEqual(r.testing.setRecord('m').spec.recede, {});
|
||||
models.setOptions({ recede: null });
|
||||
assert.equal(r.testing.setRecord('m').spec.recede, null);
|
||||
r.destroy();
|
||||
});
|
||||
Reference in new issue
Block a user