mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
[threejs] Closes #1412, added dispose() method to SkeletonMesh and required underlying code.
This commit is contained in:
parent
4a357f23f2
commit
2b5e521c34
2
spine-ts/build/spine-all.d.ts
vendored
2
spine-ts/build/spine-all.d.ts
vendored
@ -1807,6 +1807,7 @@ declare module spine.threejs {
|
|||||||
private indices;
|
private indices;
|
||||||
private indicesLength;
|
private indicesLength;
|
||||||
constructor(maxVertices?: number);
|
constructor(maxVertices?: number);
|
||||||
|
dispose(): void;
|
||||||
clear(): void;
|
clear(): void;
|
||||||
begin(): void;
|
begin(): void;
|
||||||
canBatch(verticesLength: number, indicesLength: number): boolean;
|
canBatch(verticesLength: number, indicesLength: number): boolean;
|
||||||
@ -1836,6 +1837,7 @@ declare module spine.threejs {
|
|||||||
private tempColor;
|
private tempColor;
|
||||||
constructor(skeletonData: SkeletonData);
|
constructor(skeletonData: SkeletonData);
|
||||||
update(deltaTime: number): void;
|
update(deltaTime: number): void;
|
||||||
|
dispose(): void;
|
||||||
private clearBatches();
|
private clearBatches();
|
||||||
private nextBatch();
|
private nextBatch();
|
||||||
private updateGeometry();
|
private updateGeometry();
|
||||||
|
|||||||
@ -11048,6 +11048,10 @@ var spine;
|
|||||||
_this.material = new threejs.SkeletonMeshMaterial();
|
_this.material = new threejs.SkeletonMeshMaterial();
|
||||||
return _this;
|
return _this;
|
||||||
}
|
}
|
||||||
|
MeshBatcher.prototype.dispose = function () {
|
||||||
|
this.geometry.dispose();
|
||||||
|
this.material.dispose();
|
||||||
|
};
|
||||||
MeshBatcher.prototype.clear = function () {
|
MeshBatcher.prototype.clear = function () {
|
||||||
var geo = this.geometry;
|
var geo = this.geometry;
|
||||||
geo.drawRange.start = 0;
|
geo.drawRange.start = 0;
|
||||||
@ -11159,6 +11163,11 @@ var spine;
|
|||||||
skeleton.updateWorldTransform();
|
skeleton.updateWorldTransform();
|
||||||
this.updateGeometry();
|
this.updateGeometry();
|
||||||
};
|
};
|
||||||
|
SkeletonMesh.prototype.dispose = function () {
|
||||||
|
for (var i = 0; i < this.batches.length; i++) {
|
||||||
|
this.batches[i].dispose();
|
||||||
|
}
|
||||||
|
};
|
||||||
SkeletonMesh.prototype.clearBatches = function () {
|
SkeletonMesh.prototype.clearBatches = function () {
|
||||||
for (var i = 0; i < this.batches.length; i++) {
|
for (var i = 0; i < this.batches.length; i++) {
|
||||||
this.batches[i].clear();
|
this.batches[i].clear();
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
2
spine-ts/build/spine-threejs.d.ts
vendored
2
spine-ts/build/spine-threejs.d.ts
vendored
@ -1341,6 +1341,7 @@ declare module spine.threejs {
|
|||||||
private indices;
|
private indices;
|
||||||
private indicesLength;
|
private indicesLength;
|
||||||
constructor(maxVertices?: number);
|
constructor(maxVertices?: number);
|
||||||
|
dispose(): void;
|
||||||
clear(): void;
|
clear(): void;
|
||||||
begin(): void;
|
begin(): void;
|
||||||
canBatch(verticesLength: number, indicesLength: number): boolean;
|
canBatch(verticesLength: number, indicesLength: number): boolean;
|
||||||
@ -1370,6 +1371,7 @@ declare module spine.threejs {
|
|||||||
private tempColor;
|
private tempColor;
|
||||||
constructor(skeletonData: SkeletonData);
|
constructor(skeletonData: SkeletonData);
|
||||||
update(deltaTime: number): void;
|
update(deltaTime: number): void;
|
||||||
|
dispose(): void;
|
||||||
private clearBatches();
|
private clearBatches();
|
||||||
private nextBatch();
|
private nextBatch();
|
||||||
private updateGeometry();
|
private updateGeometry();
|
||||||
|
|||||||
@ -8166,6 +8166,10 @@ var spine;
|
|||||||
_this.material = new threejs.SkeletonMeshMaterial();
|
_this.material = new threejs.SkeletonMeshMaterial();
|
||||||
return _this;
|
return _this;
|
||||||
}
|
}
|
||||||
|
MeshBatcher.prototype.dispose = function () {
|
||||||
|
this.geometry.dispose();
|
||||||
|
this.material.dispose();
|
||||||
|
};
|
||||||
MeshBatcher.prototype.clear = function () {
|
MeshBatcher.prototype.clear = function () {
|
||||||
var geo = this.geometry;
|
var geo = this.geometry;
|
||||||
geo.drawRange.start = 0;
|
geo.drawRange.start = 0;
|
||||||
@ -8277,6 +8281,11 @@ var spine;
|
|||||||
skeleton.updateWorldTransform();
|
skeleton.updateWorldTransform();
|
||||||
this.updateGeometry();
|
this.updateGeometry();
|
||||||
};
|
};
|
||||||
|
SkeletonMesh.prototype.dispose = function () {
|
||||||
|
for (var i = 0; i < this.batches.length; i++) {
|
||||||
|
this.batches[i].dispose();
|
||||||
|
}
|
||||||
|
};
|
||||||
SkeletonMesh.prototype.clearBatches = function () {
|
SkeletonMesh.prototype.clearBatches = function () {
|
||||||
for (var i = 0; i < this.batches.length; i++) {
|
for (var i = 0; i < this.batches.length; i++) {
|
||||||
this.batches[i].clear();
|
this.batches[i].clear();
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -2,7 +2,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>spine-threejs</title>
|
<title>spine-threejs</title>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r79/three.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/106/three.min.js"></script>
|
||||||
<script src="../../build/spine-threejs.js"></script>
|
<script src="../../build/spine-threejs.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@ -55,6 +55,11 @@ module spine.threejs {
|
|||||||
this.material = new SkeletonMeshMaterial();
|
this.material = new SkeletonMeshMaterial();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dispose () {
|
||||||
|
this.geometry.dispose();
|
||||||
|
this.material.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
clear () {
|
clear () {
|
||||||
let geo = (<THREE.BufferGeometry>this.geometry);
|
let geo = (<THREE.BufferGeometry>this.geometry);
|
||||||
geo.drawRange.start = 0;
|
geo.drawRange.start = 0;
|
||||||
|
|||||||
@ -102,6 +102,12 @@ module spine.threejs {
|
|||||||
this.updateGeometry();
|
this.updateGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dispose () {
|
||||||
|
for (var i = 0; i < this.batches.length; i++) {
|
||||||
|
this.batches[i].dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private clearBatches () {
|
private clearBatches () {
|
||||||
for (var i = 0; i < this.batches.length; i++) {
|
for (var i = 0; i < this.batches.length; i++) {
|
||||||
this.batches[i].clear();
|
this.batches[i].clear();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user