Replaced most cases of type bits and type name strings in love's Lua wrapper code with type id's.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2015-03-01 18:32:41 -04:00
parent 3830a0969c
commit 2f419c1c83
79 changed files with 601 additions and 566 deletions
+5 -5
View File
@@ -30,7 +30,7 @@ namespace box2d
Contact *luax_checkcontact(lua_State *L, int idx)
{
Contact *c = luax_checktype<Contact>(L, idx, "Contact", PHYSICS_CONTACT_T);
Contact *c = luax_checktype<Contact>(L, idx, PHYSICS_CONTACT_ID);
if (!c->isValid())
luaL_error(L, "Attempt to use destroyed contact.");
return c;
@@ -146,14 +146,14 @@ int w_Contact_getFixtures(lua_State *L)
Fixture *b = nullptr;
luax_catchexcept(L, [&](){ t->getFixtures(a, b); });
luax_pushtype(L, "Fixture", PHYSICS_FIXTURE_T, a);
luax_pushtype(L, "Fixture", PHYSICS_FIXTURE_T, b);
luax_pushtype(L, PHYSICS_FIXTURE_ID, a);
luax_pushtype(L, PHYSICS_FIXTURE_ID, b);
return 2;
}
int w_Contact_isDestroyed(lua_State *L)
{
Contact *c = luax_checktype<Contact>(L, 1, "Contact", PHYSICS_CONTACT_T);
Contact *c = luax_checktype<Contact>(L, 1, PHYSICS_CONTACT_ID);
luax_pushboolean(L, !c->isValid());
return 1;
}
@@ -181,7 +181,7 @@ extern "C" int luaopen_contact(lua_State *L)
{ 0, 0 }
};
return luax_register_type(L, "Contact", functions);
return luax_register_type(L, PHYSICS_CONTACT_ID, functions);
}
} // box2d