1
0
mirror of synced 2024-11-30 18:24:39 +01:00
This commit is contained in:
KillzXGaming 2018-11-11 20:01:21 -05:00
parent 6fb4da17b3
commit dbb73d165e
79 changed files with 7571 additions and 0 deletions

15
Switch_Toolbox/App.config Normal file
View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="lib" />
<dependentAssembly>
<assemblyIdentity name="OpenTK" publicKeyToken="bad199fe84eb3df4" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

BIN
Switch_Toolbox/Assimp32.dll Normal file

Binary file not shown.

BIN
Switch_Toolbox/Assimp64.dll Normal file

Binary file not shown.

125
Switch_Toolbox/Config.cs Normal file
View File

@ -0,0 +1,125 @@
using System;
using System.Collections.Generic;
using System.Xml;
using System.Drawing;
using System.IO;
using Switch_Toolbox.Library;
namespace Switch_Toolbox
{
//Based on
// https://github.com/jam1garner/Smash-Forge/blob/26e0dcbd84cdf8a4ffe3fbe0b0317520a4099286/Smash%20Forge/Filetypes/Application/Config.cs
class Config
{
public static void StartupFromFile(string fileName)
{
if (!File.Exists(fileName))
{
Save();
return;
}
ReadConfigFromFile(fileName);
}
private static void ReadConfigFromFile(string fileName)
{
int discordImageKey;
XmlDocument doc = new XmlDocument();
doc.Load(fileName);
Queue<XmlNode> que = new Queue<XmlNode>();
foreach (XmlNode node in doc.ChildNodes)
que.Enqueue(node);
while (que.Count > 0)
{
XmlNode node = que.Dequeue();
foreach (XmlNode n in node.ChildNodes)
que.Enqueue(n);
switch (node.Name)
{
case "OpenStartupWindow":
bool.TryParse(node.InnerText, out Runtime.OpenStartupWindow);
break;
case "RenderModels":
bool.TryParse(node.InnerText, out Runtime.RenderModels);
break;
case "RenderModelSelection":
bool.TryParse(node.InnerText, out Runtime.RenderModelSelection);
break;
case "RenderModelWireframe":
bool.TryParse(node.InnerText, out Runtime.RenderModelWireframe);
break;
case "viewportShading":
if (node.ParentNode != null && node.ParentNode.Name.Equals("RENDERSETTINGS"))
Enum.TryParse(node.InnerText, out Runtime.viewportShading);
break;
case "thumbnailSize":
if (node.ParentNode != null && node.ParentNode.Name.Equals("OBJLISTSETTINGS"))
Enum.TryParse(node.InnerText, out Runtime.thumbnailSize);
break;
case "stereoscopy": bool.TryParse(node.InnerText, out Runtime.stereoscopy);
break;
case "CameraFar":
float.TryParse(node.InnerText, out Runtime.CameraFar);
break;
case "CameraNear":
float.TryParse(node.InnerText, out Runtime.CameraNear);
break;
case "PreviewScale":
float.TryParse(node.InnerText, out Runtime.previewScale);
break;
}
}
}
public static void Save()
{
XmlDocument doc = CreateXmlFromSettings();
doc.Save(MainForm.executableDir + "\\config.xml");
}
private static XmlDocument CreateXmlFromSettings()
{
XmlDocument doc = new XmlDocument();
XmlNode mainNode = doc.CreateElement("FORGECONFIG");
doc.AppendChild(mainNode);
AppendMainFormSettings(doc, mainNode);
AppendObjectlistSettings(doc, mainNode);
AppendRenderSettings(doc, mainNode);
return doc;
}
private static void AppendMainFormSettings(XmlDocument doc, XmlNode parentNode)
{
XmlNode mainSettingsNode = doc.CreateElement("MAINFORM");
parentNode.AppendChild(mainSettingsNode);
mainSettingsNode.AppendChild(createNode(doc, "OpenStartupWindow", Runtime.OpenStartupWindow.ToString()));
}
private static void AppendObjectlistSettings(XmlDocument doc, XmlNode parentNode)
{
XmlNode objlistSettingsNode = doc.CreateElement("OBJLISTSETTINGS");
parentNode.AppendChild(objlistSettingsNode);
objlistSettingsNode.AppendChild(createNode(doc, "thumbnailSize", Runtime.thumbnailSize.ToString()));
}
private static void AppendRenderSettings(XmlDocument doc, XmlNode parentNode)
{
XmlNode renderSettingsNode = doc.CreateElement("RENDERSETTINGS");
parentNode.AppendChild(renderSettingsNode);
renderSettingsNode.AppendChild(createNode(doc, "viewportShading", Runtime.viewportShading.ToString()));
renderSettingsNode.AppendChild(createNode(doc, "stereoscopy", Runtime.stereoscopy.ToString()));
renderSettingsNode.AppendChild(createNode(doc, "CameraFar", Runtime.CameraFar.ToString()));
renderSettingsNode.AppendChild(createNode(doc, "CameraNear", Runtime.CameraNear.ToString()));
renderSettingsNode.AppendChild(createNode(doc, "PreviewScale", Runtime.previewScale.ToString()));
}
public static XmlNode createNode(XmlDocument doc, string el, string v)
{
XmlNode floorstyle = doc.CreateElement(el);
floorstyle.InnerText = v;
return floorstyle;
}
}
}

View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8" ?>
<Weavers>
</Weavers>

120
Switch_Toolbox/GUI/Credits.Designer.cs generated Normal file
View File

@ -0,0 +1,120 @@
namespace Switch_Toolbox
{
partial class CreditsWindow
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CreditsWindow));
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(12, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(42, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Credits!";
//
// label2
//
this.label2.AutoSize = true;
this.label2.ForeColor = System.Drawing.Color.White;
this.label2.Location = new System.Drawing.Point(12, 36);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(149, 13);
this.label2.TabIndex = 1;
this.label2.Text = "Main Developer: KillzXGaming";
this.label2.Click += new System.EventHandler(this.label2_Click);
//
// label3
//
this.label3.AutoSize = true;
this.label3.ForeColor = System.Drawing.Color.White;
this.label3.Location = new System.Drawing.Point(12, 76);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(169, 13);
this.label3.TabIndex = 2;
this.label3.Text = "Special Thanks and Contributions:";
this.label3.Click += new System.EventHandler(this.label3_Click);
//
// richTextBox1
//
this.richTextBox1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50)))));
this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.richTextBox1.ForeColor = System.Drawing.Color.White;
this.richTextBox1.Location = new System.Drawing.Point(15, 107);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(414, 311);
this.richTextBox1.TabIndex = 4;
this.richTextBox1.Text = resources.GetString("richTextBox1.Text");
//
// pictureBox1
//
this.pictureBox1.Image = global::Switch_Toolbox.Properties.Resources.Logo;
this.pictureBox1.Location = new System.Drawing.Point(327, 12);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(108, 89);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox1.TabIndex = 5;
this.pictureBox1.TabStop = false;
//
// CreditsWindow
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45)))));
this.ClientSize = new System.Drawing.Size(447, 430);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.richTextBox1);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Name = "CreditsWindow";
this.Text = "Credits";
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.PictureBox pictureBox1;
}
}

View File

@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Switch_Toolbox
{
public partial class CreditsWindow : Form
{
public CreditsWindow()
{
InitializeComponent();
}
private void label2_Click(object sender, EventArgs e)
{
}
private void label4_Click(object sender, EventArgs e)
{
}
private void label3_Click(object sender, EventArgs e)
{
}
}
}

View File

@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="richTextBox1.Text" xml:space="preserve">
<value>- Smash Forge Devs (SMG, Ploaj, jam1garner, smb123w64gb, etc) for some code ported over. Specifically animation stuff and some rendering.
- Assimp devs for their massive asset library!
- Wexos (helped figure out a few things, ie format list to assign each attribute)
- JuPaHe64 for the base 3D renderer.
- Every File Explorer devs (Gericom) for Yaz0 stuff
- Exelix for Byaml, Sarc and KCL library
- Syroot for helpful IO extensions and libraies
- GDK Chan for some DDS decode methods
- AboodXD for BNTX texture swizzling
- MelonSpeedruns for logo.</value>
</data>
</root>

View File

@ -0,0 +1,90 @@
namespace Switch_Toolbox
{
partial class PluginManager
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.listView1 = new System.Windows.Forms.ListView();
this.Plugin = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.Version = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.SuspendLayout();
//
// listView1
//
this.listView1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.listView1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.Plugin,
this.Version});
this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.listView1.ForeColor = System.Drawing.Color.White;
this.listView1.Location = new System.Drawing.Point(0, 0);
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(292, 356);
this.listView1.TabIndex = 0;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.View = System.Windows.Forms.View.List;
//
// Plugin
//
this.Plugin.Text = "Plugin";
this.Plugin.Width = 113;
//
// Version
//
this.Version.Text = "Version";
this.Version.Width = 175;
//
// imageList1
//
this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
//
// PluginManager
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.ClientSize = new System.Drawing.Size(292, 356);
this.Controls.Add(this.listView1);
this.Name = "PluginManager";
this.Text = "PluginManager";
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.ColumnHeader Plugin;
private System.Windows.Forms.ColumnHeader Version;
private System.Windows.Forms.ImageList imageList1;
}
}

View File

@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Switch_Toolbox.Library;
namespace Switch_Toolbox
{
public partial class PluginManager : Form
{
public PluginManager()
{
InitializeComponent();
imageList1.Images.Add("DLL", System.Drawing.SystemIcons.Question.ToBitmap());
imageList1.ImageSize = new Size(24, 24);
listView1.FullRowSelect = true;
listView1.SmallImageList = imageList1;
foreach (var plugin in GenericPluginLoader._Plugins)
{
ListViewItem item = new ListViewItem();
item.Text = plugin.Key;
item.ImageKey = "DLL";
item.SubItems.Add(plugin.Value.Version);
listView1.Items.Add(item);
}
}
}
}

View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="imageList1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

408
Switch_Toolbox/GUI/Settings.Designer.cs generated Normal file
View File

@ -0,0 +1,408 @@
namespace Switch_Toolbox
{
partial class Settings
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.chkBoxSpecular = new System.Windows.Forms.CheckBox();
this.chkBoxNormalMap = new System.Windows.Forms.CheckBox();
this.shadingComboBox = new System.Windows.Forms.ComboBox();
this.panel2 = new System.Windows.Forms.Panel();
this.chkBoxDisplayPolyCount = new System.Windows.Forms.CheckBox();
this.label5 = new System.Windows.Forms.Label();
this.camFarNumUD = new System.Windows.Forms.NumericUpDown();
this.label4 = new System.Windows.Forms.Label();
this.camNearNumUD = new System.Windows.Forms.NumericUpDown();
this.label3 = new System.Windows.Forms.Label();
this.camMoveComboBox = new System.Windows.Forms.ComboBox();
this.chkBoxDisplayBones = new System.Windows.Forms.CheckBox();
this.chkBoxDisplayWireframe = new System.Windows.Forms.CheckBox();
this.chkBoxDisplayModels = new System.Windows.Forms.CheckBox();
this.chkBoxStereoscopy = new System.Windows.Forms.CheckBox();
this.label2 = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
this.GLSLVerLabel = new System.Windows.Forms.Label();
this.openGLVerLabel = new System.Windows.Forms.Label();
this.btnSave = new System.Windows.Forms.Button();
this.label6 = new System.Windows.Forms.Label();
this.previewScaleUD = new System.Windows.Forms.NumericUpDown();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.camFarNumUD)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.camNearNumUD)).BeginInit();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.previewScaleUD)).BeginInit();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(255, 55);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(90, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Viewport Shading";
//
// chkBoxSpecular
//
this.chkBoxSpecular.AutoSize = true;
this.chkBoxSpecular.ForeColor = System.Drawing.Color.White;
this.chkBoxSpecular.Location = new System.Drawing.Point(258, 116);
this.chkBoxSpecular.Name = "chkBoxSpecular";
this.chkBoxSpecular.Size = new System.Drawing.Size(104, 17);
this.chkBoxSpecular.TabIndex = 3;
this.chkBoxSpecular.Text = "Enable Specular";
this.chkBoxSpecular.UseVisualStyleBackColor = true;
//
// chkBoxNormalMap
//
this.chkBoxNormalMap.AutoSize = true;
this.chkBoxNormalMap.ForeColor = System.Drawing.Color.White;
this.chkBoxNormalMap.Location = new System.Drawing.Point(258, 93);
this.chkBoxNormalMap.Name = "chkBoxNormalMap";
this.chkBoxNormalMap.Size = new System.Drawing.Size(124, 17);
this.chkBoxNormalMap.TabIndex = 2;
this.chkBoxNormalMap.Text = "Enable Normal Maps";
this.chkBoxNormalMap.UseVisualStyleBackColor = true;
this.chkBoxNormalMap.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
//
// shadingComboBox
//
this.shadingComboBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.shadingComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.shadingComboBox.ForeColor = System.Drawing.Color.White;
this.shadingComboBox.FormattingEnabled = true;
this.shadingComboBox.Location = new System.Drawing.Point(351, 52);
this.shadingComboBox.Name = "shadingComboBox";
this.shadingComboBox.Size = new System.Drawing.Size(165, 21);
this.shadingComboBox.TabIndex = 1;
this.shadingComboBox.SelectedIndexChanged += new System.EventHandler(this.shadingComboBox_SelectedIndexChanged);
//
// panel2
//
this.panel2.Controls.Add(this.label6);
this.panel2.Controls.Add(this.previewScaleUD);
this.panel2.Controls.Add(this.chkBoxDisplayPolyCount);
this.panel2.Controls.Add(this.label5);
this.panel2.Controls.Add(this.camFarNumUD);
this.panel2.Controls.Add(this.label4);
this.panel2.Controls.Add(this.camNearNumUD);
this.panel2.Controls.Add(this.label3);
this.panel2.Controls.Add(this.chkBoxSpecular);
this.panel2.Controls.Add(this.camMoveComboBox);
this.panel2.Controls.Add(this.chkBoxNormalMap);
this.panel2.Controls.Add(this.chkBoxDisplayBones);
this.panel2.Controls.Add(this.shadingComboBox);
this.panel2.Controls.Add(this.chkBoxDisplayWireframe);
this.panel2.Controls.Add(this.label1);
this.panel2.Controls.Add(this.chkBoxDisplayModels);
this.panel2.Controls.Add(this.chkBoxStereoscopy);
this.panel2.Controls.Add(this.label2);
this.panel2.Location = new System.Drawing.Point(12, 156);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(534, 246);
this.panel2.TabIndex = 4;
//
// chkBoxDisplayPolyCount
//
this.chkBoxDisplayPolyCount.AutoSize = true;
this.chkBoxDisplayPolyCount.ForeColor = System.Drawing.Color.White;
this.chkBoxDisplayPolyCount.Location = new System.Drawing.Point(120, 162);
this.chkBoxDisplayPolyCount.Name = "chkBoxDisplayPolyCount";
this.chkBoxDisplayPolyCount.Size = new System.Drawing.Size(114, 17);
this.chkBoxDisplayPolyCount.TabIndex = 13;
this.chkBoxDisplayPolyCount.Text = "Display Poly Count";
this.chkBoxDisplayPolyCount.UseVisualStyleBackColor = true;
this.chkBoxDisplayPolyCount.CheckedChanged += new System.EventHandler(this.chkBoxDisplayPolyCount_CheckedChanged);
//
// label5
//
this.label5.AutoSize = true;
this.label5.ForeColor = System.Drawing.Color.White;
this.label5.Location = new System.Drawing.Point(10, 222);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(61, 13);
this.label5.TabIndex = 12;
this.label5.Text = "Camera Far";
//
// camFarNumUD
//
this.camFarNumUD.DecimalPlaces = 3;
this.camFarNumUD.Location = new System.Drawing.Point(110, 220);
this.camFarNumUD.Maximum = new decimal(new int[] {
1316134912,
2328,
0,
0});
this.camFarNumUD.Name = "camFarNumUD";
this.camFarNumUD.Size = new System.Drawing.Size(171, 20);
this.camFarNumUD.TabIndex = 11;
this.camFarNumUD.ValueChanged += new System.EventHandler(this.camFarNumUD_ValueChanged);
//
// label4
//
this.label4.AutoSize = true;
this.label4.ForeColor = System.Drawing.Color.White;
this.label4.Location = new System.Drawing.Point(10, 196);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(69, 13);
this.label4.TabIndex = 10;
this.label4.Text = "Camera Near";
//
// camNearNumUD
//
this.camNearNumUD.DecimalPlaces = 3;
this.camNearNumUD.Increment = new decimal(new int[] {
5,
0,
0,
131072});
this.camNearNumUD.Location = new System.Drawing.Point(110, 194);
this.camNearNumUD.Maximum = new decimal(new int[] {
1,
0,
0,
0});
this.camNearNumUD.Minimum = new decimal(new int[] {
1,
0,
0,
65536});
this.camNearNumUD.Name = "camNearNumUD";
this.camNearNumUD.Size = new System.Drawing.Size(171, 20);
this.camNearNumUD.TabIndex = 9;
this.camNearNumUD.Value = new decimal(new int[] {
1,
0,
0,
65536});
this.camNearNumUD.ValueChanged += new System.EventHandler(this.camNearNumUD_ValueChanged);
//
// label3
//
this.label3.AutoSize = true;
this.label3.ForeColor = System.Drawing.Color.White;
this.label3.Location = new System.Drawing.Point(3, 55);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(43, 13);
this.label3.TabIndex = 8;
this.label3.Text = "Camera";
//
// camMoveComboBox
//
this.camMoveComboBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.camMoveComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.camMoveComboBox.ForeColor = System.Drawing.Color.White;
this.camMoveComboBox.FormattingEnabled = true;
this.camMoveComboBox.Location = new System.Drawing.Point(59, 52);
this.camMoveComboBox.Name = "camMoveComboBox";
this.camMoveComboBox.Size = new System.Drawing.Size(156, 21);
this.camMoveComboBox.TabIndex = 4;
this.camMoveComboBox.SelectedIndexChanged += new System.EventHandler(this.camMoveComboBox_SelectedIndexChanged);
//
// chkBoxDisplayBones
//
this.chkBoxDisplayBones.AutoSize = true;
this.chkBoxDisplayBones.ForeColor = System.Drawing.Color.White;
this.chkBoxDisplayBones.Location = new System.Drawing.Point(6, 162);
this.chkBoxDisplayBones.Name = "chkBoxDisplayBones";
this.chkBoxDisplayBones.Size = new System.Drawing.Size(93, 17);
this.chkBoxDisplayBones.TabIndex = 7;
this.chkBoxDisplayBones.Text = "Display Bones";
this.chkBoxDisplayBones.UseVisualStyleBackColor = true;
//
// chkBoxDisplayWireframe
//
this.chkBoxDisplayWireframe.AutoSize = true;
this.chkBoxDisplayWireframe.ForeColor = System.Drawing.Color.White;
this.chkBoxDisplayWireframe.Location = new System.Drawing.Point(6, 139);
this.chkBoxDisplayWireframe.Name = "chkBoxDisplayWireframe";
this.chkBoxDisplayWireframe.Size = new System.Drawing.Size(111, 17);
this.chkBoxDisplayWireframe.TabIndex = 6;
this.chkBoxDisplayWireframe.Text = "Display Wireframe";
this.chkBoxDisplayWireframe.UseVisualStyleBackColor = true;
this.chkBoxDisplayWireframe.CheckedChanged += new System.EventHandler(this.chkBoxDisplayWireframe_CheckedChanged);
//
// chkBoxDisplayModels
//
this.chkBoxDisplayModels.AutoSize = true;
this.chkBoxDisplayModels.ForeColor = System.Drawing.Color.White;
this.chkBoxDisplayModels.Location = new System.Drawing.Point(6, 116);
this.chkBoxDisplayModels.Name = "chkBoxDisplayModels";
this.chkBoxDisplayModels.Size = new System.Drawing.Size(97, 17);
this.chkBoxDisplayModels.TabIndex = 5;
this.chkBoxDisplayModels.Text = "Display Models";
this.chkBoxDisplayModels.UseVisualStyleBackColor = true;
this.chkBoxDisplayModels.CheckedChanged += new System.EventHandler(this.chkBoxDisplayModels_CheckedChanged);
//
// chkBoxStereoscopy
//
this.chkBoxStereoscopy.AutoSize = true;
this.chkBoxStereoscopy.ForeColor = System.Drawing.Color.White;
this.chkBoxStereoscopy.Location = new System.Drawing.Point(6, 93);
this.chkBoxStereoscopy.Name = "chkBoxStereoscopy";
this.chkBoxStereoscopy.Size = new System.Drawing.Size(121, 17);
this.chkBoxStereoscopy.TabIndex = 4;
this.chkBoxStereoscopy.Text = "Enable Stereoscopy";
this.chkBoxStereoscopy.UseVisualStyleBackColor = true;
this.chkBoxStereoscopy.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged_1);
//
// label2
//
this.label2.AutoSize = true;
this.label2.ForeColor = System.Drawing.Color.White;
this.label2.Location = new System.Drawing.Point(56, 21);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(89, 13);
this.label2.TabIndex = 4;
this.label2.Text = "Viewport Settings";
//
// panel1
//
this.panel1.Controls.Add(this.GLSLVerLabel);
this.panel1.Controls.Add(this.openGLVerLabel);
this.panel1.Location = new System.Drawing.Point(12, 13);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(534, 137);
this.panel1.TabIndex = 5;
//
// GLSLVerLabel
//
this.GLSLVerLabel.AutoSize = true;
this.GLSLVerLabel.ForeColor = System.Drawing.Color.White;
this.GLSLVerLabel.Location = new System.Drawing.Point(3, 38);
this.GLSLVerLabel.Name = "GLSLVerLabel";
this.GLSLVerLabel.Size = new System.Drawing.Size(72, 13);
this.GLSLVerLabel.TabIndex = 10;
this.GLSLVerLabel.Text = "GLSL Version";
//
// openGLVerLabel
//
this.openGLVerLabel.AutoSize = true;
this.openGLVerLabel.ForeColor = System.Drawing.Color.White;
this.openGLVerLabel.Location = new System.Drawing.Point(3, 13);
this.openGLVerLabel.Name = "openGLVerLabel";
this.openGLVerLabel.Size = new System.Drawing.Size(91, 13);
this.openGLVerLabel.TabIndex = 9;
this.openGLVerLabel.Text = "Open GL Version:";
//
// btnSave
//
this.btnSave.Location = new System.Drawing.Point(397, 408);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(149, 23);
this.btnSave.TabIndex = 6;
this.btnSave.Text = "Save";
this.btnSave.UseVisualStyleBackColor = true;
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// label6
//
this.label6.AutoSize = true;
this.label6.ForeColor = System.Drawing.Color.White;
this.label6.Location = new System.Drawing.Point(285, 196);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(75, 13);
this.label6.TabIndex = 15;
this.label6.Text = "Preview Scale";
//
// previewScaleUD
//
this.previewScaleUD.DecimalPlaces = 3;
this.previewScaleUD.Increment = new decimal(new int[] {
1,
0,
0,
131072});
this.previewScaleUD.Location = new System.Drawing.Point(363, 194);
this.previewScaleUD.Minimum = new decimal(new int[] {
1,
0,
0,
131072});
this.previewScaleUD.Name = "previewScaleUD";
this.previewScaleUD.Size = new System.Drawing.Size(171, 20);
this.previewScaleUD.TabIndex = 14;
this.previewScaleUD.Value = new decimal(new int[] {
1,
0,
0,
65536});
this.previewScaleUD.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged);
//
// Settings
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.ClientSize = new System.Drawing.Size(551, 443);
this.Controls.Add(this.btnSave);
this.Controls.Add(this.panel1);
this.Controls.Add(this.panel2);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "Settings";
this.Text = "Settings";
this.Load += new System.EventHandler(this.Settings_Load);
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.camFarNumUD)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.camNearNumUD)).EndInit();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.previewScaleUD)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.CheckBox chkBoxSpecular;
private System.Windows.Forms.CheckBox chkBoxNormalMap;
private System.Windows.Forms.ComboBox shadingComboBox;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.CheckBox chkBoxStereoscopy;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.CheckBox chkBoxDisplayBones;
private System.Windows.Forms.CheckBox chkBoxDisplayWireframe;
private System.Windows.Forms.CheckBox chkBoxDisplayModels;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ComboBox camMoveComboBox;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label openGLVerLabel;
private System.Windows.Forms.Label GLSLVerLabel;
private System.Windows.Forms.Button btnSave;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.NumericUpDown camFarNumUD;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.NumericUpDown camNearNumUD;
private System.Windows.Forms.CheckBox chkBoxDisplayPolyCount;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.NumericUpDown previewScaleUD;
}
}

View File

@ -0,0 +1,131 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Switch_Toolbox.Library;
using WeifenLuo.WinFormsUI.Docking;
using GL_Core;
using GL_Core.Public_Interfaces;
using GL_Core.Cameras;
namespace Switch_Toolbox
{
public partial class Settings : Form
{
MainForm mainForm;
public Settings(MainForm main)
{
mainForm = main;
InitializeComponent();
foreach (Runtime.ViewportShading shading in Enum.GetValues(typeof(Runtime.ViewportShading)))
{
shadingComboBox.Items.Add(shading.ToString());
}
foreach (Runtime.CameraMovement shading in Enum.GetValues(typeof(Runtime.CameraMovement)))
{
camMoveComboBox.Items.Add(shading.ToString());
}
chkBoxNormalMap.Checked = Runtime.useNormalMap;
chkBoxDisplayModels.Checked = Runtime.RenderModels;
chkBoxDisplayWireframe.Checked = Runtime.RenderModelWireframe;
chkBoxSpecular.Checked = Runtime.renderSpecular;
chkBoxStereoscopy.Checked = Runtime.stereoscopy;
chkBoxDisplayPolyCount.Checked = Runtime.DisplayPolyCount;
camNearNumUD.Value = (decimal)Runtime.CameraNear;
camFarNumUD.Value = (decimal)Runtime.CameraFar;
previewScaleUD.Value = (decimal)Runtime.previewScale;
GLSLVerLabel.Text = $"Open GL Version: {Runtime.GLSLVersion}";
openGLVerLabel.Text = $"GLSL Version: {Runtime.openGLVersion}";
shadingComboBox.SelectedIndex = (int)Runtime.viewportShading;
camMoveComboBox.SelectedIndex = (int)Runtime.cameraMovement;
}
private void shadingComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
Runtime.viewportShading = (Runtime.ViewportShading)shadingComboBox.SelectedIndex;
Viewport.Instance.UpdateViewport();
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
Runtime.useNormalMap = chkBoxNormalMap.Checked;
Viewport.Instance.UpdateViewport();
}
private void chkBoxDisplayModels_CheckedChanged(object sender, EventArgs e)
{
Runtime.RenderModels = chkBoxDisplayModels.Checked;
Viewport.Instance.UpdateViewport();
}
private void chkBoxDisplayWireframe_CheckedChanged(object sender, EventArgs e)
{
Runtime.RenderModelWireframe = chkBoxDisplayWireframe.Checked;
Viewport.Instance.LoadViewportRuntimeValues();
Viewport.Instance.UpdateViewport();
}
private void camMoveComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
Runtime.cameraMovement = (Runtime.CameraMovement)camMoveComboBox.SelectedIndex;
Viewport.Instance.LoadViewportRuntimeValues();
Viewport.Instance.UpdateViewport();
}
private void checkBox1_CheckedChanged_1(object sender, EventArgs e)
{
Runtime.stereoscopy = chkBoxStereoscopy.Checked;
Viewport.Instance.LoadViewportRuntimeValues();
Viewport.Instance.UpdateViewport();
}
private void camNearNumUD_ValueChanged(object sender, EventArgs e)
{
Runtime.CameraNear = (float)camNearNumUD.Value;
Viewport.Instance.LoadViewportRuntimeValues();
Viewport.Instance.UpdateViewport();
}
private void camFarNumUD_ValueChanged(object sender, EventArgs e)
{
Runtime.CameraFar = (float)camFarNumUD.Value;
Viewport.Instance.LoadViewportRuntimeValues();
Viewport.Instance.UpdateViewport();
}
private void btnSave_Click(object sender, EventArgs e)
{
Viewport.Instance.UpdateViewport();
Config.Save();
this.Close();
}
private void chkBoxDisplayPolyCount_CheckedChanged(object sender, EventArgs e)
{
Runtime.DisplayPolyCount = chkBoxDisplayPolyCount.Checked;
}
private void Settings_Load(object sender, EventArgs e)
{
}
private void numericUpDown1_ValueChanged(object sender, EventArgs e)
{
Runtime.previewScale = (float)previewScaleUD.Value;
Viewport.Instance.LoadViewportRuntimeValues();
Viewport.Instance.UpdateViewport();
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,141 @@
namespace Switch_Toolbox
{
partial class Startup_Window
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.listView1 = new System.Windows.Forms.ListView();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// checkBox1
//
this.checkBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.checkBox1.AutoSize = true;
this.checkBox1.Location = new System.Drawing.Point(12, 364);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(127, 17);
this.checkBox1.TabIndex = 0;
this.checkBox1.Text = "Don\'t show this again";
this.checkBox1.UseVisualStyleBackColor = true;
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
//
// richTextBox1
//
this.richTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.richTextBox1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(55)))), ((int)(((byte)(55)))), ((int)(((byte)(55)))));
this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.richTextBox1.ForeColor = System.Drawing.Color.White;
this.richTextBox1.Location = new System.Drawing.Point(12, 25);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.ReadOnly = true;
this.richTextBox1.Size = new System.Drawing.Size(590, 86);
this.richTextBox1.TabIndex = 1;
this.richTextBox1.Text = "";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(13, 6);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(59, 13);
this.label1.TabIndex = 2;
this.label1.Text = "Useful tips!";
//
// label2
//
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(9, 123);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(137, 13);
this.label2.TabIndex = 3;
this.label2.Text = "Recent (Not Working ATM)";
//
// listView1
//
this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listView1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(55)))), ((int)(((byte)(55)))), ((int)(((byte)(55)))));
this.listView1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.listView1.ForeColor = System.Drawing.Color.White;
this.listView1.Location = new System.Drawing.Point(12, 140);
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(694, 218);
this.listView1.TabIndex = 4;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.listView1_MouseClick);
//
// pictureBox1
//
this.pictureBox1.Image = global::Switch_Toolbox.Properties.Resources.Logo;
this.pictureBox1.Location = new System.Drawing.Point(608, 25);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(98, 86);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox1.TabIndex = 5;
this.pictureBox1.TabStop = false;
//
// Startup_Window
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.ClientSize = new System.Drawing.Size(718, 393);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.listView1);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.richTextBox1);
this.Controls.Add(this.checkBox1);
this.ForeColor = System.Drawing.Color.White;
this.Name = "Startup_Window";
this.Text = "Startup";
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.PictureBox pictureBox1;
}
}

