Removed some more checks

This commit is contained in:
Luc Bloom 2014-07-22 10:42:47 +02:00
parent 7f3b542fdd
commit 0fc30e839e
2 changed files with 5 additions and 26 deletions

View file

@ -112,15 +112,7 @@ Phaser.AnimationManager.prototype = {
this.isLoaded = true;
if (this._frameData)
{
return true;
}
else
{
return false;
}
return true;
},
/**
@ -137,12 +129,6 @@ Phaser.AnimationManager.prototype = {
*/
add: function (name, frames, frameRate, loop, useNumericIndex) {
if (this._frameData === null)
{
console.warn('No FrameData available for Phaser.Animation ' + name);
return;
}
frames = frames || [];
frameRate = frameRate || 60;
@ -441,14 +427,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, 'frameTotal', {
get: function () {
if (this._frameData)
{
return this._frameData.total;
}
else
{
return -1;
}
return this._frameData.total;
}
});
@ -490,7 +469,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, 'frame', {
set: function (value) {
if (typeof value === 'number' && this._frameData && this._frameData.getFrame(value) !== null)
if (typeof value === 'number' && this._frameData.getFrame(value) !== null)
{
this.currentFrame = this._frameData.getFrame(value);
@ -529,7 +508,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, 'frameName', {
set: function (value) {
if (typeof value === 'string' && this._frameData && this._frameData.getFrameByName(value) !== null)
if (typeof value === 'string' && this._frameData.getFrameByName(value) !== null)
{
this.currentFrame = this._frameData.getFrameByName(value);

View file

@ -1053,7 +1053,7 @@ Phaser.Cache.prototype = {
if (this._images[key])
{
return this._images[key].frameData._frames.length;
return this._images[key].frameData.total;
}
return 0;