mirror of
https://github.com/love2d/love.git
synced 2026-08-19 20:19:42 +02:00
Add love.data module.
- Moved love.math.compress / decompress / decode / encode / hash to love.data. - Changed love.data.compress/decompress to take the format argument first instead of second. - Added love.data.newDataView. Returns a read-only subsection of an existing Data object. - Added love.data.newByteData. Mostly useful in combination with LuaJIT's FFI as it has no extra methods currently. - Added implementations of Lua 5.3's data packing APIs: love.data.packString / packData / unpack / getPackedSize. Resolves issue #1336. Resolves issue #1331. --HG-- branch : minor
This commit is contained in:
@@ -923,7 +923,7 @@ function love.nogame()
|
||||
love.graphics.setBackgroundColor(136/255, 193/255, 206/255)
|
||||
|
||||
local function load_image(file, name, flags)
|
||||
local decoded = love.math.decode("base64", file)
|
||||
local decoded = love.data.decode("base64", file)
|
||||
return love.graphics.newImage(love.filesystem.newFileData(decoded, name:gsub("_", ".")), flags)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user