From f6797eedccce8516b7192fce54af4543417c7bdf Mon Sep 17 00:00:00 2001 From: zhangbin Date: Fri, 13 May 2016 18:27:37 +0800 Subject: [PATCH] Solve the error meta data of tmx file on windows. --- cocos2d/tilemap/editor/tiled-map.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos2d/tilemap/editor/tiled-map.js b/cocos2d/tilemap/editor/tiled-map.js index 3812892618..85a57069e3 100644 --- a/cocos2d/tilemap/editor/tiled-map.js +++ b/cocos2d/tilemap/editor/tiled-map.js @@ -27,7 +27,7 @@ function searchDependFiles(tmxFile, cb) { for (var i = 0, n = images.length; i < n ; i++) { var imageCfg = images[i].getAttribute('source'); if (imageCfg) { - var imgPath = cc.path.changeBasename(sourcePath, imageCfg); + var imgPath = Path.join(Path.dirname(sourcePath), imageCfg); textures.push(imgPath); } } @@ -39,7 +39,7 @@ function searchDependFiles(tmxFile, cb) { var tileset = tilesetElements[i]; var sourceTSX = tileset.getAttribute('source'); if (sourceTSX) { - var tsxPath = cc.path.changeBasename(tmxFile, sourceTSX); + var tsxPath = Path.join(Path.dirname(tmxFile), sourceTSX); if (Fs.existsSync(tsxPath)) { tsxFiles.push(tsxPath);