textmode.js 0.9.0-beta.1 → 0.9.0-beta.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/dist/textmode.esm.js
CHANGED
|
@@ -585,17 +585,17 @@ class fe {
|
|
|
585
585
|
a(this, "A");
|
|
586
586
|
a(this, "Qs");
|
|
587
587
|
a(this, "pe");
|
|
588
|
-
a(this, "
|
|
589
|
-
this.A = t, this.Qs = new ce(e, i), this.pe = new le(this.Qs), this.
|
|
588
|
+
a(this, "ge");
|
|
589
|
+
this.A = t, this.Qs = new ce(e, i), this.pe = new le(this.Qs), this.ge = new ue(t, e);
|
|
590
590
|
}
|
|
591
|
-
|
|
591
|
+
me(t) {
|
|
592
592
|
var s, r, n, h, c, l, u, f, d, g;
|
|
593
593
|
const e = [0, 0, 0, 0], i = [0, 0, 0, 0];
|
|
594
594
|
return t.Ls && t.Hs ? (e[0] = ((s = t.Os) == null ? void 0 : s[0]) ?? 0, e[1] = ((r = t.Os) == null ? void 0 : r[1]) ?? 0, e[2] = ((n = t.Bs) == null ? void 0 : n[0]) ?? 0, e[3] = ((h = t.Bs) == null ? void 0 : h[1]) ?? 0, i[0] = t.Ls[0], i[1] = t.Ls[1], i[2] = t.Hs[0], i[3] = t.Hs[1]) : t.Ds && (e[0] = t.Ds[0], e[1] = t.Ds[1]), this.ne({ x: t.As[0], y: t.As[1], width: t.Ss[0], height: t.Ss[1], char0: t.Gt[0], char1: t.Gt[1], char2: t.Gt[2], r1: t.jt[0], g1: t.jt[1], b1: t.jt[2], a1: t.jt[3], r2: t.Nt[0], g2: t.Nt[1], b2: t.Nt[2], a2: t.Nt[3], invert: t.Rs[0], flipX: t.Rs[1], flipY: t.Rs[2], charRot: t.Tt, translationX: ((c = t.Es) == null ? void 0 : c[0]) ?? 0, translationY: ((l = t.Es) == null ? void 0 : l[1]) ?? 0, translationZ: ((u = t.Es) == null ? void 0 : u[2]) ?? 0, rotationX: ((f = t.ks) == null ? void 0 : f[0]) ?? 0, rotationY: ((d = t.ks) == null ? void 0 : d[1]) ?? 0, rotationZ: ((g = t.ks) == null ? void 0 : g[2]) ?? 0, curveParams0: e, curveParams1: i, depth: t.Is || 0, baseZ: t.Gs || 0, geometryType: t.js || 0 });
|
|
595
595
|
}
|
|
596
596
|
ne(t) {
|
|
597
597
|
const e = this.pe.ne(t);
|
|
598
|
-
return this.Qs.ee > this.
|
|
598
|
+
return this.Qs.ee > this.ge.ee && this.ge.le(this.Qs.ee), e;
|
|
599
599
|
}
|
|
600
600
|
get _e() {
|
|
601
601
|
return this.Qs.se;
|
|
@@ -610,17 +610,17 @@ class fe {
|
|
|
610
610
|
const e = this.Qs.se;
|
|
611
611
|
if (e === 0) return;
|
|
612
612
|
const i = this.Qs.te();
|
|
613
|
-
this.
|
|
613
|
+
this.ge.ue(i, e), this.ge.de(t);
|
|
614
614
|
}
|
|
615
615
|
ve(t) {
|
|
616
|
-
this.
|
|
616
|
+
this.ge.ve(t);
|
|
617
617
|
}
|
|
618
618
|
Ms(t, e) {
|
|
619
619
|
const i = this.Qs.se;
|
|
620
620
|
i !== 0 && this.A.drawArraysInstanced(t, 0, e, i);
|
|
621
621
|
}
|
|
622
622
|
Fs() {
|
|
623
|
-
this.
|
|
623
|
+
this.ge.Fs();
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
626
|
class O {
|
|
@@ -656,7 +656,7 @@ class O {
|
|
|
656
656
|
this.Ae.Fs(), this.A.deleteBuffer(this.xe);
|
|
657
657
|
}
|
|
658
658
|
$e(t, e, i) {
|
|
659
|
-
return this.Ae.
|
|
659
|
+
return this.Ae.me(t);
|
|
660
660
|
}
|
|
661
661
|
Pe(t, e, i, s, r, n) {
|
|
662
662
|
const h = r.Lt ?? 0, c = r.Ht ?? 0, l = r.Ot ?? 0, u = r.At ?? 0, f = r.bt ?? 0, d = r.wt ?? 0, g = [0, 0, 0, 0], v = [0, 0, 0, 0];
|
|
@@ -692,14 +692,14 @@ const Ae = { Ce: new Float32Array([0, 0, 0, 0, 1, 0, 1, 0, 0.5, 1, 0.5, 1]), Te:
|
|
|
692
692
|
constructor(o, t) {
|
|
693
693
|
super(o, t, F.RECTANGLE, de);
|
|
694
694
|
}
|
|
695
|
-
|
|
695
|
+
me(o, t) {
|
|
696
696
|
return this.Pe(0, 0, o.width, o.height, t);
|
|
697
697
|
}
|
|
698
698
|
}, [F.LINE]: class extends O {
|
|
699
699
|
constructor(o, t) {
|
|
700
700
|
super(o, t, F.LINE, ge);
|
|
701
701
|
}
|
|
702
|
-
|
|
702
|
+
me(o, t) {
|
|
703
703
|
const e = o.x2 - o.x1, i = o.y2 - o.y1, s = Math.hypot(e, i), r = Math.atan2(i, e), n = t.Dt || 1, h = o.x1 + e / 2 - s / 2, c = o.y1 + i / 2, l = { ...t, wt: (t.wt || 0) + r };
|
|
704
704
|
return this.Pe(h, c, s, n, l);
|
|
705
705
|
}
|
|
@@ -707,14 +707,14 @@ const Ae = { Ce: new Float32Array([0, 0, 0, 0, 1, 0, 1, 0, 0.5, 1, 0.5, 1]), Te:
|
|
|
707
707
|
constructor(o, t) {
|
|
708
708
|
super(o, t, F.ELLIPSE, ve);
|
|
709
709
|
}
|
|
710
|
-
|
|
710
|
+
me(o, t) {
|
|
711
711
|
return this.Pe(0, 0, o.width, o.height, t);
|
|
712
712
|
}
|
|
713
713
|
}, [F.ARC]: class extends O {
|
|
714
714
|
constructor(o, t) {
|
|
715
715
|
super(o, t, F.ARC, me);
|
|
716
716
|
}
|
|
717
|
-
|
|
717
|
+
me(o, t) {
|
|
718
718
|
const e = o.start * Math.PI / 180, i = o.stop * Math.PI / 180;
|
|
719
719
|
return this.Pe(0, 0, o.width, o.height, t, { arcStart: e, arcStop: i });
|
|
720
720
|
}
|
|
@@ -722,7 +722,7 @@ const Ae = { Ce: new Float32Array([0, 0, 0, 0, 1, 0, 1, 0, 0.5, 1, 0.5, 1]), Te:
|
|
|
722
722
|
constructor(o, t) {
|
|
723
723
|
super(o, t, F.TRIANGLE, Ae);
|
|
724
724
|
}
|
|
725
|
-
|
|
725
|
+
me(o, t) {
|
|
726
726
|
const e = Math.min(o.x1, o.x2, o.x3), i = Math.max(o.x1, o.x2, o.x3), s = Math.min(o.y1, o.y2, o.y3), r = i - e, n = Math.max(o.y1, o.y2, o.y3) - s;
|
|
727
727
|
return this.Pe(e, s, r, n, t);
|
|
728
728
|
}
|
|
@@ -730,7 +730,7 @@ const Ae = { Ce: new Float32Array([0, 0, 0, 0, 1, 0, 1, 0, 0.5, 1, 0.5, 1]), Te:
|
|
|
730
730
|
constructor(o, t) {
|
|
731
731
|
super(o, t, F.BEZIER_CURVE, pe);
|
|
732
732
|
}
|
|
733
|
-
|
|
733
|
+
me(o, t) {
|
|
734
734
|
return this.Pe(0, 0, 1, t.Dt || 1, t, { cp1x: o.cp1x, cp1y: o.cp1y, cp2x: o.cp2x, cp2y: o.cp2y, bezStartX: o.x1, bezStartY: o.y1, bezEndX: o.x2, bezEndY: o.y2 });
|
|
735
735
|
}
|
|
736
736
|
} };
|
|
@@ -761,7 +761,7 @@ class Ee {
|
|
|
761
761
|
e.shader.D(), e.shader.H(e.uniforms);
|
|
762
762
|
const n = St(this.A), h = s.length > 0 && s[0].state.St;
|
|
763
763
|
if (e.shader.H({ UJ: n[2] / n[3], UG: [n[2], n[3]], UH: 1, UI: h ? 1 : 0 }), r.Me(), s.forEach((c) => {
|
|
764
|
-
r.
|
|
764
|
+
r.me(c.params, c.state);
|
|
765
765
|
}), r.Fe()) {
|
|
766
766
|
const c = r.unitGeometry, l = r.unitBuffer;
|
|
767
767
|
try {
|
|
@@ -935,10 +935,10 @@ class Te {
|
|
|
935
935
|
O(t, e) {
|
|
936
936
|
this.ni[t] = e;
|
|
937
937
|
}
|
|
938
|
-
|
|
938
|
+
gi(t) {
|
|
939
939
|
Object.assign(this.ni, t);
|
|
940
940
|
}
|
|
941
|
-
|
|
941
|
+
mi(t) {
|
|
942
942
|
return new Q(this.A, rt, t);
|
|
943
943
|
}
|
|
944
944
|
_i(t, e, i, s) {
|
|
@@ -1602,11 +1602,11 @@ class it {
|
|
|
1602
1602
|
a(this, "dr", { width: 0, height: 0 });
|
|
1603
1603
|
a(this, "vr");
|
|
1604
1604
|
a(this, "pr");
|
|
1605
|
-
a(this, "mr");
|
|
1606
1605
|
a(this, "gr");
|
|
1606
|
+
a(this, "mr");
|
|
1607
1607
|
a(this, "_r");
|
|
1608
1608
|
a(this, "yr", !1);
|
|
1609
|
-
this.cr = e, this.pr = new ze(), this.
|
|
1609
|
+
this.cr = e, this.pr = new ze(), this.gr = new Ne(t), this.mr = new Be(), this._r = new _e();
|
|
1610
1610
|
}
|
|
1611
1611
|
async Ar(t) {
|
|
1612
1612
|
if (this.yr) return;
|
|
@@ -1621,8 +1621,8 @@ class it {
|
|
|
1621
1621
|
}
|
|
1622
1622
|
Cr(t) {
|
|
1623
1623
|
if (t === void 0) return this.cr;
|
|
1624
|
-
this.cr = t, this.dr = this.
|
|
1625
|
-
const e = this.
|
|
1624
|
+
this.cr = t, this.dr = this.mr.Ji(this.nr.map((i) => i.character), this.cr, this.rr);
|
|
1625
|
+
const e = this.gr.Gi(this.nr, this.dr, this.cr, this.rr);
|
|
1626
1626
|
this.ar = e.framebuffer, this.lr = e.columns, this.ur = e.rows;
|
|
1627
1627
|
}
|
|
1628
1628
|
async Mr(t) {
|
|
@@ -1644,8 +1644,8 @@ class it {
|
|
|
1644
1644
|
}
|
|
1645
1645
|
async wr() {
|
|
1646
1646
|
const t = this.pr.Di(this.rr), { array: e, map: i } = this._r.sr(t, this.rr);
|
|
1647
|
-
this.nr = e, this.hr = i, this.dr = this.
|
|
1648
|
-
const s = this.
|
|
1647
|
+
this.nr = e, this.hr = i, this.dr = this.mr.Ji(t, this.cr, this.rr);
|
|
1648
|
+
const s = this.gr.Gi(this.nr, this.dr, this.cr, this.rr);
|
|
1649
1649
|
this.ar = s.framebuffer, this.lr = s.columns, this.ur = s.rows, this.yr = !0;
|
|
1650
1650
|
}
|
|
1651
1651
|
Fr(t) {
|
|
@@ -1934,8 +1934,8 @@ class zt {
|
|
|
1934
1934
|
a(this, "Bt", 0);
|
|
1935
1935
|
a(this, "It", 0);
|
|
1936
1936
|
a(this, "Tt", 0);
|
|
1937
|
-
a(this, "
|
|
1938
|
-
a(this, "
|
|
1937
|
+
a(this, "gn", "sampled");
|
|
1938
|
+
a(this, "mn", "fixed");
|
|
1939
1939
|
a(this, "jt", [1, 1, 1, 1]);
|
|
1940
1940
|
a(this, "Nt", [0, 0, 0, 1]);
|
|
1941
1941
|
a(this, "_n", [0, 0, 0, 1]);
|
|
@@ -1962,10 +1962,10 @@ class zt {
|
|
|
1962
1962
|
return this.Tt = Mt(t), this.Z = null, this;
|
|
1963
1963
|
}
|
|
1964
1964
|
charColorMode(t) {
|
|
1965
|
-
return this.
|
|
1965
|
+
return this.gn = t, this.Z = null, this;
|
|
1966
1966
|
}
|
|
1967
1967
|
cellColorMode(t) {
|
|
1968
|
-
return this.
|
|
1968
|
+
return this.mn = t, this.Z = null, this;
|
|
1969
1969
|
}
|
|
1970
1970
|
charColor(t, e, i, s) {
|
|
1971
1971
|
return this.bn(this.jt, t, e, i, s), this.Z = null, this;
|
|
@@ -2017,7 +2017,7 @@ class zt {
|
|
|
2017
2017
|
this.yn = e.length > 0 ? e : this.yn;
|
|
2018
2018
|
}
|
|
2019
2019
|
createBaseConversionUniforms() {
|
|
2020
|
-
return { u_image: this.Fn(), u_invert: !!this.Pt, u_flipX: !!this.Bt, u_flipY: !!this.It, u_charRotation: this.Tt, u_charColorFixed: this.
|
|
2020
|
+
return { u_image: this.Fn(), u_invert: !!this.Pt, u_flipX: !!this.Bt, u_flipY: !!this.It, u_charRotation: this.Tt, u_charColorFixed: this.gn === "fixed", u_charColor: this.jt, u_cellColorFixed: this.mn === "fixed", u_cellColor: this.Nt, u_backgroundColor: this._n, u_charCount: this.yn.length, u_charList: this.yn };
|
|
2021
2021
|
}
|
|
2022
2022
|
Cn() {
|
|
2023
2023
|
if (this.vn && this.vn.id === this.dn) return this.vn;
|
|
@@ -2108,11 +2108,17 @@ class Nt {
|
|
|
2108
2108
|
Zn() {
|
|
2109
2109
|
this.On++;
|
|
2110
2110
|
}
|
|
2111
|
-
qn() {
|
|
2111
|
+
get qn() {
|
|
2112
2112
|
return this.Bn === -1 ? 0 : performance.now() - this.Bn;
|
|
2113
2113
|
}
|
|
2114
|
-
|
|
2115
|
-
|
|
2114
|
+
set qn(t) {
|
|
2115
|
+
this.Bn = performance.now() - t;
|
|
2116
|
+
}
|
|
2117
|
+
get Vn() {
|
|
2118
|
+
return this.qn / 1e3;
|
|
2119
|
+
}
|
|
2120
|
+
set Vn(t) {
|
|
2121
|
+
this.qn = 1e3 * t;
|
|
2116
2122
|
}
|
|
2117
2123
|
get Jn() {
|
|
2118
2124
|
return this.Hn;
|
|
@@ -2339,8 +2345,8 @@ class Ot {
|
|
|
2339
2345
|
a(this, "dh");
|
|
2340
2346
|
a(this, "fo", !1);
|
|
2341
2347
|
a(this, "ph");
|
|
2342
|
-
a(this, "mh");
|
|
2343
2348
|
a(this, "gh");
|
|
2349
|
+
a(this, "mh");
|
|
2344
2350
|
a(this, "_h");
|
|
2345
2351
|
a(this, "yh");
|
|
2346
2352
|
a(this, "Ah");
|
|
@@ -2400,10 +2406,10 @@ class Ot {
|
|
|
2400
2406
|
this.ph = t;
|
|
2401
2407
|
}
|
|
2402
2408
|
ko(t) {
|
|
2403
|
-
this.
|
|
2409
|
+
this.gh = t;
|
|
2404
2410
|
}
|
|
2405
2411
|
Qh(t) {
|
|
2406
|
-
this.
|
|
2412
|
+
this.mh = t;
|
|
2407
2413
|
}
|
|
2408
2414
|
Yh(t) {
|
|
2409
2415
|
this._h = t;
|
|
@@ -2451,7 +2457,7 @@ class Ot {
|
|
|
2451
2457
|
const n = this.eh.get(r.id), h = n ? this.ta(n) : void 0;
|
|
2452
2458
|
h && this.ih.set(r.id, h), this.eh.set(r.id, r);
|
|
2453
2459
|
const c = this.rh.get(r.id);
|
|
2454
|
-
c && (c.lastPosition = r, c.lastTime = e, h) && H(h.clientX, h.clientY, r.clientX, r.clientY) > this.Th && c.longPressTimer !== null && (window.clearTimeout(c.longPressTimer), c.longPressTimer = null), this.
|
|
2460
|
+
c && (c.lastPosition = r, c.lastTime = e, h) && H(h.clientX, h.clientY, r.clientX, r.clientY) > this.Th && c.longPressTimer !== null && (window.clearTimeout(c.longPressTimer), c.longPressTimer = null), this.gh && this.gh(this.sa(r, t, h, e));
|
|
2455
2461
|
}
|
|
2456
2462
|
this.eh.size === 2 ? this.ia(t) : this.nh = null;
|
|
2457
2463
|
}
|
|
@@ -2461,7 +2467,7 @@ class Ot {
|
|
|
2461
2467
|
const e = performance.now(), i = this.Jh(t.changedTouches);
|
|
2462
2468
|
for (const s of i) {
|
|
2463
2469
|
const r = this.eh.get(s.id), n = r ? this.ta(r) : void 0, h = this.rh.get(s.id);
|
|
2464
|
-
h && h.longPressTimer !== null && (window.clearTimeout(h.longPressTimer), h.longPressTimer = null), this.
|
|
2470
|
+
h && h.longPressTimer !== null && (window.clearTimeout(h.longPressTimer), h.longPressTimer = null), this.mh && this.mh(this.sa(s, t, n, e)), h && this.ra(h, t), this.rh.delete(s.id), this.ih.delete(s.id), this.eh.delete(s.id);
|
|
2465
2471
|
}
|
|
2466
2472
|
this.eh.size < 2 && (this.nh = null);
|
|
2467
2473
|
}
|
|
@@ -2712,16 +2718,16 @@ const je = (o) => class extends o {
|
|
|
2712
2718
|
this.K.O(t, e);
|
|
2713
2719
|
}
|
|
2714
2720
|
setUniforms(t) {
|
|
2715
|
-
this.K.
|
|
2721
|
+
this.K.gi(t);
|
|
2716
2722
|
}
|
|
2717
2723
|
async createFilterShader(t) {
|
|
2718
2724
|
if (typeof t == "string" && (t.startsWith("./") || t.startsWith("../") || t.endsWith(".frag") || t.endsWith(".glsl"))) {
|
|
2719
2725
|
const e = await fetch(t);
|
|
2720
2726
|
if (!e.ok) throw Error(`Failed to load shader from ${t}: ${e.statusText}`);
|
|
2721
2727
|
const i = await e.text();
|
|
2722
|
-
return this.K.
|
|
2728
|
+
return this.K.mi(i);
|
|
2723
2729
|
}
|
|
2724
|
-
return this.K.
|
|
2730
|
+
return this.K.mi(t);
|
|
2725
2731
|
}
|
|
2726
2732
|
async createShader(t, e) {
|
|
2727
2733
|
let i, s;
|
|
@@ -2776,11 +2782,17 @@ const je = (o) => class extends o {
|
|
|
2776
2782
|
isLooping() {
|
|
2777
2783
|
return this.da.Xn;
|
|
2778
2784
|
}
|
|
2779
|
-
millis() {
|
|
2780
|
-
return this.da.qn
|
|
2785
|
+
get millis() {
|
|
2786
|
+
return this.da.qn;
|
|
2781
2787
|
}
|
|
2782
|
-
|
|
2783
|
-
|
|
2788
|
+
set millis(t) {
|
|
2789
|
+
this.da.qn = t;
|
|
2790
|
+
}
|
|
2791
|
+
get secs() {
|
|
2792
|
+
return this.da.Vn;
|
|
2793
|
+
}
|
|
2794
|
+
set secs(t) {
|
|
2795
|
+
this.da.Vn = t;
|
|
2784
2796
|
}
|
|
2785
2797
|
deltaTime() {
|
|
2786
2798
|
return this.da.Jn;
|
|
@@ -2852,30 +2864,30 @@ const je = (o) => class extends o {
|
|
|
2852
2864
|
super(...t);
|
|
2853
2865
|
}
|
|
2854
2866
|
keyPressed(t) {
|
|
2855
|
-
this.
|
|
2867
|
+
this.ga.Ro(t);
|
|
2856
2868
|
}
|
|
2857
2869
|
keyReleased(t) {
|
|
2858
|
-
this.
|
|
2870
|
+
this.ga.Eo(t);
|
|
2859
2871
|
}
|
|
2860
2872
|
isKeyPressed(t) {
|
|
2861
|
-
return this.
|
|
2873
|
+
return this.ga.Wo(t);
|
|
2862
2874
|
}
|
|
2863
2875
|
get lastKeyPressed() {
|
|
2864
|
-
return this.
|
|
2876
|
+
return this.ga.Zo();
|
|
2865
2877
|
}
|
|
2866
2878
|
get lastKeyReleased() {
|
|
2867
|
-
return this.
|
|
2879
|
+
return this.ga.qo();
|
|
2868
2880
|
}
|
|
2869
2881
|
get pressedKeys() {
|
|
2870
|
-
return this.
|
|
2882
|
+
return this.ga.Vo();
|
|
2871
2883
|
}
|
|
2872
2884
|
get modifierState() {
|
|
2873
|
-
return this.
|
|
2885
|
+
return this.ga.Jo();
|
|
2874
2886
|
}
|
|
2875
2887
|
};
|
|
2876
2888
|
class It {
|
|
2877
2889
|
constructor(t) {
|
|
2878
|
-
a(this, "
|
|
2890
|
+
a(this, "ma");
|
|
2879
2891
|
a(this, "_a", /* @__PURE__ */ new Map());
|
|
2880
2892
|
a(this, "ya", []);
|
|
2881
2893
|
a(this, "ba", /* @__PURE__ */ new Map());
|
|
@@ -2886,14 +2898,14 @@ class It {
|
|
|
2886
2898
|
a(this, "Ua", /* @__PURE__ */ new Map());
|
|
2887
2899
|
a(this, "Fa", /* @__PURE__ */ new Map());
|
|
2888
2900
|
a(this, "$a", /* @__PURE__ */ new Map());
|
|
2889
|
-
this.
|
|
2901
|
+
this.ma = t;
|
|
2890
2902
|
}
|
|
2891
2903
|
Pa(t) {
|
|
2892
2904
|
for (const e of t) {
|
|
2893
2905
|
if (this._a.has(e.name)) return void console.warn(`[textmode.js] Plugin "${e.name}" is already installed.`);
|
|
2894
2906
|
const i = this.Ta(e.name);
|
|
2895
2907
|
try {
|
|
2896
|
-
const s = e.install(this.
|
|
2908
|
+
const s = e.install(this.ma, i);
|
|
2897
2909
|
s instanceof Promise && s.catch((r) => {
|
|
2898
2910
|
console.error(`[textmode.js] Async plugin "${e.name}" installation error:`, r), this.za(e.name);
|
|
2899
2911
|
});
|
|
@@ -2908,7 +2920,7 @@ class It {
|
|
|
2908
2920
|
if (this._a.has(e.name)) return void console.warn(`[textmode.js] Plugin "${e.name}" is already installed.`);
|
|
2909
2921
|
const i = this.Ta(e.name);
|
|
2910
2922
|
try {
|
|
2911
|
-
await e.install(this.
|
|
2923
|
+
await e.install(this.ma, i);
|
|
2912
2924
|
} catch (s) {
|
|
2913
2925
|
throw this.za(e.name), s;
|
|
2914
2926
|
}
|
|
@@ -2919,7 +2931,7 @@ class It {
|
|
|
2919
2931
|
const e = this._a.get(t);
|
|
2920
2932
|
if (!e) return;
|
|
2921
2933
|
const i = this.Ta(t);
|
|
2922
|
-
e.uninstall && await e.uninstall(this.
|
|
2934
|
+
e.uninstall && await e.uninstall(this.ma, i), this._a.delete(t), this.ya.splice(this.ya.indexOf(t), 1), this.za(t);
|
|
2923
2935
|
}
|
|
2924
2936
|
Ea() {
|
|
2925
2937
|
this.ka(this.ba);
|
|
@@ -2947,7 +2959,7 @@ class It {
|
|
|
2947
2959
|
for (const e of t) await this.Ra(e);
|
|
2948
2960
|
}
|
|
2949
2961
|
Ta(t) {
|
|
2950
|
-
const e = this.
|
|
2962
|
+
const e = this.ma, i = this;
|
|
2951
2963
|
return { get renderer() {
|
|
2952
2964
|
return e.K;
|
|
2953
2965
|
}, get canvas() {
|
|
@@ -3027,11 +3039,11 @@ class It {
|
|
|
3027
3039
|
s || this.Ka(e);
|
|
3028
3040
|
}
|
|
3029
3041
|
Za(t, e) {
|
|
3030
|
-
const i = Object.getPrototypeOf(this.
|
|
3042
|
+
const i = Object.getPrototypeOf(this.ma.layers.base);
|
|
3031
3043
|
Object.defineProperty(i, t, { value: e, writable: !0, configurable: !0, enumerable: !1 });
|
|
3032
3044
|
}
|
|
3033
3045
|
Ka(t) {
|
|
3034
|
-
const e = Object.getPrototypeOf(this.
|
|
3046
|
+
const e = Object.getPrototypeOf(this.ma.layers.base), i = Object.getOwnPropertyDescriptor(e, t);
|
|
3035
3047
|
i && i.configurable && delete e[t];
|
|
3036
3048
|
}
|
|
3037
3049
|
}
|
|
@@ -3095,10 +3107,10 @@ class Kt {
|
|
|
3095
3107
|
get vc() {
|
|
3096
3108
|
return this.uc;
|
|
3097
3109
|
}
|
|
3098
|
-
get
|
|
3110
|
+
get gc() {
|
|
3099
3111
|
return this.uc !== "disabled";
|
|
3100
3112
|
}
|
|
3101
|
-
get
|
|
3113
|
+
get mc() {
|
|
3102
3114
|
return this.uc === "active" || this.uc === "transitioning" || this.uc === "error";
|
|
3103
3115
|
}
|
|
3104
3116
|
get _c() {
|
|
@@ -3323,7 +3335,7 @@ class st {
|
|
|
3323
3335
|
}
|
|
3324
3336
|
if (this.Nc.end(), t.Jc.Ia(this), i === "2d") {
|
|
3325
3337
|
const n = this.Kc.length > 0, h = n ? this.Yc : this.Qc;
|
|
3326
|
-
h.begin(), s.fi(e), e.H({ u_characterTexture: this.rr.fontFramebuffer, u_charsetDimensions: [this.rr.textureColumns, this.rr.textureRows],
|
|
3338
|
+
h.begin(), s.fi(e), e.H({ u_characterTexture: this.rr.fontFramebuffer, u_charsetDimensions: [this.rr.textureColumns, this.rr.textureRows], Ul: this.Nc.textures[0], Um: this.Nc.textures[1], Un: this.Nc.textures[2], Uo: [r.cols, r.rows], Up: [h.width, h.height], Uq: [0, 0, 0, 0] }), s.Ai(0, 0, r.width, r.height), h.end(), n && this.Gc.filterManager.tl(this.Yc.textures[0], this.Qc, this.Kc, this.Qc.width, this.Qc.height, this.Xc);
|
|
3327
3339
|
}
|
|
3328
3340
|
this.Kc = [];
|
|
3329
3341
|
}
|
|
@@ -3365,11 +3377,11 @@ class st {
|
|
|
3365
3377
|
}
|
|
3366
3378
|
const z = `#version 300 es
|
|
3367
3379
|
layout(location=0)in vec2 A;layout(location=1)in vec2 B;out vec2 v_uv;void main(){v_uv=B;gl_Position=vec4(A,0.,1.);}`, kt = `#version 300 es
|
|
3368
|
-
precision highp float;uniform sampler2D u_characterTexture;uniform vec2 u_charsetDimensions;uniform sampler2D
|
|
3380
|
+
precision highp float;uniform sampler2D u_characterTexture;uniform vec2 u_charsetDimensions;uniform sampler2D Um;uniform sampler2D Un;uniform sampler2D Ul;uniform vec2 Uo;uniform vec2 Up;uniform vec4 Uq;in vec2 v_uv;out vec4 fragColor;mat2 A(float B){float C=sin(B);float D=cos(B);return mat2(D,-C,C,D);}void main(){vec2 E=gl_FragCoord.xy/Up;vec2 F=E*Uo;vec2 G=floor(F);vec2 H=(G+0.5)/Uo;vec4 I=texture(Um,H);vec4 J=texture(Un,H);vec4 K=texture(Ul,H);int L=int(K.b*255.+0.5);bool M=(L&1)!=0;bool N=(L&2)!=0;bool O=(L&4)!=0;int P=int(K.r*255.+0.5)+int(K.g*255.+0.5)*256;int Q=int(u_charsetDimensions.x);int R=P/Q;int S=P-(R*Q);float T=(u_charsetDimensions.y-1.)-float(R);vec2 U=1./u_charsetDimensions;vec2 V=vec2(float(S),T)*U;vec2 W=V+U;float X=-K.a*360.*0.017453292;vec2 Y=fract(F)-0.5f;vec2 Z=vec2(N?-1.:1.,O?-1.:1.);Y*=Z;Y=A(X)*Y+0.5;vec2 a=V+clamp(Y,0.,1.)*U;const float b=0.0001;if(any(lessThan(a,V-b))||any(greaterThan(a,W+b))){fragColor=M?I:J;return;}vec4 c=texture(u_characterTexture,a);if(M)c.rgb=mix(c.rgb,1.-c.rgb,float(M));vec4 d=mix(Uq,J,J.a);fragColor=mix(d,I,c);}`, yt = `#version 300 es
|
|
3369
3381
|
precision highp float;uniform sampler2D u_texture;in vec2 v_uv;out vec4 fragColor;void main(){fragColor=texture(u_texture,v_uv);}`, qe = { message: "LOADING...", tone: "auto", transition: "fade", transitionDuration: 500 };
|
|
3370
3382
|
class Wt {
|
|
3371
3383
|
constructor(t, e, i) {
|
|
3372
|
-
a(this, "
|
|
3384
|
+
a(this, "ma");
|
|
3373
3385
|
a(this, "l");
|
|
3374
3386
|
a(this, "sl");
|
|
3375
3387
|
a(this, "Rc");
|
|
@@ -3384,19 +3396,19 @@ class Wt {
|
|
|
3384
3396
|
a(this, "ll", !1);
|
|
3385
3397
|
a(this, "yr", !1);
|
|
3386
3398
|
a(this, "vl");
|
|
3387
|
-
this.
|
|
3399
|
+
this.ma = t, this.l = { ...qe, ...e ?? {} }, this.sl = new Kt("active"), this.Rc = new Xt(), this.el = new Yt(this.l.transition, this.l.transitionDuration), this.il = new Nt(60), this.hl = mt(this.l, i);
|
|
3388
3400
|
const s = Gt(this.hl);
|
|
3389
|
-
this.ol = Ht(s, this.
|
|
3401
|
+
this.ol = Ht(s, this.ma), this.nl = this.ul(), this.Rc.nc((r) => {
|
|
3390
3402
|
r >= 0.999 && this.wc();
|
|
3391
3403
|
});
|
|
3392
3404
|
}
|
|
3393
3405
|
async Ar() {
|
|
3394
3406
|
if (this.yr) return;
|
|
3395
|
-
const t = this.
|
|
3407
|
+
const t = this.ma.K, e = this.ma.Er;
|
|
3396
3408
|
this.rl = new st(t, { visible: !0, opacity: 1, fontSize: 16 }), await this.rl.qc({ renderer: t, canvas: e, filterManager: null, createFramebuffer: (i, s, r = 1, n) => t.$i(i, s, r, n) }), this.yr = !0;
|
|
3397
3409
|
}
|
|
3398
|
-
get
|
|
3399
|
-
return this.sl.
|
|
3410
|
+
get mc() {
|
|
3411
|
+
return this.sl.mc && this.ll;
|
|
3400
3412
|
}
|
|
3401
3413
|
In() {
|
|
3402
3414
|
this.ll || (this.ll = !0, this.al = performance.now(), this.cl = 0, this.il.In(() => this.fl()));
|
|
@@ -3434,7 +3446,7 @@ class Wt {
|
|
|
3434
3446
|
this.sl.Mc(t);
|
|
3435
3447
|
}
|
|
3436
3448
|
fl() {
|
|
3437
|
-
if (this.sl.
|
|
3449
|
+
if (this.sl.mc) {
|
|
3438
3450
|
if (this.cl++, this.sl.vc === "transitioning" && this.el.et())
|
|
3439
3451
|
return this.sl.Cc(), this.dl(), void this.Gn();
|
|
3440
3452
|
this.ml();
|
|
@@ -3442,15 +3454,15 @@ class Wt {
|
|
|
3442
3454
|
}
|
|
3443
3455
|
ml() {
|
|
3444
3456
|
if (!this.yr) return;
|
|
3445
|
-
const t = this.rl, e = t.grid, i = this.
|
|
3457
|
+
const t = this.rl, e = t.grid, i = this.ma.K, s = this.ma.K.di(z, kt), r = this.ma.K.di(z, yt), n = { textmodifier: this.ma, grid: e, progress: this.progress, elapsedMs: performance.now() - this.al, frameCount: this.cl, message: this.l.message, palette: this.ol, theme: this.hl, phases: this.Rc.lc(), transitionOpacity: this.el.zc, isError: this.sl.vc === "error", errorMessage: this.sl._c || void 0, errorDetails: this.sl.yc || void 0 };
|
|
3446
3458
|
t.draw(() => {
|
|
3447
|
-
this.
|
|
3459
|
+
this.ma.clear(), this.ma.push();
|
|
3448
3460
|
try {
|
|
3449
3461
|
this.nl(n);
|
|
3450
3462
|
} finally {
|
|
3451
|
-
this.
|
|
3463
|
+
this.ma.pop();
|
|
3452
3464
|
}
|
|
3453
|
-
}), t.va(this.
|
|
3465
|
+
}), t.va(this.ma, s, "2d");
|
|
3454
3466
|
const h = t.texture;
|
|
3455
3467
|
h && (i.ye(...i.state.canvasBackgroundColor), i.fi(r), r.H({ u_texture: h }), i.Ai(e.offsetX, e.offsetY, e.width, e.height));
|
|
3456
3468
|
}
|
|
@@ -3481,7 +3493,7 @@ class Qt {
|
|
|
3481
3493
|
a(this, "Xc");
|
|
3482
3494
|
a(this, "bl", 0);
|
|
3483
3495
|
this.K = t, this.Al = t.di(z, `#version 300 es
|
|
3484
|
-
precision highp float;uniform sampler2D
|
|
3496
|
+
precision highp float;uniform sampler2D Ud;uniform sampler2D Ue;uniform vec2 Uf;uniform vec2 Ug;uniform vec2 Uh;uniform float Ui;uniform float Uj;uniform int Uk;in vec2 v_uv;out vec4 fragColor;const int A=0;const int B=1;const int C=2;const int D=3;const int E=4;const int F=5;const int G=6;const int H=7;const int I=8;const int J=9;const int K=10;const int L=11;const int M=12;const int N=13;vec3 O(vec3 P,vec3 Q){return Q;}vec3 R(vec3 P,vec3 Q){return P+Q;}vec3 S(vec3 P,vec3 Q){return P*Q;}vec3 T(vec3 P,vec3 Q){return 1.-(1.-P)*(1.-Q);}vec3 U(vec3 P,vec3 Q){return max(P-Q,0.);}vec3 V(vec3 P,vec3 Q){return min(P,Q);}vec3 W(vec3 P,vec3 Q){return max(P,Q);}vec3 X(vec3 P,vec3 Q){return mix(2.*P*Q,1.-2.*(1.-P)*(1.-Q),step(0.5,P));}vec3 Y(vec3 P,vec3 Q){return mix(P-(1.-2.*Q)*P*(1.-P),mix(P+(2.*Q-1.)*(P*(3.-2.*P)-P),P+(2.*Q-1.)*(sqrt(P)-P),step(0.25,P)),step(0.5,Q));}vec3 Z(vec3 P,vec3 Q){return mix(2.*P*Q,1.-2.*(1.-P)*(1.-Q),step(0.5,Q));}vec3 a(vec3 P,vec3 Q){return mix(min(vec3(1.),P/max(1.-Q,0.0001)),vec3(1.),step(1.,Q));}vec3 b(vec3 P,vec3 Q){return mix(1.-min(vec3(1.),(1.-P)/max(Q,0.0001)),vec3(0.),step(Q,vec3(0.)));}vec3 c(vec3 P,vec3 Q){return abs(P-Q);}vec3 d(vec3 P,vec3 Q){return P+Q-2.*P*Q;}vec3 e(int f,vec3 P,vec3 Q){if(f==A)return O(P,Q);if(f==B)return R(P,Q);if(f==C)return S(P,Q);if(f==D)return T(P,Q);if(f==E)return U(P,Q);if(f==F)return V(P,Q);if(f==G)return W(P,Q);if(f==H)return X(P,Q);if(f==I)return Y(P,Q);if(f==J)return Z(P,Q);if(f==K)return a(P,Q);if(f==L)return b(P,Q);if(f==M)return c(P,Q);if(f==N)return d(P,Q);return O(P,Q);}void main(){vec4 g=texture(Ue,v_uv);vec2 h=v_uv*Uf;vec2 i=h-Uh;vec2 j=Ug*0.5;vec2 k=i-j;float l=cos(-Uj);float m=sin(-Uj);vec2 n=vec2(k.x*l-k.y*m,k.x*m+k.y*l);i=n+j;bool o=any(lessThan(i,vec2(0.)))||any(greaterThanEqual(i,Ug));if(o){fragColor=g;return;}vec2 p=(floor(i)+0.5)/Ug;vec4 q=texture(Ud,p);float r=q.a*Ui;if(r<=0.){fragColor=g;return;}vec3 s=e(Uk,g.rgb,q.rgb);vec3 t=mix(g.rgb,s,r);float u=g.a+r*(1.-g.a);fragColor=vec4(t,u);}`), this.Xc = [this.K.$i(e, i, 1), this.K.$i(e, i, 1)];
|
|
3485
3497
|
}
|
|
3486
3498
|
wl(t) {
|
|
3487
3499
|
const e = this.K.context, { base: i, targetFramebuffer: s, backgroundColor: r, layers: n, canvasWidth: h, canvasHeight: c } = t, l = e.isEnabled(e.DEPTH_TEST), u = e.getParameter(e.DEPTH_WRITEMASK);
|
|
@@ -3496,11 +3508,11 @@ precision highp float;uniform sampler2D Uj;uniform sampler2D Uk;uniform vec2 Ul;
|
|
|
3496
3508
|
}
|
|
3497
3509
|
xl(t, e, i, s, r, n, h, c, l, u) {
|
|
3498
3510
|
const f = this.Xc[this.bl], d = this.bl === 0 ? 1 : 0, g = this.Xc[d], v = l * (Math.PI / 180);
|
|
3499
|
-
g.begin(), this.K.fi(this.Al), this.Al.H({
|
|
3511
|
+
g.begin(), this.K.fi(this.Al), this.Al.H({ Ud: t, Ue: f.textures[0], Uf: [e, i], Ug: [s, r], Uh: [h, c], Ui: n, Uj: v, Uk: Ft[u] }), this.K.Ai(0, 0, f.width, f.height), g.end(), this.bl = d;
|
|
3500
3512
|
}
|
|
3501
3513
|
Cl(t, e, i) {
|
|
3502
3514
|
const s = this.Xc[this.bl];
|
|
3503
|
-
t.begin(), this.K.fi(this.Al), this.Al.H({
|
|
3515
|
+
t.begin(), this.K.fi(this.Al), this.Al.H({ Ud: s.textures[0], Ue: s.textures[0], Uf: [e, i], Ug: [s.width, s.height], Uh: [0, 0], Ui: 1, Uj: 0, Uk: Ft.normal }), this.K.Ai(0, 0, e, i), t.end();
|
|
3504
3516
|
}
|
|
3505
3517
|
Vr(t, e) {
|
|
3506
3518
|
this.Xc[0].resize(t, e), this.Xc[1].resize(t, e);
|
|
@@ -3525,8 +3537,8 @@ class Vt {
|
|
|
3525
3537
|
a(this, "kl", 0);
|
|
3526
3538
|
a(this, "Dl", 0);
|
|
3527
3539
|
this.K = t, this.Ml = t.di(z, `#version 300 es
|
|
3528
|
-
precision highp float;const float A=0.001f;const int B=256;in vec2 v_uv;layout(location=0)out vec4 C;layout(location=1)out vec4 D;uniform vec2 u_resolution;uniform float Ur;uniform vec3 Us;uniform vec2
|
|
3529
|
-
precision highp float;const float A=0.001f;const float B=0.0001f;in vec2 v_uv;out vec4 fragColor;uniform sampler2D Uy;uniform sampler2D Uz;uniform sampler2D u_characterTexture;uniform vec2 u_charsetDimensions;uniform sampler2D
|
|
3540
|
+
precision highp float;const float A=0.001f;const int B=256;in vec2 v_uv;layout(location=0)out vec4 C;layout(location=1)out vec4 D;uniform vec2 u_resolution;uniform float Ur;uniform vec3 Us;uniform vec2 Up;uniform vec3 Uw;uniform mat3 Ux;uniform float Uv;uniform vec3 Ut;uniform int Uu;uniform sampler2D Ul;vec2 E(vec3 F){float G=Us.y*max(1.0f,Us.z);vec2 H;H.x=(Us.x-(F.x+0.5f+A*0.1f))/Us.x;H.y=((F.y+(Us.z-1.0f-F.z)*Us.y)+0.5f+A*0.1f)/G;return vec2(H.x,1.0f-H.y);}bool I(vec3 F){if(F.x<0.0f||F.x>=Us.x||F.y<0.0f||F.y>=Us.y||F.z<0.0f||F.z>=Us.z){return false;}if(Uu!=-1&&int(F.z+0.5f)!=Uu){return false;}vec2 H=E(F);vec4 J=texture(Ul,H);return!(J.r>=1.0f&&J.g>=1.0f);}float K(vec3 L,vec3 M){vec3 N=L-M;vec3 O=Ut*0.5f;vec3 P=abs(N)/O;if(P.x>P.y&&P.x>P.z){return N.x>0.0f?0.0f:1.0f;}else if(P.y>P.z){return N.y>0.0f?2.0f:3.0f;}else{return N.z>0.0f?4.0f:5.0f;}}vec2 Q(vec3 L,vec3 M,float R){vec3 S=L-M;vec2 T;vec2 U;int V=int(R+0.5f);if(V==2||V==3){U=vec2(Ut.x,Ut.z);T=(V==2)?vec2(S.x,S.z):vec2(S.x,-S.z);}else if(V==0||V==1){U=vec2(Ut.y,Ut.z);T=(V==0)?vec2(S.z,S.y):vec2(-S.z,S.y);}else{U=vec2(Ut.x,Ut.y);T=(V==4)?vec2(-S.x,S.y):vec2(S.x,S.y);}return 1.0f-(T/U+0.5f);}struct W{bool X;vec3 F;vec3 M;float Y;};W Z(vec3 a,vec3 b){W c;c.X=false;vec3 d=(Us*Ut)*0.5f;vec3 e=-d;vec3 f=d;vec3 g=1.0f/b;vec3 h=(e-a)*g;vec3 i=(f-a)*g;vec3 j=min(h,i);vec3 k=max(h,i);float l=max(max(j.x,j.y),j.z);float m=min(min(k.x,k.y),k.z);if(m<max(l,0.0f)){return c;}l=max(l,0.0f);vec3 n=a+l*b+b*A;vec3 o=d;float p=floor((n.x+o.x)/Ut.x+A*0.1f);float q=floor((n.y+o.y)/Ut.y+A*0.1f);float r=floor((n.z+o.z)/Ut.z+A*0.1f);vec3 s=abs(b);vec3 step=vec3(b.x>0.0f?1.0f:-1.0f,b.y>0.0f?1.0f:-1.0f,b.z>0.0f?1.0f:-1.0f);float t=(s.x<A)?1e10f:Ut.x/s.x;float u=(s.y<A)?1e10f:Ut.y/s.y;float v=(s.z<A)?1e10f:Ut.z/s.z;vec3 F=vec3(p,q,r);vec3 M=-d+(F+vec3(0.5f))*Ut;float w=(b.x>0.0f)?(M.x+Ut.x*0.5f):(M.x-Ut.x*0.5f);float x=(b.y>0.0f)?(M.y+Ut.y*0.5f):(M.y-Ut.y*0.5f);float y=(b.z>0.0f)?(M.z+Ut.z*0.5f):(M.z-Ut.z*0.5f);float z=(abs(b.x)<A)?1e10f:(w-n.x)/b.x;float AA=(abs(b.y)<A)?1e10f:(x-n.y)/b.y;float AB=(abs(b.z)<A)?1e10f:(y-n.z)/b.z;for(int AC=0;AC<B;AC++){if(I(F)){c.M=-d+(F+vec3(0.5f))*Ut;vec3 AD=c.M-Ut*0.5f;vec3 AE=c.M+Ut*0.5f;vec3 AF=(AD-a)*g;vec3 AG=(AE-a)*g;vec3 AH=min(AF,AG);c.Y=max(max(AH.x,AH.y),max(AH.z,0.0f));c.F=F;c.X=true;return c;}if(z<=AA&&z<=AB){p+=step.x;z+=t;F.x=p;}else if(AA<=AB){q+=step.y;AA+=u;F.y=q;}else{r+=step.z;AB+=v;F.z=r;}float AI=min(min(z,AA),AB);if(AI>m){break;}}return c;}void main(){vec3 d=(Us*Ut)*0.5f;float AJ=max(Uv,0.0001f);vec2 AK=vec2(Us.x,Us.y);vec2 AL=AK*0.5f;vec2 AM=gl_FragCoord.xy/max(Ur,0.0001f);vec2 AN=u_resolution;vec2 AO=Up;vec2 AP=(AN-AO)*0.5f;vec2 AQ=AM-AP;vec2 AR=AQ/AO;vec2 AS=1.0f-AR;if(any(lessThan(AS,vec2(0.0f)))||any(greaterThan(AS,vec2(1.0f)))){C=vec4(0.0f);D=vec4(0.0f);return;}vec2 AT=clamp(AS,0.0f,1.0f);vec2 AU=AL+((AT*AK)-AL)/AJ;vec2 AV=vec2(Ut.x,Ut.y);vec2 AW=(AU-AL);vec2 AX=AW*AV;float AY=length(Us*Ut);vec3 AZ=vec3(AX,-AY);const vec3 Aa=vec3(0.0f,0.0f,1.0f);mat3 Ab=Ux;vec3 Ac=Ab*(AZ-Uw);vec3 Ad=normalize(Ab*Aa);W c=Z(Ac,Ad);if(c.X){vec3 L=Ac+c.Y*Ad;float R=K(L,c.M);vec2 Ae=Q(L,c.M,R);vec3 Af=c.F/255.0f;C=vec4(Af,1.0f);D=vec4(Ae,R/5.0f,0.0f);}else{C=vec4(0.0f,0.0f,0.0f,0.0f);D=vec4(0.0f);}}`), this.Fl = t.di(z, `#version 300 es
|
|
3541
|
+
precision highp float;const float A=0.001f;const float B=0.0001f;in vec2 v_uv;out vec4 fragColor;uniform sampler2D Uy;uniform sampler2D Uz;uniform sampler2D u_characterTexture;uniform vec2 u_charsetDimensions;uniform sampler2D Um;uniform sampler2D Un;uniform sampler2D Ul;uniform vec4 Uq;uniform vec3 Us;uniform vec3 UA;uniform vec3 UB;uniform vec3 UC;uniform vec3 UD;uniform vec3 UE;uniform vec3 UF;mat2 C(float D){float E=sin(D);float F=cos(D);return mat2(F,-E,E,F);}vec2 G(vec3 H){float I=Us.y*max(1.0f,Us.z);vec2 J;J.x=(Us.x-(H.x+0.5f+A*0.1f))/Us.x;J.y=((H.y+(Us.z-1.0f-H.z)*Us.y)+0.5f+A*0.1f)/I;return vec2(J.x,1.0f-J.y);}vec4 K(vec4 L,vec4 M,vec4 N,vec2 O,int P){int Q=int(L.b*255.0f+0.5f);bool R=(Q&1)!=0;bool S=(Q&2)!=0;bool T=(Q&4)!=0;int U=max(1,int(u_charsetDimensions.x));int V=P/U;int W=P-(V*U);float X=(u_charsetDimensions.y-1.0f)-float(V);vec2 Y=1.0f/u_charsetDimensions;vec2 Z=vec2(float(W),X)*Y;vec2 a=Z+Y;float b=-L.a*360.0f*0.017453292f;vec2 c=O-0.5f;vec2 d=vec2(S?-1.0f:1.0f,T?-1.0f:1.0f);c*=d;c=C(b)*c+0.5f;vec2 e=Z+clamp(c,0.0f,1.0f)*Y;if(any(lessThan(e,Z-B))||any(greaterThan(e,a+B))){return R?M:N;}vec4 f=texture(u_characterTexture,e);if(R){f.rgb=1.0f-f.rgb;}vec4 g=mix(Uq,N,N.a);return mix(g,M,f);}vec4 h(vec2 i){vec4 j=texture(Uy,i);vec4 k=texture(Uz,i);float l=j.w;if(l<0.5f){return Uq;}vec3 H=floor(j.xyz*255.0f+0.5f);vec2 O=k.xy;vec2 J=G(H);vec4 L=texture(Ul,J);vec4 M=texture(Um,J);vec4 N=texture(Un,J);int P=int(L.r*255.0f+0.5f)+int(L.g*255.0f+0.5f)*256;return K(L,M,N,O,P);}void main(){vec2 i=gl_FragCoord.xy/vec2(textureSize(Uy,0));fragColor=h(i);}`);
|
|
3530
3542
|
}
|
|
3531
3543
|
Ar(t, e, i = 1) {
|
|
3532
3544
|
const s = e * Math.max(1, i);
|
|
@@ -3578,7 +3590,7 @@ precision highp float;const float A=0.001f;const float B=0.0001f;in vec2 v_uv;ou
|
|
|
3578
3590
|
const g = c.camera.getShaderUniforms();
|
|
3579
3591
|
u = g.rotation, f = g.translation, d = g.zoom;
|
|
3580
3592
|
const v = c.normals ?? {};
|
|
3581
|
-
this.zl.begin(), this.K.ye(0, 0, 0, 0), this.K.fi(this.Ml), this.Ml.H({ u_resolution: [n, h], Ur: 1,
|
|
3593
|
+
this.zl.begin(), this.K.ye(0, 0, 0, 0), this.K.fi(this.Ml), this.Ml.H({ u_resolution: [n, h], Ur: 1, Up: [s.width, s.height], Us: [s.cols, s.rows, e], Ut: l, Ul: this.$l.textures[0], Uu: c.isolatedLayer ?? -1, Uv: d, Uw: f, Ux: u }), this.K.Ai(0, 0, n, h), this.zl.end(), t.begin(), this.K.fi(this.Fl), this.Fl.H({ Uy: this.zl.textures[0], Uz: this.zl.textures[1], u_characterTexture: i.fontFramebuffer, u_charsetDimensions: [i.textureColumns, i.textureRows], Ul: this.$l.textures[0], Um: this.Pl.textures[0], Un: this.Tl.textures[0], Us: [s.cols, s.rows, e], Uq: r, UA: v.right ?? I.right, UB: v.left ?? I.left, UC: v.top ?? I.top, UD: v.bottom ?? I.bottom, UE: v.front ?? I.front, UF: v.back ?? I.back }), this.K.Ai(0, 0, n, h), t.end();
|
|
3582
3594
|
}
|
|
3583
3595
|
Bl(t, e) {
|
|
3584
3596
|
this.zl ? this.Rl === t && this.El === e || (this.zl.resize(t, e), this.Rl = t, this.El = e) : (this.zl = this.K.$i(t, e, 2, { depth: !1 }), this.Rl = t, this.El = e);
|
|
@@ -3926,7 +3938,7 @@ class qt {
|
|
|
3926
3938
|
const ri = Object.freeze(Object.defineProperty({ __proto__: null, FilterRegistry: Zt, TextmodeFilterManager: qt }, Symbol.toStringTag, { value: "Module" }));
|
|
3927
3939
|
class Jt {
|
|
3928
3940
|
constructor(t, e) {
|
|
3929
|
-
a(this, "
|
|
3941
|
+
a(this, "ma");
|
|
3930
3942
|
a(this, "K");
|
|
3931
3943
|
a(this, "ou");
|
|
3932
3944
|
a(this, "hu");
|
|
@@ -3939,22 +3951,22 @@ class Jt {
|
|
|
3939
3951
|
a(this, "Wl", !1);
|
|
3940
3952
|
a(this, "vu", "2d");
|
|
3941
3953
|
a(this, "pu", /* @__PURE__ */ new Set());
|
|
3942
|
-
a(this, "
|
|
3943
|
-
a(this, "
|
|
3954
|
+
a(this, "gu", []);
|
|
3955
|
+
a(this, "mu");
|
|
3944
3956
|
a(this, "_u");
|
|
3945
|
-
this.
|
|
3957
|
+
this.ma = t, this.K = t.K, this.cu = this.K.di(z, kt), this.lu = this.K.di(z, yt), this.au = new qt(this.K), this.ou = new Qt(this.K, this.ma.Er.width, this.ma.Er.height), this.hu = new Vt(this.K), this.uu = new ot(), this.fu = new $e({ onRemove: (i) => this.ma.Jc.La(i), onDispose: (i) => i.Fs() }), this.du = new st(this.K, { visible: !0, opacity: 1, fontSize: e.fontSize, fontSource: e.fontSource });
|
|
3946
3958
|
}
|
|
3947
3959
|
async Ar() {
|
|
3948
3960
|
var e, i;
|
|
3949
3961
|
await this.yu(this.du);
|
|
3950
|
-
const t = this.
|
|
3951
|
-
this.
|
|
3962
|
+
const t = this.ma.Er;
|
|
3963
|
+
this.mu = this.K.$i(t.width, t.height, 1), this._u = this.K.$i(t.width, t.height, 1), this.au.Ar(t.width, t.height), await this.fu.initialize((s) => this.yu(s)), this.hu.Ar(((e = this.du.grid) == null ? void 0 : e.cols) || 1, ((i = this.du.grid) == null ? void 0 : i.rows) || 1, 1 + this.fu.length), this.Wl = !0;
|
|
3952
3964
|
}
|
|
3953
3965
|
Au(t, e) {
|
|
3954
|
-
this.
|
|
3966
|
+
this.gu.push({ name: t, params: e });
|
|
3955
3967
|
}
|
|
3956
3968
|
bu() {
|
|
3957
|
-
this.
|
|
3969
|
+
this.gu = [];
|
|
3958
3970
|
}
|
|
3959
3971
|
add(t = {}) {
|
|
3960
3972
|
const e = new st(this.K, t);
|
|
@@ -3988,22 +4000,22 @@ class Jt {
|
|
|
3988
4000
|
this.fu.clear();
|
|
3989
4001
|
}
|
|
3990
4002
|
wu(t) {
|
|
3991
|
-
this.
|
|
4003
|
+
this.ma.Jc.Ea(), this.du.va(this.ma, this.cu, this.vu);
|
|
3992
4004
|
const e = [...this.K.state.canvasBackgroundColor];
|
|
3993
|
-
this.fu.forEach((i) => i.va(this.
|
|
4005
|
+
this.fu.forEach((i) => i.va(this.ma, this.cu, this.vu)), this.vu === "3d" ? this.xu(t, e) : this.Cu(t, e);
|
|
3994
4006
|
}
|
|
3995
4007
|
Mu() {
|
|
3996
|
-
this.wu(this.
|
|
3997
|
-
let t = this.
|
|
3998
|
-
if (this.
|
|
3999
|
-
const i = this.
|
|
4000
|
-
this.au.eu(this.
|
|
4008
|
+
this.wu(this.mu);
|
|
4009
|
+
let t = this.mu.textures[0];
|
|
4010
|
+
if (this.gu.length > 0) {
|
|
4011
|
+
const i = this.ma.Er;
|
|
4012
|
+
this.au.eu(this.mu.textures[0], this._u, this.gu, i.width, i.height), t = this._u.textures[0], this.gu = [];
|
|
4001
4013
|
}
|
|
4002
|
-
const e = this.
|
|
4003
|
-
this.K.ye(0, 0, 0, 0), this.K.fi(this.lu), this.lu.H({ u_texture: t }), this.K.Ai(0, 0, e.width, e.height), this.
|
|
4014
|
+
const e = this.ma.Er;
|
|
4015
|
+
this.K.ye(0, 0, 0, 0), this.K.fi(this.lu), this.lu.H({ u_texture: t }), this.K.Ai(0, 0, e.width, e.height), this.ma.Jc.Da();
|
|
4004
4016
|
}
|
|
4005
4017
|
Cu(t, e) {
|
|
4006
|
-
const i = this.
|
|
4018
|
+
const i = this.ma.Er, s = this.du.grid, r = this.du.texture;
|
|
4007
4019
|
if (!r) return;
|
|
4008
4020
|
const n = { layer: this.du, texture: r, width: s.width, height: s.height, offsetX: s.offsetX + this.du.Lc, offsetY: s.offsetY + this.du.Hc }, h = this.fu.map((c) => {
|
|
4009
4021
|
const l = c.grid;
|
|
@@ -4012,7 +4024,7 @@ class Jt {
|
|
|
4012
4024
|
this.ou.wl({ base: n, layers: h, targetFramebuffer: t, backgroundColor: e, canvasWidth: i.width, canvasHeight: i.height });
|
|
4013
4025
|
}
|
|
4014
4026
|
xu(t, e) {
|
|
4015
|
-
const i = this.
|
|
4027
|
+
const i = this.ma.Er, s = this.du.drawFramebuffer, r = this.du.grid;
|
|
4016
4028
|
if (!s || !r) return;
|
|
4017
4029
|
let n = r.cols * r.rows, h = r;
|
|
4018
4030
|
for (const c of this.fu) {
|
|
@@ -4027,7 +4039,7 @@ class Jt {
|
|
|
4027
4039
|
Vr() {
|
|
4028
4040
|
var n, h, c;
|
|
4029
4041
|
if (!this.Wl) return;
|
|
4030
|
-
const t = this.
|
|
4042
|
+
const t = this.ma.Er;
|
|
4031
4043
|
this.du.Vr(), this.fu.forEach((l) => l.Vr()), this.ou.Vr(t.width, t.height);
|
|
4032
4044
|
const e = this.du.grid;
|
|
4033
4045
|
let i = (e == null ? void 0 : e.cols) || 0, s = (e == null ? void 0 : e.rows) || 0;
|
|
@@ -4036,11 +4048,11 @@ class Jt {
|
|
|
4036
4048
|
u && (i = Math.max(i, u.cols), s = Math.max(s, u.rows));
|
|
4037
4049
|
}
|
|
4038
4050
|
const r = 1 + this.fu.length;
|
|
4039
|
-
this.hu.Vr(i, s, r), (n = this.
|
|
4051
|
+
this.hu.Vr(i, s, r), (n = this.mu) == null || n.resize(t.width, t.height), (h = this._u) == null || h.resize(t.width, t.height), (c = this.au) == null || c.Vr(t.width, t.height);
|
|
4040
4052
|
}
|
|
4041
4053
|
Fs() {
|
|
4042
4054
|
var t, e;
|
|
4043
|
-
this.fu.dispose(), this.
|
|
4055
|
+
this.fu.dispose(), this.ma.Jc.La(this.du), this.du.Fs(), this.au.Fs(), this.cu.dispose(), this.lu.dispose(), this.ou.Fs(), this.hu.Fs(), (t = this.mu) == null || t.dispose(), (e = this._u) == null || e.dispose(), this.gu = [];
|
|
4044
4056
|
}
|
|
4045
4057
|
get all() {
|
|
4046
4058
|
return this.fu.all;
|
|
@@ -4070,7 +4082,7 @@ class Jt {
|
|
|
4070
4082
|
}
|
|
4071
4083
|
async yu(t) {
|
|
4072
4084
|
var i;
|
|
4073
|
-
const e = { renderer: this.K, canvas: this.
|
|
4085
|
+
const e = { renderer: this.K, canvas: this.ma.Er, filterManager: this.au, createFramebuffer: (s, r, n = 1, h) => this.K.$i(s, r, n, h) };
|
|
4074
4086
|
await t.qc(e), (i = t.grid) == null || i.Br(() => this.Pu());
|
|
4075
4087
|
}
|
|
4076
4088
|
}
|
|
@@ -4137,7 +4149,7 @@ class ei extends function(e, ...i) {
|
|
|
4137
4149
|
a(this, "da");
|
|
4138
4150
|
a(this, "sh");
|
|
4139
4151
|
a(this, "pa");
|
|
4140
|
-
a(this, "
|
|
4152
|
+
a(this, "ga");
|
|
4141
4153
|
a(this, "Eu");
|
|
4142
4154
|
a(this, "fa");
|
|
4143
4155
|
a(this, "ua");
|
|
@@ -4160,7 +4172,7 @@ class ei extends function(e, ...i) {
|
|
|
4160
4172
|
this.da.Kn = 0, this.Hu = !0;
|
|
4161
4173
|
}), this.fa = new Jt(this, e);
|
|
4162
4174
|
const i = () => this.Qu();
|
|
4163
|
-
this.sh = new Bt(this.Er, i), this.pa = new Ot(this.Er, i, this.sh), this.
|
|
4175
|
+
this.sh = new Bt(this.Er, i), this.pa = new Ot(this.Er, i, this.sh), this.ga = new _t(), this.pn = new te(), this.Jc.Pa(e.plugins ?? []), this.Eu.In(), this.Yu();
|
|
4164
4176
|
}
|
|
4165
4177
|
async Yu() {
|
|
4166
4178
|
await this.fa.Ar(), await this.Eu.Ar();
|
|
@@ -4177,14 +4189,14 @@ class ei extends function(e, ...i) {
|
|
|
4177
4189
|
Xu() {
|
|
4178
4190
|
this.Iu = () => {
|
|
4179
4191
|
this.Nr && this.resizeCanvas(this.Er.targetCanvas.width, this.Er.targetCanvas.height), this.Bu();
|
|
4180
|
-
}, window.addEventListener("resize", this.Iu), this.sh.wo(), this.pa.wo(), this.
|
|
4181
|
-
this.
|
|
4192
|
+
}, window.addEventListener("resize", this.Iu), this.sh.wo(), this.pa.wo(), this.ga.wo(), window.addEventListener("blur", () => {
|
|
4193
|
+
this.ga.th();
|
|
4182
4194
|
}), this.Nr && (this.Gu = new ResizeObserver(() => {
|
|
4183
4195
|
this.resizeCanvas(this.Er.targetCanvas.width, this.Er.targetCanvas.height);
|
|
4184
4196
|
}), this.Gu.observe(this.Er.targetCanvas));
|
|
4185
4197
|
}
|
|
4186
4198
|
va() {
|
|
4187
|
-
if (!this.Eu.
|
|
4199
|
+
if (!this.Eu.mc && this.Hu) {
|
|
4188
4200
|
this.Du = !0;
|
|
4189
4201
|
try {
|
|
4190
4202
|
this.da.Yn(), this.da.Zn(), this.Nr && Ut(this.K.context, this.ju.texture, this.Er.targetCanvas), this.fa.Mu();
|
|
@@ -4202,7 +4214,7 @@ class ei extends function(e, ...i) {
|
|
|
4202
4214
|
}
|
|
4203
4215
|
Wu() {
|
|
4204
4216
|
var e, i, s, r;
|
|
4205
|
-
this.ku = !1, this.Eu.Fs(), this.Jc.Qa(), window.removeEventListener("resize", this.Iu), (e = this.Gu) == null || e.disconnect(), this.sh.To(), this.pa.To(), this.
|
|
4217
|
+
this.ku = !1, this.Eu.Fs(), this.Jc.Qa(), window.removeEventListener("resize", this.Iu), (e = this.Gu) == null || e.disconnect(), this.sh.To(), this.pa.To(), this.ga.To(), (i = this.fa) == null || i.Fs(), (s = this.pn) == null || s.Fs(), this.K.Fs(), (r = this.ju) == null || r.Fs(), this.Er.Fs(), this.Lu = !0;
|
|
4206
4218
|
}
|
|
4207
4219
|
filter(e, i) {
|
|
4208
4220
|
this.fa.Au(e, i);
|
|
@@ -4263,6 +4275,9 @@ class ei extends function(e, ...i) {
|
|
|
4263
4275
|
get conversions() {
|
|
4264
4276
|
return this.pn;
|
|
4265
4277
|
}
|
|
4278
|
+
get isRenderingFrame() {
|
|
4279
|
+
return this.Du;
|
|
4280
|
+
}
|
|
4266
4281
|
}
|
|
4267
4282
|
class Et {
|
|
4268
4283
|
constructor() {
|
|
@@ -4274,7 +4289,7 @@ class Et {
|
|
|
4274
4289
|
At._(t);
|
|
4275
4290
|
}
|
|
4276
4291
|
static get version() {
|
|
4277
|
-
return "0.9.0-beta.
|
|
4292
|
+
return "0.9.0-beta.2";
|
|
4278
4293
|
}
|
|
4279
4294
|
}
|
|
4280
4295
|
const hi = Object.freeze(Object.defineProperty({ __proto__: null, LoadingPhase: jt, LoadingPhaseTracker: Xt, LoadingScreenManager: Wt, LoadingScreenStateMachine: Kt, LoadingScreenTransition: Yt, resolveColorInputs: Ht, resolveDefaultPalette: Gt, resolveTheme: mt }, Symbol.toStringTag, { value: "Module" })), oi = Object.freeze(Object.defineProperty({ __proto__: null, TextmodeFont: it, TextmodeImage: Z, TextmodeVideo: ht }, Symbol.toStringTag, { value: "Module" })), ai = Object.freeze(Object.defineProperty({ __proto__: null, keyboard: Ge, mouse: Ye, touch: He }, Symbol.toStringTag, { value: "Module" })), ci = Object.freeze(Object.defineProperty({ __proto__: null, Camera3D: ot, Layer3DCompositor: Vt, LayerCompositor: Qt, TextmodeLayer: st, TextmodeLayerManager: Jt }, Symbol.toStringTag, { value: "Module" })), li = Et.create, ui = Et.setErrorLevel, fi = Et.version;
|