rapid-render 1.0.9 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -3
- package/dist/draw.d.ts +4 -0
- package/dist/matrix-engine.d.ts +2 -2
- package/dist/particle.d.ts +1 -1
- package/dist/rapid-render.js +329 -322
- package/dist/rapid-render.umd.cjs +11 -11
- package/dist/region/particleRegion.d.ts +1 -1
- package/dist/render.d.ts +1 -1
- package/dist/webgl/glshader.d.ts +1 -0
- package/package.json +1 -1
package/dist/rapid-render.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var
|
|
2
|
-
class
|
|
1
|
+
var b = /* @__PURE__ */ ((n) => (n[n.Float32 = 0] = "Float32", n[n.Uint32 = 1] = "Uint32", n[n.Uint16 = 2] = "Uint16", n))(b || {});
|
|
2
|
+
class _ {
|
|
3
3
|
/** The number of elements currently used in the buffer. */
|
|
4
4
|
usedElemNum;
|
|
5
5
|
/** The main typed array view corresponding to the specified ArrayType. */
|
|
@@ -172,7 +172,7 @@ class P {
|
|
|
172
172
|
this.usedElemNum = 0;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
class
|
|
175
|
+
class it extends _ {
|
|
176
176
|
/** The actual WebGLBuffer object maintained by this instance. */
|
|
177
177
|
buffer;
|
|
178
178
|
/** The related WebGL rendering context. */
|
|
@@ -480,7 +480,7 @@ class x {
|
|
|
480
480
|
static TRANSPARENT = new x(0, 0, 0, 0);
|
|
481
481
|
}
|
|
482
482
|
const E = 6;
|
|
483
|
-
class
|
|
483
|
+
class Ut {
|
|
484
484
|
/** Total number of matrices currently allocated in the store. */
|
|
485
485
|
matrixCount = 0;
|
|
486
486
|
/** The dynamic buffer used to hold matrix data. */
|
|
@@ -493,7 +493,7 @@ class Mt {
|
|
|
493
493
|
* @param capacity - The initial capacity of the matrix store (default is 10).
|
|
494
494
|
*/
|
|
495
495
|
constructor(t = 10) {
|
|
496
|
-
this.buffer = new
|
|
496
|
+
this.buffer = new _(b.Float32), this.buffer.resize(t * E), this.data = this.buffer.getArray(), this.reset();
|
|
497
497
|
}
|
|
498
498
|
/**
|
|
499
499
|
* Allocates a new matrix and initializes it to the identity matrix.
|
|
@@ -596,8 +596,8 @@ class Mt {
|
|
|
596
596
|
* @param bIdx - The index of matrix B.
|
|
597
597
|
*/
|
|
598
598
|
multiplyOut(t, e, r) {
|
|
599
|
-
const i = t * E, s = e * E, a = r * E, o = this.data, h = o[s], c = o[s + 1], u = o[s + 2], l = o[s + 3], d = o[s + 4], f = o[s + 5], m = o[a],
|
|
600
|
-
o[i] = h * m + u *
|
|
599
|
+
const i = t * E, s = e * E, a = r * E, o = this.data, h = o[s], c = o[s + 1], u = o[s + 2], l = o[s + 3], d = o[s + 4], f = o[s + 5], m = o[a], v = o[a + 1], y = o[a + 2], T = o[a + 3], M = o[a + 4], A = o[a + 5];
|
|
600
|
+
o[i] = h * m + u * v, o[i + 1] = c * m + l * v, o[i + 2] = h * y + u * T, o[i + 3] = c * y + l * T, o[i + 4] = h * M + u * A + d, o[i + 5] = c * M + l * A + f;
|
|
601
601
|
}
|
|
602
602
|
/**
|
|
603
603
|
* Inverts the matrix at the given index. If the matrix is not invertible, it defaults to the identity matrix.
|
|
@@ -721,29 +721,29 @@ class Mt {
|
|
|
721
721
|
i[r] = e[0], i[r + 1] = e[1], i[r + 2] = e[2], i[r + 3] = e[3], i[r + 4] = e[4], i[r + 5] = e[5];
|
|
722
722
|
}
|
|
723
723
|
multiplyAffineInPlace(t, e, r, i, s, a, o) {
|
|
724
|
-
const h = t * 6, c = this.data, u = c[h], l = c[h + 1], d = c[h + 2], f = c[h + 3], m = c[h + 4],
|
|
725
|
-
c[h] = u * e + d * r, c[h + 1] = l * e + f * r, c[h + 2] = u * i + d * s, c[h + 3] = l * i + f * s, c[h + 4] = u * a + d * o + m, c[h + 5] = l * a + f * o +
|
|
724
|
+
const h = t * 6, c = this.data, u = c[h], l = c[h + 1], d = c[h + 2], f = c[h + 3], m = c[h + 4], v = c[h + 5];
|
|
725
|
+
c[h] = u * e + d * r, c[h + 1] = l * e + f * r, c[h + 2] = u * i + d * s, c[h + 3] = l * i + f * s, c[h + 4] = u * a + d * o + m, c[h + 5] = l * a + f * o + v;
|
|
726
726
|
}
|
|
727
727
|
multiplyAffine(t, e, r, i, s, a, o, h) {
|
|
728
|
-
const c = t * 6, u = e * 6, l = this.data, d = l[c], f = l[c + 1], m = l[c + 2],
|
|
729
|
-
l[u] = d * r + m * i, l[u + 1] = f * r +
|
|
728
|
+
const c = t * 6, u = e * 6, l = this.data, d = l[c], f = l[c + 1], m = l[c + 2], v = l[c + 3], y = l[c + 4], T = l[c + 5];
|
|
729
|
+
l[u] = d * r + m * i, l[u + 1] = f * r + v * i, l[u + 2] = d * s + m * a, l[u + 3] = f * s + v * a, l[u + 4] = d * o + m * h + y, l[u + 5] = f * o + v * h + T;
|
|
730
730
|
}
|
|
731
731
|
}
|
|
732
|
-
class
|
|
732
|
+
class Ct {
|
|
733
733
|
/** The underlying store for matrices. */
|
|
734
|
-
matrix = new
|
|
734
|
+
matrix = new Ut();
|
|
735
735
|
/** The current step or depth in the transformation hierarchy. */
|
|
736
736
|
step = 0;
|
|
737
737
|
/** Internal stack maintaining structural information. */
|
|
738
|
-
stack = new
|
|
738
|
+
stack = new _(b.Uint32);
|
|
739
739
|
/** Records the world matrices generated at each step. */
|
|
740
|
-
stepWorldM = new
|
|
740
|
+
stepWorldM = new _(b.Uint32);
|
|
741
741
|
/** Records actions (push/pop) taken during the traversal. */
|
|
742
|
-
stepAction = new
|
|
743
|
-
/** Records the parent world matrix for each step (used by
|
|
744
|
-
stepParentM = new
|
|
742
|
+
stepAction = new _(b.Uint32);
|
|
743
|
+
/** Records the parent world matrix for each step (used by updateMatrixSubtree). */
|
|
744
|
+
stepParentM = new _(b.Uint32);
|
|
745
745
|
/** Buffer used during hierarchy traversal updates. */
|
|
746
|
-
parentStack = new
|
|
746
|
+
parentStack = new _(b.Uint32);
|
|
747
747
|
/** The index of the current local matrix in the matrix store. */
|
|
748
748
|
curLocalM = -1;
|
|
749
749
|
/** The index of the current world matrix in the matrix store. */
|
|
@@ -763,30 +763,29 @@ class At {
|
|
|
763
763
|
save() {
|
|
764
764
|
this.stack.push(this.curWorldM);
|
|
765
765
|
const t = this.curWorldM;
|
|
766
|
-
return this.
|
|
766
|
+
return this.curLocalM = this.matrix.alloc(), this.curWorldM = this.matrix.allocDirty(), this.stepWorldM.push(this.curWorldM), this.stepParentM.push(t), this.stepAction.push(1), this.matrix.copy(this.curWorldM, t), { world: this.curWorldM, local: this.curLocalM, step: this.step++ };
|
|
767
767
|
}
|
|
768
768
|
/**
|
|
769
769
|
* Restores the matrix state from the top of the stack.
|
|
770
770
|
* Equivalent to context.restore().
|
|
771
771
|
*/
|
|
772
772
|
restore() {
|
|
773
|
-
this.stack.length != 0 && (this.curWorldM = this.stack.pop(), this.curLocalM = this.curWorldM - 1, this.stepAction.push(0));
|
|
773
|
+
this.stack.length != 0 && (this.curWorldM = this.stack.pop(), this.curLocalM = this.curWorldM - 1, this.stepParentM.push(this.stack.get(this.stack.length - 1)), this.stepWorldM.push(this.curWorldM), this.stepAction.push(0), this.step++);
|
|
774
774
|
}
|
|
775
775
|
/**
|
|
776
776
|
* Evaluates and updates matrices from the given step. Used primarily for deferred transformation.
|
|
777
777
|
* @param step - The initial step to update matrices from.
|
|
778
778
|
*/
|
|
779
|
-
|
|
780
|
-
const e =
|
|
781
|
-
let
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
} else if (a.pop(), i--, i === 0)
|
|
779
|
+
updateMatrixSubtree(t) {
|
|
780
|
+
const e = typeof t == "number" ? t : t.step;
|
|
781
|
+
let r = 0, i = e;
|
|
782
|
+
for (; i < this.step; ) {
|
|
783
|
+
if (this.stepAction.get(i) === 1) {
|
|
784
|
+
const a = this.stepWorldM.get(i), o = a - 1, h = this.stepParentM.get(i);
|
|
785
|
+
this.matrix.multiplyOut(a, h, o), r++;
|
|
786
|
+
} else if (r--, r === 0)
|
|
788
787
|
break;
|
|
789
|
-
|
|
788
|
+
i++;
|
|
790
789
|
}
|
|
791
790
|
}
|
|
792
791
|
/**
|
|
@@ -920,41 +919,41 @@ class At {
|
|
|
920
919
|
t.offset && (l += t.offset.x, d += t.offset.y);
|
|
921
920
|
const f = t.origin;
|
|
922
921
|
f !== void 0 && (typeof f == "number" ? (l -= f * e, d -= f * r) : (l -= f.x * e, d -= f.y * r));
|
|
923
|
-
const m = u ? Math.cos(u) : 1,
|
|
922
|
+
const m = u ? Math.cos(u) : 1, v = u ? Math.sin(u) : 0, y = m * o, T = v * o, M = -v * h, A = m * h, P = s + y * l + M * d, C = a + T * l + A * d;
|
|
924
923
|
if (i !== -1) {
|
|
925
924
|
this.matrix.multiplyAffine(
|
|
926
925
|
this.curWorldM,
|
|
927
926
|
i,
|
|
928
|
-
v,
|
|
929
927
|
y,
|
|
930
|
-
|
|
928
|
+
T,
|
|
929
|
+
M,
|
|
931
930
|
A,
|
|
932
|
-
|
|
933
|
-
|
|
931
|
+
P,
|
|
932
|
+
C
|
|
934
933
|
);
|
|
935
934
|
return;
|
|
936
935
|
}
|
|
937
936
|
this.matrix.multiplyAffineInPlace(
|
|
938
937
|
this.curLocalM,
|
|
939
|
-
v,
|
|
940
938
|
y,
|
|
941
|
-
|
|
939
|
+
T,
|
|
940
|
+
M,
|
|
942
941
|
A,
|
|
943
|
-
|
|
944
|
-
|
|
942
|
+
P,
|
|
943
|
+
C
|
|
945
944
|
), this.matrix.multiplyAffineInPlace(
|
|
946
945
|
this.curWorldM,
|
|
947
|
-
v,
|
|
948
946
|
y,
|
|
949
|
-
|
|
947
|
+
T,
|
|
948
|
+
M,
|
|
950
949
|
A,
|
|
951
|
-
|
|
952
|
-
|
|
950
|
+
P,
|
|
951
|
+
C
|
|
953
952
|
);
|
|
954
953
|
}
|
|
955
954
|
}
|
|
956
|
-
var
|
|
957
|
-
class
|
|
955
|
+
var Q = /* @__PURE__ */ ((n) => (n[n.REPEAT = 0] = "REPEAT", n[n.CLAMP = 1] = "CLAMP", n[n.MIRRORED_REPEAT = 2] = "MIRRORED_REPEAT", n))(Q || {});
|
|
956
|
+
class _t {
|
|
958
957
|
render;
|
|
959
958
|
cache = /* @__PURE__ */ new Map();
|
|
960
959
|
constructor(t) {
|
|
@@ -969,10 +968,10 @@ class St {
|
|
|
969
968
|
async load(t, e) {
|
|
970
969
|
let r = this.cache.get(t);
|
|
971
970
|
if (r)
|
|
972
|
-
return new
|
|
971
|
+
return new O(r);
|
|
973
972
|
try {
|
|
974
973
|
const i = await this._fetchImage(t);
|
|
975
|
-
return r = z.fromSource(this.render, i, e), r.uid = t, this.cache.set(t, r), new
|
|
974
|
+
return r = z.fromSource(this.render, i, e), r.uid = t, this.cache.set(t, r), new O(r);
|
|
976
975
|
} catch (i) {
|
|
977
976
|
throw console.error(`[TextureManager] Failed to load: ${t}`, i), i;
|
|
978
977
|
}
|
|
@@ -985,9 +984,9 @@ class St {
|
|
|
985
984
|
*/
|
|
986
985
|
create(t, e) {
|
|
987
986
|
if (e?.key && this.cache.has(e.key))
|
|
988
|
-
return new
|
|
987
|
+
return new O(this.cache.get(e.key));
|
|
989
988
|
const r = z.fromSource(this.render, t, e);
|
|
990
|
-
return e?.key && (r.uid = e.key, this.cache.set(e.key, r)), new
|
|
989
|
+
return e?.key && (r.uid = e.key, this.cache.set(e.key, r)), new O(r);
|
|
991
990
|
}
|
|
992
991
|
/**
|
|
993
992
|
* Creates a generic Render Texture (FrameBuffer).
|
|
@@ -997,7 +996,7 @@ class St {
|
|
|
997
996
|
* @returns The newly created RenderTexture.
|
|
998
997
|
*/
|
|
999
998
|
createRenderTexture(t) {
|
|
1000
|
-
return new
|
|
999
|
+
return new Pt(this.render, t);
|
|
1001
1000
|
}
|
|
1002
1001
|
/**
|
|
1003
1002
|
* Creates a TextTexture for rendering text.
|
|
@@ -1005,7 +1004,7 @@ class St {
|
|
|
1005
1004
|
* @returns The newly created TextTexture.
|
|
1006
1005
|
*/
|
|
1007
1006
|
createTextTexture(t) {
|
|
1008
|
-
return new
|
|
1007
|
+
return new Lt(this.render, t);
|
|
1009
1008
|
}
|
|
1010
1009
|
/**
|
|
1011
1010
|
* Destroys a texture and potentially removes its BaseTexture from the cache.
|
|
@@ -1016,7 +1015,7 @@ class St {
|
|
|
1016
1015
|
*/
|
|
1017
1016
|
destroy(t, e = !1) {
|
|
1018
1017
|
let r, i;
|
|
1019
|
-
typeof t == "string" ? (i = t, r = this.cache.get(i)) : t instanceof
|
|
1018
|
+
typeof t == "string" ? (i = t, r = this.cache.get(i)) : t instanceof O ? (r = t.base, i = r?.uid, t.destroy()) : (r = t, i = r.uid), r && (r.refCount <= 0 || e) && (r.destroy(this.render.gl), i && this.cache.delete(i));
|
|
1020
1019
|
}
|
|
1021
1020
|
/**
|
|
1022
1021
|
* Destroys all cached textures and clears the cache, ignoring reference counts.
|
|
@@ -1050,7 +1049,7 @@ class z {
|
|
|
1050
1049
|
* @returns The created BaseTexture.
|
|
1051
1050
|
*/
|
|
1052
1051
|
static fromSource(t, e, r = {}) {
|
|
1053
|
-
const i =
|
|
1052
|
+
const i = et(t, e, r);
|
|
1054
1053
|
return new z(i, e.width, e.height);
|
|
1055
1054
|
}
|
|
1056
1055
|
/**
|
|
@@ -1060,19 +1059,19 @@ class z {
|
|
|
1060
1059
|
* @param source - The new image source.
|
|
1061
1060
|
*/
|
|
1062
1061
|
updateSource(t, e, r = {}) {
|
|
1063
|
-
this.glTexture && (t.bindTexture(t.TEXTURE_2D, this.glTexture), r.textureFilter !== void 0 &&
|
|
1062
|
+
this.glTexture && (t.bindTexture(t.TEXTURE_2D, this.glTexture), r.textureFilter !== void 0 && nt(t, r.textureFilter), r.wrap !== void 0 && st(t, r.wrap), t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL, 1), t.pixelStorei(t.UNPACK_ALIGNMENT, 1), r.premultipliedAlpha !== void 0 && t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL, r.premultipliedAlpha), this.width === e.width && this.height === e.height ? t.texSubImage2D(t.TEXTURE_2D, 0, 0, 0, t.RGBA, t.UNSIGNED_BYTE, e) : (t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, t.RGBA, t.UNSIGNED_BYTE, e), this.width = e.width, this.height = e.height), r.premultipliedAlpha !== void 0 && t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1));
|
|
1064
1063
|
}
|
|
1065
1064
|
/**
|
|
1066
1065
|
* Dynamically updates the texture filtering mode.
|
|
1067
1066
|
*/
|
|
1068
1067
|
setFilterMode(t, e) {
|
|
1069
|
-
this.glTexture && (t.bindTexture(t.TEXTURE_2D, this.glTexture),
|
|
1068
|
+
this.glTexture && (t.bindTexture(t.TEXTURE_2D, this.glTexture), nt(t, e), t.bindTexture(t.TEXTURE_2D, null));
|
|
1070
1069
|
}
|
|
1071
1070
|
/**
|
|
1072
1071
|
* Dynamically updates the texture wrap mode.
|
|
1073
1072
|
*/
|
|
1074
1073
|
setWrapMode(t, e) {
|
|
1075
|
-
this.glTexture && (t.bindTexture(t.TEXTURE_2D, this.glTexture),
|
|
1074
|
+
this.glTexture && (t.bindTexture(t.TEXTURE_2D, this.glTexture), st(t, e), t.bindTexture(t.TEXTURE_2D, null));
|
|
1076
1075
|
}
|
|
1077
1076
|
/**
|
|
1078
1077
|
* Destroys the WebGL texture resource.
|
|
@@ -1082,7 +1081,7 @@ class z {
|
|
|
1082
1081
|
this.glTexture && (t.deleteTexture(this.glTexture), this.glTexture = null);
|
|
1083
1082
|
}
|
|
1084
1083
|
}
|
|
1085
|
-
class
|
|
1084
|
+
class O {
|
|
1086
1085
|
base;
|
|
1087
1086
|
uvX = 0;
|
|
1088
1087
|
uvY = 0;
|
|
@@ -1139,7 +1138,7 @@ class B {
|
|
|
1139
1138
|
* @returns A new Texture pointing to the sub-region.
|
|
1140
1139
|
*/
|
|
1141
1140
|
getSubTexture(t, e, r, i) {
|
|
1142
|
-
if (!this.base) return new
|
|
1141
|
+
if (!this.base) return new O();
|
|
1143
1142
|
const s = this.clone(), a = this._px, o = this._py;
|
|
1144
1143
|
return s.setRegion(a + t, o + e, r, i), s;
|
|
1145
1144
|
}
|
|
@@ -1148,7 +1147,7 @@ class B {
|
|
|
1148
1147
|
* @returns A new Texture instance.
|
|
1149
1148
|
*/
|
|
1150
1149
|
clone(t) {
|
|
1151
|
-
const e = t ?? new
|
|
1150
|
+
const e = t ?? new O(this.base);
|
|
1152
1151
|
return t && this.base && t.setBase(this.base), e.scale = this.scale, e.uvX = this.uvX, e.uvY = this.uvY, e.uvW = this.uvW, e.uvH = this.uvH, e.rawWidth = this.rawWidth, e.rawHeight = this.rawHeight, e.offsetX = this.offsetX, e.offsetY = this.offsetY, e.flipY = this.flipY, e.isRotated = this.isRotated, e.isAtlas = this.isAtlas, e._px = this._px, e._py = this._py, e._pw = this._pw, e._ph = this._ph, e;
|
|
1153
1152
|
}
|
|
1154
1153
|
/**
|
|
@@ -1165,8 +1164,8 @@ class B {
|
|
|
1165
1164
|
if (!this.base) return [];
|
|
1166
1165
|
const a = [], o = this.rawWidth, h = this.rawHeight, c = Math.max(0, s), u = t + c, l = e + c, d = r ?? Math.floor((o + c) / u), f = i ?? Math.floor((h + c) / l);
|
|
1167
1166
|
for (let m = 0; m < f; m++)
|
|
1168
|
-
for (let
|
|
1169
|
-
a.push(this.getSubTexture(
|
|
1167
|
+
for (let v = 0; v < d; v++)
|
|
1168
|
+
a.push(this.getSubTexture(v * u, m * l, t, e));
|
|
1170
1169
|
return a;
|
|
1171
1170
|
}
|
|
1172
1171
|
/**
|
|
@@ -1175,8 +1174,8 @@ class B {
|
|
|
1175
1174
|
* @param options - Optional antialias and wrap mode settings.
|
|
1176
1175
|
*/
|
|
1177
1176
|
static fromImageSource(t, e, r = {}) {
|
|
1178
|
-
const i =
|
|
1179
|
-
return new
|
|
1177
|
+
const i = et(t, e, r);
|
|
1178
|
+
return new O(new z(i, e.width, e.height));
|
|
1180
1179
|
}
|
|
1181
1180
|
/**
|
|
1182
1181
|
* Marks this Texture as destroyed, decrementing the BaseTexture reference count.
|
|
@@ -1185,7 +1184,7 @@ class B {
|
|
|
1185
1184
|
this.base && (this.base.refCount--, this.base = void 0), this.glTexture = null;
|
|
1186
1185
|
}
|
|
1187
1186
|
}
|
|
1188
|
-
class
|
|
1187
|
+
class Pt extends O {
|
|
1189
1188
|
framebuffer;
|
|
1190
1189
|
renderbuffer;
|
|
1191
1190
|
gl;
|
|
@@ -1196,7 +1195,7 @@ class bt extends B {
|
|
|
1196
1195
|
_allocH = 0;
|
|
1197
1196
|
constructor(t, e) {
|
|
1198
1197
|
super(), this.gl = t.gl, this.clearColor = e.clearColor ?? x.Black;
|
|
1199
|
-
const r = Math.max(Math.round(e.width), 1), i = Math.max(Math.round(e.height), 1), a =
|
|
1198
|
+
const r = Math.max(Math.round(e.width), 1), i = Math.max(Math.round(e.height), 1), a = et(t, { width: r, height: i }, { ...e, onlySize: !0 });
|
|
1200
1199
|
if (this.setBase(new z(a, r, i)), this.framebuffer = this.gl.createFramebuffer(), this.renderbuffer = this.gl.createRenderbuffer(), !this.framebuffer || !this.renderbuffer)
|
|
1201
1200
|
throw new Error("Failed to create Framebuffer or Renderbuffer");
|
|
1202
1201
|
this.resize(r, i, !0);
|
|
@@ -1275,16 +1274,16 @@ class bt extends B {
|
|
|
1275
1274
|
super.destroy(), this.framebuffer && this.gl.deleteFramebuffer(this.framebuffer), this.renderbuffer && this.gl.deleteRenderbuffer(this.renderbuffer), this.base?.destroy(this.gl);
|
|
1276
1275
|
}
|
|
1277
1276
|
}
|
|
1278
|
-
const
|
|
1277
|
+
const Nt = {
|
|
1279
1278
|
fontFamily: "Arial",
|
|
1280
1279
|
fontSize: 24,
|
|
1281
1280
|
fontWeight: "normal",
|
|
1282
1281
|
fill: "#000000",
|
|
1283
|
-
strokeThickness:
|
|
1282
|
+
strokeThickness: 0,
|
|
1284
1283
|
align: "left",
|
|
1285
1284
|
lineHeight: 1
|
|
1286
1285
|
};
|
|
1287
|
-
class
|
|
1286
|
+
class Lt extends O {
|
|
1288
1287
|
canvas;
|
|
1289
1288
|
ctx;
|
|
1290
1289
|
render;
|
|
@@ -1293,11 +1292,11 @@ class Ct extends B {
|
|
|
1293
1292
|
options;
|
|
1294
1293
|
flipY = !0;
|
|
1295
1294
|
constructor(t, e) {
|
|
1296
|
-
super(), this.render = t, this._style = { ...
|
|
1295
|
+
super(), this.render = t, this._style = { ...Nt, ...e }, this._text = e?.text ?? "", this.options = { premultipliedAlpha: t.premultipliedAlpha, ...e }, this.scale = 1 / t.dpr, this.canvas = document.createElement("canvas");
|
|
1297
1296
|
const r = this.canvas.getContext("2d", { willReadFrequently: !0 });
|
|
1298
1297
|
if (!r) throw new Error("Failed to get 2d context for TextTexture");
|
|
1299
1298
|
this.ctx = r, this.canvas.width = 1, this.canvas.height = 1;
|
|
1300
|
-
const i =
|
|
1299
|
+
const i = et(t, this.canvas, this.options);
|
|
1301
1300
|
this.setBase(new z(i, 1, 1)), this.update();
|
|
1302
1301
|
}
|
|
1303
1302
|
get text() {
|
|
@@ -1337,29 +1336,28 @@ class Ct extends B {
|
|
|
1337
1336
|
const c = this._text.split(`
|
|
1338
1337
|
`);
|
|
1339
1338
|
let u = 0, l = 0;
|
|
1340
|
-
const d = t.measureText(c[0]), f = d.fontBoundingBoxAscent + d.fontBoundingBoxDescent;
|
|
1341
|
-
for (const
|
|
1342
|
-
const
|
|
1343
|
-
|
|
1339
|
+
const d = t.measureText(c[0] || "M"), f = (d.fontBoundingBoxAscent || r) + (d.fontBoundingBoxDescent || r * 0.2);
|
|
1340
|
+
for (const W of c) {
|
|
1341
|
+
const N = t.measureText(W);
|
|
1342
|
+
N.width > u && (u = N.width), l += f * a;
|
|
1344
1343
|
}
|
|
1345
1344
|
l -= f * (a - 1);
|
|
1346
|
-
const m = this._style.strokeThickness || 0,
|
|
1347
|
-
(this.canvas.width !==
|
|
1348
|
-
const A = this.updateOffset(
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
this.base?.updateSource(this.render.gl, this.canvas, this.options), this.setRegion(0, 0, y, R);
|
|
1345
|
+
const m = this._style.strokeThickness || 0, v = Math.ceil(u + m * 2) || 1, y = Math.ceil(l + m * 2) || 1, T = Math.ceil(v * h), M = Math.ceil(y * h);
|
|
1346
|
+
(this.canvas.width !== T || this.canvas.height !== M) && (this.canvas.width = T, this.canvas.height = M), t.setTransform(h, 0, 0, h, 0, 0), t.clearRect(0, 0, v, y), t.font = o, t.textBaseline = "top", t.textAlign = this._style.align;
|
|
1347
|
+
const A = this.updateOffset(v, m), P = e.strokeThickness, C = P > 0;
|
|
1348
|
+
C && (t.lineWidth = P, t.strokeStyle = e.stroke, t.lineJoin = "round"), e.fill && (t.fillStyle = e.fill);
|
|
1349
|
+
let F = m;
|
|
1350
|
+
for (const W of c)
|
|
1351
|
+
C && t.strokeText(W, A, F), e.fill && t.fillText(W, A, F), F += f * a;
|
|
1352
|
+
this.base?.updateSource(this.render.gl, this.canvas, this.options), this.setRegion(0, 0, T, M);
|
|
1355
1353
|
}
|
|
1356
1354
|
}
|
|
1357
|
-
const
|
|
1355
|
+
const It = (n, t = !1, e = !0) => {
|
|
1358
1356
|
const r = n.getContext("webgl2", { stencil: !0, antialias: t, premultipliedAlpha: e });
|
|
1359
1357
|
if (!r)
|
|
1360
1358
|
throw new Error("WebGL2 is not supported in this browser.");
|
|
1361
1359
|
return r;
|
|
1362
|
-
},
|
|
1360
|
+
}, dt = (n, t, e) => {
|
|
1363
1361
|
const r = n.createShader(e);
|
|
1364
1362
|
if (!r)
|
|
1365
1363
|
throw new Error("Unable to create webgl shader");
|
|
@@ -1368,8 +1366,8 @@ const _t = (n, t = !1, e = !0) => {
|
|
|
1368
1366
|
throw console.error("Shader compilation failed:", s), new Error("Unable to compile shader: " + s + t);
|
|
1369
1367
|
}
|
|
1370
1368
|
return r;
|
|
1371
|
-
},
|
|
1372
|
-
var r = n.createProgram(), i =
|
|
1369
|
+
}, Ot = (n, t, e) => {
|
|
1370
|
+
var r = n.createProgram(), i = dt(n, t, 35633), s = dt(n, e, 35632);
|
|
1373
1371
|
if (!r)
|
|
1374
1372
|
throw new Error("Unable to create program shader");
|
|
1375
1373
|
if (n.attachShader(r, i), n.attachShader(r, s), n.linkProgram(r), !n.getProgramParameter(r, n.LINK_STATUS)) {
|
|
@@ -1378,26 +1376,26 @@ const _t = (n, t = !1, e = !0) => {
|
|
|
1378
1376
|
}
|
|
1379
1377
|
return r;
|
|
1380
1378
|
};
|
|
1381
|
-
function
|
|
1379
|
+
function st(n, t) {
|
|
1382
1380
|
const e = {
|
|
1383
|
-
[
|
|
1384
|
-
[
|
|
1385
|
-
[
|
|
1381
|
+
[Q.CLAMP]: n.CLAMP_TO_EDGE,
|
|
1382
|
+
[Q.REPEAT]: n.REPEAT,
|
|
1383
|
+
[Q.MIRRORED_REPEAT]: n.MIRRORED_REPEAT
|
|
1386
1384
|
}[t] || n.CLAMP_TO_EDGE;
|
|
1387
1385
|
n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_S, e), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_T, e);
|
|
1388
1386
|
}
|
|
1389
|
-
function
|
|
1387
|
+
function nt(n, t) {
|
|
1390
1388
|
const e = {
|
|
1391
|
-
[
|
|
1392
|
-
[
|
|
1389
|
+
[ht.LINEAR]: n.LINEAR,
|
|
1390
|
+
[ht.NEAREST]: n.NEAREST
|
|
1393
1391
|
}[t] ?? n.NEAREST;
|
|
1394
1392
|
n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MIN_FILTER, e), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MAG_FILTER, e);
|
|
1395
1393
|
}
|
|
1396
|
-
function
|
|
1394
|
+
function et(n, t, e) {
|
|
1397
1395
|
const r = n.gl, i = r.createTexture();
|
|
1398
1396
|
if (!i)
|
|
1399
1397
|
throw new Error("Unable to create WebGL texture");
|
|
1400
|
-
if (r.bindTexture(r.TEXTURE_2D, i), r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, 0), r.pixelStorei(r.UNPACK_ALIGNMENT, 1),
|
|
1398
|
+
if (r.bindTexture(r.TEXTURE_2D, i), r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, 0), r.pixelStorei(r.UNPACK_ALIGNMENT, 1), st(r, e.wrap ?? Q.CLAMP), nt(r, e.textureFilter ?? n.textureFilter), e.onlySize) {
|
|
1401
1399
|
const s = t;
|
|
1402
1400
|
r.texImage2D(r.TEXTURE_2D, 0, r.RGBA, s.width, s.height, 0, r.RGBA, r.UNSIGNED_BYTE, null);
|
|
1403
1401
|
} else {
|
|
@@ -1406,7 +1404,7 @@ function J(n, t, e) {
|
|
|
1406
1404
|
}
|
|
1407
1405
|
return r.bindTexture(r.TEXTURE_2D, null), i;
|
|
1408
1406
|
}
|
|
1409
|
-
function
|
|
1407
|
+
function V(n, t) {
|
|
1410
1408
|
if (n.includes("%TEXTURE_NUM%") && (n = n.replace("%TEXTURE_NUM%", t.toString())), n.includes("%GET_COLOR%")) {
|
|
1411
1409
|
let e = "";
|
|
1412
1410
|
for (let r = 0; r < t; r++)
|
|
@@ -1415,15 +1413,15 @@ function H(n, t) {
|
|
|
1415
1413
|
}
|
|
1416
1414
|
return n;
|
|
1417
1415
|
}
|
|
1418
|
-
const
|
|
1419
|
-
function
|
|
1416
|
+
const Ft = 5126, at = 5121;
|
|
1417
|
+
function Wt(n, t, e) {
|
|
1420
1418
|
n.vertexAttribDivisor(t, e);
|
|
1421
1419
|
}
|
|
1422
|
-
function
|
|
1420
|
+
function Mt(n, t, e, r, i) {
|
|
1423
1421
|
n.drawArraysInstanced(t, e, r, i);
|
|
1424
1422
|
}
|
|
1425
|
-
let
|
|
1426
|
-
class
|
|
1423
|
+
let Bt = 0;
|
|
1424
|
+
class wt {
|
|
1427
1425
|
program;
|
|
1428
1426
|
attributeLoc = {};
|
|
1429
1427
|
uniformLoc = {};
|
|
@@ -1435,11 +1433,11 @@ class Tt {
|
|
|
1435
1433
|
/** Whether the uniform is an array (e.g. sampler2D uTextures[8]) */
|
|
1436
1434
|
uniformIsArray = {};
|
|
1437
1435
|
gl;
|
|
1438
|
-
shaderId =
|
|
1436
|
+
shaderId = Bt++;
|
|
1439
1437
|
// for debug
|
|
1440
1438
|
vao;
|
|
1441
1439
|
constructor(t, e, r, i) {
|
|
1442
|
-
this.gl = t, this.program =
|
|
1440
|
+
this.gl = t, this.program = Ot(t, e, r), this.parseShader(e), this.parseShader(r), this.vao = t.createVertexArray(), i && this.setAttributes(i);
|
|
1443
1441
|
}
|
|
1444
1442
|
/** Switch GPU to use this shader program */
|
|
1445
1443
|
use() {
|
|
@@ -1465,7 +1463,7 @@ class Tt {
|
|
|
1465
1463
|
const r = this.uniformLoc[t];
|
|
1466
1464
|
if (r === void 0) return;
|
|
1467
1465
|
const i = this.uniformType[t], s = this.uniformIsArray[t];
|
|
1468
|
-
|
|
1466
|
+
Dt(this.gl, r, i, e, s);
|
|
1469
1467
|
}
|
|
1470
1468
|
/**
|
|
1471
1469
|
* Batch-set uniforms via a plain value map.
|
|
@@ -1492,11 +1490,11 @@ class Tt {
|
|
|
1492
1490
|
r.vertexAttribPointer(
|
|
1493
1491
|
e,
|
|
1494
1492
|
t.size,
|
|
1495
|
-
t.type ??
|
|
1493
|
+
t.type ?? Ft,
|
|
1496
1494
|
t.normalized ?? !1,
|
|
1497
1495
|
t.stride,
|
|
1498
1496
|
t.offset ?? 0
|
|
1499
|
-
), r.enableVertexAttribArray(e),
|
|
1497
|
+
), r.enableVertexAttribArray(e), Wt(r, e, t.divisor ?? 0);
|
|
1500
1498
|
}
|
|
1501
1499
|
/** Bind all vertex attribute pointers at once */
|
|
1502
1500
|
setAttributes(t) {
|
|
@@ -1524,7 +1522,7 @@ class Tt {
|
|
|
1524
1522
|
}
|
|
1525
1523
|
}
|
|
1526
1524
|
}
|
|
1527
|
-
function
|
|
1525
|
+
function Dt(n, t, e, r, i = !1) {
|
|
1528
1526
|
switch (e) {
|
|
1529
1527
|
// scalars
|
|
1530
1528
|
case "float":
|
|
@@ -1560,10 +1558,10 @@ function Ot(n, t, e, r, i = !1) {
|
|
|
1560
1558
|
return n.uniformMatrix4fv(t, !1, r);
|
|
1561
1559
|
// fallback: guess by value shape
|
|
1562
1560
|
default:
|
|
1563
|
-
return
|
|
1561
|
+
return kt(n, t, r);
|
|
1564
1562
|
}
|
|
1565
1563
|
}
|
|
1566
|
-
function
|
|
1564
|
+
function kt(n, t, e) {
|
|
1567
1565
|
if (typeof e == "number")
|
|
1568
1566
|
return n.uniform1f(t, e);
|
|
1569
1567
|
const r = e;
|
|
@@ -1582,7 +1580,7 @@ function Ft(n, t, e) {
|
|
|
1582
1580
|
return n.uniform1fv(t, r);
|
|
1583
1581
|
}
|
|
1584
1582
|
}
|
|
1585
|
-
class
|
|
1583
|
+
class ft {
|
|
1586
1584
|
/** Custom vertex shader code */
|
|
1587
1585
|
vs;
|
|
1588
1586
|
/** Custom fragment shader code */
|
|
@@ -1653,8 +1651,11 @@ class ct {
|
|
|
1653
1651
|
const s = t.createShader(r, i);
|
|
1654
1652
|
return s.isCustom = !0, s.padding = this.padding, this.glshader.set(e, s), this.uniformDirty.add(e), s;
|
|
1655
1653
|
}
|
|
1654
|
+
destroy() {
|
|
1655
|
+
this.glshader.forEach((t) => t.destroy());
|
|
1656
|
+
}
|
|
1656
1657
|
}
|
|
1657
|
-
class
|
|
1658
|
+
class At {
|
|
1658
1659
|
constructor(t) {
|
|
1659
1660
|
this.rapid = t, this.gl = t.gl, this.maxTextureUnits = t.maxTextureUnits, this.matrixStore = t.matrix;
|
|
1660
1661
|
}
|
|
@@ -1697,7 +1698,7 @@ class Et {
|
|
|
1697
1698
|
return i == -1 ? (this.freeTextureUnitNum === 0 && this.flush(), this.usedTextures.push(t), this.usedTexturePadding.push(e), this.usedTexturePadding.push(r), this.usedTextures.length - 1) : i;
|
|
1698
1699
|
}
|
|
1699
1700
|
createShader(t, e) {
|
|
1700
|
-
return new
|
|
1701
|
+
return new wt(this.gl, t, e);
|
|
1701
1702
|
}
|
|
1702
1703
|
createCustomShader(t) {
|
|
1703
1704
|
return t.getGLShader(this, this.KEY, this.vs, this.fs);
|
|
@@ -1705,7 +1706,7 @@ class Et {
|
|
|
1705
1706
|
getCustomShader(t) {
|
|
1706
1707
|
if (!t)
|
|
1707
1708
|
return this.defaultShader;
|
|
1708
|
-
if (t instanceof
|
|
1709
|
+
if (t instanceof ft) {
|
|
1709
1710
|
const e = this.createCustomShader(t);
|
|
1710
1711
|
return e ?? this.defaultShader;
|
|
1711
1712
|
}
|
|
@@ -1720,7 +1721,7 @@ class Et {
|
|
|
1720
1721
|
return this.isDefaultShader && !t ? !0 : this.getCustomShader(t) == this.currentShader;
|
|
1721
1722
|
}
|
|
1722
1723
|
enter(t) {
|
|
1723
|
-
this.resetRender(), this.currentShader = this.getCustomShader(t), t instanceof
|
|
1724
|
+
this.resetRender(), this.currentShader = this.getCustomShader(t), t instanceof ft ? (this.customShader = t, this.customShaderUsedTextureNum = t.usedTextureUnitNum) : (this.customShader = null, this.customShaderUsedTextureNum = 0), this.isDefaultShader = this.currentShader == this.defaultShader, this.currentShader.use(), this.currentShader.setUniform("u_projection", this.rapid.projection);
|
|
1724
1725
|
}
|
|
1725
1726
|
exit() {
|
|
1726
1727
|
this.hasPendingContent() && this.flush(), this.gl.bindVertexArray(null);
|
|
@@ -1757,7 +1758,7 @@ class Et {
|
|
|
1757
1758
|
return !1;
|
|
1758
1759
|
}
|
|
1759
1760
|
}
|
|
1760
|
-
const
|
|
1761
|
+
const tt = `#version 300 es\r
|
|
1761
1762
|
precision highp float;\r
|
|
1762
1763
|
\r
|
|
1763
1764
|
// per-vertex\r
|
|
@@ -1805,7 +1806,7 @@ void main(void) {\r
|
|
|
1805
1806
|
\r
|
|
1806
1807
|
gl_Position = u_projection * position;\r
|
|
1807
1808
|
}\r
|
|
1808
|
-
`,
|
|
1809
|
+
`, mt = `#version 300 es\r
|
|
1809
1810
|
precision mediump float;\r
|
|
1810
1811
|
\r
|
|
1811
1812
|
uniform sampler2D uTextures[%TEXTURE_NUM%];\r
|
|
@@ -1854,8 +1855,8 @@ void main(void) {\r
|
|
|
1854
1855
|
\r
|
|
1855
1856
|
// CUSTOM_CODE_CALL\r
|
|
1856
1857
|
}\r
|
|
1857
|
-
`,
|
|
1858
|
-
class
|
|
1858
|
+
`, $ = 48, Gt = new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]);
|
|
1859
|
+
class ot extends At {
|
|
1859
1860
|
instanceBuffer;
|
|
1860
1861
|
quadBuffer;
|
|
1861
1862
|
instanceCount = 0;
|
|
@@ -1867,28 +1868,28 @@ class at extends Et {
|
|
|
1867
1868
|
}
|
|
1868
1869
|
createBuffer() {
|
|
1869
1870
|
const t = this.gl;
|
|
1870
|
-
this.quadBuffer = new
|
|
1871
|
-
for (const e of
|
|
1872
|
-
this.quadBuffer.makeDirty(), this.quadBuffer.bufferData(), this.instanceBuffer = new
|
|
1871
|
+
this.quadBuffer = new it(t, b.Float32, t.ARRAY_BUFFER, t.STATIC_DRAW), this.quadBuffer.bindBuffer();
|
|
1872
|
+
for (const e of Gt) this.quadBuffer.pushFloat32(e);
|
|
1873
|
+
this.quadBuffer.makeDirty(), this.quadBuffer.bufferData(), this.instanceBuffer = new it(t, b.Uint32, t.ARRAY_BUFFER, t.DYNAMIC_DRAW);
|
|
1873
1874
|
}
|
|
1874
1875
|
createDefaultShader() {
|
|
1875
|
-
const t = this.rapid, e =
|
|
1876
|
+
const t = this.rapid, e = V(mt, t.maxTextureUnits), r = V(tt, t.maxTextureUnits);
|
|
1876
1877
|
return this.vs = r, this.fs = e, this.defaultShader = this.createShader(r, e), this.defaultShader;
|
|
1877
1878
|
}
|
|
1878
1879
|
createShader(t, e) {
|
|
1879
1880
|
const r = super.createShader(t, e);
|
|
1880
1881
|
return r.use(), r.bindVAO(), this.instanceBuffer.bindBuffer(), r.setAttributes([
|
|
1881
|
-
{ name: "aMatrixRow0", size: 3, stride:
|
|
1882
|
-
{ name: "aMatrixRow1", size: 3, stride:
|
|
1883
|
-
{ name: "aUVRect", size: 4, stride:
|
|
1884
|
-
{ name: "aColor", size: 4, type:
|
|
1885
|
-
{ name: "aTextureId", size: 1, type:
|
|
1882
|
+
{ name: "aMatrixRow0", size: 3, stride: $, offset: 0, divisor: 1 },
|
|
1883
|
+
{ name: "aMatrixRow1", size: 3, stride: $, offset: 12, divisor: 1 },
|
|
1884
|
+
{ name: "aUVRect", size: 4, stride: $, offset: 24, divisor: 1 },
|
|
1885
|
+
{ name: "aColor", size: 4, type: at, normalized: !0, stride: $, offset: 40, divisor: 1 },
|
|
1886
|
+
{ name: "aTextureId", size: 1, type: at, stride: $, offset: 44, divisor: 1 }
|
|
1886
1887
|
]), this.quadBuffer.bindBuffer(), r.setAttributes([
|
|
1887
1888
|
{ name: "aVertex", size: 2, stride: 8, offset: 0, divisor: 0 }
|
|
1888
1889
|
]), r.unbindVAO(), this.currentShader && this.currentShader.use(), r;
|
|
1889
1890
|
}
|
|
1890
1891
|
createCustomShader(t) {
|
|
1891
|
-
const e =
|
|
1892
|
+
const e = V(mt, this.rapid.maxTextureUnits - t.usedTextureUnitNum), r = V(tt, this.rapid.maxTextureUnits - t.usedTextureUnitNum);
|
|
1892
1893
|
return t.getGLShader(this, this.KEY, r, e);
|
|
1893
1894
|
}
|
|
1894
1895
|
/**
|
|
@@ -1925,23 +1926,23 @@ class at extends Et {
|
|
|
1925
1926
|
d
|
|
1926
1927
|
);
|
|
1927
1928
|
}
|
|
1928
|
-
drawSpriteAffine(t, e, r, i, s, a, o, h = 0, c = 0, u = 1, l = 1, d = 4294967295, f = 0, m = 0,
|
|
1929
|
-
const
|
|
1929
|
+
drawSpriteAffine(t, e, r, i, s, a, o, h = 0, c = 0, u = 1, l = 1, d = 4294967295, f = 0, m = 0, v = !1, y = !1, T = !1) {
|
|
1930
|
+
const M = t.base, A = t.rawWidth, P = t.rawHeight, C = t.offsetX, F = t.offsetY, W = this.useTexture(
|
|
1930
1931
|
t.glTexture,
|
|
1931
|
-
f /
|
|
1932
|
-
m /
|
|
1933
|
-
),
|
|
1934
|
-
|
|
1935
|
-
const
|
|
1936
|
-
|
|
1937
|
-
const
|
|
1938
|
-
|
|
1932
|
+
f / M.width,
|
|
1933
|
+
m / M.height
|
|
1934
|
+
), N = this.instanceBuffer, w = N.usedElemNum;
|
|
1935
|
+
N.resize(12);
|
|
1936
|
+
const U = N.float32, X = N.uint32, k = T ? P : A, G = T ? A : P, I = k + 2 * f, B = G + 2 * m, H = C - f, R = F - m, g = this.localSpriteMatrix;
|
|
1937
|
+
T ? (g[0] = 0, g[1] = y ? B : -B, g[2] = v ? -I : I, g[3] = 0, g[4] = H + (v ? I : 0), g[5] = R + (y ? 0 : B)) : (g[0] = v ? -I : I, g[1] = 0, g[2] = 0, g[3] = y ? -B : B, g[4] = H + (v ? I : 0), g[5] = R + (y ? B : 0));
|
|
1938
|
+
const S = this.worldSpriteMatrix;
|
|
1939
|
+
S[0] = e * g[0] + i * g[1], S[1] = r * g[0] + s * g[1], S[2] = e * g[2] + i * g[3], S[3] = r * g[2] + s * g[3], S[4] = a + e * g[4] + i * g[5], S[5] = o + r * g[4] + s * g[5], U[w + 6] = h, U[w + 7] = c, U[w + 8] = u, U[w + 9] = l, X[w + 10] = d, X[w + 11] = W, this.rapid.roundPixels && (S[4] = Math.round(S[4]), S[5] = Math.round(S[5])), U[w] = S[0], U[w + 1] = S[2], U[w + 2] = S[4], U[w + 3] = S[1], U[w + 4] = S[3], U[w + 5] = S[5], N.usedElemNum += 12, N.makeDirty(), this.instanceCount++;
|
|
1939
1940
|
}
|
|
1940
1941
|
render() {
|
|
1941
1942
|
if (this.instanceCount === 0) return;
|
|
1942
1943
|
this.prepareRender();
|
|
1943
1944
|
const t = this.gl, e = this.currentShader;
|
|
1944
|
-
this.instanceBuffer.bindBuffer(), this.instanceBuffer.bufferData(), e.bindVAO(),
|
|
1945
|
+
this.instanceBuffer.bindBuffer(), this.instanceBuffer.bufferData(), e.bindVAO(), Mt(t, t.TRIANGLE_STRIP, 0, 4, this.instanceCount), this.rapid.drawcallCount++;
|
|
1945
1946
|
}
|
|
1946
1947
|
resetRender() {
|
|
1947
1948
|
super.resetRender(), this.instanceBuffer.clear(), this.instanceCount = 0;
|
|
@@ -1950,7 +1951,7 @@ class at extends Et {
|
|
|
1950
1951
|
return this.instanceCount > 0;
|
|
1951
1952
|
}
|
|
1952
1953
|
}
|
|
1953
|
-
const
|
|
1954
|
+
const Ht = `#version 300 es\r
|
|
1954
1955
|
precision highp float;\r
|
|
1955
1956
|
\r
|
|
1956
1957
|
in vec2 aPosition;\r
|
|
@@ -1981,7 +1982,7 @@ void main(void) {\r
|
|
|
1981
1982
|
// CUSTOM_CODE_CALL\r
|
|
1982
1983
|
gl_Position = u_projection * position;\r
|
|
1983
1984
|
}\r
|
|
1984
|
-
`,
|
|
1985
|
+
`, Vt = `#version 300 es\r
|
|
1985
1986
|
precision mediump float;\r
|
|
1986
1987
|
\r
|
|
1987
1988
|
in vec4 vColor;\r
|
|
@@ -2027,7 +2028,7 @@ void main(void) {\r
|
|
|
2027
2028
|
fragColor = sampleTexture(vRegion) * vColor;\r
|
|
2028
2029
|
// CUSTOM_CODE_CALL\r
|
|
2029
2030
|
}\r
|
|
2030
|
-
`,
|
|
2031
|
+
`, Yt = `#version 300 es\r
|
|
2031
2032
|
precision highp float;\r
|
|
2032
2033
|
\r
|
|
2033
2034
|
in vec2 aPosition;\r
|
|
@@ -2050,7 +2051,7 @@ void main(void) {\r
|
|
|
2050
2051
|
);\r
|
|
2051
2052
|
gl_Position = u_projection * position;\r
|
|
2052
2053
|
}\r
|
|
2053
|
-
`,
|
|
2054
|
+
`, zt = `#version 300 es\r
|
|
2054
2055
|
precision mediump float;\r
|
|
2055
2056
|
\r
|
|
2056
2057
|
in vec2 vRegion;\r
|
|
@@ -2070,8 +2071,8 @@ void main(void) {\r
|
|
|
2070
2071
|
discard;\r
|
|
2071
2072
|
}\r
|
|
2072
2073
|
}\r
|
|
2073
|
-
`,
|
|
2074
|
-
class
|
|
2074
|
+
`, K = 20;
|
|
2075
|
+
class Xt extends At {
|
|
2075
2076
|
vertexBuffer;
|
|
2076
2077
|
vertexCount = 0;
|
|
2077
2078
|
matrixIndex = -1;
|
|
@@ -2084,24 +2085,24 @@ class Ht extends Et {
|
|
|
2084
2085
|
}
|
|
2085
2086
|
createBuffer() {
|
|
2086
2087
|
const t = this.gl;
|
|
2087
|
-
this.vertexBuffer = new
|
|
2088
|
+
this.vertexBuffer = new it(t, b.Float32, t.ARRAY_BUFFER, t.DYNAMIC_DRAW), this.maskShader = this.createMaskShader(Yt, zt);
|
|
2088
2089
|
}
|
|
2089
2090
|
createDefaultShader() {
|
|
2090
|
-
return this.vs =
|
|
2091
|
+
return this.vs = Ht, this.fs = Vt, this.defaultShader = this.createShader(this.vs, this.fs), this.defaultShader;
|
|
2091
2092
|
}
|
|
2092
2093
|
createMaskShader(t, e) {
|
|
2093
|
-
const r = this.gl, i = new
|
|
2094
|
+
const r = this.gl, i = new wt(r, t, e);
|
|
2094
2095
|
return i.use(), i.bindVAO(), this.vertexBuffer.bindBuffer(), i.setAttributes([
|
|
2095
|
-
{ name: "aPosition", size: 2, type: r.FLOAT, stride:
|
|
2096
|
-
{ name: "aUV", size: 2, type: r.FLOAT, stride:
|
|
2096
|
+
{ name: "aPosition", size: 2, type: r.FLOAT, stride: K - 4, offset: 0, divisor: 0 },
|
|
2097
|
+
{ name: "aUV", size: 2, type: r.FLOAT, stride: K - 4, offset: 8, divisor: 0 }
|
|
2097
2098
|
]), i.unbindVAO(), this.currentShader && this.currentShader.use(), i;
|
|
2098
2099
|
}
|
|
2099
2100
|
createShader(t, e) {
|
|
2100
2101
|
const r = this.gl, i = super.createShader(t, e);
|
|
2101
2102
|
return i.use(), i.bindVAO(), this.vertexBuffer.bindBuffer(), i.setAttributes([
|
|
2102
|
-
{ name: "aPosition", size: 2, type: r.FLOAT, stride:
|
|
2103
|
-
{ name: "aColor", size: 4, type: r.UNSIGNED_BYTE, normalized: !0, stride:
|
|
2104
|
-
{ name: "aUV", size: 2, type: r.FLOAT, stride:
|
|
2103
|
+
{ name: "aPosition", size: 2, type: r.FLOAT, stride: K, offset: 0, divisor: 0 },
|
|
2104
|
+
{ name: "aColor", size: 4, type: r.UNSIGNED_BYTE, normalized: !0, stride: K, offset: 8, divisor: 0 },
|
|
2105
|
+
{ name: "aUV", size: 2, type: r.FLOAT, stride: K, offset: 12, divisor: 0 }
|
|
2105
2106
|
]), i.unbindVAO(), this.currentShader && this.currentShader.use(), i;
|
|
2106
2107
|
}
|
|
2107
2108
|
/**
|
|
@@ -2270,7 +2271,7 @@ class p {
|
|
|
2270
2271
|
return new p(Math.cos(t), Math.sin(t));
|
|
2271
2272
|
}
|
|
2272
2273
|
}
|
|
2273
|
-
const
|
|
2274
|
+
const jt = (n, t) => {
|
|
2274
2275
|
const [e, r, i, s, a, o] = t, h = new Float32Array([
|
|
2275
2276
|
e,
|
|
2276
2277
|
i,
|
|
@@ -2289,8 +2290,8 @@ const Vt = (n, t) => {
|
|
|
2289
2290
|
0,
|
|
2290
2291
|
1
|
|
2291
2292
|
]);
|
|
2292
|
-
return
|
|
2293
|
-
},
|
|
2293
|
+
return $t(h, n);
|
|
2294
|
+
}, $t = (n, t) => {
|
|
2294
2295
|
const e = new Float32Array(16);
|
|
2295
2296
|
for (let r = 0; r < 4; r++)
|
|
2296
2297
|
for (let i = 0; i < 4; i++) {
|
|
@@ -2301,15 +2302,15 @@ const Vt = (n, t) => {
|
|
|
2301
2302
|
}
|
|
2302
2303
|
return e;
|
|
2303
2304
|
};
|
|
2304
|
-
var
|
|
2305
|
-
const
|
|
2305
|
+
var Kt = /* @__PURE__ */ ((n) => (n[n.STRETCH = 0] = "STRETCH", n[n.REPEAT = 1] = "REPEAT", n))(Kt || {});
|
|
2306
|
+
const rt = 10, xt = (n, t, e, r, i, s) => {
|
|
2306
2307
|
const a = [], o = [], h = r ? Math.atan2(t.y, t.x) : Math.atan2(-t.y, -t.x), c = Math.PI, u = new p(t.y, -t.x);
|
|
2307
|
-
for (let l = 0; l <
|
|
2308
|
-
const d = l /
|
|
2309
|
-
a.push(n), o.push(new p(i, 0.5)), a.push(n.add(
|
|
2308
|
+
for (let l = 0; l < rt; l++) {
|
|
2309
|
+
const d = l / rt, f = (l + 1) / rt, m = h + d * c, v = h + f * c, y = new p(Math.cos(m) * e, Math.sin(m) * e), T = new p(Math.cos(v) * e, Math.sin(v) * e);
|
|
2310
|
+
a.push(n), o.push(new p(i, 0.5)), a.push(n.add(y)), o.push(new p(i + y.dot(u) * s, 0.5 - 0.5 * y.dot(t) / e)), a.push(n.add(T)), o.push(new p(i + T.dot(u) * s, 0.5 - 0.5 * T.dot(t) / e));
|
|
2310
2311
|
}
|
|
2311
2312
|
return { vertices: a, uv: o };
|
|
2312
|
-
},
|
|
2313
|
+
}, qt = (n, t = !1) => {
|
|
2313
2314
|
const e = [];
|
|
2314
2315
|
if (n.length < 2 || t && n.length < 3) return { normals: e, length: 0 };
|
|
2315
2316
|
const r = 4, i = 1e-3, s = n.length;
|
|
@@ -2329,8 +2330,8 @@ const tt = 10, lt = (n, t, e, r, i, s) => {
|
|
|
2329
2330
|
{
|
|
2330
2331
|
let m = d.add(l).normalize();
|
|
2331
2332
|
l.cross(d) < 0 && (m = m.multiply(-1));
|
|
2332
|
-
let
|
|
2333
|
-
return { normal: m, miters: Math.min(
|
|
2333
|
+
let v = 1 / Math.sqrt((1 - f) / 2);
|
|
2334
|
+
return { normal: m, miters: Math.min(v, r) };
|
|
2334
2335
|
}
|
|
2335
2336
|
};
|
|
2336
2337
|
if (t)
|
|
@@ -2349,27 +2350,27 @@ const tt = 10, lt = (n, t, e, r, i, s) => {
|
|
|
2349
2350
|
} else
|
|
2350
2351
|
e.push(o(n[h - 1], n[h], n[h + 1]));
|
|
2351
2352
|
return { normals: e, length: a };
|
|
2352
|
-
},
|
|
2353
|
+
}, Qt = (n) => {
|
|
2353
2354
|
const t = n.points;
|
|
2354
2355
|
if (t.length < 2) return { vertices: [], uv: [] };
|
|
2355
|
-
const { normals: e, length: r } =
|
|
2356
|
+
const { normals: e, length: r } = qt(t, n.closed), i = (n.width || 1) / 2, s = [], a = [], o = n.roundCap || !1, h = n.textureMode || 0;
|
|
2356
2357
|
let c = 0;
|
|
2357
2358
|
const u = n.texture?.rawWidth || 1, l = n.closed ? t.length : t.length - 1;
|
|
2358
2359
|
for (let d = 0; d < l; d++) {
|
|
2359
|
-
const f = t[d], m = e[d].normal,
|
|
2360
|
-
let w = 0,
|
|
2361
|
-
h === 0 ? (w = c / r,
|
|
2362
|
-
const
|
|
2363
|
-
s.push(
|
|
2360
|
+
const f = t[d], m = e[d].normal, v = e[d].miters, y = (d + 1) % t.length, T = t[y], M = e[y].normal, A = e[y].miters, P = f.add(m.multiply(v * i)), C = f.subtract(m.multiply(v * i)), F = T.add(M.multiply(A * i)), W = T.subtract(M.multiply(A * i)), N = f.distanceTo(T);
|
|
2361
|
+
let w = 0, U = 0;
|
|
2362
|
+
h === 0 ? (w = c / r, U = (c + N) / r) : (w = c / u, U = w + N / u);
|
|
2363
|
+
const X = new p(w, 0), k = new p(w, 1), G = new p(U, 0), I = new p(U, 1);
|
|
2364
|
+
s.push(P), a.push(X), s.push(C), a.push(k), s.push(F), a.push(G), s.push(F), a.push(G), s.push(W), a.push(I), s.push(C), a.push(k), c += N;
|
|
2364
2365
|
}
|
|
2365
2366
|
if (o && !n.closed) {
|
|
2366
|
-
const d = t[0], f = e[0].normal, m = h === 0 ? r > 0 ? 1 / r : 0 : 1 / u,
|
|
2367
|
-
s.push(...
|
|
2368
|
-
const
|
|
2369
|
-
s.push(...
|
|
2367
|
+
const d = t[0], f = e[0].normal, m = h === 0 ? r > 0 ? 1 / r : 0 : 1 / u, v = xt(d, f, i, !0, 0, m);
|
|
2368
|
+
s.push(...v.vertices), a.push(...v.uv);
|
|
2369
|
+
const y = t[t.length - 1], T = e[t.length - 1].normal, M = h === 0 ? 1 : c / u, A = h === 0 ? r > 0 ? 1 / r : 0 : 1 / u, P = xt(y, T, i, !1, M, A);
|
|
2370
|
+
s.push(...P.vertices), a.push(...P.uv);
|
|
2370
2371
|
}
|
|
2371
2372
|
return { vertices: s, uv: a };
|
|
2372
|
-
},
|
|
2373
|
+
}, Z = (n, t, e, r) => {
|
|
2373
2374
|
if (t.customMatrix !== void 0)
|
|
2374
2375
|
return t.customMatrix;
|
|
2375
2376
|
if (t.modifyStack) {
|
|
@@ -2388,8 +2389,8 @@ const tt = 10, lt = (n, t, e, r, i, s) => {
|
|
|
2388
2389
|
i
|
|
2389
2390
|
), i;
|
|
2390
2391
|
}
|
|
2391
|
-
},
|
|
2392
|
-
const e =
|
|
2392
|
+
}, Zt = (n, t) => t ? n ? t.premultipliedUint32 : t.uint32 : 4294967295, Jt = 2, te = (n, t) => {
|
|
2393
|
+
const e = Z(n, t, t.texture.rawWidth, t.texture.rawHeight), r = t.texture;
|
|
2393
2394
|
if (!r?.base || n.inCreateMask)
|
|
2394
2395
|
return;
|
|
2395
2396
|
const i = r.isAtlas ? n.atlasSpriteRegion : n.spriteRegion;
|
|
@@ -2397,7 +2398,7 @@ const tt = 10, lt = (n, t, e, r, i, s) => {
|
|
|
2397
2398
|
let s = r.uvX, a = r.uvY, o = r.uvW, h = r.uvH;
|
|
2398
2399
|
const c = !!t.flipX, u = !!t.flipY != !!r.flipY;
|
|
2399
2400
|
let l = t.padding ?? i.currentShader.padding;
|
|
2400
|
-
r.isAtlas && (l +=
|
|
2401
|
+
r.isAtlas && (l += Jt);
|
|
2401
2402
|
const d = s <= o ? l : -l, f = a <= h ? l : -l;
|
|
2402
2403
|
i.drawSprite(
|
|
2403
2404
|
r,
|
|
@@ -2413,7 +2414,7 @@ const tt = 10, lt = (n, t, e, r, i, s) => {
|
|
|
2413
2414
|
u,
|
|
2414
2415
|
r.isRotated
|
|
2415
2416
|
);
|
|
2416
|
-
},
|
|
2417
|
+
}, ee = (n, t) => {
|
|
2417
2418
|
const e = n.particleRegion;
|
|
2418
2419
|
n.enterRegion(e, t.shader);
|
|
2419
2420
|
const r = t.texture, i = t.count ?? t.x.length, s = t.color;
|
|
@@ -2426,10 +2427,10 @@ const tt = 10, lt = (n, t, e, r, i, s) => {
|
|
|
2426
2427
|
i,
|
|
2427
2428
|
t.scaleX,
|
|
2428
2429
|
t.scaleY,
|
|
2429
|
-
r.uvX,
|
|
2430
|
-
r.uvY,
|
|
2431
|
-
r.uvW,
|
|
2432
|
-
r.uvH,
|
|
2430
|
+
t.u0 ?? r.uvX,
|
|
2431
|
+
t.v0 ?? r.uvY,
|
|
2432
|
+
t.u1 ?? r.uvW,
|
|
2433
|
+
t.v1 ?? r.uvH,
|
|
2433
2434
|
t.flipX,
|
|
2434
2435
|
t.flipY,
|
|
2435
2436
|
r.isRotated,
|
|
@@ -2439,9 +2440,9 @@ const tt = 10, lt = (n, t, e, r, i, s) => {
|
|
|
2439
2440
|
t.reverseOrder,
|
|
2440
2441
|
t.customMatrix
|
|
2441
2442
|
);
|
|
2442
|
-
},
|
|
2443
|
+
}, St = (n, t) => {
|
|
2443
2444
|
if (t.points.length === 0) return;
|
|
2444
|
-
const e =
|
|
2445
|
+
const e = Z(n, t, 0, 0);
|
|
2445
2446
|
n.startGraphic(
|
|
2446
2447
|
t.drawMode ?? n.gl.TRIANGLES,
|
|
2447
2448
|
t.texture,
|
|
@@ -2459,18 +2460,18 @@ const tt = 10, lt = (n, t, e, r, i, s) => {
|
|
|
2459
2460
|
);
|
|
2460
2461
|
}
|
|
2461
2462
|
n.endGraphic();
|
|
2462
|
-
},
|
|
2463
|
+
}, re = (n, t) => {
|
|
2463
2464
|
if (n.inCreateMask)
|
|
2464
2465
|
return;
|
|
2465
|
-
const { vertices: e, uv: r } =
|
|
2466
|
-
|
|
2466
|
+
const { vertices: e, uv: r } = Qt(t);
|
|
2467
|
+
St(n, {
|
|
2467
2468
|
...t,
|
|
2468
2469
|
points: e,
|
|
2469
2470
|
uv: r,
|
|
2470
2471
|
drawMode: n.gl.TRIANGLES
|
|
2471
2472
|
});
|
|
2472
|
-
},
|
|
2473
|
-
const e =
|
|
2473
|
+
}, ie = (n, t) => {
|
|
2474
|
+
const e = Z(
|
|
2474
2475
|
n,
|
|
2475
2476
|
t,
|
|
2476
2477
|
t.texture.rawWidth,
|
|
@@ -2481,16 +2482,16 @@ const tt = 10, lt = (n, t, e, r, i, s) => {
|
|
|
2481
2482
|
t.texture,
|
|
2482
2483
|
e ?? t.customMatrix
|
|
2483
2484
|
), n.addRectVertex(t.texture.rawWidth, t.texture.rawHeight), n.endGraphic();
|
|
2484
|
-
},
|
|
2485
|
-
const e =
|
|
2485
|
+
}, se = (n, t) => {
|
|
2486
|
+
const e = Z(n, t, t.width, t.height);
|
|
2486
2487
|
n.startGraphic(
|
|
2487
2488
|
n.gl.TRIANGLE_FAN,
|
|
2488
2489
|
t.texture,
|
|
2489
2490
|
t.shader,
|
|
2490
2491
|
e ?? t.customMatrix
|
|
2491
2492
|
), n.addRectVertex(t.width, t.height, t.color), n.endGraphic();
|
|
2492
|
-
},
|
|
2493
|
-
const e = t.segments ?? 32, r =
|
|
2493
|
+
}, ne = (n, t) => {
|
|
2494
|
+
const e = t.segments ?? 32, r = Z(n, t, 0, 0);
|
|
2494
2495
|
n.startGraphic(
|
|
2495
2496
|
n.gl.TRIANGLE_FAN,
|
|
2496
2497
|
void 0,
|
|
@@ -2499,7 +2500,7 @@ const tt = 10, lt = (n, t, e, r, i, s) => {
|
|
|
2499
2500
|
);
|
|
2500
2501
|
const i = n.getColorUint32(t.color);
|
|
2501
2502
|
n.addGraphicVertex(0, 0, 0.5, 0.5, i), n.addCircleVertex(t.radius, t.color, e), n.addGraphicVertex(t.radius, 0, 1, 0.5, i), n.endGraphic();
|
|
2502
|
-
},
|
|
2503
|
+
}, pt = `#version 300 es\r
|
|
2503
2504
|
precision mediump float;\r
|
|
2504
2505
|
\r
|
|
2505
2506
|
uniform sampler2D uTextures[%TEXTURE_NUM%];\r
|
|
@@ -2549,21 +2550,21 @@ void main(void) {\r
|
|
|
2549
2550
|
// CUSTOM_CODE_CALL\r
|
|
2550
2551
|
}\r
|
|
2551
2552
|
`;
|
|
2552
|
-
class
|
|
2553
|
+
class ae extends ot {
|
|
2553
2554
|
KEY = "AtlasSprite";
|
|
2554
2555
|
constructor(t) {
|
|
2555
2556
|
super(t);
|
|
2556
2557
|
}
|
|
2557
2558
|
createCustomShader(t) {
|
|
2558
|
-
const e =
|
|
2559
|
+
const e = V(pt, this.rapid.maxTextureUnits - t.usedTextureUnitNum), r = V(tt, this.rapid.maxTextureUnits - t.usedTextureUnitNum);
|
|
2559
2560
|
return t.getGLShader(this, this.KEY, r, e);
|
|
2560
2561
|
}
|
|
2561
2562
|
createDefaultShader() {
|
|
2562
|
-
const t = this.rapid, e =
|
|
2563
|
+
const t = this.rapid, e = V(pt, t.maxTextureUnits), r = V(tt, t.maxTextureUnits);
|
|
2563
2564
|
return this.vs = r, this.fs = e, this.defaultShader = this.createShader(r, e), this.defaultShader;
|
|
2564
2565
|
}
|
|
2565
2566
|
}
|
|
2566
|
-
const
|
|
2567
|
+
const gt = `#version 300 es\r
|
|
2567
2568
|
precision highp float;\r
|
|
2568
2569
|
\r
|
|
2569
2570
|
// per-vertex\r
|
|
@@ -2604,7 +2605,7 @@ void main(void) {\r
|
|
|
2604
2605
|
\r
|
|
2605
2606
|
gl_Position = u_projection * vec4(v, 0.0, 1.0);\r
|
|
2606
2607
|
}\r
|
|
2607
|
-
`,
|
|
2608
|
+
`, vt = `#version 300 es\r
|
|
2608
2609
|
precision mediump float;\r
|
|
2609
2610
|
\r
|
|
2610
2611
|
uniform sampler2D uTexture;\r
|
|
@@ -2620,8 +2621,8 @@ void main(void) {\r
|
|
|
2620
2621
|
\r
|
|
2621
2622
|
// CUSTOM_CODE_CALL\r
|
|
2622
2623
|
}\r
|
|
2623
|
-
`, Y = 48,
|
|
2624
|
-
class
|
|
2624
|
+
`, Y = 48, yt = Y / 4;
|
|
2625
|
+
class he extends ot {
|
|
2625
2626
|
KEY = "ParticleSprite";
|
|
2626
2627
|
texture;
|
|
2627
2628
|
customMatrix;
|
|
@@ -2629,10 +2630,10 @@ class ie extends at {
|
|
|
2629
2630
|
super(t);
|
|
2630
2631
|
}
|
|
2631
2632
|
createCustomShader(t) {
|
|
2632
|
-
return t.getGLShader(this, this.KEY,
|
|
2633
|
+
return t.getGLShader(this, this.KEY, gt, vt);
|
|
2633
2634
|
}
|
|
2634
2635
|
createDefaultShader() {
|
|
2635
|
-
const t =
|
|
2636
|
+
const t = vt, e = gt;
|
|
2636
2637
|
return this.vs = e, this.fs = t, this.defaultShader = this.createShader(e, t), this.defaultShader;
|
|
2637
2638
|
}
|
|
2638
2639
|
enter(t) {
|
|
@@ -2645,42 +2646,48 @@ class ie extends at {
|
|
|
2645
2646
|
{ name: "aScale", size: 2, stride: Y, offset: 8, divisor: 1 },
|
|
2646
2647
|
{ name: "aRotation", size: 1, stride: Y, offset: 16, divisor: 1 },
|
|
2647
2648
|
{ name: "aUVRect", size: 4, stride: Y, offset: 20, divisor: 1 },
|
|
2648
|
-
{ name: "aColor", size: 4, type:
|
|
2649
|
+
{ name: "aColor", size: 4, type: at, normalized: !0, stride: Y, offset: 36, divisor: 1 },
|
|
2649
2650
|
{ name: "aOrigin", size: 2, stride: Y, offset: 40, divisor: 1 }
|
|
2650
2651
|
]), this.quadBuffer.bindBuffer(), r.setAttributes([
|
|
2651
2652
|
{ name: "aVertex", size: 2, stride: 8, offset: 0, divisor: 0 }
|
|
2652
2653
|
]), r.unbindVAO(), this.currentShader && this.currentShader.use(), r;
|
|
2653
2654
|
}
|
|
2654
|
-
drawParticles(t, e, r, i = 0, s = 4294967295, a, o = 1, h = 1, c = 0, u = 0, l = 1, d = 1, f = !1, m = !1,
|
|
2655
|
+
drawParticles(t, e, r, i = 0, s = 4294967295, a, o = 1, h = 1, c = 0, u = 0, l = 1, d = 1, f = !1, m = !1, v = !1, y = 0.5, T = 0.5, M, A = !1, P) {
|
|
2655
2656
|
if (!t.glTexture || a <= 0) return;
|
|
2656
|
-
let
|
|
2657
|
-
const
|
|
2658
|
-
let
|
|
2659
|
-
|
|
2660
|
-
let
|
|
2661
|
-
|
|
2662
|
-
let
|
|
2663
|
-
for (
|
|
2657
|
+
let C = 0;
|
|
2658
|
+
const F = typeof o == "number", W = typeof h == "number", N = typeof i == "number", w = typeof s == "number", U = typeof c == "number", X = !w && typeof s[0] == "number";
|
|
2659
|
+
let k = t.rawWidth * (f ? -1 : 1);
|
|
2660
|
+
F && (k *= o);
|
|
2661
|
+
let G = t.rawHeight * (m ? -1 : 1);
|
|
2662
|
+
W && (G *= h), U && (G *= d - u, k *= l - c);
|
|
2663
|
+
let I = v ? Math.PI / 2 : 0;
|
|
2664
|
+
for (N && (I += i); C < a; ) {
|
|
2664
2665
|
this.texture && t !== this.texture && this.flush(), this.texture || (this.texture = t, this.useTexture(t.glTexture, 0, 0));
|
|
2665
|
-
const
|
|
2666
|
-
let
|
|
2667
|
-
|
|
2668
|
-
const
|
|
2669
|
-
for (let
|
|
2670
|
-
const
|
|
2671
|
-
if (
|
|
2672
|
-
|
|
2673
|
-
else if (_)
|
|
2674
|
-
T[b + 9] = s[V];
|
|
2666
|
+
const B = a - C, H = this.instanceBuffer;
|
|
2667
|
+
let R = H.usedElemNum;
|
|
2668
|
+
H.resize(B * yt);
|
|
2669
|
+
const g = H.float32, S = H.uint32;
|
|
2670
|
+
for (let J = 0; J < B; J++) {
|
|
2671
|
+
const D = A ? a - 1 - C - J : C + J;
|
|
2672
|
+
if (g[R] = e[D], g[R + 1] = r[D], g[R + 2] = F ? k : k * o[D], g[R + 3] = W ? G : G * h[D], g[R + 4] = N ? I : i[D] + I, U)
|
|
2673
|
+
g[R + 5] = c, g[R + 6] = u, g[R + 7] = l, g[R + 8] = d;
|
|
2675
2674
|
else {
|
|
2676
|
-
const
|
|
2677
|
-
|
|
2675
|
+
const j = c[D], ct = u[D], ut = l[D], lt = d[D];
|
|
2676
|
+
g[R + 5] = j, g[R + 6] = ct, g[R + 7] = ut, g[R + 8] = lt, g[R + 2] *= lt - ct, g[R + 3] *= ut - j;
|
|
2678
2677
|
}
|
|
2679
|
-
|
|
2678
|
+
if (w)
|
|
2679
|
+
S[R + 9] = 4294967295;
|
|
2680
|
+
else if (X)
|
|
2681
|
+
S[R + 9] = s[D];
|
|
2682
|
+
else {
|
|
2683
|
+
const j = s[D];
|
|
2684
|
+
S[R + 9] = M ? j.premultipliedUint32 : j.uint32;
|
|
2685
|
+
}
|
|
2686
|
+
g[R + 10] = y, g[R + 11] = T, R += yt;
|
|
2680
2687
|
}
|
|
2681
|
-
|
|
2688
|
+
H.usedElemNum = R, H.makeDirty(), this.instanceCount += B, C += B;
|
|
2682
2689
|
}
|
|
2683
|
-
this.customMatrix =
|
|
2690
|
+
this.customMatrix = P, this.flush();
|
|
2684
2691
|
}
|
|
2685
2692
|
render() {
|
|
2686
2693
|
if (this.instanceCount === 0) return;
|
|
@@ -2689,12 +2696,12 @@ class ie extends at {
|
|
|
2689
2696
|
this.texture && (t.activeTexture(t.TEXTURE0), t.bindTexture(t.TEXTURE_2D, this.texture.glTexture));
|
|
2690
2697
|
const e = this.currentShader;
|
|
2691
2698
|
this.instanceBuffer.bindBuffer(), this.instanceBuffer.bufferData(), e.bindVAO();
|
|
2692
|
-
const r = this.rapid.matrixStack, s = this.rapid.matrix.getMatrix(this.customMatrix ?? r.curWorldM), a =
|
|
2693
|
-
this.currentShader.setUniform("u_projection", a),
|
|
2699
|
+
const r = this.rapid.matrixStack, s = this.rapid.matrix.getMatrix(this.customMatrix ?? r.curWorldM), a = jt(this.rapid.projection, s);
|
|
2700
|
+
this.currentShader.setUniform("u_projection", a), Mt(t, t.TRIANGLE_STRIP, 0, 4, this.instanceCount), this.rapid.drawcallCount++, this.texture = void 0, this.customMatrix = void 0;
|
|
2694
2701
|
}
|
|
2695
2702
|
}
|
|
2696
|
-
var
|
|
2697
|
-
class
|
|
2703
|
+
var oe = /* @__PURE__ */ ((n) => (n[n.EQUAL = 0] = "EQUAL", n[n.NOT_EQUAL = 1] = "NOT_EQUAL", n))(oe || {}), ce = /* @__PURE__ */ ((n) => (n[n.NORMAL = 0] = "NORMAL", n[n.ADD = 1] = "ADD", n[n.MULTIPLY = 2] = "MULTIPLY", n[n.SCREEN = 3] = "SCREEN", n[n.ERASE = 4] = "ERASE", n))(ce || {}), ht = /* @__PURE__ */ ((n) => (n[n.LINEAR = 0] = "LINEAR", n[n.NEAREST = 1] = "NEAREST", n))(ht || {}), ue = /* @__PURE__ */ ((n) => (n[n.CanvasItem = 0] = "CanvasItem", n[n.Viewport = 1] = "Viewport", n))(ue || {});
|
|
2704
|
+
class fe {
|
|
2698
2705
|
/** The active WebGL context. */
|
|
2699
2706
|
gl;
|
|
2700
2707
|
/** The target HTMLCanvasElement. */
|
|
@@ -2720,7 +2727,7 @@ class ce {
|
|
|
2720
2727
|
/** Maximum number of texture units supported by the device. */
|
|
2721
2728
|
maxTextureUnits = 0;
|
|
2722
2729
|
/** Matrix stack for hierarchical transformations. */
|
|
2723
|
-
matrixStack = new
|
|
2730
|
+
matrixStack = new Ct(this);
|
|
2724
2731
|
/** Direct access to the underlying matrix store. */
|
|
2725
2732
|
matrix;
|
|
2726
2733
|
/** Region dedicated to fast sprite rendering. */
|
|
@@ -2745,7 +2752,7 @@ class ce {
|
|
|
2745
2752
|
scaleMode;
|
|
2746
2753
|
/** Internal ping-pong RenderTextures for multi-filter chains. */
|
|
2747
2754
|
_filterRT = [null, null];
|
|
2748
|
-
_filterInput = new
|
|
2755
|
+
_filterInput = new O();
|
|
2749
2756
|
get height() {
|
|
2750
2757
|
return this.logicHeight;
|
|
2751
2758
|
}
|
|
@@ -2758,10 +2765,10 @@ class ce {
|
|
|
2758
2765
|
*/
|
|
2759
2766
|
constructor(t) {
|
|
2760
2767
|
this.canvas = t.canvas, this.dpr = window.devicePixelRatio || 1, this.antialias = t.antialias ?? !1, this.textureFilter = t.textureFilter ?? 1, this.premultipliedAlpha = t.premultipliedAlpha ?? !0, this.roundPixels = t.roundPixels ?? !1, this.scaleMode = t.scaleMode ?? 0;
|
|
2761
|
-
const e =
|
|
2762
|
-
this.gl = e, this.maxTextureUnits = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS), this.matrix = this.matrixStack.matrix, this.spriteRegion = new
|
|
2768
|
+
const e = It(this.canvas, this.antialias, this.premultipliedAlpha);
|
|
2769
|
+
this.gl = e, this.maxTextureUnits = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS), this.matrix = this.matrixStack.matrix, this.spriteRegion = new ot(this), this.graphicRegion = new Xt(this), this.atlasSpriteRegion = new ae(this), this.particleRegion = new he(this);
|
|
2763
2770
|
const r = this.canvas.clientWidth || this.canvas.width, i = this.canvas.clientHeight || this.canvas.height;
|
|
2764
|
-
this.physicsWidth = t.physicsWidth || Math.round(r * this.dpr), this.physicsHeight = t.physicsHeight || Math.round(i * this.dpr), this.logicWidth = t.logicWidth || t.width || this.physicsWidth / this.dpr, this.logicHeight = t.logicHeight || t.height || this.physicsHeight / this.dpr, this.resize(this.logicWidth, this.logicHeight, this.physicsWidth, this.physicsHeight), this.texture = new
|
|
2771
|
+
this.physicsWidth = t.physicsWidth || Math.round(r * this.dpr), this.physicsHeight = t.physicsHeight || Math.round(i * this.dpr), this.logicWidth = t.logicWidth || t.width || this.physicsWidth / this.dpr, this.logicHeight = t.logicHeight || t.height || this.physicsHeight / this.dpr, this.resize(this.logicWidth, this.logicHeight, this.physicsWidth, this.physicsHeight), this.texture = new _t(this), t.backgroundColor && (this.backgroundColor = t.backgroundColor), e.enable(e.BLEND), this.premultipliedAlpha ? e.blendFunc(e.ONE, e.ONE_MINUS_SRC_ALPHA) : e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA), e.enable(e.STENCIL_TEST), e.stencilFunc(e.ALWAYS, 1, 255), e.stencilOp(e.KEEP, e.KEEP, e.KEEP);
|
|
2765
2772
|
}
|
|
2766
2773
|
setTextureFilter(t) {
|
|
2767
2774
|
this.textureFilter = t;
|
|
@@ -2770,7 +2777,7 @@ class ce {
|
|
|
2770
2777
|
this.antialias = t;
|
|
2771
2778
|
}
|
|
2772
2779
|
getColorUint32(t) {
|
|
2773
|
-
return
|
|
2780
|
+
return Zt(this.premultipliedAlpha, t);
|
|
2774
2781
|
}
|
|
2775
2782
|
/**
|
|
2776
2783
|
* Enters a specific rendering region, flushing the previous one if necessary.
|
|
@@ -2781,22 +2788,22 @@ class ce {
|
|
|
2781
2788
|
this.currentRegion === t && this.currentRegion.isSameShader(e) || (this.flush(), this.currentRegion = t, t.enter(e));
|
|
2782
2789
|
}
|
|
2783
2790
|
drawParticles(t) {
|
|
2784
|
-
|
|
2791
|
+
ee(this, t);
|
|
2785
2792
|
}
|
|
2786
2793
|
drawSprite(t) {
|
|
2787
|
-
|
|
2794
|
+
te(this, t);
|
|
2788
2795
|
}
|
|
2789
2796
|
drawLine(t) {
|
|
2790
|
-
|
|
2797
|
+
re(this, t);
|
|
2791
2798
|
}
|
|
2792
2799
|
drawGraphic(t) {
|
|
2793
|
-
|
|
2800
|
+
St(this, t);
|
|
2794
2801
|
}
|
|
2795
2802
|
drawRect(t) {
|
|
2796
|
-
|
|
2803
|
+
se(this, t);
|
|
2797
2804
|
}
|
|
2798
2805
|
drawCircle(t) {
|
|
2799
|
-
|
|
2806
|
+
ne(this, t);
|
|
2800
2807
|
}
|
|
2801
2808
|
/**
|
|
2802
2809
|
* Starts rendering arbitrary graphics geometries.
|
|
@@ -2820,7 +2827,7 @@ class ce {
|
|
|
2820
2827
|
* @param texture The texture to be used as a mask.
|
|
2821
2828
|
*/
|
|
2822
2829
|
drawMaskImage(t) {
|
|
2823
|
-
|
|
2830
|
+
ie(this, t);
|
|
2824
2831
|
}
|
|
2825
2832
|
/**
|
|
2826
2833
|
* Pushes vertices for a rectangle geometry. Should be enclosed by startGraphic and endGraphic.
|
|
@@ -3176,7 +3183,7 @@ class ce {
|
|
|
3176
3183
|
endScissor() {
|
|
3177
3184
|
this.flush(), this.gl.disable(this.gl.SCISSOR_TEST);
|
|
3178
3185
|
}
|
|
3179
|
-
|
|
3186
|
+
applyCamera(t) {
|
|
3180
3187
|
this.matrixStack.applyTransform(t);
|
|
3181
3188
|
const e = this.matrixStack.curWorldM;
|
|
3182
3189
|
this.matrix.invert(e);
|
|
@@ -3216,10 +3223,10 @@ class ce {
|
|
|
3216
3223
|
return this.matrix.toCSSMatrix(t ?? this.matrixStack.curWorldM, e, r);
|
|
3217
3224
|
}
|
|
3218
3225
|
}
|
|
3219
|
-
function
|
|
3226
|
+
function le(n) {
|
|
3220
3227
|
return !(n === null || typeof n != "object" || Array.isArray(n) || n instanceof p || n instanceof x);
|
|
3221
3228
|
}
|
|
3222
|
-
class
|
|
3229
|
+
class L {
|
|
3223
3230
|
/** Random float in [min, max). */
|
|
3224
3231
|
static float(t, e) {
|
|
3225
3232
|
return Math.random() * (e - t) + t;
|
|
@@ -3234,20 +3241,20 @@ class W {
|
|
|
3234
3241
|
}
|
|
3235
3242
|
/** Random Vec2 with components in the supplied per-axis ranges. */
|
|
3236
3243
|
static vector(t, e, r, i) {
|
|
3237
|
-
return new p(
|
|
3244
|
+
return new p(L.float(t, e), L.float(r, i));
|
|
3238
3245
|
}
|
|
3239
3246
|
/** Random Color with each component interpolated between minColor and maxColor. */
|
|
3240
3247
|
static randomColor(t, e) {
|
|
3241
3248
|
return new x(
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3249
|
+
L.float(t.r, e.r),
|
|
3250
|
+
L.float(t.g, e.g),
|
|
3251
|
+
L.float(t.b, e.b),
|
|
3252
|
+
L.float(t.a, e.a)
|
|
3246
3253
|
);
|
|
3247
3254
|
}
|
|
3248
3255
|
/** Pick a random element from an array with uniform probability. */
|
|
3249
3256
|
static pick(t) {
|
|
3250
|
-
return t[
|
|
3257
|
+
return t[L.int(0, t.length - 1)];
|
|
3251
3258
|
}
|
|
3252
3259
|
/**
|
|
3253
3260
|
* Pick a random element using weighted probability.
|
|
@@ -3273,26 +3280,26 @@ class W {
|
|
|
3273
3280
|
if (Array.isArray(t)) {
|
|
3274
3281
|
const [r, i] = t;
|
|
3275
3282
|
if (typeof r == "number")
|
|
3276
|
-
return
|
|
3283
|
+
return L.float(r, i);
|
|
3277
3284
|
if (r instanceof p)
|
|
3278
|
-
return
|
|
3285
|
+
return L.vector(r.x, i.x, r.y, i.y);
|
|
3279
3286
|
if (r instanceof x)
|
|
3280
|
-
return
|
|
3287
|
+
return L.randomColor(r, i);
|
|
3281
3288
|
}
|
|
3282
3289
|
return typeof t == "number" ? t : t.clone();
|
|
3283
3290
|
}
|
|
3284
3291
|
}
|
|
3285
|
-
var
|
|
3286
|
-
const
|
|
3287
|
-
class
|
|
3292
|
+
var de = /* @__PURE__ */ ((n) => (n.POINT = "point", n.CIRCLE = "circle", n.RECT = "rect", n))(de || {});
|
|
3293
|
+
const Tt = 10, Et = 0, Rt = !0;
|
|
3294
|
+
class q {
|
|
3288
3295
|
components;
|
|
3289
3296
|
constructor(t = 1) {
|
|
3290
3297
|
if (!Number.isInteger(t) || t <= 0)
|
|
3291
3298
|
throw new RangeError("ParticleAttributeStore size must be a positive integer");
|
|
3292
3299
|
this.components = Array.from({ length: t }, () => ({
|
|
3293
|
-
value: new
|
|
3294
|
-
delta: new
|
|
3295
|
-
damping: new
|
|
3300
|
+
value: new _(b.Float32),
|
|
3301
|
+
delta: new _(b.Float32),
|
|
3302
|
+
damping: new _(b.Float32)
|
|
3296
3303
|
}));
|
|
3297
3304
|
}
|
|
3298
3305
|
getArrayBuffer() {
|
|
@@ -3325,13 +3332,13 @@ class K {
|
|
|
3325
3332
|
}
|
|
3326
3333
|
}
|
|
3327
3334
|
resolveComponent(t, e, r) {
|
|
3328
|
-
return t === void 0 ? r : Array.isArray(t) ?
|
|
3335
|
+
return t === void 0 ? r : Array.isArray(t) ? L.float(
|
|
3329
3336
|
this.getComponent(t[0], e),
|
|
3330
3337
|
this.getComponent(t[1], e)
|
|
3331
3338
|
) : this.getComponent(t, e);
|
|
3332
3339
|
}
|
|
3333
3340
|
create(t, e, r = 1) {
|
|
3334
|
-
const i =
|
|
3341
|
+
const i = le(t) ? t : void 0, s = i === void 0 ? t : void 0, a = r > 0 ? r : 1;
|
|
3335
3342
|
let o = 0;
|
|
3336
3343
|
for (let h = 0; h < this.components.length; h++) {
|
|
3337
3344
|
const { value: c, delta: u, damping: l } = this.components[h], d = this.getComponent(e, h), f = s === void 0 ? this.resolveComponent(i?.start, h, d) : this.getComponent(s, h), m = i?.end === void 0 ? f : this.resolveComponent(i.end, h, d);
|
|
@@ -3340,28 +3347,28 @@ class K {
|
|
|
3340
3347
|
return o;
|
|
3341
3348
|
}
|
|
3342
3349
|
}
|
|
3343
|
-
class
|
|
3350
|
+
class bt {
|
|
3344
3351
|
options;
|
|
3345
3352
|
emitting = !1;
|
|
3346
3353
|
emitTimer = 0;
|
|
3347
|
-
emitRate =
|
|
3348
|
-
emitTime =
|
|
3354
|
+
emitRate = Tt;
|
|
3355
|
+
emitTime = Et;
|
|
3349
3356
|
emitTimeCounter = 0;
|
|
3350
3357
|
/** Whether spawned particles are positioned in local emitter space (default: true). */
|
|
3351
|
-
localSpace =
|
|
3358
|
+
localSpace = Rt;
|
|
3352
3359
|
rapid;
|
|
3353
|
-
x = new
|
|
3354
|
-
y = new
|
|
3355
|
-
scaleX = new
|
|
3356
|
-
scaleY = new
|
|
3357
|
-
rotation = new
|
|
3358
|
-
color = new
|
|
3360
|
+
x = new _(b.Float32);
|
|
3361
|
+
y = new _(b.Float32);
|
|
3362
|
+
scaleX = new _(b.Float32);
|
|
3363
|
+
scaleY = new _(b.Float32);
|
|
3364
|
+
rotation = new _(b.Float32);
|
|
3365
|
+
color = new _(b.Uint32);
|
|
3359
3366
|
animations = {
|
|
3360
|
-
speed: new
|
|
3361
|
-
rotation: new
|
|
3362
|
-
scale: new
|
|
3363
|
-
color: new
|
|
3364
|
-
velocity: new
|
|
3367
|
+
speed: new q(),
|
|
3368
|
+
rotation: new q(),
|
|
3369
|
+
scale: new q(),
|
|
3370
|
+
color: new q(4),
|
|
3371
|
+
velocity: new q(2)
|
|
3365
3372
|
};
|
|
3366
3373
|
count = 0;
|
|
3367
3374
|
/**
|
|
@@ -3370,7 +3377,7 @@ class wt {
|
|
|
3370
3377
|
* @param options - Emitter configuration options
|
|
3371
3378
|
*/
|
|
3372
3379
|
constructor(t, e) {
|
|
3373
|
-
this.rapid = t, this.options = e, this.emitRate = e.emitRate ??
|
|
3380
|
+
this.rapid = t, this.options = e, this.emitRate = e.emitRate ?? Tt, this.emitTime = e.emitTime ?? Et, this.localSpace = e.localSpace ?? Rt;
|
|
3374
3381
|
}
|
|
3375
3382
|
getAllArrayBuffer() {
|
|
3376
3383
|
return [
|
|
@@ -3392,7 +3399,7 @@ class wt {
|
|
|
3392
3399
|
* Particle state is NOT copied.
|
|
3393
3400
|
*/
|
|
3394
3401
|
clone() {
|
|
3395
|
-
return new
|
|
3402
|
+
return new bt(this.rapid, { ...this.options });
|
|
3396
3403
|
}
|
|
3397
3404
|
/** Sets particles-per-second emission rate (continuous mode). */
|
|
3398
3405
|
setEmitRate(t) {
|
|
@@ -3426,7 +3433,7 @@ class wt {
|
|
|
3426
3433
|
this.createParticle();
|
|
3427
3434
|
}
|
|
3428
3435
|
createParticle() {
|
|
3429
|
-
const t =
|
|
3436
|
+
const t = L.scalarOrRange(this.options.life, 1);
|
|
3430
3437
|
let e = 0, r = 0;
|
|
3431
3438
|
switch (this.options.emitShape) {
|
|
3432
3439
|
case "circle": {
|
|
@@ -3472,7 +3479,7 @@ class wt {
|
|
|
3472
3479
|
r > 0 && (this.emit(r), this.emitTimer -= r / this.emitRate);
|
|
3473
3480
|
}
|
|
3474
3481
|
const e = this.updateParticle(t);
|
|
3475
|
-
this.count -= e.length,
|
|
3482
|
+
this.count -= e.length, _.removeAtIndices(e, this.getAllArrayBuffer());
|
|
3476
3483
|
}
|
|
3477
3484
|
updateParticle(t) {
|
|
3478
3485
|
const e = [], r = this.animations;
|
|
@@ -3523,41 +3530,41 @@ class wt {
|
|
|
3523
3530
|
}
|
|
3524
3531
|
}
|
|
3525
3532
|
export {
|
|
3526
|
-
|
|
3533
|
+
b as ArrayType,
|
|
3527
3534
|
z as BaseTexture,
|
|
3528
|
-
|
|
3529
|
-
|
|
3535
|
+
ce as BlendMode,
|
|
3536
|
+
ue as CanvasScaleMode,
|
|
3530
3537
|
x as Color,
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3538
|
+
ft as CustomGlShader,
|
|
3539
|
+
_ as DynamicArrayBuffer,
|
|
3540
|
+
wt as GLShader,
|
|
3541
|
+
Xt as GraphicRegion,
|
|
3542
|
+
Kt as LineTextureMode,
|
|
3543
|
+
oe as MaskType,
|
|
3544
|
+
Ct as MatrixStack,
|
|
3545
|
+
Ut as MatrixStore,
|
|
3546
|
+
bt as ParticleEmitter,
|
|
3547
|
+
de as ParticleShape,
|
|
3548
|
+
Gt as QUAD_VERTICES,
|
|
3549
|
+
fe as Rapid,
|
|
3550
|
+
At as Region,
|
|
3551
|
+
Pt as RenderTexture,
|
|
3552
|
+
ot as SpriteRegion,
|
|
3553
|
+
Lt as TextTexture,
|
|
3554
|
+
O as Texture,
|
|
3555
|
+
ht as TextureFilterMode,
|
|
3556
|
+
_t as TextureManager,
|
|
3557
|
+
Q as TextureWrapMode,
|
|
3551
3558
|
p as Vec2,
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3559
|
+
it as WebglBufferArray,
|
|
3560
|
+
jt as composeProjectionWithAffine,
|
|
3561
|
+
ne as drawCircle,
|
|
3562
|
+
St as drawGraphic,
|
|
3563
|
+
re as drawLine,
|
|
3564
|
+
ie as drawMaskImage,
|
|
3565
|
+
ee as drawParticles,
|
|
3566
|
+
se as drawRect,
|
|
3567
|
+
te as drawSprite,
|
|
3568
|
+
Zt as getColorUint32,
|
|
3569
|
+
$t as multiplyMat4
|
|
3563
3570
|
};
|