Skip to content

Commit

Permalink
Phaser 2.4.1 Release.
Browse files Browse the repository at this point in the history
  • Loading branch information
photonstorm committed Jul 24, 2015
2 parents 4ef1fc5 + 9401755 commit 7b3596f
Show file tree
Hide file tree
Showing 412 changed files with 71,263 additions and 69,284 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Change Log

## Version 2.4.1 - "Ionin Spring" - 24th July 2015

This is a small point release that updates the Creature runtimes and fixes a couple of small cache issues.

It also modifies the Grunt build scripts so that all third party libs (such as Creature, P2, gl-matrix and PIXI) are now kept well and truly outside of Phaser. They are defined and placed first in the build files. So no more PIXI hiding within the Phaser namespace or UMD patching for Phaser required.

### Updates

* The Creature Runtimes have been updated to the latest versions and the `Phaser.Creature` class updated to use them.
* GameObjectFactory.creature is a new method to help with quick Creature animation object creation.
* Cache.getPixiTexture will now search the image cache if it couldn't find a texture in the PIXI.TextureCache global array, if it finds a matching image in the image cache then it returns a new PIXI.Texture based on it.
* Cache.getPixiBaseTexture will now search the image cache if it couldn't find a BaseTexture in the PIXI.BaseTextureCache global array.

### Bug Fixes