View File

@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Switch_Toolbox.Library;
namespace Switch_Toolbox
{
public partial class Startup_Window : Form
{
public Startup_Window()
{
InitializeComponent();
CreateTipList();
richTextBox1.Text = GetRandomTip();
}
List<string> Tips = new List<string>();
private void CreateTipList()
{
Tips.Add("You can view every model and texture in a .bea file by right clicking it in the tree and clicking ''Preview''.");
Tips.Add("Bfres materials have an option to be copied when right clicked on. Use this to easily transfer new materials!");
Tips.Add("Most sections in a bfres can be exported and replaced!");
Tips.Add("For MK8D and Splatoon 2, in the material editor, if the gsys_pass in render info is set to seal on an object ontop of another, you can prevent z fighting!");
}
private string GetRandomTip()
{
var shuffledTips = Tips.OrderBy(a => Guid.NewGuid()).ToList();
return shuffledTips[0];
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
Runtime.OpenStartupWindow = !checkBox1.Checked;
Config.Save();
}
private void listView1_MouseClick(object sender, MouseEventArgs e)
{
if (listView1.SelectedItems.Count > 0)
{
string fileName = listView1.SelectedItems[0].Text;
Close();
}
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,78 @@
Open Asset Import Library (assimp)
Copyright (c) 2006-2016, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
following conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* Neither the name of the assimp team, nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************************************************************
AN EXCEPTION applies to all files in the ./test/models-nonbsd folder.
These are 3d models for testing purposes, from various free sources
on the internet. They are - unless otherwise stated - copyright of
their respective creators, which may impose additional requirements
on the use of their work. For any of these models, see
<model-name>.source.txt for more legal information. Contact us if you
are a copyright holder and believe that we credited you inproperly or
if you don't want your files to appear in the repository.
******************************************************************************
Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors
http://code.google.com/p/poly2tri/
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of Poly2Tri nor the names of its contributors may be
used to endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018 SMG
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2016 jam1garner
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,30 @@
BSD License
For ZstdNet software
Copyright (c) 2016-2018, SKB Kontur. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name SKB Kontur nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@
Note if you hae an issue with your libray being in this repo please contact me and i will remove it!.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="OpenTK" publicKeyToken="bad199fe84eb3df4" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" /></startup></configuration>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

377
Switch_Toolbox/MainForm.Designer.cs generated Normal file
View File

@ -0,0 +1,377 @@
namespace Switch_Toolbox
{
partial class MainForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.panel1 = new System.Windows.Forms.Panel();
this.menuStrip1 = new Switch_Toolbox.Library.Forms.ContextMenuStripDark();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.recentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportShaderErrorsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveConfigToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.clearWorkspaceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.windowsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.compressionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.yaz0ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.yaz0DecompressToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.yaz0CompressToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.gzipToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.gzipCompressToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.gzipDecompressToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.pluginsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.experimentalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.showObjectlistToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.dockPanel1 = new Switch_Toolbox.Library.Forms.DockPanelCustom();
this.panel1.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.Controls.Add(this.menuStrip1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(779, 38);
this.panel1.TabIndex = 0;
//
// menuStrip1
//
this.menuStrip1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(35)))), ((int)(((byte)(35)))));
this.menuStrip1.Dock = System.Windows.Forms.DockStyle.Fill;
this.menuStrip1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem,
this.editToolStripMenuItem,
this.windowsToolStripMenuItem,
this.toolsToolStripMenuItem,
this.pluginsToolStripMenuItem,
this.settingsToolStripMenuItem,
this.aboutToolStripMenuItem,
this.experimentalToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(779, 38);
this.menuStrip1.TabIndex = 0;
this.menuStrip1.Text = "menuStrip1";
this.menuStrip1.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.menuStrip1_ItemClicked_1);
//
// fileToolStripMenuItem
//
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.newToolStripMenuItem,
this.openToolStripMenuItem,
this.recentToolStripMenuItem,
this.exportShaderErrorsToolStripMenuItem,
this.saveConfigToolStripMenuItem,
this.saveToolStripMenuItem,
this.saveAsToolStripMenuItem,
this.exitToolStripMenuItem,
this.clearWorkspaceToolStripMenuItem});
this.fileToolStripMenuItem.ImageAlign = System.Drawing.ContentAlignment.TopCenter;
this.fileToolStripMenuItem.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 34);
this.fileToolStripMenuItem.Text = "File";
this.fileToolStripMenuItem.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
//
// newToolStripMenuItem
//
this.newToolStripMenuItem.ForeColor = System.Drawing.Color.White;
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
this.newToolStripMenuItem.Size = new System.Drawing.Size(179, 22);
this.newToolStripMenuItem.Text = "New";
//
// openToolStripMenuItem
//
this.openToolStripMenuItem.ForeColor = System.Drawing.Color.White;
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
this.openToolStripMenuItem.Size = new System.Drawing.Size(179, 22);
this.openToolStripMenuItem.Text = "Open";
this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click);
//
// recentToolStripMenuItem
//
this.recentToolStripMenuItem.ForeColor = System.Drawing.Color.White;
this.recentToolStripMenuItem.Name = "recentToolStripMenuItem";
this.recentToolStripMenuItem.Size = new System.Drawing.Size(179, 22);
this.recentToolStripMenuItem.Text = "Recent";
//
// exportShaderErrorsToolStripMenuItem
//
this.exportShaderErrorsToolStripMenuItem.ForeColor = System.Drawing.Color.White;
this.exportShaderErrorsToolStripMenuItem.Name = "exportShaderErrorsToolStripMenuItem";
this.exportShaderErrorsToolStripMenuItem.Size = new System.Drawing.Size(179, 22);
this.exportShaderErrorsToolStripMenuItem.Text = "Export Shader Errors";
this.exportShaderErrorsToolStripMenuItem.Click += new System.EventHandler(this.exportShaderErrorsToolStripMenuItem_Click);
//
// saveConfigToolStripMenuItem
//
this.saveConfigToolStripMenuItem.ForeColor = System.Drawing.Color.White;
this.saveConfigToolStripMenuItem.Name = "saveConfigToolStripMenuItem";
this.saveConfigToolStripMenuItem.Size = new System.Drawing.Size(179, 22);
this.saveConfigToolStripMenuItem.Text = "Save Config";
this.saveConfigToolStripMenuItem.Click += new System.EventHandler(this.saveConfigToolStripMenuItem_Click);
//
// saveToolStripMenuItem
//
this.saveToolStripMenuItem.Enabled = false;
this.saveToolStripMenuItem.ForeColor = System.Drawing.Color.White;
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
this.saveToolStripMenuItem.Size = new System.Drawing.Size(179, 22);
this.saveToolStripMenuItem.Text = "Save";
this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click);
//
// saveAsToolStripMenuItem
//
this.saveAsToolStripMenuItem.Enabled = false;
this.saveAsToolStripMenuItem.ForeColor = System.Drawing.Color.White;
this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem";
this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(179, 22);
this.saveAsToolStripMenuItem.Text = "Save As";
this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click);
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.ForeColor = System.Drawing.Color.White;
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(179, 22);
this.exitToolStripMenuItem.Text = "Exit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click_1);
//
// clearWorkspaceToolStripMenuItem
//
this.clearWorkspaceToolStripMenuItem.ForeColor = System.Drawing.Color.White;
this.clearWorkspaceToolStripMenuItem.Name = "clearWorkspaceToolStripMenuItem";
this.clearWorkspaceToolStripMenuItem.Size = new System.Drawing.Size(179, 22);
this.clearWorkspaceToolStripMenuItem.Text = "Clear Workspace";
this.clearWorkspaceToolStripMenuItem.Click += new System.EventHandler(this.clearWorkspaceToolStripMenuItem_Click);
//
// editToolStripMenuItem
//
this.editToolStripMenuItem.Checked = true;
this.editToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
this.editToolStripMenuItem.Enabled = false;
this.editToolStripMenuItem.Name = "editToolStripMenuItem";
this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 34);
this.editToolStripMenuItem.Text = "Edit";
//
// windowsToolStripMenuItem
//
this.windowsToolStripMenuItem.Name = "windowsToolStripMenuItem";
this.windowsToolStripMenuItem.Size = new System.Drawing.Size(68, 34);
this.windowsToolStripMenuItem.Text = "Windows";
//
// toolsToolStripMenuItem
//
this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.compressionToolStripMenuItem});
this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem";
this.toolsToolStripMenuItem.Size = new System.Drawing.Size(47, 34);
this.toolsToolStripMenuItem.Text = "Tools";
//
// compressionToolStripMenuItem
//
this.compressionToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.yaz0ToolStripMenuItem,
this.gzipToolStripMenuItem});
this.compressionToolStripMenuItem.ForeColor = System.Drawing.Color.White;
this.compressionToolStripMenuItem.Name = "compressionToolStripMenuItem";
this.compressionToolStripMenuItem.Size = new System.Drawing.Size(144, 22);
this.compressionToolStripMenuItem.Text = "Compression";
//
// yaz0ToolStripMenuItem
//
this.yaz0ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.yaz0DecompressToolStripMenuItem,
this.yaz0CompressToolStripMenuItem});
this.yaz0ToolStripMenuItem.ForeColor = System.Drawing.Color.White;
this.yaz0ToolStripMenuItem.Name = "yaz0ToolStripMenuItem";
this.yaz0ToolStripMenuItem.Size = new System.Drawing.Size(99, 22);
this.yaz0ToolStripMenuItem.Text = "Yaz0";
//
// yaz0DecompressToolStripMenuItem
//
this.yaz0DecompressToolStripMenuItem.ForeColor = System.Drawing.Color.White;
this.yaz0DecompressToolStripMenuItem.Name = "yaz0DecompressToolStripMenuItem";
this.yaz0DecompressToolStripMenuItem.Size = new System.Drawing.Size(139, 22);
this.yaz0DecompressToolStripMenuItem.Text = "Decompress";
this.yaz0DecompressToolStripMenuItem.Click += new System.EventHandler(this.yaz0DecompressToolStripMenuItem_Click);
//
// yaz0CompressToolStripMenuItem
//
this.yaz0CompressToolStripMenuItem.ForeColor = System.Drawing.Color.White;
this.yaz0CompressToolStripMenuItem.Name = "yaz0CompressToolStripMenuItem";
this.yaz0CompressToolStripMenuItem.Size = new System.Drawing.Size(139, 22);
this.yaz0CompressToolStripMenuItem.Text = "Compress";
this.yaz0CompressToolStripMenuItem.Click += new System.EventHandler(this.yaz0CompressToolStripMenuItem_Click);
//
// gzipToolStripMenuItem
//
this.gzipToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.gzipCompressToolStripMenuItem,
this.gzipDecompressToolStripMenuItem});
this.gzipToolStripMenuItem.ForeColor = System.Drawing.Color.White;
this.gzipToolStripMenuItem.Name = "gzipToolStripMenuItem";
this.gzipToolStripMenuItem.Size = new System.Drawing.Size(99, 22);
this.gzipToolStripMenuItem.Text = "GZIP";
//
// gzipCompressToolStripMenuItem
//
this.gzipCompressToolStripMenuItem.ForeColor = System.Drawing.Color.White;
this.gzipCompressToolStripMenuItem.Name = "gzipCompressToolStripMenuItem";
this.gzipCompressToolStripMenuItem.Size = new System.Drawing.Size(139, 22);
this.gzipCompressToolStripMenuItem.Text = "Compress";
this.gzipCompressToolStripMenuItem.Click += new System.EventHandler(this.gzipCompressToolStripMenuItem_Click);
//
// gzipDecompressToolStripMenuItem
//
this.gzipDecompressToolStripMenuItem.ForeColor = System.Drawing.Color.White;
this.gzipDecompressToolStripMenuItem.Name = "gzipDecompressToolStripMenuItem";
this.gzipDecompressToolStripMenuItem.Size = new System.Drawing.Size(139, 22);
this.gzipDecompressToolStripMenuItem.Text = "Decompress";
this.gzipDecompressToolStripMenuItem.Click += new System.EventHandler(this.gzipDecompressToolStripMenuItem_Click);
//
// pluginsToolStripMenuItem
//
this.pluginsToolStripMenuItem.Name = "pluginsToolStripMenuItem";
this.pluginsToolStripMenuItem.Size = new System.Drawing.Size(58, 34);
this.pluginsToolStripMenuItem.Text = "Plugins";
this.pluginsToolStripMenuItem.Click += new System.EventHandler(this.pluginsToolStripMenuItem_Click);
//
// settingsToolStripMenuItem
//
this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
this.settingsToolStripMenuItem.Size = new System.Drawing.Size(61, 34);
this.settingsToolStripMenuItem.Text = "Settings";
this.settingsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click);
//
// aboutToolStripMenuItem
//
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(52, 34);
this.aboutToolStripMenuItem.Text = "About";
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
//
// experimentalToolStripMenuItem
//
this.experimentalToolStripMenuItem.Name = "experimentalToolStripMenuItem";
this.experimentalToolStripMenuItem.Size = new System.Drawing.Size(87, 34);
this.experimentalToolStripMenuItem.Text = "Experimental";
//
// showObjectlistToolStripMenuItem
//
this.showObjectlistToolStripMenuItem.ForeColor = System.Drawing.Color.White;
this.showObjectlistToolStripMenuItem.Name = "showObjectlistToolStripMenuItem";
this.showObjectlistToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.showObjectlistToolStripMenuItem.Text = "Show Objectlist";
this.showObjectlistToolStripMenuItem.Click += new System.EventHandler(this.showObjectlistToolStripMenuItem_Click);
//
// dockPanel1
//
this.dockPanel1.AllowDrop = true;
this.dockPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dockPanel1.DockBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(48)))));
this.dockPanel1.Location = new System.Drawing.Point(0, 38);
this.dockPanel1.Name = "dockPanel1";
this.dockPanel1.Padding = new System.Windows.Forms.Padding(6);
this.dockPanel1.ShowAutoHideContentOnHover = false;
this.dockPanel1.Size = new System.Drawing.Size(780, 422);
this.dockPanel1.TabIndex = 1;
this.dockPanel1.DockChanged += new System.EventHandler(this.dockPanel1_DockChanged);
this.dockPanel1.DragDrop += new System.Windows.Forms.DragEventHandler(this.dockPanel1_DragDrop);
this.dockPanel1.DragEnter += new System.Windows.Forms.DragEventHandler(this.dockPanel1_DragEnter);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.ClientSize = new System.Drawing.Size(779, 460);
this.Controls.Add(this.dockPanel1);
this.Controls.Add(this.panel1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.IsMdiContainer = true;
this.KeyPreview = true;
this.Name = "MainForm";
this.Text = "Switch Toolbox";
this.Load += new System.EventHandler(this.Form4_Load);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.MainForm_KeyDown);
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.MainForm_KeyPress);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private Switch_Toolbox.Library.Forms.ContextMenuStripDark menuStrip1;
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem toolsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem settingsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem recentToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem;
private Switch_Toolbox.Library.Forms.DockPanelCustom dockPanel1;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem pluginsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem windowsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem showObjectlistToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem saveConfigToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exportShaderErrorsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem clearWorkspaceToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem compressionToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem yaz0ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem yaz0DecompressToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem yaz0CompressToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem gzipToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem gzipCompressToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem gzipDecompressToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem experimentalToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
}
}

