mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Modules now reside in Lua and are treated (almost) like normal objects.
Also added a way of getting a pointer to abstract module instances internally.
This commit is contained in:
@@ -237,7 +237,7 @@ namespace box2d
|
||||
};
|
||||
|
||||
// List of constants.
|
||||
static const LuaConstant constants[] = {
|
||||
static const Constant constants[] = {
|
||||
{ "shape_circle", Shape::SHAPE_CIRCLE },
|
||||
{ "shape_polygon", Shape::SHAPE_POLYGON },
|
||||
|
||||
@@ -264,7 +264,15 @@ namespace box2d
|
||||
}
|
||||
}
|
||||
|
||||
return luax_register_module(L, functions, types, constants, "physics");
|
||||
WrappedModule w;
|
||||
w.module = instance;
|
||||
w.name = "physics";
|
||||
w.flags = MODULE_T;
|
||||
w.functions = functions;
|
||||
w.types = types;
|
||||
w.constants = constants;
|
||||
|
||||
return luax_register_module(L, w);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
Reference in New Issue
Block a user