Replaced the EXCEPT_GUARD macro for converting love exceptions into Lua errors with the new luax_catchexcept function, which takes lambda function arguments.

This commit is contained in:
Alex Szpakowski
2014-06-03 19:27:00 -03:00
parent 724bdbd296
commit dfa319e01a
45 changed files with 315 additions and 227 deletions
+5 -2
View File
@@ -101,7 +101,10 @@ int w_setMode(lua_State *L)
// Display index is 1-based in Lua and 0-based internally.
settings.display--;
EXCEPT_GUARD(luax_pushboolean(L, instance->setWindow(w, h, &settings));)
luax_catchexcept(L,
[&](){ luax_pushboolean(L, instance->setWindow(w, h, &settings)); }
);
return 1;
}
@@ -339,7 +342,7 @@ static const luaL_Reg functions[] =
extern "C" int luaopen_love_window(lua_State *L)
{
EXCEPT_GUARD(instance = sdl::Window::createSingleton();)
luax_catchexcept(L, [&](){ instance = sdl::Window::createSingleton(); });
WrappedModule w;
w.module = instance;