fixed bug popping when i shouldnt have been and registering doPhysics()
git-svn-id: svn://anubis/anaglym/trunk@49 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
parent
6a52215247
commit
4b34a2e565
1
ag.cc
1
ag.cc
@ -29,6 +29,7 @@ namespace ag
|
||||
{ "endFrame", endFrame },
|
||||
{ "setCamera", setCamera },
|
||||
{ "elapsedTime", elapsedTime },
|
||||
{ "doPhysics", doPhysics },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
luaL_register(L, "ag", functions);
|
||||
|
@ -303,10 +303,14 @@ void Engine::update()
|
||||
lua_getfield(m_luaState, LUA_GLOBALSINDEX, "update");
|
||||
if (lua_type(m_luaState, -1) == LUA_TFUNCTION)
|
||||
{
|
||||
int s = lua_pcall(m_luaState, 0, 0, 0);
|
||||
/* call the update function - pops the function ref from the stack */
|
||||
int s = lua_pcall(m_luaState, 0, LUA_MULTRET, 0);
|
||||
reportErrors(s);
|
||||
}
|
||||
else
|
||||
{
|
||||
lua_pop(m_luaState, 1);
|
||||
}
|
||||
m_drawing = false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user