fix add search path for armaturenodereader

This commit is contained in:
geron-cn 2014-12-26 18:27:47 +08:00
parent 70eef1f660
commit b25e307dee
1 changed files with 6 additions and 3 deletions

View File

@ -115,11 +115,14 @@ void ArmatureNodeReader::setPropsWithFlatBuffers(cocos2d::Node *node,
const flatbuffers::Table *nodeOptions)
{
auto* custom = static_cast<CCArmature*>(node);
auto* custom = static_cast<Armature*>(node);
auto options = (flatbuffers::CSArmatureNodeOption*)nodeOptions;
auto reader = ArmatureNodeReader::getInstance();
std::string filepath(options->fileData()->path()->c_str());
std::string dirpath = filepath.substr(0, filepath.find_last_of("/"));
FileUtils::getInstance()->addSearchPath(dirpath);
ArmatureDataManager::getInstance()->addArmatureFileInfo(FileUtils::getInstance()->fullPathForFilename(filepath));
custom->init(getArmatureName(filepath));
if (options->isAutoPlay())