@datamoc/mw_games 0.43.0 → 0.44.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -0
- package/README.md +22 -0
- package/REFERENCE.md +82 -6
- package/api-surface.json +1028 -2
- package/dist/actors/Resource.d.ts.map +1 -1
- package/dist/actors/Resource.js +2 -3
- package/dist/actors/Resource.js.map +1 -1
- package/dist/audio/AdaptiveMusic.d.ts +85 -0
- package/dist/audio/AdaptiveMusic.d.ts.map +1 -0
- package/dist/audio/AdaptiveMusic.js +230 -0
- package/dist/audio/AdaptiveMusic.js.map +1 -0
- package/dist/audio/AudioLoader.d.ts +7 -2
- package/dist/audio/AudioLoader.d.ts.map +1 -1
- package/dist/audio/AudioLoader.js +23 -18
- package/dist/audio/AudioLoader.js.map +1 -1
- package/dist/audio/AudioViews.d.ts +70 -0
- package/dist/audio/AudioViews.d.ts.map +1 -0
- package/dist/audio/AudioViews.js +119 -0
- package/dist/audio/AudioViews.js.map +1 -0
- package/dist/audio/BusBudget.d.ts +89 -0
- package/dist/audio/BusBudget.d.ts.map +1 -0
- package/dist/audio/BusBudget.js +120 -0
- package/dist/audio/BusBudget.js.map +1 -0
- package/dist/audio/Channels.d.ts +65 -1
- package/dist/audio/Channels.d.ts.map +1 -1
- package/dist/audio/Channels.js +117 -30
- package/dist/audio/Channels.js.map +1 -1
- package/dist/audio/CoreHost.d.ts +114 -0
- package/dist/audio/CoreHost.d.ts.map +1 -0
- package/dist/audio/CoreHost.js +335 -0
- package/dist/audio/CoreHost.js.map +1 -0
- package/dist/audio/DecoderGuard.d.ts +139 -0
- package/dist/audio/DecoderGuard.d.ts.map +1 -0
- package/dist/audio/DecoderGuard.js +208 -0
- package/dist/audio/DecoderGuard.js.map +1 -0
- package/dist/audio/Fft.d.ts +3 -0
- package/dist/audio/Fft.d.ts.map +1 -0
- package/dist/audio/Fft.js +45 -0
- package/dist/audio/Fft.js.map +1 -0
- package/dist/audio/LoopTags.d.ts +18 -0
- package/dist/audio/LoopTags.d.ts.map +1 -1
- package/dist/audio/LoopTags.js +20 -0
- package/dist/audio/LoopTags.js.map +1 -1
- package/dist/audio/Midi.d.ts +35 -0
- package/dist/audio/Midi.d.ts.map +1 -1
- package/dist/audio/Midi.js +71 -1
- package/dist/audio/Midi.js.map +1 -1
- package/dist/audio/MidiRender.d.ts +31 -0
- package/dist/audio/MidiRender.d.ts.map +1 -1
- package/dist/audio/MidiRender.js +79 -2
- package/dist/audio/MidiRender.js.map +1 -1
- package/dist/audio/MidiSynth.d.ts +147 -0
- package/dist/audio/MidiSynth.d.ts.map +1 -0
- package/dist/audio/MidiSynth.js +205 -0
- package/dist/audio/MidiSynth.js.map +1 -0
- package/dist/audio/Playable.d.ts +7 -0
- package/dist/audio/Playable.d.ts.map +1 -1
- package/dist/audio/Playable.js.map +1 -1
- package/dist/audio/Positional.d.ts +12 -4
- package/dist/audio/Positional.d.ts.map +1 -1
- package/dist/audio/Positional.js +5 -2
- package/dist/audio/Positional.js.map +1 -1
- package/dist/audio/Resample.d.ts +61 -0
- package/dist/audio/Resample.d.ts.map +1 -0
- package/dist/audio/Resample.js +97 -0
- package/dist/audio/Resample.js.map +1 -0
- package/dist/audio/Settings.d.ts +99 -0
- package/dist/audio/Settings.d.ts.map +1 -0
- package/dist/audio/Settings.js +134 -0
- package/dist/audio/Settings.js.map +1 -0
- package/dist/audio/Sfx.d.ts +148 -0
- package/dist/audio/Sfx.d.ts.map +1 -0
- package/dist/audio/Sfx.js +213 -0
- package/dist/audio/Sfx.js.map +1 -0
- package/dist/audio/SpectralDistance.d.ts +34 -0
- package/dist/audio/SpectralDistance.d.ts.map +1 -0
- package/dist/audio/SpectralDistance.js +64 -0
- package/dist/audio/SpectralDistance.js.map +1 -0
- package/dist/audio/StreamChannel.d.ts +150 -0
- package/dist/audio/StreamChannel.d.ts.map +1 -0
- package/dist/audio/StreamChannel.js +390 -0
- package/dist/audio/StreamChannel.js.map +1 -0
- package/dist/audio/StreamPlayable.d.ts +73 -0
- package/dist/audio/StreamPlayable.d.ts.map +1 -0
- package/dist/audio/StreamPlayable.js +130 -0
- package/dist/audio/StreamPlayable.js.map +1 -0
- package/dist/audio/SyxBank.d.ts +73 -0
- package/dist/audio/SyxBank.d.ts.map +1 -0
- package/dist/audio/SyxBank.js +130 -0
- package/dist/audio/SyxBank.js.map +1 -0
- package/dist/audio/Underrun.d.ts +25 -0
- package/dist/audio/Underrun.d.ts.map +1 -0
- package/dist/audio/Underrun.js +18 -0
- package/dist/audio/Underrun.js.map +1 -0
- package/dist/audio/Wav.d.ts +56 -0
- package/dist/audio/Wav.d.ts.map +1 -0
- package/dist/audio/Wav.js +164 -0
- package/dist/audio/Wav.js.map +1 -0
- package/dist/audio/WebMidi.d.ts +58 -0
- package/dist/audio/WebMidi.d.ts.map +1 -0
- package/dist/audio/WebMidi.js +79 -0
- package/dist/audio/WebMidi.js.map +1 -0
- package/dist/audio/humanize/Onsets.d.ts.map +1 -1
- package/dist/audio/humanize/Onsets.js +1 -44
- package/dist/audio/humanize/Onsets.js.map +1 -1
- package/dist/audio/index.d.ts +38 -6
- package/dist/audio/index.d.ts.map +1 -1
- package/dist/audio/index.js +19 -3
- package/dist/audio/index.js.map +1 -1
- package/dist/battle/AttackPreview.d.ts.map +1 -1
- package/dist/battle/AttackPreview.js +8 -8
- package/dist/battle/AttackPreview.js.map +1 -1
- package/dist/battle/StatStages.d.ts.map +1 -1
- package/dist/battle/StatStages.js +2 -1
- package/dist/battle/StatStages.js.map +1 -1
- package/dist/board/Engine.d.ts +2 -0
- package/dist/board/Engine.d.ts.map +1 -1
- package/dist/board/Engine.js +1 -1
- package/dist/board/Engine.js.map +1 -1
- package/dist/board/HexSkirmish.d.ts.map +1 -1
- package/dist/board/HexSkirmish.js +11 -72
- package/dist/board/HexSkirmish.js.map +1 -1
- package/dist/board/Tactics.d.ts.map +1 -1
- package/dist/board/Tactics.js +3 -5
- package/dist/board/Tactics.js.map +1 -1
- package/dist/board/tourney.d.ts.map +1 -1
- package/dist/board/tourney.js +2 -19
- package/dist/board/tourney.js.map +1 -1
- package/dist/core/Handles.js +7 -7
- package/dist/core/Handles.js.map +1 -1
- package/dist/mw_games.global.js +25 -22
- package/dist/mwl/conditions.d.ts +12 -0
- package/dist/mwl/conditions.d.ts.map +1 -1
- package/dist/mwl/conditions.js +49 -8
- package/dist/mwl/conditions.js.map +1 -1
- package/dist/mwl/index.d.ts +11 -0
- package/dist/mwl/index.d.ts.map +1 -1
- package/dist/mwl/index.js +6 -0
- package/dist/mwl/index.js.map +1 -1
- package/dist/mwl/package-container.d.ts +185 -0
- package/dist/mwl/package-container.d.ts.map +1 -0
- package/dist/mwl/package-container.js +446 -0
- package/dist/mwl/package-container.js.map +1 -0
- package/dist/mwl/package-document.d.ts +217 -0
- package/dist/mwl/package-document.d.ts.map +1 -0
- package/dist/mwl/package-document.js +639 -0
- package/dist/mwl/package-document.js.map +1 -0
- package/dist/mwl/package-rom.d.ts +37 -0
- package/dist/mwl/package-rom.d.ts.map +1 -0
- package/dist/mwl/package-rom.js +96 -0
- package/dist/mwl/package-rom.js.map +1 -0
- package/dist/mwl/package-verify.d.ts +34 -0
- package/dist/mwl/package-verify.d.ts.map +1 -0
- package/dist/mwl/package-verify.js +111 -0
- package/dist/mwl/package-verify.js.map +1 -0
- package/dist/mwl/package.d.ts +184 -0
- package/dist/mwl/package.d.ts.map +1 -0
- package/dist/mwl/package.js +382 -0
- package/dist/mwl/package.js.map +1 -0
- package/dist/physics/PhysicsWorld.d.ts.map +1 -1
- package/dist/physics/PhysicsWorld.js +4 -3
- package/dist/physics/PhysicsWorld.js.map +1 -1
- package/dist/physics/XpbdWorld.d.ts.map +1 -1
- package/dist/physics/XpbdWorld.js +2 -1
- package/dist/physics/XpbdWorld.js.map +1 -1
- package/dist/testing/FakeAudio.d.ts +149 -0
- package/dist/testing/FakeAudio.d.ts.map +1 -0
- package/dist/testing/FakeAudio.js +219 -0
- package/dist/testing/FakeAudio.js.map +1 -0
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +1 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/threads/index.d.ts +2 -2
- package/dist/threads/index.d.ts.map +1 -1
- package/dist/threads/index.js +1 -1
- package/dist/threads/index.js.map +1 -1
- package/dist/threads/spawn.d.ts +32 -0
- package/dist/threads/spawn.d.ts.map +1 -1
- package/dist/threads/spawn.js +35 -11
- package/dist/threads/spawn.js.map +1 -1
- package/dist/two-d/Game.d.ts +13 -2
- package/dist/two-d/Game.d.ts.map +1 -1
- package/dist/two-d/Game.js +42 -18
- package/dist/two-d/Game.js.map +1 -1
- package/dist/two-d/render/HazeLayer.d.ts.map +1 -1
- package/dist/two-d/render/HazeLayer.js +2 -1
- package/dist/two-d/render/HazeLayer.js.map +1 -1
- package/dist/two-d/render/ImageModifiers.d.ts +4 -2
- package/dist/two-d/render/ImageModifiers.d.ts.map +1 -1
- package/dist/two-d/render/ImageModifiers.js +13 -8
- package/dist/two-d/render/ImageModifiers.js.map +1 -1
- package/dist/two-d/render/NeonGlow.d.ts.map +1 -1
- package/dist/two-d/render/NeonGlow.js +2 -1
- package/dist/two-d/render/NeonGlow.js.map +1 -1
- package/dist/two-d/render/Particles.d.ts.map +1 -1
- package/dist/two-d/render/Particles.js +2 -1
- package/dist/two-d/render/Particles.js.map +1 -1
- package/dist/two-d/render/SceneTransition.d.ts +29 -0
- package/dist/two-d/render/SceneTransition.d.ts.map +1 -1
- package/dist/two-d/render/SceneTransition.js +27 -0
- package/dist/two-d/render/SceneTransition.js.map +1 -1
- package/dist/two-d/render/ScreenEffects.d.ts.map +1 -1
- package/dist/two-d/render/ScreenEffects.js +2 -1
- package/dist/two-d/render/ScreenEffects.js.map +1 -1
- package/dist/two-d/render/SkeletalSprite.d.ts.map +1 -1
- package/dist/two-d/render/SkeletalSprite.js +2 -1
- package/dist/two-d/render/SkeletalSprite.js.map +1 -1
- package/dist/two-d/render/Types2D.d.ts +2 -2
- package/dist/two-d/render/Types2D.d.ts.map +1 -1
- package/dist/two-d/render/Types2D.js +2 -2
- package/dist/two-d/render/Types2D.js.map +1 -1
- package/dist/two-d/render/index.d.ts +2 -2
- package/dist/two-d/render/index.d.ts.map +1 -1
- package/dist/two-d/render/index.js +1 -1
- package/dist/two-d/render/index.js.map +1 -1
- package/dist/two-d/ui/Bar.d.ts.map +1 -1
- package/dist/two-d/ui/Bar.js +3 -5
- package/dist/two-d/ui/Bar.js.map +1 -1
- package/dist/two-d/ui/Dropdown.d.ts +5 -1
- package/dist/two-d/ui/Dropdown.d.ts.map +1 -1
- package/dist/two-d/ui/Dropdown.js +8 -1
- package/dist/two-d/ui/Dropdown.js.map +1 -1
- package/dist/two-d/ui/DropdownView.d.ts +15 -1
- package/dist/two-d/ui/DropdownView.d.ts.map +1 -1
- package/dist/two-d/ui/DropdownView.js +21 -3
- package/dist/two-d/ui/DropdownView.js.map +1 -1
- package/dist/two-d/ui/FloatingText.d.ts.map +1 -1
- package/dist/two-d/ui/FloatingText.js +2 -1
- package/dist/two-d/ui/FloatingText.js.map +1 -1
- package/dist/two-d/ui/IconGrid.d.ts.map +1 -1
- package/dist/two-d/ui/IconGrid.js +2 -1
- package/dist/two-d/ui/IconGrid.js.map +1 -1
- package/dist/two-d/ui/ListView.d.ts.map +1 -1
- package/dist/two-d/ui/ListView.js +2 -1
- package/dist/two-d/ui/ListView.js.map +1 -1
- package/dist/two-d/ui/ScrollBox.d.ts +6 -0
- package/dist/two-d/ui/ScrollBox.d.ts.map +1 -1
- package/dist/two-d/ui/ScrollBox.js +12 -1
- package/dist/two-d/ui/ScrollBox.js.map +1 -1
- package/dist/two-d/ui/ScrollText.d.ts +11 -2
- package/dist/two-d/ui/ScrollText.d.ts.map +1 -1
- package/dist/two-d/ui/ScrollText.js +18 -2
- package/dist/two-d/ui/ScrollText.js.map +1 -1
- package/dist/two-d/ui/Slider.d.ts.map +1 -1
- package/dist/two-d/ui/Slider.js +4 -4
- package/dist/two-d/ui/Slider.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +8 -1
- package/sbom.cdx.json +6 -6
- package/tools/audio.d.mts +75 -0
- package/tools/audio.mjs +437 -0
- package/tools/mwl.mjs +144 -2
- package/tools.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,73 @@ the public API may still change between minor versions.
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.44.2] - 2026-10-17
|
|
11
|
+
|
|
12
|
+
Hardening of `.mwp` content package loading, found by security reviews of 0.44.0 and 0.44.1.
|
|
13
|
+
Versions 0.44.0 and 0.44.1 were tagged and released on GitHub but their npm stages were rejected and
|
|
14
|
+
they were never published, so 0.44.2 is the first public release of everything in their entries below.
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- A WAV header with a zero sample rate or block align fell back to its declared `byteRate`, so
|
|
19
|
+
a lying header could still shorten the measured duration. The rate is now the lowest of the
|
|
20
|
+
declared one, `sampleRate * blockAlign` and `sampleRate * channels * ceil(bits / 8)`, and a zero in
|
|
21
|
+
any of them refuses the file as unreadable.
|
|
22
|
+
|
|
23
|
+
## [0.44.1] - 2026-10-17
|
|
24
|
+
|
|
25
|
+
> Superseded by 0.44.2 and never published to npm.
|
|
26
|
+
|
|
27
|
+
Hardening of `.mwp` content package loading, found by a security review of 0.44.0.
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
|
|
31
|
+
- A package could multiply its work through repeated file imports: depth was bounded at 4 but
|
|
32
|
+
the total was not. Imports now share a budget of 64 reads per package document.
|
|
33
|
+
- An import or a `main` document named like an `Object.prototype` member (`constructor`) crashed
|
|
34
|
+
the loader with a `TypeError`; lookups are now own-property only and report a
|
|
35
|
+
`PackageFormatError`.
|
|
36
|
+
- A WAV header declaring a large `byteRate` could shorten the duration measured against
|
|
37
|
+
`maxAudioSeconds`; the lower of the declared rate and `sampleRate * blockAlign` is used.
|
|
38
|
+
|
|
39
|
+
## [0.44.0] - 2026-10-17
|
|
40
|
+
|
|
41
|
+
> Superseded by 0.44.2 and never published to npm.
|
|
42
|
+
|
|
43
|
+
Retro-audio integration contracts (a MIDI engine registry, streaming playback, budgets, content packages and a command line tool), player-facing audio settings, and the interface follow-ups of the last Pontifex round. The parked items 393, 394, Syzygy and NNUE are closed rather than waiting on files or weights that will not arrive, and a simplification pass over the whole tree removes duplicated code.
|
|
44
|
+
|
|
45
|
+
### Added
|
|
46
|
+
|
|
47
|
+
- Pontifex follow-up points 51-54 (roadmap 443-446): `ScrollBox` now owns its `hitArea`
|
|
48
|
+
(its viewport, kept current by `resize`/`setContentHeight`, with a `viewportWidth`
|
|
49
|
+
getter); `DropdownView` and `ScrollText` gain `resize(width)`, and `DropdownViewOptions`
|
|
50
|
+
gains `maxWidth` capping `autoWidth`; a transition requested while one is playing is
|
|
51
|
+
ignored by default, with `queue: true` / `interrupt: true` in `TransitionOptions` and the
|
|
52
|
+
`transitionDisposition` rule exported, `Game.transitioning` also reporting a queued
|
|
53
|
+
transition; and `Dropdown.setHighlight` now opens the list as documented, so
|
|
54
|
+
`setHighlight(i); confirm()` picks a row and the next opening shows it.
|
|
55
|
+
- Retro-audio integration (roadmap 431-442): a named `MidiSynth` engine
|
|
56
|
+
registry with fallback diagnostics, the streaming `Playable` contract, bus render budgets
|
|
57
|
+
and decoder guards, `.mwp` content packages with capability policy and ROM refusal, data
|
|
58
|
+
sound effects, an off-main-thread audio host, adaptive music, the `mwg-audio` tool, and
|
|
59
|
+
the `testing` doubles (`FakeRetroPlayer`, fake WebAudio graph) - documented in the
|
|
60
|
+
README's "Retro audio" section, REFERENCE and `docs/listening-protocol.md`. Player-facing
|
|
61
|
+
settings (`AudioSettings` with PAL/NTSC, dynamics and softening rules), live Web MIDI
|
|
62
|
+
(`connectWebMidi`), dropped `.syx` banks with DX7 patch names and audition (`SyxBank`),
|
|
63
|
+
and the oscilloscope/tracker data cores (`waveformEnvelope`, `trackerPattern`) complete
|
|
64
|
+
item 441.
|
|
65
|
+
|
|
66
|
+
### Changed
|
|
67
|
+
|
|
68
|
+
- Simplification pass over the tree, with no change to the public API: one shared radix-2 FFT
|
|
69
|
+
in `audio`, `HexSkirmish.reachableCosts` built on `core`'s `weightedFlood` (a negative
|
|
70
|
+
terrain move cost is now ignored instead of accepted), `tourney` and `Tactics` using the
|
|
71
|
+
`Engine` job default and `core`'s `cellInside`, a single byte-joining helper in the
|
|
72
|
+
`mwl` package container, and hand-written clamps replaced by `core`'s `clamp` across
|
|
73
|
+
`ui`, `render`, `battle`, `physics` and `audio`.
|
|
74
|
+
- Roadmap: items 393 (Ableton and Reaper groove formats), 394 (the Magenta humanizer tier),
|
|
75
|
+
Syzygy and NNUE are closed; 401 is the only numbered item left, waiting on a port session.
|
|
76
|
+
|
|
10
77
|
## [0.43.0] - 2026-10-17
|
|
11
78
|
|
|
12
79
|
Scrolling, tooltips and screen transitions for interface-heavy games, a MIDI music player and
|
package/README.md
CHANGED
|
@@ -245,6 +245,28 @@ To catch page growth, set `mwgPage({ maxPageBytes: 1_500_000 })`. Its build repo
|
|
|
245
245
|
embedded paths not found literally in the generated game script as potentially unused;
|
|
246
246
|
paths assembled at runtime need manual review. `assetFiles` selects exact asset paths to embed.
|
|
247
247
|
|
|
248
|
+
### Retro audio
|
|
249
|
+
|
|
250
|
+
A retro-instrument package (an MT-32, OPL or chip synth of its own) plugs into mwg through
|
|
251
|
+
contracts mwg owns, so the core never depends on the package. It registers a `MidiSynth`
|
|
252
|
+
under a name with `registerMidiSynth('retro:mt32', factory)`; content then asks for that
|
|
253
|
+
name and `resolveMidiSynth` walks the request, the SoundFont and the built-in synth in
|
|
254
|
+
order, firing `onMidiSynthFallback` whenever a different engine ends up voicing the file.
|
|
255
|
+
Endless or machine-code formats (NSF, SID, SPC) play through the streaming `Playable`
|
|
256
|
+
contract (`StreamPlayable`, `StreamChannel`) under named decoder guards
|
|
257
|
+
(`decoderLimits`, `DecodeBudgetError`): input ceilings, an instruction budget per second
|
|
258
|
+
of sound, and bounded inflation, so untrusted files fail by name instead of hanging.
|
|
259
|
+
Rendered tracks are budgeted (`TrackCache`, `createBudgetedLoader`): a five-minute stereo
|
|
260
|
+
render is about 100 MB, so the bus caps decoded megabytes rather than keeping every track
|
|
261
|
+
forever. Synthesised effects are data, not files: `SfxBank` builds them from definitions
|
|
262
|
+
with a fixed seed, so audio never disturbs a lockstep simulation (its triggers are
|
|
263
|
+
deterministic; the audio itself is not in the lockstep state, and A/V sync follows the
|
|
264
|
+
game frame counter, not the wall clock). The `mwg-audio` tool inspects, converts, renders,
|
|
265
|
+
budgets and compares these formats from the command line, and `spectralDistance` gives a
|
|
266
|
+
first automated check between two renders. What no automation settles is whether a render
|
|
267
|
+
sounds right: the A/B listening protocol in `docs/listening-protocol.md` is the place to
|
|
268
|
+
record those verdicts.
|
|
269
|
+
|
|
248
270
|
## Capability spec
|
|
249
271
|
|
|
250
272
|
The definition of done for 1.0, drawn from what each of the nine references actually
|
package/REFERENCE.md
CHANGED
|
@@ -530,10 +530,12 @@ batcher/high-shader internals are confined to `ColorTransformBatcher.ts`.
|
|
|
530
530
|
`sequence(steps)` (item 302) chains fade/hold/flash steps end to end as one call, for the
|
|
531
531
|
hold-then-fade-back transition the four individual methods cannot express alone; `update`
|
|
532
532
|
keeps returning false at every step boundary, true only once the whole sequence finishes.
|
|
533
|
-
- `SceneTransition`/`TransitionOptions`/`TransitionRunner` + `tileShrink`, `shrink`, `pop`, `grow`, `slide`, `iris`
|
|
533
|
+
- `SceneTransition`/`TransitionOptions`/`TransitionRunner`/`TransitionDisposition` + `transitionDisposition`, `tileShrink`, `shrink`, `pop`, `grow`, `slide`, `iris`
|
|
534
534
|
and `dissolve` - screen transitions: `Game.switchScene(Next, { transition, duration, easing })` photographs the
|
|
535
535
|
outgoing scene and animates it away (or grows the new one over it), `Scene2D.transitionTo(swap, options)` does
|
|
536
|
-
the same for a scene changing its own content, `Game.transitioning` tells a scene to ignore input,
|
|
536
|
+
the same for a scene changing its own content, `Game.transitioning` tells a scene to ignore input, a second
|
|
537
|
+
transition requested while one plays is ignored unless its options say `queue: true` or `interrupt: true`
|
|
538
|
+
(`transitionDisposition` is that rule as a plain function), and
|
|
537
539
|
reduced motion skips it. `tileDelays`, `tileProgress`, `popScale`, `openAnimationFrame` and `resolveEasing` are the
|
|
538
540
|
timing as plain functions.
|
|
539
541
|
- `ActorAnimator` - an idle/move/action animation state machine with one interruption rule.
|
|
@@ -705,11 +707,13 @@ Windows, lists, message boxes, HUD widgets - all themed from one live-swappable
|
|
|
705
707
|
- `DropdownView`/`DropdownViewOptions` - the widget over a `Dropdown` model: a button showing the choice
|
|
706
708
|
that opens a column of `Button`s on an opaque backdrop, the highlighted one marked with
|
|
707
709
|
`Button.setSelected`. `maxVisibleRows` makes a long list scroll (wheel, touch, keys, scrollbar) and it opens with
|
|
708
|
-
the chosen row in view; `autoWidth` fits the longest label
|
|
710
|
+
the chosen row in view; `autoWidth` fits the longest label, `maxWidth` caps that widening, and `resize(width)`
|
|
711
|
+
re-lays the button and list in place; `handleKey` (arrows, Page, Home/End, Enter,
|
|
709
712
|
Escape) and `handleOutsideClick` are what the scene forwards from its own input; `fitBelow` limits the
|
|
710
713
|
rows to what the viewport leaves under the button.
|
|
711
714
|
- `Dropdown`/`DropdownOption`/`DropdownOptions` - a renderer-free option button: a selected entry,
|
|
712
|
-
an open list, a highlight that starts on the selection and skips disabled options.
|
|
715
|
+
an open list, a highlight that starts on the selection and skips disabled options. `setHighlight(i)`
|
|
716
|
+
opens the list on that row, so `setHighlight(i); confirm()` is a whole programmatic pick.
|
|
713
717
|
- `TextModel`/`TextModelOptions` - the editing state behind a text field, fed by `core.Input`'s
|
|
714
718
|
`onText`: caret, anchor, selection-replacing edits, a length cap and a mask. Renderer-free.
|
|
715
719
|
`multiline` keeps real newlines with row navigation (`lineCount`, `caretLine`, `lineRange`,
|
|
@@ -743,11 +747,12 @@ Windows, lists, message boxes, HUD widgets - all themed from one live-swappable
|
|
|
743
747
|
`scrollOffset` is the clamping rule the wheel, `scrollBy` and `scrollIntoView` all share. `touch: true` lets a
|
|
744
748
|
finger drag the content (a drag cancels the tap on the row under it) and coast on release, `handleKey`
|
|
745
749
|
scrolls by line, page and to either end, the thumb drags and the track jumps, and `autoHeight` sizes the
|
|
746
|
-
viewport to the content up to `height`. `
|
|
750
|
+
viewport to the content up to `height`. The box owns its `hitArea` (its viewport, kept current by `resize` and
|
|
751
|
+
`setContentHeight`), so the wheel reaches it without a row under the pointer. `update(dt)` drives the coasting.
|
|
747
752
|
- `ScrollDrag` - touch scrolling as plain numbers (`start`/`move`/`end`/`step`): how far the content follows a
|
|
748
753
|
finger and how it coasts after release, with no pointer events or clock of its own.
|
|
749
754
|
- `ScrollText`/`ScrollTextOptions` - a wrapped `Label` in a self-sizing `ScrollBox`: as tall as the text up to
|
|
750
|
-
`maxHeight`, scrolling beyond it, re-measured by `setText`.
|
|
755
|
+
`maxHeight`, scrolling beyond it, re-measured by `setText` and re-wrapped in place by `resize(width)`.
|
|
751
756
|
- `MarqueeLabel`/`MarqueeLabelOptions` + `marqueeOffset` - one line that stays on one line: a long text slides
|
|
752
757
|
back and forth in a clipped window (and holds still, cut short, under reduced motion).
|
|
753
758
|
- `ellipsize` and `truncateLines` - cut a text to a width or a number of lines, ending in an ellipsis, with the
|
|
@@ -1012,6 +1017,57 @@ reach the compiled asset map without it.
|
|
|
1012
1017
|
overlapping SE one-shots, save and replay with playheads, and plain-data snapshots.
|
|
1013
1018
|
`AudioBus.setMixer(kind, { volume, muted })` scales a whole kind on top of each track's
|
|
1014
1019
|
own volume, without changing what snapshots report.
|
|
1020
|
+
- `MidiSynth`/`MidiSynthFactory`/`MidiSynthRequest` + `registerMidiSynth`, `unregisterMidiSynth`,
|
|
1021
|
+
`midiSynthNames`, `resolveMidiSynth`, `renderMidiThroughSynth`, `renderMidiStems`,
|
|
1022
|
+
`onMidiSynthFallback` and `INTERNAL_MIDI_ENGINES` - the named-engine contract for MIDI:
|
|
1023
|
+
a package registers a synth under a name (`retro:mt32`), content asks for it by name, and
|
|
1024
|
+
resolution walks the request, then the internal names (`gm-soundfont`, `builtin`), firing
|
|
1025
|
+
`onMidiSynthFallback` whenever another engine voices the file instead. `timedMidiMessages`
|
|
1026
|
+
is the raw timed message stream a synth is driven by.
|
|
1027
|
+
- `StreamPlayable`/`StreamChannel` - the streaming half of the `Playable` contract: seek and
|
|
1028
|
+
`currentTime` on a synthesised stream, `playbackRate` by resampling, and a playhead counted
|
|
1029
|
+
in frames, so endless formats (NSF, SID) play without a whole-track render.
|
|
1030
|
+
- `TrackCache`/`createBudgetedLoader`/`BusBudgetPolicy` + `bufferBytes` - bus render budgets:
|
|
1031
|
+
an LRU cache of decoded tracks under a megabyte and entry cap, with `maxSeconds`, mono or
|
|
1032
|
+
half-rate rendering for ambience through `fitToBudget` and `resampleStereo`.
|
|
1033
|
+
- `DEFAULT_DECODER_LIMITS`/`decoderLimits`/`DecodeBudgetError`/`InstructionBudget` +
|
|
1034
|
+
`assertInputSize`, `guardBlockSource` and `inflateBounded` - the decoder guards for
|
|
1035
|
+
untrusted retro formats: input and inflate ceilings, an instruction budget per second of
|
|
1036
|
+
sound, and one named error per breach instead of a hang.
|
|
1037
|
+
- `SfxBank`/`SfxSound`/`SfxArbiter` + `sfxSeed` - data sound effects: synthesised chip
|
|
1038
|
+
effects with a deterministic seed, arbitrated against the `se` bus by priority, firing
|
|
1039
|
+
captions like a file effect.
|
|
1040
|
+
- `AudioSettings`/`AudioSettingsData`/`AudioRegion`/`OutputStage` + `regionPlaybackRate`,
|
|
1041
|
+
`softenCutoff` and `dynamicsLimit` - the player-facing audio settings in one plain-data
|
|
1042
|
+
object: volume per bus (applied to an `AudioBus` by `applyToBus`), the preferred MIDI
|
|
1043
|
+
engine name, PAL or NTSC region (a tune authored for one runs slower or faster on the
|
|
1044
|
+
other, `regionPlaybackRate`), a faithful or clean output stage, caption display, a
|
|
1045
|
+
dynamics control (a soft limiter, `dynamicsLimit`) and bright-sound softening (a falling
|
|
1046
|
+
low-pass cutoff, `softenCutoff`). A CPU and underrun indicator reads `AudioCoreHost`'s
|
|
1047
|
+
stats and `onAudioUnderrun`.
|
|
1048
|
+
- `waveformEnvelope`/`channelEnvelopes`/`WaveformBucket` and
|
|
1049
|
+
`trackerPattern`/`trackerNoteName`/`TrackerRow` - the data cores of the audio views: a
|
|
1050
|
+
waveform as per-bucket min/max pairs per channel (what an oscilloscope draws), and a
|
|
1051
|
+
MIDI file as tracker rows, one column per channel on the file's own tick grid. A game
|
|
1052
|
+
draws them with its own widgets; the reduction and the grid live here and are tested as
|
|
1053
|
+
arithmetic.
|
|
1054
|
+
- `SyxBank`/`SyxPatch` + `splitSysex` and `dx7PatchNames` - a `.syx` bank a player drops:
|
|
1055
|
+
its whole sysex messages, the patch names of every checksummed DX7 32-voice bulk dump in
|
|
1056
|
+
it (another maker's bank names nothing rather than guessing), and an `audition` that
|
|
1057
|
+
loads a patch into a `MidiSynth` and renders one note through it for a settings screen.
|
|
1058
|
+
- `connectWebMidi`/`requestWebMidiInput`/`WebMidiConnection` - live Web MIDI into a
|
|
1059
|
+
`MidiSynth`: every input port of a `MIDIAccess` is wired to the synth (channel messages
|
|
1060
|
+
to `event`, sysex to `sysex`, transport dropped), and `requestWebMidiInput` is the
|
|
1061
|
+
browser entry that returns null where Web MIDI does not exist or was refused.
|
|
1062
|
+
- `AdaptiveMusic` - adaptive tracks: mute and unmute stems of a running track with a fade,
|
|
1063
|
+
and switch between two versions at the same frame position; `loopRegionFromFile` reads
|
|
1064
|
+
the loop region a file declares as the default.
|
|
1065
|
+
- `AudioCoreHost` + `onAudioUnderrun` - the off-main-thread audio host: a synthesis core in
|
|
1066
|
+
a worker behind the same `Playable` facade, with a main-thread fallback and an underrun
|
|
1067
|
+
signal feeding bounded telemetry.
|
|
1068
|
+
- `encodeWav`/`decodeWav`/`wavInfo` and `spectralDistance` - WAVE as plain bytes (the
|
|
1069
|
+
`mwg-audio` tool's convert and compare verbs over the same code), and a spectral distance
|
|
1070
|
+
between two renders for a listening check that can be automated.
|
|
1015
1071
|
- `parseVorbisLoopTags`/`loopRegionFromTags` - read the `LOOPSTART`/`LOOPLENGTH` comments an
|
|
1016
1072
|
Ogg Vorbis file carries (a bounded walk of the first pages, null on anything malformed) and
|
|
1017
1073
|
turn them into the seconds-based `LoopRegion` a `Channel` or the bus loader hands back.
|
|
@@ -1575,6 +1631,12 @@ nothing here reaches a shipped game unless a test imports it.
|
|
|
1575
1631
|
- `fakeAudio`/`fakeAudioWithEnded`/`FakePlayable` - a `Playable` for `Sound`/`Music`'s `create`
|
|
1576
1632
|
that counts its plays; the second also has the `onended` slot a backend reporting track ends
|
|
1577
1633
|
has.
|
|
1634
|
+
- `FakeAudioContext`/`FakeBuffer`/`FakeBufferSource`/`FakeGain`/`FakeBlockSource` - a fake
|
|
1635
|
+
WebAudio graph for the audio tests: sources, gains and buffers a test can inspect, and a
|
|
1636
|
+
block source for a `StreamChannel`, with no real `AudioContext` anywhere.
|
|
1637
|
+
- `FakeRetroPlayer` - a `MidiSynth` double for a retro engine: it records every message it
|
|
1638
|
+
was driven with and renders a flat level while a note is on, so a renderer test reads what
|
|
1639
|
+
was sent and what sounded, with `FakeAudioContext.advance()` as the clock it moves by hand.
|
|
1578
1640
|
- `FakeSocket` - a `WebSocketLike` for `LockstepClient`'s `create`: `sent`, `receive(message)`,
|
|
1579
1641
|
`receiveRaw(text)`, `close()`.
|
|
1580
1642
|
- `fakeFetch`/`FakeFetchCall` - a `fetch` for every `HttpTransport` client, answering with a
|
|
@@ -1593,6 +1655,10 @@ a module worker loaded from `file://` fails CORS whatever the policy says), and
|
|
|
1593
1655
|
spawns a worker pays nothing for it, and imports `@datamoc/mw_games/threads` when it
|
|
1594
1656
|
wants one.
|
|
1595
1657
|
|
|
1658
|
+
- `openWorker(source, events)` - opens a long-lived worker from a self-contained script
|
|
1659
|
+
(blob worker in a browser, `node:worker_threads` in Node, null where neither exists) and
|
|
1660
|
+
returns its message link; `spawn` is the one-task use of it, a service such as the audio
|
|
1661
|
+
core host keeps its worker and talks to it.
|
|
1596
1662
|
- `spawn(fn, args?, options?)` - runs `fn` on a worker and resolves with its value. The
|
|
1597
1663
|
task is serialized with `Function.prototype.toString`, so it must be self-contained:
|
|
1598
1664
|
no closures over module scope, no imports, no bound or native functions - everything it
|
|
@@ -1861,6 +1927,16 @@ consumes generated data and does not parse `.mwl` source files in the browser.
|
|
|
1861
1927
|
`emitHooksDeclaration`, `emitModule`, `emitTableTypes`, `encodeSave`, `evaluateExpression`,
|
|
1862
1928
|
`execute`,
|
|
1863
1929
|
`extractCatalog`, `hookTypes`, `inventoryItem`, `isGettext`, `isMwlId`, `itemDefinition`,
|
|
1930
|
+
`PACKAGE_TAGS`, `PACKAGE_ASSET_KINDS`, `PACKAGE_MEDIA_KINDS`, `PACKAGE_SCRIPT_ACTIONS`,
|
|
1931
|
+
`KNOWN_PACKAGE_CAPABILITIES`, `DEFAULT_PACKAGE_LIMITS`, `PackageError`, `PackageFormatError`,
|
|
1932
|
+
`PackageIntegrityError`, `PackageLimitError`, `PackagePathError`, `PackageConflictError`,
|
|
1933
|
+
`encodePackage`, `decodePackage`, `verifyPackage`, `loadPackage`, `mergePackage`,
|
|
1934
|
+
`compilePackages`, `packageContent`, `packageRef`, `parsePackageRef`, `parsePackageDocument`,
|
|
1935
|
+
`checkPackagePath`, `checkPackagePolicy`, `checkConditionSyntax`, `compareVersions`,
|
|
1936
|
+
`satisfiesVersionRange`, `requestedCapabilities`, `detectRomImage`, `registerRomDigest`,
|
|
1937
|
+
`generateCredits` and `sha256Hex` (self-contained `.mwp` content packages: one compressed
|
|
1938
|
+
container with per-entry digests and declared limits, a capability policy the game accepts
|
|
1939
|
+
or refuses, `id@version` namespaces in saves, and a ROM-image refusal with generated credits),
|
|
1864
1940
|
`parseExpression`, `parseHookReference`, `parseMapFile`, `parseTerrain`, `parseValue`, `preprocess`,
|
|
1865
1941
|
`schema01`, `typedRows`, `validateCatalogNodes`, `validateHookReferences`, `loadContent`, and `validateWorld`.
|
|
1866
1942
|
- `parseMapFile`/`MwlMapFile` (item 284) - reads a Wesnoth-shaped `.map`: the `key=value` header
|