mirror of https://github.com/axmolengine/axmol.git
Merge pull request #12737 from chengstory/FixReaderBug
Fix cocos reader bug.
This commit is contained in:
commit
893d39c543
|
@ -238,15 +238,12 @@ namespace cocostudio
|
||||||
setPropsWithFlatBuffers(tmx, (Table*)gameMapOptions);
|
setPropsWithFlatBuffers(tmx, (Table*)gameMapOptions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//else
|
else
|
||||||
//{
|
{
|
||||||
// Node* node = Node::create();
|
Node* node = Node::create();
|
||||||
// setPropsWithFlatBuffers(node, (Table*)gameMapOptions);
|
setPropsWithFlatBuffers(node, (Table*)gameMapOptions);
|
||||||
// auto label = Label::create();
|
return node;
|
||||||
// label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString());
|
}
|
||||||
// node->addChild(label);
|
|
||||||
// return node;
|
|
||||||
//}
|
|
||||||
|
|
||||||
return tmx;
|
return tmx;
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,11 +153,11 @@ namespace cocostudio
|
||||||
void ParticleReader::setPropsWithFlatBuffers(cocos2d::Node *node,
|
void ParticleReader::setPropsWithFlatBuffers(cocos2d::Node *node,
|
||||||
const flatbuffers::Table *particleOptions)
|
const flatbuffers::Table *particleOptions)
|
||||||
{
|
{
|
||||||
auto particle = static_cast<ParticleSystemQuad*>(node);
|
auto particle = dynamic_cast<ParticleSystemQuad*>(node);
|
||||||
auto options = (ParticleSystemOptions*)particleOptions;
|
auto options = (ParticleSystemOptions*)particleOptions;
|
||||||
|
|
||||||
auto f_blendFunc = options->blendFunc();
|
auto f_blendFunc = options->blendFunc();
|
||||||
if (f_blendFunc)
|
if (particle && f_blendFunc)
|
||||||
{
|
{
|
||||||
cocos2d::BlendFunc blendFunc = cocos2d::BlendFunc::ALPHA_PREMULTIPLIED;
|
cocos2d::BlendFunc blendFunc = cocos2d::BlendFunc::ALPHA_PREMULTIPLIED;
|
||||||
blendFunc.src = f_blendFunc->src();
|
blendFunc.src = f_blendFunc->src();
|
||||||
|
@ -208,15 +208,12 @@ namespace cocostudio
|
||||||
particle->setPositionType(ParticleSystem::PositionType::GROUPED);
|
particle->setPositionType(ParticleSystem::PositionType::GROUPED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//else
|
else
|
||||||
//{
|
{
|
||||||
// Node* node = Node::create();
|
Node* node = Node::create();
|
||||||
// setPropsWithFlatBuffers(node, (Table*)particleOptions);
|
setPropsWithFlatBuffers(node, (Table*)particleOptions);
|
||||||
// auto label = Label::create();
|
return node;
|
||||||
// label->setString(__String::createWithFormat("%s missed", errorFilePath.c_str())->getCString());
|
}
|
||||||
// node->addChild(label);
|
|
||||||
// return node;
|
|
||||||
//}
|
|
||||||
|
|
||||||
return particle;
|
return particle;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue