ソースを参照

IDL: Updated codegen.

Бранимир Караџић 6 年 前
コミット
102b3d2b39
3 ファイル変更9 行追加6 行削除
  1. 2 0
      bindings/cs/bgfx.cs
  2. 6 6
      scripts/bindings-cs.lua
  3. 1 0
      scripts/codegen.lua

+ 2 - 0
bindings/cs/bgfx.cs

@@ -123,6 +123,7 @@ internal struct bgfx
 		OpPassZShift           = 28,
 		OpPassZShift           = 28,
 		OpPassZMask            = 0xf0000000,
 		OpPassZMask            = 0xf0000000,
 	}
 	}
+	
 	[Flags]
 	[Flags]
 	public enum ClearFlags : ushort
 	public enum ClearFlags : ushort
 	{
 	{
@@ -282,6 +283,7 @@ internal struct bgfx
 		ReservedShift          = 31,
 		ReservedShift          = 31,
 		ReservedMask           = 0x80000000,
 		ReservedMask           = 0x80000000,
 	}
 	}
+	
 	[Flags]
 	[Flags]
 	public enum CapsFlags : ulong
 	public enum CapsFlags : ulong
 	{
 	{

+ 6 - 6
scripts/bindings-cs.lua

@@ -102,7 +102,7 @@ function gen.gen()
 				table.insert(tmp, v)
 				table.insert(tmp, v)
 				any = true
 				any = true
 			end
 			end
-			if any then
+			if any and tmp[#tmp] ~= "" then
 				table.insert(tmp, "")
 				table.insert(tmp, "")
 			end
 			end
 		end
 		end
@@ -120,10 +120,6 @@ end
 local lastCombinedFlag
 local lastCombinedFlag
 
 
 local function FlagBlock(typ)
 local function FlagBlock(typ)
-	if typ == nil then
-		return
-	end
-
 	local format = "0x%08x"
 	local format = "0x%08x"
 	local enumType = " : uint"
 	local enumType = " : uint"
 	if typ.bits == 64 then
 	if typ.bits == 64 then
@@ -173,7 +169,11 @@ end
 
 
 local function lastCombinedFlagBlock()
 local function lastCombinedFlagBlock()
 	if lastCombinedFlag then
 	if lastCombinedFlag then
-		FlagBlock(combined[lastCombinedFlag])
+		local typ = combined[lastCombinedFlag]
+		if typ then
+			FlagBlock(combined[lastCombinedFlag])
+			yield("")
+		end
 		lastCombinedFlag = nil
 		lastCombinedFlag = nil
 	end
 	end
 end
 end

+ 1 - 0
scripts/codegen.lua

@@ -336,6 +336,7 @@ function codegen.nameconversion(all_types, all_funcs)
 			if substruct[v.name] then
 			if substruct[v.name] then
 				error ( "Duplicate sub struct " .. v.name .. " in " .. v.namespace)
 				error ( "Duplicate sub struct " .. v.name .. " in " .. v.namespace)
 			end
 			end
+			v.parent_class = super
 			substruct[#substruct+1] = v
 			substruct[#substruct+1] = v
 			substruct[v.name] = v
 			substruct[v.name] = v
 		end
 		end