mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-24 02:25:28 +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 ((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
|
||||
d.ReturnType.QualifiedType = "int";
|
||||
}
|
||||
|
|
|
@ -86,6 +86,7 @@ namespace Bind
|
|||
Settings.DefaultOutputPath = "gl";
|
||||
Settings.DefaultOutputNamespace = "OpenTK";
|
||||
Settings.EnumsNamespace = "";
|
||||
Settings.NamespaceSeparator = "::";
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ namespace Bind
|
|||
public static string FunctionPrefix = "gl";
|
||||
public static string ConstantPrefix = "GL_";
|
||||
public static string EnumPrefix = "";
|
||||
public static string NamespaceSeparator = ".";
|
||||
|
||||
public static string ImportsFile = "Core.cs";
|
||||
public static string DelegatesFile = "Delegates.cs";
|
||||
|
@ -51,14 +52,14 @@ namespace Bind
|
|||
{
|
||||
return
|
||||
normalEnumsClassOverride == null ?
|
||||
String.IsNullOrEmpty(NestedEnumsClass) ? OutputClass : OutputClass + "." + NestedEnumsClass :
|
||||
String.IsNullOrEmpty(NestedEnumsClass) ? OutputClass : OutputClass + NamespaceSeparator + NestedEnumsClass :
|
||||
normalEnumsClassOverride;
|
||||
}
|
||||
}
|
||||
|
||||
public static string AuxEnumsClass
|
||||
{
|
||||
get { return GLClass + "." + NestedEnumsClass; }
|
||||
get { return GLClass + NamespaceSeparator + NestedEnumsClass; }
|
||||
}
|
||||
|
||||
public static string EnumsOutput
|
||||
|
@ -66,9 +67,9 @@ namespace Bind
|
|||
get
|
||||
{
|
||||
if ((Compatibility & Legacy.NestedEnums) != Legacy.None)
|
||||
return OutputNamespace + "." + OutputClass + "." + NestedEnumsClass;
|
||||
return OutputNamespace + NamespaceSeparator + OutputClass + NamespaceSeparator + NestedEnumsClass;
|
||||
else
|
||||
return String.IsNullOrEmpty(EnumsNamespace) ? OutputNamespace : OutputNamespace + "." + EnumsNamespace;
|
||||
return String.IsNullOrEmpty(EnumsNamespace) ? OutputNamespace : OutputNamespace + NamespaceSeparator + EnumsNamespace;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,9 +78,9 @@ namespace Bind
|
|||
get
|
||||
{
|
||||
if ((Compatibility & Legacy.NestedEnums) != Legacy.None)
|
||||
return OutputNamespace + "." + GLClass + "." + NestedEnumsClass;
|
||||
return OutputNamespace + NamespaceSeparator + GLClass + NamespaceSeparator + NestedEnumsClass;
|
||||
else
|
||||
return OutputNamespace + "." + EnumsNamespace;
|
||||
return OutputNamespace + NamespaceSeparator + EnumsNamespace;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -265,7 +265,7 @@ namespace Bind.Structures
|
|||
return "";
|
||||
return String.Format("{0} = {1}((int){2}{3})",
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -259,7 +259,7 @@ namespace Bind.Structures
|
|||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.Append(Settings.DelegatesClass);
|
||||
sb.Append(".");
|
||||
sb.Append(Settings.NamespaceSeparator);
|
||||
sb.Append(Settings.FunctionPrefix);
|
||||
sb.Append(Name);
|
||||
sb.Append(Parameters.CallString());
|
||||
|
|
|
@ -58,7 +58,7 @@ namespace Bind.Structures
|
|||
get
|
||||
{
|
||||
if (!String.IsNullOrEmpty(CurrentQualifier))
|
||||
return String.Format("{0}.{1}", CurrentQualifier, CurrentType);
|
||||
return String.Format("{0}{1}{2}", CurrentQualifier, Settings.NamespaceSeparator, CurrentType);
|
||||
else
|
||||
return CurrentType;
|
||||
}
|
||||
|
@ -367,11 +367,13 @@ namespace Bind.Structures
|
|||
// Better match: enum.Name == function.Category (e.g. GL_VERSION_1_1 etc)
|
||||
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
|
||||
{
|
||||
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