mirror of
https://github.com/love2d/love.git
synced 2026-08-18 19:54:22 +02:00
Merge dynamiccore2 into minor
Instead of a global type enum and bitfield, all types now have their own love::Type static member. This means they automatically assign their ids, build their bitsets, etc. As a bonus, it simplifies wrapper code since most functions already know which type they're pushing to or getting from lua, so they can directly get the static member (if it's called 'type'). --HG-- branch : minor
This commit is contained in:
@@ -30,7 +30,7 @@ namespace opengl
|
||||
|
||||
Canvas *luax_checkcanvas(lua_State *L, int idx)
|
||||
{
|
||||
return luax_checktype<Canvas>(L, idx, GRAPHICS_CANVAS_ID);
|
||||
return luax_checktype<Canvas>(L, idx);
|
||||
}
|
||||
|
||||
int w_Canvas_getFormat(lua_State *L)
|
||||
@@ -61,7 +61,7 @@ static const luaL_Reg w_Canvas_functions[] =
|
||||
|
||||
extern "C" int luaopen_canvas(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, GRAPHICS_CANVAS_ID, "Canvas", w_Texture_functions, w_Canvas_functions, nullptr);
|
||||
return luax_register_type(L, &Canvas::type, w_Texture_functions, w_Canvas_functions, nullptr);
|
||||
}
|
||||
|
||||
} // opengl
|
||||
|
||||
Reference in New Issue
Block a user