Support format parameter in newTextureData;

This commit is contained in:
bjorn 2018-08-11 00:02:17 -07:00
parent 58dc34ec64
commit cc440c9784
1 changed files with 2 additions and 1 deletions

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);