diff --git a/bin/pixi.dev.js b/bin/pixi.dev.js index 7862f57..4e69327 100644 --- a/bin/pixi.dev.js +++ b/bin/pixi.dev.js @@ -4,7 +4,7 @@ * Copyright (c) 2012, Mat Groves * http://goodboydigital.com/ * - * Compiled: 2013-12-27 + * Compiled: 2013-12-28 * * Pixi.JS is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -870,7 +870,6 @@ * */ this._bounds = new PIXI.Rectangle(0, 0, 1, 1); - this._currentBounds = null; /* @@ -992,32 +991,16 @@ * @type Graphics */ Object.defineProperty(PIXI.DisplayObject.prototype, 'mask', { + get: function() { + return this._mask; + }, set: function(value) { - - if(value) - { - if(this._mask) - { - value.start = this._mask.start; - value.end = this._mask.end; - } - else - { - this.addFilter(value); - value.renderable = false; - } - } - else - { - this.removeFilter(this._mask); - this._mask.renderable = true; - } - this._mask = value; + } }); @@ -1036,9 +1019,6 @@ if(value) { - if(this._filters)this.removeFilter(this._filters); - this.addFilter(value); - // now put all the passes in one place.. var passes = []; for (var i = 0; i < value.length; i++) @@ -1049,15 +1029,11 @@ passes.push(filterPasses[j]); } } - this._filterBlock = value.start; + + // TODO change this as it is legacy + this._filterBlock = {target:this, filterPasses:passes}; - value.start.filterPasses = passes; - } - else - { - if(this._filters) { - this.removeFilter(this._filters); - } + } this._filters = value; @@ -1065,159 +1041,6 @@ }); /* - * Adds a filter to this displayObject - * - * @method addFilter - * @param mask {Graphics} the graphics object to use as a filter - * @private - */ -PIXI.DisplayObject.prototype.addFilter = function(data) -{ - //if(this.filter)return; - //this.filter = true; -// data[0].target = this; - - - // insert a filter block.. - // TODO Onject pool thease bad boys.. - var start = new PIXI.FilterBlock(); - var end = new PIXI.FilterBlock(); - - data.start = start; - data.end = end; - - start.data = data; - end.data = data; - - start.first = start.last = this; - end.first = end.last = this; - - start.open = true; - - start.target = this; - - /* - * insert start - */ - - var childFirst = start; - var childLast = start; - var nextObject; - var previousObject; - - previousObject = this.first._iPrev; - - if(previousObject) - { - nextObject = previousObject._iNext; - childFirst._iPrev = previousObject; - previousObject._iNext = childFirst; - } - else - { - nextObject = this; - } - - if(nextObject) - { - nextObject._iPrev = childLast; - childLast._iNext = nextObject; - } - - // now insert the end filter block.. - - /* - * insert end filter - */ - childFirst = end; - childLast = end; - nextObject = null; - previousObject = null; - - previousObject = this.last; - nextObject = previousObject._iNext; - - if(nextObject) - { - nextObject._iPrev = childLast; - childLast._iNext = nextObject; - } - - childFirst._iPrev = previousObject; - previousObject._iNext = childFirst; - - var updateLast = this; - - var prevLast = this.last; - while(updateLast) - { - if(updateLast.last === prevLast) - { - updateLast.last = end; - } - updateLast = updateLast.parent; - } - - this.first = start; - - // if webGL... - if(this.__renderGroup) - { - this.__renderGroup.addFilterBlocks(start, end); - } -}; - -/* - * Removes the filter to this displayObject - * - * @method removeFilter - * @private - */ -PIXI.DisplayObject.prototype.removeFilter = function(data) -{ - //if(!this.filter)return; - //this.filter = false; - // console.log('YUOIO') - // modify the list.. - var startBlock = data.start; - - - var nextObject = startBlock._iNext; - var previousObject = startBlock._iPrev; - - if(nextObject)nextObject._iPrev = previousObject; - if(previousObject)previousObject._iNext = nextObject; - - this.first = startBlock._iNext; - - // remove the end filter - var lastBlock = data.end; - - nextObject = lastBlock._iNext; - previousObject = lastBlock._iPrev; - - if(nextObject)nextObject._iPrev = previousObject; - previousObject._iNext = nextObject; - - // this is always true too! - var tempLast = lastBlock._iPrev; - // need to make sure the parents last is updated too - var updateLast = this; - while(updateLast.last === lastBlock) - { - updateLast.last = tempLast; - updateLast = updateLast.parent; - if(!updateLast)break; - } - - // if webGL... - if(this.__renderGroup) - { - this.__renderGroup.removeFilterBlocks(startBlock, lastBlock); - } -}; - -/* * Updates the object transform for rendering * * @method updateTransform @@ -1323,7 +1146,7 @@ PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer; /** - * The width of the sprite, setting this will actually modify the scale to acheive the value set + * The width of the displayObjectContainer, setting this will actually modify the scale to acheive the value set * * @property width * @type Number @@ -1339,7 +1162,7 @@ }); /** - * The height of the sprite, setting this will actually modify the scale to acheive the value set + * The height of the displayObjectContainer, setting this will actually modify the scale to acheive the value set * * @property height * @type Number @@ -1480,10 +1303,10 @@ */ PIXI.DisplayObjectContainer.prototype.updateTransform = function() { - if(!this.visible)return; - this._currentBounds = null; + if(!this.visible)return; + PIXI.DisplayObject.prototype.updateTransform.call( this ); for(var i=0,j=this.children.length; i