diff --git a/cocos2d/core/load-pipeline/CCLoader.js b/cocos2d/core/load-pipeline/CCLoader.js index a1211aaa75..6ba08cf04b 100644 --- a/cocos2d/core/load-pipeline/CCLoader.js +++ b/cocos2d/core/load-pipeline/CCLoader.js @@ -226,7 +226,7 @@ proto.load = function(resources, progressCallback, completeCallback) { var res = getResWithUrl(resource); if (!res.url && !res.uuid) continue; - var item = this.getItem(res.url); + var item = this._cache[res.url]; _sharedResources.push(item || res); } @@ -265,7 +265,7 @@ proto.flowInDeps = function (owner, urlList, callback) { var res = getResWithUrl(urlList[i]); if (!res.url && ! res.uuid) continue; - var item = this.getItem(res.url); + var item = this._cache[res.url]; if (item) { _sharedList.push(item); } @@ -647,7 +647,7 @@ proto.getRes = function (url, type) { } } if (item && item.alias) { - item = this._cache[item.alias]; + item = item.alias; } return (item && item.complete) ? item.content : null; }; diff --git a/cocos2d/core/load-pipeline/asset-loader.js b/cocos2d/core/load-pipeline/asset-loader.js index 7e13b458a6..42c15b7339 100644 --- a/cocos2d/core/load-pipeline/asset-loader.js +++ b/cocos2d/core/load-pipeline/asset-loader.js @@ -65,7 +65,7 @@ AssetLoader.prototype.handle = function (item, callback) { url: url, type: ext, error: null, - alias: item.id, + alias: item, complete: true }; if (CC_EDITOR) { diff --git a/cocos2d/core/load-pipeline/loading-items.js b/cocos2d/core/load-pipeline/loading-items.js index baee6ca746..1d4e08748b 100644 --- a/cocos2d/core/load-pipeline/loading-items.js +++ b/cocos2d/core/load-pipeline/loading-items.js @@ -595,7 +595,7 @@ proto.getContent = function (id) { ret = item.content; } else if (item.alias) { - ret = this.getContent(item.alias); + ret = item.alias.content; } } @@ -616,7 +616,7 @@ proto.getError = function (id) { if (item.error) { ret = item.error; } else if (item.alias) { - ret = this.getError(item.alias); + ret = item.alias.error; } } @@ -688,8 +688,8 @@ proto.removeItem = function (url) { delete this.completed[url]; delete this.map[url]; if (item.alias) { - delete this.completed[item.alias]; - delete this.map[item.alias]; + delete this.completed[item.alias.id]; + delete this.map[item.alias.id]; } this.completedCount--; diff --git a/cocos2d/core/load-pipeline/pipeline.js b/cocos2d/core/load-pipeline/pipeline.js index a7caf21885..325d1e0402 100644 --- a/cocos2d/core/load-pipeline/pipeline.js +++ b/cocos2d/core/load-pipeline/pipeline.js @@ -384,7 +384,7 @@ proto.getItem = function (id) { // downloader.js downloadUuid if (item.alias) - item = this._cache[item.alias]; + item = item.alias; return item; };