melonjs 20.8.0 → 20.9.0

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.
Files changed (182) hide show
  1. package/README.md +1 -0
  2. package/build/application/application.d.ts +66 -8
  3. package/build/application/application.d.ts.map +1 -1
  4. package/build/application/defaultApplicationSettings.d.ts +1 -0
  5. package/build/application/defaultApplicationSettings.d.ts.map +1 -1
  6. package/build/application/resize.d.ts +25 -0
  7. package/build/application/resize.d.ts.map +1 -1
  8. package/build/application/scaleMethods.d.ts +13 -3
  9. package/build/application/scaleMethods.d.ts.map +1 -1
  10. package/build/application/settings.d.ts +56 -5
  11. package/build/application/settings.d.ts.map +1 -1
  12. package/build/audio/audio.d.ts +29 -5
  13. package/build/audio/audio.d.ts.map +1 -1
  14. package/build/audio/autopause.d.ts +36 -0
  15. package/build/audio/autopause.d.ts.map +1 -0
  16. package/build/audio/backend/engine.d.ts +10 -0
  17. package/build/audio/backend/engine.d.ts.map +1 -1
  18. package/build/audio/backend/sound.d.ts.map +1 -1
  19. package/build/audio/backend/spatial.d.ts.map +1 -1
  20. package/build/audio/context.d.ts +35 -0
  21. package/build/audio/context.d.ts.map +1 -0
  22. package/build/audio/playback.d.ts.map +1 -1
  23. package/build/audio/procedural.d.ts.map +1 -1
  24. package/build/audio/spatial.d.ts +87 -0
  25. package/build/audio/spatial.d.ts.map +1 -0
  26. package/build/audio/state.d.ts +1 -0
  27. package/build/audio/state.d.ts.map +1 -1
  28. package/build/audio/types.d.ts +46 -6
  29. package/build/audio/types.d.ts.map +1 -1
  30. package/build/camera/camera2d.d.ts.map +1 -1
  31. package/build/camera/effects/fade_effect.d.ts.map +1 -1
  32. package/build/camera/effects/mask_effect.d.ts.map +1 -1
  33. package/build/camera/effects/shake_effect.d.ts.map +1 -1
  34. package/build/geometries/box3d.d.ts +1 -1
  35. package/build/geometries/box3d.d.ts.map +1 -1
  36. package/build/geometries/ellipse.d.ts +1 -1
  37. package/build/geometries/ellipse.d.ts.map +1 -1
  38. package/build/geometries/line.d.ts +1 -1
  39. package/build/geometries/line.d.ts.map +1 -1
  40. package/build/geometries/point.d.ts +1 -1
  41. package/build/geometries/point.d.ts.map +1 -1
  42. package/build/geometries/polygon.d.ts +1 -1
  43. package/build/geometries/polygon.d.ts.map +1 -1
  44. package/build/geometries/rectangle.d.ts +1 -1
  45. package/build/geometries/rectangle.d.ts.map +1 -1
  46. package/build/geometries/roundrect.d.ts +1 -1
  47. package/build/geometries/roundrect.d.ts.map +1 -1
  48. package/build/geometries/sphere.d.ts +1 -1
  49. package/build/geometries/sphere.d.ts.map +1 -1
  50. package/build/index.d.ts +8 -2
  51. package/build/index.d.ts.map +1 -1
  52. package/build/index.js +36985 -34678
  53. package/build/index.js.map +4 -4
  54. package/build/input/gamepad.d.ts +129 -3
  55. package/build/input/gamepad.d.ts.map +1 -1
  56. package/build/level/gltf/GLTFModel.d.ts +5 -4
  57. package/build/level/gltf/GLTFModel.d.ts.map +1 -1
  58. package/build/level/gltf/GLTFScene.d.ts.map +1 -1
  59. package/build/level/tiled/TMXObjectFactory.d.ts +3 -2
  60. package/build/level/tiled/TMXObjectFactory.d.ts.map +1 -1
  61. package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
  62. package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts +1 -4
  63. package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts.map +1 -1
  64. package/build/loader/cache.d.ts +220 -0
  65. package/build/loader/cache.d.ts.map +1 -1
  66. package/build/loader/loader.d.ts +20 -349
  67. package/build/loader/loader.d.ts.map +1 -1
  68. package/build/loader/parsers/gltf.d.ts +115 -0
  69. package/build/loader/parsers/gltf.d.ts.map +1 -1
  70. package/build/math/color.d.ts +1 -1
  71. package/build/math/color.d.ts.map +1 -1
  72. package/build/math/matrix2d.d.ts +1 -1
  73. package/build/math/matrix2d.d.ts.map +1 -1
  74. package/build/math/matrix3d.d.ts +1 -1
  75. package/build/math/matrix3d.d.ts.map +1 -1
  76. package/build/math/observableVector2d.d.ts +14 -2
  77. package/build/math/observableVector2d.d.ts.map +1 -1
  78. package/build/math/observableVector3d.d.ts +15 -1
  79. package/build/math/observableVector3d.d.ts.map +1 -1
  80. package/build/math/vector2d.d.ts +31 -1
  81. package/build/math/vector2d.d.ts.map +1 -1
  82. package/build/math/vector3d.d.ts +38 -1
  83. package/build/math/vector3d.d.ts.map +1 -1
  84. package/build/math/vertex.d.ts.map +1 -1
  85. package/build/particles/emitter.d.ts.map +1 -1
  86. package/build/particles/particle.d.ts +7 -1
  87. package/build/particles/particle.d.ts.map +1 -1
  88. package/build/particles/settings.d.ts +35 -0
  89. package/build/particles/settings.d.ts.map +1 -1
  90. package/build/physics/bounds.d.ts +1 -1
  91. package/build/physics/bounds.d.ts.map +1 -1
  92. package/build/physics/broadphase/octree.d.ts +24 -0
  93. package/build/physics/broadphase/octree.d.ts.map +1 -1
  94. package/build/physics/broadphase/quadtree.d.ts +31 -0
  95. package/build/physics/broadphase/quadtree.d.ts.map +1 -1
  96. package/build/physics/builtin/body.d.ts +14 -0
  97. package/build/physics/builtin/body.d.ts.map +1 -1
  98. package/build/pool.d.ts +4 -0
  99. package/build/pool.d.ts.map +1 -1
  100. package/build/renderable/colorlayer.d.ts +13 -0
  101. package/build/renderable/colorlayer.d.ts.map +1 -1
  102. package/build/renderable/container.d.ts.map +1 -1
  103. package/build/renderable/groundshadow.d.ts.map +1 -1
  104. package/build/renderable/instanced_mesh.d.ts +56 -0
  105. package/build/renderable/instanced_mesh.d.ts.map +1 -1
  106. package/build/renderable/mesh.d.ts +97 -11
  107. package/build/renderable/mesh.d.ts.map +1 -1
  108. package/build/renderable/renderable.d.ts +41 -3
  109. package/build/renderable/renderable.d.ts.map +1 -1
  110. package/build/renderable/sprite.d.ts +2 -1
  111. package/build/renderable/sprite.d.ts.map +1 -1
  112. package/build/renderable/sprite3d.d.ts +6 -2
  113. package/build/renderable/sprite3d.d.ts.map +1 -1
  114. package/build/renderable/text/bitmaptext.d.ts +63 -2
  115. package/build/renderable/text/bitmaptext.d.ts.map +1 -1
  116. package/build/renderable/text/bitmaptextdata.d.ts +1 -1
  117. package/build/renderable/text/bitmaptextdata.d.ts.map +1 -1
  118. package/build/renderable/text/glypheffect.d.ts +44 -0
  119. package/build/renderable/text/glypheffect.d.ts.map +1 -0
  120. package/build/renderable/text/text.d.ts +17 -0
  121. package/build/renderable/text/text.d.ts.map +1 -1
  122. package/build/renderable/trail.d.ts.map +1 -1
  123. package/build/renderable/trail3d.d.ts +174 -0
  124. package/build/renderable/trail3d.d.ts.map +1 -0
  125. package/build/renderable/trigger.d.ts +2 -1
  126. package/build/renderable/trigger.d.ts.map +1 -1
  127. package/build/renderable/ui/panelpaint.d.ts +5 -0
  128. package/build/renderable/ui/panelpaint.d.ts.map +1 -0
  129. package/build/renderable/ui/progressbar.d.ts +2 -4
  130. package/build/renderable/ui/progressbar.d.ts.map +1 -1
  131. package/build/renderable/ui/uipanel.d.ts +245 -0
  132. package/build/renderable/ui/uipanel.d.ts.map +1 -0
  133. package/build/renderable/ui/uitextbutton.d.ts +30 -1
  134. package/build/renderable/ui/uitextbutton.d.ts.map +1 -1
  135. package/build/state/state.d.ts.map +1 -1
  136. package/build/system/bootstrap.d.ts.map +1 -1
  137. package/build/system/legacy_pool.d.ts +22 -2
  138. package/build/system/legacy_pool.d.ts.map +1 -1
  139. package/build/system/pool.d.ts +5 -8
  140. package/build/system/pool.d.ts.map +1 -1
  141. package/build/tweens/tween.d.ts +1 -1
  142. package/build/tweens/tween.d.ts.map +1 -1
  143. package/build/video/effects/tintPulse.d.ts +0 -5
  144. package/build/video/effects/tintPulse.d.ts.map +1 -1
  145. package/build/video/effects/wave.d.ts +0 -5
  146. package/build/video/effects/wave.d.ts.map +1 -1
  147. package/build/video/gpu/batcher.d.ts +8 -2
  148. package/build/video/gpu/batcher.d.ts.map +1 -1
  149. package/build/video/gradient.d.ts +1 -0
  150. package/build/video/gradient.d.ts.map +1 -1
  151. package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
  152. package/build/video/rendertarget/rendertarget.d.ts +12 -5
  153. package/build/video/rendertarget/rendertarget.d.ts.map +1 -1
  154. package/build/video/rendertarget/webglrendertarget.d.ts.map +1 -1
  155. package/build/video/rendertarget/webgpurendertarget.d.ts +6 -12
  156. package/build/video/rendertarget/webgpurendertarget.d.ts.map +1 -1
  157. package/build/video/texture/atlas.d.ts +1 -1
  158. package/build/video/texture/atlas.d.ts.map +1 -1
  159. package/build/video/texture/texture2d.d.ts +6 -0
  160. package/build/video/texture/texture2d.d.ts.map +1 -1
  161. package/build/video/webgl/batchers/lit_quad_batcher.d.ts +2 -11
  162. package/build/video/webgl/batchers/lit_quad_batcher.d.ts.map +1 -1
  163. package/package.json +2 -2
  164. package/skills/AGENTS.md +1 -1
  165. package/skills/melonjs/SKILL.md +2 -0
  166. package/skills/melonjs-3d/SKILL.md +192 -18
  167. package/skills/melonjs-3d-assets/SKILL.md +36 -2
  168. package/skills/melonjs-audio/SKILL.md +229 -8
  169. package/skills/melonjs-camera-and-drawing/SKILL.md +73 -3
  170. package/skills/melonjs-display-and-scaling/SKILL.md +273 -0
  171. package/skills/melonjs-effects-and-shaders/SKILL.md +4 -4
  172. package/skills/melonjs-events/SKILL.md +8 -6
  173. package/skills/melonjs-input/SKILL.md +100 -4
  174. package/skills/melonjs-math/SKILL.md +313 -0
  175. package/skills/melonjs-particles-and-trails/SKILL.md +88 -14
  176. package/skills/melonjs-performance/SKILL.md +50 -19
  177. package/skills/melonjs-physics/SKILL.md +2 -1
  178. package/skills/melonjs-renderables/SKILL.md +6 -1
  179. package/skills/melonjs-scenes-and-state/SKILL.md +14 -3
  180. package/skills/melonjs-sprites-and-animation/SKILL.md +9 -4
  181. package/skills/melonjs-tilemaps/SKILL.md +40 -12
  182. package/skills/melonjs-ui-and-text/SKILL.md +382 -4
