mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +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:
@@ -28,7 +28,7 @@ namespace image
|
||||
|
||||
CompressedImageData *luax_checkcompressedimagedata(lua_State *L, int idx)
|
||||
{
|
||||
return luax_checktype<CompressedImageData>(L, idx, IMAGE_COMPRESSED_IMAGE_DATA_ID);
|
||||
return luax_checktype<CompressedImageData>(L, idx);
|
||||
}
|
||||
|
||||
int w_CompressedImageData_getWidth(lua_State *L)
|
||||
@@ -106,7 +106,7 @@ static const luaL_Reg w_CompressedImageData_functions[] =
|
||||
|
||||
extern "C" int luaopen_compressedimagedata(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, IMAGE_COMPRESSED_IMAGE_DATA_ID, "CompressedImageData", w_Data_functions, w_CompressedImageData_functions, nullptr);
|
||||
return luax_register_type(L, &CompressedImageData::type, w_Data_functions, w_CompressedImageData_functions, nullptr);
|
||||
}
|
||||
|
||||
} // image
|
||||
|
||||
Reference in New Issue
Block a user