Tweaked tiling texture

This commit is contained in:
Mat Groves 2014-02-17 21:30:23 +00:00
parent 0154dff2e2
commit d33dbb4304

View file

@ -176,8 +176,6 @@ PIXI.TilingSprite.prototype._renderWebGL = function(renderSession)
var i,j;
if(this.mask || this.filters)
{
if(this.mask)
{
renderSession.spriteBatch.stop();
@ -191,9 +189,21 @@ PIXI.TilingSprite.prototype._renderWebGL = function(renderSession)
renderSession.filterManager.pushFilter(this._filterBlock);
}
if(!this.tilingTexture || this.refreshTexture)this.generateTilingTexture(true);
if(!this.tilingTexture || this.refreshTexture)
{
this.generateTilingTexture(true);
if(this.tilingTexture && this.tilingTexture.needsUpdate)
{
//TODO - tweaking
PIXI.updateWebGLTexture(this.tilingTexture.baseTexture, renderSession.gl);
this.tilingTexture.needsUpdate = false;
// this.tilingTexture._uvs = null;
}
}
else renderSession.spriteBatch.renderTilingSprite(this);
// simple render children!
for(i=0,j=this.children.length; i<j; i++)
{
@ -206,28 +216,6 @@ PIXI.TilingSprite.prototype._renderWebGL = function(renderSession)
if(this.mask)renderSession.maskManager.popMask(renderSession);
renderSession.spriteBatch.start();
}
else
{
if(!this.tilingTexture || this.refreshTexture)
{
this.generateTilingTexture(true);
if(this.tilingTexture.needsUpdate)
{
//TODO - tweaking
PIXI.updateWebGLTexture(this.tilingTexture.baseTexture, renderSession.gl);
this.tilingTexture.needsUpdate = false;
// this.tilingTexture._uvs = null;
}
}
else renderSession.spriteBatch.renderTilingSprite(this);
// simple render children!
for(i=0,j=this.children.length; i<j; i++)
{
this.children[i]._renderWebGL(renderSession);
}
}
};
/**