diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp index 99da4ab027..0c62cdb5de 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp @@ -835,6 +835,12 @@ Node* CSLoader::nodeWithFlatBuffers(const flatbuffers::NodeTree *nodetree) // _loadingNodeParentHierarchy.push_back(node); } + // If node is invalid, there is no necessity to process children of node. + if (!node) + { + return nullptr; + } + auto children = nodetree->children(); int size = children->size(); CCLOG("size = %d", size); @@ -1156,6 +1162,12 @@ Node* CSLoader::nodeWithFlatBuffersForSimulator(const flatbuffers::NodeTree *nod // _loadingNodeParentHierarchy.push_back(node); } + // If node is invalid, there is no necessity to process children of node. + if (!node) + { + return nullptr; + } + auto children = nodetree->children(); int size = children->size(); CCLOG("size = %d", size); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp index e4136795a5..05200f6327 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp @@ -551,7 +551,7 @@ namespace cocostudio std::string normalErrorFilePath = ""; auto normalDic = options->normalData(); int normalType = normalDic->resourceType(); - std::string normalTexturePath = this->getResourcePath(normalDic->path()->c_str(), (Widget::TextureResType)normalType); + std::string normalTexturePath = normalDic->path()->c_str(); switch (normalType) { case 0: @@ -613,7 +613,7 @@ namespace cocostudio std::string pressedErrorFilePath = ""; auto pressedDic = options->pressedData(); int pressedType = pressedDic->resourceType(); - std::string pressedTexturePath = this->getResourcePath(pressedDic->path()->c_str(), (Widget::TextureResType)pressedType); + std::string pressedTexturePath = pressedDic->path()->c_str(); switch (pressedType) { case 0: @@ -677,7 +677,7 @@ namespace cocostudio std::string disabledErrorFilePath = ""; auto disabledDic = options->disabledData(); int disabledType = disabledDic->resourceType(); - std::string disabledTexturePath = this->getResourcePath(disabledDic->path()->c_str(), (Widget::TextureResType)disabledType); + std::string disabledTexturePath = disabledDic->path()->c_str(); switch (disabledType) { case 0: diff --git a/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp index 8d5fdfc592..b08901c889 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp @@ -433,7 +433,7 @@ namespace cocostudio std::string backGroundErrorFilePath = ""; auto backGroundDic = options->backGroundBoxData(); int backGroundType = backGroundDic->resourceType(); - std::string backGroundTexturePath = this->getResourcePath(backGroundDic->path()->c_str(), (Widget::TextureResType)backGroundType); + std::string backGroundTexturePath = backGroundDic->path()->c_str(); switch (backGroundType) { case 0: @@ -498,7 +498,7 @@ namespace cocostudio std::string backGroundSelectedErrorFilePath = ""; auto backGroundSelectedDic = options->backGroundBoxSelectedData(); int backGroundSelectedType = backGroundSelectedDic->resourceType(); - std::string backGroundSelectedTexturePath = this->getResourcePath(backGroundSelectedDic->path()->c_str(), (Widget::TextureResType)backGroundSelectedType); + std::string backGroundSelectedTexturePath = backGroundSelectedDic->path()->c_str(); switch (backGroundSelectedType) { case 0: @@ -563,7 +563,7 @@ namespace cocostudio std::string frontCrossErrorFilePath = ""; auto frontCrossDic = options->frontCrossData(); int frontCrossType = frontCrossDic->resourceType(); - std::string frontCrossFileName = this->getResourcePath(frontCrossDic->path()->c_str(), (Widget::TextureResType)frontCrossType); + std::string frontCrossFileName = frontCrossDic->path()->c_str(); switch (frontCrossType) { case 0: @@ -628,7 +628,7 @@ namespace cocostudio std::string backGroundBoxDisabledErrorFilePath = ""; auto backGroundDisabledDic = options->backGroundBoxDisabledData(); int backGroundDisabledType = backGroundDisabledDic->resourceType(); - std::string backGroundDisabledFileName = this->getResourcePath(backGroundDisabledDic->path()->c_str(), (Widget::TextureResType)backGroundDisabledType); + std::string backGroundDisabledFileName = backGroundDisabledDic->path()->c_str(); switch (backGroundDisabledType) { case 0: @@ -693,7 +693,7 @@ namespace cocostudio std::string frontCrossDisabledErrorFilePath = ""; auto frontCrossDisabledDic = options->frontCrossDisabledData(); int frontCrossDisabledType = frontCrossDisabledDic->resourceType(); - std::string frontCrossDisabledFileName = this->getResourcePath(frontCrossDisabledDic->path()->c_str(), (Widget::TextureResType)frontCrossDisabledType); + std::string frontCrossDisabledFileName = frontCrossDisabledDic->path()->c_str(); switch (frontCrossDisabledType) { case 0: diff --git a/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp index 1fbd8da0ac..224505822e 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp @@ -295,7 +295,7 @@ namespace cocostudio std::string errorFilePath = ""; auto imageFileNameDic = options->fileNameData(); int imageFileNameType = imageFileNameDic->resourceType(); - std::string imageFileName = this->getResourcePath(imageFileNameDic->path()->c_str(), (Widget::TextureResType)imageFileNameType); + std::string imageFileName = imageFileNameDic->path()->c_str(); switch (imageFileNameType) { case 0: diff --git a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp index 1d840e3fbd..56361d3700 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp @@ -602,7 +602,7 @@ namespace cocostudio std::string errorFilePath = ""; auto imageFileNameDic = options->backGroundImageData(); int imageFileNameType = imageFileNameDic->resourceType(); - std::string imageFileName = this->getResourcePath(imageFileNameDic->path()->c_str(), (Widget::TextureResType)imageFileNameType); + std::string imageFileName = imageFileNameDic->path()->c_str(); if (imageFileName != "") { switch (imageFileNameType) diff --git a/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp index 76d198e1d7..3fe61ee47a 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp @@ -245,7 +245,7 @@ namespace cocostudio std::string errorFilePath = ""; auto imageFileNameDic = options->textureData(); int imageFileNameType = imageFileNameDic->resourceType(); - std::string imageFileName = this->getResourcePath(imageFileNameDic->path()->c_str(), (Widget::TextureResType)imageFileNameType); + std::string imageFileName = imageFileNameDic->path()->c_str(); switch (imageFileNameType) { case 0: diff --git a/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp index 0285bf55ff..6841a1a57c 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp @@ -343,7 +343,7 @@ namespace cocostudio std::string errorFilePath = ""; auto imageFileNameDic = options->backGroundImageData(); int imageFileNameType = imageFileNameDic->resourceType(); - std::string imageFileName = this->getResourcePath(imageFileNameDic->path()->c_str(), (Widget::TextureResType)imageFileNameType); + std::string imageFileName = imageFileNameDic->path()->c_str(); if (imageFileName != "") { switch (imageFileNameType) diff --git a/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp index 9dd10412bf..dc933f716d 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp @@ -429,7 +429,7 @@ namespace cocostudio std::string errorFilePath = ""; auto imageFileNameDic = options->backGroundImageData(); int imageFileNameType = imageFileNameDic->resourceType(); - std::string imageFileName = this->getResourcePath(imageFileNameDic->path()->c_str(), (Widget::TextureResType)imageFileNameType); + std::string imageFileName = imageFileNameDic->path()->c_str(); if (imageFileName != "") { switch (imageFileNameType) diff --git a/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.cpp index 4c45a2f1cc..560b4c8bf8 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.cpp @@ -467,7 +467,7 @@ namespace cocostudio std::string imageErrorFilePath = ""; auto imageFileNameDic = options->barFileNameData(); int imageFileNameType = imageFileNameDic->resourceType(); - std::string imageFileName = this->getResourcePath(imageFileNameDic->path()->c_str(), (Widget::TextureResType)imageFileNameType); + std::string imageFileName = imageFileNameDic->path()->c_str(); switch (imageFileNameType) { case 0: @@ -532,7 +532,7 @@ namespace cocostudio std::string normalErrorFilePath = ""; auto normalDic = options->ballNormalData(); int normalType = normalDic->resourceType(); - std::string normalFileName = this->getResourcePath(normalDic->path()->c_str(), (Widget::TextureResType)normalType); + std::string normalFileName = normalDic->path()->c_str(); switch (normalType) { case 0: @@ -597,7 +597,7 @@ namespace cocostudio std::string pressedErrorFilePath = ""; auto pressedDic = options->ballPressedData(); int pressedType = pressedDic->resourceType(); - std::string pressedFileName = this->getResourcePath(pressedDic->path()->c_str(), (Widget::TextureResType)pressedType); + std::string pressedFileName = pressedDic->path()->c_str(); switch (pressedType) { case 0: @@ -662,7 +662,7 @@ namespace cocostudio std::string disabledErrorFilePath = ""; auto disabledDic = options->ballDisabledData(); int disabledType = disabledDic->resourceType(); - std::string disabledFileName = this->getResourcePath(disabledDic->path()->c_str(), (Widget::TextureResType)disabledType); + std::string disabledFileName = disabledDic->path()->c_str(); switch (disabledType) { case 0: @@ -727,7 +727,7 @@ namespace cocostudio std::string progressErrorFilePath = ""; auto progressBarDic = options->progressBarData(); int progressBarType = progressBarDic->resourceType(); - std::string progressBarFileName = this->getResourcePath(progressBarDic->path()->c_str(), (Widget::TextureResType)progressBarType); + std::string progressBarFileName = progressBarDic->path()->c_str(); switch (progressBarType) { case 0: