@moku-labs/game 0.15.25 → 0.15.26
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/dist/app.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{src-DlKMD4sW.mjs → src-DWYFupNb.mjs} +26 -2
- package/dist/testing.mjs +1 -1
- package/package.json +1 -1
package/dist/app.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ct as effectsPlugin, H as platformPlugin, Pt as audioPlugin, i as screen, m as flattenFeatures, t as createApp } from "./src-
|
|
1
|
+
import { Ct as effectsPlugin, H as platformPlugin, Pt as audioPlugin, i as screen, m as flattenFeatures, t as createApp } from "./src-DWYFupNb.mjs";
|
|
2
2
|
import { t as memory } from "./memory-CWlqhS7l.mjs";
|
|
3
3
|
import { n as isFakeClock, t as fakeClock } from "./fake-6mazmHK3.mjs";
|
|
4
4
|
//#region src/app/define.ts
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as sfx, A as types_exports$7, At as Noise, B as defineMotion, Bt as Frames, C as types_exports$14, Ct as effectsPlugin, D as types_exports$10, Dt as ColorMatrix, E as types_exports$11, Et as Blur, F as types_exports$2, Ft as scenesPlugin, G as external, Gt as PERF_CAUSES, H as platformPlugin, Ht as PASS_KINDS, I as types_exports$1, It as assetsPlugin, J as mark, Jt as PROBLEM_RULES, K as frames, Kt as PERF_GAP_BUCKETS, L as types_exports, Lt as animPlugin, M as types_exports$5, Mt as defineFilter, N as types_exports$4, Nt as debugPlugin, O as types_exports$9, Ot as Displacement, P as types_exports$3, Pt as audioPlugin, Q as set, Qt as flowPlugin, R as uiPlugin, Rt as AnimPlayer, S as types_exports$15, St as messageDuration, T as types_exports$12, Tt as Alpha, U as HAPTIC_KINDS, Ut as frameAt, V as textPlugin, Vt as rendererPlugin, W as defineAnimation, Wt as MONITOR_SECTIONS, X as play, Xt as DEMAND_REASONS, Y as parallel, Yt as SHADER_WHATS, Z as sequence, Zt as worldPlugin, _ as defineBundles, _t as Touchable, a as cubicBezier, an as SaveUnreadableError, at as wait, b as types_exports$17, bt as i18nPlugin, c as hint, cn as clockPlugin, ct as DropTarget, d as defineScene, dt as Pointer, en as exit, et as spawn, f as tr, ft as PointerOver, g as music, gt as Tappable, h as defineEmitter, ht as Swipeable, i as screen, in as modelPlugin, it as use, j as types_exports$6, jt as Outline, k as types_exports$8, kt as Glow, l as schedule, lt as Held, m as flattenFeatures, mt as Pressed, n as createPlugin, nn as to, nt as stagger, o as defineEffect, on as lifecyclePlugin, ot as inputPlugin, p as defineFeature, pt as Pressable, q as haptic, qt as PERF_LOG_VERSION, r as defineGame, rn as type, rt as tween, s as guide, sn as timePlugin, st as Draggable, t as createApp, tn as slot, tt as spawned, u as projection, ut as Hovered, v as load, vt as Traceable, w as types_exports$13, wt as Emitter, x as types_exports$16, xt as messageArgument, y as ready, yt as Traced, z as resolve, zt as Animation } from "./src-
|
|
1
|
+
import { $ as sfx, A as types_exports$7, At as Noise, B as defineMotion, Bt as Frames, C as types_exports$14, Ct as effectsPlugin, D as types_exports$10, Dt as ColorMatrix, E as types_exports$11, Et as Blur, F as types_exports$2, Ft as scenesPlugin, G as external, Gt as PERF_CAUSES, H as platformPlugin, Ht as PASS_KINDS, I as types_exports$1, It as assetsPlugin, J as mark, Jt as PROBLEM_RULES, K as frames, Kt as PERF_GAP_BUCKETS, L as types_exports, Lt as animPlugin, M as types_exports$5, Mt as defineFilter, N as types_exports$4, Nt as debugPlugin, O as types_exports$9, Ot as Displacement, P as types_exports$3, Pt as audioPlugin, Q as set, Qt as flowPlugin, R as uiPlugin, Rt as AnimPlayer, S as types_exports$15, St as messageDuration, T as types_exports$12, Tt as Alpha, U as HAPTIC_KINDS, Ut as frameAt, V as textPlugin, Vt as rendererPlugin, W as defineAnimation, Wt as MONITOR_SECTIONS, X as play, Xt as DEMAND_REASONS, Y as parallel, Yt as SHADER_WHATS, Z as sequence, Zt as worldPlugin, _ as defineBundles, _t as Touchable, a as cubicBezier, an as SaveUnreadableError, at as wait, b as types_exports$17, bt as i18nPlugin, c as hint, cn as clockPlugin, ct as DropTarget, d as defineScene, dt as Pointer, en as exit, et as spawn, f as tr, ft as PointerOver, g as music, gt as Tappable, h as defineEmitter, ht as Swipeable, i as screen, in as modelPlugin, it as use, j as types_exports$6, jt as Outline, k as types_exports$8, kt as Glow, l as schedule, lt as Held, m as flattenFeatures, mt as Pressed, n as createPlugin, nn as to, nt as stagger, o as defineEffect, on as lifecyclePlugin, ot as inputPlugin, p as defineFeature, pt as Pressable, q as haptic, qt as PERF_LOG_VERSION, r as defineGame, rn as type, rt as tween, s as guide, sn as timePlugin, st as Draggable, t as createApp, tn as slot, tt as spawned, u as projection, ut as Hovered, v as load, vt as Traceable, w as types_exports$13, wt as Emitter, x as types_exports$16, xt as messageArgument, y as ready, yt as Traced, z as resolve, zt as Animation } from "./src-DWYFupNb.mjs";
|
|
2
2
|
import { $ as component, H as Shape, I as Display, J as Exiting, L as HudPart, Q as Tree, R as NineSlice, S as bind, T as label, U as Sprite, V as Parent, W as Transform, X as Now, Y as Layer, Z as Order, b as Countdown, d as LocalWrite, et as mut, g as popup, it as tag, l as DebugTrigger, nt as system, p as ScrollState, q as sprite, s as Box, tt as resource, v as defineTokens, w as defineTextStyles, x as Text, y as defineStyle, z as Overlay } from "./visual-kEC9nb-o.mjs";
|
|
3
3
|
import { t as defineComponent } from "./component-DGg5DqKK.mjs";
|
|
4
4
|
export { Alpha, types_exports as Anim, AnimPlayer, Animation, types_exports$1 as Assets, types_exports$2 as Audio, Blur, Box, types_exports$3 as Clock, ColorMatrix, Countdown, DEMAND_REASONS, types_exports$4 as Debug, DebugTrigger, Displacement, Display, Draggable, DropTarget, types_exports$5 as Effects, Emitter, Exiting, types_exports$6 as Flow, Frames, Glow, HAPTIC_KINDS, Held, Hovered, HudPart, types_exports$7 as I18n, types_exports$8 as Input, Layer, types_exports$9 as Lifecycle, LocalWrite, MONITOR_SECTIONS, types_exports$10 as Model, NineSlice, Noise, Now, Order, Outline, Overlay, PASS_KINDS, PERF_CAUSES, PERF_GAP_BUCKETS, PERF_LOG_VERSION, PROBLEM_RULES, Parent, types_exports$11 as Platform, Pointer, PointerOver, Pressable, Pressed, types_exports$12 as Renderer, SHADER_WHATS, SaveUnreadableError, types_exports$13 as Scenes, ScrollState, Shape, Sprite, Swipeable, Tappable, Text, types_exports$14 as TextTypes, types_exports$15 as Time, Touchable, Traceable, Traced, Transform, Tree, types_exports$16 as Ui, types_exports$17 as World, animPlugin, assetsPlugin, audioPlugin, bind, clockPlugin, component, createApp, createPlugin, cubicBezier, debugPlugin, defineAnimation, defineBundles, defineComponent, defineEffect, defineEmitter, defineFeature, defineFilter, defineGame, defineMotion, defineScene, defineStyle, defineTextStyles, defineTokens, effectsPlugin, exit, external, flattenFeatures, flowPlugin, frameAt, frames, guide, haptic, hint, i18nPlugin, inputPlugin, label, lifecyclePlugin, load, mark, messageArgument, messageDuration, modelPlugin, music, mut, parallel, platformPlugin, play, popup, projection, ready, rendererPlugin, resolve, resource, scenesPlugin, schedule, screen, sequence, set, sfx, slot, spawn, spawned, sprite, stagger, system, tag, textPlugin, timePlugin, to, tr, tween, type, uiPlugin, use, wait, worldPlugin };
|
|
@@ -37648,6 +37648,26 @@ function whenAborted$1(signal) {
|
|
|
37648
37648
|
});
|
|
37649
37649
|
}
|
|
37650
37650
|
/**
|
|
37651
|
+
* Waits for the textures of loaded bundles to reach the GPU, or for the abort. It never rejects:
|
|
37652
|
+
* a warm that fails (an unload during it) is logged and the switch goes on, its first draw
|
|
37653
|
+
* uploads as before. Headless, without a device or with `uploads: 0` the warms answer at once,
|
|
37654
|
+
* and textures already on the GPU are not waited for.
|
|
37655
|
+
*
|
|
37656
|
+
* @param ctx - Domain context of the plugin.
|
|
37657
|
+
* @param bundles - The bundles the scene being entered names, all of them loaded.
|
|
37658
|
+
* @param signal - The abort signal of the node.
|
|
37659
|
+
* @returns A promise that resolves when every warm settled or the node was aborted.
|
|
37660
|
+
*/
|
|
37661
|
+
async function untilWarmed(ctx, bundles, signal) {
|
|
37662
|
+
const warms = bundles.map((bundle) => ctx.deps.assets.warm(bundle).catch((error) => {
|
|
37663
|
+
ctx.log.warn("scenes: a bundle's textures were not uploaded before the switch", {
|
|
37664
|
+
bundle,
|
|
37665
|
+
error
|
|
37666
|
+
});
|
|
37667
|
+
}));
|
|
37668
|
+
await Promise.race([Promise.all(warms), whenAborted$1(signal)]);
|
|
37669
|
+
}
|
|
37670
|
+
/**
|
|
37651
37671
|
* Loads every bundle the scene names at once and returns as soon as all loads settled or the node
|
|
37652
37672
|
* is aborted. The first load that fails while the node still runs is rethrown, so `flow` rolls
|
|
37653
37673
|
* the node back; one that fails after the abort is logged, because nobody waits for it any more.
|
|
@@ -37814,7 +37834,9 @@ function apply(ctx, scene, named) {
|
|
|
37814
37834
|
}
|
|
37815
37835
|
/**
|
|
37816
37836
|
* Switches to another scene: it reads what the scene names from the committed state, awaits all
|
|
37817
|
-
* of it and only then builds the scene.
|
|
37837
|
+
* of it and only then builds the scene. In live mode it waits between the two for the textures of
|
|
37838
|
+
* those bundles to reach the GPU; a fast walk does not, so tests and restores keep their pace. An
|
|
37839
|
+
* aborted node, or a plugin stopped during the wait, returns without touching anything.
|
|
37818
37840
|
*
|
|
37819
37841
|
* @param ctx - Domain context of the plugin.
|
|
37820
37842
|
* @param target - Id of the scene to mount.
|
|
@@ -37827,7 +37849,9 @@ async function switchTo(ctx, target, run) {
|
|
|
37827
37849
|
if (scene === void 0) throw new Error(`[game] Scene "${target}" is not registered.\n List it in the scenes of a feature.`);
|
|
37828
37850
|
const named = namedBundles(scene, committedState(ctx));
|
|
37829
37851
|
await untilAborted(ctx, named, run.signal);
|
|
37830
|
-
if (run.signal.aborted)
|
|
37852
|
+
if (run.mode === "live" && !run.signal.aborted) await untilWarmed(ctx, named, run.signal);
|
|
37853
|
+
const stopped = ctx.state.teardown === void 0;
|
|
37854
|
+
if (run.signal.aborted || stopped) return;
|
|
37831
37855
|
apply(ctx, scene, named);
|
|
37832
37856
|
}
|
|
37833
37857
|
/**
|
package/dist/testing.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $t as refuseStart, en as exit, m as flattenFeatures, rn as type, t as createApp } from "./src-
|
|
1
|
+
import { $t as refuseStart, en as exit, m as flattenFeatures, rn as type, t as createApp } from "./src-DWYFupNb.mjs";
|
|
2
2
|
import { n as saveOf, t as memory } from "./memory-CWlqhS7l.mjs";
|
|
3
3
|
import { t as fakeClock } from "./fake-6mazmHK3.mjs";
|
|
4
4
|
import { i as stepFrames, r as runRepro, t as createHeadless } from "./headless-Bxxl_mQX.mjs";
|