Remove FFI from color. It's broken.
This commit is contained in:
parent
5892600bc6
commit
32cf0e8608
@ -95,16 +95,6 @@ local function color_to_hsv(c)
|
||||
return { h, s, v, a }
|
||||
end
|
||||
|
||||
-- Do the check to see if JIT is enabled. If so use the optimized FFI structs.
|
||||
local status, ffi, the_type
|
||||
if type(jit) == "table" and jit.status() then
|
||||
status, ffi = pcall(require, "ffi")
|
||||
if status then
|
||||
ffi.cdef "typedef struct { double _c[4]; } cpml_color;"
|
||||
new = ffi.typeof("cpml_color")
|
||||
end
|
||||
end
|
||||
|
||||
function color.new(r, g, b, a)
|
||||
-- number, number, number, number
|
||||
if r and g and b and a then
|
||||
@ -267,10 +257,6 @@ function color.linear_to_gamma(r, g, b, a)
|
||||
end
|
||||
|
||||
function color.is_color(a)
|
||||
if type(a) == "cdata" then
|
||||
return ffi.istype("cpml_color", a)
|
||||
end
|
||||
|
||||
if type(a) ~= "table" then
|
||||
return false
|
||||
end
|
||||
@ -330,8 +316,4 @@ function color_mt.__mul(a, b)
|
||||
end
|
||||
end
|
||||
|
||||
if status then
|
||||
ffi.metatype(new, color_mt)
|
||||
end
|
||||
|
||||
return setmetatable({}, color_mt)
|
||||
|
Loading…
x
Reference in New Issue
Block a user