From f115a2dbf8327fdd3c997ad11b0a2e6c8a7b4036 Mon Sep 17 00:00:00 2001 From: TheJare Date: Wed, 20 Nov 2013 00:12:37 +0100 Subject: [PATCH] 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. --- src/core/Game.js | 2 +- src/core/State.js | 2 +- src/loader/Loader.js | 10 +++++++++- src/math/Math.js | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/core/Game.js b/src/core/Game.js index f6dbc4f7..7a221f24 100644 --- a/src/core/Game.js +++ b/src/core/Game.js @@ -138,7 +138,7 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant this.load = null; /** - * @property {Phaser.GameMath} math - Reference to the math helper. + * @property {Phaser.Math} math - Reference to the math helper. * @default */ this.math = null; diff --git a/src/core/State.js b/src/core/State.js index e202c949..a853b945 100644 --- a/src/core/State.js +++ b/src/core/State.js @@ -50,7 +50,7 @@ Phaser.State = function () { this.load = null; /** - * @property {Phaser.GameMath} math - Reference to the math helper. + * @property {Phaser.Math} math - Reference to the math helper. * @default */ this.math = null; diff --git a/src/loader/Loader.js b/src/loader/Loader.js index dabdcb50..44c1f80a 100644 --- a/src/loader/Loader.js +++ b/src/loader/Loader.js @@ -744,6 +744,10 @@ Phaser.Loader.prototype = { return _this.csvLoadComplete(file.key); }; } + else + { + throw new Error("Phaser.Loader. Invalid Tilemap format: " + file.format); + } this._xhr.onerror = function () { return _this.dataLoadError(file.key); @@ -873,6 +877,10 @@ Phaser.Loader.prototype = { return _this.xmlLoadComplete(file.key); }; } + else + { + throw new Error("Phaser.Loader. Invalid Texture Atlas format: " + file.format); + } this._xhr.onerror = function () { return _this.dataLoadError(file.key); @@ -1105,4 +1113,4 @@ Phaser.Loader.prototype = { } -}; \ No newline at end of file +}; diff --git a/src/math/Math.js b/src/math/Math.js index 45e3cb10..0c993a09 100644 --- a/src/math/Math.js +++ b/src/math/Math.js @@ -350,7 +350,7 @@ Phaser.Math = { if (typeof radians === "undefined") { radians = true; } - var rd = (radians) ? GameMath.PI : 180; + var rd = (radians) ? Math.PI : 180; return this.wrap(angle, rd, -rd); },