mirror of
https://github.com/cimgui/cimgui.git
synced 2025-08-11 04:18:29 +01:00
generator.lua: pre sorted changes
This commit is contained in:
@@ -177,27 +177,34 @@ local function DefsByStruct(FP)
|
|||||||
end
|
end
|
||||||
|
|
||||||
----------custom ImVector templates
|
----------custom ImVector templates
|
||||||
|
local table_do_sorted = cpp2ffi.table_do_sorted
|
||||||
local function generate_templates(code,codeimpool,templates)
|
local function generate_templates(code,codeimpool,templates)
|
||||||
table.insert(code,"\n"..[[typedef struct ImVector{int Size;int Capacity;void* Data;} ImVector;]].."\n")
|
table.insert(code,"\n"..[[typedef struct ImVector{int Size;int Capacity;void* Data;} ImVector;]].."\n")
|
||||||
for ttype,v in pairs(templates) do
|
for ttype,v in pairs(templates) do
|
||||||
--local te = k:gsub("%s","_")
|
--table_do_sorted(templates , function (ttype, v)
|
||||||
--te = te:gsub("%*","Ptr")
|
|
||||||
if ttype == "ImVector" then
|
if ttype == "ImVector" then
|
||||||
for te,newte in pairs(v) do
|
for te,newte in pairs(v) do
|
||||||
|
--table_do_sorted(v, function(te,newte)
|
||||||
table.insert(code,"typedef struct ImVector_"..newte.." {int Size;int Capacity;"..te.."* Data;} ImVector_"..newte..";\n")
|
table.insert(code,"typedef struct ImVector_"..newte.." {int Size;int Capacity;"..te.."* Data;} ImVector_"..newte..";\n")
|
||||||
|
--end)
|
||||||
end
|
end
|
||||||
elseif ttype == "ImPool" then
|
elseif ttype == "ImPool" then
|
||||||
--declare ImGuiStorage
|
--declare ImGuiStorage
|
||||||
for te,newte in pairs(v) do
|
for te,newte in pairs(v) do
|
||||||
|
--table_do_sorted(v, function(te, newte)
|
||||||
table.insert(codeimpool,"typedef struct ImVector_"..newte.." {int Size;int Capacity;"..te.."* Data;} ImVector_"..newte..";\n")
|
table.insert(codeimpool,"typedef struct ImVector_"..newte.." {int Size;int Capacity;"..te.."* Data;} ImVector_"..newte..";\n")
|
||||||
table.insert(codeimpool,"typedef struct ImPool_"..newte.." {ImVector_"..te.." Buf;ImGuiStorage Map;ImPoolIdx FreeIdx;} ImPool_"..newte..";\n")
|
table.insert(codeimpool,"typedef struct ImPool_"..newte.." {ImVector_"..te.." Buf;ImGuiStorage Map;ImPoolIdx FreeIdx;} ImPool_"..newte..";\n")
|
||||||
|
--end)
|
||||||
end
|
end
|
||||||
elseif ttype == "ImChunkStream" then
|
elseif ttype == "ImChunkStream" then
|
||||||
for te,newte in pairs(v) do
|
for te,newte in pairs(v) do
|
||||||
|
--table_do_sorted(v, function(te,newte)
|
||||||
table.insert(code,"typedef struct ImVector_"..newte.." {int Size;int Capacity;"..te.."* Data;} ImVector_"..newte..";\n")
|
table.insert(code,"typedef struct ImVector_"..newte.." {int Size;int Capacity;"..te.."* Data;} ImVector_"..newte..";\n")
|
||||||
table.insert(code,"typedef struct ImChunkStream_"..newte.." {ImVector_"..te.." Buf;} ImChunkStream_"..newte..";\n")
|
table.insert(code,"typedef struct ImChunkStream_"..newte.." {ImVector_"..te.." Buf;} ImChunkStream_"..newte..";\n")
|
||||||
|
--end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
--end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--generate cimgui.cpp cimgui.h
|
--generate cimgui.cpp cimgui.h
|
||||||
|
Reference in New Issue
Block a user