mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-24 17:05:37 +00:00
* Main.cs:
* Settings.cs: * FuncProcessor.cs: * Structures/Type.cs: * Structures/Constant.cs: * Structures/Delegate.cs: Do not hardcode namespace separator to ".".
This commit is contained in:
parent
84dcb6395f
commit
95a906647e
|
@ -169,7 +169,8 @@ namespace Bind
|
||||||
if (d.ReturnType.CurrentType.Contains("GLenum"))
|
if (d.ReturnType.CurrentType.Contains("GLenum"))
|
||||||
{
|
{
|
||||||
if ((Settings.Compatibility & Settings.Legacy.ConstIntEnums) == Settings.Legacy.None)
|
if ((Settings.Compatibility & Settings.Legacy.ConstIntEnums) == Settings.Legacy.None)
|
||||||
d.ReturnType.QualifiedType = String.Format("{0}.{1}", Settings.EnumsOutput, Settings.CompleteEnumName);
|
d.ReturnType.QualifiedType = String.Format("{0}{1}{2}",
|
||||||
|
Settings.EnumsOutput, Settings.NamespaceSeparator, Settings.CompleteEnumName);
|
||||||
else
|
else
|
||||||
d.ReturnType.QualifiedType = "int";
|
d.ReturnType.QualifiedType = "int";
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,6 +86,7 @@ namespace Bind
|
||||||
Settings.DefaultOutputPath = "gl";
|
Settings.DefaultOutputPath = "gl";
|
||||||
Settings.DefaultOutputNamespace = "OpenTK";
|
Settings.DefaultOutputNamespace = "OpenTK";
|
||||||
Settings.EnumsNamespace = "";
|
Settings.EnumsNamespace = "";
|
||||||
|
Settings.NamespaceSeparator = "::";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@ namespace Bind
|
||||||
public static string FunctionPrefix = "gl";
|
public static string FunctionPrefix = "gl";
|
||||||
public static string ConstantPrefix = "GL_";
|
public static string ConstantPrefix = "GL_";
|
||||||
public static string EnumPrefix = "";
|
public static string EnumPrefix = "";
|
||||||
|
public static string NamespaceSeparator = ".";
|
||||||
|
|
||||||
public static string ImportsFile = "Core.cs";
|
public static string ImportsFile = "Core.cs";
|
||||||
public static string DelegatesFile = "Delegates.cs";
|
public static string DelegatesFile = "Delegates.cs";
|
||||||
|
@ -51,14 +52,14 @@ namespace Bind
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
normalEnumsClassOverride == null ?
|
normalEnumsClassOverride == null ?
|
||||||
String.IsNullOrEmpty(NestedEnumsClass) ? OutputClass : OutputClass + "." + NestedEnumsClass :
|
String.IsNullOrEmpty(NestedEnumsClass) ? OutputClass : OutputClass + NamespaceSeparator + NestedEnumsClass :
|
||||||
normalEnumsClassOverride;
|
normalEnumsClassOverride;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string AuxEnumsClass
|
public static string AuxEnumsClass
|
||||||
{
|
{
|
||||||
get { return GLClass + "." + NestedEnumsClass; }
|
get { return GLClass + NamespaceSeparator + NestedEnumsClass; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string EnumsOutput
|
public static string EnumsOutput
|
||||||
|
@ -66,9 +67,9 @@ namespace Bind
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if ((Compatibility & Legacy.NestedEnums) != Legacy.None)
|
if ((Compatibility & Legacy.NestedEnums) != Legacy.None)
|
||||||
return OutputNamespace + "." + OutputClass + "." + NestedEnumsClass;
|
return OutputNamespace + NamespaceSeparator + OutputClass + NamespaceSeparator + NestedEnumsClass;
|
||||||
else
|
else
|
||||||
return String.IsNullOrEmpty(EnumsNamespace) ? OutputNamespace : OutputNamespace + "." + EnumsNamespace;
|
return String.IsNullOrEmpty(EnumsNamespace) ? OutputNamespace : OutputNamespace + NamespaceSeparator + EnumsNamespace;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,9 +78,9 @@ namespace Bind
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if ((Compatibility & Legacy.NestedEnums) != Legacy.None)
|
if ((Compatibility & Legacy.NestedEnums) != Legacy.None)
|
||||||
return OutputNamespace + "." + GLClass + "." + NestedEnumsClass;
|
return OutputNamespace + NamespaceSeparator + GLClass + NamespaceSeparator + NestedEnumsClass;
|
||||||
else
|
else
|
||||||
return OutputNamespace + "." + EnumsNamespace;
|
return OutputNamespace + NamespaceSeparator + EnumsNamespace;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -265,7 +265,7 @@ namespace Bind.Structures
|
||||||
return "";
|
return "";
|
||||||
return String.Format("{0} = {1}((int){2}{3})",
|
return String.Format("{0} = {1}((int){2}{3})",
|
||||||
Name, Unchecked ? "unchecked" : "",
|
Name, Unchecked ? "unchecked" : "",
|
||||||
!String.IsNullOrEmpty(Reference) ? Reference + "." : "", Value);
|
!String.IsNullOrEmpty(Reference) ? Reference + Settings.NamespaceSeparator : "", Value);
|
||||||
|
|
||||||
//return String.Format("{0} = {1}((int){2})", Name, Unchecked ? "unchecked" : "", Value);
|
//return String.Format("{0} = {1}((int){2})", Name, Unchecked ? "unchecked" : "", Value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -259,7 +259,7 @@ namespace Bind.Structures
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
sb.Append(Settings.DelegatesClass);
|
sb.Append(Settings.DelegatesClass);
|
||||||
sb.Append(".");
|
sb.Append(Settings.NamespaceSeparator);
|
||||||
sb.Append(Settings.FunctionPrefix);
|
sb.Append(Settings.FunctionPrefix);
|
||||||
sb.Append(Name);
|
sb.Append(Name);
|
||||||
sb.Append(Parameters.CallString());
|
sb.Append(Parameters.CallString());
|
||||||
|
|
|
@ -58,7 +58,7 @@ namespace Bind.Structures
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (!String.IsNullOrEmpty(CurrentQualifier))
|
if (!String.IsNullOrEmpty(CurrentQualifier))
|
||||||
return String.Format("{0}.{1}", CurrentQualifier, CurrentType);
|
return String.Format("{0}{1}{2}", CurrentQualifier, Settings.NamespaceSeparator, CurrentType);
|
||||||
else
|
else
|
||||||
return CurrentType;
|
return CurrentType;
|
||||||
}
|
}
|
||||||
|
@ -367,11 +367,13 @@ namespace Bind.Structures
|
||||||
// Better match: enum.Name == function.Category (e.g. GL_VERSION_1_1 etc)
|
// Better match: enum.Name == function.Category (e.g. GL_VERSION_1_1 etc)
|
||||||
if (enums.ContainsKey(category))
|
if (enums.ContainsKey(category))
|
||||||
{
|
{
|
||||||
QualifiedType = String.Format("{0}.{1}", Settings.EnumsOutput, EnumProcessor.TranslateEnumName(category));
|
QualifiedType = String.Format("{0}{1}{2}", Settings.EnumsOutput,
|
||||||
|
Settings.NamespaceSeparator, EnumProcessor.TranslateEnumName(category));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QualifiedType = String.Format("{0}.{1}", Settings.EnumsOutput, Settings.CompleteEnumName);
|
QualifiedType = String.Format("{0}{1}{2}", Settings.EnumsOutput,
|
||||||
|
Settings.NamespaceSeparator, Settings.CompleteEnumName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue