@@ -4064,7 +4064,6 @@ var Phaser;
40644064(function (Phaser) {
40654065 var TimeManager = (function () {
40664066 function TimeManager(game) {
4067- this.elapsed = 0;
40684067 this.physicsElapsed = 0;
40694068 this.time = 0;
40704069 this.pausedTime = 0;
@@ -6264,23 +6263,18 @@ var Phaser;
62646263(function (Phaser) {
62656264 var OrientationScreen = (function () {
62666265 function OrientationScreen(game) {
6267- this._showOnLandscape = false;
6268- this._showOnPortrait = false;
6266+ this._enabled = false;
62696267 this.game = game;
62706268 }
6271- OrientationScreen.prototype.enable = function (onLandscape, onPortrait, imageKey) {
6272- this._showOnLandscape = onLandscape;
6273- this._showOnPortrait = onPortrait;
6274- this.landscapeImage = this.game.cache.getImage(imageKey);
6275- this.portraitImage = this.game.cache.getImage(imageKey);
6269+ OrientationScreen.prototype.enable = function (imageKey) {
6270+ this._enabled = true;
6271+ this.image = this.game.cache.getImage(imageKey);
62766272 };
62776273 OrientationScreen.prototype.update = function () {
62786274 };
62796275 OrientationScreen.prototype.render = function () {
6280- if(this._showOnLandscape) {
6281- this.game.stage.context.drawImage(this.landscapeImage, 0, 0, this.landscapeImage.width, this.landscapeImage.height, 0, 0, this.game.stage.width, this.game.stage.height);
6282- } else if(this._showOnPortrait) {
6283- this.game.stage.context.drawImage(this.portraitImage, 0, 0, this.portraitImage.width, this.portraitImage.height, 0, 0, this.game.stage.width, this.game.stage.height);
6276+ if(this._enabled) {
6277+ this.game.stage.context.drawImage(this.image, 0, 0, this.image.width, this.image.height, 0, 0, this.game.stage.width, this.game.stage.height);
62846278 }
62856279 };
62866280 return OrientationScreen;
@@ -7875,8 +7869,6 @@ var Phaser;
78757869 }
78767870 var width = img.width;
78777871 var height = img.height;
7878- frameWidth *= game.stage.globalScale;
7879- frameHeight *= game.stage.globalScale;
78807872 var row = Math.round(width / frameWidth);
78817873 var column = Math.round(height / frameHeight);
78827874 var total = row * column;
@@ -12607,7 +12599,7 @@ var Phaser;
1260712599 if(sprite.transform.scrollFactor.equals(0)) {
1260812600 return true;
1260912601 }
12610- return true ;
12602+ return Phaser.RectangleUtils.intersects(sprite.cameraView, camera.screenView) ;
1261112603 };
1261212604 SpriteRenderer.prototype.render = function (camera, sprite) {
1261312605 Phaser.SpriteUtils.updateCameraView(camera, sprite);
@@ -12654,21 +12646,14 @@ var Phaser;
1265412646 this._dw = sprite.crop.width * sprite.transform.scale.x;
1265512647 this._dh = sprite.crop.height * sprite.transform.scale.y;
1265612648 }
12657- if(this.game.stage.globalScale != 1) {
12658- this._sx = Math.floor(this._sx * this.game.stage.globalScale);
12659- this._sy = Math.floor(this._sy * this.game.stage.globalScale);
12660- this._dx = Math.floor(this._dx * this.game.stage.globalScale);
12661- this._dy = Math.floor(this._dy * this.game.stage.globalScale);
12662- } else {
12663- this._sx = Math.floor(this._sx);
12664- this._sy = Math.floor(this._sy);
12665- this._sw = Math.floor(this._sw);
12666- this._sh = Math.floor(this._sh);
12667- this._dx = Math.floor(this._dx);
12668- this._dy = Math.floor(this._dy);
12669- this._dw = Math.floor(this._dw);
12670- this._dh = Math.floor(this._dh);
12671- }
12649+ this._sx = Math.floor(this._sx);
12650+ this._sy = Math.floor(this._sy);
12651+ this._sw = Math.floor(this._sw);
12652+ this._sh = Math.floor(this._sh);
12653+ this._dx = Math.floor(this._dx);
12654+ this._dy = Math.floor(this._dy);
12655+ this._dw = Math.floor(this._dw);
12656+ this._dh = Math.floor(this._dh);
1267212657 if(this._sw <= 0 || this._sh <= 0 || this._dw <= 0 || this._dh <= 0) {
1267312658 return false;
1267412659 }
@@ -13987,7 +13972,6 @@ var Phaser;
1398713972 var Stage = (function () {
1398813973 function Stage(game, parent, width, height) {
1398913974 var _this = this;
13990- this.globalScale = 1;
1399113975 this._backgroundColor = 'rgb(0,0,0)';
1399213976 this.clear = true;
1399313977 this.disablePauseScreen = false;
@@ -14077,7 +14061,7 @@ var Phaser;
1407714061 if (typeof imageKey === "undefined") { imageKey = ''; }
1407814062 this.scale.forceLandscape = forceLandscape;
1407914063 this.scale.forcePortrait = forcePortrait;
14080- this.orientationScreen.enable(forceLandscape, forcePortrait, imageKey);
14064+ this.orientationScreen.enable(imageKey);
1408114065 if(forceLandscape || forcePortrait) {
1408214066 if((this.scale.isLandscape && forcePortrait) || (this.scale.isPortrait && forceLandscape)) {
1408314067 this.game.paused = true;
@@ -14263,7 +14247,7 @@ var Phaser;
1426314247 this.onDestroyCallback = null;
1426414248 this.isBooted = false;
1426514249 this.isRunning = false;
14266- if(window['PhaserGlobal'].singleInstance) {
14250+ if(window['PhaserGlobal'] && window['PhaserGlobal'] .singleInstance) {
1426714251 if(Phaser.GAMES.length > 0) {
1426814252 console.log('Phaser detected an instance of this game already running, aborting');
1426914253 return;
@@ -14442,6 +14426,8 @@ var Phaser;
1444214426 this.input.reset(true);
1444314427 if(typeof state === 'function') {
1444414428 this.state = new state(this);
14429+ } else {
14430+ this.state = state;
1444514431 }
1444614432 if(this.state['create'] || this.state['update']) {
1444714433 this.callbackContext = this.state;
0 commit comments