mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 23:34:53 +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);
|
||||
convexPolygonsIndices.push(polygonIndices);
|
||||
}
|
||||
else {
|
||||
this.polygonPool.free(polygon);
|
||||
this.polygonIndicesPool.free(polygonIndices);
|
||||
}
|
||||
polygon = this.polygonPool.obtain();
|
||||
polygon.length = 0;
|
||||
polygon.push(x1);
|
||||
@ -5528,6 +5532,9 @@ var spine;
|
||||
if (polygon.length == 0) {
|
||||
convexPolygons.splice(i, 1);
|
||||
this.polygonPool.free(polygon);
|
||||
polygonIndices = convexPolygonsIndices[i];
|
||||
convexPolygonsIndices.splice(i, 1);
|
||||
this.polygonIndicesPool.free(polygonIndices);
|
||||
}
|
||||
}
|
||||
return convexPolygons;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -5460,6 +5460,10 @@ var spine;
|
||||
convexPolygons.push(polygon);
|
||||
convexPolygonsIndices.push(polygonIndices);
|
||||
}
|
||||
else {
|
||||
this.polygonPool.free(polygon);
|
||||
this.polygonIndicesPool.free(polygonIndices);
|
||||
}
|
||||
polygon = this.polygonPool.obtain();
|
||||
polygon.length = 0;
|
||||
polygon.push(x1);
|
||||
@ -5528,6 +5532,9 @@ var spine;
|
||||
if (polygon.length == 0) {
|
||||
convexPolygons.splice(i, 1);
|
||||
this.polygonPool.free(polygon);
|
||||
polygonIndices = convexPolygonsIndices[i];
|
||||
convexPolygonsIndices.splice(i, 1);
|
||||
this.polygonIndicesPool.free(polygonIndices);
|
||||
}
|
||||
}
|
||||
return convexPolygons;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -5460,6 +5460,10 @@ var spine;
|
||||
convexPolygons.push(polygon);
|
||||
convexPolygonsIndices.push(polygonIndices);
|
||||
}
|
||||
else {
|
||||
this.polygonPool.free(polygon);
|
||||
this.polygonIndicesPool.free(polygonIndices);
|
||||
}
|
||||
polygon = this.polygonPool.obtain();
|
||||
polygon.length = 0;
|
||||
polygon.push(x1);
|
||||
@ -5528,6 +5532,9 @@ var spine;
|
||||
if (polygon.length == 0) {
|
||||
convexPolygons.splice(i, 1);
|
||||
this.polygonPool.free(polygon);
|
||||
polygonIndices = convexPolygonsIndices[i];
|
||||
convexPolygonsIndices.splice(i, 1);
|
||||
this.polygonIndicesPool.free(polygonIndices);
|
||||
}
|
||||
}
|
||||
return convexPolygons;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -5460,6 +5460,10 @@ var spine;
|
||||
convexPolygons.push(polygon);
|
||||
convexPolygonsIndices.push(polygonIndices);
|
||||
}
|
||||
else {
|
||||
this.polygonPool.free(polygon);
|
||||
this.polygonIndicesPool.free(polygonIndices);
|
||||
}
|
||||
polygon = this.polygonPool.obtain();
|
||||
polygon.length = 0;
|
||||
polygon.push(x1);
|
||||
@ -5528,6 +5532,9 @@ var spine;
|
||||
if (polygon.length == 0) {
|
||||
convexPolygons.splice(i, 1);
|
||||
this.polygonPool.free(polygon);
|
||||
polygonIndices = convexPolygonsIndices[i];
|
||||
convexPolygonsIndices.splice(i, 1);
|
||||
this.polygonIndicesPool.free(polygonIndices);
|
||||
}
|
||||
}
|
||||
return convexPolygons;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -5460,6 +5460,10 @@ var spine;
|
||||
convexPolygons.push(polygon);
|
||||
convexPolygonsIndices.push(polygonIndices);
|
||||
}
|
||||
else {
|
||||
this.polygonPool.free(polygon);
|
||||
this.polygonIndicesPool.free(polygonIndices);
|
||||
}
|
||||
polygon = this.polygonPool.obtain();
|
||||
polygon.length = 0;
|
||||
polygon.push(x1);
|
||||
@ -5528,6 +5532,9 @@ var spine;
|
||||
if (polygon.length == 0) {
|
||||
convexPolygons.splice(i, 1);
|
||||
this.polygonPool.free(polygon);
|
||||
polygonIndices = convexPolygonsIndices[i];
|
||||
convexPolygonsIndices.splice(i, 1);
|
||||
this.polygonIndicesPool.free(polygonIndices);
|
||||
}
|
||||
}
|
||||
return convexPolygons;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -5460,6 +5460,10 @@ var spine;
|
||||
convexPolygons.push(polygon);
|
||||
convexPolygonsIndices.push(polygonIndices);
|
||||
}
|
||||
else {
|
||||
this.polygonPool.free(polygon);
|
||||
this.polygonIndicesPool.free(polygonIndices);
|
||||
}
|
||||
polygon = this.polygonPool.obtain();
|
||||
polygon.length = 0;
|
||||
polygon.push(x1);
|
||||
@ -5528,6 +5532,9 @@ var spine;
|
||||
if (polygon.length == 0) {
|
||||
convexPolygons.splice(i, 1);
|
||||
this.polygonPool.free(polygon);
|
||||
polygonIndices = convexPolygonsIndices[i];
|
||||
convexPolygonsIndices.splice(i, 1);
|
||||
this.polygonIndicesPool.free(polygonIndices);
|
||||
}
|
||||
}
|
||||
return convexPolygons;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -164,6 +164,9 @@ module spine {
|
||||
if (polygon.length > 0) {
|
||||
convexPolygons.push(polygon);
|
||||
convexPolygonsIndices.push(polygonIndices);
|
||||
} else {
|
||||
this.polygonPool.free(polygon)
|
||||
this.polygonIndicesPool.free(polygonIndices);
|
||||
}
|
||||
polygon = this.polygonPool.obtain();
|
||||
polygon.length = 0;
|
||||
@ -238,6 +241,9 @@ module spine {
|
||||
if (polygon.length == 0) {
|
||||
convexPolygons.splice(i, 1);
|
||||
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.atlas");
|
||||
assetManager.loadTexture("assets/stretchyman.png");
|
||||
assetManager.loadText("assets/coin.json");
|
||||
assetManager.loadText("assets/coin.atlas");
|
||||
assetManager.loadTexture("assets/coin.png");
|
||||
requestAnimationFrame(load);
|
||||
}
|
||||
|
||||
@ -91,6 +94,7 @@ function load () {
|
||||
skeletons["goblins"] = loadSkeleton("goblins-mesh", "walk", false, "goblin");
|
||||
skeletons["vine"] = loadSkeleton("vine", "animation", false);
|
||||
skeletons["stretchyman"] = loadSkeleton("stretchyman", "sneak", false);
|
||||
skeletons["coin"] = loadSkeleton("coin", "rotate", false);
|
||||
setupUI();
|
||||
requestAnimationFrame(render);
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user