From 47834ad4788dc0b3df8f155c8154c106f391feb1 Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Wed, 18 Sep 2013 14:02:31 +0100 Subject: [PATCH] Fixed issue in FrameData.getFrameIndexes where the input array was being ignored. --- README.md | 5 +++++ src/Phaser.js | 2 +- src/animation/FrameData.js | 12 ++++++------ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 24f91ad0..334d7244 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,11 @@ Phaser is everything we ever wanted from an HTML5 game framework. It will power Change Log ---------- +Version 1.0.5 (September 19th 2013) + +* Fixed issue in FrameData.getFrameIndexes where the input array was being ignored. + + Version 1.0.4 (September 18th 2013) * Small fix to Phaser.Canvas to stop it from setting overflow hidden if the parent DOM element doesn't exist. diff --git a/src/Phaser.js b/src/Phaser.js index 81db0034..65640f6e 100644 --- a/src/Phaser.js +++ b/src/Phaser.js @@ -3,7 +3,7 @@ */ var Phaser = Phaser || { - VERSION: '1.0.4', + VERSION: '1.0.5', GAMES: [], AUTO: 0, CANVAS: 1, diff --git a/src/animation/FrameData.js b/src/animation/FrameData.js index a9789bfe..4a975830 100644 --- a/src/animation/FrameData.js +++ b/src/animation/FrameData.js @@ -188,14 +188,14 @@ Phaser.Animation.FrameData.prototype = { * @param {Array} [output] Optional array. If given the results will be appended to the end of this Array, otherwise a new array is created. * @return {Array} An array of all Frame indexes matching the given names or IDs. */ - getFrameIndexes: function (input, useNumericIndex, output) { + getFrameIndexes: function (frames, useNumericIndex, output) { if (typeof useNumericIndex === "undefined") { useNumericIndex = true; } if (typeof output === "undefined") { output = []; } if (typeof frames === "undefined" || frames.length == 0) { - // No input array, so we loop through all frames + // No frames array, so we loop through all frames for (var i = 0, len = this._frames.length; i < len; i++) { output.push(this._frames[i].index); @@ -204,16 +204,16 @@ Phaser.Animation.FrameData.prototype = { else { // Input array given, loop through that instead - for (var i = 0, len = input.length; i < len; i++) + for (var i = 0, len = frames.length; i < len; i++) { - // Does the input array contain names or indexes? + // Does the frames array contain names or indexes? if (useNumericIndex) { - output.push(input[i].index); + output.push(frames[i].index); } else { - output.push(this.getFrameByName(input[i]).index); + output.push(this.getFrameByName(frames[i]).index); } } }