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)
local seen = {len = 0}
serialize_value(value, seen)
return buf, buf_pos
end
local function add_to_seen(value, seen)
@ -357,10 +356,10 @@ end
return {dumps = function(value)
serialize(value)
return ffi.string(buf, buf_size)
return ffi.string(buf, buf_pos)
end, dumpLoveFile = function(fname, 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)
local serializedData = love.filesystem.newFileData(fname)
Buffer_newDataReader(serializedData:getPointer(), serializedData:getSize())