mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Cosmetic code improvements
--HG-- branch : image-CompressedData
This commit is contained in:
@@ -146,10 +146,13 @@ private:
|
||||
{
|
||||
return texture;
|
||||
}
|
||||
// The ImageData from which the texture is created.
|
||||
|
||||
// The ImageData from which the texture is created. May be null if
|
||||
// Compressed image data was used to create the texture.
|
||||
love::image::ImageData *data;
|
||||
|
||||
// Or the Compressed Image Data from which the texture is created.
|
||||
// Or the Compressed Image Data from which the texture is created. May be
|
||||
// null if raw ImageData was used to create the texture.
|
||||
love::image::CompressedData *cdata;
|
||||
|
||||
// Width and height of the hardware texture.
|
||||
|
||||
@@ -418,7 +418,7 @@ int w_newImageFont(lua_State *L)
|
||||
int startIndex = 2;
|
||||
|
||||
// Convert to ImageData if necessary.
|
||||
if (lua_isstring(L, 1) || luax_istype(L, 1, FILESYSTEM_FILE_T) || (luax_istype(L, 1, DATA_T) && !luax_istype(L, 1, IMAGE_IMAGE_DATA_T)))
|
||||
if (lua_isstring(L, 1) || luax_istype(L, 1, FILESYSTEM_FILE_T) || luax_istype(L, 1, FILESYSTEM_FILE_DATA_T))
|
||||
luax_convobj(L, 1, "image", "newImageData");
|
||||
else if (luax_istype(L, 1, GRAPHICS_IMAGE_T))
|
||||
{
|
||||
@@ -426,6 +426,8 @@ int w_newImageFont(lua_State *L)
|
||||
img_filter = i->getFilter();
|
||||
setFilter = true;
|
||||
love::image::ImageData *id = i->getData();
|
||||
if (!id)
|
||||
return luaL_argerror(L, 1, "image cannot be compressed");
|
||||
luax_newtype(L, "ImageData", IMAGE_IMAGE_DATA_T, (void *)id, false);
|
||||
lua_replace(L, 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user