Skip to content

Commit 6c7c0cb

Browse files
committed
Phaser 2.2.2 Release files.
1 parent 1b34216 commit 6c7c0cb

15 files changed

+2662
-1219
lines changed

build/custom/p2.js

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13643,10 +13643,22 @@ Phaser.Physics.P2 = function (game, config) {
1364313643
*/
1364413644
this.game = game;
1364513645

13646-
if (typeof config === 'undefined' || !config.hasOwnProperty('gravity') || !config.hasOwnProperty('broadphase'))
13646+
if (typeof config === 'undefined')
1364713647
{
1364813648
config = { gravity: [0, 0], broadphase: new p2.SAPBroadphase() };
1364913649
}
13650+
else
13651+
{
13652+
if (!config.hasOwnProperty('gravity'))
13653+
{
13654+
config.gravity = [0, 0];
13655+
}
13656+
13657+
if (!config.hasOwnProperty('broadphase'))
13658+
{
13659+
config.broadphase = new p2.SAPBroadphase();
13660+
}
13661+
}
1365013662

1365113663
/**
1365213664
* @property {object} config - The p2 World configuration object.
@@ -13974,16 +13986,16 @@ Phaser.Physics.P2.prototype = {
1397413986
*/
1397513987
postBroadphaseHandler: function (event) {
1397613988

13977-
var i = event.pairs.length;
13989+
if (!this.postBroadphaseCallback || event.pairs.length === 0)
13990+
{
13991+
return;
13992+
}
1397813993

13979-
if (this.postBroadphaseCallback && i > 0)
13994+
for (var i = event.pairs.length - 2; i >= 0; i -= 2)
1398013995
{
13981-
while (i -= 2)
13996+
if (event.pairs[i].parent && event.pairs[i+1].parent && !this.postBroadphaseCallback.call(this.callbackContext, event.pairs[i].parent, event.pairs[i+1].parent))
1398213997
{
13983-
if (event.pairs[i].parent && event.pairs[i+1].parent && !this.postBroadphaseCallback.call(this.callbackContext, event.pairs[i].parent, event.pairs[i+1].parent))
13984-
{
13985-
event.pairs.splice(i, 2);
13986-
}
13998+
event.pairs.splice(i, 2);
1398713999
}
1398814000
}
1398914001

build/custom/p2.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)