diff --git a/config/webpack-nospector.config.js b/config/webpack-nospector.config.js index 3808a354c..c423eba35 100644 --- a/config/webpack-nospector.config.js +++ b/config/webpack-nospector.config.js @@ -34,14 +34,14 @@ module.exports = [ plugins: [ new webpack.DefinePlugin({ - CANVAS_RENDERER: JSON.stringify(true), - WEBGL_RENDERER: JSON.stringify(true), - WEBGL_DEBUG: JSON.stringify(false), - EXPERIMENTAL: JSON.stringify(true), - PLUGIN_3D: JSON.stringify(false), - PLUGIN_CAMERA3D: JSON.stringify(false), - PLUGIN_FBINSTANT: JSON.stringify(false), - FEATURE_SOUND: JSON.stringify(true) + "typeof CANVAS_RENDERER": JSON.stringify(true), + "typeof WEBGL_RENDERER": JSON.stringify(true), + "typeof WEBGL_DEBUG": JSON.stringify(false), + "typeof EXPERIMENTAL": JSON.stringify(true), + "typeof PLUGIN_3D": JSON.stringify(false), + "typeof PLUGIN_CAMERA3D": JSON.stringify(false), + "typeof PLUGIN_FBINSTANT": JSON.stringify(false), + "typeof FEATURE_SOUND": JSON.stringify(true) }), { apply: (compiler) => { diff --git a/config/webpack.config.js b/config/webpack.config.js index a92a141e4..ce7d5d2f2 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -34,14 +34,14 @@ module.exports = [ plugins: [ new webpack.DefinePlugin({ - CANVAS_RENDERER: JSON.stringify(true), - WEBGL_RENDERER: JSON.stringify(true), - WEBGL_DEBUG: JSON.stringify(true), - EXPERIMENTAL: JSON.stringify(true), - PLUGIN_3D: JSON.stringify(false), - PLUGIN_CAMERA3D: JSON.stringify(false), - PLUGIN_FBINSTANT: JSON.stringify(false), - FEATURE_SOUND: JSON.stringify(true) + "typeof CANVAS_RENDERER": JSON.stringify(true), + "typeof WEBGL_RENDERER": JSON.stringify(true), + "typeof WEBGL_DEBUG": JSON.stringify(true), + "typeof EXPERIMENTAL": JSON.stringify(true), + "typeof PLUGIN_3D": JSON.stringify(false), + "typeof PLUGIN_CAMERA3D": JSON.stringify(false), + "typeof PLUGIN_FBINSTANT": JSON.stringify(false), + "typeof FEATURE_SOUND": JSON.stringify(true) }), { apply: (compiler) => { diff --git a/config/webpack.dist.config.js b/config/webpack.dist.config.js index 7d539571e..110e7fa23 100644 --- a/config/webpack.dist.config.js +++ b/config/webpack.dist.config.js @@ -54,14 +54,14 @@ module.exports = [ plugins: [ new webpack.DefinePlugin({ - CANVAS_RENDERER: JSON.stringify(true), - WEBGL_RENDERER: JSON.stringify(true), - WEBGL_DEBUG: JSON.stringify(false), - EXPERIMENTAL: JSON.stringify(false), - PLUGIN_3D: JSON.stringify(false), - PLUGIN_CAMERA3D: JSON.stringify(false), - PLUGIN_FBINSTANT: JSON.stringify(false), - FEATURE_SOUND: JSON.stringify(true) + "typeof CANVAS_RENDERER": JSON.stringify(true), + "typeof WEBGL_RENDERER": JSON.stringify(true), + "typeof WEBGL_DEBUG": JSON.stringify(false), + "typeof EXPERIMENTAL": JSON.stringify(false), + "typeof PLUGIN_3D": JSON.stringify(false), + "typeof PLUGIN_CAMERA3D": JSON.stringify(false), + "typeof PLUGIN_FBINSTANT": JSON.stringify(false), + "typeof FEATURE_SOUND": JSON.stringify(true) }), new CleanWebpackPlugin() diff --git a/config/webpack.fb.config.js b/config/webpack.fb.config.js index ff1c107f3..43dbf6e0e 100644 --- a/config/webpack.fb.config.js +++ b/config/webpack.fb.config.js @@ -27,13 +27,13 @@ module.exports = { plugins: [ new webpack.DefinePlugin({ - CANVAS_RENDERER: JSON.stringify(true), - WEBGL_RENDERER: JSON.stringify(true), - EXPERIMENTAL: JSON.stringify(false), - PLUGIN_3D: JSON.stringify(false), - PLUGIN_CAMERA3D: JSON.stringify(false), - PLUGIN_FBINSTANT: JSON.stringify(true), - FEATURE_SOUND: JSON.stringify(true) + "typeof CANVAS_RENDERER": JSON.stringify(true), + "typeof WEBGL_RENDERER": JSON.stringify(true), + "typeof EXPERIMENTAL": JSON.stringify(false), + "typeof PLUGIN_3D": JSON.stringify(false), + "typeof PLUGIN_CAMERA3D": JSON.stringify(false), + "typeof PLUGIN_FBINSTANT": JSON.stringify(true), + "typeof FEATURE_SOUND": JSON.stringify(true) }), { apply: (compiler) => { diff --git a/config/webpack.fb.dist.config.js b/config/webpack.fb.dist.config.js index fb22086a8..f9cceb585 100644 --- a/config/webpack.fb.dist.config.js +++ b/config/webpack.fb.dist.config.js @@ -44,13 +44,13 @@ module.exports = { plugins: [ new webpack.DefinePlugin({ - CANVAS_RENDERER: JSON.stringify(true), - WEBGL_RENDERER: JSON.stringify(true), - EXPERIMENTAL: JSON.stringify(false), - PLUGIN_3D: JSON.stringify(false), - PLUGIN_CAMERA3D: JSON.stringify(false), - PLUGIN_FBINSTANT: JSON.stringify(true), - FEATURE_SOUND: JSON.stringify(true) + "typeof CANVAS_RENDERER": JSON.stringify(true), + "typeof WEBGL_RENDERER": JSON.stringify(true), + "typeof EXPERIMENTAL": JSON.stringify(false), + "typeof PLUGIN_3D": JSON.stringify(false), + "typeof PLUGIN_CAMERA3D": JSON.stringify(false), + "typeof PLUGIN_FBINSTANT": JSON.stringify(true), + "typeof FEATURE_SOUND": JSON.stringify(true) }) ] }; diff --git a/src/core/CreateRenderer.js b/src/core/CreateRenderer.js index fde4b70ff..61e2f1dc2 100644 --- a/src/core/CreateRenderer.js +++ b/src/core/CreateRenderer.js @@ -95,7 +95,7 @@ var CreateRenderer = function (game) var CanvasRenderer; var WebGLRenderer; - if (typeof WEBGL_RENDERER !== 'undefined' && typeof CANVAS_RENDERER !== 'undefined') + if (typeof WEBGL_RENDERER && typeof CANVAS_RENDERER) { CanvasRenderer = require('../renderer/canvas/CanvasRenderer'); WebGLRenderer = require('../renderer/webgl/WebGLRenderer'); @@ -112,7 +112,7 @@ var CreateRenderer = function (game) } } - if (typeof WEBGL_RENDERER !== 'undefined' && !typeof CANVAS_RENDERER !== 'undefined') + if (typeof WEBGL_RENDERER && !typeof CANVAS_RENDERER) { WebGLRenderer = require('../renderer/webgl/WebGLRenderer'); @@ -122,7 +122,7 @@ var CreateRenderer = function (game) game.renderer = new WebGLRenderer(game); } - if (!typeof WEBGL_RENDERER !== 'undefined' && typeof CANVAS_RENDERER !== 'undefined') + if (!typeof WEBGL_RENDERER && typeof CANVAS_RENDERER) { CanvasRenderer = require('../renderer/canvas/CanvasRenderer'); diff --git a/src/core/DebugHeader.js b/src/core/DebugHeader.js index fbb344227..674bd0020 100644 --- a/src/core/DebugHeader.js +++ b/src/core/DebugHeader.js @@ -101,7 +101,7 @@ var DebugHeader = function (game) } } - var fb = (typeof PLUGIN_FBINSTANT !== 'undefined') ? '-FB' : ''; + var fb = (typeof PLUGIN_FBINSTANT) ? '-FB' : ''; if (!config.hidePhaser) { diff --git a/src/core/Game.js b/src/core/Game.js index dcb2ca9c0..74ecf2bd7 100644 --- a/src/core/Game.js +++ b/src/core/Game.js @@ -28,12 +28,12 @@ var TextureManager = require('../textures/TextureManager'); var TimeStep = require('./TimeStep'); var VisibilityHandler = require('./VisibilityHandler'); -if (typeof FEATURE_SOUND !== 'undefined') +if (typeof FEATURE_SOUND) { var SoundManagerCreator = require('../sound/SoundManagerCreator'); } -if (typeof PLUGIN_FBINSTANT !== 'undefined') +if (typeof PLUGIN_FBINSTANT) { var FacebookInstantGamesPlugin = require('../../plugins/fbinstant/src/FacebookInstantGamesPlugin'); } @@ -255,7 +255,7 @@ var Game = new Class({ */ this.sound = null; - if (typeof FEATURE_SOUND !== 'undefined') + if (typeof FEATURE_SOUND) { this.sound = SoundManagerCreator.create(this); } @@ -284,7 +284,7 @@ var Game = new Class({ */ this.plugins = new PluginManager(this, this.config); - if (typeof PLUGIN_FBINSTANT !== 'undefined') + if (typeof PLUGIN_FBINSTANT) { /** * An instance of the Facebook Instant Games Plugin. @@ -395,7 +395,7 @@ var Game = new Class({ this.events.emit(Events.BOOT); - if (typeof WEBGL_DEBUG !== 'undefined' && window) + if (typeof WEBGL_DEBUG && window) { window.PHASER_GAME = this; } diff --git a/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextRender.js b/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextRender.js index 3cbcb5cff..e704e5453 100644 --- a/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextRender.js +++ b/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./DynamicBitmapTextWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./DynamicBitmapTextCanvasRenderer'); } diff --git a/src/gameobjects/bitmaptext/static/BitmapTextRender.js b/src/gameobjects/bitmaptext/static/BitmapTextRender.js index 52756e8f2..4da8a05b7 100644 --- a/src/gameobjects/bitmaptext/static/BitmapTextRender.js +++ b/src/gameobjects/bitmaptext/static/BitmapTextRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./BitmapTextWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./BitmapTextCanvasRenderer'); } diff --git a/src/gameobjects/blitter/BlitterRender.js b/src/gameobjects/blitter/BlitterRender.js index 3bdd7df1f..171b86112 100644 --- a/src/gameobjects/blitter/BlitterRender.js +++ b/src/gameobjects/blitter/BlitterRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./BlitterWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./BlitterCanvasRenderer'); } diff --git a/src/gameobjects/container/ContainerRender.js b/src/gameobjects/container/ContainerRender.js index 0a98a7b8a..3450029a2 100644 --- a/src/gameobjects/container/ContainerRender.js +++ b/src/gameobjects/container/ContainerRender.js @@ -9,12 +9,12 @@ var NOOP = require('../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./ContainerWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./ContainerCanvasRenderer'); } diff --git a/src/gameobjects/domelement/DOMElementRender.js b/src/gameobjects/domelement/DOMElementRender.js index a9a215597..d80300c61 100644 --- a/src/gameobjects/domelement/DOMElementRender.js +++ b/src/gameobjects/domelement/DOMElementRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./DOMElementCSSRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./DOMElementCSSRenderer'); } diff --git a/src/gameobjects/extern/ExternRender.js b/src/gameobjects/extern/ExternRender.js index cf2db1783..b942f7dce 100644 --- a/src/gameobjects/extern/ExternRender.js +++ b/src/gameobjects/extern/ExternRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./ExternWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./ExternCanvasRenderer'); } diff --git a/src/gameobjects/graphics/GraphicsRender.js b/src/gameobjects/graphics/GraphicsRender.js index 3149597ca..5562f3ff0 100644 --- a/src/gameobjects/graphics/GraphicsRender.js +++ b/src/gameobjects/graphics/GraphicsRender.js @@ -8,7 +8,7 @@ var NOOP = require('../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./GraphicsWebGLRenderer'); @@ -16,7 +16,7 @@ if (typeof WEBGL_RENDERER !== 'undefined') renderCanvas = require('./GraphicsCanvasRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./GraphicsCanvasRenderer'); } diff --git a/src/gameobjects/image/ImageRender.js b/src/gameobjects/image/ImageRender.js index b5a952469..ca9c89aed 100644 --- a/src/gameobjects/image/ImageRender.js +++ b/src/gameobjects/image/ImageRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./ImageWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./ImageCanvasRenderer'); } diff --git a/src/gameobjects/index.js b/src/gameobjects/index.js index c75244ca1..79c036ad9 100644 --- a/src/gameobjects/index.js +++ b/src/gameobjects/index.js @@ -124,7 +124,7 @@ var GameObjects = { }; // WebGL only Game Objects -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { GameObjects.Shader = require('./shader/Shader'); GameObjects.Mesh = require('./mesh/Mesh'); diff --git a/src/gameobjects/layer/LayerRender.js b/src/gameobjects/layer/LayerRender.js index faa981a31..7f7119e88 100644 --- a/src/gameobjects/layer/LayerRender.js +++ b/src/gameobjects/layer/LayerRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./LayerWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./LayerCanvasRenderer'); } diff --git a/src/gameobjects/mesh/MeshFactory.js b/src/gameobjects/mesh/MeshFactory.js index 9f71324d0..9d929fe7c 100644 --- a/src/gameobjects/mesh/MeshFactory.js +++ b/src/gameobjects/mesh/MeshFactory.js @@ -30,7 +30,7 @@ var GameObjectFactory = require('../GameObjectFactory'); * * @return {Phaser.GameObjects.Mesh} The Game Object that was created. */ -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { GameObjectFactory.register('mesh', function (x, y, texture, frame, vertices, uvs, indicies, containsZ, normals, colors, alphas) { diff --git a/src/gameobjects/mesh/MeshRender.js b/src/gameobjects/mesh/MeshRender.js index e948472ed..5f82597b1 100644 --- a/src/gameobjects/mesh/MeshRender.js +++ b/src/gameobjects/mesh/MeshRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./MeshWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./MeshCanvasRenderer'); } diff --git a/src/gameobjects/nineslice/NineSliceFactory.js b/src/gameobjects/nineslice/NineSliceFactory.js index 41380bee7..1ad2a6543 100644 --- a/src/gameobjects/nineslice/NineSliceFactory.js +++ b/src/gameobjects/nineslice/NineSliceFactory.js @@ -94,7 +94,7 @@ var GameObjectFactory = require('../GameObjectFactory'); * * @return {Phaser.GameObjects.NineSlice} The Game Object that was created. */ -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { GameObjectFactory.register('nineslice', function (x, y, texture, frame, width, height, leftWidth, rightWidth, topHeight, bottomHeight) { diff --git a/src/gameobjects/nineslice/NineSliceRender.js b/src/gameobjects/nineslice/NineSliceRender.js index 5b69e5da5..f60279989 100644 --- a/src/gameobjects/nineslice/NineSliceRender.js +++ b/src/gameobjects/nineslice/NineSliceRender.js @@ -8,11 +8,19 @@ var NOOP = require('../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./NineSliceWebGLRenderer'); } +<<<<<<< HEAD +======= +if (typeof CANVAS_RENDERER) +{ + // renderCanvas = require('./MeshCanvasRenderer'); +} + +>>>>>>> parent of 7aaa976a4 (Updated webpack config DefinePlugin use and corresponding defs to allow those crazy souls who import source directly on node to have a better life #6644) module.exports = { renderWebGL: renderWebGL, diff --git a/src/gameobjects/particles/ParticleEmitterRender.js b/src/gameobjects/particles/ParticleEmitterRender.js index 051bd50fb..5bf96372a 100644 --- a/src/gameobjects/particles/ParticleEmitterRender.js +++ b/src/gameobjects/particles/ParticleEmitterRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./ParticleEmitterWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./ParticleEmitterCanvasRenderer'); } diff --git a/src/gameobjects/pointlight/PointLightRender.js b/src/gameobjects/pointlight/PointLightRender.js index eb3440a2c..b3d62f244 100644 --- a/src/gameobjects/pointlight/PointLightRender.js +++ b/src/gameobjects/pointlight/PointLightRender.js @@ -8,7 +8,7 @@ var NOOP = require('../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./PointLightWebGLRenderer'); } diff --git a/src/gameobjects/rope/RopeFactory.js b/src/gameobjects/rope/RopeFactory.js index d46714512..5f43b6a65 100644 --- a/src/gameobjects/rope/RopeFactory.js +++ b/src/gameobjects/rope/RopeFactory.js @@ -27,7 +27,7 @@ var GameObjectFactory = require('../GameObjectFactory'); * * @return {Phaser.GameObjects.Rope} The Game Object that was created. */ -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { GameObjectFactory.register('rope', function (x, y, texture, frame, points, horizontal, colors, alphas) { diff --git a/src/gameobjects/rope/RopeRender.js b/src/gameobjects/rope/RopeRender.js index abba9ba6c..73e7cc39b 100644 --- a/src/gameobjects/rope/RopeRender.js +++ b/src/gameobjects/rope/RopeRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./RopeWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./RopeCanvasRenderer'); } diff --git a/src/gameobjects/shader/ShaderFactory.js b/src/gameobjects/shader/ShaderFactory.js index 8ad54a58e..f9563aa24 100644 --- a/src/gameobjects/shader/ShaderFactory.js +++ b/src/gameobjects/shader/ShaderFactory.js @@ -26,7 +26,7 @@ var GameObjectFactory = require('../GameObjectFactory'); * * @return {Phaser.GameObjects.Shader} The Game Object that was created. */ -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { GameObjectFactory.register('shader', function (key, x, y, width, height, textures, textureData) { diff --git a/src/gameobjects/shader/ShaderRender.js b/src/gameobjects/shader/ShaderRender.js index a267c4376..f11fbdc58 100644 --- a/src/gameobjects/shader/ShaderRender.js +++ b/src/gameobjects/shader/ShaderRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./ShaderWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./ShaderCanvasRenderer'); } diff --git a/src/gameobjects/shape/arc/ArcRender.js b/src/gameobjects/shape/arc/ArcRender.js index 1463957d2..f63d46417 100644 --- a/src/gameobjects/shape/arc/ArcRender.js +++ b/src/gameobjects/shape/arc/ArcRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./ArcWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./ArcCanvasRenderer'); } diff --git a/src/gameobjects/shape/curve/CurveRender.js b/src/gameobjects/shape/curve/CurveRender.js index f2d6d6826..066540d88 100644 --- a/src/gameobjects/shape/curve/CurveRender.js +++ b/src/gameobjects/shape/curve/CurveRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./CurveWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./CurveCanvasRenderer'); } diff --git a/src/gameobjects/shape/ellipse/EllipseRender.js b/src/gameobjects/shape/ellipse/EllipseRender.js index 90546eb3e..336f6608c 100644 --- a/src/gameobjects/shape/ellipse/EllipseRender.js +++ b/src/gameobjects/shape/ellipse/EllipseRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./EllipseWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./EllipseCanvasRenderer'); } diff --git a/src/gameobjects/shape/grid/GridRender.js b/src/gameobjects/shape/grid/GridRender.js index d62ab5633..e5006b94a 100644 --- a/src/gameobjects/shape/grid/GridRender.js +++ b/src/gameobjects/shape/grid/GridRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./GridWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./GridCanvasRenderer'); } diff --git a/src/gameobjects/shape/isobox/IsoBoxRender.js b/src/gameobjects/shape/isobox/IsoBoxRender.js index bdd5788c2..3d9ecb231 100644 --- a/src/gameobjects/shape/isobox/IsoBoxRender.js +++ b/src/gameobjects/shape/isobox/IsoBoxRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./IsoBoxWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./IsoBoxCanvasRenderer'); } diff --git a/src/gameobjects/shape/isotriangle/IsoTriangleRender.js b/src/gameobjects/shape/isotriangle/IsoTriangleRender.js index 512a49949..f3472cded 100644 --- a/src/gameobjects/shape/isotriangle/IsoTriangleRender.js +++ b/src/gameobjects/shape/isotriangle/IsoTriangleRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./IsoTriangleWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./IsoTriangleCanvasRenderer'); } diff --git a/src/gameobjects/shape/line/LineRender.js b/src/gameobjects/shape/line/LineRender.js index 382820f75..e1c052203 100644 --- a/src/gameobjects/shape/line/LineRender.js +++ b/src/gameobjects/shape/line/LineRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./LineWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./LineCanvasRenderer'); } diff --git a/src/gameobjects/shape/polygon/PolygonRender.js b/src/gameobjects/shape/polygon/PolygonRender.js index 0fd2873aa..faeeb7d02 100644 --- a/src/gameobjects/shape/polygon/PolygonRender.js +++ b/src/gameobjects/shape/polygon/PolygonRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./PolygonWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./PolygonCanvasRenderer'); } diff --git a/src/gameobjects/shape/rectangle/RectangleRender.js b/src/gameobjects/shape/rectangle/RectangleRender.js index a7beb1e06..8efdbbc1c 100644 --- a/src/gameobjects/shape/rectangle/RectangleRender.js +++ b/src/gameobjects/shape/rectangle/RectangleRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./RectangleWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./RectangleCanvasRenderer'); } diff --git a/src/gameobjects/shape/star/StarRender.js b/src/gameobjects/shape/star/StarRender.js index 84bae5186..222bf5ceb 100644 --- a/src/gameobjects/shape/star/StarRender.js +++ b/src/gameobjects/shape/star/StarRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./StarWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./StarCanvasRenderer'); } diff --git a/src/gameobjects/shape/triangle/TriangleRender.js b/src/gameobjects/shape/triangle/TriangleRender.js index cebad9b22..f4d4ba3fd 100644 --- a/src/gameobjects/shape/triangle/TriangleRender.js +++ b/src/gameobjects/shape/triangle/TriangleRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./TriangleWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./TriangleCanvasRenderer'); } diff --git a/src/gameobjects/sprite/SpriteRender.js b/src/gameobjects/sprite/SpriteRender.js index 602ca1ac0..5571ea815 100644 --- a/src/gameobjects/sprite/SpriteRender.js +++ b/src/gameobjects/sprite/SpriteRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./SpriteWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./SpriteCanvasRenderer'); } diff --git a/src/gameobjects/text/Text.js b/src/gameobjects/text/Text.js index dcb3a9481..fc3beca37 100644 --- a/src/gameobjects/text/Text.js +++ b/src/gameobjects/text/Text.js @@ -1433,7 +1433,7 @@ var Text = new Class({ { this.frame.source.glTexture = this.renderer.canvasToTexture(canvas, this.frame.source.glTexture, true); - if (typeof WEBGL_DEBUG !== 'undefined') + if (typeof WEBGL_DEBUG) { this.frame.glTexture.spectorMetadata = { textureKey: 'Text Game Object' }; } diff --git a/src/gameobjects/text/TextRender.js b/src/gameobjects/text/TextRender.js index 43b948283..672003a8c 100644 --- a/src/gameobjects/text/TextRender.js +++ b/src/gameobjects/text/TextRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./TextWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./TextCanvasRenderer'); } diff --git a/src/gameobjects/tilesprite/TileSprite.js b/src/gameobjects/tilesprite/TileSprite.js index aff8316e9..a7da49e41 100644 --- a/src/gameobjects/tilesprite/TileSprite.js +++ b/src/gameobjects/tilesprite/TileSprite.js @@ -469,7 +469,7 @@ var TileSprite = new Class({ { this.fillPattern = this.renderer.canvasToTexture(canvas, this.fillPattern); - if (typeof WEBGL_DEBUG !== 'undefined') + if (typeof WEBGL_DEBUG) { this.fillPattern.spectorMetadata = { textureKey: 'TileSprite Game Object' }; } diff --git a/src/gameobjects/tilesprite/TileSpriteRender.js b/src/gameobjects/tilesprite/TileSpriteRender.js index fd1dddeb8..b31e35b8b 100644 --- a/src/gameobjects/tilesprite/TileSpriteRender.js +++ b/src/gameobjects/tilesprite/TileSpriteRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./TileSpriteWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./TileSpriteCanvasRenderer'); } diff --git a/src/gameobjects/video/VideoRender.js b/src/gameobjects/video/VideoRender.js index 8e09c147a..8fb572763 100644 --- a/src/gameobjects/video/VideoRender.js +++ b/src/gameobjects/video/VideoRender.js @@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./VideoWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./VideoCanvasRenderer'); } diff --git a/src/phaser-arcade-physics.js b/src/phaser-arcade-physics.js index 5b1d9d534..1cb07af75 100644 --- a/src/phaser-arcade-physics.js +++ b/src/phaser-arcade-physics.js @@ -55,12 +55,12 @@ var Phaser = { // Merge in the optional plugins and WebGL only features -if (typeof FEATURE_SOUND !== 'undefined') +if (typeof FEATURE_SOUND) { Phaser.Sound = require('./sound'); } -if (typeof PLUGIN_CAMERA3D !== 'undefined') +if (typeof PLUGIN_CAMERA3D) { Phaser.Cameras.Sprite3D = require('../plugins/camera3d/src'); Phaser.GameObjects.Sprite3D = require('../plugins/camera3d/src/sprite3d/Sprite3D'); @@ -68,7 +68,7 @@ if (typeof PLUGIN_CAMERA3D !== 'undefined') Phaser.GameObjects.Creators.Sprite3D = require('../plugins/camera3d/src/sprite3d/Sprite3DCreator'); } -if (typeof PLUGIN_FBINSTANT !== 'undefined') +if (typeof PLUGIN_FBINSTANT) { Phaser.FacebookInstantGamesPlugin = require('../plugins/fbinstant/src/FacebookInstantGamesPlugin'); } diff --git a/src/phaser-core.js b/src/phaser-core.js index 71af8919d..1b39451e2 100644 --- a/src/phaser-core.js +++ b/src/phaser-core.js @@ -103,7 +103,7 @@ var Phaser = { // Merge in the optional plugins and WebGL only features -if (typeof FEATURE_SOUND !== 'undefined') +if (typeof FEATURE_SOUND) { Phaser.Sound = require('./sound'); } diff --git a/src/phaser-ie9.js b/src/phaser-ie9.js index ced81a105..31556da52 100644 --- a/src/phaser-ie9.js +++ b/src/phaser-ie9.js @@ -52,12 +52,12 @@ var Phaser = { // Merge in the optional plugins and WebGL only features -if (typeof FEATURE_SOUND !== 'undefined') +if (typeof FEATURE_SOUND) { Phaser.Sound = require('./sound'); } -if (typeof PLUGIN_CAMERA3D !== 'undefined') +if (typeof PLUGIN_CAMERA3D) { Phaser.Cameras.Sprite3D = require('../plugins/camera3d/src'); Phaser.GameObjects.Sprite3D = require('../plugins/camera3d/src/sprite3d/Sprite3D'); @@ -65,7 +65,7 @@ if (typeof PLUGIN_CAMERA3D !== 'undefined') Phaser.GameObjects.Creators.Sprite3D = require('../plugins/camera3d/src/sprite3d/Sprite3DCreator'); } -if (typeof PLUGIN_FBINSTANT !== 'undefined') +if (typeof PLUGIN_FBINSTANT) { Phaser.FacebookInstantGamesPlugin = require('../plugins/fbinstant/src/FacebookInstantGamesPlugin'); } diff --git a/src/phaser.js b/src/phaser.js index a372f9a61..14dc4de39 100644 --- a/src/phaser.js +++ b/src/phaser.js @@ -53,12 +53,12 @@ var Phaser = { // Merge in the optional plugins and WebGL only features -if (typeof FEATURE_SOUND !== 'undefined') +if (typeof FEATURE_SOUND) { Phaser.Sound = require('./sound'); } -if (typeof PLUGIN_CAMERA3D !== 'undefined') +if (typeof PLUGIN_CAMERA3D) { Phaser.Cameras.Sprite3D = require('../plugins/camera3d/src'); Phaser.GameObjects.Sprite3D = require('../plugins/camera3d/src/sprite3d/Sprite3D'); @@ -66,7 +66,7 @@ if (typeof PLUGIN_CAMERA3D !== 'undefined') Phaser.GameObjects.Creators.Sprite3D = require('../plugins/camera3d/src/sprite3d/Sprite3DCreator'); } -if (typeof PLUGIN_FBINSTANT !== 'undefined') +if (typeof PLUGIN_FBINSTANT) { Phaser.FacebookInstantGamesPlugin = require('../plugins/fbinstant/src/FacebookInstantGamesPlugin'); } diff --git a/src/plugins/DefaultPlugins.js b/src/plugins/DefaultPlugins.js index 4b9dc482b..5fd09aa7e 100644 --- a/src/plugins/DefaultPlugins.js +++ b/src/plugins/DefaultPlugins.js @@ -87,12 +87,12 @@ var DefaultPlugins = { }; -if (typeof PLUGIN_CAMERA3D !== 'undefined') +if (typeof PLUGIN_CAMERA3D) { DefaultPlugins.DefaultScene.push('CameraManager3D'); } -if (typeof PLUGIN_FBINSTANT !== 'undefined') +if (typeof PLUGIN_FBINSTANT) { DefaultPlugins.Global.push('facebook'); } diff --git a/src/renderer/index.js b/src/renderer/index.js index 244eab4be..48d9effff 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -19,12 +19,12 @@ module.exports = { }; -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { module.exports.Canvas = require('./canvas'); } -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { module.exports.WebGL = require('./webgl'); } diff --git a/src/renderer/webgl/WebGLRenderer.js b/src/renderer/webgl/WebGLRenderer.js index 43b850d80..0c1d7a889 100644 --- a/src/renderer/webgl/WebGLRenderer.js +++ b/src/renderer/webgl/WebGLRenderer.js @@ -30,7 +30,7 @@ var WebGLUniformLocationWrapper = require('./wrappers/WebGLUniformLocationWrappe var DEBUG = false; -if (typeof WEBGL_DEBUG !== 'undefined') +if (typeof WEBGL_DEBUG) { var SPECTOR = require('phaser3spectorjs'); DEBUG = true; diff --git a/src/scene/InjectionMap.js b/src/scene/InjectionMap.js index 66b0a6201..df441ad51 100644 --- a/src/scene/InjectionMap.js +++ b/src/scene/InjectionMap.js @@ -47,12 +47,12 @@ var InjectionMap = { }; -if (typeof PLUGIN_CAMERA3D !== 'undefined') +if (typeof PLUGIN_CAMERA3D) { InjectionMap.cameras3d = 'cameras3d'; } -if (typeof PLUGIN_FBINSTANT !== 'undefined') +if (typeof PLUGIN_FBINSTANT) { InjectionMap.facebook = 'facebook'; } diff --git a/src/scene/Scene.js b/src/scene/Scene.js index 3d23565ba..0222aa41e 100644 --- a/src/scene/Scene.js +++ b/src/scene/Scene.js @@ -257,7 +257,7 @@ var Scene = new Class({ */ this.matter; - if (typeof PLUGIN_FBINSTANT !== 'undefined') + if (typeof PLUGIN_FBINSTANT) { /** * The Facebook Instant Games Plugin. diff --git a/src/scene/Systems.js b/src/scene/Systems.js index c9b3ba823..dc5625560 100644 --- a/src/scene/Systems.js +++ b/src/scene/Systems.js @@ -62,7 +62,7 @@ var Systems = new Class({ */ this.renderer; - if (typeof PLUGIN_FBINSTANT !== 'undefined') + if (typeof PLUGIN_FBINSTANT) { /** * The Facebook Instant Games Plugin. diff --git a/src/textures/TextureSource.js b/src/textures/TextureSource.js index 1f39a0a0b..2a026c06b 100644 --- a/src/textures/TextureSource.js +++ b/src/textures/TextureSource.js @@ -255,7 +255,7 @@ var TextureSource = new Class({ this.glTexture = renderer.createTextureFromSource(image, width, height, scaleMode); } - if (typeof WEBGL_DEBUG !== 'undefined') + if (typeof WEBGL_DEBUG) { this.glTexture.spectorMetadata = { textureKey: this.texture.key }; } diff --git a/src/tilemaps/TilemapLayerRender.js b/src/tilemaps/TilemapLayerRender.js index 39155c79d..b809bce1c 100644 --- a/src/tilemaps/TilemapLayerRender.js +++ b/src/tilemaps/TilemapLayerRender.js @@ -8,12 +8,12 @@ var NOOP = require('../utils/NOOP'); var renderWebGL = NOOP; var renderCanvas = NOOP; -if (typeof WEBGL_RENDERER !== 'undefined') +if (typeof WEBGL_RENDERER) { renderWebGL = require('./TilemapLayerWebGLRenderer'); } -if (typeof CANVAS_RENDERER !== 'undefined') +if (typeof CANVAS_RENDERER) { renderCanvas = require('./TilemapLayerCanvasRenderer'); }