From 77c953ad74aebc3bff07b0164d9e4016a62d0f3a Mon Sep 17 00:00:00 2001 From: zhangbin Date: Mon, 25 Apr 2016 11:48:51 +0800 Subject: [PATCH 1/3] Solve the error that can't get the content of depended RawAsset by url. --- cocos2d/core/load-pipeline/downloader.js | 9 +++++++++ cocos2d/core/load-pipeline/loading-items.js | 12 +++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/cocos2d/core/load-pipeline/downloader.js b/cocos2d/core/load-pipeline/downloader.js index 5915d13da5..bad57dd211 100644 --- a/cocos2d/core/load-pipeline/downloader.js +++ b/cocos2d/core/load-pipeline/downloader.js @@ -263,6 +263,15 @@ function downloadUuid (item, callback) { item.url = url; item.isRawAsset = isRawAsset; if (isRawAsset) { + self.pipeline._items.map[url] = { + id: url, + url: url, + type: Path.extname(url).toLowerCase().substr(1), + error: null, + alias: item.id, + complete: true + }; + var ext = Path.extname(url).toLowerCase(); if (!ext) { callback(new Error('Download Uuid: can not find type of raw asset[' + uuid + ']: ' + url)); diff --git a/cocos2d/core/load-pipeline/loading-items.js b/cocos2d/core/load-pipeline/loading-items.js index ced9e16ade..386c9fca0c 100644 --- a/cocos2d/core/load-pipeline/loading-items.js +++ b/cocos2d/core/load-pipeline/loading-items.js @@ -124,7 +124,17 @@ JS.mixin(LoadingItems.prototype, CallbacksInvoker.prototype, { */ getContent: function (id) { var item = this.map[id]; - return item ? item.content : null; + var ret = null; + if (item) { + if (item.content) { + ret = item.content; + } + else if (item.alias) { + ret = this.getContent(item.alias); + } + } + + return ret; }, /** From e09bebcb0b3a315133d17093a1e46b363a0d8c59 Mon Sep 17 00:00:00 2001 From: zhangbin Date: Mon, 25 Apr 2016 14:25:34 +0800 Subject: [PATCH 2/3] Solve the error in component TiledMap. --- cocos2d/tilemap/CCTiledMap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos2d/tilemap/CCTiledMap.js b/cocos2d/tilemap/CCTiledMap.js index 963490045d..c3cddb0c9a 100644 --- a/cocos2d/tilemap/CCTiledMap.js +++ b/cocos2d/tilemap/CCTiledMap.js @@ -177,7 +177,7 @@ var TiledMap = cc.Class({ }, _tmxFile: { - default: '', + default: null, type: cc.TiledMapAsset }, /** From ddae03943f5546963221abcc056c2a6b7b182ef4 Mon Sep 17 00:00:00 2001 From: zhangbin Date: Tue, 26 Apr 2016 12:47:05 +0800 Subject: [PATCH 3/3] Solve the error z-order when a TiledMap node has non-TiledLayer child. --- cocos2d/tilemap/CCTiledMap.js | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos2d/tilemap/CCTiledMap.js b/cocos2d/tilemap/CCTiledMap.js index c3cddb0c9a..ccb04e9576 100644 --- a/cocos2d/tilemap/CCTiledMap.js +++ b/cocos2d/tilemap/CCTiledMap.js @@ -671,6 +671,7 @@ var TiledMap = cc.Class({ var child = logicChildren[i]; var tmxLayer = child.getComponent(cc.TiledLayer); var zOrderValue = child.getSiblingIndex(); + child.setLocalZOrder(zOrderValue); if (tmxLayer) { if (tmxLayer._sgNode) { tmxLayer._sgNode.setLocalZOrder(zOrderValue);