Skip to content

Commit 7271eb5

Browse files
committed
Removed un-needed cache arguments and fixed jshint error.
1 parent f552615 commit 7271eb5

2 files changed

Lines changed: 16 additions & 26 deletions

File tree

src/loader/Cache.js

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ Phaser.Cache.prototype = {
560560
data: data,
561561
frameWidth: frameWidth,
562562
frameHeight: frameHeight,
563-
margin: margin,
563+
margin: margin,
564564
spacing: spacing,
565565
base: new PIXI.BaseTexture(data),
566566
frameData: Phaser.AnimationParser.spriteSheet(this.game, data, frameWidth, frameHeight, frameMax, margin, spacing)
@@ -1415,9 +1415,7 @@ Phaser.Cache.prototype = {
14151415
*/
14161416
getFrameCount: function (key) {
14171417

1418-
if (map === undefined) { map = Phaser.Cache.IMAGE; }
1419-
1420-
var data = this.getFrameData(key, map);
1418+
var data = this.getFrameData(key);
14211419

14221420
if (data)
14231421
{
@@ -1431,38 +1429,32 @@ Phaser.Cache.prototype = {
14311429
},
14321430

14331431
/**
1434-
* Gets a Phaser.FrameData object from the cache.
1432+
* Gets a Phaser.FrameData object from the Image Cache.
14351433
*
14361434
* The object is looked-up based on the key given.
14371435
*
14381436
* Note: If the object cannot be found a `console.warn` message is displayed.
14391437
*
14401438
* @method Phaser.Cache#getFrameData
14411439
* @param {string} key - Asset key of the frame data to retrieve from the Cache.
1442-
* @param {integer} [cache=Phaser.Cache.IMAGE] - The cache to search. One of the Cache consts such as `Phaser.Cache.IMAGE` or `Phaser.Cache.SOUND`.
14431440
* @return {Phaser.FrameData} The frame data.
14441441
*/
1445-
getFrameData: function (key, cache) {
1442+
getFrameData: function (key) {
14461443

1447-
if (cache === undefined) { cache = Phaser.Cache.IMAGE; }
1448-
1449-
return this.getItem(key, cache, 'getFrameData', 'frameData');
1444+
return this.getItem(key, Phaser.Cache.IMAGE, 'getFrameData', 'frameData');
14501445

14511446
},
14521447

14531448
/**
1454-
* Check if the FrameData for the given key exists in the cache.
1449+
* Check if the FrameData for the given key exists in the Image Cache.
14551450
*
14561451
* @method Phaser.Cache#hasFrameData
14571452
* @param {string} key - Asset key of the frame data to retrieve from the Cache.
1458-
* @param {integer} [cache=Phaser.Cache.IMAGE] - The cache to search. One of the Cache consts such as `Phaser.Cache.IMAGE` or `Phaser.Cache.SOUND`.
14591453
* @return {boolean} True if the given key has frameData in the cache, otherwise false.
14601454
*/
1461-
hasFrameData: function (key, cache) {
1455+
hasFrameData: function (key) {
14621456

1463-
if (cache === undefined) { cache = Phaser.Cache.IMAGE; }
1464-
1465-
return (this.getItem(key, cache, '', 'frameData') !== null);
1457+
return (this.getItem(key, Phaser.Cache.IMAGE, '', 'frameData') !== null);
14661458

14671459
},
14681460

@@ -1491,12 +1483,11 @@ Phaser.Cache.prototype = {
14911483
* @method Phaser.Cache#getFrameByIndex
14921484
* @param {string} key - Asset key of the frame data to retrieve from the Cache.
14931485
* @param {number} index - The index of the frame you want to get.
1494-
* @param {integer} [cache=Phaser.Cache.IMAGE] - The cache to search. One of the Cache consts such as `Phaser.Cache.IMAGE` or `Phaser.Cache.SOUND`.
14951486
* @return {Phaser.Frame} The frame object.
14961487
*/
1497-
getFrameByIndex: function (key, index, cache) {
1488+
getFrameByIndex: function (key, index) {
14981489

1499-
var data = this.getFrameData(key, cache);
1490+
var data = this.getFrameData(key);
15001491

15011492
if (data)
15021493
{
@@ -1515,12 +1506,11 @@ Phaser.Cache.prototype = {
15151506
* @method Phaser.Cache#getFrameByName
15161507
* @param {string} key - Asset key of the frame data to retrieve from the Cache.
15171508
* @param {string} name - The name of the frame you want to get.
1518-
* @param {integer} [cache=Phaser.Cache.IMAGE] - The cache to search. One of the Cache consts such as `Phaser.Cache.IMAGE` or `Phaser.Cache.SOUND`.
15191509
* @return {Phaser.Frame} The frame object.
15201510
*/
1521-
getFrameByName: function (key, name, cache) {
1511+
getFrameByName: function (key, name) {
15221512

1523-
var data = this.getFrameData(key, cache);
1513+
var data = this.getFrameData(key);
15241514

15251515
if (data)
15261516
{

typescript/phaser.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference path="pixi.d.ts" />
22
/// <reference path="p2.d.ts" />
33

4-
// Type definitions for Phaser 2.4.0 2015-Jul-15
4+
// Type definitions for Phaser 2.4.0 2015-Jul-16
55
// Project: https://github.com/photonstorm/phaser
66

77
declare class Phaser {
@@ -433,10 +433,10 @@ declare module Phaser {
433433
getBitmapFont(key: string): Phaser.RetroFont;
434434
getCanvas(key: string): any;
435435
getFrame(key: string): Phaser.Frame;
436-
getFrameByIndex(key: string, index: number, cache?: number): Phaser.Frame;
437-
getFrameByName(key: string, name: string, cache?: number): Phaser.Frame;
436+
getFrameByIndex(key: string, index: number): Phaser.Frame;
437+
getFrameByName(key: string, name: string): Phaser.Frame;
438438
getFrameCount(key: string): number;
439-
getFrameData(key: string, cache?: string): Phaser.FrameData;
439+
getFrameData(key: string): Phaser.FrameData;
440440
getImage(key: string, full?: boolean): Phaser.Image;
441441
getItem(key: string, cache: number, method?: string, property?: string): any;
442442
getJSON(key: string, clone?: boolean): any;

0 commit comments

Comments
 (0)