mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-19 16:26:40 +08:00
[ts] Fixed memory leak in Triangulator. Added coin example to WebGL test
This commit is contained in:
parent
a97d18aafd
commit
fdf6aba634
@ -5460,6 +5460,10 @@ var spine;
|
|||||||
convexPolygons.push(polygon);
|
convexPolygons.push(polygon);
|
||||||
convexPolygonsIndices.push(polygonIndices);
|
convexPolygonsIndices.push(polygonIndices);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
this.polygonPool.free(polygon);
|
||||||
|
this.polygonIndicesPool.free(polygonIndices);
|
||||||
|
}
|
||||||
polygon = this.polygonPool.obtain();
|
polygon = this.polygonPool.obtain();
|
||||||
polygon.length = 0;
|
polygon.length = 0;
|
||||||
polygon.push(x1);
|
polygon.push(x1);
|
||||||
@ -5528,6 +5532,9 @@ var spine;
|
|||||||
if (polygon.length == 0) {
|
if (polygon.length == 0) {
|
||||||
convexPolygons.splice(i, 1);
|
convexPolygons.splice(i, 1);
|
||||||
this.polygonPool.free(polygon);
|
this.polygonPool.free(polygon);
|
||||||
|
polygonIndices = convexPolygonsIndices[i];
|
||||||
|
convexPolygonsIndices.splice(i, 1);
|
||||||
|
this.polygonIndicesPool.free(polygonIndices);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return convexPolygons;
|
return convexPolygons;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -5460,6 +5460,10 @@ var spine;
|
|||||||
convexPolygons.push(polygon);
|
convexPolygons.push(polygon);
|
||||||
convexPolygonsIndices.push(polygonIndices);
|
convexPolygonsIndices.push(polygonIndices);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
this.polygonPool.free(polygon);
|
||||||
|
this.polygonIndicesPool.free(polygonIndices);
|
||||||
|
}
|
||||||
polygon = this.polygonPool.obtain();
|
polygon = this.polygonPool.obtain();
|
||||||
polygon.length = 0;
|
polygon.length = 0;
|
||||||
polygon.push(x1);
|
polygon.push(x1);
|
||||||
@ -5528,6 +5532,9 @@ var spine;
|
|||||||
if (polygon.length == 0) {
|
if (polygon.length == 0) {
|
||||||
convexPolygons.splice(i, 1);
|
convexPolygons.splice(i, 1);
|
||||||
this.polygonPool.free(polygon);
|
this.polygonPool.free(polygon);
|
||||||
|
polygonIndices = convexPolygonsIndices[i];
|
||||||
|
convexPolygonsIndices.splice(i, 1);
|
||||||
|
this.polygonIndicesPool.free(polygonIndices);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return convexPolygons;
|
return convexPolygons;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -5460,6 +5460,10 @@ var spine;
|
|||||||
convexPolygons.push(polygon);
|
convexPolygons.push(polygon);
|
||||||
convexPolygonsIndices.push(polygonIndices);
|
convexPolygonsIndices.push(polygonIndices);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
this.polygonPool.free(polygon);
|
||||||
|
this.polygonIndicesPool.free(polygonIndices);
|
||||||
|
}
|
||||||
polygon = this.polygonPool.obtain();
|
polygon = this.polygonPool.obtain();
|
||||||
polygon.length = 0;
|
polygon.length = 0;
|
||||||
polygon.push(x1);
|
polygon.push(x1);
|
||||||
@ -5528,6 +5532,9 @@ var spine;
|
|||||||
if (polygon.length == 0) {
|
if (polygon.length == 0) {
|
||||||
convexPolygons.splice(i, 1);
|
convexPolygons.splice(i, 1);
|
||||||
this.polygonPool.free(polygon);
|
this.polygonPool.free(polygon);
|
||||||
|
polygonIndices = convexPolygonsIndices[i];
|
||||||
|
convexPolygonsIndices.splice(i, 1);
|
||||||
|
this.polygonIndicesPool.free(polygonIndices);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return convexPolygons;
|
return convexPolygons;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -5460,6 +5460,10 @@ var spine;
|
|||||||
convexPolygons.push(polygon);
|
convexPolygons.push(polygon);
|
||||||
convexPolygonsIndices.push(polygonIndices);
|
convexPolygonsIndices.push(polygonIndices);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
this.polygonPool.free(polygon);
|
||||||
|
this.polygonIndicesPool.free(polygonIndices);
|
||||||
|
}
|
||||||
polygon = this.polygonPool.obtain();
|
polygon = this.polygonPool.obtain();
|
||||||
polygon.length = 0;
|
polygon.length = 0;
|
||||||
polygon.push(x1);
|
polygon.push(x1);
|
||||||
@ -5528,6 +5532,9 @@ var spine;
|
|||||||
if (polygon.length == 0) {
|
if (polygon.length == 0) {
|
||||||
convexPolygons.splice(i, 1);
|
convexPolygons.splice(i, 1);
|
||||||
this.polygonPool.free(polygon);
|
this.polygonPool.free(polygon);
|
||||||
|
polygonIndices = convexPolygonsIndices[i];
|
||||||
|
convexPolygonsIndices.splice(i, 1);
|
||||||
|
this.polygonIndicesPool.free(polygonIndices);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return convexPolygons;
|
return convexPolygons;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -5460,6 +5460,10 @@ var spine;
|
|||||||
convexPolygons.push(polygon);
|
convexPolygons.push(polygon);
|
||||||
convexPolygonsIndices.push(polygonIndices);
|
convexPolygonsIndices.push(polygonIndices);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
this.polygonPool.free(polygon);
|
||||||
|
this.polygonIndicesPool.free(polygonIndices);
|
||||||
|
}
|
||||||
polygon = this.polygonPool.obtain();
|
polygon = this.polygonPool.obtain();
|
||||||
polygon.length = 0;
|
polygon.length = 0;
|
||||||
polygon.push(x1);
|
polygon.push(x1);
|
||||||
@ -5528,6 +5532,9 @@ var spine;
|
|||||||
if (polygon.length == 0) {
|
if (polygon.length == 0) {
|
||||||
convexPolygons.splice(i, 1);
|
convexPolygons.splice(i, 1);
|
||||||
this.polygonPool.free(polygon);
|
this.polygonPool.free(polygon);
|
||||||
|
polygonIndices = convexPolygonsIndices[i];
|
||||||
|
convexPolygonsIndices.splice(i, 1);
|
||||||
|
this.polygonIndicesPool.free(polygonIndices);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return convexPolygons;
|
return convexPolygons;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -5460,6 +5460,10 @@ var spine;
|
|||||||
convexPolygons.push(polygon);
|
convexPolygons.push(polygon);
|
||||||
convexPolygonsIndices.push(polygonIndices);
|
convexPolygonsIndices.push(polygonIndices);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
this.polygonPool.free(polygon);
|
||||||
|
this.polygonIndicesPool.free(polygonIndices);
|
||||||
|
}
|
||||||
polygon = this.polygonPool.obtain();
|
polygon = this.polygonPool.obtain();
|
||||||
polygon.length = 0;
|
polygon.length = 0;
|
||||||
polygon.push(x1);
|
polygon.push(x1);
|
||||||
@ -5528,6 +5532,9 @@ var spine;
|
|||||||
if (polygon.length == 0) {
|
if (polygon.length == 0) {
|
||||||
convexPolygons.splice(i, 1);
|
convexPolygons.splice(i, 1);
|
||||||
this.polygonPool.free(polygon);
|
this.polygonPool.free(polygon);
|
||||||
|
polygonIndices = convexPolygonsIndices[i];
|
||||||
|
convexPolygonsIndices.splice(i, 1);
|
||||||
|
this.polygonIndicesPool.free(polygonIndices);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return convexPolygons;
|
return convexPolygons;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -164,6 +164,9 @@ module spine {
|
|||||||
if (polygon.length > 0) {
|
if (polygon.length > 0) {
|
||||||
convexPolygons.push(polygon);
|
convexPolygons.push(polygon);
|
||||||
convexPolygonsIndices.push(polygonIndices);
|
convexPolygonsIndices.push(polygonIndices);
|
||||||
|
} else {
|
||||||
|
this.polygonPool.free(polygon)
|
||||||
|
this.polygonIndicesPool.free(polygonIndices);
|
||||||
}
|
}
|
||||||
polygon = this.polygonPool.obtain();
|
polygon = this.polygonPool.obtain();
|
||||||
polygon.length = 0;
|
polygon.length = 0;
|
||||||
@ -238,6 +241,9 @@ module spine {
|
|||||||
if (polygon.length == 0) {
|
if (polygon.length == 0) {
|
||||||
convexPolygons.splice(i, 1);
|
convexPolygons.splice(i, 1);
|
||||||
this.polygonPool.free(polygon);
|
this.polygonPool.free(polygon);
|
||||||
|
polygonIndices = convexPolygonsIndices[i]
|
||||||
|
convexPolygonsIndices.splice(i, 1)
|
||||||
|
this.polygonIndicesPool.free(polygonIndices);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -79,6 +79,9 @@ function init () {
|
|||||||
assetManager.loadText("assets/stretchyman.json");
|
assetManager.loadText("assets/stretchyman.json");
|
||||||
assetManager.loadText("assets/stretchyman.atlas");
|
assetManager.loadText("assets/stretchyman.atlas");
|
||||||
assetManager.loadTexture("assets/stretchyman.png");
|
assetManager.loadTexture("assets/stretchyman.png");
|
||||||
|
assetManager.loadText("assets/coin.json");
|
||||||
|
assetManager.loadText("assets/coin.atlas");
|
||||||
|
assetManager.loadTexture("assets/coin.png");
|
||||||
requestAnimationFrame(load);
|
requestAnimationFrame(load);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,6 +94,7 @@ function load () {
|
|||||||
skeletons["goblins"] = loadSkeleton("goblins-mesh", "walk", false, "goblin");
|
skeletons["goblins"] = loadSkeleton("goblins-mesh", "walk", false, "goblin");
|
||||||
skeletons["vine"] = loadSkeleton("vine", "animation", false);
|
skeletons["vine"] = loadSkeleton("vine", "animation", false);
|
||||||
skeletons["stretchyman"] = loadSkeleton("stretchyman", "sneak", false);
|
skeletons["stretchyman"] = loadSkeleton("stretchyman", "sneak", false);
|
||||||
|
skeletons["coin"] = loadSkeleton("coin", "rotate", false);
|
||||||
setupUI();
|
setupUI();
|
||||||
requestAnimationFrame(render);
|
requestAnimationFrame(render);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user