Batch mesh remove object

This commit is contained in:
2026-10-28 01:29:21 -07:00
parent 74997b1e23
commit 84bab9bbc5

View File

@ -57,10 +57,8 @@ class MeshBatch {
} }
public function removeMesh(m: MeshObject) { public function removeMesh(m: MeshObject) {
var shader = m.materials[0].shader; var b = m.materials.length > 0 ? buckets.get(m.materials[0].shader) : null;
var b = buckets.get(shader); if (b == null || !b.removeMesh(m)) nonBatched.remove(m);
if (b != null) b.removeMesh(m);
else nonBatched.remove(m);
} }
@:access(iron.RenderPath) @:access(iron.RenderPath)
@ -176,8 +174,8 @@ class Bucket {
meshes.push(m); meshes.push(m);
} }
public function removeMesh(m: MeshObject) { public function removeMesh(m: MeshObject): Bool {
meshes.remove(m); return meshes.remove(m);
} }
#if lnx_deinterleaved #if lnx_deinterleaved