Skip to content

Commit f115a2d

Browse files
committed
Remove references to GameMath, it's just Math now
Throw exceptions if wrong format given to tilemap or textureatlas. Previously, old onload remained active and error happened in the wrong (and hard to diagnose) place.
1 parent 40e1b4b commit f115a2d

4 files changed

Lines changed: 12 additions & 4 deletions

File tree

src/core/Game.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
138138
this.load = null;
139139

140140
/**
141-
* @property {Phaser.GameMath} math - Reference to the math helper.
141+
* @property {Phaser.Math} math - Reference to the math helper.
142142
* @default
143143
*/
144144
this.math = null;

src/core/State.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Phaser.State = function () {
5050
this.load = null;
5151

5252
/**
53-
* @property {Phaser.GameMath} math - Reference to the math helper.
53+
* @property {Phaser.Math} math - Reference to the math helper.
5454
* @default
5555
*/
5656
this.math = null;

src/loader/Loader.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,10 @@ Phaser.Loader.prototype = {
744744
return _this.csvLoadComplete(file.key);
745745
};
746746
}
747+
else
748+
{
749+
throw new Error("Phaser.Loader. Invalid Tilemap format: " + file.format);
750+
}
747751

748752
this._xhr.onerror = function () {
749753
return _this.dataLoadError(file.key);
@@ -873,6 +877,10 @@ Phaser.Loader.prototype = {
873877
return _this.xmlLoadComplete(file.key);
874878
};
875879
}
880+
else
881+
{
882+
throw new Error("Phaser.Loader. Invalid Texture Atlas format: " + file.format);
883+
}
876884

877885
this._xhr.onerror = function () {
878886
return _this.dataLoadError(file.key);
@@ -1105,4 +1113,4 @@ Phaser.Loader.prototype = {
11051113

11061114
}
11071115

1108-
};
1116+
};

src/math/Math.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ Phaser.Math = {
350350

351351
if (typeof radians === "undefined") { radians = true; }
352352

353-
var rd = (radians) ? GameMath.PI : 180;
353+
var rd = (radians) ? Math.PI : 180;
354354
return this.wrap(angle, rd, -rd);
355355

356356
},

0 commit comments

Comments
 (0)