You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
827 B
Lua

local base = string.match(..., "(.-)[^%.]+%.[^%.]+$")
local ffi = require("ffi")
local fh = require(base.."helper.ffi_struct")
local format = string.format
local mt, index = {}, {}
fh.gen_raw_accessor(index, "right_saturation")
fh.gen_raw_accessor(index, "left_saturation")
fh.gen_raw_accessor(index, "right_coeff")
fh.gen_raw_accessor(index, "left_coeff")
fh.gen_raw_accessor(index, "deadband")
fh.gen_raw_accessor(index, "center")
function index:tostring()
return format(
"ff_condition_effect{right_saturation=%d, left_saturation=%d, right_coeff=%d, left_coeff=%d, deadband=%d, center=%d}",
self.right_saturation, self.left_saturation,
self.right_coeff, self.left_coeff,
self.deadband, self.center)
end
mt.__tostring = index.tostring
return fh.base(mt, index, ffi.typeof("struct ff_condition_effect"))