package/README.md CHANGED
@@ -192,6 +192,7 @@ Examples
192
192
  * [3D Mesh](https://melonjs.github.io/melonJS/examples/#/mesh-3d) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/mesh3d))
193
193
  * [3D Mesh Material](https://melonjs.github.io/melonJS/examples/#/mesh-3d-material) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/mesh3dMaterial))
194
194
  * [AfterBurner Clone](https://melonjs.github.io/melonJS/examples/#/after-burner) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/afterBurner)) — `Camera3d` + 3D Mesh arcade shooter
195
+ * [Earth Defender](https://melonjs.github.io/melonJS/examples/#/earth-defender) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/earthDefender)) — a Stardust tribute: a `Camera3d` posed from the player's own surface point, blob shadows lying on a sphere through `shadowGroundPoint`, mesh-hosted `ShaderEffect` shields, spatial audio and HDR bloom
195
196
  * [Ground Shadows](https://melonjs.github.io/melonJS/examples/#/ground-shadows) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/groundShadows)) — every blob-shadow setting side by side under an orbiting sun, including blobs lying on a slope and a 70-instance scatter that costs one extra draw
196
197
  * [Jungle Rabbit](https://melonjs.github.io/melonJS/examples/#/jungle-rabbit) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/jungleRabbit)) — a low-poly river endless runner: Blender-modelled props through `InstancedMesh`, a rigged paddling boat, a procedural valley and shadows laid on its banks
197
198
  * [glTF Scene](https://melonjs.github.io/melonJS/examples/#/gltf) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/gltf)) — a Blender-authored, lit 3D scene loaded with `level.load`
@@ -46,7 +46,39 @@ export default class Application {
46
46
  */
47
47
  renderer: Renderer;
48
48
  /**
49
- * the active stage "default" camera
49
+ * The "default" camera of the stage that is currently active.
50
+ *
51
+ * It MIRRORS the active stage, so it changes with every `state.change()`,
52
+ * and its concrete class is whatever that stage resolved to: an explicit
53
+ * `cameras` entry on the stage, then the stage's own `cameraClass`, then
54
+ * the application's `cameraClass`, then a shared {@link Camera2d}.
55
+ *
56
+ * **Typed as the base class on purpose.** A stage overrides the
57
+ * application, and built-in stages do: the loading screen pins a
58
+ * {@link Camera2d} whatever `cameraClass` the application was given. So
59
+ * there is no type this property could carry that a stage could not
60
+ * contradict, and a 3D application would be told it has a
61
+ * {@link Camera3d} here while the loader is up.
62
+ *
63
+ * A 3D game therefore has two sound options, and neither of them is a
64
+ * cast. OWN the camera, which is the better one, because the type is
65
+ * never lost in the first place:
66
+ * @example
67
+ * class GameStage extends Stage {
68
+ * readonly camera: Camera3d;
69
+ *
70
+ * constructor(app) {
71
+ * const camera = new Camera3d(0, 0, app.renderer.width, app.renderer.height);
72
+ * super({ cameras: [camera] });
73
+ * // kept with its real type; nothing downstream has to narrow
74
+ * this.camera = camera;
75
+ * }
76
+ * }
77
+ * @example
78
+ * // or narrow where you read it, which the language already verifies
79
+ * if (app.viewport instanceof Camera3d) {
80
+ * app.viewport.setBasis(right, up, forward);
81
+ * }
50
82
  */
51
83
  viewport: Camera2d;
52
84
  /**
@@ -216,21 +248,47 @@ export default class Application {
216
248
  * into — see {@link Application#getParentElement}), so the canvas and
217
249
  * any sibling HUD / overlay markup inside that container go fullscreen
218
250
  * together.
251
+ * Must be called from a USER GESTURE, a click or a key press. Browsers
252
+ * refuse it otherwise: the returned promise rejects, this logs the
253
+ * rejection and nothing happens on screen. That is why the example below
254
+ * hangs the call off a key rather than calling it at startup, and why a
255
+ * game offering fullscreen puts it behind a button or a menu entry.
256
+ *
257
+ * Does nothing when the browser has no fullscreen support, or when the
258
+ * application is already fullscreen.
219
259
  * @param element - optional element to fullscreen instead of `this.parentElement`
220
260
  * @example
221
- * // bind F to toggle fullscreen
222
- * me.input.bindKey(me.input.KEY.F, "toggleFullscreen");
223
- * me.event.on(me.event.KEYDOWN, (action) => {
224
- * if (action === "toggleFullscreen") {
225
- * if (!app.isFullscreen()) app.requestFullscreen();
226
- * else app.exitFullscreen();
227
- * }
261
+ * import { event, input } from "melonjs";
262
+ *
263
+ * // F toggles fullscreen, from anywhere in the game
264
+ * input.bindKey(input.KEY.F, "fullscreen");
265
+ * event.on(event.KEYDOWN, (action, keyCode, edge) => {
266
+ * // `edge` only: a held key auto-repeats, and a repeat would toggle
267
+ * // straight back out of what it just turned on
268
+ * if (action !== "fullscreen" || !edge) {
269
+ * return;
270
+ * }
271
+ * if (app.isFullscreen()) {
272
+ * app.exitFullscreen();
273
+ * } else {
274
+ * app.requestFullscreen();
275
+ * }
228
276
  * });
229
277
  * @category Application
230
278
  */
231
279
  requestFullscreen(element?: Element): void;
232
280
  /**
233
281
  * Exit fullscreen mode for this application.
282
+ *
283
+ * Does nothing when the browser has no fullscreen support, or when the
284
+ * application is not fullscreen, so it is safe to call blind. Unlike
285
+ * {@link Application#requestFullscreen} it needs no user gesture: a page
286
+ * is always allowed to give fullscreen back.
287
+ *
288
+ * Note that the user can leave fullscreen without this being called, with
289
+ * Escape or the browser's own control, so a UI showing the current state
290
+ * should read {@link Application#isFullscreen} back rather than remember
291
+ * what it last asked for.
234
292
  * @category Application
235
293
  */
236
294
  exitFullscreen(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../src/application/application.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AAGpD,OAAO,KAAK,MAAM,qBAAqB,CAAC;AA8BxC,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AAQnD,OAAO,KAAK,EACX,mBAAmB,EACnB,2BAA2B,EAC3B,MAAM,eAAe,CAAC;AAiEvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,CAAC,OAAO,OAAO,WAAW;IAC/B;;OAEG;IACH,aAAa,EAAE,WAAW,CAAC;IAE3B;;OAEG;IACH,QAAQ,EAAG,QAAQ,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAG,QAAQ,CAAC;IAEpB;;;OAGG;IACH,KAAK,EAAE,KAAK,CAAC;IAEb;;;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are const defaultApplicationSettings: {
20
20
  gpuTilemap: true;
21
21
  failIfMajorPerformanceCaveat: true;
22
22
  highPrecisionShader: true;
23
+ scaleRounding: "fractional";
23
24
  subPixel: false;
24
25
  verbose: false;
25
26
  backgroundColor: string;
@@ -1 +1 @@
1
- {"version":3,"file":"defaultApplicationSettings.d.ts","sourceRoot":"","sources":["../../src/application/defaultApplicationSettings.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;CAyBC,CAAC"}
1
+ {"version":3,"file":"defaultApplicationSettings.d.ts","sourceRoot":"","sources":["../../src/application/defaultApplicationSettings.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BC,CAAC"}
@@ -1,4 +1,29 @@
1
1
  import type Application from "./application.ts";
2
+ /**
3
+ * The largest scale at or below `scale` that covers each source pixel with a
4
+ * WHOLE number of device pixels.
5
+ *
6
+ * Rounded down, and rounded in DEVICE pixels rather than CSS ones. That
7
+ * distinction is the whole of it: the canvas is given a CSS size and the
8
+ * browser multiplies by `devicePixelRatio` on the way to real pixels, so
9
+ * flooring the CSS factor lets the fraction come straight back. A factor of
10
+ * 2 at a ratio of 1.25 is 2.5 device pixels per source pixel, which is the
11
+ * unevenness the setting exists to remove.
12
+ *
13
+ * Worked through at a ratio of 2, fitting a 480 wide design into 1280: the
14
+ * raw factor is 2.667 CSS, which is 5.333 device pixels. Flooring here gives
15
+ * 5 device pixels, so a CSS factor of 2.5. Flooring the CSS factor instead
16
+ * would give 2, which is 4 device pixels: also whole, and a whole device
17
+ * pixel smaller than the container could have afforded.
18
+ *
19
+ * Never returns less than one device pixel per source pixel. A container
20
+ * smaller than the design resolution has no whole factor to give, and a
21
+ * scale of zero does not draw at all.
22
+ * @param scale - the unconstrained factor, in CSS pixels
23
+ * @param ratio - `devicePixelRatio`
24
+ * @returns the constrained factor, still in CSS pixels
25
+ */
26
+ export declare function integerDeviceScale(scale: number, ratio: number): number;
2
27
  /**
3
28
  * callback for window resize event
4
29
  * @param game - the game application instance triggering the resize
@@ -1 +1 @@
1
- {"version":3,"file":"resize.d.ts","sourceRoot":"","sources":["../../src/application/resize.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAkChD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAyGhD"}
1
+ {"version":3,"file":"resize.d.ts","sourceRoot":"","sources":["../../src/application/resize.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAkChD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEvE;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CA4GhD"}
@@ -1,11 +1,21 @@
1
1
  export declare const ScaleMethods: {
2
2
  /**
3
- * Manual; no scaling is performed
4
- * <img src="images/scale-fit.png"/>
3
+ * Manual; no automatic scaling is performed. The canvas keeps the size it
4
+ * was given and nothing is measured.
5
+ *
6
+ * No illustration: there is nothing to show. The one that used to sit
7
+ * here was `Fit`'s.
5
8
  */
6
9
  readonly Manual: "manual";
7
10
  /**
8
- * Letterboxed; content is scaled to design aspect ratio
11
+ * Letterboxed; the DESIGN RESOLUTION is kept and the whole frame is scaled
12
+ * to the largest factor that fits, leaving the rest as margin.
13
+ *
14
+ * The one mode where the game always sees exactly the world it was
15
+ * authored for: every other mode resizes the renderer, so the viewport
16
+ * grows or shrinks with the window. It is also the only mode
17
+ * `scaleRounding` applies to, since it is the only one with a fixed
18
+ * factor to round.
9
19
  * <img src="images/scale-fit.png"/>
10
20
  */
11
21
  readonly Fit: "fit";
@@ -1 +1 @@
1
- {"version":3,"file":"scaleMethods.d.ts","sourceRoot":"","sources":["../../src/application/scaleMethods.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY;IACxB;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;CAEM,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC"}
1
+ {"version":3,"file":"scaleMethods.d.ts","sourceRoot":"","sources":["../../src/application/scaleMethods.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY;IACxB;;;;;;OAMG;;IAGH;;;;;;;;;;OAUG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;CAEM,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC"}
@@ -52,17 +52,51 @@ export type ApplicationSettings = {
52
52
  */
53
53
  renderer: RendererType | Renderer;
54
54
  /**
55
- * enable scaling of the canvas ('auto' for automatic scaling)
55
+ * how the canvas is scaled to the page. A number is a fixed multiplier applied to the design resolution and nothing is measured; `"auto"` scales to the available space every time the window changes, using {@link ApplicationSettings.scaleMethod} to decide how and {@link ApplicationSettings.scaleTarget} to decide what is measured.
56
+ *
57
+ * `scaleMethod`, `scaleTarget` and {@link ApplicationSettings.scaleRounding} apply to `"auto"` only. With a fixed number they are ignored.
56
58
  * @default 1
59
+ * @see ApplicationSettings.scaleMethod
60
+ * @see ApplicationSettings.scaleTarget
61
+ * @see ApplicationSettings.scaleRounding
57
62
  */
58
63
  scale: number | "auto";
59
64
  /**
60
- * screen scaling modes
65
+ * how automatic scaling uses the space available to it. Applies when {@link ApplicationSettings.scale} is `"auto"`.
66
+ *
67
+ * The distinction that decides which to pick is whether the DESIGN RESOLUTION moves. `"fit"` keeps it and scales the whole frame to the largest factor that fits, leaving the rest as margin, so the game always sees exactly the world it was authored for. Every other mode calls `renderer.resize()`, so the design resolution follows the container and the game sees MORE or LESS of the world on a different window: `"fill-min"` / `"fill-max"` keep the aspect ratio while doing so, `"flex"` / `"flex-width"` / `"flex-height"` resize one or both axes, and `"stretch"` scales each axis independently so the aspect ratio is not preserved. `"manual"` does nothing automatic.
68
+ *
69
+ * A game whose layout assumes a known frame wants `"fit"`. A game that should reveal more world on a larger window wants one of the others, and has to cope with a viewport whose size it did not choose.
61
70
  * @default "manual"
71
+ * @see ApplicationSettings.scale
62
72
  */
63
73
  scaleMethod: ScaleMethod;
64
74
  /**
65
- * the HTML Element to be used as the reference target when using automatic scaling (by default melonJS will use the parent container of the div element containing the canvas)
75
+ * whether the automatically computed scale factor may be fractional, or must be a whole number of device pixels. `"fractional"` (the default) lets the canvas fill its container exactly, at the cost of source pixels landing on uneven numbers of device pixels: at a 2.667 factor some are 3 device pixels wide and some are 2, which browsers resolve differently and which pixel art shows as shimmering or uneven stems. `"integer"` rounds the factor DOWN so every source pixel covers the same whole number of device pixels, and letterboxes with whatever space is left over.
76
+ *
77
+ * Only `scaleMethod: "fit"` is affected: every other method resizes the renderer to the container, so the design resolution changes and there is no fixed factor to round. The rounding is applied in DEVICE pixels, so `devicePixelRatio` cannot reintroduce a fraction.
78
+ *
79
+ * **What it costs depends on the container, and on `devicePixelRatio`, far more than it looks.** A higher ratio has more device pixels to round among, so it lands closer to the factor it wanted. For a 480x270 design, which is exactly a quarter of 1920x1080:
80
+ *
81
+ * | container | ratio | fit | integer | presented | area lost |
82
+ * |---|---|---|---|---|---|
83
+ * | 1920x1080 | 1 or 2 | 4.000 | 4 / 8 | 1920x1080 | none |
84
+ * | 1440x810 | 1 | 3.000 | 3 | 1440x810 | none |
85
+ * | 1280x720 | 2 | 2.667 | 5 | 1200x675 | 12% |
86
+ * | 1280x720 | 1 | 2.667 | 2 | 960x540 | 44% |
87
+ * | 1366x768 | 1 | 2.844 | 2 | 960x540 | 51% |
88
+ *
89
+ * A design resolution that divides the sizes you expect costs nothing at all; one that does not can give up half the screen on a 1x display. Choose the design resolution with this in mind rather than reaching for the setting afterwards.
90
+ * @default "fractional"
91
+ */
92
+ scaleRounding: "fractional" | "integer";
93
+ /**
94
+ * the element automatic scaling measures to decide how much space it has. By default it is the PARENT of the container the canvas was mounted in, which is one level further out than most callers expect and is the usual cause of a canvas that does not fit its box.
95
+ *
96
+ * The case to watch for: a container that is `position: fixed` or `absolute` contributes no height to its parent, so that parent measures only whatever else it holds. If it measures `<body>`, the window size is used instead, and the canvas comes out larger than the box it lives in, cropped by whatever sits above it, by exactly the height of that other content on every resize.
97
+ *
98
+ * Name the element here when the default does not land on the box you meant, or give the canvas container a parent whose box IS that area.
99
+ * @see ApplicationSettings.scale
66
100
  */
67
101
  scaleTarget: HTMLElement;
68
102
  /**
@@ -83,7 +117,9 @@ export type ApplicationSettings = {
83
117
  */
84
118
  powerPreference: PowerPreference;
85
119
  /**
86
- * whether to allow transparent pixels in the front buffer (screen).
120
+ * whether the canvas composites with the page behind it. `false`, the default, makes the front buffer opaque: the clear alpha is 1, WebGPU is configured `alphaMode: "opaque"`, and the canvas renderer clears rather than erases.
121
+ *
122
+ * Turn it on only when the page is meant to show through, since an opaque surface is the cheaper one to composite and is what a game filling its container wants. With it on the clear alpha becomes 0 and WebGPU switches to `"premultiplied"`, so anything drawn at partial alpha blends with the page rather than with a known background.
87
123
  * @default false
88
124
  */
89
125
  transparent: boolean;
@@ -172,6 +208,16 @@ export type ApplicationSettings = {
172
208
  * @default false
173
209
  */
174
210
  hdrOutput: boolean;
211
+ /**
212
+ * the tone curve applied at the end of the camera's chain, or `"none"` for no curve. `"aces"` is the filmic one, `"reinhard"` the gentlest, `"exponential"` the simplest.
213
+ *
214
+ * **A curve is a look decision, not a companion to {@link ApplicationSettings.hdr}.** Every curve maps 1 to less than 1, so switching one on changes a game whose art was authored against a clamp: the clipped white goes matte and the picture flattens. Turn it on for art authored in linear light, or when a deliberate grade is wanted.
215
+ *
216
+ * Changing the mode rebuilds one shader, since the curve is baked into it; {@link ApplicationSettings.toneMappingExposure} and {@link ApplicationSettings.toneMappingWhite} are uniform writes and can be driven per frame, which is what makes a settings screen or a hit flash cheap. `renderer.setToneMapping()` is the runtime entry point.
217
+ * @default "none"
218
+ * @see ApplicationSettings.toneMappingExposure
219
+ * @see ApplicationSettings.toneMappingWhite
220
+ */
175
221
  toneMapping: "none" | "aces" | "reinhard" | "exponential";
176
222
  /**
177
223
  * Multiplier applied before the tone curve. Above `1` lifts the image
@@ -399,8 +445,13 @@ export type ApplicationSettings = {
399
445
  */
400
446
  highPrecisionShader: boolean;
401
447
  /**
402
- * whether to enable sub-pixel rendering (avoid sprite flickering when using transforms)
448
+ * whether a renderable may sit on a fractional position WITHIN the frame. `false`, the default, snaps each translation to whole pixels, which is what stops a slowly moving or transformed sprite shimmering along its edges.
449
+ *
450
+ * The snap TRUNCATES rather than rounds, and truncates toward zero, so a value that should swing symmetrically about the origin does not: an offset travelling between -3 and +3 lands on -2 and +2, and sits at each extreme a little longer than it should. Something animating over a short distance is where this shows.
451
+ *
452
+ * It says nothing about how the frame reaches the screen. A game that snaps positions here and is then presented at a fractional scale has undone the work at the last step; {@link ApplicationSettings.scaleRounding} is what addresses that half.
403
453
  * @default false
454
+ * @see ApplicationSettings.scaleRounding
404
455
  */
405
456
  subPixel: boolean;
406
457
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/application/settings.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EA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@
9
9
  * `pause`, `resume`, `stop`, `fade`, `seek`, `rate`, `stereo`,
10
10
  * `position`, `orientation`, `panner`).
11
11
  * - {@link ./procedural.ts} — procedural primitives (`tone`, `noise`).
12
+ * - {@link ./spatial.ts} — the world-space layer: a movable listener,
13
+ * sounds that follow a renderable, and the pixel-shaped defaults.
14
+ * - {@link ./autopause.ts} — silencing the mix while the window is away.
12
15
  * - {@link ./types.ts} — public TypeScript shapes.
13
16
  *
14
17
  * This file owns the remaining lifecycle / track / mix / unload
@@ -16,6 +19,7 @@
16
19
  */
17
20
  export { duration, fade, load, orientation, panner, pause, play, playing, position, rate, resume, seek, state, stereo, stop, } from "./playback.ts";
18
21
  export { noise, tone } from "./procedural.ts";
22
+ export { getSpatialDefaults, listener, listenerOrientation, setListener, setSpatialDefaults, unfollow, } from "./spatial.ts";
19
23
  export { getAudioContext, getMasterGain, setStopOnAudioError, stopOnAudioError, } from "./state.ts";
20
24
  export type { LoadSettings, NoiseFilter, NoiseOptions, PannerAttributes, SoundAsset, ToneOptions, } from "./types.ts";
21
25
  /**
@@ -65,20 +69,40 @@ export declare function enable(): void;
65
69
  */
66
70
  export declare function disable(): void;
67
71
  /**
68
- * Play the specified audio track. Automatically loops the clip and
69
- * tracks it as the current track for {@link stopTrack} / {@link pauseTrack}
70
- * / {@link resumeTrack}.
72
+ * Play the specified audio track, **replacing** whatever track was playing.
73
+ *
74
+ * The clip loops, and its name becomes the current track for
75
+ * {@link stopTrack} / {@link pauseTrack} / {@link resumeTrack} /
76
+ * {@link getCurrentTrack}. The previous track is stopped first, so only one
77
+ * track is ever playing: there is a single current-track slot, and a track
78
+ * left running after the slot had moved on could no longer be reached by any
79
+ * of those four.
80
+ *
81
+ * Calling it with the name already playing restarts that track from the
82
+ * beginning, the same as {@link play} on any other clip. Scene code that
83
+ * wants the bed to carry on across a screen change should not call this
84
+ * again, rather than rely on it doing nothing.
85
+ *
86
+ * Use {@link play} for sound effects: they are meant to overlap, and nothing
87
+ * here applies to them.
71
88
  * @param sound_name - Audio track name (case-sensitive).
72
89
  * @param volume - Playback volume, `0.0..1.0`. Defaults to the current
73
90
  * global volume.
74
91
  * @returns The sound instance ID.
92
+ * @throws {Error} when no clip of that name is loaded, raised before anything
93
+ * is stopped, so a mistyped name cannot silence the music already playing.
75
94
  * @example
76
- * me.audio.playTrack("awesome_music");
95
+ * me.audio.playTrack("menu_theme");
96
+ * me.audio.playTrack("battle_theme"); // the menu theme stops
77
97
  * @category Audio
78
98
  */
79
99
  export declare function playTrack(sound_name: string, volume?: number): number;
80
100
  /**
81
- * Stop the current audio track.
101
+ * Stop the current audio track, and leave no current track behind.
102
+ *
103
+ * Only needed where nothing else follows, since {@link playTrack} stops the
104
+ * track it replaces: a scene whose successor has no music of its own, or a
105
+ * game going quiet. A no-op when no track is playing.
82
106
  * @see {@link playTrack}
83
107
  * @example
84
108
  * me.audio.playTrack("awesome_music");
@@ -1 +1 @@
1
- {"version":3,"file":"audio.d.ts","sourceRoot":"","sources":["../../src/audio/audio.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAcH,OAAO,EACN,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,MAAM,EACN,KAAK,EACL,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,MAAM,EACN,IAAI,GACJ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EACN,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,gBAAgB,GAChB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACX,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,WAAW,GACX,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,IAAI,CAAC,MAAM,GAAE,MAAc,GAAG,OAAO,CAG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AAI,CAMhC;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAIjC;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAIlC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAE/C;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAE9C;AAED;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,IAAI,CACnB,UAAU,EAAE,MAAM,EAClB,EAAE,CAAC,EAAE,MAAM,EACX,UAAU,GAAE,OAAc,GACxB,IAAI,CAEN;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAE5D;AAED;;;GAGG;AACH,wBAAgB,OAAO,IAAI,IAAI,CAE9B;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAEhC;AAED;;;;GAIG;AACH,wBAAgB,KAAK,IAAI,OAAO,CAE/B;AAED;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAsBlD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAOhC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Silence the game's sound effects while the window does not have focus.
3
+ *
4
+ * `Application` pauses the game on blur and resumes it on focus (its
5
+ * `pauseOnBlur` / `resumeOnFocus` settings, both on by default), and
6
+ * `state.pause()` already pauses the MUSIC TRACK. Nothing ever silenced the
7
+ * sound effects, so a looping one — an engine hum, an alarm, ambience — kept
8
+ * playing over whatever the player switched to.
9
+ *
10
+ * Driven from `Application#_onBlur` / `_onFocus` rather than from
11
+ * `STATE_PAUSE`, deliberately. A state pause is not always a focus loss:
12
+ * `state.freeze()` forwards its `music` flag into `state.pause()` for a
13
+ * hit-stop measured in tens of milliseconds, and muting there would punch a
14
+ * hole in the very impact sound the freeze exists to emphasise. A game's own
15
+ * pause menu is the same story, and would lose its UI clicks. Focus loss is
16
+ * the case where silence is unambiguously right.
17
+ *
18
+ * Driving it from the application also means the existing `stopOnBlur` /
19
+ * `pauseOnBlur` / `resumeOnFocus` settings gate it, instead of a fourth
20
+ * setting that says almost the same thing. A game that opted out of pausing
21
+ * in the background is a game that wants to keep running there, audio
22
+ * included.
23
+ *
24
+ * MUTED rather than stopped or paused:
25
+ *
26
+ * - stopping discards playback ids, and an id is the handle a game holds to
27
+ * reposition or fade a sound, so a loop could never be resumed in place;
28
+ * - per-voice pausing would have to be taught about every source in turn, and
29
+ * would miss the procedural `tone` / `noise` primitives and anything a game
30
+ * hangs off `getMasterGain()`;
31
+ * - muting zeroes the master gain, which everything routes through, and it
32
+ * lets a short one-shot finish silently instead of queueing up to fire the
33
+ * moment the player comes back.
34
+ */
35
+ export {};
36
+ //# sourceMappingURL=autopause.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autopause.d.ts","sourceRoot":"","sources":["../../src/audio/autopause.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG"}
@@ -1,3 +1,4 @@
1
+ import { AudioContextOwner } from "../context.ts";
1
2
  import type { Sound } from "./sound.ts";
2
3
  export declare class AudioEngine {
3
4
  html5PoolSize: number;
@@ -9,6 +10,15 @@ export declare class AudioEngine {
9
10
  ctx: AudioContext | null;
10
11
  autoUnlock: boolean;
11
12
  state: string;
13
+ /**
14
+ * The single owner of the context: see `../context.ts`.
15
+ *
16
+ * The engine no longer creates listeners for keeping the context alive,
17
+ * nor decides when a stop should be reverted. It answers the owner's two
18
+ * questions and does the reviving, which is the part only it can do
19
+ * because only it has the voices waiting on the result.
20
+ */
21
+ readonly contextOwner: AudioContextOwner;
12
22
  constructor();
13
23
  volume(vol?: number): number | this;
14
24
  mute(muted: boolean): this;
@@ -1 +1 @@
1
- {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../../src/audio/backend/engine.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,EACN,KAAK,4BAA4B,EAGjC,MAAM,YAAY,CAAC;AAEpB,qBAAa,WAAW;IAWvB,aAAa,EAAE,MAAM,CAAM;IAM3B,MAAM,EAAE,KAAK,EAAE,CAAM;IAqBrB,UAAU,EAAE,QAAQ,GAAG,IAAI,CAAQ;IACnC,OAAO,EAAE,OAAO,CAAS;IACzB,aAAa,EAAE,OAAO,CAAQ;IAC9B,WAAW,EAAE,OAAO,CAAQ;IAC5B,GAAG,EAAE,YAAY,GAAG,IAAI,CAAQ;IAChC,UAAU,EAAE,OAAO,CAAQ;IAC3B,KAAK,EAAE,MAAM,CAAe;;IAqD5B,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAoCnC,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IA2B1B,IAAI,IAAI,IAAI;IAQZ,MAAM,IAAI,IAAI;IAkBd,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAI5B;;;;;;;;;;;;;OAaG;IACH,aAAa,IAAI,YAAY,GAAG,IAAI;IAmCpC,MAAM,IAAI,IAAI;IAmCd,YAAY,IAAI,IAAI;IAqEpB,YAAY,IAAI,IAAI;IAiGpB,iBAAiB,IAAI,4BAA4B;IAoCjD,kBAAkB,CAAC,KAAK,EAAE,4BAA4B,GAAG,IAAI;IAQ7D,YAAY,IAAI,IAAI;IA6CpB,WAAW,IAAI,IAAI;CAsDnB"}
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../../src/audio/backend/engine.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;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LACES, REVIVES or CLOSES the context goes
5
+ * through here. Everything else asks for the current one and uses it.
6
+ *
7
+ * That split is the whole point of this file. The context used to be managed
8
+ * in two places: the backend engine held it and ran its own recovery, while
9
+ * the procedural generators carried a private `_resumeIfSuspended` they
10
+ * called before every beep. One context, two owners, and only one of them
11
+ * kept the books, so the hardware and the engine's own view of it could
12
+ * drift apart with nothing in place to notice.
13
+ *
14
+ * Three rules this file exists to make unbreakable:
15
+ *
16
+ * 1. **The recovery listeners are attached once and read the CURRENT
17
+ * context.** They used to capture whichever context existed when they
18
+ * were installed, and the engine replaces its context during unlock (see
19
+ * `_unlockAudio`'s 44100 swap), so the nets could be left watching an
20
+ * object nothing used any more. Reading {@link AudioContextOwner.current}
21
+ * at call time makes that unexpressible.
22
+ * 2. **A deliberate stop and a surprise stop are different events.** The
23
+ * engine suspends the context on purpose after thirty idle seconds, and a
24
+ * blanket "resume whenever it is not running" cancels that power saving
25
+ * forever. A `statechange` therefore only recovers when the engine still
26
+ * reports itself running; a user gesture or the tab coming back always
27
+ * does, because the player is plainly here and waiting.
28
+ * 3. **Reviving goes through the engine's bookkeeping, never around it.** A
29
+ * bare `ctx.resume()` restarts the hardware and nothing else: the
30
+ * engine's own `state` stays wrong and no "resume" reaches the voices
31
+ * parked waiting for it, so the sound stays silent with a perfectly
32
+ * healthy context underneath.
33
+ */
34
+ export {};
35
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/audio/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG"}
@@ -1 +1 @@
1
- {"version":3,"file":"playback.d.ts","sourceRoot":"","sources":["../../src/audio/playback.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAcH,OAAO,KAAK,EACX,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;;;;;;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AM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAmB3D;AAED;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAE3D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CA4B5D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,KAAK,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAK3E"}
@@ -1 +1 @@
1
- {"version":3,"file":"procedural.d.ts","sourceRoot":"","sources":["../../src/audio/procedural.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAsF5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CA6D5C;AAmDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAgE9C"}
1
+ {"version":3,"file":"procedural.d.ts","sourceRoot":"","sources":["../../src/audio/procedural.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAsE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CA6D5C;AAmDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAgE9C"}