Skip to content

Commit 1b7dcd9

Browse files
committed
Phaser 2.4.9 RC1.
1 parent 45bd98e commit 1b7dcd9

16 files changed

Lines changed: 328 additions & 204 deletions

build/custom/phaser-arcade-physics.js

Lines changed: 70 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Phaser - http://phaser.io
99
*
10-
* v2.4.9 "Four Kings" - Built: Thu Jun 02 2016 16:38:57
10+
* v2.4.9 "Four Kings" - Built: Thu Jun 02 2016 23:21:31
1111
*
1212
* By Richard Davey http://www.photonstorm.com @photonstorm
1313
*
@@ -1855,7 +1855,7 @@ PIXI.Sprite.prototype._renderCanvas = function(renderSession, matrix)
18551855

18561856
renderSession.context.globalAlpha = this.worldAlpha;
18571857

1858-
// If smoothingEnabled is supported and we need to change the smoothing property for this texture
1858+
// If smoothingEnabled is supported and we need to change the smoothing property for this texture
18591859
if (renderSession.smoothProperty && renderSession.scaleMode !== this.texture.baseTexture.scaleMode)
18601860
{
18611861
renderSession.scaleMode = this.texture.baseTexture.scaleMode;
@@ -9152,7 +9152,7 @@ var Phaser = Phaser || {
91529152
* @constant
91539153
* @type {string}
91549154
*/
9155-
VERSION: '2.4.9-dev',
9155+
VERSION: '2.4.9 RC1',
91569156

91579157
/**
91589158
* An array of Phaser game instances.
@@ -14913,11 +14913,6 @@ Phaser.Camera.prototype = {
1491314913
this.updateFX();
1491414914
}
1491514915

14916-
if (this.target)
14917-
{
14918-
this.updateTarget();
14919-
}
14920-
1492114916
if (this._shake.duration > 0)
1492214917
{
1492314918
this.updateShake();
@@ -14935,8 +14930,6 @@ Phaser.Camera.prototype = {
1493514930
this._shake.y = Math.floor(this._shake.y);
1493614931
}
1493714932

14938-
// this.displayObject.position.x = -(this.view.x + this._shake.x);
14939-
// this.displayObject.position.y = -(this.view.y + this._shake.y);
1494014933
this.displayObject.position.x = -this.view.x;
1494114934
this.displayObject.position.y = -this.view.y;
1494214935

@@ -15049,6 +15042,19 @@ Phaser.Camera.prototype = {
1504915042
this.view.y = this.game.math.linear(this.view.y, this._targetPosition.y - this.view.halfHeight, this.lerp.y);
1505015043
}
1505115044

15045+
if (this.bounds)
15046+
{
15047+
this.checkBounds();
15048+
}
15049+
15050+
if (this.roundPx)
15051+
{
15052+
this.view.floor();
15053+
}
15054+
15055+
this.displayObject.position.x = -this.view.x;
15056+
this.displayObject.position.y = -this.view.y;
15057+
1505215058
},
1505315059

1505415060
/**
@@ -17885,7 +17891,6 @@ Phaser.Stage.prototype.preUpdate = function () {
1788517891

1788617892
this.currentRenderOrderID = 0;
1788717893

17888-
// This can't loop in reverse, we need the orderID to be in sequence
1788917894
for (var i = 0; i < this.children.length; i++)
1789017895
{
1789117896
this.children[i].preUpdate();
@@ -17900,9 +17905,7 @@ Phaser.Stage.prototype.preUpdate = function () {
1790017905
*/
1790117906
Phaser.Stage.prototype.update = function () {
1790217907

17903-
var i = this.children.length;
17904-
17905-
while (i--)
17908+
for (var i = 0; i < this.children.length; i++)
1790617909
{
1790717910
this.children[i].update();
1790817911
}
@@ -17913,22 +17916,25 @@ Phaser.Stage.prototype.update = function () {
1791317916
* This is called automatically before the renderer runs and after the plugins have updated.
1791417917
* In postUpdate this is where all the final physics calculations and object positioning happens.
1791517918
* The objects are processed in the order of the display list.
17916-
* The only exception to this is if the camera is following an object, in which case that is updated first.
1791717919
*
1791817920
* @method Phaser.Stage#postUpdate
1791917921
*/
1792017922
Phaser.Stage.prototype.postUpdate = function () {
1792117923

17922-
var i = this.children.length;
17924+
// Apply the camera shake, fade, bounds, etc
17925+
this.game.camera.update();
1792317926

17924-
while (i--)
17927+
for (var i = 0; i < this.children.length; i++)
1792517928
{
1792617929
this.children[i].postUpdate();
1792717930
}
1792817931

1792917932
this.updateTransform();
1793017933

17931-
this.game.world.camera.update();
17934+
if (this.game.camera.target)
17935+
{
17936+
this.game.camera.updateTarget();
17937+
}
1793217938

1793317939
};
1793417940

@@ -21711,9 +21717,6 @@ Phaser.Game.prototype = {
2171121717
{
2171221718
this.updateLogic(this.time.desiredFpsMult);
2171321719

21714-
// Sync the scene graph after _every_ logic update to account for moved game objects
21715-
this.stage.updateTransform();
21716-
2171721720
// call the game render update exactly once every frame
2171821721
this.updateRender(this.time.slowMotion * this.time.desiredFps);
2171921722

@@ -21768,9 +21771,6 @@ Phaser.Game.prototype = {
2176821771

2176921772
this.updateLogic(this.time.desiredFpsMult);
2177021773

21771-
// Sync the scene graph after _every_ logic update to account for moved game objects
21772-
this.stage.updateTransform();
21773-
2177421774
count++;
2177521775

2177621776
if (this.forceSingleUpdate && count === 1)
@@ -21820,7 +21820,7 @@ Phaser.Game.prototype = {
2182021820

2182121821
this.scale.preUpdate();
2182221822
this.debug.preUpdate();
21823-
this.world.camera.preUpdate();
21823+
this.camera.preUpdate();
2182421824
this.physics.preUpdate();
2182521825
this.state.preUpdate(timeStep);
2182621826
this.plugins.preUpdate(timeStep);
@@ -21846,6 +21846,8 @@ Phaser.Game.prototype = {
2184621846
this.debug.preUpdate();
2184721847
}
2184821848

21849+
this.stage.updateTransform();
21850+
2184921851
},
2185021852

2185121853
/**
@@ -75120,16 +75122,54 @@ Phaser.TilemapLayer.prototype.preUpdate = function() {
7512075122
*/
7512175123
Phaser.TilemapLayer.prototype.postUpdate = function () {
7512275124

75123-
Phaser.Component.FixedToCamera.postUpdate.call(this);
75125+
this.position.x = (this.game.camera.view.x + this.cameraOffset.x) / this.game.camera.scale.x;
75126+
this.position.y = (this.game.camera.view.y + this.cameraOffset.y) / this.game.camera.scale.y;
75127+
75128+
this._scrollX = this.game.camera.view.x * this.scrollFactorX / this.scale.x;
75129+
this._scrollY = this.game.camera.view.y * this.scrollFactorY / this.scale.y;
75130+
75131+
};
75132+
75133+
/**
75134+
* Automatically called by the Canvas Renderer.
75135+
* Overrides the Sprite._renderCanvas function.
75136+
*
75137+
* @method Phaser.TilemapLayer#_renderCanvas
75138+
* @private
75139+
*/
75140+
Phaser.TilemapLayer.prototype._renderCanvas = function (renderSession) {
75141+
75142+
this.position.x = (this.game.camera.view.x + this.cameraOffset.x) / this.game.camera.scale.x;
75143+
this.position.y = (this.game.camera.view.y + this.cameraOffset.y) / this.game.camera.scale.y;
75144+
75145+
this._scrollX = this.game.camera.view.x * this.scrollFactorX / this.scale.x;
75146+
this._scrollY = this.game.camera.view.y * this.scrollFactorY / this.scale.y;
7512475147

75125-
// Stops you being able to auto-scroll the camera if it's not following a sprite
75126-
var camera = this.game.camera;
75148+
this.render();
75149+
75150+
PIXI.Sprite.prototype._renderCanvas.call(this, renderSession);
7512775151

75128-
this.scrollX = camera.x * this.scrollFactorX / this.scale.x;
75129-
this.scrollY = camera.y * this.scrollFactorY / this.scale.y;
75152+
};
75153+
75154+
/**
75155+
* Automatically called by the Canvas Renderer.
75156+
* Overrides the Sprite._renderWebGL function.
75157+
*
75158+
* @method Phaser.TilemapLayer#_renderWebGL
75159+
* @private
75160+
*/
75161+
Phaser.TilemapLayer.prototype._renderWebGL = function (renderSession) {
75162+
75163+
this.position.x = (this.game.camera.view.x + this.cameraOffset.x) / this.game.camera.scale.x;
75164+
this.position.y = (this.game.camera.view.y + this.cameraOffset.y) / this.game.camera.scale.y;
75165+
75166+
this._scrollX = this.game.camera.view.x * this.scrollFactorX / this.scale.x;
75167+
this._scrollY = this.game.camera.view.y * this.scrollFactorY / this.scale.y;
7513075168

7513175169
this.render();
7513275170

75171+
PIXI.Sprite.prototype._renderWebGL.call(this, renderSession);
75172+
7513375173
};
7513475174

7513575175
/**

build/custom/phaser-arcade-physics.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/phaser-arcade-physics.min.js

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

build/custom/phaser-minimum.js

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Phaser - http://phaser.io
99
*
10-
* v2.4.9 "Four Kings" - Built: Thu Jun 02 2016 16:39:14
10+
* v2.4.9 "Four Kings" - Built: Thu Jun 02 2016 23:21:52
1111
*
1212
* By Richard Davey http://www.photonstorm.com @photonstorm
1313
*
@@ -1855,7 +1855,7 @@ PIXI.Sprite.prototype._renderCanvas = function(renderSession, matrix)
18551855

18561856
renderSession.context.globalAlpha = this.worldAlpha;
18571857

1858-
// If smoothingEnabled is supported and we need to change the smoothing property for this texture
1858+
// If smoothingEnabled is supported and we need to change the smoothing property for this texture
18591859
if (renderSession.smoothProperty && renderSession.scaleMode !== this.texture.baseTexture.scaleMode)
18601860
{
18611861
renderSession.scaleMode = this.texture.baseTexture.scaleMode;
@@ -7952,7 +7952,7 @@ var Phaser = Phaser || {
79527952
* @constant
79537953
* @type {string}
79547954
*/
7955-
VERSION: '2.4.9-dev',
7955+
VERSION: '2.4.9 RC1',
79567956

79577957
/**
79587958
* An array of Phaser game instances.
@@ -13713,11 +13713,6 @@ Phaser.Camera.prototype = {
1371313713
this.updateFX();
1371413714
}
1371513715

13716-
if (this.target)
13717-
{
13718-
this.updateTarget();
13719-
}
13720-
1372113716
if (this._shake.duration > 0)
1372213717
{
1372313718
this.updateShake();
@@ -13735,8 +13730,6 @@ Phaser.Camera.prototype = {
1373513730
this._shake.y = Math.floor(this._shake.y);
1373613731
}
1373713732

13738-
// this.displayObject.position.x = -(this.view.x + this._shake.x);
13739-
// this.displayObject.position.y = -(this.view.y + this._shake.y);
1374013733
this.displayObject.position.x = -this.view.x;
1374113734
this.displayObject.position.y = -this.view.y;
1374213735

@@ -13849,6 +13842,19 @@ Phaser.Camera.prototype = {
1384913842
this.view.y = this.game.math.linear(this.view.y, this._targetPosition.y - this.view.halfHeight, this.lerp.y);
1385013843
}
1385113844

13845+
if (this.bounds)
13846+
{
13847+
this.checkBounds();
13848+
}
13849+
13850+
if (this.roundPx)
13851+
{
13852+
this.view.floor();
13853+
}
13854+
13855+
this.displayObject.position.x = -this.view.x;
13856+
this.displayObject.position.y = -this.view.y;
13857+
1385213858
},
1385313859

1385413860
/**
@@ -16685,7 +16691,6 @@ Phaser.Stage.prototype.preUpdate = function () {
1668516691

1668616692
this.currentRenderOrderID = 0;
1668716693

16688-
// This can't loop in reverse, we need the orderID to be in sequence
1668916694
for (var i = 0; i < this.children.length; i++)
1669016695
{
1669116696
this.children[i].preUpdate();
@@ -16700,9 +16705,7 @@ Phaser.Stage.prototype.preUpdate = function () {
1670016705
*/
1670116706
Phaser.Stage.prototype.update = function () {
1670216707

16703-
var i = this.children.length;
16704-
16705-
while (i--)
16708+
for (var i = 0; i < this.children.length; i++)
1670616709
{
1670716710
this.children[i].update();
1670816711
}
@@ -16713,22 +16716,25 @@ Phaser.Stage.prototype.update = function () {
1671316716
* This is called automatically before the renderer runs and after the plugins have updated.
1671416717
* In postUpdate this is where all the final physics calculations and object positioning happens.
1671516718
* The objects are processed in the order of the display list.
16716-
* The only exception to this is if the camera is following an object, in which case that is updated first.
1671716719
*
1671816720
* @method Phaser.Stage#postUpdate
1671916721
*/
1672016722
Phaser.Stage.prototype.postUpdate = function () {
1672116723

16722-
var i = this.children.length;
16724+
// Apply the camera shake, fade, bounds, etc
16725+
this.game.camera.update();
1672316726

16724-
while (i--)
16727+
for (var i = 0; i < this.children.length; i++)
1672516728
{
1672616729
this.children[i].postUpdate();
1672716730
}
1672816731

1672916732
this.updateTransform();
1673016733

16731-
this.game.world.camera.update();
16734+
if (this.game.camera.target)
16735+
{
16736+
this.game.camera.updateTarget();
16737+
}
1673216738

1673316739
};
1673416740

@@ -20511,9 +20517,6 @@ Phaser.Game.prototype = {
2051120517
{
2051220518
this.updateLogic(this.time.desiredFpsMult);
2051320519

20514-
// Sync the scene graph after _every_ logic update to account for moved game objects
20515-
this.stage.updateTransform();
20516-
2051720520
// call the game render update exactly once every frame
2051820521
this.updateRender(this.time.slowMotion * this.time.desiredFps);
2051920522

@@ -20568,9 +20571,6 @@ Phaser.Game.prototype = {
2056820571

2056920572
this.updateLogic(this.time.desiredFpsMult);
2057020573

20571-
// Sync the scene graph after _every_ logic update to account for moved game objects
20572-
this.stage.updateTransform();
20573-
2057420574
count++;
2057520575

2057620576
if (this.forceSingleUpdate && count === 1)
@@ -20620,7 +20620,7 @@ Phaser.Game.prototype = {
2062020620

2062120621
this.scale.preUpdate();
2062220622
this.debug.preUpdate();
20623-
this.world.camera.preUpdate();
20623+
this.camera.preUpdate();
2062420624
this.physics.preUpdate();
2062520625
this.state.preUpdate(timeStep);
2062620626
this.plugins.preUpdate(timeStep);
@@ -20646,6 +20646,8 @@ Phaser.Game.prototype = {
2064620646
this.debug.preUpdate();
2064720647
}
2064820648

20649+
this.stage.updateTransform();
20650+
2064920651
},
2065020652

2065120653
/**

build/custom/phaser-minimum.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/phaser-minimum.min.js

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

0 commit comments

Comments
 (0)