2023-04-28 17:35:52 +00:00
|
|
|
--Load and save the bmp formats used by DEFCON.
|
2023-07-28 05:17:00 +00:00
|
|
|
local t = {}
|
2023-07-28 23:23:08 +00:00
|
|
|
local love = assert( love )
|
2023-07-28 05:17:00 +00:00
|
|
|
local lfs = love.filesystem
|
2023-04-28 17:35:52 +00:00
|
|
|
|
2023-07-28 05:17:00 +00:00
|
|
|
--FFI bit-twiddling stuff.
|
|
|
|
local ffi = require 'ffi'
|
|
|
|
local bit = require 'bit'
|
2023-04-28 17:35:52 +00:00
|
|
|
|
2023-07-28 05:17:00 +00:00
|
|
|
function t.load( filename )
|
2023-07-28 23:23:08 +00:00
|
|
|
local imgd = love.image.newImageData( filename )
|
|
|
|
print( "LOADING BITMAP: ", filename, imgd:getSize(), imgd:getFormat(), imgd:getDimensions() )
|
2023-08-28 23:12:43 +00:00
|
|
|
local img = love.graphics.newImage( imgd )
|
|
|
|
img:setFilter( "nearest", "nearest" )
|
|
|
|
return img, imgd
|
2023-07-28 05:17:00 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
function t.save( data, format )
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
return t
|