mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-24 02:05:29 +00:00
Moved overrides file to Settings class.
This commit is contained in:
parent
c3bfa7dc9a
commit
2dd61c6afd
|
@ -25,7 +25,7 @@ namespace Bind.ES
|
|||
enumSpecExt = String.Empty;
|
||||
glSpec = dirName + "/signatures.xml";
|
||||
glSpecExt = String.Empty;
|
||||
functionOverridesFile = dirName + "/overrides.xml";
|
||||
Settings.OverridesFile = dirName + "/overrides.xml";
|
||||
|
||||
Settings.ImportsFile = "Core.cs";
|
||||
Settings.DelegatesFile = "Delegates.cs";
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace Bind.GL2
|
|||
enumSpecExt = String.Empty;
|
||||
glSpec = "GL2/signatures.xml";
|
||||
glSpecExt = String.Empty;
|
||||
functionOverridesFile = "GL2/gloverrides.xml";
|
||||
Settings.OverridesFile = "GL2/gloverrides.xml";
|
||||
|
||||
Settings.ImportsFile = "GLCore.cs";
|
||||
Settings.DelegatesFile = "GLDelegates.cs";
|
||||
|
|
|
@ -29,8 +29,6 @@ namespace Bind.GL2
|
|||
protected static string glSpec = "GL2/gl.spec";
|
||||
protected static string glSpecExt = "";
|
||||
|
||||
protected static string functionOverridesFile = "GL2/gloverrides.xml";
|
||||
|
||||
protected static string loadAllFuncName = "LoadAll";
|
||||
|
||||
protected static Regex enumToDotNet = new Regex("_[a-z|A-Z]?", RegexOptions.Compiled);
|
||||
|
@ -38,7 +36,7 @@ namespace Bind.GL2
|
|||
protected static readonly char[] numbers = "0123456789".ToCharArray();
|
||||
//protected static readonly Dictionary<string, string> doc_replacements;
|
||||
|
||||
protected ISpecReader SpecReader = new XmlSpecReader(functionOverridesFile);
|
||||
protected ISpecReader SpecReader = new XmlSpecReader();
|
||||
protected ISpecWriter SpecWriter = new CSharpSpecWriter();
|
||||
|
||||
#endregion
|
||||
|
@ -69,19 +67,20 @@ namespace Bind.GL2
|
|||
|
||||
public virtual void Process()
|
||||
{
|
||||
var overrides = new XPathDocument(Path.Combine(Settings.InputPath, functionOverridesFile));
|
||||
var overrides = new XPathDocument(Path.Combine(Settings.InputPath, Settings.OverridesFile));
|
||||
|
||||
using (StreamReader sr = Utilities.OpenSpecFile(Settings.InputPath, glTypemap))
|
||||
{
|
||||
Type.GLTypes = SpecReader.ReadTypeMap(sr);
|
||||
}
|
||||
using (StreamReader sr = Utilities.OpenSpecFile(Settings.InputPath, csTypemap))
|
||||
{
|
||||
Type.CSTypes = SpecReader.ReadCSTypeMap(sr);
|
||||
}
|
||||
|
||||
var enums = SpecReader.ReadEnums(new StreamReader(Path.Combine(Settings.InputPath, enumSpec)));
|
||||
var delegates = SpecReader.ReadDelegates(new StreamReader(Path.Combine(Settings.InputPath, glSpec)));
|
||||
EnumCollection enums;
|
||||
using (var sr = new StreamReader(Path.Combine(Settings.InputPath, enumSpec)))
|
||||
enums = SpecReader.ReadEnums(sr);
|
||||
|
||||
DelegateCollection delegates;
|
||||
using (var sr = new StreamReader(Path.Combine(Settings.InputPath, glSpec)))
|
||||
delegates = SpecReader.ReadDelegates(sr);
|
||||
|
||||
enums = new EnumProcessor(overrides).Process(enums);
|
||||
var wrappers = new FuncProcessor(overrides).Process(delegates, enums);
|
||||
|
|
|
@ -26,6 +26,7 @@ namespace Bind
|
|||
public static string DocPath = DefaultDocPath;
|
||||
public static string DocFile = DefaultDocFile;
|
||||
public static string LicenseFile = DefaultLicenseFile;
|
||||
public static string OverridesFile = "GL2/gloverrides.xml";
|
||||
|
||||
public static string GLClass = "GL"; // Needed by Glu for the AuxEnumsClass. Can be set through -gl:"xxx".
|
||||
public static string OutputClass = "GL"; // The real output class. Can be set through -class:"xxx".
|
||||
|
|
|
@ -40,19 +40,12 @@ namespace Bind
|
|||
|
||||
class XmlSpecReader : ISpecReader
|
||||
{
|
||||
readonly string functionOverridesFile;
|
||||
|
||||
public XmlSpecReader(string functionOverridesFile)
|
||||
{
|
||||
this.functionOverridesFile = functionOverridesFile;
|
||||
}
|
||||
|
||||
public DelegateCollection ReadDelegates(StreamReader specFile)
|
||||
{
|
||||
DelegateCollection delegates = new DelegateCollection();
|
||||
XPathDocument specs = new XPathDocument(specFile);
|
||||
XPathDocument overrides = new XPathDocument(new StreamReader(
|
||||
Path.Combine(Settings.InputPath, functionOverridesFile)));
|
||||
Path.Combine(Settings.InputPath, Settings.OverridesFile)));
|
||||
|
||||
foreach (XPathNavigator nav in new XPathNavigator[] {
|
||||
specs.CreateNavigator().SelectSingleNode("/signatures"),
|
||||
|
@ -208,7 +201,8 @@ namespace Bind
|
|||
EnumCollection enums = new EnumCollection();
|
||||
Enum all = new Enum() { Name = Settings.CompleteEnumName };
|
||||
XPathDocument specs = new XPathDocument(specFile);
|
||||
XPathDocument overrides = new XPathDocument(new StreamReader(Path.Combine(Settings.InputPath, functionOverridesFile)));
|
||||
XPathDocument overrides = new XPathDocument(new StreamReader(
|
||||
Path.Combine(Settings.InputPath, Settings.OverridesFile)));
|
||||
|
||||
foreach (XPathNavigator nav in new XPathNavigator[] {
|
||||
specs.CreateNavigator().SelectSingleNode("/signatures"),
|
||||
|
|
Loading…
Reference in a new issue