Skip to content

Commit 6e820b3

Browse files
committed
We know the order, so can avoid checking the type
1 parent acf6b94 commit 6e820b3

1 file changed

Lines changed: 9 additions & 14 deletions

File tree

src/loader/filetypes/BitmapFontFile.js

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,15 @@ var BitmapFontFile = new Class({
5959
{
6060
if (this.isReadyToProcess())
6161
{
62-
var fileA = this.files[0];
63-
var fileB = this.files[1];
64-
65-
fileA.addToCache();
66-
fileB.addToCache();
67-
68-
if (fileA.type === 'image')
69-
{
70-
this.loader.cacheManager.bitmapFont.add(fileB.key, { data: ParseXMLBitmapFont(fileB.data), texture: fileA.key, frame: null });
71-
}
72-
else
73-
{
74-
this.loader.cacheManager.bitmapFont.add(fileA.key, { data: ParseXMLBitmapFont(fileA.data), texture: fileB.key, frame: null });
75-
}
62+
var image = this.files[0];
63+
var xml = this.files[1];
64+
65+
image.addToCache();
66+
xml.addToCache();
67+
68+
this.loader.cacheManager.bitmapFont.add(image.key, {
69+
data: ParseXMLBitmapFont(xml.data), texture: image.key, frame: null
70+
});
7671

7772
this.complete = true;
7873
}

0 commit comments

Comments
 (0)