mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 14:01:49 +00:00
fix canvas:set_data with table argument
This commit is contained in:
parent
afb7049248
commit
e678195a2a
1 changed files with 2 additions and 1 deletions
|
|
@ -46,6 +46,7 @@ local _ffi = ffi
|
||||||
function __vc_Canvas_set_data(self, data)
|
function __vc_Canvas_set_data(self, data)
|
||||||
if type(data) == "cdata" then
|
if type(data) == "cdata" then
|
||||||
self:_set_data(tostring(_ffi.cast("uintptr_t", data.bytes)), data.size)
|
self:_set_data(tostring(_ffi.cast("uintptr_t", data.bytes)), data.size)
|
||||||
|
return
|
||||||
end
|
end
|
||||||
local width = self.width
|
local width = self.width
|
||||||
local height = self.height
|
local height = self.height
|
||||||
|
|
@ -60,7 +61,7 @@ function __vc_Canvas_set_data(self, data)
|
||||||
for i=0, size - 1 do
|
for i=0, size - 1 do
|
||||||
canvas_ffi_buffer[i] = data[i + 1]
|
canvas_ffi_buffer[i] = data[i + 1]
|
||||||
end
|
end
|
||||||
self:_set_data(tostring(_ffi.cast("uintptr_t", canvas_ffi_buffer)), data.size)
|
self:_set_data(tostring(_ffi.cast("uintptr_t", canvas_ffi_buffer)), size)
|
||||||
end
|
end
|
||||||
|
|
||||||
local ipairs_mt_supported = false
|
local ipairs_mt_supported = false
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue