mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +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:
@@ -73,7 +73,7 @@ int w_newImageData(lua_State *L)
|
||||
memcpy(t->getData(), bytes, t->getSize());
|
||||
}
|
||||
|
||||
luax_pushtype(L, IMAGE_IMAGE_DATA_ID, t);
|
||||
luax_pushtype(L, t);
|
||||
t->release();
|
||||
return 1;
|
||||
}
|
||||
@@ -87,7 +87,7 @@ int w_newImageData(lua_State *L)
|
||||
[&](bool) { data->release(); }
|
||||
);
|
||||
|
||||
luax_pushtype(L, IMAGE_IMAGE_DATA_ID, t);
|
||||
luax_pushtype(L, t);
|
||||
t->release();
|
||||
return 1;
|
||||
}
|
||||
@@ -107,7 +107,7 @@ int w_newCompressedData(lua_State *L)
|
||||
[&](bool) { data->release(); }
|
||||
);
|
||||
|
||||
luax_pushtype(L, IMAGE_COMPRESSED_IMAGE_DATA_ID, t);
|
||||
luax_pushtype(L, CompressedImageData::type, t);
|
||||
t->release();
|
||||
return 1;
|
||||
}
|
||||
@@ -151,7 +151,7 @@ extern "C" int luaopen_love_image(lua_State *L)
|
||||
WrappedModule w;
|
||||
w.module = instance;
|
||||
w.name = "image";
|
||||
w.type = MODULE_IMAGE_ID;
|
||||
w.type = &Image::type;
|
||||
w.functions = functions;
|
||||
w.types = types;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user