1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-02 12:33:52 +00:00

Support format parameter in newTextureData;

This commit is contained in:
bjorn 2018-08-11 00:02:17 -07:00
parent 58dc34ec64
commit cc440c9784

View file

@ -113,7 +113,8 @@ int l_lovrDataNewTextureData(lua_State* L) {
if (lua_type(L, 1) == LUA_TNUMBER) {
int width = luaL_checknumber(L, 1);
int height = luaL_checknumber(L, 2);
textureData = lovrTextureDataGetBlank(width, height, 0x0, FORMAT_RGBA);
TextureFormat format = luaL_checkoption(L, 3, "rgba", TextureFormats);
textureData = lovrTextureDataGetBlank(width, height, 0x0, format);
} else {
Blob* blob = luax_readblob(L, 1, "Texture");
textureData = lovrTextureDataFromBlob(blob);