Skip to content

Commit

Permalink
Revert define changes as they don't work
Browse files Browse the repository at this point in the history
  • Loading branch information
photonstorm committed Feb 21, 2024
1 parent 7959f37 commit c445303
Show file tree
Hide file tree
Showing 57 changed files with 142 additions and 134 deletions.
16 changes: 8 additions & 8 deletions config/webpack-nospector.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
16 changes: 8 additions & 8 deletions config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
16 changes: 8 additions & 8 deletions config/webpack.dist.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
14 changes: 7 additions & 7 deletions config/webpack.fb.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
14 changes: 7 additions & 7 deletions config/webpack.fb.dist.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
]
};
6 changes: 3 additions & 3 deletions src/core/CreateRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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');

Expand All @@ -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');

Expand Down
2 changes: 1 addition & 1 deletion src/core/DebugHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ var DebugHeader = function (game)
}
}

var fb = (typeof PLUGIN_FBINSTANT !== 'undefined') ? '-FB' : '';
var fb = (typeof PLUGIN_FBINSTANT) ? '-FB' : '';

if (!config.hidePhaser)
{
Expand Down
10 changes: 5 additions & 5 deletions src/core/Game.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextRender.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
4 changes: 2 additions & 2 deletions src/gameobjects/bitmaptext/static/BitmapTextRender.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
4 changes: 2 additions & 2 deletions src/gameobjects/blitter/BlitterRender.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
4 changes: 2 additions & 2 deletions src/gameobjects/container/ContainerRender.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
4 changes: 2 additions & 2 deletions src/gameobjects/domelement/DOMElementRender.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
4 changes: 2 additions & 2 deletions src/gameobjects/extern/ExternRender.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
4 changes: 2 additions & 2 deletions src/gameobjects/graphics/GraphicsRender.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ var NOOP = require('../../utils/NOOP');
var renderWebGL = NOOP;
var renderCanvas = NOOP;

if (typeof WEBGL_RENDERER !== 'undefined')
if (typeof WEBGL_RENDERER)
{
renderWebGL = require('./GraphicsWebGLRenderer');

// Needed for Graphics.generateTexture
renderCanvas = require('./GraphicsCanvasRenderer');
}

if (typeof CANVAS_RENDERER !== 'undefined')
if (typeof CANVAS_RENDERER)
{
renderCanvas = require('./GraphicsCanvasRenderer');
}
Expand Down
4 changes: 2 additions & 2 deletions src/gameobjects/image/ImageRender.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
2 changes: 1 addition & 1 deletion src/gameobjects/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions src/gameobjects/layer/LayerRender.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
2 changes: 1 addition & 1 deletion src/gameobjects/mesh/MeshFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions src/gameobjects/mesh/MeshRender.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
2 changes: 1 addition & 1 deletion src/gameobjects/nineslice/NineSliceFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
10 changes: 9 additions & 1 deletion src/gameobjects/nineslice/NineSliceRender.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading

0 comments on commit c445303

Please sign in to comment.