Tweaked tiling texture
This commit is contained in:
parent
0154dff2e2
commit
d33dbb4304
1 changed files with 32 additions and 44 deletions
|
@ -176,58 +176,46 @@ PIXI.TilingSprite.prototype._renderWebGL = function(renderSession)
|
|||
|
||||
var i,j;
|
||||
|
||||
if(this.mask || this.filters)
|
||||
if(this.mask)
|
||||
{
|
||||
if(this.mask)
|
||||
{
|
||||
renderSession.spriteBatch.stop();
|
||||
renderSession.maskManager.pushMask(this.mask, renderSession);
|
||||
renderSession.spriteBatch.start();
|
||||
}
|
||||
|
||||
if(this.filters)
|
||||
{
|
||||
renderSession.spriteBatch.flush();
|
||||
renderSession.filterManager.pushFilter(this._filterBlock);
|
||||
}
|
||||
|
||||
if(!this.tilingTexture || this.refreshTexture)this.generateTilingTexture(true);
|
||||
else renderSession.spriteBatch.renderTilingSprite(this);
|
||||
|
||||
// simple render children!
|
||||
for(i=0,j=this.children.length; i<j; i++)
|
||||
{
|
||||
this.children[i]._renderWebGL(renderSession);
|
||||
}
|
||||
|
||||
renderSession.spriteBatch.stop();
|
||||
|
||||
if(this.filters)renderSession.filterManager.popFilter();
|
||||
if(this.mask)renderSession.maskManager.popMask(renderSession);
|
||||
|
||||
renderSession.maskManager.pushMask(this.mask, renderSession);
|
||||
renderSession.spriteBatch.start();
|
||||
}
|
||||
else
|
||||
|
||||
if(this.filters)
|
||||
{
|
||||
if(!this.tilingTexture || this.refreshTexture)
|
||||
renderSession.spriteBatch.flush();
|
||||
renderSession.filterManager.pushFilter(this._filterBlock);
|
||||
}
|
||||
|
||||
|
||||
if(!this.tilingTexture || this.refreshTexture)
|
||||
{
|
||||
this.generateTilingTexture(true);
|
||||
if(this.tilingTexture && this.tilingTexture.needsUpdate)
|
||||
{
|
||||
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);
|
||||
//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);
|
||||
}
|
||||
|
||||
renderSession.spriteBatch.stop();
|
||||
|
||||
if(this.filters)renderSession.filterManager.popFilter();
|
||||
if(this.mask)renderSession.maskManager.popMask(renderSession);
|
||||
|
||||
renderSession.spriteBatch.start();
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue