Last Object tupdate
This commit is contained in:
parent
edda8b451c
commit
e010142b21
19 changed files with 934 additions and 364 deletions
|
@ -4,7 +4,7 @@
|
|||
* Copyright (c) 2012, Mat Groves
|
||||
* http://goodboydigital.com/
|
||||
*
|
||||
* Compiled: 2013-06-29
|
||||
* Compiled: 2013-06-30
|
||||
*
|
||||
* Pixi.JS is licensed under the MIT License.
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
|
@ -797,7 +797,6 @@ PIXI.DisplayObjectContainer = function()
|
|||
//s
|
||||
this.renderable = false;
|
||||
|
||||
//this.last = this;
|
||||
}
|
||||
|
||||
// constructor
|
||||
|
@ -823,13 +822,16 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'visible', {
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
||||
{
|
||||
//this.addChildAt(child, this.children.length)
|
||||
|
||||
//this.addChildAt(child, this.children.length)
|
||||
// return;
|
||||
|
||||
if(child.parent != undefined)
|
||||
{
|
||||
|
||||
//// COULD BE THIS???
|
||||
child.parent.removeChild(child);
|
||||
// return;
|
||||
}
|
||||
|
||||
child.parent = this;
|
||||
|
@ -861,17 +863,28 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
var previousObject;
|
||||
|
||||
previousObject = this.last;
|
||||
|
||||
// if(this.last._iNext)
|
||||
|
||||
//console.log( this.last._iNext);
|
||||
nextObject = previousObject._iNext;
|
||||
|
||||
// always true in this case
|
||||
this.last = child.last;
|
||||
|
||||
//this.last = child.last;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
var prevLast = this.last;
|
||||
while(updateLast)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
if(updateLast.last == prevLast)
|
||||
{
|
||||
updateLast.last = child.last;
|
||||
}
|
||||
else
|
||||
{
|
||||
// console.log("Not last")
|
||||
}
|
||||
updateLast = updateLast.parent;
|
||||
}
|
||||
|
||||
if(nextObject)
|
||||
|
@ -892,6 +905,13 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
/*
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last);
|
||||
console.log(this.stage.last._iNext)
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -902,9 +922,10 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
||||
{
|
||||
//this.addChild(child);
|
||||
// console.log(child)
|
||||
this.addChild(child);
|
||||
//console.log("AT " + index)
|
||||
//return;
|
||||
return;
|
||||
if(index >= 0 && index <= this.children.length)
|
||||
{
|
||||
if(child.parent != undefined)child.parent.removeChild(child);
|
||||
|
@ -921,6 +942,7 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
while(tmpChild)
|
||||
}
|
||||
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
var childLast = child.last;
|
||||
|
@ -943,10 +965,12 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
else if(index == 0)
|
||||
{
|
||||
// console.log("")
|
||||
previousObject = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
//console.log("!!!")
|
||||
previousObject = this.children[index].last;
|
||||
}
|
||||
|
||||
|
@ -972,6 +996,11 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1049,9 +1078,9 @@ PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
|||
PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
||||
{
|
||||
var index = this.children.indexOf( child );
|
||||
|
||||
if ( index !== -1 )
|
||||
{
|
||||
//console.log(">>")
|
||||
// unlink //
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
|
@ -1065,16 +1094,17 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
|||
|
||||
if(this.last == childLast.last)
|
||||
{
|
||||
this.last = child._iPrev;
|
||||
|
||||
var tempLast = childFirst._iPrev;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
while(updateLast.last == childLast.last)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
updateLast.last = tempLast;
|
||||
updateLast = updateLast.parent;
|
||||
if(!updateLast)break;
|
||||
}
|
||||
}
|
||||
|
||||
childLast._iNext = null;
|
||||
childFirst._iPrev = null;
|
||||
|
||||
|
@ -2703,7 +2733,7 @@ PIXI.autoDetectRenderer = function(width, height, view, transparent)
|
|||
//console.log(webgl);
|
||||
if( webgl )
|
||||
{
|
||||
return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
// return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
}
|
||||
|
||||
return new PIXI.CanvasRenderer(width, height, view, transparent);
|
||||
|
@ -4818,7 +4848,6 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb
|
|||
|
||||
if(displayObject.renderable)
|
||||
{
|
||||
|
||||
this.insertObject(displayObject, previousRenderable, nextRenderable);
|
||||
previousRenderable = displayObject;
|
||||
}
|
||||
|
@ -5396,11 +5425,15 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
|
||||
// one the display object hits this. we can break the loop
|
||||
var testObject = displayObject.last._iNext;
|
||||
if(testObject)
|
||||
{
|
||||
// console.log(testObject.last == displayObject.last)//_iNext);
|
||||
}
|
||||
|
||||
var count = 0;
|
||||
|
||||
var count = 0
|
||||
do
|
||||
{
|
||||
|
||||
transform = displayObject.worldTransform;
|
||||
|
||||
if(!displayObject.visible)
|
||||
|
@ -5414,7 +5447,6 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
displayObject = displayObject._iNext;
|
||||
continue;
|
||||
}
|
||||
count++;
|
||||
|
||||
|
||||
if(displayObject instanceof PIXI.Sprite)
|
||||
|
@ -5459,13 +5491,19 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
PIXI.CanvasGraphics.renderGraphics(displayObject, context);
|
||||
}
|
||||
|
||||
count++
|
||||
displayObject = displayObject._iNext;
|
||||
|
||||
|
||||
}
|
||||
while(displayObject != testObject)
|
||||
|
||||
this.context.setTransform(1,0,0,1,0,0);
|
||||
console.log(count);
|
||||
// this.context.setTransform(1,0,0,1,0,0);
|
||||
}
|
||||
|
||||
var cacheCount;
|
||||
|
||||
PIXI.CanvasRenderer.prototype.renderDisplayObject2 = function(displayObject)
|
||||
{
|
||||
var transform = displayObject.worldTransform;
|
||||
|
|
10
bin/pixi.js
10
bin/pixi.js
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
|||
* Copyright (c) 2012, Mat Groves
|
||||
* http://goodboydigital.com/
|
||||
*
|
||||
* Compiled: 2013-06-29
|
||||
* Compiled: 2013-06-30
|
||||
*
|
||||
* Pixi.JS is licensed under the MIT License.
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
|
@ -797,7 +797,6 @@ PIXI.DisplayObjectContainer = function()
|
|||
//s
|
||||
this.renderable = false;
|
||||
|
||||
//this.last = this;
|
||||
}
|
||||
|
||||
// constructor
|
||||
|
@ -823,13 +822,16 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'visible', {
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
||||
{
|
||||
//this.addChildAt(child, this.children.length)
|
||||
|
||||
//this.addChildAt(child, this.children.length)
|
||||
// return;
|
||||
|
||||
if(child.parent != undefined)
|
||||
{
|
||||
|
||||
//// COULD BE THIS???
|
||||
child.parent.removeChild(child);
|
||||
// return;
|
||||
}
|
||||
|
||||
child.parent = this;
|
||||
|
@ -861,17 +863,28 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
var previousObject;
|
||||
|
||||
previousObject = this.last;
|
||||
|
||||
// if(this.last._iNext)
|
||||
|
||||
//console.log( this.last._iNext);
|
||||
nextObject = previousObject._iNext;
|
||||
|
||||
// always true in this case
|
||||
this.last = child.last;
|
||||
|
||||
//this.last = child.last;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
var prevLast = this.last;
|
||||
while(updateLast)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
if(updateLast.last == prevLast)
|
||||
{
|
||||
updateLast.last = child.last;
|
||||
}
|
||||
else
|
||||
{
|
||||
// console.log("Not last")
|
||||
}
|
||||
updateLast = updateLast.parent;
|
||||
}
|
||||
|
||||
if(nextObject)
|
||||
|
@ -892,6 +905,13 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
/*
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last);
|
||||
console.log(this.stage.last._iNext)
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -902,9 +922,10 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
||||
{
|
||||
//this.addChild(child);
|
||||
// console.log(child)
|
||||
this.addChild(child);
|
||||
//console.log("AT " + index)
|
||||
//return;
|
||||
return;
|
||||
if(index >= 0 && index <= this.children.length)
|
||||
{
|
||||
if(child.parent != undefined)child.parent.removeChild(child);
|
||||
|
@ -921,6 +942,7 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
while(tmpChild)
|
||||
}
|
||||
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
var childLast = child.last;
|
||||
|
@ -943,10 +965,12 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
else if(index == 0)
|
||||
{
|
||||
// console.log("")
|
||||
previousObject = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
//console.log("!!!")
|
||||
previousObject = this.children[index].last;
|
||||
}
|
||||
|
||||
|
@ -972,6 +996,11 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1049,9 +1078,9 @@ PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
|||
PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
||||
{
|
||||
var index = this.children.indexOf( child );
|
||||
|
||||
if ( index !== -1 )
|
||||
{
|
||||
//console.log(">>")
|
||||
// unlink //
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
|
@ -1065,16 +1094,17 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
|||
|
||||
if(this.last == childLast.last)
|
||||
{
|
||||
this.last = child._iPrev;
|
||||
|
||||
var tempLast = childFirst._iPrev;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
while(updateLast.last == childLast.last)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
updateLast.last = tempLast;
|
||||
updateLast = updateLast.parent;
|
||||
if(!updateLast)break;
|
||||
}
|
||||
}
|
||||
|
||||
childLast._iNext = null;
|
||||
childFirst._iPrev = null;
|
||||
|
||||
|
@ -2703,7 +2733,7 @@ PIXI.autoDetectRenderer = function(width, height, view, transparent)
|
|||
//console.log(webgl);
|
||||
if( webgl )
|
||||
{
|
||||
return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
// return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
}
|
||||
|
||||
return new PIXI.CanvasRenderer(width, height, view, transparent);
|
||||
|
@ -4818,7 +4848,6 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb
|
|||
|
||||
if(displayObject.renderable)
|
||||
{
|
||||
|
||||
this.insertObject(displayObject, previousRenderable, nextRenderable);
|
||||
previousRenderable = displayObject;
|
||||
}
|
||||
|
@ -5396,11 +5425,15 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
|
||||
// one the display object hits this. we can break the loop
|
||||
var testObject = displayObject.last._iNext;
|
||||
if(testObject)
|
||||
{
|
||||
// console.log(testObject.last == displayObject.last)//_iNext);
|
||||
}
|
||||
|
||||
var count = 0;
|
||||
|
||||
var count = 0
|
||||
do
|
||||
{
|
||||
|
||||
transform = displayObject.worldTransform;
|
||||
|
||||
if(!displayObject.visible)
|
||||
|
@ -5414,7 +5447,6 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
displayObject = displayObject._iNext;
|
||||
continue;
|
||||
}
|
||||
count++;
|
||||
|
||||
|
||||
if(displayObject instanceof PIXI.Sprite)
|
||||
|
@ -5459,13 +5491,19 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
PIXI.CanvasGraphics.renderGraphics(displayObject, context);
|
||||
}
|
||||
|
||||
count++
|
||||
displayObject = displayObject._iNext;
|
||||
|
||||
|
||||
}
|
||||
while(displayObject != testObject)
|
||||
|
||||
this.context.setTransform(1,0,0,1,0,0);
|
||||
console.log(count);
|
||||
// this.context.setTransform(1,0,0,1,0,0);
|
||||
}
|
||||
|
||||
var cacheCount;
|
||||
|
||||
PIXI.CanvasRenderer.prototype.renderDisplayObject2 = function(displayObject)
|
||||
{
|
||||
var transform = displayObject.worldTransform;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (c) 2012, Mat Groves
|
||||
* http://goodboydigital.com/
|
||||
*
|
||||
* Compiled: 2013-06-29
|
||||
* Compiled: 2013-06-30
|
||||
*
|
||||
* Pixi.JS is licensed under the MIT License.
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
|
@ -797,7 +797,6 @@ PIXI.DisplayObjectContainer = function()
|
|||
//s
|
||||
this.renderable = false;
|
||||
|
||||
//this.last = this;
|
||||
}
|
||||
|
||||
// constructor
|
||||
|
@ -823,13 +822,16 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'visible', {
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
||||
{
|
||||
//this.addChildAt(child, this.children.length)
|
||||
|
||||
//this.addChildAt(child, this.children.length)
|
||||
// return;
|
||||
|
||||
if(child.parent != undefined)
|
||||
{
|
||||
|
||||
//// COULD BE THIS???
|
||||
child.parent.removeChild(child);
|
||||
// return;
|
||||
}
|
||||
|
||||
child.parent = this;
|
||||
|
@ -861,17 +863,28 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
var previousObject;
|
||||
|
||||
previousObject = this.last;
|
||||
|
||||
// if(this.last._iNext)
|
||||
|
||||
//console.log( this.last._iNext);
|
||||
nextObject = previousObject._iNext;
|
||||
|
||||
// always true in this case
|
||||
this.last = child.last;
|
||||
|
||||
//this.last = child.last;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
var prevLast = this.last;
|
||||
while(updateLast)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
if(updateLast.last == prevLast)
|
||||
{
|
||||
updateLast.last = child.last;
|
||||
}
|
||||
else
|
||||
{
|
||||
// console.log("Not last")
|
||||
}
|
||||
updateLast = updateLast.parent;
|
||||
}
|
||||
|
||||
if(nextObject)
|
||||
|
@ -892,6 +905,13 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
/*
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last);
|
||||
console.log(this.stage.last._iNext)
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -902,9 +922,10 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
||||
{
|
||||
//this.addChild(child);
|
||||
// console.log(child)
|
||||
this.addChild(child);
|
||||
//console.log("AT " + index)
|
||||
//return;
|
||||
return;
|
||||
if(index >= 0 && index <= this.children.length)
|
||||
{
|
||||
if(child.parent != undefined)child.parent.removeChild(child);
|
||||
|
@ -921,6 +942,7 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
while(tmpChild)
|
||||
}
|
||||
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
var childLast = child.last;
|
||||
|
@ -943,10 +965,12 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
else if(index == 0)
|
||||
{
|
||||
// console.log("")
|
||||
previousObject = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
//console.log("!!!")
|
||||
previousObject = this.children[index].last;
|
||||
}
|
||||
|
||||
|
@ -972,6 +996,11 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1049,9 +1078,9 @@ PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
|||
PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
||||
{
|
||||
var index = this.children.indexOf( child );
|
||||
|
||||
if ( index !== -1 )
|
||||
{
|
||||
//console.log(">>")
|
||||
// unlink //
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
|
@ -1065,16 +1094,17 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
|||
|
||||
if(this.last == childLast.last)
|
||||
{
|
||||
this.last = child._iPrev;
|
||||
|
||||
var tempLast = childFirst._iPrev;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
while(updateLast.last == childLast.last)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
updateLast.last = tempLast;
|
||||
updateLast = updateLast.parent;
|
||||
if(!updateLast)break;
|
||||
}
|
||||
}
|
||||
|
||||
childLast._iNext = null;
|
||||
childFirst._iPrev = null;
|
||||
|
||||
|
@ -2703,7 +2733,7 @@ PIXI.autoDetectRenderer = function(width, height, view, transparent)
|
|||
//console.log(webgl);
|
||||
if( webgl )
|
||||
{
|
||||
return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
// return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
}
|
||||
|
||||
return new PIXI.CanvasRenderer(width, height, view, transparent);
|
||||
|
@ -4818,7 +4848,6 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb
|
|||
|
||||
if(displayObject.renderable)
|
||||
{
|
||||
|
||||
this.insertObject(displayObject, previousRenderable, nextRenderable);
|
||||
previousRenderable = displayObject;
|
||||
}
|
||||
|
@ -5396,11 +5425,15 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
|
||||
// one the display object hits this. we can break the loop
|
||||
var testObject = displayObject.last._iNext;
|
||||
if(testObject)
|
||||
{
|
||||
// console.log(testObject.last == displayObject.last)//_iNext);
|
||||
}
|
||||
|
||||
var count = 0;
|
||||
|
||||
var count = 0
|
||||
do
|
||||
{
|
||||
|
||||
transform = displayObject.worldTransform;
|
||||
|
||||
if(!displayObject.visible)
|
||||
|
@ -5414,7 +5447,6 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
displayObject = displayObject._iNext;
|
||||
continue;
|
||||
}
|
||||
count++;
|
||||
|
||||
|
||||
if(displayObject instanceof PIXI.Sprite)
|
||||
|
@ -5459,13 +5491,19 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
PIXI.CanvasGraphics.renderGraphics(displayObject, context);
|
||||
}
|
||||
|
||||
count++
|
||||
displayObject = displayObject._iNext;
|
||||
|
||||
|
||||
}
|
||||
while(displayObject != testObject)
|
||||
|
||||
this.context.setTransform(1,0,0,1,0,0);
|
||||
console.log(count);
|
||||
// this.context.setTransform(1,0,0,1,0,0);
|
||||
}
|
||||
|
||||
var cacheCount;
|
||||
|
||||
PIXI.CanvasRenderer.prototype.renderDisplayObject2 = function(displayObject)
|
||||
{
|
||||
var transform = displayObject.worldTransform;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (c) 2012, Mat Groves
|
||||
* http://goodboydigital.com/
|
||||
*
|
||||
* Compiled: 2013-06-29
|
||||
* Compiled: 2013-06-30
|
||||
*
|
||||
* Pixi.JS is licensed under the MIT License.
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
|
@ -797,7 +797,6 @@ PIXI.DisplayObjectContainer = function()
|
|||
//s
|
||||
this.renderable = false;
|
||||
|
||||
//this.last = this;
|
||||
}
|
||||
|
||||
// constructor
|
||||
|
@ -823,13 +822,16 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'visible', {
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
||||
{
|
||||
//this.addChildAt(child, this.children.length)
|
||||
|
||||
//this.addChildAt(child, this.children.length)
|
||||
// return;
|
||||
|
||||
if(child.parent != undefined)
|
||||
{
|
||||
|
||||
//// COULD BE THIS???
|
||||
child.parent.removeChild(child);
|
||||
// return;
|
||||
}
|
||||
|
||||
child.parent = this;
|
||||
|
@ -861,17 +863,28 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
var previousObject;
|
||||
|
||||
previousObject = this.last;
|
||||
|
||||
// if(this.last._iNext)
|
||||
|
||||
//console.log( this.last._iNext);
|
||||
nextObject = previousObject._iNext;
|
||||
|
||||
// always true in this case
|
||||
this.last = child.last;
|
||||
|
||||
//this.last = child.last;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
var prevLast = this.last;
|
||||
while(updateLast)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
if(updateLast.last == prevLast)
|
||||
{
|
||||
updateLast.last = child.last;
|
||||
}
|
||||
else
|
||||
{
|
||||
// console.log("Not last")
|
||||
}
|
||||
updateLast = updateLast.parent;
|
||||
}
|
||||
|
||||
if(nextObject)
|
||||
|
@ -892,6 +905,13 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
/*
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last);
|
||||
console.log(this.stage.last._iNext)
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -902,9 +922,10 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
||||
{
|
||||
//this.addChild(child);
|
||||
// console.log(child)
|
||||
this.addChild(child);
|
||||
//console.log("AT " + index)
|
||||
//return;
|
||||
return;
|
||||
if(index >= 0 && index <= this.children.length)
|
||||
{
|
||||
if(child.parent != undefined)child.parent.removeChild(child);
|
||||
|
@ -921,6 +942,7 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
while(tmpChild)
|
||||
}
|
||||
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
var childLast = child.last;
|
||||
|
@ -943,10 +965,12 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
else if(index == 0)
|
||||
{
|
||||
// console.log("")
|
||||
previousObject = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
//console.log("!!!")
|
||||
previousObject = this.children[index].last;
|
||||
}
|
||||
|
||||
|
@ -972,6 +996,11 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1049,9 +1078,9 @@ PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
|||
PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
||||
{
|
||||
var index = this.children.indexOf( child );
|
||||
|
||||
if ( index !== -1 )
|
||||
{
|
||||
//console.log(">>")
|
||||
// unlink //
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
|
@ -1065,16 +1094,17 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
|||
|
||||
if(this.last == childLast.last)
|
||||
{
|
||||
this.last = child._iPrev;
|
||||
|
||||
var tempLast = childFirst._iPrev;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
while(updateLast.last == childLast.last)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
updateLast.last = tempLast;
|
||||
updateLast = updateLast.parent;
|
||||
if(!updateLast)break;
|
||||
}
|
||||
}
|
||||
|
||||
childLast._iNext = null;
|
||||
childFirst._iPrev = null;
|
||||
|
||||
|
@ -2703,7 +2733,7 @@ PIXI.autoDetectRenderer = function(width, height, view, transparent)
|
|||
//console.log(webgl);
|
||||
if( webgl )
|
||||
{
|
||||
return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
// return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
}
|
||||
|
||||
return new PIXI.CanvasRenderer(width, height, view, transparent);
|
||||
|
@ -4818,7 +4848,6 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb
|
|||
|
||||
if(displayObject.renderable)
|
||||
{
|
||||
|
||||
this.insertObject(displayObject, previousRenderable, nextRenderable);
|
||||
previousRenderable = displayObject;
|
||||
}
|
||||
|
@ -5396,11 +5425,15 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
|
||||
// one the display object hits this. we can break the loop
|
||||
var testObject = displayObject.last._iNext;
|
||||
if(testObject)
|
||||
{
|
||||
// console.log(testObject.last == displayObject.last)//_iNext);
|
||||
}
|
||||
|
||||
var count = 0;
|
||||
|
||||
var count = 0
|
||||
do
|
||||
{
|
||||
|
||||
transform = displayObject.worldTransform;
|
||||
|
||||
if(!displayObject.visible)
|
||||
|
@ -5414,7 +5447,6 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
displayObject = displayObject._iNext;
|
||||
continue;
|
||||
}
|
||||
count++;
|
||||
|
||||
|
||||
if(displayObject instanceof PIXI.Sprite)
|
||||
|
@ -5459,13 +5491,19 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
PIXI.CanvasGraphics.renderGraphics(displayObject, context);
|
||||
}
|
||||
|
||||
count++
|
||||
displayObject = displayObject._iNext;
|
||||
|
||||
|
||||
}
|
||||
while(displayObject != testObject)
|
||||
|
||||
this.context.setTransform(1,0,0,1,0,0);
|
||||
console.log(count);
|
||||
// this.context.setTransform(1,0,0,1,0,0);
|
||||
}
|
||||
|
||||
var cacheCount;
|
||||
|
||||
PIXI.CanvasRenderer.prototype.renderDisplayObject2 = function(displayObject)
|
||||
{
|
||||
var transform = displayObject.worldTransform;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (c) 2012, Mat Groves
|
||||
* http://goodboydigital.com/
|
||||
*
|
||||
* Compiled: 2013-06-29
|
||||
* Compiled: 2013-06-30
|
||||
*
|
||||
* Pixi.JS is licensed under the MIT License.
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
|
@ -797,7 +797,6 @@ PIXI.DisplayObjectContainer = function()
|
|||
//s
|
||||
this.renderable = false;
|
||||
|
||||
//this.last = this;
|
||||
}
|
||||
|
||||
// constructor
|
||||
|
@ -823,13 +822,16 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'visible', {
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
||||
{
|
||||
//this.addChildAt(child, this.children.length)
|
||||
|
||||
//this.addChildAt(child, this.children.length)
|
||||
// return;
|
||||
|
||||
if(child.parent != undefined)
|
||||
{
|
||||
|
||||
//// COULD BE THIS???
|
||||
child.parent.removeChild(child);
|
||||
// return;
|
||||
}
|
||||
|
||||
child.parent = this;
|
||||
|
@ -861,17 +863,28 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
var previousObject;
|
||||
|
||||
previousObject = this.last;
|
||||
|
||||
// if(this.last._iNext)
|
||||
|
||||
//console.log( this.last._iNext);
|
||||
nextObject = previousObject._iNext;
|
||||
|
||||
// always true in this case
|
||||
this.last = child.last;
|
||||
|
||||
//this.last = child.last;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
var prevLast = this.last;
|
||||
while(updateLast)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
if(updateLast.last == prevLast)
|
||||
{
|
||||
updateLast.last = child.last;
|
||||
}
|
||||
else
|
||||
{
|
||||
// console.log("Not last")
|
||||
}
|
||||
updateLast = updateLast.parent;
|
||||
}
|
||||
|
||||
if(nextObject)
|
||||
|
@ -892,6 +905,13 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
/*
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last);
|
||||
console.log(this.stage.last._iNext)
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -902,9 +922,10 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
||||
{
|
||||
//this.addChild(child);
|
||||
// console.log(child)
|
||||
this.addChild(child);
|
||||
//console.log("AT " + index)
|
||||
//return;
|
||||
return;
|
||||
if(index >= 0 && index <= this.children.length)
|
||||
{
|
||||
if(child.parent != undefined)child.parent.removeChild(child);
|
||||
|
@ -921,6 +942,7 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
while(tmpChild)
|
||||
}
|
||||
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
var childLast = child.last;
|
||||
|
@ -943,10 +965,12 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
else if(index == 0)
|
||||
{
|
||||
// console.log("")
|
||||
previousObject = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
//console.log("!!!")
|
||||
previousObject = this.children[index].last;
|
||||
}
|
||||
|
||||
|
@ -972,6 +996,11 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1049,9 +1078,9 @@ PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
|||
PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
||||
{
|
||||
var index = this.children.indexOf( child );
|
||||
|
||||
if ( index !== -1 )
|
||||
{
|
||||
//console.log(">>")
|
||||
// unlink //
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
|
@ -1065,16 +1094,17 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
|||
|
||||
if(this.last == childLast.last)
|
||||
{
|
||||
this.last = child._iPrev;
|
||||
|
||||
var tempLast = childFirst._iPrev;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
while(updateLast.last == childLast.last)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
updateLast.last = tempLast;
|
||||
updateLast = updateLast.parent;
|
||||
if(!updateLast)break;
|
||||
}
|
||||
}
|
||||
|
||||
childLast._iNext = null;
|
||||
childFirst._iPrev = null;
|
||||
|
||||
|
@ -2703,7 +2733,7 @@ PIXI.autoDetectRenderer = function(width, height, view, transparent)
|
|||
//console.log(webgl);
|
||||
if( webgl )
|
||||
{
|
||||
return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
// return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
}
|
||||
|
||||
return new PIXI.CanvasRenderer(width, height, view, transparent);
|
||||
|
@ -4818,7 +4848,6 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb
|
|||
|
||||
if(displayObject.renderable)
|
||||
{
|
||||
|
||||
this.insertObject(displayObject, previousRenderable, nextRenderable);
|
||||
previousRenderable = displayObject;
|
||||
}
|
||||
|
@ -5396,11 +5425,15 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
|
||||
// one the display object hits this. we can break the loop
|
||||
var testObject = displayObject.last._iNext;
|
||||
if(testObject)
|
||||
{
|
||||
// console.log(testObject.last == displayObject.last)//_iNext);
|
||||
}
|
||||
|
||||
var count = 0;
|
||||
|
||||
var count = 0
|
||||
do
|
||||
{
|
||||
|
||||
transform = displayObject.worldTransform;
|
||||
|
||||
if(!displayObject.visible)
|
||||
|
@ -5414,7 +5447,6 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
displayObject = displayObject._iNext;
|
||||
continue;
|
||||
}
|
||||
count++;
|
||||
|
||||
|
||||
if(displayObject instanceof PIXI.Sprite)
|
||||
|
@ -5459,13 +5491,19 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
PIXI.CanvasGraphics.renderGraphics(displayObject, context);
|
||||
}
|
||||
|
||||
count++
|
||||
displayObject = displayObject._iNext;
|
||||
|
||||
|
||||
}
|
||||
while(displayObject != testObject)
|
||||
|
||||
this.context.setTransform(1,0,0,1,0,0);
|
||||
console.log(count);
|
||||
// this.context.setTransform(1,0,0,1,0,0);
|
||||
}
|
||||
|
||||
var cacheCount;
|
||||
|
||||
PIXI.CanvasRenderer.prototype.renderDisplayObject2 = function(displayObject)
|
||||
{
|
||||
var transform = displayObject.worldTransform;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (c) 2012, Mat Groves
|
||||
* http://goodboydigital.com/
|
||||
*
|
||||
* Compiled: 2013-06-29
|
||||
* Compiled: 2013-06-30
|
||||
*
|
||||
* Pixi.JS is licensed under the MIT License.
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
|
@ -797,7 +797,6 @@ PIXI.DisplayObjectContainer = function()
|
|||
//s
|
||||
this.renderable = false;
|
||||
|
||||
//this.last = this;
|
||||
}
|
||||
|
||||
// constructor
|
||||
|
@ -823,13 +822,16 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'visible', {
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
||||
{
|
||||
//this.addChildAt(child, this.children.length)
|
||||
|
||||
//this.addChildAt(child, this.children.length)
|
||||
// return;
|
||||
|
||||
if(child.parent != undefined)
|
||||
{
|
||||
|
||||
//// COULD BE THIS???
|
||||
child.parent.removeChild(child);
|
||||
// return;
|
||||
}
|
||||
|
||||
child.parent = this;
|
||||
|
@ -861,17 +863,28 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
var previousObject;
|
||||
|
||||
previousObject = this.last;
|
||||
|
||||
// if(this.last._iNext)
|
||||
|
||||
//console.log( this.last._iNext);
|
||||
nextObject = previousObject._iNext;
|
||||
|
||||
// always true in this case
|
||||
this.last = child.last;
|
||||
|
||||
//this.last = child.last;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
var prevLast = this.last;
|
||||
while(updateLast)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
if(updateLast.last == prevLast)
|
||||
{
|
||||
updateLast.last = child.last;
|
||||
}
|
||||
else
|
||||
{
|
||||
// console.log("Not last")
|
||||
}
|
||||
updateLast = updateLast.parent;
|
||||
}
|
||||
|
||||
if(nextObject)
|
||||
|
@ -892,6 +905,13 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
/*
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last);
|
||||
console.log(this.stage.last._iNext)
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -902,9 +922,10 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
||||
{
|
||||
//this.addChild(child);
|
||||
// console.log(child)
|
||||
this.addChild(child);
|
||||
//console.log("AT " + index)
|
||||
//return;
|
||||
return;
|
||||
if(index >= 0 && index <= this.children.length)
|
||||
{
|
||||
if(child.parent != undefined)child.parent.removeChild(child);
|
||||
|
@ -921,6 +942,7 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
while(tmpChild)
|
||||
}
|
||||
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
var childLast = child.last;
|
||||
|
@ -943,10 +965,12 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
else if(index == 0)
|
||||
{
|
||||
// console.log("")
|
||||
previousObject = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
//console.log("!!!")
|
||||
previousObject = this.children[index].last;
|
||||
}
|
||||
|
||||
|
@ -972,6 +996,11 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1049,9 +1078,9 @@ PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
|||
PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
||||
{
|
||||
var index = this.children.indexOf( child );
|
||||
|
||||
if ( index !== -1 )
|
||||
{
|
||||
//console.log(">>")
|
||||
// unlink //
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
|
@ -1065,16 +1094,17 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
|||
|
||||
if(this.last == childLast.last)
|
||||
{
|
||||
this.last = child._iPrev;
|
||||
|
||||
var tempLast = childFirst._iPrev;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
while(updateLast.last == childLast.last)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
updateLast.last = tempLast;
|
||||
updateLast = updateLast.parent;
|
||||
if(!updateLast)break;
|
||||
}
|
||||
}
|
||||
|
||||
childLast._iNext = null;
|
||||
childFirst._iPrev = null;
|
||||
|
||||
|
@ -2703,7 +2733,7 @@ PIXI.autoDetectRenderer = function(width, height, view, transparent)
|
|||
//console.log(webgl);
|
||||
if( webgl )
|
||||
{
|
||||
return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
// return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
}
|
||||
|
||||
return new PIXI.CanvasRenderer(width, height, view, transparent);
|
||||
|
@ -4818,7 +4848,6 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb
|
|||
|
||||
if(displayObject.renderable)
|
||||
{
|
||||
|
||||
this.insertObject(displayObject, previousRenderable, nextRenderable);
|
||||
previousRenderable = displayObject;
|
||||
}
|
||||
|
@ -5396,11 +5425,15 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
|
||||
// one the display object hits this. we can break the loop
|
||||
var testObject = displayObject.last._iNext;
|
||||
if(testObject)
|
||||
{
|
||||
// console.log(testObject.last == displayObject.last)//_iNext);
|
||||
}
|
||||
|
||||
var count = 0;
|
||||
|
||||
var count = 0
|
||||
do
|
||||
{
|
||||
|
||||
transform = displayObject.worldTransform;
|
||||
|
||||
if(!displayObject.visible)
|
||||
|
@ -5414,7 +5447,6 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
displayObject = displayObject._iNext;
|
||||
continue;
|
||||
}
|
||||
count++;
|
||||
|
||||
|
||||
if(displayObject instanceof PIXI.Sprite)
|
||||
|
@ -5459,13 +5491,19 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
PIXI.CanvasGraphics.renderGraphics(displayObject, context);
|
||||
}
|
||||
|
||||
count++
|
||||
displayObject = displayObject._iNext;
|
||||
|
||||
|
||||
}
|
||||
while(displayObject != testObject)
|
||||
|
||||
this.context.setTransform(1,0,0,1,0,0);
|
||||
console.log(count);
|
||||
// this.context.setTransform(1,0,0,1,0,0);
|
||||
}
|
||||
|
||||
var cacheCount;
|
||||
|
||||
PIXI.CanvasRenderer.prototype.renderDisplayObject2 = function(displayObject)
|
||||
{
|
||||
var transform = displayObject.worldTransform;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (c) 2012, Mat Groves
|
||||
* http://goodboydigital.com/
|
||||
*
|
||||
* Compiled: 2013-06-29
|
||||
* Compiled: 2013-06-30
|
||||
*
|
||||
* Pixi.JS is licensed under the MIT License.
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
|
@ -797,7 +797,6 @@ PIXI.DisplayObjectContainer = function()
|
|||
//s
|
||||
this.renderable = false;
|
||||
|
||||
//this.last = this;
|
||||
}
|
||||
|
||||
// constructor
|
||||
|
@ -823,13 +822,16 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'visible', {
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
||||
{
|
||||
//this.addChildAt(child, this.children.length)
|
||||
|
||||
//this.addChildAt(child, this.children.length)
|
||||
// return;
|
||||
|
||||
if(child.parent != undefined)
|
||||
{
|
||||
|
||||
//// COULD BE THIS???
|
||||
child.parent.removeChild(child);
|
||||
// return;
|
||||
}
|
||||
|
||||
child.parent = this;
|
||||
|
@ -861,17 +863,28 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
var previousObject;
|
||||
|
||||
previousObject = this.last;
|
||||
|
||||
// if(this.last._iNext)
|
||||
|
||||
//console.log( this.last._iNext);
|
||||
nextObject = previousObject._iNext;
|
||||
|
||||
// always true in this case
|
||||
this.last = child.last;
|
||||
|
||||
//this.last = child.last;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
var prevLast = this.last;
|
||||
while(updateLast)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
if(updateLast.last == prevLast)
|
||||
{
|
||||
updateLast.last = child.last;
|
||||
}
|
||||
else
|
||||
{
|
||||
// console.log("Not last")
|
||||
}
|
||||
updateLast = updateLast.parent;
|
||||
}
|
||||
|
||||
if(nextObject)
|
||||
|
@ -892,6 +905,13 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
/*
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last);
|
||||
console.log(this.stage.last._iNext)
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -902,9 +922,10 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
||||
{
|
||||
//this.addChild(child);
|
||||
// console.log(child)
|
||||
this.addChild(child);
|
||||
//console.log("AT " + index)
|
||||
//return;
|
||||
return;
|
||||
if(index >= 0 && index <= this.children.length)
|
||||
{
|
||||
if(child.parent != undefined)child.parent.removeChild(child);
|
||||
|
@ -921,6 +942,7 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
while(tmpChild)
|
||||
}
|
||||
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
var childLast = child.last;
|
||||
|
@ -943,10 +965,12 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
else if(index == 0)
|
||||
{
|
||||
// console.log("")
|
||||
previousObject = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
//console.log("!!!")
|
||||
previousObject = this.children[index].last;
|
||||
}
|
||||
|
||||
|
@ -972,6 +996,11 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1049,9 +1078,9 @@ PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
|||
PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
||||
{
|
||||
var index = this.children.indexOf( child );
|
||||
|
||||
if ( index !== -1 )
|
||||
{
|
||||
//console.log(">>")
|
||||
// unlink //
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
|
@ -1065,16 +1094,17 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
|||
|
||||
if(this.last == childLast.last)
|
||||
{
|
||||
this.last = child._iPrev;
|
||||
|
||||
var tempLast = childFirst._iPrev;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
while(updateLast.last == childLast.last)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
updateLast.last = tempLast;
|
||||
updateLast = updateLast.parent;
|
||||
if(!updateLast)break;
|
||||
}
|
||||
}
|
||||
|
||||
childLast._iNext = null;
|
||||
childFirst._iPrev = null;
|
||||
|
||||
|
@ -2703,7 +2733,7 @@ PIXI.autoDetectRenderer = function(width, height, view, transparent)
|
|||
//console.log(webgl);
|
||||
if( webgl )
|
||||
{
|
||||
return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
// return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
}
|
||||
|
||||
return new PIXI.CanvasRenderer(width, height, view, transparent);
|
||||
|
@ -4818,7 +4848,6 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb
|
|||
|
||||
if(displayObject.renderable)
|
||||
{
|
||||
|
||||
this.insertObject(displayObject, previousRenderable, nextRenderable);
|
||||
previousRenderable = displayObject;
|
||||
}
|
||||
|
@ -5396,11 +5425,15 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
|
||||
// one the display object hits this. we can break the loop
|
||||
var testObject = displayObject.last._iNext;
|
||||
if(testObject)
|
||||
{
|
||||
// console.log(testObject.last == displayObject.last)//_iNext);
|
||||
}
|
||||
|
||||
var count = 0;
|
||||
|
||||
var count = 0
|
||||
do
|
||||
{
|
||||
|
||||
transform = displayObject.worldTransform;
|
||||
|
||||
if(!displayObject.visible)
|
||||
|
@ -5414,7 +5447,6 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
displayObject = displayObject._iNext;
|
||||
continue;
|
||||
}
|
||||
count++;
|
||||
|
||||
|
||||
if(displayObject instanceof PIXI.Sprite)
|
||||
|
@ -5459,13 +5491,19 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
PIXI.CanvasGraphics.renderGraphics(displayObject, context);
|
||||
}
|
||||
|
||||
count++
|
||||
displayObject = displayObject._iNext;
|
||||
|
||||
|
||||
}
|
||||
while(displayObject != testObject)
|
||||
|
||||
this.context.setTransform(1,0,0,1,0,0);
|
||||
console.log(count);
|
||||
// this.context.setTransform(1,0,0,1,0,0);
|
||||
}
|
||||
|
||||
var cacheCount;
|
||||
|
||||
PIXI.CanvasRenderer.prototype.renderDisplayObject2 = function(displayObject)
|
||||
{
|
||||
var transform = displayObject.worldTransform;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (c) 2012, Mat Groves
|
||||
* http://goodboydigital.com/
|
||||
*
|
||||
* Compiled: 2013-06-29
|
||||
* Compiled: 2013-06-30
|
||||
*
|
||||
* Pixi.JS is licensed under the MIT License.
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
|
@ -797,7 +797,6 @@ PIXI.DisplayObjectContainer = function()
|
|||
//s
|
||||
this.renderable = false;
|
||||
|
||||
//this.last = this;
|
||||
}
|
||||
|
||||
// constructor
|
||||
|
@ -823,13 +822,16 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'visible', {
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
||||
{
|
||||
//this.addChildAt(child, this.children.length)
|
||||
|
||||
//this.addChildAt(child, this.children.length)
|
||||
// return;
|
||||
|
||||
if(child.parent != undefined)
|
||||
{
|
||||
|
||||
//// COULD BE THIS???
|
||||
child.parent.removeChild(child);
|
||||
// return;
|
||||
}
|
||||
|
||||
child.parent = this;
|
||||
|
@ -861,17 +863,28 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
var previousObject;
|
||||
|
||||
previousObject = this.last;
|
||||
|
||||
// if(this.last._iNext)
|
||||
|
||||
//console.log( this.last._iNext);
|
||||
nextObject = previousObject._iNext;
|
||||
|
||||
// always true in this case
|
||||
this.last = child.last;
|
||||
|
||||
//this.last = child.last;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
var prevLast = this.last;
|
||||
while(updateLast)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
if(updateLast.last == prevLast)
|
||||
{
|
||||
updateLast.last = child.last;
|
||||
}
|
||||
else
|
||||
{
|
||||
// console.log("Not last")
|
||||
}
|
||||
updateLast = updateLast.parent;
|
||||
}
|
||||
|
||||
if(nextObject)
|
||||
|
@ -892,6 +905,13 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
/*
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last);
|
||||
console.log(this.stage.last._iNext)
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -902,9 +922,10 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
||||
{
|
||||
//this.addChild(child);
|
||||
// console.log(child)
|
||||
this.addChild(child);
|
||||
//console.log("AT " + index)
|
||||
//return;
|
||||
return;
|
||||
if(index >= 0 && index <= this.children.length)
|
||||
{
|
||||
if(child.parent != undefined)child.parent.removeChild(child);
|
||||
|
@ -921,6 +942,7 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
while(tmpChild)
|
||||
}
|
||||
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
var childLast = child.last;
|
||||
|
@ -943,10 +965,12 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
else if(index == 0)
|
||||
{
|
||||
// console.log("")
|
||||
previousObject = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
//console.log("!!!")
|
||||
previousObject = this.children[index].last;
|
||||
}
|
||||
|
||||
|
@ -972,6 +996,11 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1049,9 +1078,9 @@ PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
|||
PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
||||
{
|
||||
var index = this.children.indexOf( child );
|
||||
|
||||
if ( index !== -1 )
|
||||
{
|
||||
//console.log(">>")
|
||||
// unlink //
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
|
@ -1065,16 +1094,17 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
|||
|
||||
if(this.last == childLast.last)
|
||||
{
|
||||
this.last = child._iPrev;
|
||||
|
||||
var tempLast = childFirst._iPrev;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
while(updateLast.last == childLast.last)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
updateLast.last = tempLast;
|
||||
updateLast = updateLast.parent;
|
||||
if(!updateLast)break;
|
||||
}
|
||||
}
|
||||
|
||||
childLast._iNext = null;
|
||||
childFirst._iPrev = null;
|
||||
|
||||
|
@ -2703,7 +2733,7 @@ PIXI.autoDetectRenderer = function(width, height, view, transparent)
|
|||
//console.log(webgl);
|
||||
if( webgl )
|
||||
{
|
||||
return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
// return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
}
|
||||
|
||||
return new PIXI.CanvasRenderer(width, height, view, transparent);
|
||||
|
@ -4818,7 +4848,6 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb
|
|||
|
||||
if(displayObject.renderable)
|
||||
{
|
||||
|
||||
this.insertObject(displayObject, previousRenderable, nextRenderable);
|
||||
previousRenderable = displayObject;
|
||||
}
|
||||
|
@ -5396,11 +5425,15 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
|
||||
// one the display object hits this. we can break the loop
|
||||
var testObject = displayObject.last._iNext;
|
||||
if(testObject)
|
||||
{
|
||||
// console.log(testObject.last == displayObject.last)//_iNext);
|
||||
}
|
||||
|
||||
var count = 0;
|
||||
|
||||
var count = 0
|
||||
do
|
||||
{
|
||||
|
||||
transform = displayObject.worldTransform;
|
||||
|
||||
if(!displayObject.visible)
|
||||
|
@ -5414,7 +5447,6 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
displayObject = displayObject._iNext;
|
||||
continue;
|
||||
}
|
||||
count++;
|
||||
|
||||
|
||||
if(displayObject instanceof PIXI.Sprite)
|
||||
|
@ -5459,13 +5491,19 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
PIXI.CanvasGraphics.renderGraphics(displayObject, context);
|
||||
}
|
||||
|
||||
count++
|
||||
displayObject = displayObject._iNext;
|
||||
|
||||
|
||||
}
|
||||
while(displayObject != testObject)
|
||||
|
||||
this.context.setTransform(1,0,0,1,0,0);
|
||||
console.log(count);
|
||||
// this.context.setTransform(1,0,0,1,0,0);
|
||||
}
|
||||
|
||||
var cacheCount;
|
||||
|
||||
PIXI.CanvasRenderer.prototype.renderDisplayObject2 = function(displayObject)
|
||||
{
|
||||
var transform = displayObject.worldTransform;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (c) 2012, Mat Groves
|
||||
* http://goodboydigital.com/
|
||||
*
|
||||
* Compiled: 2013-06-29
|
||||
* Compiled: 2013-06-30
|
||||
*
|
||||
* Pixi.JS is licensed under the MIT License.
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
|
@ -797,7 +797,6 @@ PIXI.DisplayObjectContainer = function()
|
|||
//s
|
||||
this.renderable = false;
|
||||
|
||||
//this.last = this;
|
||||
}
|
||||
|
||||
// constructor
|
||||
|
@ -823,13 +822,16 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'visible', {
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
||||
{
|
||||
//this.addChildAt(child, this.children.length)
|
||||
|
||||
//this.addChildAt(child, this.children.length)
|
||||
// return;
|
||||
|
||||
if(child.parent != undefined)
|
||||
{
|
||||
|
||||
//// COULD BE THIS???
|
||||
child.parent.removeChild(child);
|
||||
// return;
|
||||
}
|
||||
|
||||
child.parent = this;
|
||||
|
@ -861,17 +863,28 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
var previousObject;
|
||||
|
||||
previousObject = this.last;
|
||||
|
||||
// if(this.last._iNext)
|
||||
|
||||
//console.log( this.last._iNext);
|
||||
nextObject = previousObject._iNext;
|
||||
|
||||
// always true in this case
|
||||
this.last = child.last;
|
||||
|
||||
//this.last = child.last;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
var prevLast = this.last;
|
||||
while(updateLast)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
if(updateLast.last == prevLast)
|
||||
{
|
||||
updateLast.last = child.last;
|
||||
}
|
||||
else
|
||||
{
|
||||
// console.log("Not last")
|
||||
}
|
||||
updateLast = updateLast.parent;
|
||||
}
|
||||
|
||||
if(nextObject)
|
||||
|
@ -892,6 +905,13 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
/*
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last);
|
||||
console.log(this.stage.last._iNext)
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -902,9 +922,10 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
||||
{
|
||||
//this.addChild(child);
|
||||
// console.log(child)
|
||||
this.addChild(child);
|
||||
//console.log("AT " + index)
|
||||
//return;
|
||||
return;
|
||||
if(index >= 0 && index <= this.children.length)
|
||||
{
|
||||
if(child.parent != undefined)child.parent.removeChild(child);
|
||||
|
@ -921,6 +942,7 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
while(tmpChild)
|
||||
}
|
||||
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
var childLast = child.last;
|
||||
|
@ -943,10 +965,12 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
else if(index == 0)
|
||||
{
|
||||
// console.log("")
|
||||
previousObject = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
//console.log("!!!")
|
||||
previousObject = this.children[index].last;
|
||||
}
|
||||
|
||||
|
@ -972,6 +996,11 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1049,9 +1078,9 @@ PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
|||
PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
||||
{
|
||||
var index = this.children.indexOf( child );
|
||||
|
||||
if ( index !== -1 )
|
||||
{
|
||||
//console.log(">>")
|
||||
// unlink //
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
|
@ -1065,16 +1094,17 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
|||
|
||||
if(this.last == childLast.last)
|
||||
{
|
||||
this.last = child._iPrev;
|
||||
|
||||
var tempLast = childFirst._iPrev;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
while(updateLast.last == childLast.last)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
updateLast.last = tempLast;
|
||||
updateLast = updateLast.parent;
|
||||
if(!updateLast)break;
|
||||
}
|
||||
}
|
||||
|
||||
childLast._iNext = null;
|
||||
childFirst._iPrev = null;
|
||||
|
||||
|
@ -2703,7 +2733,7 @@ PIXI.autoDetectRenderer = function(width, height, view, transparent)
|
|||
//console.log(webgl);
|
||||
if( webgl )
|
||||
{
|
||||
return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
// return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
}
|
||||
|
||||
return new PIXI.CanvasRenderer(width, height, view, transparent);
|
||||
|
@ -4818,7 +4848,6 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb
|
|||
|
||||
if(displayObject.renderable)
|
||||
{
|
||||
|
||||
this.insertObject(displayObject, previousRenderable, nextRenderable);
|
||||
previousRenderable = displayObject;
|
||||
}
|
||||
|
@ -5396,11 +5425,15 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
|
||||
// one the display object hits this. we can break the loop
|
||||
var testObject = displayObject.last._iNext;
|
||||
if(testObject)
|
||||
{
|
||||
// console.log(testObject.last == displayObject.last)//_iNext);
|
||||
}
|
||||
|
||||
var count = 0;
|
||||
|
||||
var count = 0
|
||||
do
|
||||
{
|
||||
|
||||
transform = displayObject.worldTransform;
|
||||
|
||||
if(!displayObject.visible)
|
||||
|
@ -5414,7 +5447,6 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
displayObject = displayObject._iNext;
|
||||
continue;
|
||||
}
|
||||
count++;
|
||||
|
||||
|
||||
if(displayObject instanceof PIXI.Sprite)
|
||||
|
@ -5459,13 +5491,19 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
PIXI.CanvasGraphics.renderGraphics(displayObject, context);
|
||||
}
|
||||
|
||||
count++
|
||||
displayObject = displayObject._iNext;
|
||||
|
||||
|
||||
}
|
||||
while(displayObject != testObject)
|
||||
|
||||
this.context.setTransform(1,0,0,1,0,0);
|
||||
console.log(count);
|
||||
// this.context.setTransform(1,0,0,1,0,0);
|
||||
}
|
||||
|
||||
var cacheCount;
|
||||
|
||||
PIXI.CanvasRenderer.prototype.renderDisplayObject2 = function(displayObject)
|
||||
{
|
||||
var transform = displayObject.worldTransform;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (c) 2012, Mat Groves
|
||||
* http://goodboydigital.com/
|
||||
*
|
||||
* Compiled: 2013-06-29
|
||||
* Compiled: 2013-06-30
|
||||
*
|
||||
* Pixi.JS is licensed under the MIT License.
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
|
@ -797,7 +797,6 @@ PIXI.DisplayObjectContainer = function()
|
|||
//s
|
||||
this.renderable = false;
|
||||
|
||||
//this.last = this;
|
||||
}
|
||||
|
||||
// constructor
|
||||
|
@ -823,13 +822,16 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'visible', {
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
||||
{
|
||||
//this.addChildAt(child, this.children.length)
|
||||
|
||||
//this.addChildAt(child, this.children.length)
|
||||
// return;
|
||||
|
||||
if(child.parent != undefined)
|
||||
{
|
||||
|
||||
//// COULD BE THIS???
|
||||
child.parent.removeChild(child);
|
||||
// return;
|
||||
}
|
||||
|
||||
child.parent = this;
|
||||
|
@ -861,17 +863,28 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
var previousObject;
|
||||
|
||||
previousObject = this.last;
|
||||
|
||||
// if(this.last._iNext)
|
||||
|
||||
//console.log( this.last._iNext);
|
||||
nextObject = previousObject._iNext;
|
||||
|
||||
// always true in this case
|
||||
this.last = child.last;
|
||||
|
||||
//this.last = child.last;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
var prevLast = this.last;
|
||||
while(updateLast)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
if(updateLast.last == prevLast)
|
||||
{
|
||||
updateLast.last = child.last;
|
||||
}
|
||||
else
|
||||
{
|
||||
// console.log("Not last")
|
||||
}
|
||||
updateLast = updateLast.parent;
|
||||
}
|
||||
|
||||
if(nextObject)
|
||||
|
@ -892,6 +905,13 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
/*
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last);
|
||||
console.log(this.stage.last._iNext)
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -902,9 +922,10 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
||||
{
|
||||
//this.addChild(child);
|
||||
// console.log(child)
|
||||
this.addChild(child);
|
||||
//console.log("AT " + index)
|
||||
//return;
|
||||
return;
|
||||
if(index >= 0 && index <= this.children.length)
|
||||
{
|
||||
if(child.parent != undefined)child.parent.removeChild(child);
|
||||
|
@ -921,6 +942,7 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
while(tmpChild)
|
||||
}
|
||||
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
var childLast = child.last;
|
||||
|
@ -943,10 +965,12 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
else if(index == 0)
|
||||
{
|
||||
// console.log("")
|
||||
previousObject = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
//console.log("!!!")
|
||||
previousObject = this.children[index].last;
|
||||
}
|
||||
|
||||
|
@ -972,6 +996,11 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1049,9 +1078,9 @@ PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
|||
PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
||||
{
|
||||
var index = this.children.indexOf( child );
|
||||
|
||||
if ( index !== -1 )
|
||||
{
|
||||
//console.log(">>")
|
||||
// unlink //
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
|
@ -1065,16 +1094,17 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
|||
|
||||
if(this.last == childLast.last)
|
||||
{
|
||||
this.last = child._iPrev;
|
||||
|
||||
var tempLast = childFirst._iPrev;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
while(updateLast.last == childLast.last)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
updateLast.last = tempLast;
|
||||
updateLast = updateLast.parent;
|
||||
if(!updateLast)break;
|
||||
}
|
||||
}
|
||||
|
||||
childLast._iNext = null;
|
||||
childFirst._iPrev = null;
|
||||
|
||||
|
@ -2703,7 +2733,7 @@ PIXI.autoDetectRenderer = function(width, height, view, transparent)
|
|||
//console.log(webgl);
|
||||
if( webgl )
|
||||
{
|
||||
return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
// return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
}
|
||||
|
||||
return new PIXI.CanvasRenderer(width, height, view, transparent);
|
||||
|
@ -4818,7 +4848,6 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb
|
|||
|
||||
if(displayObject.renderable)
|
||||
{
|
||||
|
||||
this.insertObject(displayObject, previousRenderable, nextRenderable);
|
||||
previousRenderable = displayObject;
|
||||
}
|
||||
|
@ -5396,11 +5425,15 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
|
||||
// one the display object hits this. we can break the loop
|
||||
var testObject = displayObject.last._iNext;
|
||||
if(testObject)
|
||||
{
|
||||
// console.log(testObject.last == displayObject.last)//_iNext);
|
||||
}
|
||||
|
||||
var count = 0;
|
||||
|
||||
var count = 0
|
||||
do
|
||||
{
|
||||
|
||||
transform = displayObject.worldTransform;
|
||||
|
||||
if(!displayObject.visible)
|
||||
|
@ -5414,7 +5447,6 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
displayObject = displayObject._iNext;
|
||||
continue;
|
||||
}
|
||||
count++;
|
||||
|
||||
|
||||
if(displayObject instanceof PIXI.Sprite)
|
||||
|
@ -5459,13 +5491,19 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
PIXI.CanvasGraphics.renderGraphics(displayObject, context);
|
||||
}
|
||||
|
||||
count++
|
||||
displayObject = displayObject._iNext;
|
||||
|
||||
|
||||
}
|
||||
while(displayObject != testObject)
|
||||
|
||||
this.context.setTransform(1,0,0,1,0,0);
|
||||
console.log(count);
|
||||
// this.context.setTransform(1,0,0,1,0,0);
|
||||
}
|
||||
|
||||
var cacheCount;
|
||||
|
||||
PIXI.CanvasRenderer.prototype.renderDisplayObject2 = function(displayObject)
|
||||
{
|
||||
var transform = displayObject.worldTransform;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (c) 2012, Mat Groves
|
||||
* http://goodboydigital.com/
|
||||
*
|
||||
* Compiled: 2013-06-29
|
||||
* Compiled: 2013-06-30
|
||||
*
|
||||
* Pixi.JS is licensed under the MIT License.
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
|
@ -797,7 +797,6 @@ PIXI.DisplayObjectContainer = function()
|
|||
//s
|
||||
this.renderable = false;
|
||||
|
||||
//this.last = this;
|
||||
}
|
||||
|
||||
// constructor
|
||||
|
@ -823,13 +822,16 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'visible', {
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
||||
{
|
||||
//this.addChildAt(child, this.children.length)
|
||||
|
||||
//this.addChildAt(child, this.children.length)
|
||||
// return;
|
||||
|
||||
if(child.parent != undefined)
|
||||
{
|
||||
|
||||
//// COULD BE THIS???
|
||||
child.parent.removeChild(child);
|
||||
// return;
|
||||
}
|
||||
|
||||
child.parent = this;
|
||||
|
@ -861,17 +863,28 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
var previousObject;
|
||||
|
||||
previousObject = this.last;
|
||||
|
||||
// if(this.last._iNext)
|
||||
|
||||
//console.log( this.last._iNext);
|
||||
nextObject = previousObject._iNext;
|
||||
|
||||
// always true in this case
|
||||
this.last = child.last;
|
||||
|
||||
//this.last = child.last;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
var prevLast = this.last;
|
||||
while(updateLast)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
if(updateLast.last == prevLast)
|
||||
{
|
||||
updateLast.last = child.last;
|
||||
}
|
||||
else
|
||||
{
|
||||
// console.log("Not last")
|
||||
}
|
||||
updateLast = updateLast.parent;
|
||||
}
|
||||
|
||||
if(nextObject)
|
||||
|
@ -892,6 +905,13 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
/*
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last);
|
||||
console.log(this.stage.last._iNext)
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -902,9 +922,10 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
||||
{
|
||||
//this.addChild(child);
|
||||
// console.log(child)
|
||||
this.addChild(child);
|
||||
//console.log("AT " + index)
|
||||
//return;
|
||||
return;
|
||||
if(index >= 0 && index <= this.children.length)
|
||||
{
|
||||
if(child.parent != undefined)child.parent.removeChild(child);
|
||||
|
@ -921,6 +942,7 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
while(tmpChild)
|
||||
}
|
||||
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
var childLast = child.last;
|
||||
|
@ -943,10 +965,12 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
else if(index == 0)
|
||||
{
|
||||
// console.log("")
|
||||
previousObject = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
//console.log("!!!")
|
||||
previousObject = this.children[index].last;
|
||||
}
|
||||
|
||||
|
@ -972,6 +996,11 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1049,9 +1078,9 @@ PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
|||
PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
||||
{
|
||||
var index = this.children.indexOf( child );
|
||||
|
||||
if ( index !== -1 )
|
||||
{
|
||||
//console.log(">>")
|
||||
// unlink //
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
|
@ -1065,16 +1094,17 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
|||
|
||||
if(this.last == childLast.last)
|
||||
{
|
||||
this.last = child._iPrev;
|
||||
|
||||
var tempLast = childFirst._iPrev;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
while(updateLast.last == childLast.last)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
updateLast.last = tempLast;
|
||||
updateLast = updateLast.parent;
|
||||
if(!updateLast)break;
|
||||
}
|
||||
}
|
||||
|
||||
childLast._iNext = null;
|
||||
childFirst._iPrev = null;
|
||||
|
||||
|
@ -2703,7 +2733,7 @@ PIXI.autoDetectRenderer = function(width, height, view, transparent)
|
|||
//console.log(webgl);
|
||||
if( webgl )
|
||||
{
|
||||
return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
// return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
}
|
||||
|
||||
return new PIXI.CanvasRenderer(width, height, view, transparent);
|
||||
|
@ -4818,7 +4848,6 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb
|
|||
|
||||
if(displayObject.renderable)
|
||||
{
|
||||
|
||||
this.insertObject(displayObject, previousRenderable, nextRenderable);
|
||||
previousRenderable = displayObject;
|
||||
}
|
||||
|
@ -5396,11 +5425,15 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
|
||||
// one the display object hits this. we can break the loop
|
||||
var testObject = displayObject.last._iNext;
|
||||
if(testObject)
|
||||
{
|
||||
// console.log(testObject.last == displayObject.last)//_iNext);
|
||||
}
|
||||
|
||||
var count = 0;
|
||||
|
||||
var count = 0
|
||||
do
|
||||
{
|
||||
|
||||
transform = displayObject.worldTransform;
|
||||
|
||||
if(!displayObject.visible)
|
||||
|
@ -5414,7 +5447,6 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
displayObject = displayObject._iNext;
|
||||
continue;
|
||||
}
|
||||
count++;
|
||||
|
||||
|
||||
if(displayObject instanceof PIXI.Sprite)
|
||||
|
@ -5459,13 +5491,19 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
PIXI.CanvasGraphics.renderGraphics(displayObject, context);
|
||||
}
|
||||
|
||||
count++
|
||||
displayObject = displayObject._iNext;
|
||||
|
||||
|
||||
}
|
||||
while(displayObject != testObject)
|
||||
|
||||
this.context.setTransform(1,0,0,1,0,0);
|
||||
console.log(count);
|
||||
// this.context.setTransform(1,0,0,1,0,0);
|
||||
}
|
||||
|
||||
var cacheCount;
|
||||
|
||||
PIXI.CanvasRenderer.prototype.renderDisplayObject2 = function(displayObject)
|
||||
{
|
||||
var transform = displayObject.worldTransform;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (c) 2012, Mat Groves
|
||||
* http://goodboydigital.com/
|
||||
*
|
||||
* Compiled: 2013-06-29
|
||||
* Compiled: 2013-06-30
|
||||
*
|
||||
* Pixi.JS is licensed under the MIT License.
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
|
@ -797,7 +797,6 @@ PIXI.DisplayObjectContainer = function()
|
|||
//s
|
||||
this.renderable = false;
|
||||
|
||||
//this.last = this;
|
||||
}
|
||||
|
||||
// constructor
|
||||
|
@ -823,13 +822,16 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'visible', {
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
||||
{
|
||||
//this.addChildAt(child, this.children.length)
|
||||
|
||||
//this.addChildAt(child, this.children.length)
|
||||
// return;
|
||||
|
||||
if(child.parent != undefined)
|
||||
{
|
||||
|
||||
//// COULD BE THIS???
|
||||
child.parent.removeChild(child);
|
||||
// return;
|
||||
}
|
||||
|
||||
child.parent = this;
|
||||
|
@ -861,17 +863,28 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
var previousObject;
|
||||
|
||||
previousObject = this.last;
|
||||
|
||||
// if(this.last._iNext)
|
||||
|
||||
//console.log( this.last._iNext);
|
||||
nextObject = previousObject._iNext;
|
||||
|
||||
// always true in this case
|
||||
this.last = child.last;
|
||||
|
||||
//this.last = child.last;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
var prevLast = this.last;
|
||||
while(updateLast)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
if(updateLast.last == prevLast)
|
||||
{
|
||||
updateLast.last = child.last;
|
||||
}
|
||||
else
|
||||
{
|
||||
// console.log("Not last")
|
||||
}
|
||||
updateLast = updateLast.parent;
|
||||
}
|
||||
|
||||
if(nextObject)
|
||||
|
@ -892,6 +905,13 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
/*
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last);
|
||||
console.log(this.stage.last._iNext)
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -902,9 +922,10 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
||||
{
|
||||
//this.addChild(child);
|
||||
// console.log(child)
|
||||
this.addChild(child);
|
||||
//console.log("AT " + index)
|
||||
//return;
|
||||
return;
|
||||
if(index >= 0 && index <= this.children.length)
|
||||
{
|
||||
if(child.parent != undefined)child.parent.removeChild(child);
|
||||
|
@ -921,6 +942,7 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
while(tmpChild)
|
||||
}
|
||||
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
var childLast = child.last;
|
||||
|
@ -943,10 +965,12 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
else if(index == 0)
|
||||
{
|
||||
// console.log("")
|
||||
previousObject = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
//console.log("!!!")
|
||||
previousObject = this.children[index].last;
|
||||
}
|
||||
|
||||
|
@ -972,6 +996,11 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1049,9 +1078,9 @@ PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
|||
PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
||||
{
|
||||
var index = this.children.indexOf( child );
|
||||
|
||||
if ( index !== -1 )
|
||||
{
|
||||
//console.log(">>")
|
||||
// unlink //
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
|
@ -1065,16 +1094,17 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
|||
|
||||
if(this.last == childLast.last)
|
||||
{
|
||||
this.last = child._iPrev;
|
||||
|
||||
var tempLast = childFirst._iPrev;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
while(updateLast.last == childLast.last)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
updateLast.last = tempLast;
|
||||
updateLast = updateLast.parent;
|
||||
if(!updateLast)break;
|
||||
}
|
||||
}
|
||||
|
||||
childLast._iNext = null;
|
||||
childFirst._iPrev = null;
|
||||
|
||||
|
@ -2703,7 +2733,7 @@ PIXI.autoDetectRenderer = function(width, height, view, transparent)
|
|||
//console.log(webgl);
|
||||
if( webgl )
|
||||
{
|
||||
return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
// return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
}
|
||||
|
||||
return new PIXI.CanvasRenderer(width, height, view, transparent);
|
||||
|
@ -4818,7 +4848,6 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb
|
|||
|
||||
if(displayObject.renderable)
|
||||
{
|
||||
|
||||
this.insertObject(displayObject, previousRenderable, nextRenderable);
|
||||
previousRenderable = displayObject;
|
||||
}
|
||||
|
@ -5396,11 +5425,15 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
|
||||
// one the display object hits this. we can break the loop
|
||||
var testObject = displayObject.last._iNext;
|
||||
if(testObject)
|
||||
{
|
||||
// console.log(testObject.last == displayObject.last)//_iNext);
|
||||
}
|
||||
|
||||
var count = 0;
|
||||
|
||||
var count = 0
|
||||
do
|
||||
{
|
||||
|
||||
transform = displayObject.worldTransform;
|
||||
|
||||
if(!displayObject.visible)
|
||||
|
@ -5414,7 +5447,6 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
displayObject = displayObject._iNext;
|
||||
continue;
|
||||
}
|
||||
count++;
|
||||
|
||||
|
||||
if(displayObject instanceof PIXI.Sprite)
|
||||
|
@ -5459,13 +5491,19 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
PIXI.CanvasGraphics.renderGraphics(displayObject, context);
|
||||
}
|
||||
|
||||
count++
|
||||
displayObject = displayObject._iNext;
|
||||
|
||||
|
||||
}
|
||||
while(displayObject != testObject)
|
||||
|
||||
this.context.setTransform(1,0,0,1,0,0);
|
||||
console.log(count);
|
||||
// this.context.setTransform(1,0,0,1,0,0);
|
||||
}
|
||||
|
||||
var cacheCount;
|
||||
|
||||
PIXI.CanvasRenderer.prototype.renderDisplayObject2 = function(displayObject)
|
||||
{
|
||||
var transform = displayObject.worldTransform;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (c) 2012, Mat Groves
|
||||
* http://goodboydigital.com/
|
||||
*
|
||||
* Compiled: 2013-06-29
|
||||
* Compiled: 2013-06-30
|
||||
*
|
||||
* Pixi.JS is licensed under the MIT License.
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
|
@ -797,7 +797,6 @@ PIXI.DisplayObjectContainer = function()
|
|||
//s
|
||||
this.renderable = false;
|
||||
|
||||
//this.last = this;
|
||||
}
|
||||
|
||||
// constructor
|
||||
|
@ -823,13 +822,16 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'visible', {
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
||||
{
|
||||
//this.addChildAt(child, this.children.length)
|
||||
|
||||
//this.addChildAt(child, this.children.length)
|
||||
// return;
|
||||
|
||||
if(child.parent != undefined)
|
||||
{
|
||||
|
||||
//// COULD BE THIS???
|
||||
child.parent.removeChild(child);
|
||||
// return;
|
||||
}
|
||||
|
||||
child.parent = this;
|
||||
|
@ -861,17 +863,28 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
var previousObject;
|
||||
|
||||
previousObject = this.last;
|
||||
|
||||
// if(this.last._iNext)
|
||||
|
||||
//console.log( this.last._iNext);
|
||||
nextObject = previousObject._iNext;
|
||||
|
||||
// always true in this case
|
||||
this.last = child.last;
|
||||
|
||||
//this.last = child.last;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
var prevLast = this.last;
|
||||
while(updateLast)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
if(updateLast.last == prevLast)
|
||||
{
|
||||
updateLast.last = child.last;
|
||||
}
|
||||
else
|
||||
{
|
||||
// console.log("Not last")
|
||||
}
|
||||
updateLast = updateLast.parent;
|
||||
}
|
||||
|
||||
if(nextObject)
|
||||
|
@ -892,6 +905,13 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
/*
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last);
|
||||
console.log(this.stage.last._iNext)
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -902,9 +922,10 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
||||
{
|
||||
//this.addChild(child);
|
||||
// console.log(child)
|
||||
this.addChild(child);
|
||||
//console.log("AT " + index)
|
||||
//return;
|
||||
return;
|
||||
if(index >= 0 && index <= this.children.length)
|
||||
{
|
||||
if(child.parent != undefined)child.parent.removeChild(child);
|
||||
|
@ -921,6 +942,7 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
while(tmpChild)
|
||||
}
|
||||
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
var childLast = child.last;
|
||||
|
@ -943,10 +965,12 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
else if(index == 0)
|
||||
{
|
||||
// console.log("")
|
||||
previousObject = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
//console.log("!!!")
|
||||
previousObject = this.children[index].last;
|
||||
}
|
||||
|
||||
|
@ -972,6 +996,11 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1049,9 +1078,9 @@ PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
|||
PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
||||
{
|
||||
var index = this.children.indexOf( child );
|
||||
|
||||
if ( index !== -1 )
|
||||
{
|
||||
//console.log(">>")
|
||||
// unlink //
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
|
@ -1065,16 +1094,17 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
|||
|
||||
if(this.last == childLast.last)
|
||||
{
|
||||
this.last = child._iPrev;
|
||||
|
||||
var tempLast = childFirst._iPrev;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
while(updateLast.last == childLast.last)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
updateLast.last = tempLast;
|
||||
updateLast = updateLast.parent;
|
||||
if(!updateLast)break;
|
||||
}
|
||||
}
|
||||
|
||||
childLast._iNext = null;
|
||||
childFirst._iPrev = null;
|
||||
|
||||
|
@ -2703,7 +2733,7 @@ PIXI.autoDetectRenderer = function(width, height, view, transparent)
|
|||
//console.log(webgl);
|
||||
if( webgl )
|
||||
{
|
||||
return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
// return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
}
|
||||
|
||||
return new PIXI.CanvasRenderer(width, height, view, transparent);
|
||||
|
@ -4818,7 +4848,6 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb
|
|||
|
||||
if(displayObject.renderable)
|
||||
{
|
||||
|
||||
this.insertObject(displayObject, previousRenderable, nextRenderable);
|
||||
previousRenderable = displayObject;
|
||||
}
|
||||
|
@ -5396,11 +5425,15 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
|
||||
// one the display object hits this. we can break the loop
|
||||
var testObject = displayObject.last._iNext;
|
||||
if(testObject)
|
||||
{
|
||||
// console.log(testObject.last == displayObject.last)//_iNext);
|
||||
}
|
||||
|
||||
var count = 0;
|
||||
|
||||
var count = 0
|
||||
do
|
||||
{
|
||||
|
||||
transform = displayObject.worldTransform;
|
||||
|
||||
if(!displayObject.visible)
|
||||
|
@ -5414,7 +5447,6 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
displayObject = displayObject._iNext;
|
||||
continue;
|
||||
}
|
||||
count++;
|
||||
|
||||
|
||||
if(displayObject instanceof PIXI.Sprite)
|
||||
|
@ -5459,13 +5491,19 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
PIXI.CanvasGraphics.renderGraphics(displayObject, context);
|
||||
}
|
||||
|
||||
count++
|
||||
displayObject = displayObject._iNext;
|
||||
|
||||
|
||||
}
|
||||
while(displayObject != testObject)
|
||||
|
||||
this.context.setTransform(1,0,0,1,0,0);
|
||||
console.log(count);
|
||||
// this.context.setTransform(1,0,0,1,0,0);
|
||||
}
|
||||
|
||||
var cacheCount;
|
||||
|
||||
PIXI.CanvasRenderer.prototype.renderDisplayObject2 = function(displayObject)
|
||||
{
|
||||
var transform = displayObject.worldTransform;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (c) 2012, Mat Groves
|
||||
* http://goodboydigital.com/
|
||||
*
|
||||
* Compiled: 2013-06-29
|
||||
* Compiled: 2013-06-30
|
||||
*
|
||||
* Pixi.JS is licensed under the MIT License.
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
|
@ -797,7 +797,6 @@ PIXI.DisplayObjectContainer = function()
|
|||
//s
|
||||
this.renderable = false;
|
||||
|
||||
//this.last = this;
|
||||
}
|
||||
|
||||
// constructor
|
||||
|
@ -823,13 +822,16 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'visible', {
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
||||
{
|
||||
//this.addChildAt(child, this.children.length)
|
||||
|
||||
//this.addChildAt(child, this.children.length)
|
||||
// return;
|
||||
|
||||
if(child.parent != undefined)
|
||||
{
|
||||
|
||||
//// COULD BE THIS???
|
||||
child.parent.removeChild(child);
|
||||
// return;
|
||||
}
|
||||
|
||||
child.parent = this;
|
||||
|
@ -861,17 +863,28 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
var previousObject;
|
||||
|
||||
previousObject = this.last;
|
||||
|
||||
// if(this.last._iNext)
|
||||
|
||||
//console.log( this.last._iNext);
|
||||
nextObject = previousObject._iNext;
|
||||
|
||||
// always true in this case
|
||||
this.last = child.last;
|
||||
|
||||
//this.last = child.last;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
var prevLast = this.last;
|
||||
while(updateLast)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
if(updateLast.last == prevLast)
|
||||
{
|
||||
updateLast.last = child.last;
|
||||
}
|
||||
else
|
||||
{
|
||||
// console.log("Not last")
|
||||
}
|
||||
updateLast = updateLast.parent;
|
||||
}
|
||||
|
||||
if(nextObject)
|
||||
|
@ -892,6 +905,13 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
/*
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last);
|
||||
console.log(this.stage.last._iNext)
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -902,9 +922,10 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
||||
{
|
||||
//this.addChild(child);
|
||||
// console.log(child)
|
||||
this.addChild(child);
|
||||
//console.log("AT " + index)
|
||||
//return;
|
||||
return;
|
||||
if(index >= 0 && index <= this.children.length)
|
||||
{
|
||||
if(child.parent != undefined)child.parent.removeChild(child);
|
||||
|
@ -921,6 +942,7 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
while(tmpChild)
|
||||
}
|
||||
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
var childLast = child.last;
|
||||
|
@ -943,10 +965,12 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
else if(index == 0)
|
||||
{
|
||||
// console.log("")
|
||||
previousObject = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
//console.log("!!!")
|
||||
previousObject = this.children[index].last;
|
||||
}
|
||||
|
||||
|
@ -972,6 +996,11 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1049,9 +1078,9 @@ PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
|||
PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
||||
{
|
||||
var index = this.children.indexOf( child );
|
||||
|
||||
if ( index !== -1 )
|
||||
{
|
||||
//console.log(">>")
|
||||
// unlink //
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
|
@ -1065,16 +1094,17 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
|||
|
||||
if(this.last == childLast.last)
|
||||
{
|
||||
this.last = child._iPrev;
|
||||
|
||||
var tempLast = childFirst._iPrev;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
while(updateLast.last == childLast.last)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
updateLast.last = tempLast;
|
||||
updateLast = updateLast.parent;
|
||||
if(!updateLast)break;
|
||||
}
|
||||
}
|
||||
|
||||
childLast._iNext = null;
|
||||
childFirst._iPrev = null;
|
||||
|
||||
|
@ -2703,7 +2733,7 @@ PIXI.autoDetectRenderer = function(width, height, view, transparent)
|
|||
//console.log(webgl);
|
||||
if( webgl )
|
||||
{
|
||||
return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
// return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
}
|
||||
|
||||
return new PIXI.CanvasRenderer(width, height, view, transparent);
|
||||
|
@ -4818,7 +4848,6 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb
|
|||
|
||||
if(displayObject.renderable)
|
||||
{
|
||||
|
||||
this.insertObject(displayObject, previousRenderable, nextRenderable);
|
||||
previousRenderable = displayObject;
|
||||
}
|
||||
|
@ -5396,11 +5425,15 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
|
||||
// one the display object hits this. we can break the loop
|
||||
var testObject = displayObject.last._iNext;
|
||||
if(testObject)
|
||||
{
|
||||
// console.log(testObject.last == displayObject.last)//_iNext);
|
||||
}
|
||||
|
||||
var count = 0;
|
||||
|
||||
var count = 0
|
||||
do
|
||||
{
|
||||
|
||||
transform = displayObject.worldTransform;
|
||||
|
||||
if(!displayObject.visible)
|
||||
|
@ -5414,7 +5447,6 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
displayObject = displayObject._iNext;
|
||||
continue;
|
||||
}
|
||||
count++;
|
||||
|
||||
|
||||
if(displayObject instanceof PIXI.Sprite)
|
||||
|
@ -5459,13 +5491,19 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
PIXI.CanvasGraphics.renderGraphics(displayObject, context);
|
||||
}
|
||||
|
||||
count++
|
||||
displayObject = displayObject._iNext;
|
||||
|
||||
|
||||
}
|
||||
while(displayObject != testObject)
|
||||
|
||||
this.context.setTransform(1,0,0,1,0,0);
|
||||
console.log(count);
|
||||
// this.context.setTransform(1,0,0,1,0,0);
|
||||
}
|
||||
|
||||
var cacheCount;
|
||||
|
||||
PIXI.CanvasRenderer.prototype.renderDisplayObject2 = function(displayObject)
|
||||
{
|
||||
var transform = displayObject.worldTransform;
|
||||
|
|
|
@ -21,7 +21,6 @@ PIXI.DisplayObjectContainer = function()
|
|||
//s
|
||||
this.renderable = false;
|
||||
|
||||
//this.last = this;
|
||||
}
|
||||
|
||||
// constructor
|
||||
|
@ -47,13 +46,16 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'visible', {
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
||||
{
|
||||
//this.addChildAt(child, this.children.length)
|
||||
|
||||
//this.addChildAt(child, this.children.length)
|
||||
// return;
|
||||
|
||||
if(child.parent != undefined)
|
||||
{
|
||||
|
||||
//// COULD BE THIS???
|
||||
child.parent.removeChild(child);
|
||||
// return;
|
||||
}
|
||||
|
||||
child.parent = this;
|
||||
|
@ -85,17 +87,28 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
var previousObject;
|
||||
|
||||
previousObject = this.last;
|
||||
|
||||
// if(this.last._iNext)
|
||||
|
||||
//console.log( this.last._iNext);
|
||||
nextObject = previousObject._iNext;
|
||||
|
||||
// always true in this case
|
||||
this.last = child.last;
|
||||
|
||||
//this.last = child.last;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
var prevLast = this.last;
|
||||
while(updateLast)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
if(updateLast.last == prevLast)
|
||||
{
|
||||
updateLast.last = child.last;
|
||||
}
|
||||
else
|
||||
{
|
||||
// console.log("Not last")
|
||||
}
|
||||
updateLast = updateLast.parent;
|
||||
}
|
||||
|
||||
if(nextObject)
|
||||
|
@ -116,6 +129,13 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
/*
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last);
|
||||
console.log(this.stage.last._iNext)
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -126,9 +146,10 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
||||
{
|
||||
//this.addChild(child);
|
||||
// console.log(child)
|
||||
this.addChild(child);
|
||||
//console.log("AT " + index)
|
||||
//return;
|
||||
return;
|
||||
if(index >= 0 && index <= this.children.length)
|
||||
{
|
||||
if(child.parent != undefined)child.parent.removeChild(child);
|
||||
|
@ -145,6 +166,7 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
while(tmpChild)
|
||||
}
|
||||
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
var childLast = child.last;
|
||||
|
@ -167,10 +189,12 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
}
|
||||
else if(index == 0)
|
||||
{
|
||||
// console.log("")
|
||||
previousObject = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
//console.log("!!!")
|
||||
previousObject = this.children[index].last;
|
||||
}
|
||||
|
||||
|
@ -196,6 +220,11 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
|
|||
// add them to the new render group..
|
||||
this.__renderGroup.addDisplayObjectAndChildren(child);
|
||||
}
|
||||
|
||||
if(this.stage)
|
||||
{
|
||||
console.log(this.stage.last == child.last );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -273,9 +302,9 @@ PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
|
|||
PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
||||
{
|
||||
var index = this.children.indexOf( child );
|
||||
|
||||
if ( index !== -1 )
|
||||
{
|
||||
//console.log(">>")
|
||||
// unlink //
|
||||
// modify the list..
|
||||
var childFirst = child.first
|
||||
|
@ -289,16 +318,17 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
|
|||
|
||||
if(this.last == childLast.last)
|
||||
{
|
||||
this.last = child._iPrev;
|
||||
|
||||
var tempLast = childFirst._iPrev;
|
||||
// need to make sure the parents last is updated too
|
||||
var updateParent = this.parent;
|
||||
while(updateParent)
|
||||
var updateLast = this;//.parent;
|
||||
while(updateLast.last == childLast.last)
|
||||
{
|
||||
updateParent.last = this.last
|
||||
updateParent = updateParent.parent;
|
||||
updateLast.last = tempLast;
|
||||
updateLast = updateLast.parent;
|
||||
if(!updateLast)break;
|
||||
}
|
||||
}
|
||||
|
||||
childLast._iNext = null;
|
||||
childFirst._iPrev = null;
|
||||
|
||||
|
|
|
@ -133,11 +133,15 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
|
||||
// one the display object hits this. we can break the loop
|
||||
var testObject = displayObject.last._iNext;
|
||||
if(testObject)
|
||||
{
|
||||
// console.log(testObject.last == displayObject.last)//_iNext);
|
||||
}
|
||||
|
||||
var count = 0;
|
||||
|
||||
var count = 0
|
||||
do
|
||||
{
|
||||
|
||||
transform = displayObject.worldTransform;
|
||||
|
||||
if(!displayObject.visible)
|
||||
|
@ -151,7 +155,6 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
displayObject = displayObject._iNext;
|
||||
continue;
|
||||
}
|
||||
count++;
|
||||
|
||||
|
||||
if(displayObject instanceof PIXI.Sprite)
|
||||
|
@ -196,13 +199,19 @@ PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject)
|
|||
PIXI.CanvasGraphics.renderGraphics(displayObject, context);
|
||||
}
|
||||
|
||||
count++
|
||||
displayObject = displayObject._iNext;
|
||||
|
||||
|
||||
}
|
||||
while(displayObject != testObject)
|
||||
|
||||
this.context.setTransform(1,0,0,1,0,0);
|
||||
console.log(count);
|
||||
// this.context.setTransform(1,0,0,1,0,0);
|
||||
}
|
||||
|
||||
var cacheCount;
|
||||
|
||||
PIXI.CanvasRenderer.prototype.renderDisplayObject2 = function(displayObject)
|
||||
{
|
||||
var transform = displayObject.worldTransform;
|
||||
|
|
|
@ -364,7 +364,6 @@ PIXI.WebGLRenderGroup.prototype.addDisplayObjectAndChildren = function(displayOb
|
|||
|
||||
if(displayObject.renderable)
|
||||
{
|
||||
|
||||
this.insertObject(displayObject, previousRenderable, nextRenderable);
|
||||
previousRenderable = displayObject;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ PIXI.autoDetectRenderer = function(width, height, view, transparent)
|
|||
//console.log(webgl);
|
||||
if( webgl )
|
||||
{
|
||||
return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
// return new PIXI.WebGLRenderer(width, height, view, transparent);
|
||||
}
|
||||
|
||||
return new PIXI.CanvasRenderer(width, height, view, transparent);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue