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
+2 -2
View File
@@ -246,7 +246,7 @@ int Physics::getDistance(lua_State *L)
b2SimplexCache c;
c.count = 0;
EXCEPT_GUARD(
luax_catchexcept(L, [&]() {
pA.Set(fixtureA->fixture->GetShape(), 0);
pB.Set(fixtureB->fixture->GetShape(), 0);
i.proxyA = pA;
@@ -255,7 +255,7 @@ int Physics::getDistance(lua_State *L)
i.transformB = fixtureB->fixture->GetBody()->GetTransform();
i.useRadii = true;
b2Distance(&o, &c, &i);
)
});
lua_pushnumber(L, Physics::scaleUp(o.distance));
lua_pushnumber(L, Physics::scaleUp(o.pointA.x));