From 6e820b3e7f8ba46fb5c6a6c41f7da0a5a71b324d Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Fri, 4 May 2018 14:34:06 +0100 Subject: [PATCH] We know the order, so can avoid checking the type --- src/loader/filetypes/BitmapFontFile.js | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/loader/filetypes/BitmapFontFile.js b/src/loader/filetypes/BitmapFontFile.js index 423447f6b..246a6b219 100644 --- a/src/loader/filetypes/BitmapFontFile.js +++ b/src/loader/filetypes/BitmapFontFile.js @@ -59,20 +59,15 @@ var BitmapFontFile = new Class({ { if (this.isReadyToProcess()) { - var fileA = this.files[0]; - var fileB = this.files[1]; + var image = this.files[0]; + var xml = this.files[1]; - fileA.addToCache(); - fileB.addToCache(); + image.addToCache(); + xml.addToCache(); - if (fileA.type === 'image') - { - this.loader.cacheManager.bitmapFont.add(fileB.key, { data: ParseXMLBitmapFont(fileB.data), texture: fileA.key, frame: null }); - } - else - { - this.loader.cacheManager.bitmapFont.add(fileA.key, { data: ParseXMLBitmapFont(fileA.data), texture: fileB.key, frame: null }); - } + this.loader.cacheManager.bitmapFont.add(image.key, { + data: ParseXMLBitmapFont(xml.data), texture: image.key, frame: null + }); this.complete = true; }