mirror of
https://github.com/bjornbytes/lovr.git
synced 2024-07-04 13:33:34 +00:00
Support format parameter in newTextureData;
This commit is contained in:
parent
58dc34ec64
commit
cc440c9784
|
@ -113,7 +113,8 @@ int l_lovrDataNewTextureData(lua_State* L) {
|
||||||
if (lua_type(L, 1) == LUA_TNUMBER) {
|
if (lua_type(L, 1) == LUA_TNUMBER) {
|
||||||
int width = luaL_checknumber(L, 1);
|
int width = luaL_checknumber(L, 1);
|
||||||
int height = luaL_checknumber(L, 2);
|
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 {
|
} else {
|
||||||
Blob* blob = luax_readblob(L, 1, "Texture");
|
Blob* blob = luax_readblob(L, 1, "Texture");
|
||||||
textureData = lovrTextureDataFromBlob(blob);
|
textureData = lovrTextureDataFromBlob(blob);
|
||||||
|
|
Loading…
Reference in a new issue