mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
Ensure array size passed to draw mesh.
This commit is contained in:
parent
3ef4c024f2
commit
4225edeede
@ -167,8 +167,14 @@ class SpineC3Instance extends globalThis.ISDKWorldInstanceBase {
|
|||||||
while (command) {
|
while (command) {
|
||||||
const { numVertices, positions, uvs, colors, indices, numIndices, blendMode } = command;
|
const { numVertices, positions, uvs, colors, indices, numIndices, blendMode } = command;
|
||||||
|
|
||||||
const vertices = this.tempVertices;
|
const vertices = this.tempVertices.length < numVertices * 3
|
||||||
const c3colors = this.tempColors;
|
? (this.tempVertices = new Float32Array(numVertices * 3))
|
||||||
|
: this.tempVertices;
|
||||||
|
|
||||||
|
const c3colors = this.tempColors.length < numVertices * 4
|
||||||
|
? (this.tempColors = new Float32Array(numVertices * 4))
|
||||||
|
: this.tempColors;
|
||||||
|
|
||||||
for (let i = 0; i < numVertices; i++) {
|
for (let i = 0; i < numVertices; i++) {
|
||||||
const srcIndex = i * 2;
|
const srcIndex = i * 2;
|
||||||
const { x, y } = this.skeletonToC3WorldCoordinates(positions[srcIndex], positions[srcIndex + 1]);
|
const { x, y } = this.skeletonToC3WorldCoordinates(positions[srcIndex], positions[srcIndex + 1]);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user