mirror of
https://github.com/love2d/love.git
synced 2026-08-18 19:54:22 +02:00
Make love::Type handle type names
TODO: Fix undefined behaviour in luax_register_type, you can't use a va_list after a reference type --HG-- branch : dynamiccore2
This commit is contained in:
@@ -34,7 +34,7 @@ namespace physics
|
||||
namespace box2d
|
||||
{
|
||||
|
||||
love::Type ChainShape::type(&Shape::type);
|
||||
love::Type ChainShape::type("ChainShape", &Shape::type);
|
||||
|
||||
ChainShape::ChainShape(b2ChainShape *c, bool loop, bool own)
|
||||
: Shape(c, own), loop(loop)
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace physics
|
||||
namespace box2d
|
||||
{
|
||||
|
||||
love::Type CircleShape::type(&Shape::type);
|
||||
love::Type CircleShape::type("CircleShape", &Shape::type);
|
||||
|
||||
CircleShape::CircleShape(b2CircleShape *c, bool own)
|
||||
: Shape(c, own)
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace physics
|
||||
namespace box2d
|
||||
{
|
||||
|
||||
love::Type Contact::type(&Object::type);
|
||||
love::Type Contact::type("Contact", &Object::type);
|
||||
|
||||
Contact::Contact(b2Contact *contact)
|
||||
: contact(contact)
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace physics
|
||||
namespace box2d
|
||||
{
|
||||
|
||||
love::Type EdgeShape::type(&Shape::type);
|
||||
love::Type EdgeShape::type("EdgeShape", &Shape::type);
|
||||
|
||||
EdgeShape::EdgeShape(b2EdgeShape *e, bool own)
|
||||
: Shape(e, own)
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace physics
|
||||
namespace box2d
|
||||
{
|
||||
|
||||
love::Type Fixture::type(&Object::type);
|
||||
love::Type Fixture::type("Fixture", &Object::type);
|
||||
|
||||
Fixture::Fixture(Body *body, Shape *shape, float density)
|
||||
: body(body)
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace physics
|
||||
namespace box2d
|
||||
{
|
||||
|
||||
love::Type FrictionJoint::type(&Joint::type);
|
||||
love::Type FrictionJoint::type("FrictionJoint", &Joint::type);
|
||||
|
||||
FrictionJoint::FrictionJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected)
|
||||
: Joint(body1, body2)
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace physics
|
||||
namespace box2d
|
||||
{
|
||||
|
||||
love::Type GearJoint::type(&Joint::type);
|
||||
love::Type GearJoint::type("GearJoint", &Joint::type);
|
||||
|
||||
GearJoint::GearJoint(Joint *joint1, Joint *joint2, float ratio, bool collideConnected)
|
||||
: Joint(joint1->body2, joint2->body2)
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace physics
|
||||
namespace box2d
|
||||
{
|
||||
|
||||
love::Type MotorJoint::type(&Joint::type);
|
||||
love::Type MotorJoint::type("MotorJoint", &Joint::type);
|
||||
|
||||
MotorJoint::MotorJoint(Body *body1, Body *body2)
|
||||
: Joint(body1, body2)
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace physics
|
||||
namespace box2d
|
||||
{
|
||||
|
||||
love::Type MouseJoint::type(&Joint::type);
|
||||
love::Type MouseJoint::type("MouseJoint", &Joint::type);
|
||||
|
||||
MouseJoint::MouseJoint(Body *body1, float x, float y)
|
||||
: Joint(body1)
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace physics
|
||||
namespace box2d
|
||||
{
|
||||
|
||||
love::Type PolygonShape::type(&Shape::type);
|
||||
love::Type PolygonShape::type("PolygonShape", &Shape::type);
|
||||
|
||||
PolygonShape::PolygonShape(b2PolygonShape *p, bool own)
|
||||
: Shape(p, own)
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace physics
|
||||
namespace box2d
|
||||
{
|
||||
|
||||
love::Type PrismaticJoint::type(&Joint::type);
|
||||
love::Type PrismaticJoint::type("PrismaticJoint", &Joint::type);
|
||||
|
||||
PrismaticJoint::PrismaticJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, float ax, float ay, bool collideConnected)
|
||||
: Joint(body1, body2)
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace physics
|
||||
namespace box2d
|
||||
{
|
||||
|
||||
love::Type PulleyJoint::type(&Joint::type);
|
||||
love::Type PulleyJoint::type("PulleyJoint", &Joint::type);
|
||||
|
||||
PulleyJoint::PulleyJoint(Body *bodyA, Body *bodyB, b2Vec2 groundAnchorA, b2Vec2 groundAnchorB, b2Vec2 anchorA, b2Vec2 anchorB, float ratio, bool collideConnected)
|
||||
: Joint(bodyA, bodyB)
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace physics
|
||||
namespace box2d
|
||||
{
|
||||
|
||||
love::Type RevoluteJoint::type(&Joint::type);
|
||||
love::Type RevoluteJoint::type("RevoluteJoint", &Joint::type);
|
||||
|
||||
RevoluteJoint::RevoluteJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected)
|
||||
: Joint(body1, body2)
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace physics
|
||||
namespace box2d
|
||||
{
|
||||
|
||||
love::Type RopeJoint::type(&Joint::type);
|
||||
love::Type RopeJoint::type("RopeJoint", &Joint::type);
|
||||
|
||||
RopeJoint::RopeJoint(Body *body1, Body *body2, float x1, float y1, float x2, float y2, float maxLength, bool collideConnected)
|
||||
: Joint(body1, body2)
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace physics
|
||||
namespace box2d
|
||||
{
|
||||
|
||||
love::Type WeldJoint::type(&Joint::type);
|
||||
love::Type WeldJoint::type("WeldJoint", &Joint::type);
|
||||
|
||||
WeldJoint::WeldJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, bool collideConnected)
|
||||
: Joint(body1, body2)
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace physics
|
||||
namespace box2d
|
||||
{
|
||||
|
||||
love::Type WheelJoint::type(&Joint::type);
|
||||
love::Type WheelJoint::type("WheelJoint", &Joint::type);
|
||||
|
||||
WheelJoint::WheelJoint(Body *body1, Body *body2, float xA, float yA, float xB, float yB, float ax, float ay, bool collideConnected)
|
||||
: Joint(body1, body2)
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace physics
|
||||
namespace box2d
|
||||
{
|
||||
|
||||
love::Type World::type(&Object::type);
|
||||
love::Type World::type("World", &Object::type);
|
||||
|
||||
World::ContactCallback::ContactCallback()
|
||||
: ref(nullptr)
|
||||
|
||||
@@ -650,7 +650,7 @@ static const luaL_Reg w_Body_functions[] =
|
||||
|
||||
extern "C" int luaopen_body(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, Body::type, "Body", w_Body_functions, nullptr);
|
||||
return luax_register_type(L, Body::type, w_Body_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -149,7 +149,7 @@ static const luaL_Reg w_ChainShape_functions[] =
|
||||
|
||||
extern "C" int luaopen_chainshape(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, ChainShape::type, "ChainShape", w_Shape_functions, w_ChainShape_functions, nullptr);
|
||||
return luax_register_type(L, ChainShape::type, w_Shape_functions, w_ChainShape_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -75,7 +75,7 @@ static const luaL_Reg w_CircleShape_functions[] =
|
||||
|
||||
extern "C" int luaopen_circleshape(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, CircleShape::type, "CircleShape", w_Shape_functions, w_CircleShape_functions, nullptr);
|
||||
return luax_register_type(L, CircleShape::type, w_Shape_functions, w_CircleShape_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -181,7 +181,7 @@ static const luaL_Reg w_Contact_functions[] =
|
||||
|
||||
extern "C" int luaopen_contact(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, Contact::type, "Contact", w_Contact_functions, nullptr);
|
||||
return luax_register_type(L, Contact::type, w_Contact_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -93,7 +93,7 @@ static const luaL_Reg w_DistanceJoint_functions[] =
|
||||
|
||||
extern "C" int luaopen_distancejoint(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, DistanceJoint::type, "DistanceJoint", w_Joint_functions, w_DistanceJoint_functions, nullptr);
|
||||
return luax_register_type(L, DistanceJoint::type, w_Joint_functions, w_DistanceJoint_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -105,7 +105,7 @@ static const luaL_Reg w_EdgeShape_functions[] =
|
||||
|
||||
extern "C" int luaopen_edgeshape(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, EdgeShape::type, "EdgeShape", w_Shape_functions, w_EdgeShape_functions, nullptr);
|
||||
return luax_register_type(L, EdgeShape::type, w_Shape_functions, w_EdgeShape_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -302,7 +302,7 @@ static const luaL_Reg w_Fixture_functions[] =
|
||||
|
||||
extern "C" int luaopen_fixture(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, Fixture::type, "Fixture", w_Fixture_functions, nullptr);
|
||||
return luax_register_type(L, Fixture::type, w_Fixture_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -77,7 +77,7 @@ static const luaL_Reg w_FrictionJoint_functions[] =
|
||||
|
||||
extern "C" int luaopen_frictionjoint(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, FrictionJoint::type, "FrictionJoint", w_Joint_functions, w_FrictionJoint_functions, nullptr);
|
||||
return luax_register_type(L, FrictionJoint::type, w_Joint_functions, w_FrictionJoint_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -77,7 +77,7 @@ static const luaL_Reg w_GearJoint_functions[] =
|
||||
|
||||
extern "C" int luaopen_gearjoint(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, GearJoint::type, "GearJoint", w_Joint_functions, w_GearJoint_functions, nullptr);
|
||||
return luax_register_type(L, GearJoint::type, w_Joint_functions, w_GearJoint_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -182,7 +182,7 @@ const luaL_Reg w_Joint_functions[] =
|
||||
|
||||
extern "C" int luaopen_joint(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, Joint::type, "Joint", w_Joint_functions, nullptr);
|
||||
return luax_register_type(L, Joint::type, w_Joint_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -127,7 +127,7 @@ static const luaL_Reg w_MotorJoint_functions[] =
|
||||
|
||||
extern "C" int luaopen_motorjoint(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, MotorJoint::type, "MotorJoint", w_Joint_functions, w_MotorJoint_functions, nullptr);
|
||||
return luax_register_type(L, MotorJoint::type, w_Joint_functions, w_MotorJoint_functions, nullptr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ static const luaL_Reg w_MouseJoint_functions[] =
|
||||
|
||||
extern "C" int luaopen_mousejoint(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, MouseJoint::type, "MouseJoint", w_Joint_functions, w_MouseJoint_functions, nullptr);
|
||||
return luax_register_type(L, MouseJoint::type, w_Joint_functions, w_MouseJoint_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -55,7 +55,7 @@ static const luaL_Reg w_PolygonShape_functions[] =
|
||||
|
||||
extern "C" int luaopen_polygonshape(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, PolygonShape::type, "PolygonShape", w_Shape_functions, w_PolygonShape_functions, nullptr);
|
||||
return luax_register_type(L, PolygonShape::type, w_Shape_functions, w_PolygonShape_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -204,7 +204,7 @@ static const luaL_Reg w_PrismaticJoint_functions[] =
|
||||
|
||||
extern "C" int luaopen_prismaticjoint(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, PrismaticJoint::type, "PrismaticJoint", w_Joint_functions, w_PrismaticJoint_functions, nullptr);
|
||||
return luax_register_type(L, PrismaticJoint::type, w_Joint_functions, w_PrismaticJoint_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -74,7 +74,7 @@ static const luaL_Reg w_PulleyJoint_functions[] =
|
||||
|
||||
extern "C" int luaopen_pulleyjoint(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, PulleyJoint::type, "PulleyJoint", w_Joint_functions, w_PulleyJoint_functions, nullptr);
|
||||
return luax_register_type(L, PulleyJoint::type, w_Joint_functions, w_PulleyJoint_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -196,7 +196,7 @@ static const luaL_Reg w_RevoluteJoint_functions[] =
|
||||
|
||||
extern "C" int luaopen_revolutejoint(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, RevoluteJoint::type, "RevoluteJoint", w_Joint_functions, w_RevoluteJoint_functions, nullptr);
|
||||
return luax_register_type(L, RevoluteJoint::type, w_Joint_functions, w_RevoluteJoint_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -50,7 +50,7 @@ static const luaL_Reg w_RopeJoint_functions[] =
|
||||
|
||||
extern "C" int luaopen_ropejoint(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, RopeJoint::type, "RopeJoint", w_Joint_functions, w_RopeJoint_functions, nullptr);
|
||||
return luax_register_type(L, RopeJoint::type, w_Joint_functions, w_RopeJoint_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -108,7 +108,7 @@ const luaL_Reg w_Shape_functions[] =
|
||||
|
||||
extern "C" int luaopen_shape(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, Shape::type, "Shape", w_Shape_functions, nullptr);
|
||||
return luax_register_type(L, Shape::type, w_Shape_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -84,7 +84,7 @@ static const luaL_Reg w_WeldJoint_functions[] =
|
||||
|
||||
extern "C" int luaopen_weldjoint(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, WeldJoint::type, "WeldJoint", w_Joint_functions, w_WeldJoint_functions, nullptr);
|
||||
return luax_register_type(L, WeldJoint::type, w_Joint_functions, w_WeldJoint_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -160,7 +160,7 @@ static const luaL_Reg w_WheelJoint_functions[] =
|
||||
|
||||
extern "C" int luaopen_wheeljoint(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, WheelJoint::type, "WheelJoint", w_Joint_functions, w_WheelJoint_functions, nullptr);
|
||||
return luax_register_type(L, WheelJoint::type, w_Joint_functions, w_WheelJoint_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -237,7 +237,7 @@ static const luaL_Reg w_World_functions[] =
|
||||
|
||||
extern "C" int luaopen_world(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, World::type, "World", w_World_functions, nullptr);
|
||||
return luax_register_type(L, World::type, w_World_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
Reference in New Issue
Block a user