refactor async load callback funtion

This commit is contained in:
yangxiao 2014-12-05 15:48:46 +08:00
parent 5e86d71fcc
commit 3439b7f68d
1 changed files with 3 additions and 3 deletions

View File

@ -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);
});
}