mirror of
https://github.com/photonstorm/phaser
synced 2024-11-21 20:23:19 +00:00
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
This commit is contained in:
parent
4a85524425
commit
7aaa976a4e
57 changed files with 135 additions and 135 deletions
|
@ -34,14 +34,14 @@ module.exports = [
|
|||
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
"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)
|
||||
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)
|
||||
}),
|
||||
{
|
||||
apply: (compiler) => {
|
||||
|
|
|
@ -34,14 +34,14 @@ module.exports = [
|
|||
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
"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)
|
||||
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)
|
||||
}),
|
||||
{
|
||||
apply: (compiler) => {
|
||||
|
|
|
@ -54,14 +54,14 @@ module.exports = [
|
|||
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
"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)
|
||||
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)
|
||||
}),
|
||||
|
||||
new CleanWebpackPlugin()
|
||||
|
|
|
@ -27,13 +27,13 @@ module.exports = {
|
|||
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
"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)
|
||||
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)
|
||||
}),
|
||||
{
|
||||
apply: (compiler) => {
|
||||
|
|
|
@ -44,13 +44,13 @@ module.exports = {
|
|||
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
"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)
|
||||
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)
|
||||
})
|
||||
]
|
||||
};
|
||||
|
|
|
@ -95,7 +95,7 @@ var CreateRenderer = function (game)
|
|||
var CanvasRenderer;
|
||||
var WebGLRenderer;
|
||||
|
||||
if (typeof WEBGL_RENDERER && typeof CANVAS_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined' && typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
CanvasRenderer = require('../renderer/canvas/CanvasRenderer');
|
||||
WebGLRenderer = require('../renderer/webgl/WebGLRenderer');
|
||||
|
@ -112,7 +112,7 @@ var CreateRenderer = function (game)
|
|||
}
|
||||
}
|
||||
|
||||
if (typeof WEBGL_RENDERER && !typeof CANVAS_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined' && !typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
WebGLRenderer = require('../renderer/webgl/WebGLRenderer');
|
||||
|
||||
|
@ -122,7 +122,7 @@ var CreateRenderer = function (game)
|
|||
game.renderer = new WebGLRenderer(game);
|
||||
}
|
||||
|
||||
if (!typeof WEBGL_RENDERER && typeof CANVAS_RENDERER)
|
||||
if (!typeof WEBGL_RENDERER !== 'undefined' && typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
CanvasRenderer = require('../renderer/canvas/CanvasRenderer');
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ var DebugHeader = function (game)
|
|||
}
|
||||
}
|
||||
|
||||
var fb = (typeof PLUGIN_FBINSTANT) ? '-FB' : '';
|
||||
var fb = (typeof PLUGIN_FBINSTANT !== 'undefined') ? '-FB' : '';
|
||||
|
||||
if (!config.hidePhaser)
|
||||
{
|
||||
|
|
|
@ -28,12 +28,12 @@ var TextureManager = require('../textures/TextureManager');
|
|||
var TimeStep = require('./TimeStep');
|
||||
var VisibilityHandler = require('./VisibilityHandler');
|
||||
|
||||
if (typeof FEATURE_SOUND)
|
||||
if (typeof FEATURE_SOUND !== 'undefined')
|
||||
{
|
||||
var SoundManagerCreator = require('../sound/SoundManagerCreator');
|
||||
}
|
||||
|
||||
if (typeof PLUGIN_FBINSTANT)
|
||||
if (typeof PLUGIN_FBINSTANT !== 'undefined')
|
||||
{
|
||||
var FacebookInstantGamesPlugin = require('../../plugins/fbinstant/src/FacebookInstantGamesPlugin');
|
||||
}
|
||||
|
@ -255,7 +255,7 @@ var Game = new Class({
|
|||
*/
|
||||
this.sound = null;
|
||||
|
||||
if (typeof FEATURE_SOUND)
|
||||
if (typeof FEATURE_SOUND !== 'undefined')
|
||||
{
|
||||
this.sound = SoundManagerCreator.create(this);
|
||||
}
|
||||
|
@ -284,7 +284,7 @@ var Game = new Class({
|
|||
*/
|
||||
this.plugins = new PluginManager(this, this.config);
|
||||
|
||||
if (typeof PLUGIN_FBINSTANT)
|
||||
if (typeof PLUGIN_FBINSTANT !== 'undefined')
|
||||
{
|
||||
/**
|
||||
* 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 && window)
|
||||
if (typeof WEBGL_DEBUG !== 'undefined' && window)
|
||||
{
|
||||
window.PHASER_GAME = this;
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./DynamicBitmapTextWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./DynamicBitmapTextCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./BitmapTextWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./BitmapTextCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./BlitterWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./BlitterCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -9,12 +9,12 @@ var NOOP = require('../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./ContainerWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./ContainerCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./DOMElementCSSRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./DOMElementCSSRenderer');
|
||||
}
|
||||
|
|
4
src/gameobjects/extern/ExternRender.js
vendored
4
src/gameobjects/extern/ExternRender.js
vendored
|
@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./ExternWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./ExternCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ var NOOP = require('../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./GraphicsWebGLRenderer');
|
||||
|
||||
|
@ -16,7 +16,7 @@ if (typeof WEBGL_RENDERER)
|
|||
renderCanvas = require('./GraphicsCanvasRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./GraphicsCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./ImageWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./ImageCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -124,7 +124,7 @@ var GameObjects = {
|
|||
};
|
||||
|
||||
// WebGL only Game Objects
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
GameObjects.Shader = require('./shader/Shader');
|
||||
GameObjects.Mesh = require('./mesh/Mesh');
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./LayerWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./LayerCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ var GameObjectFactory = require('../GameObjectFactory');
|
|||
*
|
||||
* @return {Phaser.GameObjects.Mesh} The Game Object that was created.
|
||||
*/
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
GameObjectFactory.register('mesh', function (x, y, texture, frame, vertices, uvs, indicies, containsZ, normals, colors, alphas)
|
||||
{
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./MeshWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./MeshCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ var GameObjectFactory = require('../GameObjectFactory');
|
|||
*
|
||||
* @return {Phaser.GameObjects.NineSlice} The Game Object that was created.
|
||||
*/
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
GameObjectFactory.register('nineslice', function (x, y, texture, frame, width, height, leftWidth, rightWidth, topHeight, bottomHeight)
|
||||
{
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./NineSliceWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
// renderCanvas = require('./MeshCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./ParticleEmitterWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./ParticleEmitterCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ var NOOP = require('../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./PointLightWebGLRenderer');
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ var GameObjectFactory = require('../GameObjectFactory');
|
|||
*
|
||||
* @return {Phaser.GameObjects.Rope} The Game Object that was created.
|
||||
*/
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
GameObjectFactory.register('rope', function (x, y, texture, frame, points, horizontal, colors, alphas)
|
||||
{
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./RopeWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./RopeCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ var GameObjectFactory = require('../GameObjectFactory');
|
|||
*
|
||||
* @return {Phaser.GameObjects.Shader} The Game Object that was created.
|
||||
*/
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
GameObjectFactory.register('shader', function (key, x, y, width, height, textures, textureData)
|
||||
{
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./ShaderWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./ShaderCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./ArcWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./ArcCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./CurveWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./CurveCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./EllipseWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./EllipseCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./GridWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./GridCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./IsoBoxWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./IsoBoxCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./IsoTriangleWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./IsoTriangleCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./LineWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./LineCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./PolygonWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./PolygonCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./RectangleWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./RectangleCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./StarWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./StarCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./TriangleWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./TriangleCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./SpriteWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./SpriteCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
if (typeof WEBGL_DEBUG !== 'undefined')
|
||||
{
|
||||
this.frame.glTexture.spectorMetadata = { textureKey: 'Text Game Object' };
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./TextWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./TextCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -469,7 +469,7 @@ var TileSprite = new Class({
|
|||
{
|
||||
this.fillPattern = this.renderer.canvasToTexture(canvas, this.fillPattern);
|
||||
|
||||
if (typeof WEBGL_DEBUG)
|
||||
if (typeof WEBGL_DEBUG !== 'undefined')
|
||||
{
|
||||
this.fillPattern.spectorMetadata = { textureKey: 'TileSprite Game Object' };
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./TileSpriteWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./TileSpriteCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./VideoWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./VideoCanvasRenderer');
|
||||
}
|
||||
|
|
|
@ -55,12 +55,12 @@ var Phaser = {
|
|||
|
||||
// Merge in the optional plugins and WebGL only features
|
||||
|
||||
if (typeof FEATURE_SOUND)
|
||||
if (typeof FEATURE_SOUND !== 'undefined')
|
||||
{
|
||||
Phaser.Sound = require('./sound');
|
||||
}
|
||||
|
||||
if (typeof PLUGIN_CAMERA3D)
|
||||
if (typeof PLUGIN_CAMERA3D !== 'undefined')
|
||||
{
|
||||
Phaser.Cameras.Sprite3D = require('../plugins/camera3d/src');
|
||||
Phaser.GameObjects.Sprite3D = require('../plugins/camera3d/src/sprite3d/Sprite3D');
|
||||
|
@ -68,7 +68,7 @@ if (typeof PLUGIN_CAMERA3D)
|
|||
Phaser.GameObjects.Creators.Sprite3D = require('../plugins/camera3d/src/sprite3d/Sprite3DCreator');
|
||||
}
|
||||
|
||||
if (typeof PLUGIN_FBINSTANT)
|
||||
if (typeof PLUGIN_FBINSTANT !== 'undefined')
|
||||
{
|
||||
Phaser.FacebookInstantGamesPlugin = require('../plugins/fbinstant/src/FacebookInstantGamesPlugin');
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ var Phaser = {
|
|||
|
||||
// Merge in the optional plugins and WebGL only features
|
||||
|
||||
if (typeof FEATURE_SOUND)
|
||||
if (typeof FEATURE_SOUND !== 'undefined')
|
||||
{
|
||||
Phaser.Sound = require('./sound');
|
||||
}
|
||||
|
|
|
@ -52,12 +52,12 @@ var Phaser = {
|
|||
|
||||
// Merge in the optional plugins and WebGL only features
|
||||
|
||||
if (typeof FEATURE_SOUND)
|
||||
if (typeof FEATURE_SOUND !== 'undefined')
|
||||
{
|
||||
Phaser.Sound = require('./sound');
|
||||
}
|
||||
|
||||
if (typeof PLUGIN_CAMERA3D)
|
||||
if (typeof PLUGIN_CAMERA3D !== 'undefined')
|
||||
{
|
||||
Phaser.Cameras.Sprite3D = require('../plugins/camera3d/src');
|
||||
Phaser.GameObjects.Sprite3D = require('../plugins/camera3d/src/sprite3d/Sprite3D');
|
||||
|
@ -65,7 +65,7 @@ if (typeof PLUGIN_CAMERA3D)
|
|||
Phaser.GameObjects.Creators.Sprite3D = require('../plugins/camera3d/src/sprite3d/Sprite3DCreator');
|
||||
}
|
||||
|
||||
if (typeof PLUGIN_FBINSTANT)
|
||||
if (typeof PLUGIN_FBINSTANT !== 'undefined')
|
||||
{
|
||||
Phaser.FacebookInstantGamesPlugin = require('../plugins/fbinstant/src/FacebookInstantGamesPlugin');
|
||||
}
|
||||
|
|
|
@ -53,12 +53,12 @@ var Phaser = {
|
|||
|
||||
// Merge in the optional plugins and WebGL only features
|
||||
|
||||
if (typeof FEATURE_SOUND)
|
||||
if (typeof FEATURE_SOUND !== 'undefined')
|
||||
{
|
||||
Phaser.Sound = require('./sound');
|
||||
}
|
||||
|
||||
if (typeof PLUGIN_CAMERA3D)
|
||||
if (typeof PLUGIN_CAMERA3D !== 'undefined')
|
||||
{
|
||||
Phaser.Cameras.Sprite3D = require('../plugins/camera3d/src');
|
||||
Phaser.GameObjects.Sprite3D = require('../plugins/camera3d/src/sprite3d/Sprite3D');
|
||||
|
@ -66,7 +66,7 @@ if (typeof PLUGIN_CAMERA3D)
|
|||
Phaser.GameObjects.Creators.Sprite3D = require('../plugins/camera3d/src/sprite3d/Sprite3DCreator');
|
||||
}
|
||||
|
||||
if (typeof PLUGIN_FBINSTANT)
|
||||
if (typeof PLUGIN_FBINSTANT !== 'undefined')
|
||||
{
|
||||
Phaser.FacebookInstantGamesPlugin = require('../plugins/fbinstant/src/FacebookInstantGamesPlugin');
|
||||
}
|
||||
|
|
|
@ -87,12 +87,12 @@ var DefaultPlugins = {
|
|||
|
||||
};
|
||||
|
||||
if (typeof PLUGIN_CAMERA3D)
|
||||
if (typeof PLUGIN_CAMERA3D !== 'undefined')
|
||||
{
|
||||
DefaultPlugins.DefaultScene.push('CameraManager3D');
|
||||
}
|
||||
|
||||
if (typeof PLUGIN_FBINSTANT)
|
||||
if (typeof PLUGIN_FBINSTANT !== 'undefined')
|
||||
{
|
||||
DefaultPlugins.Global.push('facebook');
|
||||
}
|
||||
|
|
|
@ -19,12 +19,12 @@ module.exports = {
|
|||
|
||||
};
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
module.exports.Canvas = require('./canvas');
|
||||
}
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
module.exports.WebGL = require('./webgl');
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ var WebGLUniformLocationWrapper = require('./wrappers/WebGLUniformLocationWrappe
|
|||
|
||||
var DEBUG = false;
|
||||
|
||||
if (typeof WEBGL_DEBUG)
|
||||
if (typeof WEBGL_DEBUG !== 'undefined')
|
||||
{
|
||||
var SPECTOR = require('phaser3spectorjs');
|
||||
DEBUG = true;
|
||||
|
|
|
@ -47,12 +47,12 @@ var InjectionMap = {
|
|||
|
||||
};
|
||||
|
||||
if (typeof PLUGIN_CAMERA3D)
|
||||
if (typeof PLUGIN_CAMERA3D !== 'undefined')
|
||||
{
|
||||
InjectionMap.cameras3d = 'cameras3d';
|
||||
}
|
||||
|
||||
if (typeof PLUGIN_FBINSTANT)
|
||||
if (typeof PLUGIN_FBINSTANT !== 'undefined')
|
||||
{
|
||||
InjectionMap.facebook = 'facebook';
|
||||
}
|
||||
|
|
|
@ -257,7 +257,7 @@ var Scene = new Class({
|
|||
*/
|
||||
this.matter;
|
||||
|
||||
if (typeof PLUGIN_FBINSTANT)
|
||||
if (typeof PLUGIN_FBINSTANT !== 'undefined')
|
||||
{
|
||||
/**
|
||||
* The Facebook Instant Games Plugin.
|
||||
|
|
|
@ -62,7 +62,7 @@ var Systems = new Class({
|
|||
*/
|
||||
this.renderer;
|
||||
|
||||
if (typeof PLUGIN_FBINSTANT)
|
||||
if (typeof PLUGIN_FBINSTANT !== 'undefined')
|
||||
{
|
||||
/**
|
||||
* The Facebook Instant Games Plugin.
|
||||
|
|
|
@ -255,7 +255,7 @@ var TextureSource = new Class({
|
|||
this.glTexture = renderer.createTextureFromSource(image, width, height, scaleMode);
|
||||
}
|
||||
|
||||
if (typeof WEBGL_DEBUG)
|
||||
if (typeof WEBGL_DEBUG !== 'undefined')
|
||||
{
|
||||
this.glTexture.spectorMetadata = { textureKey: this.texture.key };
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ var NOOP = require('../utils/NOOP');
|
|||
var renderWebGL = NOOP;
|
||||
var renderCanvas = NOOP;
|
||||
|
||||
if (typeof WEBGL_RENDERER)
|
||||
if (typeof WEBGL_RENDERER !== 'undefined')
|
||||
{
|
||||
renderWebGL = require('./TilemapLayerWebGLRenderer');
|
||||
}
|
||||
|
||||
if (typeof CANVAS_RENDERER)
|
||||
if (typeof CANVAS_RENDERER !== 'undefined')
|
||||
{
|
||||
renderCanvas = require('./TilemapLayerCanvasRenderer');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue