Skip to content

Commit

Permalink
Reverted some unfinished optimizations in pulse.Layer.
Browse files Browse the repository at this point in the history
  • Loading branch information
InconceivableDuck committed Jul 10, 2012
1 parent d62378e commit 0579ffe
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions lib/pulse/src/visual/layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ pulse.Layer = pulse.Visual.extend(
*/
this.objects = {};

this._private.objectArray = [];

/**
* The ordered keys of the child nodes.
* @type {array}
Expand Down Expand Up @@ -171,7 +169,6 @@ pulse.Layer = pulse.Visual.extend(

if(!this.objects.hasOwnProperty(obj.name)) {
this.objects[obj.name] = obj;
this._private.objectArray.push(obj);
obj.parent = this;
obj.updated = true;
this._private.orderedKeys = pulse.util.getOrderedKeys(this.objects);
Expand Down Expand Up @@ -269,19 +266,17 @@ pulse.Layer = pulse.Visual.extend(

var reorder = false;

var len = this._private.objectArray.length;
for(var i = 0; i < len; i++) {
var node = this._private.objectArray[i];
if(node instanceof pulse.Visual) {
if(node.shuffled === true) {
node.shuffled = false;
for(var s in this.objects) {
if(this.objects[s] instanceof pulse.Visual) {
if(this.objects[s].shuffled === true) {
this.objects[s].shuffled = false;
reorder = true;
}

node.update(elapsed);
this.objects[s].update(elapsed);

// If the objects needs redrawn, mark the layer as needing redrawn.
if(node.updated) {
if(this.objects[s].updated) {
this.updated = true;
}
}
Expand Down Expand Up @@ -321,9 +316,8 @@ pulse.Layer = pulse.Visual.extend(
var isDirty = false;

// Do any sprites need updated?
var len = this._private.objectArray.length;
for(var i = 0; i < len; i++) {
if(this._private.objectArray[i].updated) {
for(var s in this.objects) {
if(this.objects[s].updated) {
isDirty = true;
break;
}
Expand Down

0 comments on commit 0579ffe

Please sign in to comment.