Skip to content

Commit 79d6993

Browse files
committed
Fixed issue with Time.update not being properly set in IE9 / setTimeout environments.
1 parent d1233ad commit 79d6993

13 files changed

Lines changed: 45 additions & 20 deletions

build/custom/phaser-arcade-physics.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Phaser - http://phaser.io
99
*
10-
* v2.4.4 "Amador" - Built: Tue Oct 13 2015 14:10:01
10+
* v2.4.4 "Amador" - Built: Tue Oct 13 2015 14:22:38
1111
*
1212
* By Richard Davey http://www.photonstorm.com @photonstorm
1313
*
@@ -49324,6 +49324,7 @@ Phaser.Time.prototype = {
4932449324
this._started = Date.now();
4932549325
this.time = Date.now();
4932649326
this.events.start();
49327+
this.timeExpected = this.time;
4932749328

4932849329
},
4932949330

@@ -49427,11 +49428,15 @@ Phaser.Time.prototype = {
4942749428

4942849429
if (this.game.raf._isSetTimeOut)
4942949430
{
49431+
// console.log('Time isSet', this._desiredFps, 'te', this.timeExpected, 'time', time);
49432+
4943049433
// time to call this function again in ms in case we're using timers instead of RequestAnimationFrame to update the game
4943149434
this.timeToCall = Math.floor(Math.max(0, (1000.0 / this._desiredFps) - (this.timeExpected - time)));
4943249435

4943349436
// time when the next call is expected if using timers
4943449437
this.timeExpected = time + this.timeToCall;
49438+
49439+
// console.log('Time expect', this.timeExpected);
4943549440
}
4943649441

4943749442
if (this.advancedTiming)

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: 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.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Phaser - http://phaser.io
99
*
10-
* v2.4.4 "Amador" - Built: Tue Oct 13 2015 14:10:17
10+
* v2.4.4 "Amador" - Built: Tue Oct 13 2015 14:22:54
1111
*
1212
* By Richard Davey http://www.photonstorm.com @photonstorm
1313
*
@@ -34230,6 +34230,7 @@ Phaser.Time.prototype = {
3423034230
this._started = Date.now();
3423134231
this.time = Date.now();
3423234232
this.events.start();
34233+
this.timeExpected = this.time;
3423334234

3423434235
},
3423534236

@@ -34333,11 +34334,15 @@ Phaser.Time.prototype = {
3433334334

3433434335
if (this.game.raf._isSetTimeOut)
3433534336
{
34337+
// console.log('Time isSet', this._desiredFps, 'te', this.timeExpected, 'time', time);
34338+
3433634339
// time to call this function again in ms in case we're using timers instead of RequestAnimationFrame to update the game
3433734340
this.timeToCall = Math.floor(Math.max(0, (1000.0 / this._desiredFps) - (this.timeExpected - time)));
3433834341

3433934342
// time when the next call is expected if using timers
3434034343
this.timeExpected = time + this.timeToCall;
34344+
34345+
// console.log('Time expect', this.timeExpected);
3434134346
}
3434234347

3434334348
if (this.advancedTiming)

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: 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-no-physics.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Phaser - http://phaser.io
99
*
10-
* v2.4.4 "Amador" - Built: Tue Oct 13 2015 14:10:10
10+
* v2.4.4 "Amador" - Built: Tue Oct 13 2015 14:22:47
1111
*
1212
* By Richard Davey http://www.photonstorm.com @photonstorm
1313
*
@@ -49324,6 +49324,7 @@ Phaser.Time.prototype = {
4932449324
this._started = Date.now();
4932549325
this.time = Date.now();
4932649326
this.events.start();
49327+
this.timeExpected = this.time;
4932749328

4932849329
},
4932949330

@@ -49427,11 +49428,15 @@ Phaser.Time.prototype = {
4942749428

4942849429
if (this.game.raf._isSetTimeOut)
4942949430
{
49431+
// console.log('Time isSet', this._desiredFps, 'te', this.timeExpected, 'time', time);
49432+
4943049433
// time to call this function again in ms in case we're using timers instead of RequestAnimationFrame to update the game
4943149434
this.timeToCall = Math.floor(Math.max(0, (1000.0 / this._desiredFps) - (this.timeExpected - time)));
4943249435

4943349436
// time when the next call is expected if using timers
4943449437
this.timeExpected = time + this.timeToCall;
49438+
49439+
// console.log('Time expect', this.timeExpected);
4943549440
}
4943649441

4943749442
if (this.advancedTiming)

build/custom/phaser-no-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-no-physics.min.js

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/phaser.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Phaser - http://phaser.io
99
*
10-
* v2.4.4 "Amador" - Built: Tue Oct 13 2015 14:09:50
10+
* v2.4.4 "Amador" - Built: Tue Oct 13 2015 14:22:27
1111
*
1212
* By Richard Davey http://www.photonstorm.com @photonstorm
1313
*
@@ -62937,6 +62937,7 @@ Phaser.Time.prototype = {
6293762937
this._started = Date.now();
6293862938
this.time = Date.now();
6293962939
this.events.start();
62940+
this.timeExpected = this.time;
6294062941

6294162942
},
6294262943

@@ -63040,11 +63041,15 @@ Phaser.Time.prototype = {
6304063041

6304163042
if (this.game.raf._isSetTimeOut)
6304263043
{
63044+
// console.log('Time isSet', this._desiredFps, 'te', this.timeExpected, 'time', time);
63045+
6304363046
// time to call this function again in ms in case we're using timers instead of RequestAnimationFrame to update the game
6304463047
this.timeToCall = Math.floor(Math.max(0, (1000.0 / this._desiredFps) - (this.timeExpected - time)));
6304563048

6304663049
// time when the next call is expected if using timers
6304763050
this.timeExpected = time + this.timeToCall;
63051+
63052+
// console.log('Time expect', this.timeExpected);
6304863053
}
6304963054

6305063055
if (this.advancedTiming)

0 commit comments

Comments
 (0)