Browse Source

fix invalid buffer grow

Nicolas Cannasse 4 years ago
parent
commit
46492d7f28
1 changed files with 1 additions and 1 deletions
  1. 1 1
      h3d/scene/MeshBatch.hx

+ 1 - 1
h3d/scene/MeshBatch.hx

@@ -157,7 +157,7 @@ class MeshBatch extends MultiMaterial {
 
 		var startPos = batch.paramsCount * instanceCount << 2;
 		// in case we are bigger than emitCountTip
-		if( startPos + batch.paramsCount > batch.data.length )
+		if( startPos + (batch.paramsCount<<2) > batch.data.length )
 			batch.data.grow(batch.data.length << 1);
 
 		var p = batch.params;