mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Added love.math.encode(format, data | string [, linelength]) and love.math.decode(format, data | string). Current formats are "base64" and "hex". The optional line length only applies to base64 and specifies the maximum number of characters per line in the encoded string.
Removed the variant of love.filesystem.newFileData which decoded a base64-encoded string since it's redundant. --HG-- branch : minor
This commit is contained in:
@@ -936,7 +936,8 @@ function love.nogame()
|
||||
love.graphics.setBackgroundColor(136/255, 193/255, 206/255)
|
||||
|
||||
local function load_image(file, name)
|
||||
return love.graphics.newImage(love.filesystem.newFileData(file, name:gsub("_", "."), "base64"))
|
||||
local decoded = love.math.decode("base64", file)
|
||||
return love.graphics.newImage(love.filesystem.newFileData(decoded, name:gsub("_", ".")))
|
||||
end
|
||||
|
||||
g_images = {}
|
||||
|
||||
Reference in New Issue
Block a user