@carbonenginejs/runtime 0.1.0-alpha.0 → 0.1.0-alpha.1
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/README.md +58 -125
- package/dist/audio/index.js +8 -1
- package/dist/audio/index.js.map +1 -1
- package/dist/audio/trinity/audio/AudActionLog/AudActionLogCB.js +84 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionLogCB.js.map +1 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecord.js +14 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecord.js.map +1 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordExecuteActionOnPlayingID.js +26 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordExecuteActionOnPlayingID.js.map +1 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordPostEvent.js +27 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordPostEvent.js.map +1 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordSetRTPC.js +27 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordSetRTPC.js.map +1 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordSetState.js +25 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordSetState.js.map +1 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordSetSwitch.js +26 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordSetSwitch.js.map +1 -0
- package/dist/audio/trinity/audio/AudActionLog/IAudActionLog.js +58 -0
- package/dist/audio/trinity/audio/AudActionLog/IAudActionLog.js.map +1 -0
- package/dist/audio/trinity/audio/AudManager.js +1 -1
- package/dist/audio/trinity/audio/AudManager.js.map +1 -1
- package/dist/audio/trinity/audio/{AudObstructionOcclusion.js → AudObstructionOcclusion/AudObstructionOcclusion.js} +8 -52
- package/dist/audio/trinity/audio/AudObstructionOcclusion/AudObstructionOcclusion.js.map +1 -0
- package/dist/audio/trinity/audio/AudObstructionOcclusion/EmitterState.js +17 -0
- package/dist/audio/trinity/audio/AudObstructionOcclusion/EmitterState.js.map +1 -0
- package/dist/audio/trinity/audio/AudObstructionOcclusion/FadingValue.js +46 -0
- package/dist/audio/trinity/audio/AudObstructionOcclusion/FadingValue.js.map +1 -0
- package/dist/audio/trinity/index.js +8 -1
- package/dist/audio/trinity/index.js.map +1 -1
- package/dist/character/CjsCharacterAppearanceConstruction.js +5 -0
- package/dist/character/CjsCharacterAppearanceConstruction.js.map +1 -1
- package/dist/character/CjsCharacterAppearanceManager.js +14 -0
- package/dist/character/CjsCharacterAppearanceManager.js.map +1 -1
- package/dist/character/CjsCharacterFoundationConstruction.js +5 -0
- package/dist/character/CjsCharacterFoundationConstruction.js.map +1 -1
- package/dist/character/CjsCharacterTexturePolicy.js +5 -0
- package/dist/character/CjsCharacterTexturePolicy.js.map +1 -1
- package/dist/character/gles/CjsCharacterGlesAppearanceAL.js +17 -0
- package/dist/character/gles/CjsCharacterGlesAppearanceAL.js.map +1 -1
- package/dist/character/gles/CjsCharacterGlesAtlasRenderer.js +2 -0
- package/dist/character/gles/CjsCharacterGlesAtlasRenderer.js.map +1 -1
- package/dist/character/gles/CjsCharacterGlesFoundationTranslator.js +5 -0
- package/dist/character/gles/CjsCharacterGlesFoundationTranslator.js.map +1 -1
- package/dist/character/gles/CjsCharacterGlesLegacyConstructionTranslator.js +5 -0
- package/dist/character/gles/CjsCharacterGlesLegacyConstructionTranslator.js.map +1 -1
- package/dist/character/gles/CjsCharacterGlesMorphDeformation.js +2 -0
- package/dist/character/gles/CjsCharacterGlesMorphDeformation.js.map +1 -1
- package/dist/character/gles/CjsCharacterGlesPaletteCompatibility.js +5 -0
- package/dist/character/gles/CjsCharacterGlesPaletteCompatibility.js.map +1 -1
- package/dist/character/gles/CjsCharacterGlesTriangleCoverage.js +5 -0
- package/dist/character/gles/CjsCharacterGlesTriangleCoverage.js.map +1 -1
- package/dist/character/webgl2/CjsCharacterWebgl2EffectRouter.js +9 -0
- package/dist/character/webgl2/CjsCharacterWebgl2EffectRouter.js.map +1 -1
- package/dist/global/blue/CjsScriptCallback.js +142 -0
- package/dist/global/blue/CjsScriptCallback.js.map +1 -0
- package/dist/global/blue/index.js +2 -0
- package/dist/global/blue/index.js.map +1 -0
- package/dist/global/consts/renderContext/formats.js +51 -1
- package/dist/global/consts/renderContext/formats.js.map +1 -1
- package/dist/global/consts/renderContext/index.js +2 -2
- package/dist/global/consts/renderContext/renderStates.js +16 -1
- package/dist/global/consts/renderContext/renderStates.js.map +1 -1
- package/dist/global/contracts/index.js +0 -1
- package/dist/global/contracts/index.js.map +1 -1
- package/dist/global/index.js +4 -3
- package/dist/global/index.js.map +1 -1
- package/dist/global/math/index.js +2 -0
- package/dist/global/math/index.js.map +1 -1
- package/dist/global/math/mesh.js +70 -16
- package/dist/global/math/mesh.js.map +1 -1
- package/dist/global/math/noise.js +47 -68
- package/dist/global/math/noise.js.map +1 -1
- package/dist/global/math/pool.js +18 -3
- package/dist/global/math/pool.js.map +1 -1
- package/dist/global/math/random.js +52 -0
- package/dist/global/math/random.js.map +1 -0
- package/dist/global/math/tri3.js +18 -4
- package/dist/global/math/tri3.js.map +1 -1
- package/dist/global/utils/bytes.js +22 -4
- package/dist/global/utils/bytes.js.map +1 -1
- package/dist/global/utils/checksum.js +80 -0
- package/dist/global/utils/checksum.js.map +1 -0
- package/dist/global/utils/errors/CjsCancellationError.js +36 -0
- package/dist/global/utils/errors/CjsCancellationError.js.map +1 -0
- package/dist/global/utils/errors/CjsError.js +21 -52
- package/dist/global/utils/errors/CjsError.js.map +1 -1
- package/dist/global/utils/errors/abort.js +1 -1
- package/dist/global/utils/errors/abort.js.map +1 -1
- package/dist/global/utils/errors/index.js +2 -1
- package/dist/global/utils/errors/index.js.map +1 -1
- package/dist/global/utils/index.js +4 -2
- package/dist/global/utils/index.js.map +1 -1
- package/dist/index.js +95 -35
- package/dist/index.js.map +1 -1
- package/dist/input/Tr2MainWindow.js +7 -9
- package/dist/input/Tr2MainWindow.js.map +1 -1
- package/dist/resource/CjsResMan.js +33 -39
- package/dist/resource/CjsResMan.js.map +1 -1
- package/dist/resource/CjsResource.js +19 -5
- package/dist/resource/CjsResource.js.map +1 -1
- package/dist/resource/audio/AudioGeometryResData.js +22 -27
- package/dist/resource/audio/AudioGeometryResData.js.map +1 -1
- package/dist/resource/audio/CjsAudioRes.js +4 -5
- package/dist/resource/audio/CjsAudioRes.js.map +1 -1
- package/dist/resource/format/CjsBitReader.js +263 -0
- package/dist/resource/format/CjsBitReader.js.map +1 -0
- package/dist/resource/format/CjsByteReader.js +130 -125
- package/dist/resource/format/CjsByteReader.js.map +1 -1
- package/dist/resource/format/CjsFormat.js +11 -4
- package/dist/resource/format/CjsFormat.js.map +1 -1
- package/dist/resource/format/CjsFormatError.js +37 -1
- package/dist/resource/format/CjsFormatError.js.map +1 -1
- package/dist/resource/format/CjsResourceProbe.js +41 -37
- package/dist/resource/format/CjsResourceProbe.js.map +1 -1
- package/dist/resource/format/carbonRecordGuard.js +33 -0
- package/dist/resource/format/carbonRecordGuard.js.map +1 -0
- package/dist/resource/format/imageSignatures.js +202 -0
- package/dist/resource/format/imageSignatures.js.map +1 -0
- package/dist/resource/format/index.js +2 -1
- package/dist/resource/format/index.js.map +1 -1
- package/dist/resource/format/jsonPolicies.js +180 -0
- package/dist/resource/format/jsonPolicies.js.map +1 -0
- package/dist/resource/formats/black/core/helpers.js +18 -29
- package/dist/resource/formats/black/core/helpers.js.map +1 -1
- package/dist/resource/formats/bnk/CjsBnkFormat.js +4 -3
- package/dist/resource/formats/bnk/CjsBnkFormat.js.map +1 -1
- package/dist/resource/formats/bnk/core/WwiseCursor.js +218 -0
- package/dist/resource/formats/bnk/core/WwiseCursor.js.map +1 -0
- package/dist/resource/formats/bnk/core/busNodes.js +2 -1
- package/dist/resource/formats/bnk/core/busNodes.js.map +1 -1
- package/dist/resource/formats/bnk/core/effectNodes.js +2 -1
- package/dist/resource/formats/bnk/core/effectNodes.js.map +1 -1
- package/dist/resource/formats/bnk/core/eventAction.js +15 -93
- package/dist/resource/formats/bnk/core/eventAction.js.map +1 -1
- package/dist/resource/formats/bnk/core/globalSettings.js +19 -94
- package/dist/resource/formats/bnk/core/globalSettings.js.map +1 -1
- package/dist/resource/formats/bnk/core/helpers.js +2 -48
- package/dist/resource/formats/bnk/core/helpers.js.map +1 -1
- package/dist/resource/formats/bnk/core/musicNodes.js +42 -134
- package/dist/resource/formats/bnk/core/musicNodes.js.map +1 -1
- package/dist/resource/formats/bnk/core/nodeBase.js +20 -111
- package/dist/resource/formats/bnk/core/nodeBase.js.map +1 -1
- package/dist/resource/formats/bnk/core/sfxNodes.js +2 -1
- package/dist/resource/formats/bnk/core/sfxNodes.js.map +1 -1
- package/dist/resource/formats/cmf/CjsCmfFormat.js +242 -228
- package/dist/resource/formats/cmf/CjsCmfFormat.js.map +1 -1
- package/dist/resource/formats/cmf/core/binary.js +54 -60
- package/dist/resource/formats/cmf/core/binary.js.map +1 -1
- package/dist/resource/formats/dds/CjsDdsFormat.js +5 -3
- package/dist/resource/formats/dds/CjsDdsFormat.js.map +1 -1
- package/dist/resource/formats/dds/core/bc6h.js +16 -18
- package/dist/resource/formats/dds/core/bc6h.js.map +1 -1
- package/dist/resource/formats/dds/core/bc7.js +28 -24
- package/dist/resource/formats/dds/core/bc7.js.map +1 -1
- package/dist/resource/formats/dds/core/helpers.js +7 -133
- package/dist/resource/formats/dds/core/helpers.js.map +1 -1
- package/dist/resource/formats/dxbc/CjsDxbcFormat.js +3 -2
- package/dist/resource/formats/dxbc/CjsDxbcFormat.js.map +1 -1
- package/dist/resource/formats/dxbc/core/helpers.js +4 -32
- package/dist/resource/formats/dxbc/core/helpers.js.map +1 -1
- package/dist/resource/formats/fbx/CjsFbxFormat.js +11 -0
- package/dist/resource/formats/fbx/CjsFbxFormat.js.map +1 -1
- package/dist/resource/formats/fbx/core/helpers.js +18 -12
- package/dist/resource/formats/fbx/core/helpers.js.map +1 -1
- package/dist/resource/formats/flac/CjsFlacFormat.js +4 -9
- package/dist/resource/formats/flac/CjsFlacFormat.js.map +1 -1
- package/dist/resource/formats/flac/core/helpers.js +1 -62
- package/dist/resource/formats/flac/core/helpers.js.map +1 -1
- package/dist/resource/formats/gif/CjsGifFormat.js +4 -9
- package/dist/resource/formats/gif/CjsGifFormat.js.map +1 -1
- package/dist/resource/formats/gif/core/helpers.js +1 -63
- package/dist/resource/formats/gif/core/helpers.js.map +1 -1
- package/dist/resource/formats/gltf/CjsGltfFormat.js +4 -3
- package/dist/resource/formats/gltf/CjsGltfFormat.js.map +1 -1
- package/dist/resource/formats/gltf/core/helpers.js +3 -19
- package/dist/resource/formats/gltf/core/helpers.js.map +1 -1
- package/dist/resource/formats/gr2/CjsGr2Format.js +105 -92
- package/dist/resource/formats/gr2/CjsGr2Format.js.map +1 -1
- package/dist/resource/formats/gr2/core/container.js +1 -10
- package/dist/resource/formats/gr2/core/container.js.map +1 -1
- package/dist/resource/formats/gr2/core/helpers.js +24 -35
- package/dist/resource/formats/gr2/core/helpers.js.map +1 -1
- package/dist/resource/formats/gr2/core/shared.js +193 -189
- package/dist/resource/formats/gr2/core/shared.js.map +1 -1
- package/dist/resource/formats/hlsl/CjsHlslFormat.js +4 -3
- package/dist/resource/formats/hlsl/CjsHlslFormat.js.map +1 -1
- package/dist/resource/formats/hlsl/core/helpers.js +1 -30
- package/dist/resource/formats/hlsl/core/helpers.js.map +1 -1
- package/dist/resource/formats/jpeg/CjsJpegFormat.js +5 -3
- package/dist/resource/formats/jpeg/CjsJpegFormat.js.map +1 -1
- package/dist/resource/formats/jpeg/core/helpers.js +7 -134
- package/dist/resource/formats/jpeg/core/helpers.js.map +1 -1
- package/dist/resource/formats/mp3/CjsMp3Format.js +4 -9
- package/dist/resource/formats/mp3/CjsMp3Format.js.map +1 -1
- package/dist/resource/formats/mp3/core/helpers.js +1 -64
- package/dist/resource/formats/mp3/core/helpers.js.map +1 -1
- package/dist/resource/formats/mp4/CjsMp4Format.js +4 -9
- package/dist/resource/formats/mp4/CjsMp4Format.js.map +1 -1
- package/dist/resource/formats/mp4/core/helpers.js +1 -73
- package/dist/resource/formats/mp4/core/helpers.js.map +1 -1
- package/dist/resource/formats/obj/CjsObjFormat.js +4 -3
- package/dist/resource/formats/obj/CjsObjFormat.js.map +1 -1
- package/dist/resource/formats/obj/core/helpers.js +93 -115
- package/dist/resource/formats/obj/core/helpers.js.map +1 -1
- package/dist/resource/formats/ogg/CjsOggFormat.js +4 -3
- package/dist/resource/formats/ogg/CjsOggFormat.js.map +1 -1
- package/dist/resource/formats/ogg/core/helpers.js +1 -15
- package/dist/resource/formats/ogg/core/helpers.js.map +1 -1
- package/dist/resource/formats/ogg/core/vorbis.js +138 -144
- package/dist/resource/formats/ogg/core/vorbis.js.map +1 -1
- package/dist/resource/formats/pickle/CjsPickleFormat.js +83 -114
- package/dist/resource/formats/pickle/CjsPickleFormat.js.map +1 -1
- package/dist/resource/formats/png/CjsPngFormat.js +5 -3
- package/dist/resource/formats/png/CjsPngFormat.js.map +1 -1
- package/dist/resource/formats/png/core/helpers.js +13 -152
- package/dist/resource/formats/png/core/helpers.js.map +1 -1
- package/dist/resource/formats/png/core/writer.js +3 -27
- package/dist/resource/formats/png/core/writer.js.map +1 -1
- package/dist/resource/formats/red/core/helpers.js +19 -29
- package/dist/resource/formats/red/core/helpers.js.map +1 -1
- package/dist/resource/formats/stl/CjsStlFormat.js +158 -147
- package/dist/resource/formats/stl/CjsStlFormat.js.map +1 -1
- package/dist/resource/formats/stl/core/helpers.js +44 -66
- package/dist/resource/formats/stl/core/helpers.js.map +1 -1
- package/dist/resource/formats/tga/CjsTgaFormat.js +5 -3
- package/dist/resource/formats/tga/CjsTgaFormat.js.map +1 -1
- package/dist/resource/formats/tga/core/helpers.js +7 -153
- package/dist/resource/formats/tga/core/helpers.js.map +1 -1
- package/dist/resource/formats/vta/CjsVtaFormat.js +4 -3
- package/dist/resource/formats/vta/CjsVtaFormat.js.map +1 -1
- package/dist/resource/formats/vta/core/helpers.js +1 -17
- package/dist/resource/formats/vta/core/helpers.js.map +1 -1
- package/dist/resource/formats/wav/CjsWavFormat.js +4 -3
- package/dist/resource/formats/wav/CjsWavFormat.js.map +1 -1
- package/dist/resource/formats/wav/core/helpers.js +1 -15
- package/dist/resource/formats/wav/core/helpers.js.map +1 -1
- package/dist/resource/formats/webgl/CjsWebglFormat.js +4 -3
- package/dist/resource/formats/webgl/CjsWebglFormat.js.map +1 -1
- package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js +52 -4
- package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -1
- package/dist/resource/formats/webgl/core/helpers.js +39 -68
- package/dist/resource/formats/webgl/core/helpers.js.map +1 -1
- package/dist/resource/formats/webgpu/CjsWebgpuFormat.js +4 -3
- package/dist/resource/formats/webgpu/CjsWebgpuFormat.js.map +1 -1
- package/dist/resource/formats/webgpu/core/helpers.js +4 -30
- package/dist/resource/formats/webgpu/core/helpers.js.map +1 -1
- package/dist/resource/formats/webm/CjsWebmFormat.js +4 -9
- package/dist/resource/formats/webm/CjsWebmFormat.js.map +1 -1
- package/dist/resource/formats/webm/core/helpers.js +1 -73
- package/dist/resource/formats/webm/core/helpers.js.map +1 -1
- package/dist/resource/formats/webp/CjsWebpFormat.js +4 -9
- package/dist/resource/formats/webp/CjsWebpFormat.js.map +1 -1
- package/dist/resource/formats/webp/core/helpers.js +1 -62
- package/dist/resource/formats/webp/core/helpers.js.map +1 -1
- package/dist/resource/formats/wem/CjsWemFormat.js +4 -3
- package/dist/resource/formats/wem/CjsWemFormat.js.map +1 -1
- package/dist/resource/formats/wem/core/bitStream.js +83 -106
- package/dist/resource/formats/wem/core/bitStream.js.map +1 -1
- package/dist/resource/formats/wem/core/codebookLibrary.js +52 -52
- package/dist/resource/formats/wem/core/codebookLibrary.js.map +1 -1
- package/dist/resource/formats/wem/core/helpers.js +1 -15
- package/dist/resource/formats/wem/core/helpers.js.map +1 -1
- package/dist/resource/formats/wem/core/wemToOgg.js +67 -67
- package/dist/resource/formats/wem/core/wemToOgg.js.map +1 -1
- package/dist/resource/geometry/MeshDecalData.js +23 -25
- package/dist/resource/geometry/MeshDecalData.js.map +1 -1
- package/dist/resource/geometry/MeshDecalLodData.js +14 -23
- package/dist/resource/geometry/MeshDecalLodData.js.map +1 -1
- package/dist/resource/geometry/TriGeometryRes.js +299 -284
- package/dist/resource/geometry/TriGeometryRes.js.map +1 -1
- package/dist/resource/geometry/TriGeometryResAreaData.js +30 -31
- package/dist/resource/geometry/TriGeometryResAreaData.js.map +1 -1
- package/dist/resource/geometry/TriGeometryResJointData.js +16 -24
- package/dist/resource/geometry/TriGeometryResJointData.js.map +1 -1
- package/dist/resource/geometry/TriGeometryResLodData.js +50 -41
- package/dist/resource/geometry/TriGeometryResLodData.js.map +1 -1
- package/dist/resource/geometry/TriGeometryResMeshData.js +32 -32
- package/dist/resource/geometry/TriGeometryResMeshData.js.map +1 -1
- package/dist/resource/geometry/TriGeometryResSkeletonData.js +14 -23
- package/dist/resource/geometry/TriGeometryResSkeletonData.js.map +1 -1
- package/dist/resource/geometry/TriJointBinding.js +16 -24
- package/dist/resource/geometry/TriJointBinding.js.map +1 -1
- package/dist/resource/geometry/TriMorphTargetGeometryConstants.js +22 -27
- package/dist/resource/geometry/TriMorphTargetGeometryConstants.js.map +1 -1
- package/dist/resource/geometry/TriRtGeometryConstants.js +50 -41
- package/dist/resource/geometry/TriRtGeometryConstants.js.map +1 -1
- package/dist/resource/geometry/granny/GStateBindingCallbackData.js +12 -22
- package/dist/resource/geometry/granny/GStateBindingCallbackData.js.map +1 -1
- package/dist/resource/geometry/granny/Tr2GrannyIntersectionResult.js +30 -31
- package/dist/resource/geometry/granny/Tr2GrannyIntersectionResult.js.map +1 -1
- package/dist/resource/index.js +1 -1
- package/dist/resource/shader/reflection/Tr2EffectConstant.js +16 -17
- package/dist/resource/shader/reflection/Tr2EffectConstant.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectDescription.js +26 -28
- package/dist/resource/shader/reflection/Tr2EffectDescription.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectLibrary.js +24 -25
- package/dist/resource/shader/reflection/Tr2EffectLibrary.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js +21 -22
- package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectResource.js +25 -26
- package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectStageInput.js +69 -72
- package/dist/resource/shader/reflection/Tr2EffectStageInput.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectTechnique.js +17 -18
- package/dist/resource/shader/reflection/Tr2EffectTechnique.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2Pass.js +42 -43
- package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2RenderStateSetup.js +26 -5
- package/dist/resource/shader/reflection/Tr2RenderStateSetup.js.map +1 -1
- package/dist/resource/shader/reflection/carbonRecordFields.js +87 -90
- package/dist/resource/shader/reflection/carbonRecordFields.js.map +1 -1
- package/dist/resource/shader/sampler/Tr2SamplerSetup.js +32 -34
- package/dist/resource/shader/sampler/Tr2SamplerSetup.js.map +1 -1
- package/dist/resource/texture/CjsTextureArrayRes.js +1 -6
- package/dist/resource/texture/CjsTextureArrayRes.js.map +1 -1
- package/dist/resource/texture/Tr2TextureLodManager.js +35 -27
- package/dist/resource/texture/Tr2TextureLodManager.js.map +1 -1
- package/dist/resource/texture/Tr2TextureLodUpdateRequest.js +16 -24
- package/dist/resource/texture/Tr2TextureLodUpdateRequest.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePackChannel.js +16 -24
- package/dist/resource/texture/Tr2TexturePackChannel.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipeline.js +24 -20
- package/dist/resource/texture/Tr2TexturePipeline.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineParams.js +14 -23
- package/dist/resource/texture/Tr2TexturePipelineParams.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepCompress.js +18 -25
- package/dist/resource/texture/Tr2TexturePipelineStepCompress.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js +11 -16
- package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js +14 -23
- package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepLoad.js +12 -22
- package/dist/resource/texture/Tr2TexturePipelineStepLoad.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepPack.js +38 -26
- package/dist/resource/texture/Tr2TexturePipelineStepPack.js.map +1 -1
- package/dist/resource/worker/CjsResManMainThreadLoader.js +2 -5
- package/dist/resource/worker/CjsResManMainThreadLoader.js.map +1 -1
- package/dist/resource/worker/CjsResManWorkerLoader.js +6 -7
- package/dist/resource/worker/CjsResManWorkerLoader.js.map +1 -1
- package/dist/resource/worker/protocol.js +18 -1
- package/dist/resource/worker/protocol.js.map +1 -1
- package/dist/sof/EveSOF.js +2 -222
- package/dist/sof/EveSOF.js.map +1 -1
- package/dist/sof/SofDocumentBuilder.js +205 -0
- package/dist/sof/SofDocumentBuilder.js.map +1 -0
- package/dist/sof/faction/ErrSOFFactionColorSetTypeNotFound.js +16 -0
- package/dist/sof/faction/ErrSOFFactionColorSetTypeNotFound.js.map +1 -0
- package/dist/sof/faction/ErrSOFFactionColorSetTypeUnknown.js +16 -0
- package/dist/sof/faction/ErrSOFFactionColorSetTypeUnknown.js.map +1 -0
- package/dist/sof/faction/EveSOFDataFactionColorSet.js +3 -27
- package/dist/sof/faction/EveSOFDataFactionColorSet.js.map +1 -1
- package/dist/sof/faction/index.js +3 -1
- package/dist/sof/faction/index.js.map +1 -1
- package/dist/sof/generic/ErrSOFAreaShaderNotFound.js +18 -0
- package/dist/sof/generic/ErrSOFAreaShaderNotFound.js.map +1 -0
- package/dist/sof/generic/ErrSOFDecalShaderNotFound.js +18 -0
- package/dist/sof/generic/ErrSOFDecalShaderNotFound.js.map +1 -0
- package/dist/sof/generic/ErrSOFMaterialPrefixNotFound.js +21 -0
- package/dist/sof/generic/ErrSOFMaterialPrefixNotFound.js.map +1 -0
- package/dist/sof/generic/ErrSOFPatternMaterialPrefixNotFound.js +21 -0
- package/dist/sof/generic/ErrSOFPatternMaterialPrefixNotFound.js.map +1 -0
- package/dist/sof/generic/EveSOFDataGeneric.js +5 -69
- package/dist/sof/generic/EveSOFDataGeneric.js.map +1 -1
- package/dist/sof/generic/index.js +5 -1
- package/dist/sof/generic/index.js.map +1 -1
- package/dist/sof/index.js +23 -7
- package/dist/sof/index.js.map +1 -1
- package/dist/sof/pattern/ErrSOFProjectionNotFound.js +20 -0
- package/dist/sof/pattern/ErrSOFProjectionNotFound.js.map +1 -0
- package/dist/sof/pattern/EveSOFDataPattern.js +2 -17
- package/dist/sof/pattern/EveSOFDataPattern.js.map +1 -1
- package/dist/sof/pattern/index.js +2 -1
- package/dist/sof/pattern/index.js.map +1 -1
- package/dist/sof/shared/ErrSOFAreaTypeNotFound.js +16 -0
- package/dist/sof/shared/ErrSOFAreaTypeNotFound.js.map +1 -0
- package/dist/sof/shared/ErrSOFLogoSetTypeNotFound.js +16 -0
- package/dist/sof/shared/ErrSOFLogoSetTypeNotFound.js.map +1 -0
- package/dist/sof/shared/ErrSOFLogoSetTypeUnknown.js +16 -0
- package/dist/sof/shared/ErrSOFLogoSetTypeUnknown.js.map +1 -0
- package/dist/sof/shared/EveSOFDataArea.js +2 -13
- package/dist/sof/shared/EveSOFDataArea.js.map +1 -1
- package/dist/sof/shared/EveSOFDataLogoSet.js +3 -27
- package/dist/sof/shared/EveSOFDataLogoSet.js.map +1 -1
- package/dist/sof/shared/EveSOFDataParameter.js +2 -146
- package/dist/sof/shared/EveSOFDataParameter.js.map +1 -1
- package/dist/sof/shared/EveSOFDataParameterBool.js +40 -0
- package/dist/sof/shared/EveSOFDataParameterBool.js.map +1 -0
- package/dist/sof/shared/EveSOFDataParameterColor.js +36 -0
- package/dist/sof/shared/EveSOFDataParameterColor.js.map +1 -0
- package/dist/sof/shared/EveSOFDataParameterFloat.js +37 -0
- package/dist/sof/shared/EveSOFDataParameterFloat.js.map +1 -0
- package/dist/sof/shared/EveSOFDataParameterInt.js +37 -0
- package/dist/sof/shared/EveSOFDataParameterInt.js.map +1 -0
- package/dist/sof/shared/EveSOFDataParameterVector2.js +37 -0
- package/dist/sof/shared/EveSOFDataParameterVector2.js.map +1 -0
- package/dist/sof/shared/EveSOFDataParameterVector3.js +37 -0
- package/dist/sof/shared/EveSOFDataParameterVector3.js.map +1 -0
- package/dist/sof/shared/{EveSOFDataSpotlightAttachment.js → EveSOFDataSpotLightAttachment.js} +1 -1
- package/dist/sof/shared/{EveSOFDataSpotlightAttachment.js.map → EveSOFDataSpotLightAttachment.js.map} +1 -1
- package/dist/sof/shared/index.js +13 -4
- package/dist/sof/shared/index.js.map +1 -1
- package/dist/sof/sofDocumentValues.js +33 -0
- package/dist/sof/sofDocumentValues.js.map +1 -0
- package/dist/trinity/controllers/ITr2Controller/ITr2ActionController.js +168 -0
- package/dist/trinity/controllers/ITr2Controller/ITr2ActionController.js.map +1 -0
- package/dist/trinity/controllers/{ITr2Controller.js → ITr2Controller/ITr2Controller.js} +2 -134
- package/dist/trinity/controllers/ITr2Controller/ITr2Controller.js.map +1 -0
- package/dist/trinity/controllers/Tr2Controller.js +2 -1
- package/dist/trinity/controllers/Tr2Controller.js.map +1 -1
- package/dist/trinity/controllers/Tr2ControllerReference.js +2 -1
- package/dist/trinity/controllers/Tr2ControllerReference.js.map +1 -1
- package/dist/trinity/controllers/action/ITr2ControllerAction.js +2 -1
- package/dist/trinity/controllers/action/ITr2ControllerAction.js.map +1 -1
- package/dist/trinity/controllers/action/Tr2ActionSpawnParticles.js +10 -9
- package/dist/trinity/controllers/action/Tr2ActionSpawnParticles.js.map +1 -1
- package/dist/trinity/controllers/expression/CjsControllerExpressionCompileError.js +26 -0
- package/dist/trinity/controllers/expression/CjsControllerExpressionCompileError.js.map +1 -0
- package/dist/trinity/controllers/expression/CjsControllerExpressionEvaluateError.js +24 -0
- package/dist/trinity/controllers/expression/CjsControllerExpressionEvaluateError.js.map +1 -0
- package/dist/trinity/controllers/expression/CjsControllerExpressionParser.js +387 -0
- package/dist/trinity/controllers/expression/CjsControllerExpressionParser.js.map +1 -0
- package/dist/trinity/controllers/expression/CjsControllerExpressionProgram.js +4 -1011
- package/dist/trinity/controllers/expression/CjsControllerExpressionProgram.js.map +1 -1
- package/dist/trinity/controllers/expression/expressionRuntime.js +605 -0
- package/dist/trinity/controllers/expression/expressionRuntime.js.map +1 -0
- package/dist/trinity/controllers/index.js +5 -2
- package/dist/trinity/controllers/index.js.map +1 -1
- package/dist/trinity/controllers/state/ITr2StateMachineStateFinalizer.js +2 -1
- package/dist/trinity/controllers/state/ITr2StateMachineStateFinalizer.js.map +1 -1
- package/dist/trinity/controllers/timeline/Tr2TimelineController.js +2 -1
- package/dist/trinity/controllers/timeline/Tr2TimelineController.js.map +1 -1
- package/dist/trinity/core/ITr2Updateable.js +2 -1
- package/dist/trinity/core/ITr2Updateable.js.map +1 -1
- package/dist/trinity/core/Tr2Blitter.js +6 -3
- package/dist/trinity/core/Tr2Blitter.js.map +1 -1
- package/dist/trinity/core/Tr2Denoiser.js +256 -0
- package/dist/trinity/core/Tr2Denoiser.js.map +1 -0
- package/dist/trinity/core/Tr2GpuResourcePool/GpuResourceHandle.js +115 -0
- package/dist/trinity/core/Tr2GpuResourcePool/GpuResourceHandle.js.map +1 -0
- package/dist/trinity/core/Tr2GpuResourcePool/TextureSize2D.js +79 -0
- package/dist/trinity/core/Tr2GpuResourcePool/TextureSize2D.js.map +1 -0
- package/dist/trinity/core/{Tr2GpuResourcePool.js → Tr2GpuResourcePool/Tr2GpuResourcePool.js} +63 -151
- package/dist/trinity/core/Tr2GpuResourcePool/Tr2GpuResourcePool.js.map +1 -0
- package/dist/trinity/core/{Tr2QuadRenderer.js → Tr2QuadRenderer/Tr2QuadRenderer.js} +8 -30
- package/dist/trinity/core/Tr2QuadRenderer/Tr2QuadRenderer.js.map +1 -0
- package/dist/trinity/core/Tr2QuadRenderer/Tr2QuadRendererEffectRecord.js +38 -0
- package/dist/trinity/core/Tr2QuadRenderer/Tr2QuadRendererEffectRecord.js.map +1 -0
- package/dist/trinity/core/Tr2RenderUtils.js +20 -3
- package/dist/trinity/core/Tr2RenderUtils.js.map +1 -1
- package/dist/trinity/core/Tr2Renderer.js +146 -1
- package/dist/trinity/core/Tr2Renderer.js.map +1 -1
- package/dist/trinity/core/Tr2ShadowMap.js +135 -14
- package/dist/trinity/core/Tr2ShadowMap.js.map +1 -1
- package/dist/trinity/core/{Tr2TextureArray.js → Tr2TextureArray/Tr2TextureArray.js} +3 -58
- package/dist/trinity/core/Tr2TextureArray/Tr2TextureArray.js.map +1 -0
- package/dist/trinity/core/Tr2TextureArray/Tr2TextureArrayElement.js +61 -0
- package/dist/trinity/core/Tr2TextureArray/Tr2TextureArrayElement.js.map +1 -0
- package/dist/trinity/core/batch/TriRenderBatch/DefaultKeyGenerator.js +26 -0
- package/dist/trinity/core/batch/TriRenderBatch/DefaultKeyGenerator.js.map +1 -0
- package/dist/trinity/core/batch/TriRenderBatch/EffectKeyGenerator.js +29 -0
- package/dist/trinity/core/batch/TriRenderBatch/EffectKeyGenerator.js.map +1 -0
- package/dist/trinity/core/batch/{ITriRenderBatchAccumulator.js → TriRenderBatch/ITriRenderBatchAccumulator.js} +30 -30
- package/dist/trinity/core/batch/TriRenderBatch/ITriRenderBatchAccumulator.js.map +1 -0
- package/dist/trinity/core/batch/{Tr2RenderBatch.js → TriRenderBatch/Tr2RenderBatch.js} +81 -154
- package/dist/trinity/core/batch/TriRenderBatch/Tr2RenderBatch.js.map +1 -0
- package/dist/trinity/core/batch/{TriRenderBatchAccumulator.js → TriRenderBatch/TriRenderBatchAccumulator.js} +7 -38
- package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAccumulator.js.map +1 -0
- package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAreaBlock.js +61 -0
- package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAreaBlock.js.map +1 -0
- package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAreaBlocksWithSharedMaterial.js +40 -0
- package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAreaBlocksWithSharedMaterial.js.map +1 -0
- package/dist/trinity/core/batch/TriRenderBatchMap.js +6 -1
- package/dist/trinity/core/batch/TriRenderBatchMap.js.map +1 -1
- package/dist/trinity/core/context/Tr2RenderContext.js +75 -57
- package/dist/trinity/core/context/Tr2RenderContext.js.map +1 -1
- package/dist/trinity/core/context/Tr2VisibilityResults/Tr2VisibilityEvent.js +67 -0
- package/dist/trinity/core/context/Tr2VisibilityResults/Tr2VisibilityEvent.js.map +1 -0
- package/dist/trinity/core/context/Tr2VisibilityResults/Tr2VisibilityResults.js +50 -0
- package/dist/trinity/core/context/Tr2VisibilityResults/Tr2VisibilityResults.js.map +1 -0
- package/dist/trinity/core/device/Tr2DepthStencil.js +186 -13
- package/dist/trinity/core/device/Tr2DepthStencil.js.map +1 -1
- package/dist/trinity/core/device/{Tr2RingBuffer.js → Tr2RingBuffer/Tr2RingBuffer.js} +27 -79
- package/dist/trinity/core/device/Tr2RingBuffer/Tr2RingBuffer.js.map +1 -0
- package/dist/trinity/core/device/Tr2RingBuffer/Tr2RingBufferOffsets.js +114 -0
- package/dist/trinity/core/device/Tr2RingBuffer/Tr2RingBufferOffsets.js.map +1 -0
- package/dist/trinity/core/device/{Tr2SuballocatedBuffer.js → Tr2SuballocatedBuffer/Tr2SuballocatedBuffer.js} +5 -59
- package/dist/trinity/core/device/Tr2SuballocatedBuffer/Tr2SuballocatedBuffer.js.map +1 -0
- package/dist/trinity/core/device/Tr2SuballocatedBuffer/Tr2SuballocatedBufferAllocation.js +80 -0
- package/dist/trinity/core/device/Tr2SuballocatedBuffer/Tr2SuballocatedBufferAllocation.js.map +1 -0
- package/dist/trinity/core/index.js +42 -15
- package/dist/trinity/core/index.js.map +1 -1
- package/dist/trinity/core/lighting/Tr2LightManager.js +6 -1
- package/dist/trinity/core/lighting/Tr2LightManager.js.map +1 -1
- package/dist/trinity/core/mesh/{ITr2ImpostorSource.js → ITr2ImpostorSource/ITr2ImpostorSource.js} +6 -28
- package/dist/trinity/core/mesh/ITr2ImpostorSource/ITr2ImpostorSource.js.map +1 -0
- package/dist/trinity/core/mesh/ITr2ImpostorSource/ITr2ImpostorSourceImpostorHash.js +32 -0
- package/dist/trinity/core/mesh/ITr2ImpostorSource/ITr2ImpostorSourceImpostorHash.js.map +1 -0
- package/dist/trinity/core/mesh/{ITr2InstanceData.js → ITr2InstanceData/ITr2InstanceData.js} +5 -29
- package/dist/trinity/core/mesh/ITr2InstanceData/ITr2InstanceData.js.map +1 -0
- package/dist/trinity/core/mesh/ITr2InstanceData/ITr2InstanceDataInstanceData.js +33 -0
- package/dist/trinity/core/mesh/ITr2InstanceData/ITr2InstanceDataInstanceData.js.map +1 -0
- package/dist/trinity/core/mesh/Tr2DirectInstanceData.js +2 -1
- package/dist/trinity/core/mesh/Tr2DirectInstanceData.js.map +1 -1
- package/dist/trinity/core/mesh/Tr2MeshBase.js +7 -1
- package/dist/trinity/core/mesh/Tr2MeshBase.js.map +1 -1
- package/dist/trinity/core/mesh/Tr2RuntimeInstanceData.js +2 -1
- package/dist/trinity/core/mesh/Tr2RuntimeInstanceData.js.map +1 -1
- package/dist/trinity/core/mesh/TriGeometryResAllocations.js +6 -2
- package/dist/trinity/core/mesh/TriGeometryResAllocations.js.map +1 -1
- package/dist/trinity/core/rawData/CjsConstantLayout.js +196 -0
- package/dist/trinity/core/rawData/CjsConstantLayout.js.map +1 -0
- package/dist/trinity/core/rawData/CjsPerFrameLayouts.js +8 -3
- package/dist/trinity/core/rawData/CjsPerFrameLayouts.js.map +1 -1
- package/dist/trinity/core/rawData/CjsPerObjectLayouts.js +40 -732
- package/dist/trinity/core/rawData/CjsPerObjectLayouts.js.map +1 -1
- package/dist/trinity/core/rawData/layouts/CjsEveBasicLayout.js +34 -0
- package/dist/trinity/core/rawData/layouts/CjsEveBasicLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveBoosterSetLayout.js +69 -0
- package/dist/trinity/core/rawData/layouts/CjsEveBoosterSetLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveChildBoosterSetLayout.js +59 -0
- package/dist/trinity/core/rawData/layouts/CjsEveChildBoosterSetLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveChildBulletStormLayout.js +37 -0
- package/dist/trinity/core/rawData/layouts/CjsEveChildBulletStormLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveChildSpherePinLayout.js +44 -0
- package/dist/trinity/core/rawData/layouts/CjsEveChildSpherePinLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveLensflareLayout.js +31 -0
- package/dist/trinity/core/rawData/layouts/CjsEveLensflareLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveMissileWarheadLayout.js +29 -0
- package/dist/trinity/core/rawData/layouts/CjsEveMissileWarheadLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEvePerObjectLayout.js +39 -0
- package/dist/trinity/core/rawData/layouts/CjsEvePerObjectLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSceneStaticParticlesLayout.js +30 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSceneStaticParticlesLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSpaceObjectDecalLayout.js +78 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSpaceObjectDecalLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSpaceObjectLayout.js +169 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSpaceObjectLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSpacePerObjectLayout.js +107 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSpacePerObjectLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSpherePinLayout.js +44 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSpherePinLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveStretch2Layout.js +34 -0
- package/dist/trinity/core/rawData/layouts/CjsEveStretch2Layout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveTurretSetLayout.js +82 -0
- package/dist/trinity/core/rawData/layouts/CjsEveTurretSetLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsTr2PerObjectLayout.js +42 -0
- package/dist/trinity/core/rawData/layouts/CjsTr2PerObjectLayout.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveBasicPerObjectData.js +55 -0
- package/dist/trinity/core/rawData/perObjectData/EveBasicPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveBoosterSetPerObjectData.js +59 -0
- package/dist/trinity/core/rawData/perObjectData/EveBoosterSetPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveChildBoosterSetPerObjectData.js +59 -0
- package/dist/trinity/core/rawData/perObjectData/EveChildBoosterSetPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveChildBulletStormPerObjectData.js +55 -0
- package/dist/trinity/core/rawData/perObjectData/EveChildBulletStormPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveChildSpherePinPerObjectData.js +55 -0
- package/dist/trinity/core/rawData/perObjectData/EveChildSpherePinPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveDecalPerObjectData.js +59 -0
- package/dist/trinity/core/rawData/perObjectData/EveDecalPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveLensflarePerObjectData.js +55 -0
- package/dist/trinity/core/rawData/perObjectData/EveLensflarePerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveMissileWarheadPerObjectData.js +55 -0
- package/dist/trinity/core/rawData/perObjectData/EveMissileWarheadPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveSceneStaticParticlesPerObjectData.js +55 -0
- package/dist/trinity/core/rawData/perObjectData/EveSceneStaticParticlesPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveSpherePinPerObjectData.js +55 -0
- package/dist/trinity/core/rawData/perObjectData/EveSpherePinPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveTurretSetPerObjectData.js +59 -0
- package/dist/trinity/core/rawData/perObjectData/EveTurretSetPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/StretchPerObjectData.js +55 -0
- package/dist/trinity/core/rawData/perObjectData/StretchPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/{Tr2PerObjectData.js → perObjectData/Tr2PerObjectData.js} +110 -62
- package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectDataPSBuffer.js +104 -0
- package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectDataPSBuffer.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectDataStandard.js +87 -0
- package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectDataStandard.js.map +1 -0
- package/dist/trinity/core/variable/TriVariable.js +83 -83
- package/dist/trinity/core/variable/TriVariable.js.map +1 -1
- package/dist/trinity/core/vertex/{Tr2VertexDefinition.js → Tr2VertexDefinition/Tr2VertexDefinition.js} +4 -20
- package/dist/trinity/core/vertex/Tr2VertexDefinition/Tr2VertexDefinition.js.map +1 -0
- package/dist/trinity/core/vertex/Tr2VertexDefinition/Tr2VertexDefinitionItem.js +29 -0
- package/dist/trinity/core/vertex/Tr2VertexDefinition/Tr2VertexDefinitionItem.js.map +1 -0
- package/dist/trinity/core/volumetrics/Tr2VolumetricsRenderer.js +116 -36
- package/dist/trinity/core/volumetrics/Tr2VolumetricsRenderer.js.map +1 -1
- package/dist/trinity/curves/curve/Tr2CurveRandomAxisRotation.js +50 -92
- package/dist/trinity/curves/curve/Tr2CurveRandomAxisRotation.js.map +1 -1
- package/dist/trinity/eve/EveModularObjectModifier.js +9 -5
- package/dist/trinity/eve/EveModularObjectModifier.js.map +1 -1
- package/dist/trinity/eve/IEveInheritPropertiesOwner.js +2 -1
- package/dist/trinity/eve/IEveInheritPropertiesOwner.js.map +1 -1
- package/dist/trinity/eve/IEveSpaceObject2.js +2 -1
- package/dist/trinity/eve/IEveSpaceObject2.js.map +1 -1
- package/dist/trinity/eve/IEveTransform.js +2 -1
- package/dist/trinity/eve/IEveTransform.js.map +1 -1
- package/dist/trinity/eve/attachment/banner/EveBannerSet.js +2 -2
- package/dist/trinity/eve/attachment/banner/EveBannerSet.js.map +1 -1
- package/dist/trinity/eve/attachment/booster/EveBoosterSet2.js +109 -133
- package/dist/trinity/eve/attachment/booster/EveBoosterSet2.js.map +1 -1
- package/dist/trinity/eve/attachment/booster/EveBoosterSet2Item.js +40 -0
- package/dist/trinity/eve/attachment/booster/EveBoosterSet2Item.js.map +1 -0
- package/dist/trinity/eve/attachment/booster/EveBoosterSet2Renderable.js +1 -1
- package/dist/trinity/eve/attachment/booster/EveBoosterSet2Renderable.js.map +1 -1
- package/dist/trinity/eve/attachment/decal/DecalMeshCache.js +2 -14
- package/dist/trinity/eve/attachment/decal/DecalMeshCache.js.map +1 -1
- package/dist/trinity/eve/attachment/decal/DecalMeshCacheMeshBuffers.js +18 -0
- package/dist/trinity/eve/attachment/decal/DecalMeshCacheMeshBuffers.js.map +1 -0
- package/dist/trinity/eve/attachment/decal/EveSpaceObjectDecal.js +1 -1
- package/dist/trinity/eve/attachment/decal/EveSpaceObjectDecal.js.map +1 -1
- package/dist/trinity/eve/attachment/haze/EveHazeSet.js +1 -1
- package/dist/trinity/eve/attachment/haze/EveHazeSet.js.map +1 -1
- package/dist/trinity/eve/attachment/plane/EvePlaneSet.js +1 -1
- package/dist/trinity/eve/attachment/plane/EvePlaneSet.js.map +1 -1
- package/dist/trinity/eve/attachment/spotlight/EveSpotlightSet.js +2 -2
- package/dist/trinity/eve/attachment/spotlight/EveSpotlightSet.js.map +1 -1
- package/dist/trinity/eve/attachment/sprite/EveSpriteLineSet.js +1 -1
- package/dist/trinity/eve/attachment/sprite/EveSpriteLineSet.js.map +1 -1
- package/dist/trinity/eve/attachment/sprite/EveSpriteSet.js +4 -2
- package/dist/trinity/eve/attachment/sprite/EveSpriteSet.js.map +1 -1
- package/dist/trinity/eve/attachment/turrets/EveTurretSet.js +143 -139
- package/dist/trinity/eve/attachment/turrets/EveTurretSet.js.map +1 -1
- package/dist/trinity/eve/camera/EveCamera.js +1 -1
- package/dist/trinity/eve/camera/EveCamera.js.map +1 -1
- package/dist/trinity/eve/child/EveChildBoosterSet.js +12 -1
- package/dist/trinity/eve/child/EveChildBoosterSet.js.map +1 -1
- package/dist/trinity/eve/child/EveChildCloud2.js +178 -151
- package/dist/trinity/eve/child/EveChildCloud2.js.map +1 -1
- package/dist/trinity/eve/child/EveChildContainer.js +141 -141
- package/dist/trinity/eve/child/EveChildContainer.js.map +1 -1
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMesh.js +87 -0
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMesh.js.map +1 -0
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshArea.js +46 -0
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshArea.js.map +1 -0
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshInstance.js +35 -0
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshInstance.js.map +1 -0
- package/dist/trinity/eve/child/{EveChildInstancedMeshes.js → EveChildInstancedMeshes/EveChildInstancedMeshes.js} +42 -163
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshes.js.map +1 -0
- package/dist/trinity/eve/child/EveChildMesh.js +218 -218
- package/dist/trinity/eve/child/EveChildMesh.js.map +1 -1
- package/dist/trinity/eve/child/EveChildPartData/EveChildPartData.js +53 -0
- package/dist/trinity/eve/child/EveChildPartData/EveChildPartData.js.map +1 -0
- package/dist/trinity/eve/child/{EveChildPartData.js → EveChildPartData/EveChildPartDataPartData.js} +9 -45
- package/dist/trinity/eve/child/EveChildPartData/EveChildPartDataPartData.js.map +1 -0
- package/dist/trinity/eve/child/EveChildParticleSystem.js +30 -29
- package/dist/trinity/eve/child/EveChildParticleSystem.js.map +1 -1
- package/dist/trinity/eve/child/EveChildTransform.js +5 -0
- package/dist/trinity/eve/child/EveChildTransform.js.map +1 -1
- package/dist/trinity/eve/child/EveChildTurret.js +7 -0
- package/dist/trinity/eve/child/EveChildTurret.js.map +1 -1
- package/dist/trinity/eve/index.js +10 -4
- package/dist/trinity/eve/index.js.map +1 -1
- package/dist/trinity/eve/lights/Tr2Light.js +5 -0
- package/dist/trinity/eve/lights/Tr2Light.js.map +1 -1
- package/dist/trinity/eve/overlays/overlayBatches.js +6 -1
- package/dist/trinity/eve/overlays/overlayBatches.js.map +1 -1
- package/dist/trinity/eve/particles/static/EveSceneStaticParticles.js +4 -4
- package/dist/trinity/eve/particles/static/EveSceneStaticParticles.js.map +1 -1
- package/dist/trinity/eve/renderable/stretch/EveStretch2.js +76 -71
- package/dist/trinity/eve/renderable/stretch/EveStretch2.js.map +1 -1
- package/dist/trinity/eve/renderable/stretch/EveStretch3.js +1 -1
- package/dist/trinity/eve/renderable/stretch/EveStretch3.js.map +1 -1
- package/dist/trinity/eve/spaceObject/EveShip2.js +3 -3
- package/dist/trinity/eve/spaceObject/EveShip2.js.map +1 -1
- package/dist/trinity/eve/spaceObject/EveSpaceObject2.js +408 -407
- package/dist/trinity/eve/spaceObject/EveSpaceObject2.js.map +1 -1
- package/dist/trinity/eve/ui/EveTacticalOverlay.js +1 -1
- package/dist/trinity/eve/ui/EveTacticalOverlay.js.map +1 -1
- package/dist/trinity/eve/ui/lines/EveCurveLineSet.js +9 -9
- package/dist/trinity/eve/ui/lines/EveCurveLineSet.js.map +1 -1
- package/dist/trinity/eve/ui/lines/EveLineSet.js +27 -25
- package/dist/trinity/eve/ui/lines/EveLineSet.js.map +1 -1
- package/dist/trinity/eve/ui/tacticalOverlay/EveTacticalTrails.js +3 -2
- package/dist/trinity/eve/ui/tacticalOverlay/EveTacticalTrails.js.map +1 -1
- package/dist/trinity/generated/index.js +0 -1
- package/dist/trinity/generated/index.js.map +1 -1
- package/dist/trinity/generated/trinityCore/index.js +0 -1
- package/dist/trinity/generated/trinityCore/index.js.map +1 -1
- package/dist/trinity/index.js +59 -23
- package/dist/trinity/index.js.map +1 -1
- package/dist/trinity/particle/{ITr2GenericEmitter.js → ITr2GenericEmitter/ITr2GenericEmitter.js} +4 -32
- package/dist/trinity/particle/ITr2GenericEmitter/ITr2GenericEmitter.js.map +1 -0
- package/dist/trinity/particle/ITr2GenericEmitter/ITr2GenericEmitterUpdateArguments.js +36 -0
- package/dist/trinity/particle/ITr2GenericEmitter/ITr2GenericEmitterUpdateArguments.js.map +1 -0
- package/dist/trinity/particle/Tr2ParticleSystem.js +4 -2
- package/dist/trinity/particle/Tr2ParticleSystem.js.map +1 -1
- package/dist/trinity/particle/element/Tr2ParticleElementData.js +15 -4
- package/dist/trinity/particle/element/Tr2ParticleElementData.js.map +1 -1
- package/dist/trinity/particle/emitter/Tr2DynamicEmitter.js +21 -20
- package/dist/trinity/particle/emitter/Tr2DynamicEmitter.js.map +1 -1
- package/dist/trinity/particle/emitter/Tr2GpuSharedEmitter.js +23 -22
- package/dist/trinity/particle/emitter/Tr2GpuSharedEmitter.js.map +1 -1
- package/dist/trinity/particle/emitter/Tr2StaticEmitter.js +14 -13
- package/dist/trinity/particle/emitter/Tr2StaticEmitter.js.map +1 -1
- package/dist/trinity/particle/index.js +2 -1
- package/dist/trinity/particle/index.js.map +1 -1
- package/dist/trinity/renderJob/step/TriStepPushRenderTarget.js +7 -1
- package/dist/trinity/renderJob/step/TriStepPushRenderTarget.js.map +1 -1
- package/dist/trinity/shader/Tr2Effect.js +131 -58
- package/dist/trinity/shader/Tr2Effect.js.map +1 -1
- package/dist/trinity/shader/Tr2EffectStateManager.js +17 -5
- package/dist/trinity/shader/Tr2EffectStateManager.js.map +1 -1
- package/dist/trinity/shader/Tr2Material.js +21 -4
- package/dist/trinity/shader/Tr2Material.js.map +1 -1
- package/dist/trinity/shader/material/Tr2EffectPassParameters.js +4 -1
- package/dist/trinity/shader/material/Tr2EffectPassParameters.js.map +1 -1
- package/dist/trinity/shader/parameter/Tr2GeometryBufferParameter.js +2 -2
- package/dist/trinity/shader/parameter/Tr2GeometryBufferParameter.js.map +1 -1
- package/dist/trinityal/Tr2BufferAL/Tr2BufferDescriptionAL.js +79 -0
- package/dist/trinityal/Tr2BufferAL/Tr2BufferDescriptionAL.js.map +1 -0
- package/dist/trinityal/{Tr2DeviceResourceAL.js → Tr2DeviceResourceAL/Tr2BaseDeviceResourceAL.js} +77 -79
- package/dist/trinityal/Tr2DeviceResourceAL/Tr2BaseDeviceResourceAL.js.map +1 -0
- package/dist/trinityal/Tr2DeviceResourceAL/Tr2DeviceResourceAL.js +24 -0
- package/dist/trinityal/Tr2DeviceResourceAL/Tr2DeviceResourceAL.js.map +1 -0
- package/dist/trinityal/Tr2DrawUPHelper.js +2 -1
- package/dist/trinityal/Tr2DrawUPHelper.js.map +1 -1
- package/dist/trinityal/Tr2HalHelperStructures/Tr2MsaaDesc.js +45 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2MsaaDesc.js.map +1 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2SamplerDescription.js +154 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2SamplerDescription.js.map +1 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2SubresourceData.js +48 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2SubresourceData.js.map +1 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureCoordBox.js +75 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureCoordBox.js.map +1 -0
- package/dist/trinityal/{Tr2HalHelperStructures.js → Tr2HalHelperStructures/Tr2TextureSubresource.js} +11 -115
- package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureSubresource.js.map +1 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2Viewport.js +51 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2Viewport.js.map +1 -0
- package/dist/trinityal/{Tr2RenderPassAL.js → Tr2RenderPassAL/Tr2ColorAttachment.js} +5 -28
- package/dist/trinityal/Tr2RenderPassAL/Tr2ColorAttachment.js.map +1 -0
- package/dist/trinityal/Tr2RenderPassAL/Tr2DepthAttachment.js +38 -0
- package/dist/trinityal/Tr2RenderPassAL/Tr2DepthAttachment.js.map +1 -0
- package/dist/trinityal/Tr2ResourceSetAL/Tr2RegisterMapAL.js +80 -0
- package/dist/trinityal/Tr2ResourceSetAL/Tr2RegisterMapAL.js.map +1 -0
- package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetAL.js +76 -0
- package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetAL.js.map +1 -0
- package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetALStub.js +96 -0
- package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetALStub.js.map +1 -0
- package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetDescriptionAL.js +196 -0
- package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetDescriptionAL.js.map +1 -0
- package/dist/trinityal/index.js +22 -9
- package/dist/trinityal/index.js.map +1 -1
- package/dist/trinityal/stub/Tr2BufferALStub.js +86 -141
- package/dist/trinityal/stub/Tr2BufferALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2CapsALStub.js +17 -0
- package/dist/trinityal/stub/Tr2CapsALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2ConstantBufferALStub.js +57 -41
- package/dist/trinityal/stub/Tr2ConstantBufferALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2FenceALStub.js +18 -2
- package/dist/trinityal/stub/Tr2FenceALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2GpuTimerALStub.js +97 -0
- package/dist/trinityal/stub/Tr2GpuTimerALStub.js.map +1 -0
- package/dist/trinityal/stub/Tr2OcclusionQueryALStub.js +124 -0
- package/dist/trinityal/stub/Tr2OcclusionQueryALStub.js.map +1 -0
- package/dist/trinityal/stub/Tr2PipelineStatsQueryALStub/Tr2PipelineStatsQueryALStub.js +146 -0
- package/dist/trinityal/stub/Tr2PipelineStatsQueryALStub/Tr2PipelineStatsQueryALStub.js.map +1 -0
- package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2BindlessResourcesAL.js +28 -0
- package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2BindlessResourcesAL.js.map +1 -0
- package/dist/trinityal/stub/{Tr2RenderContextALStub.js → Tr2RenderContextALStub/Tr2RenderContextALStub.js} +70 -75
- package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2RenderContextALStub.js.map +1 -0
- package/dist/trinityal/stub/Tr2SamplerStateALStub.js +47 -31
- package/dist/trinityal/stub/Tr2SamplerStateALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2ShaderALStub.js +61 -45
- package/dist/trinityal/stub/Tr2ShaderALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2ShaderProgramALStub.js +51 -33
- package/dist/trinityal/stub/Tr2ShaderProgramALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2SwapChainALStub.js +61 -45
- package/dist/trinityal/stub/Tr2SwapChainALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2TextureALStub.js +188 -171
- package/dist/trinityal/stub/Tr2TextureALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2VertexLayoutALStub.js +43 -27
- package/dist/trinityal/stub/Tr2VertexLayoutALStub.js.map +1 -1
- package/dist/trinityal/stub/{Tr2VideoAdapterInfoALStub.js → Tr2VideoAdapterInfoStub.js} +16 -1
- package/dist/trinityal/stub/Tr2VideoAdapterInfoStub.js.map +1 -0
- package/dist/trinityal/stub/index.js +8 -4
- package/dist/trinityal/stub/index.js.map +1 -1
- package/dist/trinityal/vertexLayoutMatch.js +2 -2
- package/dist/trinityal/vertexLayoutMatch.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuBufferAL.js +105 -90
- package/dist/trinityal/webgpu/CjsWebgpuBufferAL.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuCapsAL.js +17 -0
- package/dist/trinityal/webgpu/CjsWebgpuCapsAL.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuConstantBufferAL.js +15 -0
- package/dist/trinityal/webgpu/CjsWebgpuConstantBufferAL.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuDevice.js +2 -2
- package/dist/trinityal/webgpu/CjsWebgpuDevice.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuRenderContextAL.js +900 -938
- package/dist/trinityal/webgpu/CjsWebgpuRenderContextAL.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuResourceSetAL.js +56 -60
- package/dist/trinityal/webgpu/CjsWebgpuResourceSetAL.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuSamplerStateAL.js +16 -1
- package/dist/trinityal/webgpu/CjsWebgpuSamplerStateAL.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuShaderAL.js +100 -379
- package/dist/trinityal/webgpu/CjsWebgpuShaderAL.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuShaderProgramAL.js +330 -0
- package/dist/trinityal/webgpu/CjsWebgpuShaderProgramAL.js.map +1 -0
- package/dist/trinityal/webgpu/CjsWebgpuTextureAL.js +15 -0
- package/dist/trinityal/webgpu/CjsWebgpuTextureAL.js.map +1 -1
- package/dist/trinityal/webgpu/core/{constantArena.js → CjsWebgpuConstantArena.js} +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuConstantArena.js.map +1 -0
- package/dist/trinityal/webgpu/core/{batchGroups.js → CjsWebgpuEncodeState.js} +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuEncodeState.js.map +1 -0
- package/dist/trinityal/webgpu/core/{perFrameSource.js → CjsWebgpuPerFrameSource.js} +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuPerFrameSource.js.map +1 -0
- package/dist/trinityal/webgpu/core/{pipelineCache.js → CjsWebgpuPipelineCache.js} +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuPipelineCache.js.map +1 -0
- package/dist/trinityal/webgpu/core/{psoDescription.js → CjsWebgpuPsoDescription.js} +2 -2
- package/dist/trinityal/webgpu/core/CjsWebgpuPsoDescription.js.map +1 -0
- package/dist/trinityal/webgpu/core/{renderTarget.js → CjsWebgpuRenderTarget.js} +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuRenderTarget.js.map +1 -0
- package/dist/trinityal/webgpu/core/{samplerSource.js → CjsWebgpuSamplerSource.js} +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuSamplerSource.js.map +1 -0
- package/dist/trinityal/webgpu/core/{textureSource.js → CjsWebgpuTextureSource.js} +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuTextureSource.js.map +1 -0
- package/dist/trinityal/webgpu/core/{trinityBatchDispatcher.js → CjsWebgpuTrinityBatchDispatcher.js} +4 -4
- package/dist/trinityal/webgpu/core/CjsWebgpuTrinityBatchDispatcher.js.map +1 -0
- package/dist/trinityal/webgpu/core/{trinityBatchResolver.js → CjsWebgpuTrinityBatchResolver.js} +81 -81
- package/dist/trinityal/webgpu/core/CjsWebgpuTrinityBatchResolver.js.map +1 -0
- package/dist/trinityal/webgpu/core/{trinityPassEncoder.js → CjsWebgpuTrinityPassEncoder.js} +2 -2
- package/dist/trinityal/webgpu/core/CjsWebgpuTrinityPassEncoder.js.map +1 -0
- package/dist/trinityal/webgpu/core/{workQueue.js → CjsWebgpuWorkQueue.js} +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuWorkQueue.js.map +1 -0
- package/dist/trinityal/webgpu/internal.js +12 -11
- package/dist/trinityal/webgpu/internal.js.map +1 -1
- package/docs/audio/reference/classes/trinity.md +44 -34
- package/docs/character/architecture.md +276 -0
- package/docs/character/reference/character-appearance-plans.md +30 -66
- package/docs/character/reference/prepared-libraries.md +14 -30
- package/docs/global/reference/api.md +2 -1
- package/docs/global/reference/classes/README.md +53 -71
- package/docs/global/reference/classes/dropped.md +16 -0
- package/docs/resource/README.md +19 -15
- package/docs/resource/architecture.md +9 -2
- package/docs/resource/concepts/format-capabilities.md +124 -80
- package/docs/resource/concepts/shared-format-helpers.md +94 -0
- package/docs/resource/formats/README.md +230 -224
- package/docs/resource/formats/bitknit2.md +221 -0
- package/docs/resource/formats/carbon-effect-container.md +184 -269
- package/docs/resource/formats/gr2.md +6 -1
- package/docs/resource/formats/schemabound.md +28 -48
- package/docs/resource/formats/static.md +70 -97
- package/docs/resource/formats/webgl/carbon-constant-layouts.md +8 -8
- package/docs/resource/formats/webgl/decl-io.md +165 -256
- package/docs/resource/formats/webgl/memory-structured.md +64 -142
- package/docs/resource/formats/webgl/texture-sample.md +109 -138
- package/docs/resource/formats/webgpu/formats/carbon-webgpu.md +38 -69
- package/docs/resource/formats/webgpu/guides/effect-packaging.md +54 -116
- package/docs/resource/formats/webgpu/reference/api.md +64 -67
- package/docs/resource/formats/webgpu/reference/wgsl-compatibility.md +104 -260
- package/docs/resource/reference/classes/core.md +256 -236
- package/docs/resource/reference/classes/formats.md +1668 -1672
- package/docs/resource/reference/workers.md +4 -2
- package/docs/sof/reference/classes/core.md +1 -1
- package/docs/sof/reference/classes/faction.md +2 -2
- package/docs/sof/reference/classes/generic.md +4 -4
- package/docs/sof/reference/classes/pattern.md +1 -1
- package/docs/sof/reference/classes/shared.md +10 -10
- package/docs/trinity/architecture.md +55 -44
- package/docs/trinity/concepts/generated-class-lifecycle.md +10 -15
- package/docs/trinity/reference/classes/curves-and-utilities.md +496 -506
- package/docs/trinity/reference/classes/dropped.md +0 -189
- package/docs/trinity/reference/classes/eve-runtime.md +8 -8
- package/docs/trinity/reference/classes/generated.md +0 -10
- package/docs/trinity/reference/classes/particle.md +2 -2
- package/docs/trinity/reference/classes/trinity-core.md +1554 -1256
- package/docs/trinity/reference/implementation-status.md +50 -75
- package/docs/trinity/reference/main-semantic-extraction.md +13 -17
- package/docs/trinityal/reference/classes/README.md +77 -27
- package/docs/trinityal/reference/classes/dropped.md +82 -0
- package/docs/trinityal/webgpu/README.md +3 -1
- package/docs/trinityal/webgpu/architecture.md +121 -228
- package/docs/trinityal/webgpu/reference/api.md +5 -5
- package/docs/trinityal/webgpu/reference/classes/README.md +13 -13
- package/format-notices/gr2/NOTICE +18 -12
- package/format-notices/gr2/THIRD-PARTY-NOTICES.md +5 -5
- package/package.json +4 -1
- package/dist/audio/trinity/audio/AudActionLog.js +0 -173
- package/dist/audio/trinity/audio/AudActionLog.js.map +0 -1
- package/dist/audio/trinity/audio/AudObstructionOcclusion.js.map +0 -1
- package/dist/global/contracts/CjsScriptCallback.js +0 -94
- package/dist/global/contracts/CjsScriptCallback.js.map +0 -1
- package/dist/trinity/controllers/ITr2Controller.js.map +0 -1
- package/dist/trinity/core/Tr2GpuResourcePool.js.map +0 -1
- package/dist/trinity/core/Tr2QuadRenderer.js.map +0 -1
- package/dist/trinity/core/Tr2TextureArray.js.map +0 -1
- package/dist/trinity/core/batch/ITriRenderBatchAccumulator.js.map +0 -1
- package/dist/trinity/core/batch/Tr2RenderBatch.js.map +0 -1
- package/dist/trinity/core/batch/TriRenderBatchAccumulator.js.map +0 -1
- package/dist/trinity/core/context/CjsShadowMapExecutor.js +0 -43
- package/dist/trinity/core/context/CjsShadowMapExecutor.js.map +0 -1
- package/dist/trinity/core/context/CjsVolumetricsExecutor.js +0 -64
- package/dist/trinity/core/context/CjsVolumetricsExecutor.js.map +0 -1
- package/dist/trinity/core/context/Tr2VisibilityResults.js +0 -109
- package/dist/trinity/core/context/Tr2VisibilityResults.js.map +0 -1
- package/dist/trinity/core/device/Tr2RingBuffer.js.map +0 -1
- package/dist/trinity/core/device/Tr2SuballocatedBuffer.js.map +0 -1
- package/dist/trinity/core/mesh/ITr2ImpostorSource.js.map +0 -1
- package/dist/trinity/core/mesh/ITr2InstanceData.js.map +0 -1
- package/dist/trinity/core/rawData/Tr2PerObjectData.js.map +0 -1
- package/dist/trinity/core/rawData/constantLayout.js +0 -175
- package/dist/trinity/core/rawData/constantLayout.js.map +0 -1
- package/dist/trinity/core/vertex/Tr2VertexDefinition.js.map +0 -1
- package/dist/trinity/eve/child/EveChildInstancedMeshes.js.map +0 -1
- package/dist/trinity/eve/child/EveChildPartData.js.map +0 -1
- package/dist/trinity/generated/trinityCore/Tr2Denoiser.js +0 -47
- package/dist/trinity/generated/trinityCore/Tr2Denoiser.js.map +0 -1
- package/dist/trinity/particle/ITr2GenericEmitter.js.map +0 -1
- package/dist/trinityal/Tr2DeviceResourceAL.js.map +0 -1
- package/dist/trinityal/Tr2HalHelperStructures.js.map +0 -1
- package/dist/trinityal/Tr2RenderPassAL.js.map +0 -1
- package/dist/trinityal/Tr2ResourceSetAL.js +0 -419
- package/dist/trinityal/Tr2ResourceSetAL.js.map +0 -1
- package/dist/trinityal/Tr2SamplerDescription.js +0 -72
- package/dist/trinityal/Tr2SamplerDescription.js.map +0 -1
- package/dist/trinityal/stub/Tr2QueryALStub.js +0 -326
- package/dist/trinityal/stub/Tr2QueryALStub.js.map +0 -1
- package/dist/trinityal/stub/Tr2RenderContextALStub.js.map +0 -1
- package/dist/trinityal/stub/Tr2VideoAdapterInfoALStub.js.map +0 -1
- package/dist/trinityal/webgpu/core/batchGroups.js.map +0 -1
- package/dist/trinityal/webgpu/core/constantArena.js.map +0 -1
- package/dist/trinityal/webgpu/core/perFrameSource.js.map +0 -1
- package/dist/trinityal/webgpu/core/pipelineCache.js.map +0 -1
- package/dist/trinityal/webgpu/core/psoDescription.js.map +0 -1
- package/dist/trinityal/webgpu/core/renderTarget.js.map +0 -1
- package/dist/trinityal/webgpu/core/samplerSource.js.map +0 -1
- package/dist/trinityal/webgpu/core/textureSource.js.map +0 -1
- package/dist/trinityal/webgpu/core/trinityBatchDispatcher.js.map +0 -1
- package/dist/trinityal/webgpu/core/trinityBatchResolver.js.map +0 -1
- package/dist/trinityal/webgpu/core/trinityPassEncoder.js.map +0 -1
- package/dist/trinityal/webgpu/core/workQueue.js.map +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { asUint8Array } from '#utils/bytes';
|
|
2
2
|
import { CjsFormat } from '../../format/CjsFormat.js';
|
|
3
|
-
import { DEFAULT_VALUES, OUTPUT_RAW, OUTPUT_OGG, OUTPUT_PCM, OUTPUT_WEM_JSON, normalizeValues, readWithValues, inspectWithValues,
|
|
3
|
+
import { DEFAULT_VALUES, OUTPUT_RAW, OUTPUT_OGG, OUTPUT_PCM, OUTPUT_WEM_JSON, normalizeValues, readWithValues, inspectWithValues, isWEM, OUTPUT_JSON, WEM_CODEC_NAMES } from './core/helpers.js';
|
|
4
4
|
import { probeCodecSupportWithValues } from './core/probeCodecSupport.js';
|
|
5
|
+
import { toJsonWithByteSummary } from '../../format/jsonPolicies.js';
|
|
5
6
|
|
|
6
7
|
const FORMAT_NAME = "CjsWemFormat";
|
|
7
8
|
|
|
@@ -97,7 +98,7 @@ class CjsWemFormat extends CjsFormat {
|
|
|
97
98
|
* @returns {any} JSON-compatible value.
|
|
98
99
|
*/
|
|
99
100
|
ToJSON(value) {
|
|
100
|
-
return
|
|
101
|
+
return toJsonWithByteSummary(value);
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
/**
|
|
@@ -151,7 +152,7 @@ class CjsWemFormat extends CjsFormat {
|
|
|
151
152
|
* @returns {any} JSON-compatible value.
|
|
152
153
|
*/
|
|
153
154
|
static toJSON(value) {
|
|
154
|
-
return
|
|
155
|
+
return toJsonWithByteSummary(value);
|
|
155
156
|
}
|
|
156
157
|
|
|
157
158
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CjsWemFormat.js","sources":["../../../../../src/resource/formats/wem/CjsWemFormat.js"],"sourcesContent":["import { asUint8Array } from \"#utils/bytes\";\nimport { CjsFormat } from \"../../format/CjsFormat.js\";\nimport {\n DEFAULT_VALUES,\n OUTPUT_JSON,\n OUTPUT_OGG,\n OUTPUT_PCM,\n OUTPUT_RAW,\n OUTPUT_WEM_JSON,\n WEM_CODEC_NAMES,\n inspectWithValues,\n probeSupportWithValues,\n isWEM,\n normalizeValues,\n readWithValues,\n toJsonValue\n} from \"./core/helpers.js\";\nimport { probeCodecSupportWithValues } from \"./core/probeCodecSupport.js\";\n\nconst FORMAT_NAME = \"CjsWemFormat\";\n\n/**\n * Reader for Audiokinetic Wwise media (.wem) containers.\n *\n * Inspection identifies the codec, channel/rate layout, and Vorbis duration\n * without decoding audio data. Read emits the container bytes untouched by\n * default; `emit: \"ogg\"` repacks Wwise Vorbis into a standard Ogg stream and\n * `emit: \"pcm\"` decodes PTADPCM / 16-bit PCM media to float32 samples.\n */\nexport class CjsWemFormat extends CjsFormat\n{\n #values = DEFAULT_VALUES;\n\n /**\n * Browser-worker module declaration consumed by CjsResManWorkerLoader.\n */\n static worker = Object.freeze({\n module: import.meta.url,\n exportName: \"CjsWemFormat\",\n outputTypes: Object.freeze([ OUTPUT_RAW, OUTPUT_OGG, OUTPUT_PCM, OUTPUT_WEM_JSON ]),\n defaultOutput: OUTPUT_RAW\n });\n\n /**\n * Create a reusable wem format profile.\n *\n * @param {object} [options] Default read/inspect options.\n */\n constructor(options = {})\n {\n super();\n this.SetValues(options);\n }\n\n /**\n * Merge options into this profile.\n *\n * @param {object} [options] Values to merge.\n * @returns {CjsWemFormat} This format profile.\n */\n SetValues(options = {})\n {\n this.#values = normalizeValues(this.#values, options, FORMAT_NAME);\n return this;\n }\n\n /**\n * Get normalized profile values with optional per-call overrides.\n *\n * @param {object} [options] Per-call values.\n * @returns {object} Normalized read values.\n */\n GetValues(options = {})\n {\n return normalizeValues(this.#values, options, FORMAT_NAME);\n }\n\n /**\n * Read wem bytes with this profile.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Wem bytes.\n * @param {object} [options] Per-call values.\n * @returns {object} GPU-free raw/debug payload for the selected emit target.\n */\n Read(input, options = {})\n {\n return readWithValues(input, this.GetValues(options));\n }\n\n /**\n * Read wem bytes asynchronously with this profile.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Wem bytes.\n * @param {object} [options] Per-call values.\n * @returns {Promise<object>} GPU-free raw/debug payload for the selected emit target.\n */\n async ReadAsync(input, options = {})\n {\n return this.Read(input, options);\n }\n\n /**\n * Inspect wem bytes without decoding audio data.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Wem bytes.\n * @param {object} [options] Per-call values.\n * @returns {object} Wwise container metadata.\n */\n Inspect(input, options = {})\n {\n return inspectWithValues(input, this.GetValues(options));\n }\n\n /**\n * Convert format output into JSON-compatible debug data.\n *\n * @param {any} value Format output.\n * @returns {any} JSON-compatible value.\n */\n ToJSON(value)\n {\n return toJsonValue(value);\n }\n\n /**\n * One-shot wem read.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Wem bytes.\n * @param {object} [options] Read options.\n * @returns {object} GPU-free raw/debug payload for the selected emit target.\n */\n static read(input, options = {})\n {\n return readWithValues(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * One-shot asynchronous wem read.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Wem bytes.\n * @param {object} [options] Read options.\n * @returns {Promise<object>} GPU-free raw/debug payload for the selected emit target.\n */\n static async readAsync(input, options = {})\n {\n return CjsWemFormat.read(input, options);\n }\n\n /**\n * One-shot wem inspection.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Wem bytes.\n * @param {object} [options] Inspect options.\n * @returns {object} Wwise container metadata.\n */\n static inspect(input, options = {})\n {\n return inspectWithValues(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * One-shot wem support probe.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Wem bytes.\n * @param {object} [options] Probe options.\n * @returns {object} Support/probe report.\n */\n static probeSupport(input, options = {})\n {\n return probeCodecSupportWithValues(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * Convert format output into JSON-compatible debug data.\n *\n * @param {any} value Format output.\n * @returns {any} JSON-compatible value.\n */\n static toJSON(value)\n {\n return toJsonValue(value);\n }\n\n /**\n * Test whether bytes look like a Wwise media container.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Candidate wem bytes.\n * @returns {boolean} True when RIFF/RIFX WAVE signatures are present.\n */\n static isWEM(input)\n {\n try\n {\n return isWEM(asUint8Array(input, \"Wem input\"));\n }\n catch\n {\n return false;\n }\n }\n\n /**\n * Repack Wwise Vorbis wem bytes into a standard Ogg Vorbis stream.\n *\n * Lossless container transform (no audio decode/re-encode); output plays\n * natively where Ogg Vorbis is supported. Equivalent to\n * `read(input, { emit: \"ogg\" })`.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Wem bytes.\n * @param {object} [options] Options, including a `codebooks` override.\n * @returns {object} Ogg payload with bytes, timing, and loop metadata.\n */\n static toOgg(input, options = {})\n {\n return CjsWemFormat.read(input, { ...options, emit: OUTPUT_OGG });\n }\n\n /**\n * Decode wem audio data to per-channel float32 PCM (AudioBuffer-ready).\n *\n * Covers Wwise PTADPCM (0x8311) and uncompressed 16-bit PCM. Wwise Vorbis\n * is not decoded here - repack it with `toOgg()` instead. Equivalent to\n * `read(input, { emit: \"pcm\" })`.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Wem bytes.\n * @param {object} [options] Read options.\n * @returns {object} PCM payload with channelData, sample rate, and timing.\n */\n static toPcm(input, options = {})\n {\n return CjsWemFormat.read(input, { ...options, emit: OUTPUT_PCM });\n }\n\n /**\n * Emit targets for this format (canonical frozen enum).\n */\n static Output = Object.freeze({\n RAW: OUTPUT_RAW,\n JSON: OUTPUT_JSON,\n WEM_JSON: OUTPUT_WEM_JSON,\n OGG: OUTPUT_OGG,\n PCM: OUTPUT_PCM\n });\n static CODEC_NAMES = WEM_CODEC_NAMES;\n static id = \"wem\";\n static mediaTypes = Object.freeze([ \"audio\" ]);\n static outputs = CjsFormat.defineOutputs({\n raw: { default: true, passthrough: true },\n ogg: { },\n pcm: { decoded: true },\n wemJson: { role: \"debug\", probes: [ \"wemJson\", \"raw\" ] }\n });\n static extensions = Object.freeze([ \".wem\" ]);\n}\n\nexport default CjsWemFormat;\n"],"names":["FORMAT_NAME","CjsWemFormat","CjsFormat","DEFAULT_VALUES","worker","Object","freeze","module","import","meta","url","exportName","outputTypes","OUTPUT_RAW","OUTPUT_OGG","OUTPUT_PCM","OUTPUT_WEM_JSON","defaultOutput","constructor","options","SetValues","normalizeValues","GetValues","Read","input","readWithValues","ReadAsync","Inspect","inspectWithValues","ToJSON","value","toJsonValue","read","readAsync","inspect","probeSupport","probeCodecSupportWithValues","toJSON","isWEM","asUint8Array","toOgg","emit","toPcm","Output","RAW","JSON","OUTPUT_JSON","WEM_JSON","OGG","PCM","CODEC_NAMES","WEM_CODEC_NAMES","id","mediaTypes","outputs","defineOutputs","raw","default","passthrough","ogg","pcm","decoded","wemJson","role","probes","extensions"],"mappings":";;;;;AAmBA,MAAMA,WAAW,GAAG,cAAc;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,YAAY,SAASC,SAAS,CAC3C;EACI,OAAO,GAAGC,cAAc;;AAExB;AACJ;AACA;AACI,EAAA,OAAOC,MAAM,GAAGC,MAAM,CAACC,MAAM,CAAC;AAC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AAAA,OAAO,EAAE,IAAI;AAAEC,MAAAA,WAAW,EAAE;KAAM;IACzCC,GAAG,EAAE,EAAI;AACTC,IAAAA,GAAG,EAAE;AAAEC,MAAAA,OAAO,EAAE;KAAM;AACtBC,IAAAA,OAAO,EAAE;AAAEC,MAAAA,IAAI,EAAE,OAAO;AAAEC,MAAAA,MAAM,EAAE,CAAE,SAAS,EAAE,KAAK;AAAG;AAC3D,GAAC,CAAC;EACF,OAAOC,UAAU,GAAG5D,MAAM,CAACC,MAAM,CAAC,CAAE,MAAM,CAAE,CAAC;AACjD;;;;"}
|
|
1
|
+
{"version":3,"file":"CjsWemFormat.js","sources":["../../../../../src/resource/formats/wem/CjsWemFormat.js"],"sourcesContent":["import { asUint8Array } from \"#utils/bytes\";\nimport { CjsFormat } from \"../../format/CjsFormat.js\";\nimport {\n DEFAULT_VALUES,\n OUTPUT_JSON,\n OUTPUT_OGG,\n OUTPUT_PCM,\n OUTPUT_RAW,\n OUTPUT_WEM_JSON,\n WEM_CODEC_NAMES,\n inspectWithValues,\n probeSupportWithValues,\n isWEM,\n normalizeValues,\n readWithValues,\n toJsonValue\n} from \"./core/helpers.js\";\nimport { probeCodecSupportWithValues } from \"./core/probeCodecSupport.js\";\n\nconst FORMAT_NAME = \"CjsWemFormat\";\n\n/**\n * Reader for Audiokinetic Wwise media (.wem) containers.\n *\n * Inspection identifies the codec, channel/rate layout, and Vorbis duration\n * without decoding audio data. Read emits the container bytes untouched by\n * default; `emit: \"ogg\"` repacks Wwise Vorbis into a standard Ogg stream and\n * `emit: \"pcm\"` decodes PTADPCM / 16-bit PCM media to float32 samples.\n */\nexport class CjsWemFormat extends CjsFormat\n{\n #values = DEFAULT_VALUES;\n\n /**\n * Browser-worker module declaration consumed by CjsResManWorkerLoader.\n */\n static worker = Object.freeze({\n module: import.meta.url,\n exportName: \"CjsWemFormat\",\n outputTypes: Object.freeze([ OUTPUT_RAW, OUTPUT_OGG, OUTPUT_PCM, OUTPUT_WEM_JSON ]),\n defaultOutput: OUTPUT_RAW\n });\n\n /**\n * Create a reusable wem format profile.\n *\n * @param {object} [options] Default read/inspect options.\n */\n constructor(options = {})\n {\n super();\n this.SetValues(options);\n }\n\n /**\n * Merge options into this profile.\n *\n * @param {object} [options] Values to merge.\n * @returns {CjsWemFormat} This format profile.\n */\n SetValues(options = {})\n {\n this.#values = normalizeValues(this.#values, options, FORMAT_NAME);\n return this;\n }\n\n /**\n * Get normalized profile values with optional per-call overrides.\n *\n * @param {object} [options] Per-call values.\n * @returns {object} Normalized read values.\n */\n GetValues(options = {})\n {\n return normalizeValues(this.#values, options, FORMAT_NAME);\n }\n\n /**\n * Read wem bytes with this profile.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Wem bytes.\n * @param {object} [options] Per-call values.\n * @returns {object} GPU-free raw/debug payload for the selected emit target.\n */\n Read(input, options = {})\n {\n return readWithValues(input, this.GetValues(options));\n }\n\n /**\n * Read wem bytes asynchronously with this profile.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Wem bytes.\n * @param {object} [options] Per-call values.\n * @returns {Promise<object>} GPU-free raw/debug payload for the selected emit target.\n */\n async ReadAsync(input, options = {})\n {\n return this.Read(input, options);\n }\n\n /**\n * Inspect wem bytes without decoding audio data.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Wem bytes.\n * @param {object} [options] Per-call values.\n * @returns {object} Wwise container metadata.\n */\n Inspect(input, options = {})\n {\n return inspectWithValues(input, this.GetValues(options));\n }\n\n /**\n * Convert format output into JSON-compatible debug data.\n *\n * @param {any} value Format output.\n * @returns {any} JSON-compatible value.\n */\n ToJSON(value)\n {\n return toJsonValue(value);\n }\n\n /**\n * One-shot wem read.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Wem bytes.\n * @param {object} [options] Read options.\n * @returns {object} GPU-free raw/debug payload for the selected emit target.\n */\n static read(input, options = {})\n {\n return readWithValues(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * One-shot asynchronous wem read.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Wem bytes.\n * @param {object} [options] Read options.\n * @returns {Promise<object>} GPU-free raw/debug payload for the selected emit target.\n */\n static async readAsync(input, options = {})\n {\n return CjsWemFormat.read(input, options);\n }\n\n /**\n * One-shot wem inspection.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Wem bytes.\n * @param {object} [options] Inspect options.\n * @returns {object} Wwise container metadata.\n */\n static inspect(input, options = {})\n {\n return inspectWithValues(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * One-shot wem support probe.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Wem bytes.\n * @param {object} [options] Probe options.\n * @returns {object} Support/probe report.\n */\n static probeSupport(input, options = {})\n {\n return probeCodecSupportWithValues(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * Convert format output into JSON-compatible debug data.\n *\n * @param {any} value Format output.\n * @returns {any} JSON-compatible value.\n */\n static toJSON(value)\n {\n return toJsonValue(value);\n }\n\n /**\n * Test whether bytes look like a Wwise media container.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Candidate wem bytes.\n * @returns {boolean} True when RIFF/RIFX WAVE signatures are present.\n */\n static isWEM(input)\n {\n try\n {\n return isWEM(asUint8Array(input, \"Wem input\"));\n }\n catch\n {\n return false;\n }\n }\n\n /**\n * Repack Wwise Vorbis wem bytes into a standard Ogg Vorbis stream.\n *\n * Lossless container transform (no audio decode/re-encode); output plays\n * natively where Ogg Vorbis is supported. Equivalent to\n * `read(input, { emit: \"ogg\" })`.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Wem bytes.\n * @param {object} [options] Options, including a `codebooks` override.\n * @returns {object} Ogg payload with bytes, timing, and loop metadata.\n */\n static toOgg(input, options = {})\n {\n return CjsWemFormat.read(input, { ...options, emit: OUTPUT_OGG });\n }\n\n /**\n * Decode wem audio data to per-channel float32 PCM (AudioBuffer-ready).\n *\n * Covers Wwise PTADPCM (0x8311) and uncompressed 16-bit PCM. Wwise Vorbis\n * is not decoded here - repack it with `toOgg()` instead. Equivalent to\n * `read(input, { emit: \"pcm\" })`.\n *\n * @param {Uint8Array|ArrayBuffer|DataView} input Wem bytes.\n * @param {object} [options] Read options.\n * @returns {object} PCM payload with channelData, sample rate, and timing.\n */\n static toPcm(input, options = {})\n {\n return CjsWemFormat.read(input, { ...options, emit: OUTPUT_PCM });\n }\n\n /**\n * Emit targets for this format (canonical frozen enum).\n */\n static Output = Object.freeze({\n RAW: OUTPUT_RAW,\n JSON: OUTPUT_JSON,\n WEM_JSON: OUTPUT_WEM_JSON,\n OGG: OUTPUT_OGG,\n PCM: OUTPUT_PCM\n });\n static CODEC_NAMES = WEM_CODEC_NAMES;\n static id = \"wem\";\n static mediaTypes = Object.freeze([ \"audio\" ]);\n static outputs = CjsFormat.defineOutputs({\n raw: { default: true, passthrough: true },\n ogg: { },\n pcm: { decoded: true },\n wemJson: { role: \"debug\", probes: [ \"wemJson\", \"raw\" ] }\n });\n static extensions = Object.freeze([ \".wem\" ]);\n}\n\nexport default CjsWemFormat;\n"],"names":["FORMAT_NAME","CjsWemFormat","CjsFormat","DEFAULT_VALUES","worker","Object","freeze","module","import","meta","url","exportName","outputTypes","OUTPUT_RAW","OUTPUT_OGG","OUTPUT_PCM","OUTPUT_WEM_JSON","defaultOutput","constructor","options","SetValues","normalizeValues","GetValues","Read","input","readWithValues","ReadAsync","Inspect","inspectWithValues","ToJSON","value","toJsonValue","read","readAsync","inspect","probeSupport","probeCodecSupportWithValues","toJSON","isWEM","asUint8Array","toOgg","emit","toPcm","Output","RAW","JSON","OUTPUT_JSON","WEM_JSON","OGG","PCM","CODEC_NAMES","WEM_CODEC_NAMES","id","mediaTypes","outputs","defineOutputs","raw","default","passthrough","ogg","pcm","decoded","wemJson","role","probes","extensions"],"mappings":";;;;;;AAmBA,MAAMA,WAAW,GAAG,cAAc;;AAElC;AACA;AACA;AACA;AACA;AACA;A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GhD,MAAM,CAACC,MAAM,CAAC,CAAE,OAAO,CAAE,CAAC;AAC9C,EAAA,OAAOgD,OAAO,GAAGpD,SAAS,CAACqD,aAAa,CAAC;AACrCC,IAAAA,GAAG,EAAE;AAAEC,MAAAA,OAAO,EAAE,IAAI;AAAEC,MAAAA,WAAW,EAAE;KAAM;IACzCC,GAAG,EAAE,EAAI;AACTC,IAAAA,GAAG,EAAE;AAAEC,MAAAA,OAAO,EAAE;KAAM;AACtBC,IAAAA,OAAO,EAAE;AAAEC,MAAAA,IAAI,EAAE,OAAO;AAAEC,MAAAA,MAAM,EAAE,CAAE,SAAS,EAAE,KAAK;AAAG;AAC3D,GAAC,CAAC;EACF,OAAOC,UAAU,GAAG5D,MAAM,CAACC,MAAM,CAAC,CAAE,MAAM,CAAE,CAAC;AACjD;;;;"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
1
|
+
import { CjsBitReader } from '../../../format/CjsBitReader.js';
|
|
2
|
+
import { CjsFormatRangeError } from '../../../format/CjsFormatError.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Bit-level IO for Wwise Vorbis repacking.
|
|
6
|
+
*
|
|
7
|
+
* Vorbis bitstreams are LSB-first within each byte; both the reader and the
|
|
8
|
+
* Ogg writer here follow that convention. The writer assembles one Ogg page
|
|
9
|
+
* per packet (identification, comment, setup, then one page per audio
|
|
10
|
+
* packet), matching the ww2ogg reference behavior.
|
|
8
11
|
*/
|
|
9
12
|
|
|
10
13
|
const OGG_HEADER_BYTES = 27;
|
|
@@ -24,13 +27,13 @@ function buildCrcTable() {
|
|
|
24
27
|
return table;
|
|
25
28
|
}
|
|
26
29
|
|
|
27
|
-
/**
|
|
28
|
-
* Compute the Ogg page checksum (forward CRC-32, polynomial 0x04c11db7,
|
|
29
|
-
* zero initial value, no final xor).
|
|
30
|
-
*
|
|
31
|
-
* @param {Uint8Array} bytes Page bytes with the checksum field zeroed.
|
|
32
|
-
* @param {number} length Number of bytes to include.
|
|
33
|
-
* @returns {number} Unsigned 32-bit checksum.
|
|
30
|
+
/**
|
|
31
|
+
* Compute the Ogg page checksum (forward CRC-32, polynomial 0x04c11db7,
|
|
32
|
+
* zero initial value, no final xor).
|
|
33
|
+
*
|
|
34
|
+
* @param {Uint8Array} bytes Page bytes with the checksum field zeroed.
|
|
35
|
+
* @param {number} length Number of bytes to include.
|
|
36
|
+
* @returns {number} Unsigned 32-bit checksum.
|
|
34
37
|
*/
|
|
35
38
|
function oggChecksum(bytes, length) {
|
|
36
39
|
let crc = 0;
|
|
@@ -40,75 +43,49 @@ function oggChecksum(bytes, length) {
|
|
|
40
43
|
return crc;
|
|
41
44
|
}
|
|
42
45
|
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
46
|
+
/**
|
|
47
|
+
* Error raised when a Wwise Vorbis bitstream runs out mid-read.
|
|
48
|
+
*
|
|
49
|
+
* The `code` is the package-wide truncation code, which `CjsFormatReadError`
|
|
50
|
+
* does not itself carry.
|
|
45
51
|
*/
|
|
46
|
-
class
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Create a reader over `bytes` starting at `offset`.
|
|
55
|
-
*
|
|
56
|
-
* @param {Uint8Array} bytes Source bytes.
|
|
57
|
-
* @param {number} [offset] Starting byte offset.
|
|
58
|
-
*/
|
|
59
|
-
constructor(bytes, offset = 0) {
|
|
60
|
-
this.#bytes = bytes;
|
|
61
|
-
this.#position = offset;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Read a single bit.
|
|
66
|
-
*
|
|
67
|
-
* @returns {number} 0 or 1.
|
|
68
|
-
*/
|
|
69
|
-
readBit() {
|
|
70
|
-
if (this.#bitsLeft === 0) {
|
|
71
|
-
if (this.#position >= this.#bytes.length) {
|
|
72
|
-
const error = new Error("wem: bitstream out of bits");
|
|
73
|
-
error.code = "CJS_FORMAT_TRUNCATED";
|
|
74
|
-
throw error;
|
|
75
|
-
}
|
|
76
|
-
this.#bitBuffer = this.#bytes[this.#position++];
|
|
77
|
-
this.#bitsLeft = 8;
|
|
78
|
-
}
|
|
79
|
-
const bit = this.#bitBuffer & 1;
|
|
80
|
-
this.#bitBuffer >>= 1;
|
|
81
|
-
this.#bitsLeft--;
|
|
82
|
-
this.#totalBitsRead++;
|
|
83
|
-
return bit;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Read `count` bits as an unsigned integer (LSB-first).
|
|
88
|
-
*
|
|
89
|
-
* @param {number} count Bit count (0..32).
|
|
90
|
-
* @returns {number} Unsigned value.
|
|
91
|
-
*/
|
|
92
|
-
readBits(count) {
|
|
93
|
-
let value = 0;
|
|
94
|
-
for (let i = 0; i < count; i++) {
|
|
95
|
-
if (this.readBit()) value |= 1 << i;
|
|
96
|
-
}
|
|
97
|
-
return value >>> 0;
|
|
52
|
+
class WemBitstreamError extends CjsFormatRangeError {
|
|
53
|
+
/** Creates a truncation error with the cursor state that produced it. */
|
|
54
|
+
constructor(message, details = {}) {
|
|
55
|
+
super(message, details);
|
|
56
|
+
this.name = "WemBitstreamError";
|
|
57
|
+
this.code = "CJS_FORMAT_TRUNCATED";
|
|
98
58
|
}
|
|
59
|
+
}
|
|
99
60
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
61
|
+
/**
|
|
62
|
+
* LSB-first bit reader over a byte range.
|
|
63
|
+
*
|
|
64
|
+
* The bit cursor itself is shared (`CjsBitReader`); Vorbis is LSB-first, which
|
|
65
|
+
* is the shared convention. Only the error identity is Wwise's own: a truncated
|
|
66
|
+
* bitstream here is a truncated FILE, so it throws rather than reporting a
|
|
67
|
+
* recoverable end-of-packet the way the Ogg packet reader does.
|
|
68
|
+
*/
|
|
69
|
+
class BitReader extends CjsBitReader {
|
|
70
|
+
static ReadError = WemBitstreamError;
|
|
71
|
+
static endOfDataMessage = "wem: bitstream out of bits";
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Create a reader over `bytes` starting at `offset`.
|
|
75
|
+
*
|
|
76
|
+
* @param {Uint8Array} bytes Source bytes.
|
|
77
|
+
* @param {number} [offset] Starting byte offset.
|
|
104
78
|
*/
|
|
105
|
-
|
|
106
|
-
|
|
79
|
+
constructor(bytes, offset = 0) {
|
|
80
|
+
super(bytes, {
|
|
81
|
+
offset,
|
|
82
|
+
source: "wem"
|
|
83
|
+
});
|
|
107
84
|
}
|
|
108
85
|
}
|
|
109
86
|
|
|
110
|
-
/**
|
|
111
|
-
* LSB-first bit writer that assembles Ogg pages, one packet per page.
|
|
87
|
+
/**
|
|
88
|
+
* LSB-first bit writer that assembles Ogg pages, one packet per page.
|
|
112
89
|
*/
|
|
113
90
|
class OggPageWriter {
|
|
114
91
|
#pages = [];
|
|
@@ -121,10 +98,10 @@ class OggPageWriter {
|
|
|
121
98
|
#first = true;
|
|
122
99
|
#continued = false;
|
|
123
100
|
|
|
124
|
-
/**
|
|
125
|
-
* Write a single bit.
|
|
126
|
-
*
|
|
127
|
-
* @param {number|boolean} bit Bit value.
|
|
101
|
+
/**
|
|
102
|
+
* Write a single bit.
|
|
103
|
+
*
|
|
104
|
+
* @param {number|boolean} bit Bit value.
|
|
128
105
|
*/
|
|
129
106
|
writeBit(bit) {
|
|
130
107
|
if (bit) this.#bitBuffer |= 1 << this.#bitsStored;
|
|
@@ -132,11 +109,11 @@ class OggPageWriter {
|
|
|
132
109
|
if (this.#bitsStored === 8) this.#flushBits();
|
|
133
110
|
}
|
|
134
111
|
|
|
135
|
-
/**
|
|
136
|
-
* Write `count` bits of `value` (LSB-first).
|
|
137
|
-
*
|
|
138
|
-
* @param {number} value Unsigned value.
|
|
139
|
-
* @param {number} count Bit count (0..32).
|
|
112
|
+
/**
|
|
113
|
+
* Write `count` bits of `value` (LSB-first).
|
|
114
|
+
*
|
|
115
|
+
* @param {number} value Unsigned value.
|
|
116
|
+
* @param {number} count Bit count (0..32).
|
|
140
117
|
*/
|
|
141
118
|
writeBits(value, count) {
|
|
142
119
|
for (let i = 0; i < count; i++) {
|
|
@@ -144,10 +121,10 @@ class OggPageWriter {
|
|
|
144
121
|
}
|
|
145
122
|
}
|
|
146
123
|
|
|
147
|
-
/**
|
|
148
|
-
* Set the granule position recorded on the next flushed page.
|
|
149
|
-
*
|
|
150
|
-
* @param {number} granule Unsigned granule position (< 2^53).
|
|
124
|
+
/**
|
|
125
|
+
* Set the granule position recorded on the next flushed page.
|
|
126
|
+
*
|
|
127
|
+
* @param {number} granule Unsigned granule position (< 2^53).
|
|
151
128
|
*/
|
|
152
129
|
setGranule(granule) {
|
|
153
130
|
this.#granule = granule;
|
|
@@ -166,10 +143,10 @@ class OggPageWriter {
|
|
|
166
143
|
this.#bitBuffer = 0;
|
|
167
144
|
}
|
|
168
145
|
|
|
169
|
-
/**
|
|
170
|
-
* Finish the current packet and emit it as one Ogg page.
|
|
171
|
-
*
|
|
172
|
-
* @param {boolean} [last] Mark this page as end-of-stream.
|
|
146
|
+
/**
|
|
147
|
+
* Finish the current packet and emit it as one Ogg page.
|
|
148
|
+
*
|
|
149
|
+
* @param {boolean} [last] Mark this page as end-of-stream.
|
|
173
150
|
*/
|
|
174
151
|
flushPage(last = false) {
|
|
175
152
|
this.#flushBits();
|
|
@@ -208,10 +185,10 @@ class OggPageWriter {
|
|
|
208
185
|
this.#payloadBytes = 0;
|
|
209
186
|
}
|
|
210
187
|
|
|
211
|
-
/**
|
|
212
|
-
* Concatenate all flushed pages into one buffer.
|
|
213
|
-
*
|
|
214
|
-
* @returns {Uint8Array} Complete Ogg stream bytes.
|
|
188
|
+
/**
|
|
189
|
+
* Concatenate all flushed pages into one buffer.
|
|
190
|
+
*
|
|
191
|
+
* @returns {Uint8Array} Complete Ogg stream bytes.
|
|
215
192
|
*/
|
|
216
193
|
toBytes() {
|
|
217
194
|
let total = 0;
|
|
@@ -225,10 +202,10 @@ class OggPageWriter {
|
|
|
225
202
|
return bytes;
|
|
226
203
|
}
|
|
227
204
|
|
|
228
|
-
/**
|
|
229
|
-
* Number of pages flushed so far.
|
|
230
|
-
*
|
|
231
|
-
* @returns {number} Page count.
|
|
205
|
+
/**
|
|
206
|
+
* Number of pages flushed so far.
|
|
207
|
+
*
|
|
208
|
+
* @returns {number} Page count.
|
|
232
209
|
*/
|
|
233
210
|
get pageCount() {
|
|
234
211
|
return this.#pages.length;
|
|
@@ -241,11 +218,11 @@ function writeU32(bytes, offset, value) {
|
|
|
241
218
|
bytes[offset + 3] = value >>> 24 & 0xff;
|
|
242
219
|
}
|
|
243
220
|
|
|
244
|
-
/**
|
|
245
|
-
* Smallest number of bits needed to represent `value` (Vorbis ilog).
|
|
246
|
-
*
|
|
247
|
-
* @param {number} value Unsigned value.
|
|
248
|
-
* @returns {number} Bit count; 0 when value is 0.
|
|
221
|
+
/**
|
|
222
|
+
* Smallest number of bits needed to represent `value` (Vorbis ilog).
|
|
223
|
+
*
|
|
224
|
+
* @param {number} value Unsigned value.
|
|
225
|
+
* @returns {number} Bit count; 0 when value is 0.
|
|
249
226
|
*/
|
|
250
227
|
function ilog(value) {
|
|
251
228
|
let result = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitStream.js","sources":["../../../../../../src/resource/formats/wem/core/bitStream.js"],"sourcesContent":["/**\r\n * Bit-level IO for Wwise Vorbis repacking.\r\n *\r\n * Vorbis bitstreams are LSB-first within each byte; both the reader and the\r\n * Ogg writer here follow that convention. The writer assembles one Ogg page\r\n * per packet (identification, comment, setup, then one page per audio\r\n * packet), matching the ww2ogg reference behavior.\r\n */\r\n\r\nconst OGG_HEADER_BYTES = 27;\r\nconst OGG_MAX_SEGMENTS = 255;\r\nconst OGG_SEGMENT_SIZE = 255;\r\nconst OGG_MAX_PAYLOAD = OGG_MAX_SEGMENTS * OGG_SEGMENT_SIZE;\r\n\r\nconst CRC_TABLE = buildCrcTable();\r\n\r\nfunction buildCrcTable()\r\n{\r\n const table = new Uint32Array(256);\r\n for (let i = 0; i < 256; i++)\r\n {\r\n let r = (i << 24) >>> 0;\r\n for (let bit = 0; bit < 8; bit++)\r\n {\r\n r = ((r & 0x80000000) ? ((r << 1) ^ 0x04c11db7) : (r << 1)) >>> 0;\r\n }\r\n table[i] = r;\r\n }\r\n return table;\r\n}\r\n\r\n/**\r\n * Compute the Ogg page checksum (forward CRC-32, polynomial 0x04c11db7,\r\n * zero initial value, no final xor).\r\n *\r\n * @param {Uint8Array} bytes Page bytes with the checksum field zeroed.\r\n * @param {number} length Number of bytes to include.\r\n * @returns {number} Unsigned 32-bit checksum.\r\n */\r\nexport function oggChecksum(bytes, length)\r\n{\r\n let crc = 0;\r\n for (let i = 0; i < length; i++)\r\n {\r\n crc = (((crc << 8) >>> 0) ^ CRC_TABLE[((crc >>> 24) ^ bytes[i]) & 0xff]) >>> 0;\r\n }\r\n return crc;\r\n}\r\n\r\n/**\r\n * LSB-first bit reader over a byte range.\r\n */\r\nexport class BitReader\r\n{\r\n #bytes;\r\n #position;\r\n #bitBuffer = 0;\r\n #bitsLeft = 0;\r\n #totalBitsRead = 0;\r\n\r\n /**\r\n * Create a reader over `bytes` starting at `offset`.\r\n *\r\n * @param {Uint8Array} bytes Source bytes.\r\n * @param {number} [offset] Starting byte offset.\r\n */\r\n constructor(bytes, offset = 0)\r\n {\r\n this.#bytes = bytes;\r\n this.#position = offset;\r\n }\r\n\r\n /**\r\n * Read a single bit.\r\n *\r\n * @returns {number} 0 or 1.\r\n */\r\n readBit()\r\n {\r\n if (this.#bitsLeft === 0)\r\n {\r\n if (this.#position >= this.#bytes.length)\r\n {\r\n const error = new Error(\"wem: bitstream out of bits\");\r\n error.code = \"CJS_FORMAT_TRUNCATED\";\r\n throw error;\r\n }\r\n this.#bitBuffer = this.#bytes[this.#position++];\r\n this.#bitsLeft = 8;\r\n }\r\n const bit = this.#bitBuffer & 1;\r\n this.#bitBuffer >>= 1;\r\n this.#bitsLeft--;\r\n this.#totalBitsRead++;\r\n return bit;\r\n }\r\n\r\n /**\r\n * Read `count` bits as an unsigned integer (LSB-first).\r\n *\r\n * @param {number} count Bit count (0..32).\r\n * @returns {number} Unsigned value.\r\n */\r\n readBits(count)\r\n {\r\n let value = 0;\r\n for (let i = 0; i < count; i++)\r\n {\r\n if (this.readBit()) value |= (1 << i);\r\n }\r\n return value >>> 0;\r\n }\r\n\r\n /**\r\n * Total bits consumed so far.\r\n *\r\n * @returns {number} Bit count.\r\n */\r\n get totalBitsRead()\r\n {\r\n return this.#totalBitsRead;\r\n }\r\n}\r\n\r\n/**\r\n * LSB-first bit writer that assembles Ogg pages, one packet per page.\r\n */\r\nexport class OggPageWriter\r\n{\r\n #pages = [];\r\n #payload = new Uint8Array(OGG_MAX_PAYLOAD);\r\n #payloadBytes = 0;\r\n #bitBuffer = 0;\r\n #bitsStored = 0;\r\n #granule = 0;\r\n #sequenceNumber = 0;\r\n #first = true;\r\n #continued = false;\r\n\r\n /**\r\n * Write a single bit.\r\n *\r\n * @param {number|boolean} bit Bit value.\r\n */\r\n writeBit(bit)\r\n {\r\n if (bit) this.#bitBuffer |= (1 << this.#bitsStored);\r\n this.#bitsStored++;\r\n if (this.#bitsStored === 8) this.#flushBits();\r\n }\r\n\r\n /**\r\n * Write `count` bits of `value` (LSB-first).\r\n *\r\n * @param {number} value Unsigned value.\r\n * @param {number} count Bit count (0..32).\r\n */\r\n writeBits(value, count)\r\n {\r\n for (let i = 0; i < count; i++)\r\n {\r\n this.writeBit((value >>> i) & 1);\r\n }\r\n }\r\n\r\n /**\r\n * Set the granule position recorded on the next flushed page.\r\n *\r\n * @param {number} granule Unsigned granule position (< 2^53).\r\n */\r\n setGranule(granule)\r\n {\r\n this.#granule = granule;\r\n }\r\n\r\n /** Flushes bits into the current WEM binary writer output. */\r\n #flushBits()\r\n {\r\n if (this.#bitsStored === 0) return;\r\n if (this.#payloadBytes === OGG_MAX_PAYLOAD)\r\n {\r\n const error = new Error(\"wem: packet too large for one Ogg page\");\r\n error.code = \"CJS_FORMAT_OUTPUT_NOT_SUPPORTED\";\r\n throw error;\r\n }\r\n this.#payload[this.#payloadBytes++] = this.#bitBuffer;\r\n this.#bitsStored = 0;\r\n this.#bitBuffer = 0;\r\n }\r\n\r\n /**\r\n * Finish the current packet and emit it as one Ogg page.\r\n *\r\n * @param {boolean} [last] Mark this page as end-of-stream.\r\n */\r\n flushPage(last = false)\r\n {\r\n this.#flushBits();\r\n if (this.#payloadBytes === 0) return;\r\n\r\n const payloadBytes = this.#payloadBytes;\r\n let segments = Math.floor((payloadBytes + OGG_SEGMENT_SIZE) / OGG_SEGMENT_SIZE);\r\n if (segments === OGG_MAX_SEGMENTS + 1) segments = OGG_MAX_SEGMENTS;\r\n\r\n const page = new Uint8Array(OGG_HEADER_BYTES + segments + payloadBytes);\r\n page[0] = 0x4f;\r\n page[1] = 0x67;\r\n page[2] = 0x67;\r\n page[3] = 0x53;\r\n page[4] = 0;\r\n page[5] = (this.#continued ? 1 : 0) | (this.#first ? 2 : 0) | (last ? 4 : 0);\r\n writeU32(page, 6, this.#granule % 0x100000000);\r\n writeU32(page, 10, Math.floor(this.#granule / 0x100000000));\r\n writeU32(page, 14, 1);\r\n writeU32(page, 18, this.#sequenceNumber);\r\n writeU32(page, 22, 0);\r\n page[26] = segments;\r\n\r\n let bytesLeft = payloadBytes;\r\n for (let i = 0; i < segments; i++)\r\n {\r\n if (bytesLeft >= OGG_SEGMENT_SIZE)\r\n {\r\n page[27 + i] = OGG_SEGMENT_SIZE;\r\n bytesLeft -= OGG_SEGMENT_SIZE;\r\n }\r\n else\r\n {\r\n page[27 + i] = bytesLeft;\r\n }\r\n }\r\n\r\n page.set(this.#payload.subarray(0, payloadBytes), OGG_HEADER_BYTES + segments);\r\n writeU32(page, 22, oggChecksum(page, page.length));\r\n\r\n this.#pages.push(page);\r\n this.#sequenceNumber++;\r\n this.#first = false;\r\n this.#continued = false;\r\n this.#payloadBytes = 0;\r\n }\r\n\r\n /**\r\n * Concatenate all flushed pages into one buffer.\r\n *\r\n * @returns {Uint8Array} Complete Ogg stream bytes.\r\n */\r\n toBytes()\r\n {\r\n let total = 0;\r\n for (const page of this.#pages) total += page.length;\r\n const bytes = new Uint8Array(total);\r\n let offset = 0;\r\n for (const page of this.#pages)\r\n {\r\n bytes.set(page, offset);\r\n offset += page.length;\r\n }\r\n return bytes;\r\n }\r\n\r\n /**\r\n * Number of pages flushed so far.\r\n *\r\n * @returns {number} Page count.\r\n */\r\n get pageCount()\r\n {\r\n return this.#pages.length;\r\n }\r\n}\r\n\r\nfunction writeU32(bytes, offset, value)\r\n{\r\n bytes[offset] = value & 0xff;\r\n bytes[offset + 1] = (value >>> 8) & 0xff;\r\n bytes[offset + 2] = (value >>> 16) & 0xff;\r\n bytes[offset + 3] = (value >>> 24) & 0xff;\r\n}\r\n\r\n/**\r\n * Smallest number of bits needed to represent `value` (Vorbis ilog).\r\n *\r\n * @param {number} value Unsigned value.\r\n * @returns {number} Bit count; 0 when value is 0.\r\n */\r\nexport function ilog(value)\r\n{\r\n let result = 0;\r\n let v = value >>> 0;\r\n while (v)\r\n {\r\n result++;\r\n v >>>= 1;\r\n }\r\n return result;\r\n}\r\n"],"names":["OGG_HEADER_BYTES","OGG_MAX_SEGMENTS","OGG_SEGMENT_SIZE","OGG_MAX_PAYLOAD","CRC_TABLE","buildCrcTable","table","Uint32Array","i","r","bit","oggChecksum","bytes","length","crc","BitReader","constructor","offset","readBit","error","Error","code","readBits","count","value","totalBitsRead","OggPageWriter","Uint8Array","writeBit","writeBits","setGranule","granule","#flushBits","flushPage","last","payloadBytes","segments","Math","floor","page","writeU32","bytesLeft","set","subarray","push","toBytes","total","pageCount","ilog","result","v"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,gBAAgB,GAAG,EAAE;AAC3B,MAAMC,gBAAgB,GAAG,GAAG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ACRC,IAAAA,CAAC,MAAM,CAAC;AACZ,EAAA;AACA,EAAA,OAAOD,MAAM;AACjB;;;;"}
|
|
1
|
+
{"version":3,"file":"bitStream.js","sources":["../../../../../../src/resource/formats/wem/core/bitStream.js"],"sourcesContent":["/**\n * Bit-level IO for Wwise Vorbis repacking.\n *\n * Vorbis bitstreams are LSB-first within each byte; both the reader and the\n * Ogg writer here follow that convention. The writer assembles one Ogg page\n * per packet (identification, comment, setup, then one page per audio\n * packet), matching the ww2ogg reference behavior.\n */\n\nimport { CjsBitReader } from \"../../../format/CjsBitReader.js\";\nimport { CjsFormatRangeError } from \"../../../format/CjsFormatError.js\";\n\nconst OGG_HEADER_BYTES = 27;\nconst OGG_MAX_SEGMENTS = 255;\nconst OGG_SEGMENT_SIZE = 255;\nconst OGG_MAX_PAYLOAD = OGG_MAX_SEGMENTS * OGG_SEGMENT_SIZE;\n\nconst CRC_TABLE = buildCrcTable();\n\nfunction buildCrcTable()\n{\n const table = new Uint32Array(256);\n for (let i = 0; i < 256; i++)\n {\n let r = (i << 24) >>> 0;\n for (let bit = 0; bit < 8; bit++)\n {\n r = ((r & 0x80000000) ? ((r << 1) ^ 0x04c11db7) : (r << 1)) >>> 0;\n }\n table[i] = r;\n }\n return table;\n}\n\n/**\n * Compute the Ogg page checksum (forward CRC-32, polynomial 0x04c11db7,\n * zero initial value, no final xor).\n *\n * @param {Uint8Array} bytes Page bytes with the checksum field zeroed.\n * @param {number} length Number of bytes to include.\n * @returns {number} Unsigned 32-bit checksum.\n */\nexport function oggChecksum(bytes, length)\n{\n let crc = 0;\n for (let i = 0; i < length; i++)\n {\n crc = (((crc << 8) >>> 0) ^ CRC_TABLE[((crc >>> 24) ^ bytes[i]) & 0xff]) >>> 0;\n }\n return crc;\n}\n\n/**\n * Error raised when a Wwise Vorbis bitstream runs out mid-read.\n *\n * The `code` is the package-wide truncation code, which `CjsFormatReadError`\n * does not itself carry.\n */\nclass WemBitstreamError extends CjsFormatRangeError\n{\n /** Creates a truncation error with the cursor state that produced it. */\n constructor(message, details = {})\n {\n super(message, details);\n this.name = \"WemBitstreamError\";\n this.code = \"CJS_FORMAT_TRUNCATED\";\n }\n}\n\n/**\n * LSB-first bit reader over a byte range.\n *\n * The bit cursor itself is shared (`CjsBitReader`); Vorbis is LSB-first, which\n * is the shared convention. Only the error identity is Wwise's own: a truncated\n * bitstream here is a truncated FILE, so it throws rather than reporting a\n * recoverable end-of-packet the way the Ogg packet reader does.\n */\nexport class BitReader extends CjsBitReader\n{\n static ReadError = WemBitstreamError;\n\n static endOfDataMessage = \"wem: bitstream out of bits\";\n\n /**\n * Create a reader over `bytes` starting at `offset`.\n *\n * @param {Uint8Array} bytes Source bytes.\n * @param {number} [offset] Starting byte offset.\n */\n constructor(bytes, offset = 0)\n {\n super(bytes, { offset, source: \"wem\" });\n }\n}\n\n/**\n * LSB-first bit writer that assembles Ogg pages, one packet per page.\n */\nexport class OggPageWriter\n{\n #pages = [];\n #payload = new Uint8Array(OGG_MAX_PAYLOAD);\n #payloadBytes = 0;\n #bitBuffer = 0;\n #bitsStored = 0;\n #granule = 0;\n #sequenceNumber = 0;\n #first = true;\n #continued = false;\n\n /**\n * Write a single bit.\n *\n * @param {number|boolean} bit Bit value.\n */\n writeBit(bit)\n {\n if (bit) this.#bitBuffer |= (1 << this.#bitsStored);\n this.#bitsStored++;\n if (this.#bitsStored === 8) this.#flushBits();\n }\n\n /**\n * Write `count` bits of `value` (LSB-first).\n *\n * @param {number} value Unsigned value.\n * @param {number} count Bit count (0..32).\n */\n writeBits(value, count)\n {\n for (let i = 0; i < count; i++)\n {\n this.writeBit((value >>> i) & 1);\n }\n }\n\n /**\n * Set the granule position recorded on the next flushed page.\n *\n * @param {number} granule Unsigned granule position (< 2^53).\n */\n setGranule(granule)\n {\n this.#granule = granule;\n }\n\n /** Flushes bits into the current WEM binary writer output. */\n #flushBits()\n {\n if (this.#bitsStored === 0) return;\n if (this.#payloadBytes === OGG_MAX_PAYLOAD)\n {\n const error = new Error(\"wem: packet too large for one Ogg page\");\n error.code = \"CJS_FORMAT_OUTPUT_NOT_SUPPORTED\";\n throw error;\n }\n this.#payload[this.#payloadBytes++] = this.#bitBuffer;\n this.#bitsStored = 0;\n this.#bitBuffer = 0;\n }\n\n /**\n * Finish the current packet and emit it as one Ogg page.\n *\n * @param {boolean} [last] Mark this page as end-of-stream.\n */\n flushPage(last = false)\n {\n this.#flushBits();\n if (this.#payloadBytes === 0) return;\n\n const payloadBytes = this.#payloadBytes;\n let segments = Math.floor((payloadBytes + OGG_SEGMENT_SIZE) / OGG_SEGMENT_SIZE);\n if (segments === OGG_MAX_SEGMENTS + 1) segments = OGG_MAX_SEGMENTS;\n\n const page = new Uint8Array(OGG_HEADER_BYTES + segments + payloadBytes);\n page[0] = 0x4f;\n page[1] = 0x67;\n page[2] = 0x67;\n page[3] = 0x53;\n page[4] = 0;\n page[5] = (this.#continued ? 1 : 0) | (this.#first ? 2 : 0) | (last ? 4 : 0);\n writeU32(page, 6, this.#granule % 0x100000000);\n writeU32(page, 10, Math.floor(this.#granule / 0x100000000));\n writeU32(page, 14, 1);\n writeU32(page, 18, this.#sequenceNumber);\n writeU32(page, 22, 0);\n page[26] = segments;\n\n let bytesLeft = payloadBytes;\n for (let i = 0; i < segments; i++)\n {\n if (bytesLeft >= OGG_SEGMENT_SIZE)\n {\n page[27 + i] = OGG_SEGMENT_SIZE;\n bytesLeft -= OGG_SEGMENT_SIZE;\n }\n else\n {\n page[27 + i] = bytesLeft;\n }\n }\n\n page.set(this.#payload.subarray(0, payloadBytes), OGG_HEADER_BYTES + segments);\n writeU32(page, 22, oggChecksum(page, page.length));\n\n this.#pages.push(page);\n this.#sequenceNumber++;\n this.#first = false;\n this.#continued = false;\n this.#payloadBytes = 0;\n }\n\n /**\n * Concatenate all flushed pages into one buffer.\n *\n * @returns {Uint8Array} Complete Ogg stream bytes.\n */\n toBytes()\n {\n let total = 0;\n for (const page of this.#pages) total += page.length;\n const bytes = new Uint8Array(total);\n let offset = 0;\n for (const page of this.#pages)\n {\n bytes.set(page, offset);\n offset += page.length;\n }\n return bytes;\n }\n\n /**\n * Number of pages flushed so far.\n *\n * @returns {number} Page count.\n */\n get pageCount()\n {\n return this.#pages.length;\n }\n}\n\nfunction writeU32(bytes, offset, value)\n{\n bytes[offset] = value & 0xff;\n bytes[offset + 1] = (value >>> 8) & 0xff;\n bytes[offset + 2] = (value >>> 16) & 0xff;\n bytes[offset + 3] = (value >>> 24) & 0xff;\n}\n\n/**\n * Smallest number of bits needed to represent `value` (Vorbis ilog).\n *\n * @param {number} value Unsigned value.\n * @returns {number} Bit count; 0 when value is 0.\n */\nexport function ilog(value)\n{\n let result = 0;\n let v = value >>> 0;\n while (v)\n {\n result++;\n v >>>= 1;\n }\n return result;\n}\n"],"names":["OGG_HEADER_BYTES","OGG_MAX_SEGMENTS","OGG_SEGMENT_SIZE","OGG_MAX_PAYLOAD","CRC_TABLE","buildCrcTable","table","Uint32Array","i","r","bit","oggChecksum","bytes","length","crc","WemBitstreamError","CjsFormatRangeError","constructor","message","details","name","code","BitReader","CjsBitReader","ReadError","endOfDataMessage","offset","source","OggPageWriter","Uint8Array","writeBit","writeBits","value","count","setGranule","granule","#flushBits","error","Error","flushPage","last","payloadBytes","segments","Math","floor","page","writeU32","bytesLeft","set","subarray","push","toBytes","total","pageCount","ilog","result","v"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,MAAMA,gBAAgB,GAAG,EAAE;AAC3B,MAAMC,gBAAgB,GAAG,GAAG;AAC5B,MAAMC,gBAAgB,GAAG,GAAG;AAC5B,MAAMC,eAAe,GAAGF,gBAAgB,GAAGC,gBAAgB;AAE3D,MAAME,SAAS,GAAGC,aAAa,EAAE;AAEjC,SAASA,aAAaA,GACtB;AACI,EAAA,MAAMC,KAAK,GAAG,IAAIC,WAAW,CAAC,GAAG,CAAC;EAClC,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAG,GAAG,EA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,SAASsB,IAAIA,CAACtB,KAAK,EAC1B;EACI,IAAIuB,MAAM,GAAG,CAAC;AACd,EAAA,IAAIC,CAAC,GAAGxB,KAAK,KAAK,CAAC;AACnB,EAAA,OAAOwB,CAAC,EACR;AACID,IAAAA,MAAM,EAAE;AACRC,IAAAA,CAAC,MAAM,CAAC;AACZ,EAAA;AACA,EAAA,OAAOD,MAAM;AACjB;;;;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { BitReader, ilog } from './bitStream.js';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* Packed Vorbis codebook library handling for Wwise Vorbis repacking.
|
|
5
|
-
*
|
|
6
|
-
* Wwise strips the standard Vorbis codebooks from the setup header and
|
|
7
|
-
* references entries in a shared packed library by 10-bit id. Rebuilding
|
|
8
|
-
* expands each packed codebook back into the standard Vorbis codebook
|
|
9
|
-
* encoding. Behavior mirrors the ww2ogg reference (BSD-licensed, Xiph.org
|
|
10
|
-
* Foundation / Adam Gashlin); this is an original reimplementation.
|
|
3
|
+
/**
|
|
4
|
+
* Packed Vorbis codebook library handling for Wwise Vorbis repacking.
|
|
5
|
+
*
|
|
6
|
+
* Wwise strips the standard Vorbis codebooks from the setup header and
|
|
7
|
+
* references entries in a shared packed library by 10-bit id. Rebuilding
|
|
8
|
+
* expands each packed codebook back into the standard Vorbis codebook
|
|
9
|
+
* encoding. Behavior mirrors the ww2ogg reference (BSD-licensed, Xiph.org
|
|
10
|
+
* Foundation / Adam Gashlin); this is an original reimplementation.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
function parseError(message) {
|
|
@@ -16,15 +16,15 @@ function parseError(message) {
|
|
|
16
16
|
return error;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
/**
|
|
20
|
-
* Parse a packed codebook library blob.
|
|
21
|
-
*
|
|
22
|
-
* Layout: codebook data, then a table of u32-le offsets; the last u32 in the
|
|
23
|
-
* file points at the start of the offset table. Codebook `i` spans
|
|
24
|
-
* offsets[i]..offsets[i+1].
|
|
25
|
-
*
|
|
26
|
-
* @param {Uint8Array} bytes Packed codebook library bytes.
|
|
27
|
-
* @returns {object} Parsed library with `count` usable codebooks.
|
|
19
|
+
/**
|
|
20
|
+
* Parse a packed codebook library blob.
|
|
21
|
+
*
|
|
22
|
+
* Layout: codebook data, then a table of u32-le offsets; the last u32 in the
|
|
23
|
+
* file points at the start of the offset table. Codebook `i` spans
|
|
24
|
+
* offsets[i]..offsets[i+1].
|
|
25
|
+
*
|
|
26
|
+
* @param {Uint8Array} bytes Packed codebook library bytes.
|
|
27
|
+
* @returns {object} Parsed library with `count` usable codebooks.
|
|
28
28
|
*/
|
|
29
29
|
function parseCodebookLibrary(bytes) {
|
|
30
30
|
if (bytes.length < 4) throw parseError("packed codebook library is truncated");
|
|
@@ -46,12 +46,12 @@ function parseCodebookLibrary(bytes) {
|
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
/**
|
|
50
|
-
* Rebuild one packed codebook, referenced by library id, into `writer`.
|
|
51
|
-
*
|
|
52
|
-
* @param {object} library `parseCodebookLibrary` output.
|
|
53
|
-
* @param {number} id Codebook id from the setup header.
|
|
54
|
-
* @param {object} writer OggPageWriter positioned inside the setup packet.
|
|
49
|
+
/**
|
|
50
|
+
* Rebuild one packed codebook, referenced by library id, into `writer`.
|
|
51
|
+
*
|
|
52
|
+
* @param {object} library `parseCodebookLibrary` output.
|
|
53
|
+
* @param {number} id Codebook id from the setup header.
|
|
54
|
+
* @param {object} writer OggPageWriter positioned inside the setup packet.
|
|
55
55
|
*/
|
|
56
56
|
function rebuildCodebookById(library, id, writer) {
|
|
57
57
|
if (id < 0 || id >= library.count) {
|
|
@@ -63,36 +63,36 @@ function rebuildCodebookById(library, id, writer) {
|
|
|
63
63
|
rebuildCodebook(reader, size, writer);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
/**
|
|
67
|
-
* Rebuild one packed codebook from `reader` into the standard Vorbis
|
|
68
|
-
* codebook encoding on `writer`.
|
|
69
|
-
*
|
|
70
|
-
* @param {object} reader BitReader at the start of the packed codebook.
|
|
71
|
-
* @param {number} size Packed codebook size in bytes (0 skips the size check).
|
|
72
|
-
* @param {object} writer OggPageWriter positioned inside the setup packet.
|
|
66
|
+
/**
|
|
67
|
+
* Rebuild one packed codebook from `reader` into the standard Vorbis
|
|
68
|
+
* codebook encoding on `writer`.
|
|
69
|
+
*
|
|
70
|
+
* @param {object} reader BitReader at the start of the packed codebook.
|
|
71
|
+
* @param {number} size Packed codebook size in bytes (0 skips the size check).
|
|
72
|
+
* @param {object} writer OggPageWriter positioned inside the setup packet.
|
|
73
73
|
*/
|
|
74
74
|
function rebuildCodebook(reader, size, writer) {
|
|
75
|
-
const dimensions = reader.
|
|
76
|
-
const entries = reader.
|
|
75
|
+
const dimensions = reader.ReadBits(4);
|
|
76
|
+
const entries = reader.ReadBits(14);
|
|
77
77
|
writer.writeBits(0x564342, 24);
|
|
78
78
|
writer.writeBits(dimensions, 16);
|
|
79
79
|
writer.writeBits(entries, 24);
|
|
80
|
-
const ordered = reader.
|
|
80
|
+
const ordered = reader.ReadBits(1);
|
|
81
81
|
writer.writeBits(ordered, 1);
|
|
82
82
|
if (ordered) {
|
|
83
|
-
const initialLength = reader.
|
|
83
|
+
const initialLength = reader.ReadBits(5);
|
|
84
84
|
writer.writeBits(initialLength, 5);
|
|
85
85
|
let currentEntry = 0;
|
|
86
86
|
while (currentEntry < entries) {
|
|
87
87
|
const bits = ilog(entries - currentEntry);
|
|
88
|
-
const number = reader.
|
|
88
|
+
const number = reader.ReadBits(bits);
|
|
89
89
|
writer.writeBits(number, bits);
|
|
90
90
|
currentEntry += number;
|
|
91
91
|
}
|
|
92
92
|
if (currentEntry > entries) throw parseError("codebook current entry out of range");
|
|
93
93
|
} else {
|
|
94
|
-
const codewordLengthLength = reader.
|
|
95
|
-
const sparse = reader.
|
|
94
|
+
const codewordLengthLength = reader.ReadBits(3);
|
|
95
|
+
const sparse = reader.ReadBits(1);
|
|
96
96
|
if (codewordLengthLength === 0 || codewordLengthLength > 5) {
|
|
97
97
|
throw parseError("nonsense codeword length");
|
|
98
98
|
}
|
|
@@ -100,30 +100,30 @@ function rebuildCodebook(reader, size, writer) {
|
|
|
100
100
|
for (let i = 0; i < entries; i++) {
|
|
101
101
|
let present = true;
|
|
102
102
|
if (sparse) {
|
|
103
|
-
const presentBit = reader.
|
|
103
|
+
const presentBit = reader.ReadBits(1);
|
|
104
104
|
writer.writeBits(presentBit, 1);
|
|
105
105
|
present = presentBit !== 0;
|
|
106
106
|
}
|
|
107
107
|
if (present) {
|
|
108
|
-
const codewordLength = reader.
|
|
108
|
+
const codewordLength = reader.ReadBits(codewordLengthLength);
|
|
109
109
|
writer.writeBits(codewordLength, 5);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
const lookupType = reader.
|
|
113
|
+
const lookupType = reader.ReadBits(1);
|
|
114
114
|
writer.writeBits(lookupType, 4);
|
|
115
115
|
if (lookupType === 1) {
|
|
116
|
-
const min = reader.
|
|
117
|
-
const max = reader.
|
|
118
|
-
const valueLength = reader.
|
|
119
|
-
const sequenceFlag = reader.
|
|
116
|
+
const min = reader.ReadBits(32);
|
|
117
|
+
const max = reader.ReadBits(32);
|
|
118
|
+
const valueLength = reader.ReadBits(4);
|
|
119
|
+
const sequenceFlag = reader.ReadBits(1);
|
|
120
120
|
writer.writeBits(min, 32);
|
|
121
121
|
writer.writeBits(max, 32);
|
|
122
122
|
writer.writeBits(valueLength, 4);
|
|
123
123
|
writer.writeBits(sequenceFlag, 1);
|
|
124
124
|
const quantvals = bookMaptype1Quantvals(entries, dimensions);
|
|
125
125
|
for (let i = 0; i < quantvals; i++) {
|
|
126
|
-
writer.writeBits(reader.
|
|
126
|
+
writer.writeBits(reader.ReadBits(valueLength + 1), valueLength + 1);
|
|
127
127
|
}
|
|
128
128
|
} else if (lookupType !== 0) {
|
|
129
129
|
throw parseError(`unexpected codebook lookup type ${lookupType}`);
|
|
@@ -133,13 +133,13 @@ function rebuildCodebook(reader, size, writer) {
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
/**
|
|
137
|
-
* Number of quantized values for a maptype-1 codebook lookup table
|
|
138
|
-
* (Vorbis/Tremor `_book_maptype1_quantvals`).
|
|
139
|
-
*
|
|
140
|
-
* @param {number} entries Codebook entry count.
|
|
141
|
-
* @param {number} dimensions Codebook dimensions.
|
|
142
|
-
* @returns {number} Quantized value count.
|
|
136
|
+
/**
|
|
137
|
+
* Number of quantized values for a maptype-1 codebook lookup table
|
|
138
|
+
* (Vorbis/Tremor `_book_maptype1_quantvals`).
|
|
139
|
+
*
|
|
140
|
+
* @param {number} entries Codebook entry count.
|
|
141
|
+
* @param {number} dimensions Codebook dimensions.
|
|
142
|
+
* @returns {number} Quantized value count.
|
|
143
143
|
*/
|
|
144
144
|
function bookMaptype1Quantvals(entries, dimensions) {
|
|
145
145
|
if (dimensions === 0) return 0;
|