mirror of https://github.com/axmolengine/axmol.git
csbload error bug (#17465)
* csbload error bug * csbload error bug * csbload error bug
This commit is contained in:
parent
0cde5c6fc1
commit
7aa74fa994
|
@ -951,7 +951,7 @@ Node* CSLoader::nodeWithFlatBuffersFile(const std::string &fileName, const ccNod
|
|||
std::string fullPath = FileUtils::getInstance()->fullPathForFilename(fileName);
|
||||
|
||||
CC_ASSERT(FileUtils::getInstance()->isFileExist(fullPath));
|
||||
|
||||
|
||||
Data buf = FileUtils::getInstance()->getDataFromFile(fullPath);
|
||||
|
||||
if (buf.isNull())
|
||||
|
@ -1010,7 +1010,6 @@ Node* CSLoader::nodeWithFlatBuffers(const flatbuffers::NodeTree *nodetree, const
|
|||
std::string classname = nodetree->classname()->c_str();
|
||||
|
||||
auto options = nodetree->options();
|
||||
auto tableOptions = const_cast<Table*>((Table*)(&options));
|
||||
|
||||
if (classname == "ProjectNode")
|
||||
{
|
||||
|
@ -1029,7 +1028,7 @@ Node* CSLoader::nodeWithFlatBuffers(const flatbuffers::NodeTree *nodetree, const
|
|||
{
|
||||
node = Node::create();
|
||||
}
|
||||
reader->setPropsWithFlatBuffers(node, tableOptions);
|
||||
reader->setPropsWithFlatBuffers(node, (const flatbuffers::Table*)options->data());
|
||||
if (action)
|
||||
{
|
||||
action->setTimeSpeed(projectNodeOptions->innerActionSpeed());
|
||||
|
@ -1041,12 +1040,12 @@ Node* CSLoader::nodeWithFlatBuffers(const flatbuffers::NodeTree *nodetree, const
|
|||
{
|
||||
node = Node::create();
|
||||
auto reader = ComAudioReader::getInstance();
|
||||
Component* component = reader->createComAudioWithFlatBuffers(tableOptions);
|
||||
Component* component = reader->createComAudioWithFlatBuffers((const flatbuffers::Table*)options->data());
|
||||
if (component)
|
||||
{
|
||||
component->setName(PlayableFrame::PLAYABLE_EXTENTION);
|
||||
node->addComponent(component);
|
||||
reader->setPropsWithFlatBuffers(node, tableOptions);
|
||||
reader->setPropsWithFlatBuffers(node, (const flatbuffers::Table*)options->data());
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1062,7 +1061,7 @@ Node* CSLoader::nodeWithFlatBuffers(const flatbuffers::NodeTree *nodetree, const
|
|||
NodeReaderProtocol* reader = dynamic_cast<NodeReaderProtocol*>(ObjectFactory::getInstance()->createObject(readername));
|
||||
if (reader)
|
||||
{
|
||||
node = reader->createNodeWithFlatBuffers(tableOptions);
|
||||
node = reader->createNodeWithFlatBuffers((const flatbuffers::Table*)options->data());
|
||||
}
|
||||
|
||||
Widget* widget = dynamic_cast<Widget*>(node);
|
||||
|
@ -1358,7 +1357,6 @@ Node* CSLoader::nodeWithFlatBuffersForSimulator(const flatbuffers::NodeTree *nod
|
|||
std::string classname = nodetree->classname()->c_str();
|
||||
|
||||
auto options = nodetree->options();
|
||||
auto tableOptions = const_cast<Table*>((Table*)(&options));
|
||||
|
||||
if (classname == "ProjectNode")
|
||||
{
|
||||
|
@ -1376,7 +1374,7 @@ Node* CSLoader::nodeWithFlatBuffersForSimulator(const flatbuffers::NodeTree *nod
|
|||
{
|
||||
node = Node::create();
|
||||
}
|
||||
reader->setPropsWithFlatBuffers(node, tableOptions);
|
||||
reader->setPropsWithFlatBuffers(node, (const flatbuffers::Table*)options->data());
|
||||
if (action)
|
||||
{
|
||||
action->setTimeSpeed(projectNodeOptions->innerActionSpeed());
|
||||
|
@ -1388,11 +1386,11 @@ Node* CSLoader::nodeWithFlatBuffersForSimulator(const flatbuffers::NodeTree *nod
|
|||
{
|
||||
node = Node::create();
|
||||
auto reader = ComAudioReader::getInstance();
|
||||
Component* component = reader->createComAudioWithFlatBuffers(tableOptions);
|
||||
Component* component = reader->createComAudioWithFlatBuffers((const flatbuffers::Table*)options->data());
|
||||
if (component)
|
||||
{
|
||||
node->addComponent(component);
|
||||
reader->setPropsWithFlatBuffers(node, tableOptions);
|
||||
reader->setPropsWithFlatBuffers(node, (const flatbuffers::Table*)options->data());
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1403,7 +1401,7 @@ Node* CSLoader::nodeWithFlatBuffersForSimulator(const flatbuffers::NodeTree *nod
|
|||
NodeReaderProtocol* reader = dynamic_cast<NodeReaderProtocol*>(ObjectFactory::getInstance()->createObject(readername));
|
||||
if (reader)
|
||||
{
|
||||
node = reader->createNodeWithFlatBuffers(tableOptions);
|
||||
node = reader->createNodeWithFlatBuffers((const flatbuffers::Table*)options->data());
|
||||
}
|
||||
|
||||
Widget* widget = dynamic_cast<Widget*>(node);
|
||||
|
|
Loading…
Reference in New Issue