mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
IDL: Fixed functions that require _this.
This commit is contained in:
@@ -401,7 +401,7 @@ function codegen.nameconversion(all_types, all_funcs)
|
||||
end
|
||||
local classtype = { fulltype = classname .. "*" }
|
||||
convert_arg(all_types, classtype, v)
|
||||
v.this = classtype.ctype .. " _this"
|
||||
v.this = classtype.ctype
|
||||
v.this_conversion = string.format( "%s This = (%s)_this;", classtype.cpptype, classtype.cpptype)
|
||||
v.this_to_c = string.format("(%s)this", classtype.ctype)
|
||||
end
|
||||
@@ -446,7 +446,7 @@ local function codetemp(func)
|
||||
|
||||
if func.class then
|
||||
-- It's a member function
|
||||
cargs[1] = func.this
|
||||
cargs[1] = func.this .. " _this"
|
||||
conversion[1] = func.this_conversion
|
||||
cppfunc = "This->" .. func.name
|
||||
callargs[1] = "_this"
|
||||
|
||||
@@ -272,6 +272,21 @@ function converter.funcs(func)
|
||||
local first = ""
|
||||
local args = "("
|
||||
|
||||
if func.this ~= nil then
|
||||
|
||||
local thisType = func.this:gsub("const ", "")
|
||||
if thisType == "bgfx_encoder_t*" then
|
||||
thisType = "Encoder*"
|
||||
elseif thisType == "bgfx_attachment_t*" then
|
||||
thisType = "Attachment*"
|
||||
elseif thisType == "bgfx_vertex_decl_t*" then
|
||||
thisType = "VertexDecl*"
|
||||
end
|
||||
|
||||
args = args .. thisType .. " " .. "_this"
|
||||
first = ", "
|
||||
end
|
||||
|
||||
for _, arg in ipairs(func.args) do
|
||||
|
||||
local argtype = convert_type(arg)
|
||||
|
||||
Reference in New Issue
Block a user