mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 13:13:43 +00:00
Added index offset to allow mesh batching
This commit is contained in:
parent
49bcb5829b
commit
7b0370c57b
1 changed files with 2 additions and 1 deletions
|
@ -232,6 +232,7 @@ SpriteBatch.prototype = {
|
|||
var indexBuffer = this.indexDataBuffer.uintView;
|
||||
var indices = gameObject.indices;
|
||||
var indexLength = indices.length;
|
||||
var indexOffset = this.vertexCount;
|
||||
|
||||
tempMatrix.applyITRS(translateX, translateY, rotation, scaleX, scaleY);
|
||||
|
||||
|
@ -279,7 +280,7 @@ SpriteBatch.prototype = {
|
|||
var elementCount = this.elementCount;
|
||||
for (var index = 0; index < indexLength; ++index)
|
||||
{
|
||||
indexBuffer[elementCount + index] = indices[index];
|
||||
indexBuffer[elementCount + index] = indexOffset + indices[index];
|
||||
}
|
||||
|
||||
this.elementCount += indexLength;
|
||||
|
|
Loading…
Reference in a new issue