csbload error bug (#17465)

* csbload error bug

* csbload error bug

* csbload error bug
This commit is contained in:
Owen.Cai 2017-03-08 10:14:38 +08:00 committed by minggo
parent 0cde5c6fc1
commit 7aa74fa994
1 changed files with 9 additions and 11 deletions

View File

@ -1010,7 +1010,6 @@ Node* CSLoader::nodeWithFlatBuffers(const flatbuffers::NodeTree *nodetree, const
std::string classname = nodetree->classname()->c_str(); std::string classname = nodetree->classname()->c_str();
auto options = nodetree->options(); auto options = nodetree->options();
auto tableOptions = const_cast<Table*>((Table*)(&options));
if (classname == "ProjectNode") if (classname == "ProjectNode")
{ {
@ -1029,7 +1028,7 @@ Node* CSLoader::nodeWithFlatBuffers(const flatbuffers::NodeTree *nodetree, const
{ {
node = Node::create(); node = Node::create();
} }
reader->setPropsWithFlatBuffers(node, tableOptions); reader->setPropsWithFlatBuffers(node, (const flatbuffers::Table*)options->data());
if (action) if (action)
{ {
action->setTimeSpeed(projectNodeOptions->innerActionSpeed()); action->setTimeSpeed(projectNodeOptions->innerActionSpeed());
@ -1041,12 +1040,12 @@ Node* CSLoader::nodeWithFlatBuffers(const flatbuffers::NodeTree *nodetree, const
{ {
node = Node::create(); node = Node::create();
auto reader = ComAudioReader::getInstance(); auto reader = ComAudioReader::getInstance();
Component* component = reader->createComAudioWithFlatBuffers(tableOptions); Component* component = reader->createComAudioWithFlatBuffers((const flatbuffers::Table*)options->data());
if (component) if (component)
{ {
component->setName(PlayableFrame::PLAYABLE_EXTENTION); component->setName(PlayableFrame::PLAYABLE_EXTENTION);
node->addComponent(component); node->addComponent(component);
reader->setPropsWithFlatBuffers(node, tableOptions); reader->setPropsWithFlatBuffers(node, (const flatbuffers::Table*)options->data());
} }
} }
else else
@ -1062,7 +1061,7 @@ Node* CSLoader::nodeWithFlatBuffers(const flatbuffers::NodeTree *nodetree, const
NodeReaderProtocol* reader = dynamic_cast<NodeReaderProtocol*>(ObjectFactory::getInstance()->createObject(readername)); NodeReaderProtocol* reader = dynamic_cast<NodeReaderProtocol*>(ObjectFactory::getInstance()->createObject(readername));
if (reader) if (reader)
{ {
node = reader->createNodeWithFlatBuffers(tableOptions); node = reader->createNodeWithFlatBuffers((const flatbuffers::Table*)options->data());
} }
Widget* widget = dynamic_cast<Widget*>(node); Widget* widget = dynamic_cast<Widget*>(node);
@ -1358,7 +1357,6 @@ Node* CSLoader::nodeWithFlatBuffersForSimulator(const flatbuffers::NodeTree *nod
std::string classname = nodetree->classname()->c_str(); std::string classname = nodetree->classname()->c_str();
auto options = nodetree->options(); auto options = nodetree->options();
auto tableOptions = const_cast<Table*>((Table*)(&options));
if (classname == "ProjectNode") if (classname == "ProjectNode")
{ {
@ -1376,7 +1374,7 @@ Node* CSLoader::nodeWithFlatBuffersForSimulator(const flatbuffers::NodeTree *nod
{ {
node = Node::create(); node = Node::create();
} }
reader->setPropsWithFlatBuffers(node, tableOptions); reader->setPropsWithFlatBuffers(node, (const flatbuffers::Table*)options->data());
if (action) if (action)
{ {
action->setTimeSpeed(projectNodeOptions->innerActionSpeed()); action->setTimeSpeed(projectNodeOptions->innerActionSpeed());
@ -1388,11 +1386,11 @@ Node* CSLoader::nodeWithFlatBuffersForSimulator(const flatbuffers::NodeTree *nod
{ {
node = Node::create(); node = Node::create();
auto reader = ComAudioReader::getInstance(); auto reader = ComAudioReader::getInstance();
Component* component = reader->createComAudioWithFlatBuffers(tableOptions); Component* component = reader->createComAudioWithFlatBuffers((const flatbuffers::Table*)options->data());
if (component) if (component)
{ {
node->addComponent(component); node->addComponent(component);
reader->setPropsWithFlatBuffers(node, tableOptions); reader->setPropsWithFlatBuffers(node, (const flatbuffers::Table*)options->data());
} }
} }
else else
@ -1403,7 +1401,7 @@ Node* CSLoader::nodeWithFlatBuffersForSimulator(const flatbuffers::NodeTree *nod
NodeReaderProtocol* reader = dynamic_cast<NodeReaderProtocol*>(ObjectFactory::getInstance()->createObject(readername)); NodeReaderProtocol* reader = dynamic_cast<NodeReaderProtocol*>(ObjectFactory::getInstance()->createObject(readername));
if (reader) if (reader)
{ {
node = reader->createNodeWithFlatBuffers(tableOptions); node = reader->createNodeWithFlatBuffers((const flatbuffers::Table*)options->data());
} }
Widget* widget = dynamic_cast<Widget*>(node); Widget* widget = dynamic_cast<Widget*>(node);