@egret/engine 0.0.0-stage → 7.0.2
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.
- package/LICENSE +201 -0
- package/NOTICE +21 -0
- package/README.md +101 -2
- package/README.zh-CN.md +102 -0
- package/dist/Engine.d.ts +77 -0
- package/dist/Engine.js +469 -0
- package/dist/animation/index.d.ts +6 -0
- package/dist/animation/index.js +5 -0
- package/dist/animation/sequenceController.d.ts +22 -0
- package/dist/animation/sequenceController.js +618 -0
- package/dist/animation/sequenceCoordinator.d.ts +26 -0
- package/dist/animation/sequenceCoordinator.js +161 -0
- package/dist/animation/sequenceInput.d.ts +25 -0
- package/dist/animation/sequenceInput.js +108 -0
- package/dist/animation/sequenceMath.d.ts +35 -0
- package/dist/animation/sequenceMath.js +164 -0
- package/dist/animation/sequenceResetSlot.d.ts +7 -0
- package/dist/animation/sequenceResetSlot.js +367 -0
- package/dist/animation/sequenceResetTypes.d.ts +48 -0
- package/dist/animation/sequenceResetTypes.js +2 -0
- package/dist/animation/types.d.ts +75 -0
- package/dist/animation/types.js +2 -0
- package/dist/assetBundle.d.ts +54 -0
- package/dist/assetBundle.js +173 -0
- package/dist/assetGroup.d.ts +17 -0
- package/dist/assetGroup.js +332 -0
- package/dist/assetGroupTypes.d.ts +17 -0
- package/dist/assetGroupTypes.js +2 -0
- package/dist/audio.d.ts +4 -0
- package/dist/audio.js +4 -0
- package/dist/audioCues.d.ts +47 -0
- package/dist/audioCues.js +127 -0
- package/dist/audioMixer.d.ts +7 -0
- package/dist/audioMixer.js +785 -0
- package/dist/audioTypes.d.ts +246 -0
- package/dist/audioTypes.js +3 -0
- package/dist/bitmapBindingTicket.d.ts +24 -0
- package/dist/bitmapBindingTicket.js +215 -0
- package/dist/bitmapButton.d.ts +4 -0
- package/dist/bitmapButton.js +407 -0
- package/dist/bitmapButtonTypes.d.ts +31 -0
- package/dist/bitmapButtonTypes.js +2 -0
- package/dist/bitmapFontParse.d.ts +10 -0
- package/dist/bitmapFontParse.js +246 -0
- package/dist/bitmapFontTypes.d.ts +112 -0
- package/dist/bitmapFontTypes.js +2 -0
- package/dist/bitmapResourceSlot.d.ts +26 -0
- package/dist/bitmapResourceSlot.js +340 -0
- package/dist/bitmapText.d.ts +6 -0
- package/dist/bitmapText.js +320 -0
- package/dist/bitmapfont.d.ts +5 -0
- package/dist/bitmapfont.js +5 -0
- package/dist/camera.d.ts +4 -0
- package/dist/camera.js +4 -0
- package/dist/camera2d.d.ts +7 -0
- package/dist/camera2d.js +419 -0
- package/dist/cameraTypes.d.ts +126 -0
- package/dist/cameraTypes.js +2 -0
- package/dist/closeHost.d.ts +4 -0
- package/dist/closeHost.js +66 -0
- package/dist/contentArtifacts.d.ts +12 -0
- package/dist/contentArtifacts.js +153 -0
- package/dist/contentAtlasPages.d.ts +13 -0
- package/dist/contentAtlasPages.js +117 -0
- package/dist/contentLoader.d.ts +6 -0
- package/dist/contentLoader.js +327 -0
- package/dist/contentTypes.d.ts +35 -0
- package/dist/contentTypes.js +2 -0
- package/dist/createEngine.d.ts +7 -0
- package/dist/createEngine.js +25 -0
- package/dist/createEngineForProfile.d.ts +5 -0
- package/dist/createEngineForProfile.js +45 -0
- package/dist/displaySubtreeTicket.d.ts +25 -0
- package/dist/displaySubtreeTicket.js +76 -0
- package/dist/fontContentLoader.d.ts +6 -0
- package/dist/fontContentLoader.js +298 -0
- package/dist/fontContentTypes.d.ts +39 -0
- package/dist/fontContentTypes.js +2 -0
- package/dist/gameClock.d.ts +24 -0
- package/dist/gameClock.js +246 -0
- package/dist/gameClockTypes.d.ts +37 -0
- package/dist/gameClockTypes.js +2 -0
- package/dist/gameRun.d.ts +53 -0
- package/dist/gameRun.js +97 -0
- package/dist/gamepad.d.ts +5 -0
- package/dist/gamepad.js +5 -0
- package/dist/gamepadInput.d.ts +4 -0
- package/dist/gamepadInput.js +281 -0
- package/dist/gamepadKeys.d.ts +4 -0
- package/dist/gamepadKeys.js +205 -0
- package/dist/gamepadTypes.d.ts +142 -0
- package/dist/gamepadTypes.js +3 -0
- package/dist/hover.d.ts +4 -0
- package/dist/hover.js +4 -0
- package/dist/hoverInput.d.ts +8 -0
- package/dist/hoverInput.js +503 -0
- package/dist/hoverInputTypes.d.ts +129 -0
- package/dist/hoverInputTypes.js +2 -0
- package/dist/index.d.ts +52 -0
- package/dist/index.js +21 -0
- package/dist/input.d.ts +6 -0
- package/dist/input.js +5 -0
- package/dist/inputActions.d.ts +86 -0
- package/dist/inputActions.js +330 -0
- package/dist/internal/contentFactoryState.d.ts +19 -0
- package/dist/internal/contentFactoryState.js +42 -0
- package/dist/internal/mouseInputFactoryState.d.ts +57 -0
- package/dist/internal/mouseInputFactoryState.js +125 -0
- package/dist/internal/sequenceControllerFactoryState.d.ts +42 -0
- package/dist/internal/sequenceControllerFactoryState.js +98 -0
- package/dist/internal/textFieldFactoryState.d.ts +11 -0
- package/dist/internal/textFieldFactoryState.js +32 -0
- package/dist/internal/texturedFrameState.d.ts +4 -0
- package/dist/internal/texturedFrameState.js +12 -0
- package/dist/internal/uiFactoryState.d.ts +68 -0
- package/dist/internal/uiFactoryState.js +173 -0
- package/dist/internal/uiRootState.d.ts +67 -0
- package/dist/internal/uiRootState.js +103 -0
- package/dist/keyboardInput.d.ts +13 -0
- package/dist/keyboardInput.js +579 -0
- package/dist/keyboardInputTypes.d.ts +93 -0
- package/dist/keyboardInputTypes.js +2 -0
- package/dist/kit.d.ts +16 -0
- package/dist/kit.js +10 -0
- package/dist/layout.d.ts +5 -0
- package/dist/layout.js +132 -0
- package/dist/layoutTypes.d.ts +28 -0
- package/dist/layoutTypes.js +2 -0
- package/dist/manifestAssetGroup.d.ts +10 -0
- package/dist/manifestAssetGroup.js +477 -0
- package/dist/manifestResourceState.d.ts +17 -0
- package/dist/manifestResourceState.js +58 -0
- package/dist/manifestResourceTypes.d.ts +26 -0
- package/dist/manifestResourceTypes.js +2 -0
- package/dist/motion.d.ts +35 -0
- package/dist/motion.js +206 -0
- package/dist/mouseInput.d.ts +102 -0
- package/dist/mouseInput.js +562 -0
- package/dist/mouseInputTypes.d.ts +41 -0
- package/dist/mouseInputTypes.js +2 -0
- package/dist/paragraph.d.ts +8 -0
- package/dist/paragraph.js +7 -0
- package/dist/particleEmitter.d.ts +4 -0
- package/dist/particleEmitter.js +300 -0
- package/dist/particleTypes.d.ts +115 -0
- package/dist/particleTypes.js +2 -0
- package/dist/particles.d.ts +4 -0
- package/dist/particles.js +4 -0
- package/dist/physics2d.d.ts +4 -0
- package/dist/physics2d.js +4 -0
- package/dist/physics2dGeometry.d.ts +39 -0
- package/dist/physics2dGeometry.js +230 -0
- package/dist/physics2dTypes.d.ts +221 -0
- package/dist/physics2dTypes.js +2 -0
- package/dist/physics2dWorld.d.ts +4 -0
- package/dist/physics2dWorld.js +823 -0
- package/dist/pointerInput.d.ts +12 -0
- package/dist/pointerInput.js +300 -0
- package/dist/pointerInputTypes.d.ts +41 -0
- package/dist/pointerInputTypes.js +2 -0
- package/dist/random.d.ts +30 -0
- package/dist/random.js +131 -0
- package/dist/rendering/ownedPreparationFailure2D.d.ts +5 -0
- package/dist/rendering/ownedPreparationFailure2D.js +33 -0
- package/dist/rendering/packSharedDraws2D.d.ts +50 -0
- package/dist/rendering/packSharedDraws2D.js +379 -0
- package/dist/rendering/packedOrientation.d.ts +4 -0
- package/dist/rendering/packedOrientation.js +7 -0
- package/dist/rendering/prepareRectangles2D.d.ts +92 -0
- package/dist/rendering/prepareRectangles2D.js +481 -0
- package/dist/rendering/prepareSharedDraws2D.d.ts +90 -0
- package/dist/rendering/prepareSharedDraws2D.js +663 -0
- package/dist/rendering/preparedBatches2D.d.ts +17 -0
- package/dist/rendering/preparedBatches2D.js +30 -0
- package/dist/rendering/preparedSharedBatches2D.d.ts +44 -0
- package/dist/rendering/preparedSharedBatches2D.js +247 -0
- package/dist/rendering/sharedColor2D.d.ts +52 -0
- package/dist/rendering/sharedColor2D.js +191 -0
- package/dist/rendering/sharedEffects2D.d.ts +23 -0
- package/dist/rendering/sharedEffects2D.js +126 -0
- package/dist/rendering/sharedPreparationRetention2D.d.ts +120 -0
- package/dist/rendering/sharedPreparationRetention2D.js +357 -0
- package/dist/rendering/srgbBytes.d.ts +3 -0
- package/dist/rendering/srgbBytes.js +64 -0
- package/dist/rendering/texturedPreparationBudget2D.d.ts +31 -0
- package/dist/rendering/texturedPreparationBudget2D.js +81 -0
- package/dist/rendering/world3d/Animation3D.d.ts +104 -0
- package/dist/rendering/world3d/Animation3D.js +384 -0
- package/dist/rendering/world3d/AnimationTexture3D.d.ts +163 -0
- package/dist/rendering/world3d/AnimationTexture3D.js +603 -0
- package/dist/rendering/world3d/Batch3D.d.ts +75 -0
- package/dist/rendering/world3d/Batch3D.js +332 -0
- package/dist/rendering/world3d/Camera3D.d.ts +62 -0
- package/dist/rendering/world3d/Camera3D.js +132 -0
- package/dist/rendering/world3d/Character3D.d.ts +127 -0
- package/dist/rendering/world3d/Character3D.js +305 -0
- package/dist/rendering/world3d/Cloth3D.d.ts +130 -0
- package/dist/rendering/world3d/Cloth3D.js +503 -0
- package/dist/rendering/world3d/Compression3D.d.ts +22 -0
- package/dist/rendering/world3d/Compression3D.js +703 -0
- package/dist/rendering/world3d/Curves3D.d.ts +119 -0
- package/dist/rendering/world3d/Curves3D.js +460 -0
- package/dist/rendering/world3d/Decal3D.d.ts +43 -0
- package/dist/rendering/world3d/Decal3D.js +242 -0
- package/dist/rendering/world3d/Export3D.d.ts +13 -0
- package/dist/rendering/world3d/Export3D.js +263 -0
- package/dist/rendering/world3d/Geometry3D.d.ts +95 -0
- package/dist/rendering/world3d/Geometry3D.js +335 -0
- package/dist/rendering/world3d/GeometryBuilder3D.d.ts +53 -0
- package/dist/rendering/world3d/GeometryBuilder3D.js +196 -0
- package/dist/rendering/world3d/Gizmo3D.d.ts +80 -0
- package/dist/rendering/world3d/Gizmo3D.js +514 -0
- package/dist/rendering/world3d/Gltf3D.d.ts +73 -0
- package/dist/rendering/world3d/Gltf3D.js +996 -0
- package/dist/rendering/world3d/GpuParticles3D.d.ts +109 -0
- package/dist/rendering/world3d/GpuParticles3D.js +401 -0
- package/dist/rendering/world3d/Hdr3D.d.ts +35 -0
- package/dist/rendering/world3d/Hdr3D.js +191 -0
- package/dist/rendering/world3d/Jelly3D.d.ts +77 -0
- package/dist/rendering/world3d/Jelly3D.js +267 -0
- package/dist/rendering/world3d/Ktx23D.d.ts +30 -0
- package/dist/rendering/world3d/Ktx23D.js +112 -0
- package/dist/rendering/world3d/Light3D.d.ts +84 -0
- package/dist/rendering/world3d/Light3D.js +97 -0
- package/dist/rendering/world3d/Material3D.d.ts +253 -0
- package/dist/rendering/world3d/Material3D.js +269 -0
- package/dist/rendering/world3d/Mesh3D.d.ts +112 -0
- package/dist/rendering/world3d/Mesh3D.js +337 -0
- package/dist/rendering/world3d/Meshopt3D.d.ts +15 -0
- package/dist/rendering/world3d/Meshopt3D.js +276 -0
- package/dist/rendering/world3d/Navigation3D.d.ts +213 -0
- package/dist/rendering/world3d/Navigation3D.js +1043 -0
- package/dist/rendering/world3d/Object3D.d.ts +118 -0
- package/dist/rendering/world3d/Object3D.js +315 -0
- package/dist/rendering/world3d/Particles3D.d.ts +90 -0
- package/dist/rendering/world3d/Particles3D.js +277 -0
- package/dist/rendering/world3d/Physics3D.d.ts +430 -0
- package/dist/rendering/world3d/Physics3D.js +2840 -0
- package/dist/rendering/world3d/PhysicsHull3D.d.ts +37 -0
- package/dist/rendering/world3d/PhysicsHull3D.js +229 -0
- package/dist/rendering/world3d/PhysicsMesh3D.d.ts +41 -0
- package/dist/rendering/world3d/PhysicsMesh3D.js +340 -0
- package/dist/rendering/world3d/PhysicsQueries3D.d.ts +24 -0
- package/dist/rendering/world3d/PhysicsQueries3D.js +323 -0
- package/dist/rendering/world3d/PhysicsRemote3D.d.ts +179 -0
- package/dist/rendering/world3d/PhysicsRemote3D.js +536 -0
- package/dist/rendering/world3d/Ragdoll3D.d.ts +74 -0
- package/dist/rendering/world3d/Ragdoll3D.js +202 -0
- package/dist/rendering/world3d/Raycast3D.d.ts +40 -0
- package/dist/rendering/world3d/Raycast3D.js +247 -0
- package/dist/rendering/world3d/RenderList3D.d.ts +91 -0
- package/dist/rendering/world3d/RenderList3D.js +502 -0
- package/dist/rendering/world3d/Retarget3D.d.ts +21 -0
- package/dist/rendering/world3d/Retarget3D.js +185 -0
- package/dist/rendering/world3d/Rig3D.d.ts +57 -0
- package/dist/rendering/world3d/Rig3D.js +219 -0
- package/dist/rendering/world3d/Sdf3D.d.ts +181 -0
- package/dist/rendering/world3d/Sdf3D.js +1136 -0
- package/dist/rendering/world3d/SdfLod3D.d.ts +17 -0
- package/dist/rendering/world3d/SdfLod3D.js +56 -0
- package/dist/rendering/world3d/Serialize3D.d.ts +66 -0
- package/dist/rendering/world3d/Serialize3D.js +629 -0
- package/dist/rendering/world3d/Simplify3D.d.ts +29 -0
- package/dist/rendering/world3d/Simplify3D.js +426 -0
- package/dist/rendering/world3d/StateMachine3D.d.ts +87 -0
- package/dist/rendering/world3d/StateMachine3D.js +280 -0
- package/dist/rendering/world3d/SurfaceMaterial3D.d.ts +26 -0
- package/dist/rendering/world3d/SurfaceMaterial3D.js +138 -0
- package/dist/rendering/world3d/Terrain3D.d.ts +248 -0
- package/dist/rendering/world3d/Terrain3D.js +827 -0
- package/dist/rendering/world3d/Text3D.d.ts +95 -0
- package/dist/rendering/world3d/Text3D.js +560 -0
- package/dist/rendering/world3d/Texture3D.d.ts +148 -0
- package/dist/rendering/world3d/Texture3D.js +270 -0
- package/dist/rendering/world3d/Trail3D.d.ts +62 -0
- package/dist/rendering/world3d/Trail3D.js +195 -0
- package/dist/rendering/world3d/Vehicle3D.d.ts +102 -0
- package/dist/rendering/world3d/Vehicle3D.js +228 -0
- package/dist/rendering/world3d/VolumetricFog3D.d.ts +57 -0
- package/dist/rendering/world3d/VolumetricFog3D.js +230 -0
- package/dist/rendering/world3d/Water3D.d.ts +165 -0
- package/dist/rendering/world3d/Water3D.js +607 -0
- package/dist/rendering/world3d/core3D.d.ts +36 -0
- package/dist/rendering/world3d/core3D.js +99 -0
- package/dist/rendering/world3d/debug3D.d.ts +69 -0
- package/dist/rendering/world3d/debug3D.js +262 -0
- package/dist/rendering/world3d/decoders3D.d.ts +42 -0
- package/dist/rendering/world3d/decoders3D.js +133 -0
- package/dist/rendering/world3d/geometries3D.d.ts +111 -0
- package/dist/rendering/world3d/geometries3D.js +610 -0
- package/dist/rendering/world3d/helpers3D.d.ts +67 -0
- package/dist/rendering/world3d/helpers3D.js +178 -0
- package/dist/rendering/world3d/index.d.ts +103 -0
- package/dist/rendering/world3d/index.js +62 -0
- package/dist/rendering/world3d/math3D.d.ts +114 -0
- package/dist/rendering/world3d/math3D.js +675 -0
- package/dist/rendering/world3d/primitives3D.d.ts +67 -0
- package/dist/rendering/world3d/primitives3D.js +197 -0
- package/dist/resources.d.ts +8 -0
- package/dist/resources.js +6 -0
- package/dist/saveStore.d.ts +71 -0
- package/dist/saveStore.js +182 -0
- package/dist/semanticList.d.ts +126 -0
- package/dist/semanticList.js +175 -0
- package/dist/semanticTree.d.ts +10 -0
- package/dist/semanticTree.js +539 -0
- package/dist/semanticTypes.d.ts +175 -0
- package/dist/semanticTypes.js +2 -0
- package/dist/semantics.d.ts +6 -0
- package/dist/semantics.js +5 -0
- package/dist/sequencePlayback.d.ts +19 -0
- package/dist/sequencePlayback.js +391 -0
- package/dist/sequencePlaybackTypes.d.ts +24 -0
- package/dist/sequencePlaybackTypes.js +2 -0
- package/dist/sequenceTargetClaims.d.ts +10 -0
- package/dist/sequenceTargetClaims.js +31 -0
- package/dist/srgbBytes.d.ts +3 -0
- package/dist/srgbBytes.js +64 -0
- package/dist/startEngine.d.ts +5 -0
- package/dist/startEngine.js +31 -0
- package/dist/surfaceOwnership.d.ts +3 -0
- package/dist/surfaceOwnership.js +15 -0
- package/dist/text.d.ts +24 -0
- package/dist/text.js +4 -0
- package/dist/textField.d.ts +6 -0
- package/dist/textField.js +6 -0
- package/dist/textTable.d.ts +41 -0
- package/dist/textTable.js +114 -0
- package/dist/tileMapDraw.d.ts +7 -0
- package/dist/tileMapDraw.js +310 -0
- package/dist/tiledImport.d.ts +9 -0
- package/dist/tiledImport.js +357 -0
- package/dist/tilemap.d.ts +5 -0
- package/dist/tilemap.js +5 -0
- package/dist/tilemapTypes.d.ts +182 -0
- package/dist/tilemapTypes.js +2 -0
- package/dist/timer.d.ts +34 -0
- package/dist/timer.js +119 -0
- package/dist/tween.d.ts +15 -0
- package/dist/tween.js +329 -0
- package/dist/tweenTypes.d.ts +31 -0
- package/dist/tweenTypes.js +2 -0
- package/dist/ui/controlKeys.d.ts +113 -0
- package/dist/ui/controlKeys.js +250 -0
- package/dist/ui/controls.d.ts +58 -0
- package/dist/ui/controls.js +290 -0
- package/dist/ui/editing.d.ts +3 -0
- package/dist/ui/editing.js +3 -0
- package/dist/ui/index.d.ts +19 -0
- package/dist/ui/index.js +11 -0
- package/dist/ui/keyboardFocus.d.ts +32 -0
- package/dist/ui/keyboardFocus.js +146 -0
- package/dist/ui/layerTypes.d.ts +98 -0
- package/dist/ui/layerTypes.js +2 -0
- package/dist/ui/layers.d.ts +4 -0
- package/dist/ui/layers.js +586 -0
- package/dist/ui/leafContent.d.ts +21 -0
- package/dist/ui/leafContent.js +136 -0
- package/dist/ui/rangeControl.d.ts +53 -0
- package/dist/ui/rangeControl.js +168 -0
- package/dist/ui/scrollControl.d.ts +84 -0
- package/dist/ui/scrollControl.js +222 -0
- package/dist/ui/stateControls.d.ts +90 -0
- package/dist/ui/stateControls.js +331 -0
- package/dist/ui/textEditor.d.ts +54 -0
- package/dist/ui/textEditor.js +371 -0
- package/dist/ui/textEditorTypes.d.ts +85 -0
- package/dist/ui/textEditorTypes.js +2 -0
- package/dist/ui/textFieldControl.d.ts +100 -0
- package/dist/ui/textFieldControl.js +260 -0
- package/dist/ui/theme.d.ts +64 -0
- package/dist/ui/theme.js +166 -0
- package/dist/ui/types.d.ts +285 -0
- package/dist/ui/types.js +2 -0
- package/dist/ui/uiRoot.d.ts +4 -0
- package/dist/ui/uiRoot.js +1526 -0
- package/dist/ui/uiRootDisplay.d.ts +46 -0
- package/dist/ui/uiRootDisplay.js +148 -0
- package/dist/ui/uiRootModel.d.ts +114 -0
- package/dist/ui/uiRootModel.js +66 -0
- package/dist/ui/virtualList.d.ts +20 -0
- package/dist/ui/virtualList.js +105 -0
- package/dist/video.d.ts +4 -0
- package/dist/video.js +4 -0
- package/dist/videoPlayer.d.ts +4 -0
- package/dist/videoPlayer.js +215 -0
- package/dist/videoTypes.d.ts +77 -0
- package/dist/videoTypes.js +2 -0
- package/dist/web/BrowserAssetBundle.d.ts +41 -0
- package/dist/web/BrowserAssetBundle.js +136 -0
- package/dist/web/BrowserAudio.d.ts +74 -0
- package/dist/web/BrowserAudio.js +503 -0
- package/dist/web/BrowserFrameLoop.d.ts +69 -0
- package/dist/web/BrowserFrameLoop.js +125 -0
- package/dist/web/BrowserGame.d.ts +174 -0
- package/dist/web/BrowserGame.js +473 -0
- package/dist/web/BrowserGamepadInput.d.ts +38 -0
- package/dist/web/BrowserGamepadInput.js +134 -0
- package/dist/web/BrowserHoverInput.d.ts +25 -0
- package/dist/web/BrowserHoverInput.js +266 -0
- package/dist/web/BrowserImageTextures.d.ts +72 -0
- package/dist/web/BrowserImageTextures.js +169 -0
- package/dist/web/BrowserInputActions.d.ts +63 -0
- package/dist/web/BrowserInputActions.js +345 -0
- package/dist/web/BrowserKeyboardInput.d.ts +4 -0
- package/dist/web/BrowserKeyboardInput.js +223 -0
- package/dist/web/BrowserPlay.d.ts +417 -0
- package/dist/web/BrowserPlay.js +1648 -0
- package/dist/web/BrowserPointerInput.d.ts +4 -0
- package/dist/web/BrowserPointerInput.js +511 -0
- package/dist/web/BrowserPreferences.d.ts +10 -0
- package/dist/web/BrowserPreferences.js +39 -0
- package/dist/web/BrowserSemantics.d.ts +36 -0
- package/dist/web/BrowserSemantics.js +418 -0
- package/dist/web/BrowserStatsPanel.d.ts +56 -0
- package/dist/web/BrowserStatsPanel.js +143 -0
- package/dist/web/BrowserStorage.d.ts +35 -0
- package/dist/web/BrowserStorage.js +132 -0
- package/dist/web/BrowserTextEditor.d.ts +52 -0
- package/dist/web/BrowserTextEditor.js +839 -0
- package/dist/web/BrowserTextInput.d.ts +89 -0
- package/dist/web/BrowserTextInput.js +524 -0
- package/dist/web/BrowserTextureProvider.d.ts +58 -0
- package/dist/web/BrowserTextureProvider.js +935 -0
- package/dist/web/BrowserVideo.d.ts +40 -0
- package/dist/web/BrowserVideo.js +237 -0
- package/dist/web/CanvasKitFontSetProvider.d.ts +32 -0
- package/dist/web/CanvasKitFontSetProvider.js +215 -0
- package/dist/web/CanvasKitParagraphProvider.d.ts +173 -0
- package/dist/web/CanvasKitParagraphProvider.js +692 -0
- package/dist/web/CanvasTextRasterProvider.d.ts +4 -0
- package/dist/web/CanvasTextRasterProvider.js +312 -0
- package/dist/web/ManifestByteSource.d.ts +151 -0
- package/dist/web/ManifestByteSource.js +975 -0
- package/dist/web/ManifestFontContentLoader.d.ts +13 -0
- package/dist/web/ManifestFontContentLoader.js +30 -0
- package/dist/web/MouseInput.d.ts +4 -0
- package/dist/web/MouseInput.js +218 -0
- package/dist/web/WebGL2Host.d.ts +5 -0
- package/dist/web/WebGL2Host.js +2711 -0
- package/dist/web/WebGPUHost.d.ts +100 -0
- package/dist/web/WebGPUHost.js +3430 -0
- package/dist/web/audio.d.ts +3 -0
- package/dist/web/audio.js +4 -0
- package/dist/web/canvasKitParagraphGeometry.d.ts +27 -0
- package/dist/web/canvasKitParagraphGeometry.js +83 -0
- package/dist/web/editing.d.ts +5 -0
- package/dist/web/editing.js +4 -0
- package/dist/web/editorFonts.d.ts +54 -0
- package/dist/web/editorFonts.js +297 -0
- package/dist/web/game.d.ts +5 -0
- package/dist/web/game.js +6 -0
- package/dist/web/gamepad.d.ts +3 -0
- package/dist/web/gamepad.js +4 -0
- package/dist/web/hover.d.ts +3 -0
- package/dist/web/hover.js +4 -0
- package/dist/web/image.d.ts +4 -0
- package/dist/web/image.js +4 -0
- package/dist/web/imageProjections2D.d.ts +16 -0
- package/dist/web/imageProjections2D.js +2 -0
- package/dist/web/input.d.ts +6 -0
- package/dist/web/input.js +4 -0
- package/dist/web/keyboard.d.ts +3 -0
- package/dist/web/keyboard.js +3 -0
- package/dist/web/kit.d.ts +11 -0
- package/dist/web/kit.js +8 -0
- package/dist/web/loop.d.ts +3 -0
- package/dist/web/loop.js +4 -0
- package/dist/web/paragraph.d.ts +6 -0
- package/dist/web/paragraph.js +4 -0
- package/dist/web/play.d.ts +10 -0
- package/dist/web/play.js +9 -0
- package/dist/web/playMusic.d.ts +33 -0
- package/dist/web/playMusic.js +194 -0
- package/dist/web/playSfx.d.ts +36 -0
- package/dist/web/playSfx.js +112 -0
- package/dist/web/playTouch.d.ts +45 -0
- package/dist/web/playTouch.js +141 -0
- package/dist/web/playWidgets.d.ts +71 -0
- package/dist/web/playWidgets.js +431 -0
- package/dist/web/pointer.d.ts +3 -0
- package/dist/web/pointer.js +3 -0
- package/dist/web/prepareSharedSubmission2D.d.ts +27 -0
- package/dist/web/prepareSharedSubmission2D.js +63 -0
- package/dist/web/resources.d.ts +29 -0
- package/dist/web/resources.js +96 -0
- package/dist/web/semantics.d.ts +3 -0
- package/dist/web/semantics.js +4 -0
- package/dist/web/sharedDeviceSession.d.ts +64 -0
- package/dist/web/sharedDeviceSession.js +2 -0
- package/dist/web/sharedEffectShaders.d.ts +13 -0
- package/dist/web/sharedEffectShaders.js +181 -0
- package/dist/web/sharedFrameUpload.d.ts +25 -0
- package/dist/web/sharedFrameUpload.js +2 -0
- package/dist/web/sharedHostDeferred.d.ts +7 -0
- package/dist/web/sharedHostDeferred.js +12 -0
- package/dist/web/sharedRetentionLedger.d.ts +85 -0
- package/dist/web/sharedRetentionLedger.js +391 -0
- package/dist/web/sharedSubmissionStorage2D.d.ts +56 -0
- package/dist/web/sharedSubmissionStorage2D.js +73 -0
- package/dist/web/sharedWebGL2Arena.d.ts +40 -0
- package/dist/web/sharedWebGL2Arena.js +77 -0
- package/dist/web/sharedWebGL2Options.d.ts +33 -0
- package/dist/web/sharedWebGL2Options.js +102 -0
- package/dist/web/sharedWebGL2Shaders.d.ts +33 -0
- package/dist/web/sharedWebGL2Shaders.js +408 -0
- package/dist/web/sharedWebGPUOptions.d.ts +41 -0
- package/dist/web/sharedWebGPUOptions.js +130 -0
- package/dist/web/text.d.ts +3 -0
- package/dist/web/text.js +3 -0
- package/dist/web/textInput.d.ts +3 -0
- package/dist/web/textInput.js +3 -0
- package/dist/web/video.d.ts +3 -0
- package/dist/web/video.js +4 -0
- package/dist/web/webgl2.d.ts +7 -0
- package/dist/web/webgl2.js +4 -0
- package/dist/web/webgl2LayerState.d.ts +50 -0
- package/dist/web/webgl2LayerState.js +102 -0
- package/dist/web/webgl2Native.d.ts +72 -0
- package/dist/web/webgl2Native.js +572 -0
- package/dist/web/webgl2Types.d.ts +150 -0
- package/dist/web/webgl2Types.js +2 -0
- package/dist/web/webgpu.d.ts +6 -0
- package/dist/web/webgpu.js +2 -0
- package/dist/web/webgpuBindingCache.d.ts +26 -0
- package/dist/web/webgpuBindingCache.js +223 -0
- package/dist/web/webgpuBufferPool.d.ts +51 -0
- package/dist/web/webgpuBufferPool.js +58 -0
- package/dist/web/webgpuImageResidency.d.ts +56 -0
- package/dist/web/webgpuImageResidency.js +65 -0
- package/dist/web/webgpuLifetime.d.ts +45 -0
- package/dist/web/webgpuLifetime.js +64 -0
- package/dist/web/webgpuRetentionPool.d.ts +66 -0
- package/dist/web/webgpuRetentionPool.js +85 -0
- package/dist/web/webgpuSharedPass.d.ts +7 -0
- package/dist/web/webgpuSharedPass.js +293 -0
- package/dist/web/webgpuSharedResolvePass.d.ts +3 -0
- package/dist/web/webgpuSharedResolvePass.js +34 -0
- package/dist/web/world3d/Audio3D.d.ts +85 -0
- package/dist/web/world3d/Audio3D.js +271 -0
- package/dist/web/world3d/BrowserPlay3D.d.ts +295 -0
- package/dist/web/world3d/BrowserPlay3D.js +1256 -0
- package/dist/web/world3d/FlyControls3D.d.ts +59 -0
- package/dist/web/world3d/FlyControls3D.js +162 -0
- package/dist/web/world3d/FollowControls3D.d.ts +31 -0
- package/dist/web/world3d/FollowControls3D.js +119 -0
- package/dist/web/world3d/OrbitControls3D.d.ts +58 -0
- package/dist/web/world3d/OrbitControls3D.js +189 -0
- package/dist/web/world3d/TransformControls3D.d.ts +37 -0
- package/dist/web/world3d/TransformControls3D.js +128 -0
- package/dist/web/world3d/WebGL2Renderer3D.d.ts +136 -0
- package/dist/web/world3d/WebGL2Renderer3D.js +1175 -0
- package/dist/web/world3d/WebGPURenderer3D.d.ts +112 -0
- package/dist/web/world3d/WebGPURenderer3D.js +1916 -0
- package/dist/web/world3d/World3DView.d.ts +54 -0
- package/dist/web/world3d/World3DView.js +79 -0
- package/dist/web/world3d/app3D.d.ts +143 -0
- package/dist/web/world3d/app3D.js +305 -0
- package/dist/web/world3d/assets3D.d.ts +39 -0
- package/dist/web/world3d/assets3D.js +112 -0
- package/dist/web/world3d/atmosphere3D.d.ts +56 -0
- package/dist/web/world3d/atmosphere3D.js +193 -0
- package/dist/web/world3d/canvasFont3D.d.ts +21 -0
- package/dist/web/world3d/canvasFont3D.js +165 -0
- package/dist/web/world3d/frame3D.d.ts +144 -0
- package/dist/web/world3d/frame3D.js +388 -0
- package/dist/web/world3d/gpuResources3D.d.ts +98 -0
- package/dist/web/world3d/gpuResources3D.js +901 -0
- package/dist/web/world3d/host3D.d.ts +24 -0
- package/dist/web/world3d/host3D.js +61 -0
- package/dist/web/world3d/index.d.ts +40 -0
- package/dist/web/world3d/index.js +24 -0
- package/dist/web/world3d/loaders3D.d.ts +27 -0
- package/dist/web/world3d/loaders3D.js +138 -0
- package/dist/web/world3d/markers3D.d.ts +53 -0
- package/dist/web/world3d/markers3D.js +130 -0
- package/dist/web/world3d/materialWebGL23D.d.ts +34 -0
- package/dist/web/world3d/materialWebGL23D.js +218 -0
- package/dist/web/world3d/overlay3D.d.ts +47 -0
- package/dist/web/world3d/overlay3D.js +187 -0
- package/dist/web/world3d/post3D.d.ts +116 -0
- package/dist/web/world3d/post3D.js +462 -0
- package/dist/web/world3d/postWebGL23D.d.ts +24 -0
- package/dist/web/world3d/postWebGL23D.js +237 -0
- package/dist/web/world3d/postWebGPU3D.d.ts +23 -0
- package/dist/web/world3d/postWebGPU3D.js +255 -0
- package/dist/web/world3d/probe3D.d.ts +15 -0
- package/dist/web/world3d/probe3D.js +66 -0
- package/dist/web/world3d/shaders3D.d.ts +43 -0
- package/dist/web/world3d/shaders3D.js +851 -0
- package/dist/web/world3d/stats3D.d.ts +34 -0
- package/dist/web/world3d/stats3D.js +81 -0
- package/dist/web/world3d/webGL2FrameMetrics3D.d.ts +71 -0
- package/dist/web/world3d/webGL2FrameMetrics3D.js +185 -0
- package/dist/web/world3d/webgpu.d.ts +37 -0
- package/dist/web/world3d/webgpu.js +23 -0
- package/dist/web/world3d/webgpuPacking3D.d.ts +13 -0
- package/dist/web/world3d/webgpuPacking3D.js +85 -0
- package/dist/web/world3d/wgsl3D.d.ts +68 -0
- package/dist/web/world3d/wgsl3D.js +781 -0
- package/package.json +220 -4
package/dist/Engine.js
ADDED
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
import { createDisplaySubtreeTickets } from './displaySubtreeTicket.js';
|
|
2
|
+
import { SHARED_FRAME_PROFILE_2D } from '@egret/contracts';
|
|
3
|
+
import { collectSharedFrameContent } from '@egret/runtime';
|
|
4
|
+
import { EgretError, createScope, createStage, createAssetManager, reportDiagnostic, createDisplayInputOperations } from '@egret/runtime';
|
|
5
|
+
import { createBitmapResourceSlotOwner } from './bitmapResourceSlot.js';
|
|
6
|
+
import { createBitmapBindingOwner } from './bitmapBindingTicket.js';
|
|
7
|
+
import { closeHost } from './closeHost.js';
|
|
8
|
+
import { registerSharedFrame } from './internal/texturedFrameState.js';
|
|
9
|
+
import { createGameClockOwner } from './gameClock.js';
|
|
10
|
+
import { createTweenOwner } from './tween.js';
|
|
11
|
+
import { registerTextFieldEngine } from './internal/textFieldFactoryState.js';
|
|
12
|
+
import { createAssetGroupOwner } from './assetGroup.js';
|
|
13
|
+
import { createManifestAssetGroupOwner } from './manifestAssetGroup.js';
|
|
14
|
+
import { createMouseInputOwner } from './mouseInput.js';
|
|
15
|
+
import { createSequencePlaybackOwner } from './sequencePlayback.js';
|
|
16
|
+
import { registerUiEngine } from './internal/uiFactoryState.js';
|
|
17
|
+
import { createSequenceTargetClaims } from './sequenceTargetClaims.js';
|
|
18
|
+
import { registerSequenceControllerEngine } from './internal/sequenceControllerFactoryState.js';
|
|
19
|
+
import { registerContentEngine } from './internal/contentFactoryState.js';
|
|
20
|
+
export let constructEngine;
|
|
21
|
+
const freezeSharedFrame = Object.freeze;
|
|
22
|
+
const CREATION_TOKEN = Symbol('egret.engineFactory');
|
|
23
|
+
/** Observation does not accept asynchronous submission or prove host completion. */
|
|
24
|
+
function observeRejectedRenderResult(result) {
|
|
25
|
+
const ignoreRejection = () => { };
|
|
26
|
+
try {
|
|
27
|
+
// Intrinsic brand checking recognizes native Promises from other realms and
|
|
28
|
+
// avoids consulting an overridden .then property on a native Promise.
|
|
29
|
+
void Reflect.apply(Promise.prototype.then, result, [undefined, ignoreRejection]);
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
// Ordinary thenables (including throwing then getters) are assimilated into
|
|
33
|
+
// a handled Promise. Observation must not replace the invalid-port cause.
|
|
34
|
+
try {
|
|
35
|
+
void Promise.resolve(result).then(undefined, ignoreRejection);
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
/* A hostile constructor cannot make this return type acceptable. */
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/** One headless run. Construct with createEngine(), not directly. */
|
|
43
|
+
export class Engine {
|
|
44
|
+
#displaySubtreeTickets;
|
|
45
|
+
#contentLoaders = new Set();
|
|
46
|
+
#gameClockOwner;
|
|
47
|
+
#tweenOwner;
|
|
48
|
+
#sequencePlaybackOwner;
|
|
49
|
+
#sequenceControllerOwner;
|
|
50
|
+
#assetGroupOwner;
|
|
51
|
+
#manifestAssetGroupOwner;
|
|
52
|
+
#bitmapResourceSlotOwner;
|
|
53
|
+
#bitmapBindingOwner;
|
|
54
|
+
#bitmapResourceTargets = new WeakMap();
|
|
55
|
+
#mouseInputOwner;
|
|
56
|
+
#uiOwner;
|
|
57
|
+
#engineScopes = new WeakSet();
|
|
58
|
+
frameBusy = false;
|
|
59
|
+
nextFrameId = 1;
|
|
60
|
+
frameIdle;
|
|
61
|
+
releaseFrame;
|
|
62
|
+
sharedRenderer;
|
|
63
|
+
/** The space the renderer mixes in, which every frame records; ports may carry it beside their declared members. */
|
|
64
|
+
#sharedBlendSpace;
|
|
65
|
+
#currentState = 'open';
|
|
66
|
+
scopes = new Set();
|
|
67
|
+
cleanupErrors = [];
|
|
68
|
+
closePromise;
|
|
69
|
+
host;
|
|
70
|
+
timeoutMs;
|
|
71
|
+
onDiagnostic;
|
|
72
|
+
releaseSurface;
|
|
73
|
+
#context;
|
|
74
|
+
stage;
|
|
75
|
+
assets;
|
|
76
|
+
sharedFrameProfile;
|
|
77
|
+
clock;
|
|
78
|
+
constructor(options, timeoutMs, surface, releaseSurface, ports, clockOptions, token) {
|
|
79
|
+
if (token !== CREATION_TOKEN)
|
|
80
|
+
throw new EgretError('ENGINE_FACTORY_REQUIRED');
|
|
81
|
+
this.host = options.host;
|
|
82
|
+
this.sharedRenderer = ports.shared;
|
|
83
|
+
this.#sharedBlendSpace =
|
|
84
|
+
ports.sharedBlendSpace === 'srgb' ? 'srgb' : 'linear';
|
|
85
|
+
this.sharedFrameProfile = ports.sharedProfile;
|
|
86
|
+
this.timeoutMs = timeoutMs;
|
|
87
|
+
this.onDiagnostic = options.onDiagnostic;
|
|
88
|
+
this.releaseSurface = releaseSurface;
|
|
89
|
+
const assertOpen = () => {
|
|
90
|
+
if (this.#currentState !== 'open')
|
|
91
|
+
throw new EgretError('ENGINE_CLOSED');
|
|
92
|
+
};
|
|
93
|
+
const textFields = registerTextFieldEngine(this, assertOpen, (scope) => typeof scope === 'object' && scope !== null && this.#engineScopes.has(scope));
|
|
94
|
+
let preparedDisplayOperations;
|
|
95
|
+
let assetGroupOperations;
|
|
96
|
+
// The context is never retained in a named public property by its consumers.
|
|
97
|
+
this.#context = Object.freeze({
|
|
98
|
+
assertOpen: () => {
|
|
99
|
+
if (this.#currentState !== 'open')
|
|
100
|
+
throw new EgretError('ENGINE_CLOSED');
|
|
101
|
+
},
|
|
102
|
+
report: (diagnostic) => reportDiagnostic(this.onDiagnostic, diagnostic),
|
|
103
|
+
captureCleanup: (cause) => {
|
|
104
|
+
if (this.#currentState === 'closing')
|
|
105
|
+
this.cleanupErrors.push(cause);
|
|
106
|
+
},
|
|
107
|
+
registerTextFieldCache: textFields.registerCache,
|
|
108
|
+
registerPreparedDisplayOperations: (operations) => {
|
|
109
|
+
preparedDisplayOperations = operations;
|
|
110
|
+
},
|
|
111
|
+
registerBitmapResourceTarget: (bitmap, operations) => {
|
|
112
|
+
this.#bitmapResourceTargets.set(bitmap, operations);
|
|
113
|
+
},
|
|
114
|
+
registerAssetGroupOperations: (operations) => {
|
|
115
|
+
assetGroupOperations = operations;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
// The inert owner precedes publication and uses private Scope membership.
|
|
119
|
+
this.#gameClockOwner = createGameClockOwner({
|
|
120
|
+
assertOpen: this.#context.assertOpen,
|
|
121
|
+
isEngineScope: (scope) => typeof scope === 'object' && scope !== null && this.#engineScopes.has(scope),
|
|
122
|
+
isFrameBusy: () => this.frameBusy,
|
|
123
|
+
report: this.#context.report
|
|
124
|
+
}, clockOptions);
|
|
125
|
+
// Tween assembly receives the authentic private clock before publication.
|
|
126
|
+
this.#tweenOwner = createTweenOwner({
|
|
127
|
+
assertOpen: this.#context.assertOpen,
|
|
128
|
+
isEngineScope: (scope) => typeof scope === 'object' && scope !== null && this.#engineScopes.has(scope),
|
|
129
|
+
clock: this.#gameClockOwner.clock
|
|
130
|
+
});
|
|
131
|
+
const sequenceClaims = createSequenceTargetClaims();
|
|
132
|
+
// Sequence playback borrows the private clock and authentic Scope authority.
|
|
133
|
+
this.#sequencePlaybackOwner = createSequencePlaybackOwner({
|
|
134
|
+
assertOpen: this.#context.assertOpen,
|
|
135
|
+
isEngineScope: (scope) => typeof scope === 'object' && scope !== null && this.#engineScopes.has(scope),
|
|
136
|
+
clock: this.#gameClockOwner.clock,
|
|
137
|
+
claims: sequenceClaims,
|
|
138
|
+
captureCleanup: this.#context.captureCleanup
|
|
139
|
+
});
|
|
140
|
+
this.#sequenceControllerOwner = registerSequenceControllerEngine(this, {
|
|
141
|
+
assertOpen: this.#context.assertOpen,
|
|
142
|
+
createScope: () => this.#createScope(),
|
|
143
|
+
clock: this.#gameClockOwner.clock,
|
|
144
|
+
isClockBusy: this.#gameClockOwner.isBusy,
|
|
145
|
+
claims: sequenceClaims,
|
|
146
|
+
report: this.#context.report,
|
|
147
|
+
captureCleanup: this.#context.captureCleanup
|
|
148
|
+
});
|
|
149
|
+
this.clock = this.#gameClockOwner.clock;
|
|
150
|
+
const stage = createStage(this.#context);
|
|
151
|
+
this.#uiOwner = registerUiEngine(this, {
|
|
152
|
+
stage,
|
|
153
|
+
assertOpen: this.#context.assertOpen,
|
|
154
|
+
isFrameBusy: () => this.frameBusy,
|
|
155
|
+
createScope: () => this.#createScope(),
|
|
156
|
+
report: this.#context.report,
|
|
157
|
+
captureCleanup: this.#context.captureCleanup
|
|
158
|
+
});
|
|
159
|
+
const rawInput = createDisplayInputOperations(stage);
|
|
160
|
+
const deliverInput = this.#uiOwner.deliver;
|
|
161
|
+
const inputOperations = Object.freeze({
|
|
162
|
+
pick: rawInput.pick,
|
|
163
|
+
isAttached: rawInput.isAttached,
|
|
164
|
+
dispatch: (...args) => deliverInput(() => rawInput.dispatch(...args))
|
|
165
|
+
});
|
|
166
|
+
// Capture original startup and Stage authority before publishing replaceable readonly fields.
|
|
167
|
+
this.#mouseInputOwner = createMouseInputOwner(this, {
|
|
168
|
+
surface,
|
|
169
|
+
operations: inputOperations,
|
|
170
|
+
assertOpen: this.#context.assertOpen,
|
|
171
|
+
report: this.#context.report,
|
|
172
|
+
captureCleanup: this.#context.captureCleanup
|
|
173
|
+
});
|
|
174
|
+
this.stage = stage;
|
|
175
|
+
this.#displaySubtreeTickets = createDisplaySubtreeTickets({
|
|
176
|
+
assertOpen: this.#context.assertOpen,
|
|
177
|
+
isEngineScope: (scope) => this.#engineScopes.has(scope),
|
|
178
|
+
isBusy: () => this.frameBusy || this.#gameClockOwner.isBusy()
|
|
179
|
+
}, preparedDisplayOperations);
|
|
180
|
+
this.assets = createAssetManager(this.#context);
|
|
181
|
+
this.#bitmapBindingOwner = createBitmapBindingOwner({
|
|
182
|
+
assertOpen: this.#context.assertOpen,
|
|
183
|
+
isEngineScope: (scope) => typeof scope === 'object' && scope !== null && this.#engineScopes.has(scope)
|
|
184
|
+
}, this.#bitmapResourceTargets);
|
|
185
|
+
// Authentic manager construction captured the operations before publication.
|
|
186
|
+
this.#bitmapResourceSlotOwner = createBitmapResourceSlotOwner({
|
|
187
|
+
assertOpen: this.#context.assertOpen,
|
|
188
|
+
isEngineScope: (scope) => typeof scope === 'object' && scope !== null && this.#engineScopes.has(scope),
|
|
189
|
+
report: this.#context.report,
|
|
190
|
+
captureCleanup: this.#context.captureCleanup
|
|
191
|
+
}, assetGroupOperations, this.#bitmapResourceTargets);
|
|
192
|
+
this.#assetGroupOwner = createAssetGroupOwner({
|
|
193
|
+
assertOpen: this.#context.assertOpen,
|
|
194
|
+
isEngineScope: (scope) => typeof scope === 'object' && scope !== null && this.#engineScopes.has(scope),
|
|
195
|
+
report: this.#context.report,
|
|
196
|
+
captureCleanup: this.#context.captureCleanup
|
|
197
|
+
}, assetGroupOperations);
|
|
198
|
+
this.#manifestAssetGroupOwner = createManifestAssetGroupOwner({
|
|
199
|
+
assertOpen: this.#context.assertOpen,
|
|
200
|
+
isEngineScope: (scope) => typeof scope === 'object' && scope !== null && this.#engineScopes.has(scope),
|
|
201
|
+
report: this.#context.report,
|
|
202
|
+
captureCleanup: this.#context.captureCleanup
|
|
203
|
+
}, assetGroupOperations);
|
|
204
|
+
const assets = this.assets;
|
|
205
|
+
const register = assets.register;
|
|
206
|
+
registerContentEngine(this, {
|
|
207
|
+
assertOpen,
|
|
208
|
+
isScope: (scope) => typeof scope === 'object' && scope !== null && this.#engineScopes.has(scope),
|
|
209
|
+
register: (type, provider) => {
|
|
210
|
+
Reflect.apply(register, assets, [type, provider]);
|
|
211
|
+
},
|
|
212
|
+
group: (scope, manifest, roots, bindings, options) => this.#manifestAssetGroupOwner.create(scope, manifest, roots, bindings, options),
|
|
213
|
+
own: (dispose) => {
|
|
214
|
+
assertOpen();
|
|
215
|
+
this.#contentLoaders.add(dispose);
|
|
216
|
+
return () => {
|
|
217
|
+
this.#contentLoaders.delete(dispose);
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
static {
|
|
223
|
+
constructEngine = (options, timeoutMs, surface, releaseSurface, ports, clockOptions) => new Engine(options, timeoutMs, surface, releaseSurface, ports, clockOptions, CREATION_TOKEN);
|
|
224
|
+
}
|
|
225
|
+
advanceTime(sourceSeconds) {
|
|
226
|
+
return this.#gameClockOwner.advance(sourceSeconds);
|
|
227
|
+
}
|
|
228
|
+
captureSharedFrame(options) {
|
|
229
|
+
return this.executeSharedFrame(options, false);
|
|
230
|
+
}
|
|
231
|
+
/** Capture a prepared binding view without publishing it to the live scene. */
|
|
232
|
+
capturePreparedSharedFrame(ticket, options) {
|
|
233
|
+
return this.executeSharedFrame(options, false, [ticket]);
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Prepare one borrowed detached root as the target container's new sole child.
|
|
237
|
+
* Uses authenticated already-bound private state, not fresh subclass hooks/getters.
|
|
238
|
+
* Run application semantic guards before preparation; Scope ownership is not their approval.
|
|
239
|
+
*/
|
|
240
|
+
prepareDisplaySubtree(scope, target, candidate) {
|
|
241
|
+
return this.#displaySubtreeTickets.prepare(scope, target, candidate);
|
|
242
|
+
}
|
|
243
|
+
/** Immutable candidate snapshot; the live Stage remains unchanged. */
|
|
244
|
+
capturePreparedDisplaySharedFrame(ticket, options) {
|
|
245
|
+
return this.executeSharedFrame(options, false, undefined, [ticket]);
|
|
246
|
+
}
|
|
247
|
+
renderSharedFrame(options) {
|
|
248
|
+
return this.executeSharedFrame(options, true);
|
|
249
|
+
}
|
|
250
|
+
/** Busy precedes all external reads; cleanup waits for the finally barrier. */
|
|
251
|
+
executeSharedFrame(options, render, candidate, displayCandidate) {
|
|
252
|
+
this.#context.assertOpen();
|
|
253
|
+
if (this.frameBusy)
|
|
254
|
+
throw new EgretError('FRAME_REENTRANT');
|
|
255
|
+
if (this.#gameClockOwner.isBusy())
|
|
256
|
+
throw new EgretError('CLOCK_REENTRANT');
|
|
257
|
+
this.frameBusy = true;
|
|
258
|
+
this.frameIdle = new Promise(resolve => {
|
|
259
|
+
this.releaseFrame = resolve;
|
|
260
|
+
});
|
|
261
|
+
try {
|
|
262
|
+
const renderer = this.sharedRenderer;
|
|
263
|
+
if (render && renderer === undefined)
|
|
264
|
+
throw new EgretError('RENDERER_REQUIRED');
|
|
265
|
+
const prepared = displayCandidate !== undefined
|
|
266
|
+
? this.#displaySubtreeTickets.read(displayCandidate[0])
|
|
267
|
+
: candidate === undefined
|
|
268
|
+
? undefined
|
|
269
|
+
: this.#bitmapBindingOwner.readPreparedForCapture(candidate[0]);
|
|
270
|
+
let width, height, colorInput, alphaInput, outputInput;
|
|
271
|
+
let optionsFailed = false, optionsCause;
|
|
272
|
+
try {
|
|
273
|
+
width = options.width;
|
|
274
|
+
height = options.height;
|
|
275
|
+
colorInput = options.clearColor;
|
|
276
|
+
alphaInput = options.clearAlpha;
|
|
277
|
+
outputInput = options.outputAlpha;
|
|
278
|
+
}
|
|
279
|
+
catch (cause) {
|
|
280
|
+
// Even a caller-thrown EgretError is an external read failure here.
|
|
281
|
+
if (prepared === undefined)
|
|
282
|
+
throw new EgretError('INVALID_FRAME_OPTIONS', { cause });
|
|
283
|
+
optionsFailed = true;
|
|
284
|
+
optionsCause = cause;
|
|
285
|
+
}
|
|
286
|
+
// Candidate lifetime/phase wins even when an option getter threw undefined.
|
|
287
|
+
// Binding, target and entitlement preflight waits for valid options below.
|
|
288
|
+
prepared?.validate();
|
|
289
|
+
if (optionsFailed)
|
|
290
|
+
throw new EgretError('INVALID_FRAME_OPTIONS', { cause: optionsCause });
|
|
291
|
+
const outputAlpha = outputInput === undefined ? 'premultiplied' : outputInput;
|
|
292
|
+
const clearColor = colorInput === undefined ? 0 : colorInput;
|
|
293
|
+
const clearAlpha = alphaInput === undefined ? (outputAlpha === 'opaque' ? 1 : 0) : alphaInput;
|
|
294
|
+
if (typeof width !== 'number' ||
|
|
295
|
+
!Number.isFinite(width) ||
|
|
296
|
+
width <= 0 ||
|
|
297
|
+
typeof height !== 'number' ||
|
|
298
|
+
!Number.isFinite(height) ||
|
|
299
|
+
height <= 0 ||
|
|
300
|
+
typeof clearColor !== 'number' ||
|
|
301
|
+
!Number.isInteger(clearColor) ||
|
|
302
|
+
clearColor < 0 ||
|
|
303
|
+
clearColor > 0xffffff ||
|
|
304
|
+
typeof clearAlpha !== 'number' ||
|
|
305
|
+
!Number.isFinite(clearAlpha) ||
|
|
306
|
+
clearAlpha < 0 ||
|
|
307
|
+
clearAlpha > 1 ||
|
|
308
|
+
(outputAlpha !== 'opaque' && outputAlpha !== 'premultiplied') ||
|
|
309
|
+
(outputAlpha === 'opaque' && clearAlpha !== 1))
|
|
310
|
+
throw new EgretError('INVALID_FRAME_OPTIONS');
|
|
311
|
+
this.#context.assertOpen();
|
|
312
|
+
const content = prepared === undefined ? collectSharedFrameContent(this.stage) : prepared.captureContent(this.stage);
|
|
313
|
+
this.#context.assertOpen();
|
|
314
|
+
prepared?.validate();
|
|
315
|
+
if (!Number.isSafeInteger(this.nextFrameId) || this.nextFrameId <= 0)
|
|
316
|
+
throw new EgretError('FRAME_ID_EXHAUSTED');
|
|
317
|
+
const frame = freezeSharedFrame({
|
|
318
|
+
profile: SHARED_FRAME_PROFILE_2D,
|
|
319
|
+
...(this.#sharedBlendSpace === 'srgb'
|
|
320
|
+
? { colorRecipe: 'egret.srgb-pma/1', targetRepresentation: 'egret.encoded-srgb-pma8-target/1' }
|
|
321
|
+
: { colorRecipe: 'egret.linear-srgb-pma/1', targetRepresentation: 'egret.srgb-pma8-target/1' }),
|
|
322
|
+
outputRepresentation: outputAlpha === 'opaque' ? 'egret.srgb-opaque-unorm8/1' : 'egret.srgb-premultiplied-unorm8/1',
|
|
323
|
+
frameId: this.nextFrameId,
|
|
324
|
+
width,
|
|
325
|
+
height,
|
|
326
|
+
clearColor,
|
|
327
|
+
clearAlpha,
|
|
328
|
+
outputAlpha,
|
|
329
|
+
...content
|
|
330
|
+
});
|
|
331
|
+
registerSharedFrame(frame);
|
|
332
|
+
this.nextFrameId++;
|
|
333
|
+
if (render) {
|
|
334
|
+
try {
|
|
335
|
+
const result = Reflect.apply(renderer, this.host, [frame]);
|
|
336
|
+
if (result !== undefined) {
|
|
337
|
+
observeRejectedRenderResult(result);
|
|
338
|
+
throw new EgretError('INVALID_RENDERER');
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
catch (cause) {
|
|
342
|
+
this.#context.report({ code: 'FRAME_RENDER_FAILED', phase: 'graphics', severity: 'error', cause });
|
|
343
|
+
throw new EgretError('FRAME_RENDER_FAILED', { cause });
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
return frame;
|
|
347
|
+
}
|
|
348
|
+
finally {
|
|
349
|
+
this.frameBusy = false;
|
|
350
|
+
const release = this.releaseFrame;
|
|
351
|
+
this.releaseFrame = undefined;
|
|
352
|
+
this.frameIdle = undefined;
|
|
353
|
+
release?.();
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
createScope() {
|
|
357
|
+
return this.#createScope();
|
|
358
|
+
}
|
|
359
|
+
#createScope() {
|
|
360
|
+
this.#context.assertOpen();
|
|
361
|
+
const scope = createScope(this.#context, (closed) => {
|
|
362
|
+
this.scopes.delete(closed);
|
|
363
|
+
});
|
|
364
|
+
this.scopes.add(scope);
|
|
365
|
+
this.#engineScopes.add(scope);
|
|
366
|
+
this.#sequenceControllerOwner.registerScope(scope);
|
|
367
|
+
this.#mouseInputOwner.registerScope(scope);
|
|
368
|
+
this.#uiOwner.registerScope(scope);
|
|
369
|
+
return scope;
|
|
370
|
+
}
|
|
371
|
+
createTween(scope, options) {
|
|
372
|
+
return this.#tweenOwner.create(scope, options);
|
|
373
|
+
}
|
|
374
|
+
/** Create an idle, Scope-owned sequence controller without rendering or ticking. */
|
|
375
|
+
createSequencePlayback(scope, bitmap, clip, options) {
|
|
376
|
+
return this.#sequencePlaybackOwner.create(scope, bitmap, clip, options);
|
|
377
|
+
}
|
|
378
|
+
/** Preserve the current image while an explicitly requested replacement loads. */
|
|
379
|
+
createBitmapResourceSlot(scope, bitmap) {
|
|
380
|
+
return this.#bitmapResourceSlotOwner.create(scope, bitmap);
|
|
381
|
+
}
|
|
382
|
+
/** Capture exact Bitmap bindings before asynchronously preparing a borrowed group. */
|
|
383
|
+
captureBitmapBindings(scope, targets) {
|
|
384
|
+
return this.#bitmapBindingOwner.capture(scope, targets);
|
|
385
|
+
}
|
|
386
|
+
createAssetGroup(scope, refs, options) {
|
|
387
|
+
return this.#assetGroupOwner.create(scope, refs, options);
|
|
388
|
+
}
|
|
389
|
+
/** Acquire an admitted dependency closure with independent group-owned leases. */
|
|
390
|
+
createManifestGroup(scope, manifest, roots, bindings, options) {
|
|
391
|
+
return this.#manifestAssetGroupOwner.create(scope, manifest, roots, bindings, options);
|
|
392
|
+
}
|
|
393
|
+
/** Every caller shares one close promise, including reentrant cleanup callbacks. */
|
|
394
|
+
dispose() {
|
|
395
|
+
if (this.closePromise !== undefined)
|
|
396
|
+
return this.closePromise;
|
|
397
|
+
let resolveClose = () => { };
|
|
398
|
+
let rejectClose = () => { };
|
|
399
|
+
this.closePromise = new Promise((resolve, reject) => {
|
|
400
|
+
resolveClose = resolve;
|
|
401
|
+
rejectClose = reject;
|
|
402
|
+
});
|
|
403
|
+
// Cache the result before abort/cleanup/diagnostic callbacks can reenter.
|
|
404
|
+
this.#currentState = 'closing';
|
|
405
|
+
// Revoke content wrappers before manifest leases and callback-capable cleanup.
|
|
406
|
+
for (const dispose of [...this.#contentLoaders])
|
|
407
|
+
dispose();
|
|
408
|
+
// Detach managed UI before input and ordinary Scope/Stage cleanup.
|
|
409
|
+
this.#uiOwner.close();
|
|
410
|
+
// Revoke every manifest group before cleanup callbacks can reenter.
|
|
411
|
+
this.#manifestAssetGroupOwner.close();
|
|
412
|
+
this.#bitmapBindingOwner.close();
|
|
413
|
+
this.#bitmapResourceSlotOwner.close();
|
|
414
|
+
// Retire browser input before the remaining callback-capable owners or idle wait.
|
|
415
|
+
this.#mouseInputOwner.close();
|
|
416
|
+
// Terminal observations change now, before the existing idle barriers wait.
|
|
417
|
+
this.#assetGroupOwner.close();
|
|
418
|
+
this.#tweenOwner.close();
|
|
419
|
+
this.#sequenceControllerOwner.close();
|
|
420
|
+
this.#sequencePlaybackOwner.close();
|
|
421
|
+
this.#gameClockOwner.close();
|
|
422
|
+
void this.runClose().then(resolveClose, rejectClose);
|
|
423
|
+
return this.closePromise;
|
|
424
|
+
}
|
|
425
|
+
// Scope and Stage cleanup precede CPU assets, stop and asynchronous host close.
|
|
426
|
+
async runClose() {
|
|
427
|
+
try {
|
|
428
|
+
if (this.frameIdle !== undefined)
|
|
429
|
+
await this.frameIdle;
|
|
430
|
+
if (this.#gameClockOwner.isBusy())
|
|
431
|
+
await this.#gameClockOwner.whenIdle();
|
|
432
|
+
for (const scope of [...this.scopes].reverse()) {
|
|
433
|
+
try {
|
|
434
|
+
scope.dispose();
|
|
435
|
+
}
|
|
436
|
+
catch (cause) {
|
|
437
|
+
this.cleanupErrors.push(cause);
|
|
438
|
+
this.#context.report({ code: 'ENGINE_SCOPE_CLEANUP_FAILED', phase: 'engine', severity: 'error', cause });
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
try {
|
|
442
|
+
this.stage.dispose();
|
|
443
|
+
}
|
|
444
|
+
catch (cause) {
|
|
445
|
+
this.cleanupErrors.push(cause);
|
|
446
|
+
this.#context.report({ code: 'ENGINE_STAGE_CLEANUP_FAILED', phase: 'engine', severity: 'error', cause });
|
|
447
|
+
}
|
|
448
|
+
try {
|
|
449
|
+
this.assets.dispose();
|
|
450
|
+
}
|
|
451
|
+
catch (cause) {
|
|
452
|
+
this.cleanupErrors.push(cause);
|
|
453
|
+
this.#context.report({ code: 'ENGINE_ASSETS_CLEANUP_FAILED', phase: 'assets', severity: 'error', cause });
|
|
454
|
+
}
|
|
455
|
+
try {
|
|
456
|
+
this.host.stop?.();
|
|
457
|
+
}
|
|
458
|
+
catch (cause) {
|
|
459
|
+
this.cleanupErrors.push(cause);
|
|
460
|
+
this.#context.report({ code: 'HOST_STOP_FAILED', phase: 'engine', severity: 'error', cause });
|
|
461
|
+
}
|
|
462
|
+
await closeHost(this.host, this.timeoutMs, this.releaseSurface, this.cleanupErrors, this.onDiagnostic);
|
|
463
|
+
}
|
|
464
|
+
finally {
|
|
465
|
+
this.#currentState = 'closed';
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
//# sourceMappingURL=Engine.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Optional owned sequence controls share the Engine clock without loading into the default entry. */
|
|
2
|
+
export { createSequenceController } from './sequenceController.js';
|
|
3
|
+
export type { SequenceMarker, SequenceControllerOptions, SequenceControllerState, SequenceEventSource, SequenceControllerEvent, SequenceSeekRequest, SequenceControllerStatus, SequenceController } from './types.js';
|
|
4
|
+
export { createSequenceResetSlot } from './sequenceResetSlot.js';
|
|
5
|
+
export type { SequenceResetInitial, SequenceResetActive, SequenceResetRequest, SequenceResetState, SequenceResetTicket, SequenceResetSlot } from './sequenceResetTypes.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/** Optional owned sequence controls share the Engine clock without loading into the default entry. */
|
|
3
|
+
export { createSequenceController } from './sequenceController.js';
|
|
4
|
+
export { createSequenceResetSlot } from './sequenceResetSlot.js';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Bitmap, Scope, SequenceClip } from '@egret/runtime';
|
|
2
|
+
import type { Engine } from '../Engine.js';
|
|
3
|
+
import type { SequenceControllerEnginePort } from '../internal/sequenceControllerFactoryState.js';
|
|
4
|
+
import type { SequenceController, SequenceControllerOptions } from './types.js';
|
|
5
|
+
/** Optional assembly only: authenticate the exact Engine, original controller and Bitmap. */
|
|
6
|
+
export declare function requireResetController(value: unknown, port: SequenceControllerEnginePort, bitmap: Bitmap): () => object;
|
|
7
|
+
/** Reserve the replacement pause revision before synchronous event delivery can reenter the slot. */
|
|
8
|
+
export declare function pauseSequenceForReplacement(value: SequenceController, port: SequenceControllerEnginePort, bitmap: Bitmap, revision: object): void;
|
|
9
|
+
export declare function requireSequencePreserveSource(value: SequenceController, port: SequenceControllerEnginePort, bitmap: Bitmap): {
|
|
10
|
+
clip: SequenceClip;
|
|
11
|
+
totalPlays: number | 'infinite';
|
|
12
|
+
markers: readonly {
|
|
13
|
+
readonly id: string;
|
|
14
|
+
readonly timeSeconds: number;
|
|
15
|
+
readonly markerIndex: number;
|
|
16
|
+
}[];
|
|
17
|
+
};
|
|
18
|
+
/** Stage an event-free successor at the paused source position. The slot has checked both timelines. */
|
|
19
|
+
export declare function stageSequencePreserve(port: SequenceControllerEnginePort, from: SequenceController, fromBitmap: Bitmap, to: SequenceController, toBitmap: Bitmap, running: boolean): () => void;
|
|
20
|
+
/** Opt-in sequence controls share Engine ownership but never create a second timer. */
|
|
21
|
+
export declare function createSequenceController(engine: Engine, scope: Scope, bitmap: Bitmap, clip: SequenceClip, options: SequenceControllerOptions): SequenceController;
|
|
22
|
+
//# sourceMappingURL=sequenceController.d.ts.map
|