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
@@ -69,7 +69,7 @@ int w_MotorJoint_setMaxForce(lua_State *L)
{
MotorJoint *t = luax_checkmotorjoint(L, 1);
float arg1 = (float) luaL_checknumber(L, 2);
EXCEPT_GUARD(t->setMaxForce(arg1);)
luax_catchexcept(L, [&](){ t->setMaxForce(arg1); });
return 0;
}
@@ -84,7 +84,7 @@ int w_MotorJoint_setMaxTorque(lua_State *L)
{
MotorJoint *t = luax_checkmotorjoint(L, 1);
float arg1 = (float) luaL_checknumber(L, 2);
EXCEPT_GUARD(t->setMaxTorque(arg1);)
luax_catchexcept(L, [&](){ t->setMaxTorque(arg1); });
return 0;
}
@@ -99,7 +99,7 @@ int w_MotorJoint_setCorrectionFactor(lua_State *L)
{
MotorJoint *t = luax_checkmotorjoint(L, 1);
float arg1 = (float) luaL_checknumber(L, 2);
EXCEPT_GUARD(t->setCorrectionFactor(arg1);)
luax_catchexcept(L, [&](){ t->setCorrectionFactor(arg1); });
return 0;
}