mirror of https://github.com/axmolengine/axmol.git
Refine cocos2dx_lua_loader logic
This commit is contained in:
parent
f7128789a0
commit
eb5dcb6cfc
|
@ -108,15 +108,13 @@ extern "C"
|
||||||
{
|
{
|
||||||
LuaStack* stack = LuaEngine::getInstance()->getLuaStack();
|
LuaStack* stack = LuaEngine::getInstance()->getLuaStack();
|
||||||
resolvedPath.insert(resolvedPath.begin(), '@'); // lua standard, add file chunck mark '@'
|
resolvedPath.insert(resolvedPath.begin(), '@'); // lua standard, add file chunck mark '@'
|
||||||
stack->luaLoadBuffer(L, reinterpret_cast<const char*>(chunk.getBytes()), static_cast<int>(chunk.getSize()),
|
return stack->luaLoadBuffer(L, reinterpret_cast<const char*>(chunk.getBytes()), static_cast<int>(chunk.getSize()),
|
||||||
resolvedPath.c_str());
|
resolvedPath.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CCLOG("can not get file data of %s", resolvedPath.c_str());
|
CCLOG("can not get file data of %s", resolvedPath.c_str());
|
||||||
return 0;
|
return LUA_ERRFILE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue