From 74679922d167ab646ede67f1ba5025fbd69ed7a6 Mon Sep 17 00:00:00 2001 From: photonstorm Date: Fri, 11 Jul 2014 11:48:03 +0100 Subject: [PATCH] Debug.preUpdate was still being called in the Game Loop even if enableDebug was set to false (thanks @qdrj, #995) --- README.md | 3 +++ src/core/Game.js | 13 ++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 857b88a44..f5d34f835 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,9 @@ Version 2.1.0 - "Shienar" - -in development- ### Bug Fixes +* Fixed pixel perfect dragging (thanks @jeroenverfallie, fix #996) +* Debug.preUpdate was still being called in the Game Loop even if enableDebug was set to false (thanks @qdrj, #995) + ### Migration Guide There is an extensive [Migration Guide](https://github.com/photonstorm/phaser/blob/master/resources/Migration%20Guide.md) available for those converting from Phaser 1.x to 2.x. In the guide we detail the API breaking changes and approach to our new physics system. diff --git a/src/core/Game.js b/src/core/Game.js index 68796762b..1a771c276 100644 --- a/src/core/Game.js +++ b/src/core/Game.js @@ -643,7 +643,11 @@ Phaser.Game.prototype = { this.pendingStep = true; } - this.debug.preUpdate(); + if (this.config['enableDebug']) + { + this.debug.preUpdate(); + } + this.physics.preUpdate(); this.state.preUpdate(); this.plugins.preUpdate(); @@ -664,8 +668,11 @@ Phaser.Game.prototype = { else { this.state.pauseUpdate(); - // this.input.update(); - this.debug.preUpdate(); + + if (this.config['enableDebug']) + { + this.debug.preUpdate(); + } } if (this.renderType != Phaser.HEADLESS)