From c2d7a6dbb0c4b111ba561021445589c6c3f9fb1a Mon Sep 17 00:00:00 2001 From: German Khokhlov Date: Tue, 3 Nov 2026 21:49:50 +0400 Subject: [PATCH] Register the Navara style, bloom and cloud cover modules in the package boundaries and keep VisualEffects free of the globe contract --- scripts/package-boundaries.json | 6 +++++- src/ui/visualEffects.js | 19 +++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/scripts/package-boundaries.json b/scripts/package-boundaries.json index 48d9af8a9..96e9cf002 100644 --- a/scripts/package-boundaries.json +++ b/scripts/package-boundaries.json @@ -3595,7 +3595,11 @@ "src/globe/navara/look.js", "src/globe/navara/maps.js", "src/globe/navara/sharpen.js", - "src/annotations/drawInputNavara.js", + "src/globe/navara/stylePass.js", + "src/globe/navara/stylePasses.js", + "src/globe/navara/bloom.js", + "src/globe/navara/bloomSettings.js", + "src/globe/navara/cockpitClouds.js", "src/globe/navara/surface.js", "src/globe/navara/viewOptions.js", "src/app/engineChoice.js", diff --git a/src/ui/visualEffects.js b/src/ui/visualEffects.js index 957a8f929..81422710c 100644 --- a/src/ui/visualEffects.js +++ b/src/ui/visualEffects.js @@ -1,5 +1,4 @@ import { PostProcessStage } from 'cesium'; -import { engineCapabilities } from '../globe/contract.js'; import { bloomStrengthFromIntensity, clampBloomIntensity, @@ -77,11 +76,23 @@ export class VisualEffects { typeof engine?.render?.setSharpen === 'function' ? engine.render : null; // Without a viewer, an engine that draws the styles itself // (render.setStyle) gets them through stand-in stages (initStyles). - const capabilities = engineCapabilities(engine); + // (The visualStyles and bloom capabilities of src/globe/contract.js + // engineCapabilities, read by member: this package stays engine-free.) + const render = engine?.render; this.engineStyles = - !viewer && capabilities.visualStyles ? engine.render : null; + !viewer && + Array.isArray(render?.visualStyles) && + typeof render.setStyle === 'function' && + typeof render.style === 'function' + ? render + : null; // Likewise the bloom (render.setBloom) for Cesium's bloom stage. - this.engineBloom = !viewer && capabilities.bloom ? engine.render : null; + this.engineBloom = + !viewer && + typeof render?.setBloom === 'function' && + typeof render.bloom === 'function' + ? render + : null; this.requestRender = requestRender; this.holdRender = holdRender; this.releaseRender = releaseRender;