598
Switch_Toolbox/MainForm.cs Normal file
View File

@ -0,0 +1,598 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Switch_Toolbox.Library.Forms;
using WeifenLuo.WinFormsUI.Docking;
using Switch_Toolbox.Library;
using Smash_Forge.Rendering;
using Switch_Toolbox.Library.IO;
using System.Net;
namespace Switch_Toolbox
{
public partial class MainForm : Form
{
public static string executableDir = null;
public DockContentST dockContent;
public string LatestUpdateUrl = "";
List<string> RecentFiles = new List<string>();
public ObjectList objectList = null;
IFileFormat[] SupportedFormats;
IFileMenuExtension[] FileMenuExtensions;
public MainForm()
{
InitializeComponent();
ShaderTools.executableDir = executableDir;
Config.StartupFromFile(MainForm.executableDir + "\\config.xml");
dockContent = new DockContentST();
dockContent = Viewport.Instance;
GenericPluginLoader.LoadPlugin();
foreach (var plugin in GenericPluginLoader._Plugins)
{
plugin.Value.MainForm = this;
plugin.Value.DockedEditor = dockContent;
plugin.Value.Load();
LoadPluginContextMenus(plugin.Value.Types);
}
Settings settings = new Settings(this);
settings.Close();
Reload();
LoadPluginFileContextMenus();
}
private List<IMenuExtension> menuExtentions = new List<IMenuExtension>();
private void LoadPluginContextMenus(Type[] types)
{
foreach (Type T in types)
{
Type[] interfaces_array = T.GetInterfaces();
for (int i = 0; i < interfaces_array.Length; i++)
{
if (interfaces_array[i] == typeof(IMenuExtension))
{
menuExtentions.Add((IMenuExtension)Activator.CreateInstance(T));
}
}
}
foreach (IMenuExtension ext in menuExtentions)
{
if (ext.FileMenuExtensions != null)
RegisterMenuExtIndex(fileToolStripMenuItem, ext.FileMenuExtensions, fileToolStripMenuItem.DropDownItems.Count); //last items are separator and settings
if (ext.ToolsMenuExtensions != null)
RegisterMenuExtIndex(toolsToolStripMenuItem, ext.ToolsMenuExtensions);
if (ext.TitleBarExtensions != null)
RegisterMenuExtIndex(menuStrip1, ext.TitleBarExtensions, menuStrip1.Items.Count);
}
}
private void LoadPluginFileContextMenus()
{
foreach (IFileMenuExtension ext in FileMenuExtensions)
{
if (ext.NewFileMenuExtensions != null)
RegisterMenuExtIndex(newToolStripMenuItem, ext.NewFileMenuExtensions, newToolStripMenuItem.DropDownItems.Count);
if (ext.ToolsMenuExtensions != null)
RegisterMenuExtIndex(toolsToolStripMenuItem, ext.ToolsMenuExtensions);
if (ext.TitleBarExtensions != null)
RegisterMenuExtIndex(menuStrip1, ext.TitleBarExtensions, menuStrip1.Items.Count);
if (ext.ExperimentalMenuExtensions != null)
RegisterMenuExtIndex(experimentalToolStripMenuItem, ext.ExperimentalMenuExtensions, experimentalToolStripMenuItem.DropDownItems.Count);
if (ext.CompressionMenuExtensions != null)
RegisterMenuExtIndex(compressionToolStripMenuItem, ext.CompressionMenuExtensions, compressionToolStripMenuItem.DropDownItems.Count);
}
}
void RegisterMenuExtIndex(ToolStripMenuItem target, ToolStripItemDark[] list, int index = 0)
{
foreach (var i in list)
target.DropDownItems.Insert(index++, i);
}
void RegisterMenuExtIndex(ToolStrip target, ToolStripItemDark[] list, int index = 0)
{
foreach (var i in list)
target.Items.Insert(index++, i);
}
public void Reload()
{
SupportedFormats = FileManager.GetFileFormats();
FileMenuExtensions = FileManager.GetMenuExtensions();
}
private void Form4_Load(object sender, EventArgs e)
{
LoadObjectList();
LoadRecentList();
foreach (string item in RecentFiles)
{
ToolStripMenuItem fileRecent = new ToolStripMenuItem();
fileRecent.Click += RecentFile_click;
fileRecent.Text = item;
fileRecent.Size = new System.Drawing.Size(170, 40);
fileRecent.AutoSize = true;
fileRecent.Image = null;
fileRecent.ForeColor = Color.White;
recentToolStripMenuItem.DropDownItems.Add(fileRecent); //add the menu to "recent" menu
}
dockContent.Show(dockPanel1, DockState.Document);
if (OpenTK.Graphics.GraphicsContext.CurrentContext != null)
{
OpenTKSharedResources.InitializeSharedResources();
}
if (Runtime.OpenStartupWindow)
{
Startup_Window window = new Startup_Window();
window.TopMost = true;
window.Show();
}
}
const int MRUnumber = 6;
private void SaveRecentFile(string path)
{
recentToolStripMenuItem.DropDownItems.Clear();
LoadRecentList(); //load list from file
if (!(RecentFiles.Contains(path))) //prevent duplication on recent list
RecentFiles.Insert(0, path); //insert given path into list
//keep list number not exceeded the given value
while (RecentFiles.Count > MRUnumber)
{
RecentFiles.RemoveAt(MRUnumber);
}
foreach (string item in RecentFiles)
{
//create new menu for each item in list
ToolStripMenuItem fileRecent = new ToolStripMenuItem();
fileRecent.Click += RecentFile_click;
fileRecent.Text = item;
fileRecent.Size = new System.Drawing.Size(170, 40);
fileRecent.AutoSize = true;
fileRecent.Image = null;
fileRecent.ForeColor = Color.White;
//add the menu to "recent" menu
recentToolStripMenuItem.DropDownItems.Add(fileRecent);
}
//writing menu list to file
//create file called "Recent.txt" located on app folder
StreamWriter stringToWrite =
new StreamWriter(System.Environment.CurrentDirectory + "\\Recent.txt");
foreach (string item in RecentFiles)
{
stringToWrite.WriteLine(item); //write list to stream
}
stringToWrite.Flush(); //write stream to file
stringToWrite.Close(); //close the stream and reclaim memory
}
private void LoadRecentList()
{//try to load file. If file isn't found, do nothing
RecentFiles.Clear();
try
{
StreamReader listToRead = new StreamReader(System.Environment.CurrentDirectory + "\\Recent.txt"); //read file stream
string line;
while ((line = listToRead.ReadLine()) != null) //read each line until end of file
{
if (File.Exists(line))
RecentFiles.Add(line); //insert to list
}
listToRead.Close(); //close the stream
}
catch (Exception)
{
//throw;
}
}
private void LoadObjectList()
{
objectList = new ObjectList();
objectList.Show(dockPanel1, Runtime.objectListDockState);
}
public void SaveFile(IFileFormat format, string FileName)
{
byte[] data = format.Save();
int Alignment = format.Alignment;
Console.WriteLine(Alignment);
SaveCompressFile(data, FileName, Alignment);
}
private void SaveCompressFile(byte[] data, string FileName, int Alignment = 0, bool EnableDialog = true)
{
if (EnableDialog)
{
DialogResult save = MessageBox.Show("Compress file?", "File Save", MessageBoxButtons.YesNo);
if (save == DialogResult.Yes)
data = EveryFileExplorer.YAZ0.Compress(data, 3, (uint)Alignment);
}
File.WriteAllBytes(FileName, data);
MessageBox.Show($"File has been saved to {FileName}");
Cursor.Current = Cursors.Default;
}
public void OpenFile(string FileName, byte[] data = null, bool Compressed = false,
CompressionType CompType = CompressionType.None)
{
if (data == null)
data = File.ReadAllBytes(FileName);
if (File.Exists(FileName))
SaveRecentFile(FileName);
FileReader f = new FileReader(data);
string Magic = f.ReadMagic(0, 4);
string Magic2 = f.ReadMagic(0, 2);
//Determine if the file is compressed or not
if (Magic == "Yaz0")
{
data = EveryFileExplorer.YAZ0.Decompress(data).ToArray();
OpenFile(FileName, data, true, CompressionType.Yaz0);
return;
}
if (Magic == "ZLIB")
{
data = FileReader.InflateZLIB(f.getSection(64, data.Length - 64));
OpenFile(FileName, data, true, CompressionType.Zlib);
return;
}
f.Dispose();
f.Close();
foreach (IFileFormat format in SupportedFormats)
{
Console.WriteLine(format.Magic.Reverse());
Console.WriteLine(Magic2);
if (format.Magic == Magic || format.Magic == Magic2 || format.Magic.Reverse() == Magic2)
{
format.CompressionType = CompType;
format.FileIsCompressed = Compressed;
format.Data = data;
format.FileName = Path.GetFileName(FileName);
format.Load();
format.FilePath = FileName;
if (format.EditorRoot != null)
{
objectList.treeView1.Nodes.Add(format.EditorRoot);
}
if (format.CanSave)
{
saveAsToolStripMenuItem.Enabled = true;
saveToolStripMenuItem.Enabled = true;
}
if (format.UseEditMenu)
editToolStripMenuItem.Enabled = true;
}
if (format.Magic == String.Empty) //Load by extension if magic isn't defined
{
foreach (string ext in format.Extension)
{
if (ext.Remove(0, 1) == Path.GetExtension(FileName))
{
format.CompressionType = CompType;
format.FileIsCompressed = Compressed;
format.Data = data;
format.FileName = Path.GetFileName(FileName);
format.FilePath = FileName;
format.Load();
if (format.EditorRoot != null)
{
objectList.treeView1.Nodes.Add(format.EditorRoot);
}
if (format.CanSave)
{
saveAsToolStripMenuItem.Enabled = true;
saveToolStripMenuItem.Enabled = true;
}
if (format.UseEditMenu)
editToolStripMenuItem.Enabled = true;
}
}
}
}
}
private void DisposeControls()
{
}
private void RecentFile_click(object sender, EventArgs e)
{
OpenFile(sender.ToString());
}
private void menuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void menuStrip1_ItemClicked_1(object sender, ToolStripItemClickedEventArgs e)
{
}
private void exitToolStripMenuItem_Click_1(object sender, EventArgs e)
{
Close();
}
private void pluginsToolStripMenuItem_Click(object sender, EventArgs e)
{
PluginManager pluginManager = new PluginManager();
pluginManager.Show();
}
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = Utils.GetAllFilters(SupportedFormats);
ofd.Multiselect = true;
if (ofd.ShowDialog() == DialogResult.OK)
{
foreach (string file in ofd.FileNames)
OpenFile(file);
}
}
private void showObjectlistToolStripMenuItem_Click(object sender, EventArgs e)
{
if (objectList == null)
LoadObjectList();
}
private void dockPanel1_DragDrop(object sender, DragEventArgs e)
{
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
foreach (string filename in files)
{
OpenFile(filename);
}
}
private void dockPanel1_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Effect = DragDropEffects.All;
else
{
String[] strGetFormats = e.Data.GetFormats();
e.Effect = DragDropEffects.None;
}
}
private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
{
SaveFile(true);
}
private void MainForm_KeyPress(object sender, KeyPressEventArgs e)
{
}
private void SaveFile(bool UseSaveDialog)
{
foreach (IFileFormat format in SupportedFormats)
{
if (format.CanSave)
{
List<IFileFormat> f = new List<IFileFormat>();
f.Add(format);
if (UseSaveDialog)
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = Utils.GetAllFilters(f);
sfd.FileName = format.FileName;
if (sfd.ShowDialog() == DialogResult.OK)
{
Cursor.Current = Cursors.WaitCursor;
SaveFile(format, sfd.FileName);
}
}
else
{
SaveFile(format, format.FilePath);
}
}
}
}
private void MainForm_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.KeyCode == Keys.S) // Ctrl-S Save
{
// Do what you want here
SaveFile(true);
e.SuppressKeyPress = true; // Stops other controls on the form receiving event.
}
}
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
SaveFile(false);
}
private void saveConfigToolStripMenuItem_Click(object sender, EventArgs e)
{
Config.Save();
// dockPanel1.SaveAsXml("DockStates/" + dockPanel1.Text + ".xml");
}
private void dockPanel1_DockChanged(object sender, EventArgs e)
{
Console.WriteLine(e.ToString());
}
private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
{
Settings settings = new Settings(this);
settings.Show();
}
private void exportShaderErrorsToolStripMenuItem_Click(object sender, EventArgs e)
{
ShaderTools.SaveErrorLogs();
}
private void clearWorkspaceToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (var plugin in GenericPluginLoader._Plugins)
{
plugin.Value.Unload();
foreach (IFileFormat format in SupportedFormats)
{
if (format.IsActive)
{
format.Unload();
}
}
}
Viewport.Instance.Dispose();
GC.Collect();
}
public void CompressData(CompressionType CompressionType, byte[] data)
{
switch (CompressionType)
{
case CompressionType.Yaz0:
SaveFileForCompression(EveryFileExplorer.YAZ0.Compress(data));
break;
case CompressionType.Zlib:
break;
case CompressionType.Gzip:
SaveFileForCompression(STLibraryCompression.GZIP.Compress(data));
break;
case CompressionType.Zstb:
break;
}
}
public void DecompressData(CompressionType CompressionType, byte[] data)
{
try
{
switch (CompressionType)
{
case CompressionType.Yaz0:
SaveFileForCompression(EveryFileExplorer.YAZ0.Decompress(data));
break;
case CompressionType.Zlib:
break;
case CompressionType.Gzip:
SaveFileForCompression(STLibraryCompression.GZIP.Decompress(data));
break;
case CompressionType.Zstb:
break;
}
}
catch
{
MessageBox.Show($"File not compressed with {CompressionType} compression!");
}
}
private void yaz0DecompressToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileForCompression(CompressionType.Yaz0, false);
}
private void yaz0CompressToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileForCompression(CompressionType.Yaz0, true);
}
private void gzipCompressToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileForCompression(CompressionType.Gzip, true);
}
private void gzipDecompressToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileForCompression(CompressionType.Gzip, false);
}
private void SaveFileForCompression(byte[] data)
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "All files(*.*)|*.*";
Cursor.Current = Cursors.Default;
if (sfd.ShowDialog() == DialogResult.OK)
{
SaveCompressFile(data, sfd.FileName, 0, false);
}
}
private void OpenFileForCompression(CompressionType compressionType, bool Compress)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "All files(*.*)|*.*";
ofd.Multiselect = true;
if (ofd.ShowDialog() == DialogResult.OK)
{
Cursor.Current = Cursors.WaitCursor;
foreach (string file in ofd.FileNames)
{
if (Compress)
CompressData(compressionType, File.ReadAllBytes(ofd.FileName));
else
DecompressData(compressionType, File.ReadAllBytes(ofd.FileName));
}
}
}
private void checkUpdatesToolStripMenuItem_Click(object sender, EventArgs e)
{
if (LatestUpdateUrl == "")
return;
using (var webClient = new WebClient())
{
webClient.DownloadFile(LatestUpdateUrl, "update.zip");
webClient.DownloadDataCompleted += UpdateDownloadCompleted;
}
}
void UpdateDownloadCompleted(object sender, DownloadDataCompletedEventArgs e)
{
MessageBox.Show("Update downloaded!");
System.IO.Compression.ZipFile.ExtractToDirectory("update.zip", "update/");
}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
CreditsWindow credits = new CreditsWindow();
credits.TopMost = true;
credits.Show();
}
}
}

