Added love.math.compress(data, format [, level]) and love.math.decompress(compresseddata) / love.math.decompress(compressedstring, format).

Renamed the love.image CompressedData type to CompressedImageData.

love.math.compress returns a love.math CompressedData object which holds the newly compressed data. Currently supported formats are "lz4" and "zlib". Note that the formats are not file formats and don't compress filesystem hierarchies.
This commit is contained in:
Alex Szpakowski
2015-03-23 11:28:14 -03:00
parent 4d92d00aff
commit a29b349014
45 changed files with 3895 additions and 395 deletions
+3 -3
View File
@@ -70,13 +70,13 @@ int w_newCompressedData(lua_State *L)
{
love::filesystem::FileData *data = love::filesystem::luax_getfiledata(L, 1);
CompressedData *t = nullptr;
CompressedImageData *t = nullptr;
luax_catchexcept(L,
[&]() { t = instance()->newCompressedData(data); },
[&]() { data->release(); }
);
luax_pushtype(L, IMAGE_COMPRESSED_DATA_ID, t);
luax_pushtype(L, IMAGE_COMPRESSED_IMAGE_DATA_ID, t);
t->release();
return 1;
}
@@ -103,7 +103,7 @@ static const luaL_Reg functions[] =
static const lua_CFunction types[] =
{
luaopen_imagedata,
luaopen_compresseddata,
luaopen_compressedimagedata,
0
};