Skip to content

Commit 0fc30e8

Browse files
committed
Removed some more checks
1 parent 7f3b542 commit 0fc30e8

2 files changed

Lines changed: 5 additions & 26 deletions

File tree

src/animation/AnimationManager.js

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,7 @@ Phaser.AnimationManager.prototype = {
112112

113113
this.isLoaded = true;
114114

115-
if (this._frameData)
116-
{
117-
return true;
118-
}
119-
else
120-
{
121-
return false;
122-
}
123-
115+
return true;
124116
},
125117

126118
/**
@@ -137,12 +129,6 @@ Phaser.AnimationManager.prototype = {
137129
*/
138130
add: function (name, frames, frameRate, loop, useNumericIndex) {
139131

140-
if (this._frameData === null)
141-
{
142-
console.warn('No FrameData available for Phaser.Animation ' + name);
143-
return;
144-
}
145-
146132
frames = frames || [];
147133
frameRate = frameRate || 60;
148134

@@ -441,14 +427,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, 'frameTotal', {
441427

442428
get: function () {
443429

444-
if (this._frameData)
445-
{
446-
return this._frameData.total;
447-
}
448-
else
449-
{
450-
return -1;
451-
}
430+
return this._frameData.total;
452431
}
453432

454433
});
@@ -490,7 +469,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, 'frame', {
490469

491470
set: function (value) {
492471

493-
if (typeof value === 'number' && this._frameData && this._frameData.getFrame(value) !== null)
472+
if (typeof value === 'number' && this._frameData.getFrame(value) !== null)
494473
{
495474
this.currentFrame = this._frameData.getFrame(value);
496475

@@ -529,7 +508,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, 'frameName', {
529508

530509
set: function (value) {
531510

532-
if (typeof value === 'string' && this._frameData && this._frameData.getFrameByName(value) !== null)
511+
if (typeof value === 'string' && this._frameData.getFrameByName(value) !== null)
533512
{
534513
this.currentFrame = this._frameData.getFrameByName(value);
535514

src/loader/Cache.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ Phaser.Cache.prototype = {
10531053

10541054
if (this._images[key])
10551055
{
1056-
return this._images[key].frameData._frames.length;
1056+
return this._images[key].frameData.total;
10571057
}
10581058

10591059
return 0;

0 commit comments

Comments
 (0)