Skip to content

Commit f054490

Browse files
committed
Fixed issues for CCLoaderLayer
1 parent 48b08f6 commit f054490

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

cocos2d/core/platform/CCSAXParser.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,10 @@ cc.PlistParser = cc.SAXParser.extend(/** @lends cc.plistParser# */{
8888
parse : function (xmlTxt) {
8989
var xmlDoc = this._parseXML(xmlTxt);
9090
var plist = xmlDoc.documentElement;
91-
if (plist.tagName !== 'plist')
92-
throw new Error("Not a plist file!");
91+
if (plist.tagName !== 'plist') {
92+
cc.warn("Not a plist file!");
93+
return {};
94+
}
9395

9496
// Get first real node
9597
var node = null;
@@ -164,4 +166,4 @@ cc.saxParser = new cc.SAXParser();
164166
* @name cc.plistParser
165167
* A Plist Parser
166168
*/
167-
cc.plistParser = new cc.PlistParser();
169+
cc.plistParser = new cc.PlistParser();

extensions/runtime/CCLoaderLayer.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,10 @@ cc.LoaderLayer = cc.Layer.extend({
206206
res = [];
207207
for (var i = 0; i < this._groupname.length; i++) {
208208
var group = groups[this._groupname[i]];
209+
var files = group && group.files;
209210
var preCount = i > 0 ? groupIndex[i - 1] : 0;
210-
groupIndex.push(preCount + group.length);
211-
res = res.concat(group);
211+
groupIndex.push(preCount + files ? files.length : 0);
212+
res = res.concat(files);
212213
}
213214
}
214215
var self = this;
@@ -462,13 +463,14 @@ cc.LoaderLayer.preload = function (groupname, callback, target) {
462463
else {
463464
cc.warn("Group versions haven't been loaded, you can also set group data with 'cc.LoaderLayer.groups'");
464465
}
466+
res_engine_loaded = true;
465467
callPreload();
466468
});
467469
};
468470

469471
cc.LoaderLayer._useDefaultSource = true;
470472
cc.LoaderLayer._isDefaultProgress = true;
471-
cc.LoaderLayer._finalConfig = null;
473+
cc.LoaderLayer._finalConfig = cc.LoaderLayer._confg;
472474
cc.LoaderLayer.groups = {};
473475
cc.LoaderLayer.setUseDefaultSource = function (status) {
474476
cc.LoaderLayer._useDefaultSource = status;
@@ -771,6 +773,7 @@ cc.Dialog._defaultConfig = {
771773
cc.log("dialog call onExit");
772774
}
773775
};
776+
cc.Dialog._finalConfig = cc.Dialog._defaultConfig;
774777
cc.Dialog.setConfig = function (config) {
775778
this._initData(config);
776779
};
@@ -968,4 +971,4 @@ cc.network.preloadstatus = {
968971
}
969972
cc.runtime.network = cc.network;
970973

971-
})();
974+
})();

0 commit comments

Comments
 (0)