* Fixed Cache.getKeys to use the `_cacheMap` (thanks @jamesgroat #1929)
* Safari on OSX wouldn't recognise button presses on trackpads (thanks JakeCake)
* Cache.removeImage now calls destroy on the image BaseTexture, removing it from the PIXI global caches without throwing a warning.

## Version 2.4 - "Katar" - 22nd July 2015

### API Changes
Expand Down
210 changes: 170 additions & 40 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ module.exports = function (grunt) {

var modules = {

'pixi': { 'description': 'Pixi.js (custom Phaser build)', 'optional': false, 'stub': false },
'intro': { 'description': 'Phaser UMD wrapper', 'optional': true, 'stub': false },
'phaser': { 'description': 'Phaser Globals', 'optional': false, 'stub': false },
'geom': { 'description': 'Geometry Classes', 'optional': false, 'stub': false },
Expand Down Expand Up @@ -112,76 +111,151 @@ module.exports = function (grunt) {

grunt.log.writeln("Excluding modules:\n");

var excludes = grunt.option('exclude').split(',');
var excludedKeys = [];

// Check the given modules are all valid
for (var i = 0; i < excludes.length; i++)
// Nothing is excluded!
var excludes = false;

if (grunt.option('exclude') !== 'null')
{
var exclude = excludes[i];
excludes = grunt.option('exclude').split(',');

// Check the given modules are all valid
for (var i = 0; i < excludes.length; i++)
{
var exclude = excludes[i];

if (modules[exclude])
{
grunt.log.writeln("* " + exclude + ' - ' + modules[exclude].description);
excludedKeys[exclude] = true;
}
else
{
grunt.fail.fatal("Unknown module '" + exclude + "'");
}
}

// Handle basic dependencies

if (modules[exclude])
if (excludedKeys['arcade'] && !excludedKeys['particles'])
{
grunt.log.writeln("* " + exclude + ' - ' + modules[exclude].description);
grunt.log.writeln("Warning: Particles rely on Arcade Physics which has been excluded. Removing Particles from build.");
excludes.push('particles');
}
else

if (excludedKeys['rendertexture'] && !excludedKeys['retrofont'])
{
grunt.fail.fatal("Unknown module '" + exclude + "'");
grunt.log.writeln("Warning: RetroFonts rely on RenderTextures. Excluding from build.");
excludes.push('retrofont');
}
}

// Handle basic dependencies
// Ok we know the excludes array is fine, let's get this show started

grunt.log.writeln("\nPackaging Globals ...\n");

var filelist = [];

// Clean the working folder
var tasks = [ 'clean:build' ];

// Prepare the globals first, the libs that live outside of Phaser

// 1) Creature

if (!excludedKeys['creature'])
{
grunt.log.writeln("-> Creature");
tasks.push('concat:creatureGlobal');
filelist.push('<%= modules_dir %>/creature-global.js');
}

// 2) P2

if (excludes['arcade'] && !excludes['particles'])
if (!excludedKeys['p2'])
{
grunt.log.writeln("Warning: Particles rely on Arcade Physics. Excluding from build.");
excludes.push('particles');
grunt.log.writeln("-> P2.js");
tasks.push('concat:p2Global');
filelist.push('<%= modules_dir %>/p2-global.js');
}

if (excludes['rendertexture'] && !excludes['retrofont'])
// 3) PIXI

grunt.log.writeln("-> PIXI");
tasks.push('concat:pixiIntro');
filelist.push('<%= modules_dir %>/pixi-intro.js');

// Optional Rope
if (!excludedKeys['rope'])
{
grunt.log.writeln("Warning: RetroFonts rely on RenderTextures. Excluding from build.");
excludes.push('retrofont');
grunt.log.writeln("-> PIXI.Rope");
tasks.push('concat:pixiRope');
filelist.push('<%= modules_dir %>/pixi-rope.js');
}

// Ok we know the excludes array is fine, let's get this show started
// Optional Tilesprite
if (!excludedKeys['tilesprite'])
{
grunt.log.writeln("-> PIXI.TileSprite");
tasks.push('concat:pixiTileSprite');
filelist.push('<%= modules_dir %>/pixi-tilesprite.js');
}

grunt.log.writeln("\nBuilding ...\n");
// PIXI Outro
tasks.push('concat:pixiOutro');
filelist.push('<%= modules_dir %>/pixi-outro.js');

var filelist = [];
// And now for Phaser

// Clean the working folder
var tasks = [ 'clean:build' ];
grunt.log.writeln("\nBuilding ...");

for (var key in modules)
if (excludes !== false)
{
if (modules[key].stub && excludes.indexOf(key) !== -1)
for (var key in modules)
{
// If the module IS excluded and has a stub, we need that
tasks.push('concat:' + key + 'Stub');
if (modules[key].stub && excludes.indexOf(key) !== -1)
{
// If the module IS excluded and has a stub, we need that
tasks.push('concat:' + key + 'Stub');

filelist.push('<%= modules_dir %>/' + key + '.js');
}
else if (modules[key].optional === false || excludes.indexOf(key) === -1)
{
// If it's required or NOT excluded, add it to the tasks list
tasks.push('concat:' + key);
filelist.push('<%= modules_dir %>/' + key + '.js');
}
else if (modules[key].optional === false || excludes.indexOf(key) === -1)
{
// If it's required or NOT excluded, add it to the tasks list
tasks.push('concat:' + key);

filelist.push('<%= modules_dir %>/' + key + '.js');
filelist.push('<%= modules_dir %>/' + key + '.js');

// Special case: If they have Arcade Physics AND Tilemaps we need to include the Tilemap Collision class
if (key === 'arcade' && !excludes['tilemaps'])
{
tasks.push('concat:arcadeTilemaps');
filelist.push('<%= modules_dir %>/arcadeTilemaps.js');
// Special case: If they have Arcade Physics AND Tilemaps we need to include the Tilemap Collision class
if (key === 'arcade' && !excludes['tilemaps'])
{
tasks.push('concat:arcadeTilemaps');
filelist.push('<%= modules_dir %>/arcadeTilemaps.js');
}
}
}
}
else
{
// The full monty ...

for (var mkey in modules)
{
tasks.push('concat:' + mkey);
filelist.push('<%= modules_dir %>/' + mkey + '.js');
}
}

grunt.config.set('filelist', filelist);

tasks.push('concat:custom');

tasks.push('uglify:custom');
if (grunt.option('uglify'))
{
tasks.push('uglify:custom');
}

if (grunt.option('copy'))
{
Expand Down Expand Up @@ -215,17 +289,57 @@ module.exports = function (grunt) {
grunt.option('filename', 'phaser');
grunt.option('sourcemap', true);
grunt.option('copy', false);
grunt.option('uglify', true);

grunt.task.run('custom');

});

grunt.registerTask('full', 'Phaser complete', function() {
grunt.registerTask('full', 'Phaser (excluding Ninja and Creature)', function() {

grunt.option('exclude', 'ninja,creature');
grunt.option('filename', 'phaser');
grunt.option('sourcemap', true);
grunt.option('copy', true);
grunt.option('uglify', true);

grunt.task.run('custom');

});

grunt.registerTask('complete', 'Phaser Build with all libs', function() {

grunt.option('exclude', 'null');
grunt.option('filename', 'phaser-complete');
grunt.option('sourcemap', false);
grunt.option('copy', true);
grunt.option('copycustom', true);
grunt.option('uglify', true);

grunt.task.run('custom');

});

grunt.registerTask('test', 'Phaser Test Build (all libs)', function() {

grunt.option('exclude', 'ninja,creature');
grunt.option('filename', 'phaser-test');
grunt.option('sourcemap', false);
grunt.option('copy', false);
grunt.option('uglify', false);

grunt.task.run('custom');

});

grunt.registerTask('creature', 'Phaser + Creature', function() {

grunt.option('exclude', 'ninja');
grunt.option('filename', 'phaser-creature');
grunt.option('sourcemap', true);
grunt.option('copy', true);
grunt.option('copycustom', true);
grunt.option('uglify', true);

grunt.task.run('custom');

Expand All @@ -238,6 +352,20 @@ module.exports = function (grunt) {
grunt.option('sourcemap', true);
grunt.option('copy', false);
grunt.option('copycustom', true);
grunt.option('uglify', true);

grunt.task.run('custom');

});

grunt.registerTask('ninjaphysics', 'Phaser with Ninja Physics and Tilemaps', function() {

grunt.option('exclude', 'p2,particles,creature');
grunt.option('filename', 'phaser-ninja-physics');
grunt.option('sourcemap', true);
grunt.option('copy', false);
grunt.option('copycustom', true);
grunt.option('uglify', true);

grunt.task.run('custom');

Expand All @@ -250,18 +378,20 @@ module.exports = function (grunt) {
grunt.option('sourcemap', true);
grunt.option('copy', false);
grunt.option('copycustom', true);
grunt.option('uglify', true);

grunt.task.run('custom');

});

grunt.registerTask('minimum', 'Phaser without any optional modules except Pixi', function() {
grunt.registerTask('minimum', 'Phaser without any optional modules', function() {

grunt.option('exclude', 'gamepad,keyboard,bitmapdata,graphics,rendertexture,text,bitmaptext,retrofont,net,tweens,sound,debug,arcade,ninja,p2,tilemaps,particles,creature,video,rope,tilesprite');
grunt.option('filename', 'phaser-minimum');
grunt.option('sourcemap', true);
grunt.option('copy', false);
grunt.option('copycustom', true);
grunt.option('uglify', true);

grunt.task.run('custom');

Expand Down

0 comments on commit 7b3596f

Please sign in to comment.