Skip to content

Commit

Permalink
Merge pull request #656 from Weedshaker/master
Browse files Browse the repository at this point in the history
Reverting bugs introduced by PR #641 mentioned at issue #644
  • Loading branch information
samme committed Mar 5, 2020
2 parents f34218f + 7c71e54 commit a38dd09
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Change Log

## Version 2.14.1 - asap 2020

### API Changes



### New Features



### Updates



### Bug Fixes

* Reversion of WebGLSpriteBatch Bug introced at PR #641

### Thanks

@weedshaker

## Version 2.14.0 - 19 Jan 2020

### API Changes
Expand Down
20 changes: 19 additions & 1 deletion src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,15 @@ PIXI.WebGLSpriteBatch.prototype.end = function ()
PIXI.WebGLSpriteBatch.prototype.render = function (sprite, matrix)
{
var texture = sprite.texture;
var baseTexture = texture.baseTexture;
var gl = this.gl;
if (PIXI.WebGLRenderer.textureArray[baseTexture.textureIndex] != baseTexture) // eslint-disable-line eqeqeq
{
this.flush();
gl.activeTexture(gl.TEXTURE0 + baseTexture.textureIndex);
gl.bindTexture(gl.TEXTURE_2D, baseTexture._glTextures[gl.id]);
PIXI.WebGLRenderer.textureArray[baseTexture.textureIndex] = baseTexture;
}

// They provided an alternative rendering matrix, so use it
var wt = sprite.worldTransform;
Expand Down Expand Up @@ -425,7 +434,16 @@ PIXI.WebGLSpriteBatch.prototype.render = function (sprite, matrix)
PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function (sprite)
{
var texture = sprite.tilingTexture;
var baseTexture = texture.baseTexture;
var gl = this.gl;
var textureIndex = sprite.texture.baseTexture.textureIndex;
if (PIXI.WebGLRenderer.textureArray[textureIndex] != baseTexture) // eslint-disable-line eqeqeq
{
this.flush();
gl.activeTexture(gl.TEXTURE0 + textureIndex);
gl.bindTexture(gl.TEXTURE_2D, baseTexture._glTextures[gl.id]);
PIXI.WebGLRenderer.textureArray[textureIndex] = baseTexture;
}

// check texture..
if (this.currentBatchSize >= this.size)
Expand Down Expand Up @@ -657,7 +675,7 @@ PIXI.WebGLSpriteBatch.prototype.flush = function ()
}

//
if ((currentBaseTexture !== nextTexture && !skip) ||
if (/* (currentBaseTexture !== nextTexture && !skip) || */
blendSwap ||
shaderSwap)
{
Expand Down

0 comments on commit a38dd09

Please sign in to comment.