mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Unify pixel format enums for ImageData, CompressedImageData, and Canvas into a single PixelFormat enum.
Replace love.graphics.getRawImageFormats and love.graphics.getCompressedImageFormats with love.graphics.getImageFormats. --HG-- branch : minor
This commit is contained in:
@@ -44,13 +44,13 @@ int w_newImageData(lua_State *L)
|
||||
if (w <= 0 || h <= 0)
|
||||
return luaL_error(L, "Invalid image size.");
|
||||
|
||||
ImageData::Format format = ImageData::FORMAT_RGBA8;
|
||||
PixelFormat format = PIXELFORMAT_RGBA8;
|
||||
|
||||
if (!lua_isnoneornil(L, 3))
|
||||
{
|
||||
const char *fstr = luaL_checkstring(L, 3);
|
||||
if (!ImageData::getConstant(fstr, format))
|
||||
return luaL_error(L, "Invalid ImageData format: %s", fstr);
|
||||
if (!getConstant(fstr, format))
|
||||
return luaL_error(L, "Invalid pixel format: %s", fstr);
|
||||
}
|
||||
|
||||
size_t numbytes = 0;
|
||||
|
||||
Reference in New Issue
Block a user