Skip to content

Commit

Permalink
Changing the layer of an entity could cause flickering
Browse files Browse the repository at this point in the history
  • Loading branch information
Draknek committed Mar 7, 2013
1 parent 992c1af commit b170822
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions net/flashpunk/Engine.as
Expand Up @@ -95,6 +95,7 @@
if (FP._world._tween) FP._world.updateTweens();
FP._world.update();
}
FP._world.updateLists(false);
}

/**
Expand Down
6 changes: 4 additions & 2 deletions net/flashpunk/World.as
Expand Up @@ -920,8 +920,10 @@

/**
* Updates the add/remove lists at the end of the frame.
* @param shouldAdd If false, entities will not be added
to the world, only removed.
*/
public function updateLists():void
public function updateLists(shouldAdd:Boolean = true):void
{
var e:Entity;

Expand Down Expand Up @@ -953,7 +955,7 @@
}

// add entities
if (_add.length)
if (shouldAdd && _add.length)
{
for each (e in _add)
{
Expand Down

0 comments on commit b170822

Please sign in to comment.