Commits

Alex Szpakowski  committed 9b66e92

Fixed some uncaught exceptions in love.physics

  • Participants
  • Parent commits 7adf2ae

Comments (0)

Files changed (7)

File src/modules/physics/box2d/wrap_Body.cpp

 {
 	Body *t = luax_checkbody(L, 1);
 	float arg1 = (float)luaL_checknumber(L, 2);
-	t->setX(arg1);
+	ASSERT_GUARD(t->setX(arg1);)
 	return 0;
 }
 
 {
 	Body *t = luax_checkbody(L, 1);
 	float arg1 = (float)luaL_checknumber(L, 2);
-	t->setY(arg1);
+	ASSERT_GUARD(t->setY(arg1);)
 	return 0;
 }
 
 {
 	Body *t = luax_checkbody(L, 1);
 	float arg1 = (float)luaL_checknumber(L, 2);
-	t->setAngle(arg1);
+	ASSERT_GUARD(t->setAngle(arg1);)
 	return 0;
 }
 
 	Body *t = luax_checkbody(L, 1);
 	float arg1 = (float)luaL_checknumber(L, 2);
 	float arg2 = (float)luaL_checknumber(L, 3);
-	t->setPosition(arg1, arg2);
+	ASSERT_GUARD(t->setPosition(arg1, arg2);)
 	return 0;
 }
 
 int w_Body_resetMassData(lua_State *L)
 {
 	Body *t = luax_checkbody(L, 1);
-	t->resetMassData();
+	ASSERT_GUARD(t->resetMassData();)
 	return 0;
 }
 
 {
 	Body *t = luax_checkbody(L, 1);
 	float m = (float)luaL_checknumber(L, 2);
-	t->setMass(m);
+	ASSERT_GUARD(t->setMass(m);)
 	return 0;
 }
 
 {
 	Body *t = luax_checkbody(L, 1);
 	float i = (float)luaL_checknumber(L, 2);
-	t->setInertia(i);
+	ASSERT_GUARD(t->setInertia(i);)
 	return 0;
 }
 
 	const char *typeStr = luaL_checkstring(L, 2);
 	Body::Type type;
 	Body::getConstant(typeStr, type);
-	t->setType(type);
+	ASSERT_GUARD(t->setType(type);)
 	return 0;
 }
 
 {
 	Body *t = luax_checkbody(L, 1);
 	bool b = luax_toboolean(L, 2);
-	t->setActive(b);
+	ASSERT_GUARD(t->setActive(b);)
 	return 0;
 }
 
 {
 	Body *t = luax_checkbody(L, 1);
 	bool b = luax_toboolean(L, 2);
-	t->setFixedRotation(b);
+	ASSERT_GUARD(t->setFixedRotation(b);)
 	return 0;
 }
 
 {
 	Body *t = luax_checkbody(L, 1);
 	lua_remove(L, 1);
-	return t->getFixtureList(L);
+	int n = 0;
+	ASSERT_GUARD(n = t->getFixtureList(L);)
+	return n;
 }
 
 int w_Body_destroy(lua_State *L)

File src/modules/physics/box2d/wrap_ChainShape.cpp

 	ChainShape *c = luax_checkchainshape(L, 1);
 	float x = (float)luaL_checknumber(L, 2);
 	float y = (float)luaL_checknumber(L, 3);
-	c->setNextVertex(x, y);
+	ASSERT_GUARD(c->setNextVertex(x, y);)
 	return 0;
 }
 
 	ChainShape *c = luax_checkchainshape(L, 1);
 	float x = (float)luaL_checknumber(L, 2);
 	float y = (float)luaL_checknumber(L, 3);
-	c->setPrevVertex(x, y);
+	ASSERT_GUARD(c->setPrevVertex(x, y);)
 	return 0;
 }
 

File src/modules/physics/box2d/wrap_Fixture.cpp

 {
 	Fixture *t = luax_checkfixture(L, 1);
 	float arg1 = (float)luaL_checknumber(L, 2);
-	t->setDensity(arg1);
+	ASSERT_GUARD(t->setDensity(arg1);)
 	return 0;
 }
 

File src/modules/physics/box2d/wrap_FrictionJoint.cpp

  **/
 
 #include "wrap_FrictionJoint.h"
+#include "wrap_Physics.h"
 
 namespace love
 {
 {
 	FrictionJoint *t = luax_checkfrictionjoint(L, 1);
 	float arg1 = (float)luaL_checknumber(L, 2);
-	t->setMaxForce(arg1);
+	ASSERT_GUARD(t->setMaxForce(arg1);)
 	return 0;
 }
 
 {
 	FrictionJoint *t = luax_checkfrictionjoint(L, 1);
 	float arg1 = (float)luaL_checknumber(L, 2);
-	t->setMaxTorque(arg1);
+	ASSERT_GUARD(t->setMaxTorque(arg1);)
 	return 0;
 }
 

File src/modules/physics/box2d/wrap_GearJoint.cpp

  **/
 
 #include "wrap_GearJoint.h"
+#include "wrap_Physics.h"
 
 namespace love
 {
 {
 	GearJoint *t = luax_checkgearjoint(L, 1);
 	float arg1 = (float)luaL_checknumber(L, 2);
-	t->setRatio(arg1);
+	ASSERT_GUARD(t->setRatio(arg1);)
 	return 0;
 }
 

File src/modules/physics/box2d/wrap_PrismaticJoint.cpp

  **/
 
 #include "wrap_PrismaticJoint.h"
+#include "wrap_Physics.h"
 
 namespace love
 {
 {
 	PrismaticJoint *t = luax_checkprismaticjoint(L, 1);
 	float arg1 = (float)luaL_checknumber(L, 2);
-	t->setUpperLimit(arg1);
+	ASSERT_GUARD(t->setUpperLimit(arg1);)
 	return 0;
 }
 
 {
 	PrismaticJoint *t = luax_checkprismaticjoint(L, 1);
 	float arg1 = (float)luaL_checknumber(L, 2);
-	t->setLowerLimit(arg1);
+	ASSERT_GUARD(t->setLowerLimit(arg1);)
 	return 0;
 }
 
 	PrismaticJoint *t = luax_checkprismaticjoint(L, 1);
 	float arg1 = (float)luaL_checknumber(L, 2);
 	float arg2 = (float)luaL_checknumber(L, 3);
-	t->setLimits(arg1, arg2);
+	ASSERT_GUARD(t->setLimits(arg1, arg2);)
 	return 0;
 }
 

File src/modules/physics/box2d/wrap_RevoluteJoint.cpp

  **/
 
 #include "wrap_RevoluteJoint.h"
+#include "wrap_Physics.h"
 
 namespace love
 {
 {
 	RevoluteJoint *t = luax_checkrevolutejoint(L, 1);
 	float arg1 = (float)luaL_checknumber(L, 2);
-	t->setUpperLimit(arg1);
+	ASSERT_GUARD(t->setUpperLimit(arg1);)
 	return 0;
 }
 
 {
 	RevoluteJoint *t = luax_checkrevolutejoint(L, 1);
 	float arg1 = (float)luaL_checknumber(L, 2);
-	t->setLowerLimit(arg1);
+	ASSERT_GUARD(t->setLowerLimit(arg1);)
 	return 0;
 }
 
 	RevoluteJoint *t = luax_checkrevolutejoint(L, 1);
 	float arg1 = (float)luaL_checknumber(L, 2);
 	float arg2 = (float)luaL_checknumber(L, 3);
-	t->setLimits(arg1, arg2);
+	ASSERT_GUARD(t->setLimits(arg1, arg2);)
 	return 0;
 }