Skip to content

Commit

Permalink
Phaser 2.2.2 Release files.
Browse files Browse the repository at this point in the history
  • Loading branch information
photonstorm committed Jan 6, 2015
1 parent 1b34216 commit 6c7c0cb
Show file tree
Hide file tree
Showing 15 changed files with 2,662 additions and 1,219 deletions.
28 changes: 20 additions & 8 deletions build/custom/p2.js
Original file line number Diff line number Diff line change
Expand Up @@ -13643,10 +13643,22 @@ Phaser.Physics.P2 = function (game, config) {
*/
this.game = game;

if (typeof config === 'undefined' || !config.hasOwnProperty('gravity') || !config.hasOwnProperty('broadphase'))
if (typeof config === 'undefined')
{
config = { gravity: [0, 0], broadphase: new p2.SAPBroadphase() };
}
else
{
if (!config.hasOwnProperty('gravity'))
{
config.gravity = [0, 0];
}

if (!config.hasOwnProperty('broadphase'))
{
config.broadphase = new p2.SAPBroadphase();
}
}

/**
* @property {object} config - The p2 World configuration object.
Expand Down Expand Up @@ -13974,16 +13986,16 @@ Phaser.Physics.P2.prototype = {
*/
postBroadphaseHandler: function (event) {

var i = event.pairs.length;
if (!this.postBroadphaseCallback || event.pairs.length === 0)
{
return;
}

if (this.postBroadphaseCallback && i > 0)
for (var i = event.pairs.length - 2; i >= 0; i -= 2)
{
while (i -= 2)
if (event.pairs[i].parent && event.pairs[i+1].parent && !this.postBroadphaseCallback.call(this.callbackContext, event.pairs[i].parent, event.pairs[i+1].parent))
{
if (event.pairs[i].parent && event.pairs[i+1].parent && !this.postBroadphaseCallback.call(this.callbackContext, event.pairs[i].parent, event.pairs[i+1].parent))
{
event.pairs.splice(i, 2);
}
event.pairs.splice(i, 2);
}
}

Expand Down
4 changes: 2 additions & 2 deletions build/custom/p2.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 6c7c0cb

Please sign in to comment.