@@ -260,7 +260,7 @@ PIXI.WebGLSpriteBatch.prototype.render = function (sprite, matrix) {
260260 h1 = texture . frame . height * - aY ;
261261 }
262262
263- var i = this . currentBatchSize * 4 * this . vertSize ;
263+ var i = this . currentBatchSize * this . vertexSize ; // 4 * this.vertSize;
264264 var tiOffset = this . currentBatchSize * 4 ;
265265 var resolution = texture . baseTexture . resolution ;
266266 var textureIndex = texture . baseTexture . textureIndex ;
@@ -409,7 +409,7 @@ PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function (sprite) {
409409 var h0 = height * ( 1 - aY ) ;
410410 var h1 = height * - aY ;
411411
412- var i = this . currentBatchSize * 4 * this . vertSize ;
412+ var i = this . currentBatchSize * this . vertexSize ; // 4 * this.vertSize;
413413
414414 var resolution = texture . baseTexture . resolution ;
415415
@@ -495,9 +495,8 @@ PIXI.WebGLSpriteBatch.prototype.flush = function () {
495495 // bind the buffers
496496 gl . bindBuffer ( gl . ARRAY_BUFFER , this . vertexBuffer ) ;
497497 gl . bindBuffer ( gl . ELEMENT_ARRAY_BUFFER , this . indexBuffer ) ;
498-
499498 // this is the same for each shader?
500- var stride = this . vertexSize ; //this.vertSize * 4;
499+ var stride = this . vertexSize ; //this.vertSize * 4;
501500 gl . vertexAttribPointer ( shader . aVertexPosition , 2 , gl . FLOAT , false , stride , 0 ) ;
502501 gl . vertexAttribPointer ( shader . aTextureCoord , 2 , gl . FLOAT , false , stride , 8 ) ;
503502
@@ -513,7 +512,7 @@ PIXI.WebGLSpriteBatch.prototype.flush = function () {
513512 gl . bufferSubData ( gl . ARRAY_BUFFER , 0 , this . vertices ) ;
514513 } else {
515514 gl . bindBuffer ( gl . ARRAY_BUFFER , this . vertexBuffer ) ;
516- var view = this . positions . subarray ( 0 , this . currentBatchSize * 4 * this . vertSize ) ;
515+ var view = this . positions . subarray ( 0 , this . currentBatchSize * this . vertexSize ) ;
517516 gl . bufferSubData ( gl . ARRAY_BUFFER , 0 , view ) ;
518517 }
519518
@@ -551,7 +550,7 @@ PIXI.WebGLSpriteBatch.prototype.flush = function () {
551550 skip = false ;
552551 }
553552
554- if ( ( /* currentBaseTexture !== nextTexture &&*/ ! skip ) || blendSwap || shaderSwap ) {
553+ if ( ( currentBaseTexture !== nextTexture && ! skip ) || blendSwap || shaderSwap ) {
555554 this . renderBatch ( currentBaseTexture , batchSize , start ) ;
556555
557556 start = i ;
@@ -628,7 +627,6 @@ PIXI.WebGLSpriteBatch.prototype.renderBatch = function (texture, size, startInde
628627 }
629628 } else {
630629 gl . activeTexture ( gl . TEXTURE0 + texture . textureIndex ) ;
631- //console.log(texture.textureIndex);
632630 // bind the current texture
633631 gl . bindTexture ( gl . TEXTURE_2D , texture . _glTextures [ gl . id ] ) ;
634632 }
@@ -666,7 +664,6 @@ PIXI.WebGLSpriteBatch.prototype.destroy = function () {
666664
667665 this . gl . deleteBuffer ( this . vertexBuffer ) ;
668666 this . gl . deleteBuffer ( this . indexBuffer ) ;
669- this . gl . deleteBuffer ( this . texIndexBuffer ) ;
670667
671668 this . currentBaseTexture = null ;
672669
0 commit comments