mirror of https://github.com/axmolengine/axmol.git
Fix variable name typo (#17195)
This commit is contained in:
parent
21d57bfd39
commit
888b985e0e
|
@ -107,14 +107,14 @@ void Sprite3D::createAsync(const std::string& modelPath, const std::string& text
|
||||||
|
|
||||||
sprite->_asyncLoadParam.afterLoadCallback = callback;
|
sprite->_asyncLoadParam.afterLoadCallback = callback;
|
||||||
sprite->_asyncLoadParam.texPath = texturePath;
|
sprite->_asyncLoadParam.texPath = texturePath;
|
||||||
sprite->_asyncLoadParam.modlePath = modelPath;
|
sprite->_asyncLoadParam.modelPath = modelPath;
|
||||||
sprite->_asyncLoadParam.callbackParam = callbackparam;
|
sprite->_asyncLoadParam.callbackParam = callbackparam;
|
||||||
sprite->_asyncLoadParam.materialdatas = new (std::nothrow) MaterialDatas();
|
sprite->_asyncLoadParam.materialdatas = new (std::nothrow) MaterialDatas();
|
||||||
sprite->_asyncLoadParam.meshdatas = new (std::nothrow) MeshDatas();
|
sprite->_asyncLoadParam.meshdatas = new (std::nothrow) MeshDatas();
|
||||||
sprite->_asyncLoadParam.nodeDatas = new (std::nothrow) NodeDatas();
|
sprite->_asyncLoadParam.nodeDatas = new (std::nothrow) NodeDatas();
|
||||||
AsyncTaskPool::getInstance()->enqueue(AsyncTaskPool::TaskType::TASK_IO, CC_CALLBACK_1(Sprite3D::afterAsyncLoad, sprite), (void*)(&sprite->_asyncLoadParam), [sprite]()
|
AsyncTaskPool::getInstance()->enqueue(AsyncTaskPool::TaskType::TASK_IO, CC_CALLBACK_1(Sprite3D::afterAsyncLoad, sprite), (void*)(&sprite->_asyncLoadParam), [sprite]()
|
||||||
{
|
{
|
||||||
sprite->_asyncLoadParam.result = sprite->loadFromFile(sprite->_asyncLoadParam.modlePath, sprite->_asyncLoadParam.nodeDatas, sprite->_asyncLoadParam.meshdatas, sprite->_asyncLoadParam.materialdatas);
|
sprite->_asyncLoadParam.result = sprite->loadFromFile(sprite->_asyncLoadParam.modelPath, sprite->_asyncLoadParam.nodeDatas, sprite->_asyncLoadParam.meshdatas, sprite->_asyncLoadParam.materialdatas);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ void Sprite3D::afterAsyncLoad(void* param)
|
||||||
auto& nodeDatas = asyncParam->nodeDatas;
|
auto& nodeDatas = asyncParam->nodeDatas;
|
||||||
if (initFrom(*nodeDatas, *meshdatas, *materialdatas))
|
if (initFrom(*nodeDatas, *meshdatas, *materialdatas))
|
||||||
{
|
{
|
||||||
auto spritedata = Sprite3DCache::getInstance()->getSpriteData(asyncParam->modlePath);
|
auto spritedata = Sprite3DCache::getInstance()->getSpriteData(asyncParam->modelPath);
|
||||||
if (spritedata == nullptr)
|
if (spritedata == nullptr)
|
||||||
{
|
{
|
||||||
//add to cache
|
//add to cache
|
||||||
|
@ -150,7 +150,7 @@ void Sprite3D::afterAsyncLoad(void* param)
|
||||||
data->glProgramStates.pushBack(mesh->getGLProgramState());
|
data->glProgramStates.pushBack(mesh->getGLProgramState());
|
||||||
}
|
}
|
||||||
|
|
||||||
Sprite3DCache::getInstance()->addSprite3DData(asyncParam->modlePath, data);
|
Sprite3DCache::getInstance()->addSprite3DData(asyncParam->modelPath, data);
|
||||||
|
|
||||||
CC_SAFE_DELETE(meshdatas);
|
CC_SAFE_DELETE(meshdatas);
|
||||||
materialdatas = nullptr;
|
materialdatas = nullptr;
|
||||||
|
@ -168,7 +168,7 @@ void Sprite3D::afterAsyncLoad(void* param)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CCLOG("file load failed: %s ", asyncParam->modlePath.c_str());
|
CCLOG("file load failed: %s ", asyncParam->modelPath.c_str());
|
||||||
}
|
}
|
||||||
asyncParam->afterLoadCallback(this, asyncParam->callbackParam);
|
asyncParam->afterLoadCallback(this, asyncParam->callbackParam);
|
||||||
}
|
}
|
||||||
|
|
|
@ -271,7 +271,7 @@ protected:
|
||||||
std::function<void(Sprite3D*, void*)> afterLoadCallback; // callback after load
|
std::function<void(Sprite3D*, void*)> afterLoadCallback; // callback after load
|
||||||
void* callbackParam;
|
void* callbackParam;
|
||||||
bool result; // sprite load result
|
bool result; // sprite load result
|
||||||
std::string modlePath;
|
std::string modelPath;
|
||||||
std::string texPath; //
|
std::string texPath; //
|
||||||
MeshDatas* meshdatas;
|
MeshDatas* meshdatas;
|
||||||
MaterialDatas* materialdatas;
|
MaterialDatas* materialdatas;
|
||||||
|
|
|
@ -39,7 +39,7 @@ extern "C" {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call this function can import the lua bindings for the cocos3d module.
|
* Call this function can import the lua bindings for the cocos3d module.
|
||||||
* After registering, we could call the related cocos3d code conveniently in the lua.eg,.cc.Sprite3D:create(modlepath).
|
* After registering, we could call the related cocos3d code conveniently in the lua.eg,.cc.Sprite3D:create(modelPath).
|
||||||
* If you don't want to use the cocos3d module in the lua, you only don't call this registering function.
|
* If you don't want to use the cocos3d module in the lua, you only don't call this registering function.
|
||||||
* If you don't register the cocos3d module, the package size would become smaller .
|
* If you don't register the cocos3d module, the package size would become smaller .
|
||||||
* The current mechanism,this function is called in the lua_module_register.h
|
* The current mechanism,this function is called in the lua_module_register.h
|
||||||
|
|
Loading…
Reference in New Issue