1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-04 05:23:34 +00:00

Expose option to flip TextureData on load;

This commit is contained in:
bjorn 2019-01-04 21:51:20 -08:00
parent ed71485fcc
commit cc88a0b919

View file

@ -105,7 +105,8 @@ static int l_lovrDataNewTextureData(lua_State* L) {
textureData = lovrTextureDataCreate(width, height, 0x0, format);
} else {
Blob* blob = luax_readblob(L, 1, "Texture");
textureData = lovrTextureDataCreateFromBlob(blob, true);
bool flip = lua_isnoneornil(L, 2) ? true : lua_toboolean(L, 2);
textureData = lovrTextureDataCreateFromBlob(blob, flip);
lovrRelease(blob);
}