lua - require support; if child resource fails to load resource, parent fails to load as well
This commit is contained in:
parent
278a693727
commit
d410881377
3 changed files with 7 additions and 1 deletions
|
@ -114,7 +114,11 @@ namespace Lumix
|
|||
|
||||
void Resource::onStateChanged(State old_state, State new_state)
|
||||
{
|
||||
if (State::READY == new_state || State::FAILURE == new_state)
|
||||
if (State::FAILURE == new_state)
|
||||
{
|
||||
onFailure();
|
||||
}
|
||||
else if (State::READY == new_state)
|
||||
{
|
||||
decrementDepCount();
|
||||
}
|
||||
|
|
|
@ -193,6 +193,7 @@ struct PipelineImpl : public Pipeline
|
|||
if(success)
|
||||
{
|
||||
m_lua_state = luaL_newstate();
|
||||
luaL_openlibs(m_lua_state);
|
||||
bool errors = luaL_loadbuffer(m_lua_state, (const char*)file->getBuffer(), file->size(), "") != LUA_OK;
|
||||
errors = errors || lua_pcall(m_lua_state, 0, LUA_MULTRET, 0) != LUA_OK;
|
||||
if (errors)
|
||||
|
|
|
@ -248,6 +248,7 @@ void Shader::loaded(FS::IFile* file, bool success, FS::FileSystem& fs)
|
|||
if(success)
|
||||
{
|
||||
lua_State* L = luaL_newstate();
|
||||
luaL_openlibs(L);
|
||||
|
||||
bool errors = luaL_loadbuffer(L, (const char*)file->getBuffer(), file->size(), "") != LUA_OK;
|
||||
errors = errors || lua_pcall(L, 0, LUA_MULTRET, 0) != LUA_OK;
|
||||
|
|
Loading…
Reference in a new issue