mirror of https://github.com/axmolengine/axmol.git
refactor async load callback funtion
This commit is contained in:
parent
5e86d71fcc
commit
3439b7f68d
|
@ -98,10 +98,10 @@ void Sprite3D::createAsync(const std::string &modelPath, const std::string &text
|
|||
sprite->_asyncLoadParam.materialdatas = new (std::nothrow) MaterialDatas();
|
||||
sprite->_asyncLoadParam.meshdatas = new (std::nothrow) MeshDatas();
|
||||
sprite->_asyncLoadParam.nodeDatas = new (std::nothrow) NodeDatas();
|
||||
AsyncTaskPool::getInstance()->enqueue(AsyncTaskPool::TaskType::TASK_IO, CC_CALLBACK_1(Sprite3D::afterAsyncLoad, sprite), (void*)(&sprite->_asyncLoadParam), [](Sprite3D* sp)
|
||||
AsyncTaskPool::getInstance()->enqueue(AsyncTaskPool::TaskType::TASK_IO, CC_CALLBACK_1(Sprite3D::afterAsyncLoad, sprite), (void*)(&sprite->_asyncLoadParam), [sprite]()
|
||||
{
|
||||
sp->_asyncLoadParam.result = sp->loadFromFile(sp->_asyncLoadParam.path, sp->_asyncLoadParam.nodeDatas, sp->_asyncLoadParam.meshdatas, sp->_asyncLoadParam.materialdatas);
|
||||
}, sprite);
|
||||
sprite->_asyncLoadParam.result = sprite->loadFromFile(sprite->_asyncLoadParam.path, sprite->_asyncLoadParam.nodeDatas, sprite->_asyncLoadParam.meshdatas, sprite->_asyncLoadParam.materialdatas);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue