This commit is contained in:
Robin Wellner 2016-02-23 13:15:53 +01:00
parent 63a512707c
commit 60006de9f0

View File

@ -246,7 +246,6 @@ local function serialize(value)
Buffer_makeBuffer(4096) Buffer_makeBuffer(4096)
local seen = {len = 0} local seen = {len = 0}
serialize_value(value, seen) serialize_value(value, seen)
return buf, buf_pos
end end
local function add_to_seen(value, seen) local function add_to_seen(value, seen)
@ -357,10 +356,10 @@ end
return {dumps = function(value) return {dumps = function(value)
serialize(value) serialize(value)
return ffi.string(buf, buf_size) return ffi.string(buf, buf_pos)
end, dumpLoveFile = function(fname, value) end, dumpLoveFile = function(fname, value)
serialize(value) serialize(value)
love.filesystem.write(fname, ffi.string(buf, buf_size)) love.filesystem.write(fname, ffi.string(buf, buf_pos))
end, loadLoveFile = function(fname) end, loadLoveFile = function(fname)
local serializedData = love.filesystem.newFileData(fname) local serializedData = love.filesystem.newFileData(fname)
Buffer_newDataReader(serializedData:getPointer(), serializedData:getSize()) Buffer_newDataReader(serializedData:getPointer(), serializedData:getSize())