2502
Switch_Toolbox/MainForm.resx Normal file

File diff suppressed because it is too large Load Diff

24
Switch_Toolbox/Program.cs Normal file
View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Switch_Toolbox
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
MainForm.executableDir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}

View File

@ -0,0 +1 @@


View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Switch_Toolbox")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Switch_Toolbox")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e861c28b-b039-48f7-9a4f-c83f67c0adde")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,83 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Switch_Toolbox.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Switch_Toolbox.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Logo {
get {
object obj = ResourceManager.GetObject("Logo", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tool {
get {
object obj = ResourceManager.GetObject("Tool", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@ -0,0 +1,127 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Tool" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Tool.ico;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Logo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Switch_Toolbox.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@ -0,0 +1,152 @@
#version 330
in vec2 f_texcoord0;
in vec2 f_texcoord1;
in vec2 f_texcoord2;
in vec2 f_texcoord3;
in vec3 objectPosition;
in vec3 normal;
in vec3 viewNormal;
in vec4 vertexColor;
in vec3 tangent;
in vec3 bitangent;
in vec3 boneWeightsColored;
uniform sampler2D DiffuseMap;
uniform sampler2D BakeShadowMap;
uniform sampler2D SpecularMap;
uniform sampler2D NormalMap;
uniform sampler2D BakeLightMap;
uniform sampler2D UVTestPattern;
uniform sampler2D TransparencyMap;
uniform sampler2D EmissionMap;
uniform sampler2D DiffuseLayer;
uniform sampler2D MetalnessMap;
uniform sampler2D RoughnessMap;
uniform sampler2D MRA;
uniform sampler2D BOTWSpecularMap;
uniform sampler2D SphereMap;
uniform sampler2D SubSurfaceScatteringMap;
// Viewport Camera/Lighting
uniform mat4 mvpMatrix;
uniform vec3 difLightDirection;
// Viewport Settings
uniform int uvChannel;
uniform int renderType;
uniform int useNormalMap;
uniform vec4 colorSamplerUV;
uniform int renderVertColor;
uniform vec3 difLightColor;
uniform vec3 ambLightColor;
uniform int colorOverride;
uniform float DefaultMetalness;
uniform float DefaultRoughness;
uniform int isTransparent;
// Texture Map Toggles
uniform int HasDiffuse;
uniform int HasNormalMap;
uniform int HasSpecularMap;
uniform int HasShadowMap;
uniform int HasAmbientOcclusionMap;
uniform int HasLightMap;
uniform int HasTransparencyMap;
uniform int HasEmissionMap;
uniform int HasDiffuseLayer;
uniform int HasMetalnessMap;
uniform int HasRoughnessMap;
uniform int HasMRA;
uniform int HasSubSurfaceScatteringMap;
uniform vec4 const_color0;
uniform vec4 base_color_mul_color;
struct VertexAttributes {
vec3 objectPosition;
vec2 texCoord;
vec2 texCoord2;
vec2 texCoord3;
vec4 vertexColor;
vec3 normal;
vec3 viewNormal;
vec3 tangent;
vec3 bitangent;
};
out vec4 fragColor;
#define gamma 2.2
// Defined in Utility.frag.
float Luminance(vec3 rgb);
vec3 CalcBumpedNormal(vec3 normal, sampler2D normalMap, VertexAttributes vert, float texCoordIndex);
void main()
{
fragColor = vec4(vec3(0), 1);
VertexAttributes vert;
vert.objectPosition = objectPosition;
vert.texCoord = f_texcoord0;
vert.texCoord2 = f_texcoord1;
vert.texCoord3 = f_texcoord2;
vert.vertexColor = vertexColor;
vert.normal = normal;
vert.viewNormal = viewNormal;
vert.tangent = tangent;
vert.bitangent = bitangent;
// Wireframe color.
if (colorOverride == 1)
{
if (renderVertColor == 1)
fragColor = vec4(vertexColor);
else
fragColor = vec4(1);
return;
}
// Calculate shading vectors.
vec3 I = vec3(0,0,-1) * mat3(mvpMatrix);
vec3 N = normal;
if (HasNormalMap == 1 && useNormalMap == 1)
N = CalcBumpedNormal(normal, NormalMap, vert, 0);
// Diffuse lighting.
float halfLambert = dot(difLightDirection, N) * 0.5 + 0.5;
vec4 diffuseMapColor = vec4(texture(DiffuseMap, f_texcoord0).rgb, 1);
diffuseMapColor *= halfLambert;
// vec3 displayNormal = (N * 0.5) + 0.5;
// fragColor = vec4(displayNormal,1);
fragColor.rgb += diffuseMapColor.rgb;
vec3 color = vec3(1);
vec3 normal = texture(NormalMap, f_texcoord0).rgb;
vec3 specular = texture(SpecularMap, f_texcoord0).rgb;
fragColor.a *= texture(DiffuseMap, f_texcoord0).a;
if (renderVertColor == 1)
fragColor *= min(vert.vertexColor, vec4(1));
fragColor *= min(const_color0, vec4(1));
fragColor *= min(base_color_mul_color, vec4(1));
// if (isTransparent != 1)
// fragColor.a = 1;
}

View File

@ -0,0 +1,129 @@
#version 330
uniform mat4 mvpMatrix;
in vec3 vPosition;
in vec3 vNormal;
in vec3 vTangent;
in vec3 vBitangent;
in vec2 vUV0;
in vec4 vColor;
in vec4 vBone;
in vec4 vWeight;
in vec2 vUV1;
in vec2 vUV2;
in vec3 vPosition2;
in vec3 vPosition3;
out vec2 f_texcoord0;
out vec2 f_texcoord1;
out vec2 f_texcoord2;
out vec2 f_texcoord3;
out vec3 objectPosition;
out vec3 normal;
out vec3 viewNormal;
out vec4 vertexColor;
out vec3 tangent;
out vec3 bitangent;
out vec3 boneWeightsColored;
// Shader Options
uniform vec4 gsys_bake_st0;
uniform vec4 gsys_bake_st1;
// Skinning uniforms
uniform mat4 bones[200];
//Meshes have a bone index and will use their transform depending on skin influence amount
uniform mat4 singleBoneBindTransform;
uniform int NoSkinning;
uniform int RigidSkinning;
vec4 skin(vec3 pos, ivec4 index)
{
vec4 newPosition = vec4(pos.xyz, 1.0);
newPosition = bones[index.x] * vec4(pos, 1.0) * vWeight.x;
newPosition += bones[index.y] * vec4(pos, 1.0) * vWeight.y;
newPosition += bones[index.z] * vec4(pos, 1.0) * vWeight.z;
if (vWeight.w < 1) //Necessary. Bones may scale weirdly without
newPosition += bones[index.w] * vec4(pos, 1.0) * vWeight.w;
return newPosition;
}
vec3 skinNRM(vec3 nr, ivec4 index)
{
vec3 newNormal = vec3(0);
newNormal = mat3(bones[index.x]) * nr * vWeight.x;
newNormal += mat3(bones[index.y]) * nr * vWeight.y;
newNormal += mat3(bones[index.z]) * nr * vWeight.z;
newNormal += mat3(bones[index.w]) * nr * vWeight.w;
return newNormal;
}
vec2 rotateUV(vec2 uv, float rotation)
{
float mid = 0.5;
return vec2(
cos(rotation) * (uv.x - mid) + sin(rotation) * (uv.y - mid) + mid,
cos(rotation) * (uv.y - mid) - sin(rotation) * (uv.x - mid) + mid
);
}
void main()
{
ivec4 index = ivec4(vBone);
vec4 objPos = vec4(vPosition.xyz, 1.0);
objectPosition = vPosition.xyz;
if (vBone.x != -1.0)
objPos = skin(vPosition, index);
gl_Position = mvpMatrix * vec4(objPos.xyz, 1.0);
normal = vNormal;
if(vBone.x != -1.0)
normal = normalize((skinNRM(vNormal.xyz, index)).xyz);
if (RigidSkinning == 1)
{
gl_Position = mvpMatrix * bones[index.x] * vec4(vPosition, 1.0);
normal = vNormal;
normal = mat3(bones[index.x]) * vNormal.xyz * 1;
}
if (NoSkinning == 1)
{
gl_Position = mvpMatrix * singleBoneBindTransform * vec4(vPosition, 1.0);
normal = mat3(singleBoneBindTransform) * vNormal.xyz * 1;
normal = normalize(normal);
}
f_texcoord0 = vUV0;
vec4 sampler2 = gsys_bake_st0;
vec4 sampler3 = gsys_bake_st1;
if (sampler2.x != 0 && sampler2.y != 0)
f_texcoord1 = vec2((vUV1 * sampler2.xy) + sampler2.zw);
else
f_texcoord1 = vec2((vUV1 * vec2(1)) + sampler2.zw);
if (sampler3.x != 0 && sampler3.y != 0)
f_texcoord2 = vec2((vUV1 * sampler3.xy) + sampler3.zw);
else
f_texcoord2 = vec2((vUV1 * vec2(1)) + sampler3.zw);
f_texcoord3 = vUV2;
tangent = vTangent;
bitangent = vBitangent;
vertexColor = vColor;
}

View File

@ -0,0 +1,352 @@
#version 330
in vec2 f_texcoord0;
in vec2 f_texcoord1;
in vec2 f_texcoord2;
in vec2 f_texcoord3;
in vec3 objectPosition;
in vec3 normal;
in vec4 vertexColor;
in vec3 tangent;
in vec3 bitangent;
in vec3 boneWeightsColored;
// Viewport Camera/Lighting
uniform mat4 mvpMatrix;
uniform vec3 specLightDirection;
uniform vec3 difLightDirection;
uniform mat4 projMatrix;
uniform mat4 normalMatrix;
uniform mat4 modelViewMatrix;
uniform mat4 rotationMatrix;
uniform int useImageBasedLighting;
uniform int enableCellShading;
uniform vec3 camPos;
uniform vec3 light1Pos;
const float levels = 3.0;
// Viewport Settings
uniform int uvChannel;
uniform int renderType;
uniform int useNormalMap;
uniform vec4 colorSamplerUV;
uniform int renderVertColor;
uniform vec3 difLightColor;
uniform vec3 ambLightColor;
uniform int colorOverride;
uniform float DefaultMetalness;
uniform float DefaultRoughness;
// Channel Toggles
uniform int renderR;
uniform int renderG;
uniform int renderB;
uniform int renderAlpha;
// Texture Samplers
uniform sampler2D tex0;
uniform sampler2D BakeShadowMap;
uniform sampler2D normalMap;
uniform sampler2D BakeLightMap;
uniform sampler2D UVTestPattern;
uniform sampler2D TransparencyMap;
uniform sampler2D EmissionMap;
uniform sampler2D SpecularMap;
uniform sampler2D DiffuseLayer;
uniform sampler2D MetalnessMap;
uniform sampler2D RoughnessMap;
uniform sampler2D MRA;
uniform sampler2D TeamColorMap;
uniform sampler2D SphereMap;
uniform samplerCube irradianceMap;
uniform samplerCube specularIbl;
uniform sampler2D brdfLUT;
// Shader Params
uniform float normal_map_weight;
uniform float ao_density;
uniform float emission_intensity;
uniform vec4 fresnelParams;
uniform vec4 base_color_mul_color;
uniform vec3 emission_color;
uniform vec3 specular_color;
// Shader Options
uniform float uking_texture2_texcoord;
uniform float bake_shadow_type;
uniform float enable_fresnel;
uniform float enable_emission;
uniform float cSpecularType;
// Texture Map Toggles
uniform int HasDiffuse;
uniform int HasNormalMap;
uniform int HasSpecularMap;
uniform int HasShadowMap;
uniform int HasAmbientOcclusionMap;
uniform int HasLightMap;
uniform int HasTransparencyMap;
uniform int HasEmissionMap;
uniform int HasDiffuseLayer;
uniform int HasMetalnessMap;
uniform int HasRoughnessMap;
uniform int HasMRA;
uniform int roughnessAmount;
uniform int UseAOMap;
uniform int UseCavityMap;
uniform int UseMetalnessMap;
uniform int UseRoughnessMap;
int isTransparent;
uniform int renderDiffuse;
uniform int renderSpecular;
uniform int renderFresnel;
struct VertexAttributes
{
vec3 objectPosition;
vec2 texCoord;
vec2 texCoord2;
vec2 texCoord3;
vec4 vertexColor;
vec3 normal;
vec3 viewNormal;
vec3 tangent;
vec3 bitangent;
};
out vec4 fragColor;
#define gamma 2.2
const float PI = 3.14159265359;
// Defined in BFRES_Utility.frag.
vec3 CalcBumpedNormal(vec3 normal, sampler2D normalMap, VertexAttributes vert, float uking_texture2_texcoord);
float AmbientOcclusionBlend(sampler2D BakeShadowMap, VertexAttributes vert, float ao_density);
vec3 EmissionPass(sampler2D EmissionMap, float emission_intensity, VertexAttributes vert, float uking_texture2_texcoord, vec3 emission_color);
// Shader code adapted from learnopengl.com's PBR tutorial:
// https://learnopengl.com/PBR/Theory
vec3 fresnelSchlick(float cosTheta, vec3 F0)
{
return F0 + (1.0 - F0) * pow(1.0 - cosTheta, 5.0);
}
vec3 fresnelSchlickRoughness(float cosTheta, vec3 F0, float roughness)
{
return F0 + (max(vec3(1.0 - roughness), F0) - F0) * pow(1.0 - cosTheta, 5.0);
}
float DistributionGGX(vec3 N, vec3 H, float roughness)
{
float a = roughness*roughness;
float a2 = a*a;
float NdotH = max(dot(N, H), 0.0);
float NdotH2 = NdotH*NdotH;
float num = a2;
float denom = (NdotH2 * (a2 - 1.0) + 1.0);
denom = PI * denom * denom;
return num / denom;
}
float GeometrySchlickGGX(float NdotV, float roughness)
{
float r = (roughness + 1.0);
float k = (r*r) / 8.0;
float num = NdotV;
float denom = NdotV * (1.0 - k) + k;
return num / denom;
}
float GeometrySmith(vec3 N, vec3 V, vec3 L, float roughness)
{
float NdotV = max(dot(N, V), 0.0);
float NdotL = max(dot(N, L), 0.0);
float ggx2 = GeometrySchlickGGX(NdotV, roughness);
float ggx1 = GeometrySchlickGGX(NdotL, roughness);
return ggx1 * ggx2;
}
vec3 saturation(vec3 rgb, float adjustment)
{
const vec3 W = vec3(0.2125, 0.7154, 0.0721);
vec3 intensity = vec3(dot(rgb, W));
return mix(intensity, rgb, adjustment);
}
vec3 DiffusePass(vec3 albedo, vec3 N, vec3 L, vec3 R)
{
float lambert = max(dot(N, L), 0.0);
// Higher blend values make the dark region smoother and larger.
float smoothness = 0.1;
float center = 0.5;
float edgeL = center;
float edgeR = center + (smoothness * 0.5);
float smoothLambert = smoothstep(edgeL, edgeR, lambert);
float ambient = 0.6;
smoothLambert = clamp(smoothLambert + ambient, 0, 1);
vec3 diffuseTerm = albedo;
diffuseTerm *= smoothLambert;
return diffuseTerm * 1.5;
}
vec3 SpecularPass(vec3 albedo, vec3 N, vec3 H, vec3 R, float metallic, float specularMapIntensity)
{
// Specular pass
vec3 specularTerm = vec3(0);
// TODO: Metalness
vec3 specularColor = albedo;
specularTerm = specularColor;
// Hack something together for now.
vec3 specularLighting = texture(irradianceMap, R).rrr;
float center = 0.375;
float smoothness = 0.035;
specularLighting = smoothstep(vec3(center - smoothness), vec3(center + smoothness), specularLighting);
specularTerm *= specularLighting;
specularTerm *= specularMapIntensity;
return specularTerm;
}
vec3 FresnelPass(vec3 N, vec3 I)
{
// Fake edge lighting
float nDotI = clamp(dot(N, I), 0, 1);
float fresnel = 1 - nDotI;
// TODO: Extract cel shade function.
float center = 0.75;
float smoothness = 0.015;
fresnel = smoothstep(center - smoothness, center + smoothness, fresnel);
vec3 fresnelTerm = vec3(1, 1, 0.75) * fresnel * 0.2;
return fresnelTerm;
}
void main()
{
fragColor = vec4(1);
// Create a struct for passing all the vertex attributes to other functions.
VertexAttributes vert;
vert.objectPosition = objectPosition;
vert.texCoord = f_texcoord0;
vert.texCoord2 = f_texcoord1;
vert.texCoord3 = f_texcoord2;
vert.vertexColor = vertexColor;
vert.normal = normal;
vert.tangent = tangent;
vert.bitangent = bitangent;
vec3 lightColor = vec3(10);
// Wireframe color.
if (colorOverride == 1)
{
fragColor = vec4(1);
return;
}
vec3 albedo = pow(texture(tex0, f_texcoord0).rgb, vec3(gamma));
float metallic = DefaultMetalness;
if (HasMetalnessMap == 1)
metallic = texture(MetalnessMap, f_texcoord0).r;
float roughness = DefaultRoughness;
if (HasRoughnessMap == 1)
roughness = texture(RoughnessMap, f_texcoord0).r;
float ao = 1;
if (HasShadowMap == 1 && UseAOMap == 1)
ao = texture(BakeShadowMap, f_texcoord1).r;
float shadow = 1;
if (HasShadowMap == 1)
shadow = texture(BakeShadowMap, f_texcoord1).g;
float cavity = 1;
vec3 lightMapColor = vec3(1);
float lightMapIntensity = 0;
if (HasLightMap == 1)
{
lightMapColor = texture(BakeLightMap, f_texcoord1).rgb;
lightMapIntensity = texture(BakeLightMap, f_texcoord1).a;
}
// TODO: Extract function.
float specularMapIntensity = 1;
if (HasSpecularMap == 1)
{
if (uking_texture2_texcoord == 1)
{
metallic = texture(SpecularMap, f_texcoord1).g;
specularMapIntensity = texture(SpecularMap, f_texcoord1).r;
}
else
{
metallic = texture(SpecularMap, f_texcoord0).g;
specularMapIntensity = texture(SpecularMap, f_texcoord0).r;
}
}
vec3 I = vec3(0,0,-1) * mat3(mvpMatrix);
vec3 N = normal;
if (HasNormalMap == 1 && useNormalMap == 1)
N = CalcBumpedNormal(normal, normalMap, vert, uking_texture2_texcoord);
vec3 V = normalize(I); //Eye View
vec3 L = normalize(specLightDirection); //Light
vec3 H = normalize(specLightDirection + I); //Half Angle
vec3 R = reflect(I, N); // reflection
// Render passes
vec3 outputColor = vec3(0);
float kDiffuse = clamp(1.0 - metallic, 0, 1);
outputColor += DiffusePass(albedo, N, L, R) * renderDiffuse;
outputColor += SpecularPass(albedo, N, H, R, metallic, specularMapIntensity) * renderSpecular;
outputColor += FresnelPass(N, I) * renderFresnel;
if (HasEmissionMap == 1 || enable_emission == 1) //Can be without texture map
outputColor.rgb += EmissionPass(EmissionMap, emission_intensity, vert, uking_texture2_texcoord, emission_color);
outputColor *= ao;
outputColor *= (0.6 + shadow);
float cavityStrength = 1.0;
outputColor *= cavity * cavityStrength + (1.0 - cavityStrength);
// TODO: Renders as black?
// if (renderVertColor == 1)
// fragColor *= min(vertexColor, vec4(1));
outputColor = pow(outputColor, vec3(1.0 / gamma));
float alpha = texture(tex0, f_texcoord0).a;
fragColor = vec4(outputColor, alpha);
}

View File

@ -0,0 +1,304 @@
#version 330
in vec2 f_texcoord0;
in vec2 f_texcoord1;
in vec2 f_texcoord2;
in vec2 f_texcoord3;
in vec3 objectPosition;
in vec3 normal;
in vec3 viewNormal;
in vec4 vertexColor;
in vec3 tangent;
in vec3 bitangent;
in vec3 boneWeightsColored;
// Viewport Camera/Lighting
uniform mat4 mvpMatrix;
uniform vec3 specLightDirection;
uniform vec3 difLightDirection;
uniform mat4 projMatrix;
uniform mat4 normalMatrix;
uniform mat4 modelViewMatrix;
uniform mat4 rotationMatrix;
uniform int useImageBasedLighting;
uniform int enableCellShading;
uniform vec3 camPos;
uniform vec3 light1Pos;
const float levels = 3.0;
// Viewport Settings
uniform int uvChannel;
uniform int renderType;
uniform int useNormalMap;
uniform vec4 colorSamplerUV;
uniform int renderVertColor;
uniform vec3 difLightColor;
uniform vec3 ambLightColor;
uniform int colorOverride;
uniform float DefaultMetalness;
uniform float DefaultRoughness;
// Channel Toggles
uniform int renderR;
uniform int renderG;
uniform int renderB;
uniform int renderAlpha;
// Texture Samplers
uniform sampler2D DiffuseMap;
uniform sampler2D BakeShadowMap;
uniform sampler2D NormalMap;
uniform sampler2D BakeLightMap;
uniform sampler2D UVTestPattern;
uniform sampler2D TransparencyMap;
uniform sampler2D EmissionMap;
uniform sampler2D SpecularMap;
uniform sampler2D DiffuseLayer;
uniform sampler2D MetalnessMap;
uniform sampler2D RoughnessMap;
uniform sampler2D MRA;
uniform sampler2D TeamColorMap;
uniform sampler2D SphereMap;
uniform sampler2D SubSurfaceScatteringMap;
uniform samplerCube irradianceMap;
uniform samplerCube specularIbl;
uniform sampler2D brdfLUT;
// Shader Params
uniform float normal_map_weight;
uniform float ao_density;
uniform float emission_intensity;
uniform vec4 fresnelParams;
uniform vec4 base_color_mul_color;
uniform vec3 emission_color;
uniform vec3 specular_color;
// Shader Options
uniform float uking_texture2_texcoord;
uniform float bake_shadow_type;
uniform float enable_fresnel;
uniform float enable_emission;
uniform float cSpecularType;
// Texture Map Toggles
uniform int HasDiffuse;
uniform int HasNormalMap;
uniform int HasSpecularMap;
uniform int HasShadowMap;
uniform int HasAmbientOcclusionMap;
uniform int HasLightMap;
uniform int HasTransparencyMap;
uniform int HasEmissionMap;
uniform int HasDiffuseLayer;
uniform int HasMetalnessMap;
uniform int HasRoughnessMap;
uniform int HasMRA;
uniform int HasSubSurfaceScatteringMap;
uniform int roughnessAmount;
uniform int UseAOMap;
uniform int UseCavityMap;
uniform int UseMetalnessMap;
uniform int UseRoughnessMap;
int isTransparent;
struct VertexAttributes {
vec3 objectPosition;
vec2 texCoord;
vec2 texCoord2;
vec2 texCoord3;
vec4 vertexColor;
vec3 normal;
vec3 viewNormal;
vec3 tangent;
vec3 bitangent;
};
out vec4 fragColor;
#define gamma 2.2
// Defined in Utility.frag.
float Luminance(vec3 rgb);
// Defined in BFRES_Utility.frag.
vec3 CalcBumpedNormal(vec3 normal, sampler2D normalMap, VertexAttributes vert, float texCoordIndex);
float AmbientOcclusionBlend(sampler2D BakeShadowMap, VertexAttributes vert, float ao_density);
vec3 EmissionPass(sampler2D EmissionMap, float emission_intensity, VertexAttributes vert, float texCoordIndex, vec3 emission_color);
vec2 displayTexCoord = f_texcoord0;
void main()
{
fragColor = vec4(vec3(0), 1);
// Create a struct for passing all the vertex attributes to other functions.
VertexAttributes vert;
vert.objectPosition = objectPosition;
vert.texCoord = f_texcoord0;
vert.texCoord2 = f_texcoord1;
vert.texCoord3 = f_texcoord2;
vert.vertexColor = vertexColor;
vert.normal = normal;
vert.viewNormal = viewNormal;
vert.tangent = tangent;
vert.bitangent = bitangent;
vec3 N = normal;
if (HasNormalMap == 1 && useNormalMap == 1)
N = CalcBumpedNormal(normal, NormalMap, vert, uking_texture2_texcoord);
if (renderType == 1) // normals vertexColor
{
vec3 displayNormal = (N * 0.5) + 0.5;
fragColor = vec4(displayNormal,1);
}
else if (renderType == 2) // Lighting
{
float halfLambert = dot(difLightDirection, N) * 0.5 + 0.5;
fragColor = vec4(vec3(halfLambert), 1);
}
else if (renderType == 4) //Display Normal
{
if (uking_texture2_texcoord == 1)
fragColor.rgb = texture(NormalMap, f_texcoord1).rgb;
else
fragColor.rgb = texture(NormalMap, displayTexCoord).rgb;
}
else if (renderType == 3) //DiffuseColor
fragColor = vec4(texture(DiffuseMap, displayTexCoord).rgb, 1);
else if (renderType == 5) // vertexColor
fragColor = vertexColor;
else if (renderType == 6) //Display Ambient Occlusion
{
if (HasShadowMap == 1)
{
float ambientOcclusionBlend = AmbientOcclusionBlend(BakeShadowMap, vert, ao_density);
fragColor = vec4(vec3(ambientOcclusionBlend), 1);
}
else
{
fragColor = vec4(1);
}
}
else if (renderType == 7) // uv coords
fragColor = vec4(displayTexCoord.x, displayTexCoord.y, 1, 1);
else if (renderType == 8) // uv test pattern
{
fragColor = vec4(texture(UVTestPattern, displayTexCoord).rgb, 1);
}
else if (renderType == 9) //Display tangents
{
vec3 displayTangent = (tangent * 0.5) + 0.5;
if (dot(tangent, vec3(1)) == 0)
displayTangent = vec3(0);
fragColor = vec4(displayTangent,1);
}
else if (renderType == 10) //Display bitangents
{
vec3 displayBitangent = (bitangent * 0.5) + 0.5;
if (dot(bitangent, vec3(1)) == 0)
displayBitangent = vec3(0);
fragColor = vec4(displayBitangent,1);
}
else if (renderType == 12)
{
fragColor.rgb = boneWeightsColored;
}
else if (renderType == 11) //Light map
{
if (HasLightMap == 1)
{
vec3 lightMap = texture(BakeLightMap, f_texcoord2).rgb;
fragColor = vec4(lightMap, 1);
}
else
{
fragColor = vec4(1);
}
}
else if (renderType == 14) //Shadow
{
if (HasShadowMap == 1)
{
float Shadow = texture(BakeShadowMap, f_texcoord1).g;
fragColor = vec4(vec3(Shadow), 1);
}
else
{
fragColor = vec4(1);
}
}
else if (renderType == 15) //MetalnessMap
{
if (HasMetalnessMap == 1)
{
float mtl = texture(MetalnessMap, displayTexCoord).r;
fragColor = vec4(vec3(mtl), 1);
}
else
{
fragColor = vec4(1);
}
}
else if (renderType == 16) //RoughnessMap
{
if (HasRoughnessMap == 1)
{
float rgh = texture(RoughnessMap, displayTexCoord).r;
fragColor = vec4(vec3(rgh), 1);
}
else
{
fragColor = vec4(1);
}
}
else if (renderType == 17) //SubSurfaceScatteringMap
{
if (HasSubSurfaceScatteringMap == 1)
{
vec3 sss = texture(SubSurfaceScatteringMap, displayTexCoord).rgb;
fragColor = vec4(sss, 1);
}
else
{
fragColor = vec4(1);
}
}
else if (renderType == 18) //EmmissionMap
{
if (HasEmissionMap == 1)
{
vec3 emm = texture(EmissionMap, displayTexCoord).rgb;
fragColor = vec4(emm, 1);
}
else
{
fragColor = vec4(1);
}
}
// Toggles rendering of individual color channels for all render modes.
fragColor.rgb *= vec3(renderR, renderG, renderB);
if (renderR == 1 && renderG == 0 && renderB == 0)
fragColor.rgb = fragColor.rrr;
else if (renderG == 1 && renderR == 0 && renderB == 0)
fragColor.rgb = fragColor.ggg;
else if (renderB == 1 && renderR == 0 && renderG == 0)
fragColor.rgb = fragColor.bbb;
}

View File

@ -0,0 +1,307 @@
#version 330
in vec2 f_texcoord0;
in vec2 f_texcoord1;
in vec2 f_texcoord2;
in vec2 f_texcoord3;
in vec3 objectPosition;
in vec3 normal;
in vec4 vertexColor;
in vec3 tangent;
in vec3 bitangent;
in vec3 boneWeightsColored;
// Viewport Camera/Lighting
uniform mat4 mvpMatrix;
uniform vec3 specLightDirection;
uniform vec3 difLightDirection;
uniform mat4 projMatrix;
uniform mat4 normalMatrix;
uniform mat4 modelViewMatrix;
uniform mat4 rotationMatrix;
uniform int useImageBasedLighting;
uniform int enableCellShading;
uniform vec3 camPos;
uniform vec3 light1Pos;
const float levels = 3.0;
// Viewport Settings
uniform int uvChannel;
uniform int renderType;
uniform int useNormalMap;
uniform vec4 colorSamplerUV;
uniform int renderVertColor;
uniform vec3 difLightColor;
uniform vec3 ambLightColor;
uniform int colorOverride;
uniform float DefaultMetalness;
uniform float DefaultRoughness;
// Channel Toggles
uniform int renderR;
uniform int renderG;
uniform int renderB;
uniform int renderAlpha;
// Texture Samplers
uniform sampler2D tex0;
uniform sampler2D BakeShadowMap;
uniform sampler2D spl;
uniform sampler2D normalMap;
uniform sampler2D BakeLightMap;
uniform sampler2D UVTestPattern;
uniform sampler2D TransparencyMap;
uniform sampler2D EmissionMap;
uniform sampler2D SpecularMap;
uniform sampler2D DiffuseLayer;
uniform sampler2D MetalnessMap;
uniform sampler2D RoughnessMap;
uniform sampler2D MRA;
uniform sampler2D BOTWSpecularMap;
uniform sampler2D SphereMap;
uniform sampler2D SubSurfaceScatteringMap;
uniform samplerCube irradianceMap;
uniform samplerCube specularIbl;
uniform sampler2D brdfLUT;
// Shader Params
uniform float normal_map_weight;
uniform float ao_density;
uniform float emission_intensity;
uniform vec4 fresnelParams;
uniform vec4 base_color_mul_color;
uniform vec3 emission_color;
uniform vec3 specular_color;
// Shader Options
uniform float uking_texture2_texcoord;
uniform float bake_shadow_type;
uniform float enable_fresnel;
uniform float enable_emission;
uniform float cSpecularType;
// Texture Map Toggles
uniform int HasDiffuse;
uniform int HasNormalMap;
uniform int HasSpecularMap;
uniform int HasShadowMap;
uniform int HasAmbientOcclusionMap;
uniform int HasLightMap;
uniform int HasTransparencyMap;
uniform int HasEmissionMap;
uniform int HasDiffuseLayer;
uniform int HasMetalnessMap;
uniform int HasRoughnessMap;
uniform int HasMRA;
uniform int HasBOTWSpecularMap;
uniform int HasSubSurfaceScatteringMap;
uniform int roughnessAmount;
uniform int UseAOMap;
uniform int UseCavityMap;
uniform int UseMetalnessMap;
uniform int UseRoughnessMap;
int isTransparent;
struct VertexAttributes {
vec3 objectPosition;
vec2 texCoord;
vec2 texCoord2;
vec2 texCoord3;
vec4 vertexColor;
vec3 normal;
vec3 viewNormal;
vec3 tangent;
vec3 bitangent;
};
out vec4 fragColor;
#define gamma 2.2
const float PI = 3.14159265359;
// Defined in BFRES_Utility.frag.
vec3 CalcBumpedNormal(vec3 normal, sampler2D normalMap, VertexAttributes vert, float texCoordIndex);
float AmbientOcclusionBlend(sampler2D BakeShadowMap, VertexAttributes vert, float ao_density);
vec3 EmissionPass(sampler2D EmissionMap, float emission_intensity, VertexAttributes vert, float texCoordIndex, vec3 emission_color);
// Shader code adapted from learnopengl.com's PBR tutorial:
// https://learnopengl.com/PBR/Theory
vec3 FresnelSchlick(float cosTheta, vec3 F0)
{
return F0 + (1.0 - F0) * pow(1.0 - cosTheta, 5.0);
}
vec3 FresnelSchlickRoughness(float cosTheta, vec3 F0, float roughness)
{
return F0 + (max(vec3(1.0 - roughness), F0) - F0) * pow(1.0 - cosTheta, 5.0);
}
float DistributionGGX(vec3 N, vec3 H, float roughness)
{
float a = roughness*roughness;
float a2 = a*a;
float NdotH = max(dot(N, H), 0.0);
float NdotH2 = NdotH*NdotH;
float num = a2;
float denom = (NdotH2 * (a2 - 1.0) + 1.0);
denom = PI * denom * denom;
return num / denom;
}
float GeometrySchlickGGX(float NdotV, float roughness)
{
float r = (roughness + 1.0);
float k = (r*r) / 8.0;
float num = NdotV;
float denom = NdotV * (1.0 - k) + k;
return num / denom;
}
float GeometrySmith(vec3 N, vec3 V, vec3 L, float roughness)
{
float NdotV = max(dot(N, V), 0.0);
float NdotL = max(dot(N, L), 0.0);
float ggx2 = GeometrySchlickGGX(NdotV, roughness);
float ggx1 = GeometrySchlickGGX(NdotL, roughness);
return ggx1 * ggx2;
}
vec3 saturation(vec3 rgb, float adjustment)
{
const vec3 W = vec3(0.2125, 0.7154, 0.0721);
vec3 intensity = vec3(dot(rgb, W));
return mix(intensity, rgb, adjustment);
}
void main()
{
fragColor = vec4(1);
// Create a struct for passing all the vertex attributes to other functions.
VertexAttributes vert;
vert.objectPosition = objectPosition;
vert.texCoord = f_texcoord0;
vert.texCoord2 = f_texcoord1;
vert.texCoord3 = f_texcoord2;
vert.vertexColor = vertexColor;
vert.normal = normal;
vert.tangent = tangent;
vert.bitangent = bitangent;
vec3 lightColor = vec3(10);
// Wireframe color.
if (colorOverride == 1)
{
fragColor = vec4(1);
return;
}
vec3 albedo = vec3(1);
if (HasDiffuse == 1)
albedo = pow(texture(tex0, f_texcoord0).rgb, vec3(gamma));
float metallic = 0;
if (HasMetalnessMap == 1)
metallic = texture(MetalnessMap, f_texcoord0).r;
float roughness = 0.5;
if (HasRoughnessMap == 1)
roughness = texture(RoughnessMap, f_texcoord0).r;
float ao = 1;
if (HasShadowMap == 1 && UseAOMap == 1)
ao = texture(BakeShadowMap, f_texcoord1).r;
float shadow = 1;
if (HasShadowMap == 1)
shadow = texture(BakeShadowMap, f_texcoord1).g;
float cavity = 1;
vec3 emission = vec3(0);
if (HasEmissionMap == 1 || enable_emission == 1) //Can be without texture map
emission.rgb += EmissionPass(EmissionMap, emission_intensity, vert, 0, emission_color);
vec3 lightMapColor = vec3(1);
float lightMapIntensity = 0;
if (HasLightMap == 1)
{
lightMapColor = texture(BakeLightMap, f_texcoord1).rgb;
lightMapIntensity = texture(BakeLightMap, f_texcoord1).a;
}
float specIntensity = 0;
if (HasMRA == 1) //Kirby Star Allies PBR map
{
//Note KSA has no way to tell if one gets unused or not because shaders :(
//Usually it's just metalness with roughness and works fine
metallic = texture(MRA, f_texcoord0).r;
roughness = texture(MRA, f_texcoord0).g;
specIntensity = texture(MRA, f_texcoord0).b;
ao = texture(MRA, f_texcoord0).a;
}
// Calculate shading vectors.
vec3 I = vec3(0,0,-1) * mat3(mvpMatrix);
vec3 N = normal;
if (HasNormalMap == 1 && useNormalMap == 1)
N = CalcBumpedNormal(normal, normalMap, vert, 0);
vec3 V = normalize(I); // view
vec3 L = normalize(specLightDirection); // Light
vec3 H = normalize(specLightDirection + I); // half angle
vec3 R = reflect(I, N); // reflection
// Diffuse pass
vec3 diffuseIblColor = texture(irradianceMap, N).rgb;
vec3 diffuseTerm = albedo * diffuseIblColor;
diffuseTerm *= cavity;
diffuseTerm *= ao;
diffuseTerm *= shadow;
// Adjust for metalness.
diffuseTerm *= clamp(1 - metallic, 0, 1);
// Specular pass.
int maxSpecularLod = 8;
vec3 specularIblColor = textureLod(specularIbl, R, roughness * maxSpecularLod).rgb;
vec3 f0 = mix(vec3(0.04), albedo, metallic); // dialectric
vec3 kS = FresnelSchlickRoughness(max(dot(N, H), 0.0), f0, roughness);
vec3 specularTerm = specularIblColor * kS;
// Add render passes.
fragColor.rgb = vec3(0);
fragColor.rgb += diffuseTerm;
fragColor.rgb += specularTerm;
// Global brightness adjustment.
fragColor.rgb *= 2.5;
// Convert back to sRGB.
fragColor.rgb = pow(fragColor.rgb, vec3(1 / gamma));
// Alpha calculations.
float alpha = texture(tex0, f_texcoord0).a;
fragColor.a = alpha;
}

View File

@ -0,0 +1,135 @@
#version 330
// A struct is used for what would normally be attributes from the vert/geom shader.
struct VertexAttributes
{
vec3 objectPosition;
vec2 texCoord;
vec2 texCoord2;
vec2 texCoord3;
vec4 vertexColor;
vec3 normal;
vec3 viewNormal;
vec3 tangent;
vec3 bitangent;
};
uniform mat4 sphereMatrix;
uniform sampler2D SphereMap;
uniform samplerCube specularIbl;
uniform int HasSphereMap;
uniform int hasTangents;
// Defined in Utility.frag.
float Luminance(vec3 rgb);
vec3 SpecularPass(vec3 I, vec3 normal, int HasSpecularMap, sampler2D SpecularMap, vec3 SpecColor, VertexAttributes vert, float texcoord2)
{
float specBrdf = max(dot(I, normal), 0);
float exponent = 8;
if (SpecColor == vec3(0)) //Color shouldn't be black unless it's not set
SpecColor = vec3(1);
if (HasSpecularMap == 0)
{
return 0.1 * SpecColor * pow(specBrdf, exponent);
}
// TODO: Different games use the channels for separate textures.
vec3 specularTex = vec3(1);
if (texcoord2 == 1)
specularTex = texture(SpecularMap, vert.texCoord2).rrr;
else
specularTex = texture(SpecularMap, vert.texCoord).rrr;
vec3 result = specularTex * SpecColor * pow(specBrdf, exponent);
result *= SpecColor.rgb;
float intensity = 0.3;
return result * intensity;
}
vec3 EmissionPass(sampler2D EmissionMap, float emission_intensity, VertexAttributes vert, float texCoordIndex, vec3 emission_color)
{
vec3 result = vec3(0);
// BOTW somtimes uses second uv channel for emission map
vec3 emission = vec3(1);
if (texCoordIndex == 1)
emission = texture2D(EmissionMap, vert.texCoord2).rgb;
else
emission = texture2D(EmissionMap, vert.texCoord).rgb;
// If tex is empty then use full brightness.
//Some emissive mats have emission but no texture
// if (Luminance(emission.rgb) < 0.01)
// result += vec3(emission_intensity) * emission_color;
result += emission.rgb;
return result;
}
vec3 SphereMapColor(vec3 viewNormal, sampler2D spheremap) {
// Calculate UVs based on view space normals.
vec2 sphereTexcoord = vec2(viewNormal.x, (1 - viewNormal.y));
return texture(spheremap, sphereTexcoord * 0.5 + 0.5).rgb;
}
vec3 ReflectionPass(vec3 N, vec3 I, vec4 diffuseMap, float aoBlend, vec3 tintColor, VertexAttributes vert) {
vec3 reflectionPass = vec3(0);
// cubemap reflection
vec3 R = reflect(I, N);
R.y *= -1.0;
vec3 cubeColor = texture(specularIbl, R).aaa;
// reflectionPass += diffuseMap.aaa * cubeColor * tintColor;
vec3 viewNormal = mat3(sphereMatrix) * normalize(N.xyz);
vec3 sphereMapColor = SphereMapColor(vert.viewNormal, SphereMap);
reflectionPass += sphereMapColor * HasSphereMap;
reflectionPass = max(reflectionPass, vec3(0));
return reflectionPass;
}
float AmbientOcclusionBlend(sampler2D BakeShadowMap, VertexAttributes vert, float ao_density)
{
float aoMap = texture(BakeShadowMap, vert.texCoord2).r;
return mix(aoMap, 1, ao_density);
}
vec3 CalcBumpedNormal(vec3 inputNormal, sampler2D normalMap, VertexAttributes vert, float texCoordIndex)
{
if (hasTangents == 0)
return inputNormal;
float normalIntensity = 1;
//if (normal_map_weight != 0) //MK8 and splatoon 1/2 uses this param
// normalIntensity = normal_map_weight;
// Calculate the resulting normal map and intensity.
vec3 normalMapColor = vec3(1);
if (texCoordIndex == 1)
normalMapColor = vec3(texture(normalMap, vert.texCoord2).rg, 1);
else
normalMapColor = vec3(texture(normalMap, vert.texCoord).rg, 1);
normalMapColor = mix(vec3(0.5, 0.5, 1), normalMapColor, normalIntensity);
// Remap the normal map to the correct range.
vec3 normalMapNormal = 2.0 * normalMapColor - vec3(1);
// TBN Matrix.
vec3 T = vert.tangent;
vec3 B = vert. bitangent;
if (Luminance(B) < 0.01)
B = normalize(cross(T, vert.normal));
mat3 tbnMatrix = mat3(T, B, vert.normal);
vec3 newNormal = tbnMatrix * normalMapNormal;
return normalize(newNormal);
}

View File

@ -0,0 +1,7 @@
#version 330 core
out vec4 FragColor;
void main()
{
FragColor = vec4(1.0, 1.0, 0.0, 1.0);
}

View File

@ -0,0 +1,25 @@
#version 330 core
layout (triangles) in;
layout (line_strip, max_vertices = 6) out;
in VS_OUT {
vec3 normal;
} gs_in[];
const float MAGNITUDE = 0.4;
void GenerateLine(int index)
{
gl_Position = gl_in[index].gl_Position;
EmitVertex();
gl_Position = gl_in[index].gl_Position + vec4(gs_in[index].normal, 0.0) * MAGNITUDE;
EmitVertex();
EndPrimitive();
}
void main()
{
GenerateLine(0); // first vertex normal
GenerateLine(1); // second vertex normal
GenerateLine(2); // third vertex normal
}

View File

@ -0,0 +1,29 @@
#version 330 core
in vec3 vPosition;
in vec3 vNormal;
in vec3 vTangent;
in vec3 vBitangent;
in vec2 vUV0;
in vec4 vColor;
in vec4 vBone;
in vec4 vWeight;
in vec2 vUV1;
in vec2 vUV2;
in vec3 vPosition2;
in vec3 vPosition3;
out VS_OUT {
vec3 normal;
} vs_out;
uniform mat4 projection;
uniform mat4 view;
uniform mat4 model;
void main()
{
gl_Position = projection * view * model * vec4(vPosition, 1.0);
mat3 normalMatrix = mat3(transpose(inverse(view * model)));
vs_out.normal = normalize(vec3(projection * vec4(normalMatrix * vNormal, 0.0)));
}

View File

@ -0,0 +1,16 @@
#version 330 core
out vec4 FragColor;
in vec3 TexCoords;
uniform samplerCube environmentMap;
void main()
{
vec3 envColor = textureLod(environmentMap, TexCoords, 0.0).rgb;
envColor = envColor / (envColor + vec3(1.0));
envColor = pow(envColor, vec3(1.0/2.2));
FragColor = vec4(envColor, 1.0);
}

View File

@ -0,0 +1,15 @@
#version 330 core
layout (location = 0) in vec3 aPos;
uniform mat4 projection;
uniform mat4 rotView;
out vec3 TexCoords;
void main()
{
TexCoords = aPos;
vec4 clipPos = rotView * projection * vec4(aPos, 1.0);
gl_Position = clipPos.xyww;
}

View File

@ -0,0 +1,36 @@
#version 110
varying vec2 f_texcoord0;
varying vec2 f_texcoord1;
varying vec2 f_texcoord2;
varying vec2 f_texcoord3;
varying vec3 objectPosition;
varying vec3 normal;
varying vec3 viewNormal;
varying vec4 vertexColor;
varying vec3 tangent;
varying vec3 bitangent;
varying vec3 boneWeightsColored;
uniform sampler2D DiffuseMap;
uniform int isTransparent;
#define gamma 2.2
void main()
{
vec4 fragColor = vec4(vec3(0), 1);
vec4 diffuseMapColor = vec4(texture2D(DiffuseMap, f_texcoord0).rgb, 1);
fragColor.rgb += diffuseMapColor.rgb;
fragColor.a *= texture2D(DiffuseMap, f_texcoord0).a;
if (isTransparent != 1)
fragColor.a = 1.0;
gl_FragColor = fragColor;
}

View File

@ -0,0 +1,50 @@
#version 110
uniform mat4 mvpMatrix;
attribute vec3 vPosition;
attribute vec3 vNormal;
attribute vec3 vTangent;
attribute vec3 vBitangent;
attribute vec2 vUV0;
attribute vec4 vColor;
attribute vec4 vBone;
attribute vec4 vWeight;
attribute vec2 vUV1;
attribute vec2 vUV2;
attribute vec3 vPosition2;
attribute vec3 vPosition3;
varying vec2 f_texcoord0;
varying vec2 f_texcoord1;
varying vec2 f_texcoord2;
varying vec2 f_texcoord3;
varying vec3 normal;
varying vec4 vertexColor;
varying vec3 tangent;
varying vec3 bitangent;
// Shader Options
uniform vec4 gsys_bake_st0;
uniform vec4 gsys_bake_st1;
// Skinning uniforms
uniform mat4 bones[200];
//Meshes have a bone index and will use their transform depending on skin influence amount
uniform mat4 singleBoneBindTransform;
uniform int NoSkinning;
uniform int RigidSkinning;
void main()
{
gl_Position = mvpMatrix * vec4(vPosition.xyz, 1.0);
normal = vNormal;
f_texcoord0 = vUV0;
f_texcoord1 = vUV1;
f_texcoord2 = vUV1;
f_texcoord3 = vUV2;
tangent = vTangent;
bitangent = vBitangent;
vertexColor = vColor;
}

View File

@ -0,0 +1,21 @@
#version 330
float Luminance(vec3 rgb)
{
const vec3 W = vec3(0.2125, 0.7154, 0.0721);
return dot(rgb, W);
}
// The hardware conversion doesn't work on all drivers.
// http://entropymine.com/imageworsener/srgbformula/
float SrgbToLinear(float x)
{
if (x < 0.03928)
return x * 0.0773993808; // 1.0 / 12.92
else
return pow((x + 0.055) / 1.055, 2.4);
}
vec3 SrgbToLinear(vec3 color) {
return vec3(SrgbToLinear(color.r), SrgbToLinear(color.g), SrgbToLinear(color.b));
}

View File

@ -0,0 +1,16 @@
#version 330
float WireframeIntensity(vec3 distanceToEdges) {
float minDistance = min(min(distanceToEdges.x, distanceToEdges.y), distanceToEdges.z);
// Constant wireframe thickness relative to the screen size.
float thickness = 0.5;
float smoothAmount = 0.5;
float delta = fwidth(minDistance);
float edge0 = delta * thickness;
float edge1 = edge0 + (delta * smoothAmount);
float smoothedDistance = smoothstep(edge0, edge1, minDistance);
return 1 - smoothedDistance;
}

View File

@ -0,0 +1,374 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Costura.Fody.3.1.4\build\Costura.Fody.props" Condition="Exists('..\packages\Costura.Fody.3.1.4\build\Costura.Fody.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E861C28B-B039-48F7-9A4F-C83F67C0ADDE}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>Switch_Toolbox</RootNamespace>
<AssemblyName>Switch_Toolbox</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Tool.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="BarsLibrary, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\ConsoleApp1\BarsLibrary\bin\Release\BarsLibrary.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="BevelEngineArchive_Lib">
<HintPath>..\..\..\..\Documents\Visual Studio 2017\Projects\WindowsFormsApp2\WindowsFormsApp2\Lib\BevelEngineArchive_Lib.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ByamlExt">
<HintPath>..\..\..\..\Documents\Visual Studio 2017\Projects\WindowsFormsApp2\WindowsFormsApp2\Lib\ByamlExt.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Costura, Version=3.1.4.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.3.1.4\lib\net46\Costura.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="CsvHelper, Version=8.0.0.0, Culture=neutral, PublicKeyToken=8c4959082be5c823, processorArchitecture=MSIL">
<HintPath>..\packages\CsvHelper.8.0.0-beta01\lib\net45\CsvHelper.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="EditorCoreCommon">
<HintPath>..\..\..\..\Documents\Visual Studio 2017\Projects\WindowsFormsApp2\WindowsFormsApp2\Lib\EditorCoreCommon.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="NAudio">
<HintPath>..\Switch_FileFormatsMain\Externals\NAudio.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="OpenTK">
<HintPath>..\..\..\..\Documents\Visual Studio 2017\Projects\WindowsFormsApp2\WindowsFormsApp2\Lib\OpenTK.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="OpenTK.GLControl">
<HintPath>..\..\..\..\Documents\Visual Studio 2017\Projects\WindowsFormsApp2\WindowsFormsApp2\Lib\OpenTK.GLControl.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="SARCExt">
<HintPath>..\..\..\..\Documents\Visual Studio 2017\Projects\WindowsFormsApp2\WindowsFormsApp2\Lib\SARCExt.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="SFGraphics">
<HintPath>..\..\..\..\Documents\Visual Studio 2017\Projects\WindowsFormsApp2\WindowsFormsApp2\Lib\SFGraphics.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="SFGraphics.Utils">
<HintPath>..\..\..\..\Documents\Visual Studio 2017\Projects\WindowsFormsApp2\WindowsFormsApp2\Lib\SFGraphics.Utils.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Syroot.BinaryData">
<HintPath>..\..\..\..\Documents\Visual Studio 2017\Projects\WindowsFormsApp2\WindowsFormsApp2\Lib\Syroot.BinaryData.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Syroot.Maths">
<HintPath>..\..\..\..\Documents\Visual Studio 2017\Projects\WindowsFormsApp2\WindowsFormsApp2\Lib\Syroot.Maths.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Syroot.NintenTools.NSW.Bfres, Version=1.2.3.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Switch_FileFormatsMain\Externals\Syroot.NintenTools.NSW.Bfres.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Syroot.NintenTools.NSW.Bntx, Version=1.2.3.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\Documents\GitHub\Nintendo_Switch_BFRES_Library\src - Copy (2)\Syroot.NintenTools.Bntx\bin\Release\net45\Syroot.NintenTools.NSW.Bntx.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="VGAudio">
<HintPath>..\Switch_FileFormatsMain\Externals\VGAudio.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="WeifenLuo.WinFormsUI.Docking, Version=3.0.4.0, Culture=neutral, PublicKeyToken=5cded1a1a0a7b481, processorArchitecture=MSIL">
<HintPath>..\packages\DockPanelSuite.3.0.4\lib\net40\WeifenLuo.WinFormsUI.Docking.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="WeifenLuo.WinFormsUI.Docking.ThemeVS2015, Version=3.0.4.0, Culture=neutral, PublicKeyToken=5cded1a1a0a7b481, processorArchitecture=MSIL">
<HintPath>..\packages\DockPanelSuite.ThemeVS2015.3.0.4\lib\net40\WeifenLuo.WinFormsUI.Docking.ThemeVS2015.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Config.cs" />
<Compile Include="GUI\Credits.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="GUI\Credits.Designer.cs">
<DependentUpon>Credits.cs</DependentUpon>
</Compile>
<Compile Include="GUI\NodeWrappers.cs" />
<Compile Include="GUI\Settings.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="GUI\Settings.Designer.cs">
<DependentUpon>Settings.cs</DependentUpon>
</Compile>
<Compile Include="GUI\Startup Window.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="GUI\Startup Window.Designer.cs">
<DependentUpon>Startup Window.cs</DependentUpon>
</Compile>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="GUI\PluginManager.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="GUI\PluginManager.Designer.cs">
<DependentUpon>PluginManager.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="GUI\Credits.resx">
<DependentUpon>Credits.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\Settings.resx">
<DependentUpon>Settings.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\Startup Window.resx">
<DependentUpon>Startup Window.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\PluginManager.resx">
<DependentUpon>PluginManager.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<None Include="Shader\Bfres\BFRES.frag">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Shader\Bfres\BFRES.vert">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Shader\Bfres\BFRES_Botw.frag">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Shader\Bfres\BFRES_Debug.frag">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Shader\Bfres\BFRES_PBR.frag">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Shader\Bfres\BFRES_utility.frag">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Shader\Bfres\Normals.frag">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Shader\Bfres\Normals.geom">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Shader\Bfres\Normals.vert">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Shader\HDRSkyBox\HDRSkyBox.frag">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Shader\HDRSkyBox\HDRSkyBox.vert">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Shader\Legacy\BFRES.frag" />
<None Include="Shader\Legacy\BFRES.vert" />
<None Include="Shader\Utility\Utility.frag">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Shader\Utility\Wireframe.frag">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="Rendering\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GL_EditorFramework-master\GL_Core\GL_Core.csproj">
<Project>{29647ba5-2859-46f0-a99e-c3a387a9447a}</Project>
<Name>GL_Core</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\Switch_Toolbox_Library\Switch_Toolbox_Library.csproj">
<Project>{96820047-2a39-4e5a-bfa4-e84fff5c66cf}</Project>
<Name>Switch_Toolbox_Library</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\Updater\Updater.csproj">
<Project>{d82a2c08-2a65-43af-bda6-a36cc27aa003}</Project>
<Name>Updater</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="libzstd.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\AssimpNet.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\BarsLibrary.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\BezelEngineArchive_Lib.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\ByamlExt.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\Costura.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\CsvHelper.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\EditorCoreCommon.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\Licenses\Assimp COPYRIGHT.txt" />
<Content Include="Lib\Licenses\SFGraphics COPYRIGHT.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\Licenses\SmashForge COPYRIGHT.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\NAudio.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\Octokit.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\OpenTK.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\OpenTK.GLControl.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\Plugins\Blank.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\SARCExt.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\SFGraphics.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\SFGraphics.Utils.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\Switch_Toolbox.Library.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\Syroot.BinaryData.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\Syroot.Maths.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\VGAudio.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\VisualStudioTabControl.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\WeifenLuo.WinFormsUI.Docking.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\WeifenLuo.WinFormsUI.Docking.ThemeVS2015.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\ZstdNet.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\Licenses\ZSTD NET COPYRIGHT.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Projects\Recent\DUMMY.txt" />
<None Include="Resources\Logo.png" />
<Content Include="Tool.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Fody.3.2.9\build\Fody.targets" Condition="Exists('..\packages\Fody.3.2.9\build\Fody.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Fody.3.2.9\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.3.2.9\build\Fody.targets'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.3.1.4\build\Costura.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.3.1.4\build\Costura.Fody.props'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.3.1.4\build\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.3.1.4\build\Costura.Fody.targets'))" />
</Target>
<Import Project="..\packages\Costura.Fody.3.1.4\build\Costura.Fody.targets" Condition="Exists('..\packages\Costura.Fody.3.1.4\build\Costura.Fody.targets')" />
</Project>

BIN
Switch_Toolbox/Tool.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

BIN
Switch_Toolbox/libzstd.dll Normal file

Binary file not shown.

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Costura.Fody" version="3.1.4" targetFramework="net461" />
<package id="CsvHelper" version="8.0.0-beta01" targetFramework="net462" />
<package id="DockPanelSuite" version="3.0.4" targetFramework="net461" />
<package id="DockPanelSuite.ThemeVS2015" version="3.0.4" targetFramework="net461" />
<package id="Fody" version="3.2.9" targetFramework="net461" developmentDependency="true" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net462" />
</packages>