1
0
mirror of synced 2025-02-12 09:12:59 +01:00

Fix compile issues and update to latest

This commit is contained in:
KillzXGaming 2018-11-18 12:09:54 -05:00
parent 9dcf9eb15f
commit d30f94eb9a
13 changed files with 149 additions and 67 deletions

View File

@ -1416,7 +1416,7 @@ namespace Bfres.Structs
shape.CreateNewBoundingBoxes(); shape.CreateNewBoundingBoxes();
shape.CreateBoneList(obj, this); shape.CreateBoneList(obj, this);
shape.CreateIndexList(obj, this); shape.CreateIndexList(obj, this);
shape.ApplyImportSettings(csvsettings); shape.ApplyImportSettings(csvsettings, GetMaterial(shape.MaterialIndex));
shape.SaveShape(); shape.SaveShape();
shape.SaveVertexBuffer(); shape.SaveVertexBuffer();
shape.BFRESRender = BFRESRender; shape.BFRESRender = BFRESRender;
@ -1561,7 +1561,7 @@ namespace Bfres.Structs
shape.CreateNewBoundingBoxes(); shape.CreateNewBoundingBoxes();
shape.CreateBoneList(obj, this); shape.CreateBoneList(obj, this);
shape.CreateIndexList(obj, this); shape.CreateIndexList(obj, this);
shape.ApplyImportSettings(settings); shape.ApplyImportSettings(settings, GetMaterial(shape.MaterialIndex));
shape.SaveShape(); shape.SaveShape();
shape.SaveVertexBuffer(); shape.SaveVertexBuffer();
shape.BFRESRender = BFRESRender; shape.BFRESRender = BFRESRender;
@ -1579,6 +1579,10 @@ namespace Bfres.Structs
} }
BFRESRender.UpdateVertexData(); BFRESRender.UpdateVertexData();
} }
public FMAT GetMaterial(int index)
{
return materials.Values.ElementAt(index);
}
public void AddMaterials(string FileName, bool Replace = true) public void AddMaterials(string FileName, bool Replace = true)
{ {
string ext = System.IO.Path.GetExtension(FileName); string ext = System.IO.Path.GetExtension(FileName);
@ -1712,8 +1716,6 @@ namespace Bfres.Structs
if (dialog.ShowDialog() == DialogResult.OK) if (dialog.ShowDialog() == DialogResult.OK)
{ {
Text = dialog.textBox1.Text;
((FMDL)Parent.Parent).materials.Remove(Text); ((FMDL)Parent.Parent).materials.Remove(Text);
Text = dialog.textBox1.Text; Text = dialog.textBox1.Text;
((FMDL)Parent.Parent).materials.Add(Text, this); ((FMDL)Parent.Parent).materials.Add(Text, this);
@ -2123,7 +2125,7 @@ namespace Bfres.Structs
Parent.Nodes.Remove(this); Parent.Nodes.Remove(this);
} }
} }
public void ApplyImportSettings(BfresModelImportSettings settings) public void ApplyImportSettings(BfresModelImportSettings settings, FMAT mat)
{ {
if (settings.FlipUVsVertical) if (settings.FlipUVsVertical)
{ {
@ -2155,6 +2157,40 @@ namespace Bfres.Structs
MessageBox.Show($"Failed to generate tangents for mesh {Text}"); MessageBox.Show($"Failed to generate tangents for mesh {Text}");
} }
} }
if (settings.SetDefaultParamData)
{
foreach (var param in mat.matparam.Values)
{
switch (param.Name)
{
case "const_color0":
case "const_color1":
case "const_color2":
case "const_color3":
case "base_color_mul_color":
case "uniform0_mul_color":
case "uniform1_mul_color":
case "uniform2_mul_color":
case "uniform3_mul_color":
case "uniform4_mul_color":
case "proc_texture_2d_mul_color":
case "proc_texture_3d_mul_color":
case "displacement1_color":
case "ripple_emission_color":
case "hack_color":
case "stain_color":
case "displacement_color":
param.ValueFloat = new float[] {1,1,1,1 };
break;
case "gsys_bake_st0":
param.ValueFloat = new float[] { 1, 1, 0, 0 };
break;
case "gsys_bake_st1":
param.ValueFloat = new float[] { 1, 1, 0, 0 };
break;
}
}
}
} }
public void TransformPosition(Vector3 Position, Vector3 Rotation, Vector3 Scale) public void TransformPosition(Vector3 Position, Vector3 Rotation, Vector3 Scale)
{ {

View File

@ -80,6 +80,8 @@ namespace FirstPlugin
#region structs #region structs
public void LoadViewport() public void LoadViewport()
{
if (!Runtime.DisableViewport)
{ {
if (!EditorIsViewportActive(FirstPlugin.DockedViewport)) if (!EditorIsViewportActive(FirstPlugin.DockedViewport))
{ {
@ -88,6 +90,7 @@ namespace FirstPlugin
FirstPlugin.DockedViewport = Viewport.Instance; FirstPlugin.DockedViewport = Viewport.Instance;
} }
} }
}
public bool EditorIsViewportActive(DockContent dock) public bool EditorIsViewportActive(DockContent dock)
{ {
if (dock is Viewport) if (dock is Viewport)

View File

@ -61,6 +61,7 @@
this.chkBoxFlipUvsY = new System.Windows.Forms.CheckBox(); this.chkBoxFlipUvsY = new System.Windows.Forms.CheckBox();
this.chkBoxImportBones = new System.Windows.Forms.CheckBox(); this.chkBoxImportBones = new System.Windows.Forms.CheckBox();
this.panel8 = new System.Windows.Forms.Panel(); this.panel8 = new System.Windows.Forms.Panel();
this.chkBoxRotNegative90Y = new System.Windows.Forms.CheckBox();
this.useMaterialLabel = new System.Windows.Forms.Label(); this.useMaterialLabel = new System.Windows.Forms.Label();
this.textBoxMaterialPath = new System.Windows.Forms.TextBox(); this.textBoxMaterialPath = new System.Windows.Forms.TextBox();
this.chkBoxEnableWeightIndices = new System.Windows.Forms.CheckBox(); this.chkBoxEnableWeightIndices = new System.Windows.Forms.CheckBox();
@ -83,7 +84,7 @@
this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage2 = new System.Windows.Forms.TabPage(); this.tabPage2 = new System.Windows.Forms.TabPage();
this.tabPageAdvanced = new System.Windows.Forms.TabPage(); this.tabPageAdvanced = new System.Windows.Forms.TabPage();
this.chkBoxRotNegative90Y = new System.Windows.Forms.CheckBox(); this.chkBoxParamDefaults = new System.Windows.Forms.CheckBox();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.panel2.SuspendLayout(); this.panel2.SuspendLayout();
this.panel3.SuspendLayout(); this.panel3.SuspendLayout();
@ -383,7 +384,7 @@
// chkBoxFlipUvsY // chkBoxFlipUvsY
// //
this.chkBoxFlipUvsY.AutoSize = true; this.chkBoxFlipUvsY.AutoSize = true;
this.chkBoxFlipUvsY.Location = new System.Drawing.Point(3, 21); this.chkBoxFlipUvsY.Location = new System.Drawing.Point(3, 39);
this.chkBoxFlipUvsY.Name = "chkBoxFlipUvsY"; this.chkBoxFlipUvsY.Name = "chkBoxFlipUvsY";
this.chkBoxFlipUvsY.Size = new System.Drawing.Size(65, 17); this.chkBoxFlipUvsY.Size = new System.Drawing.Size(65, 17);
this.chkBoxFlipUvsY.TabIndex = 4; this.chkBoxFlipUvsY.TabIndex = 4;
@ -394,7 +395,7 @@
// chkBoxImportBones // chkBoxImportBones
// //
this.chkBoxImportBones.AutoSize = true; this.chkBoxImportBones.AutoSize = true;
this.chkBoxImportBones.Location = new System.Drawing.Point(3, 44); this.chkBoxImportBones.Location = new System.Drawing.Point(3, 62);
this.chkBoxImportBones.Name = "chkBoxImportBones"; this.chkBoxImportBones.Name = "chkBoxImportBones";
this.chkBoxImportBones.Size = new System.Drawing.Size(88, 17); this.chkBoxImportBones.Size = new System.Drawing.Size(88, 17);
this.chkBoxImportBones.TabIndex = 10; this.chkBoxImportBones.TabIndex = 10;
@ -405,6 +406,7 @@
// //
// panel8 // panel8
// //
this.panel8.Controls.Add(this.chkBoxParamDefaults);
this.panel8.Controls.Add(this.chkBoxRotNegative90Y); this.panel8.Controls.Add(this.chkBoxRotNegative90Y);
this.panel8.Controls.Add(this.useMaterialLabel); this.panel8.Controls.Add(this.useMaterialLabel);
this.panel8.Controls.Add(this.textBoxMaterialPath); this.panel8.Controls.Add(this.textBoxMaterialPath);
@ -428,6 +430,17 @@
this.panel8.Size = new System.Drawing.Size(498, 322); this.panel8.Size = new System.Drawing.Size(498, 322);
this.panel8.TabIndex = 11; this.panel8.TabIndex = 11;
// //
// chkBoxRotNegative90Y
//
this.chkBoxRotNegative90Y.AutoSize = true;
this.chkBoxRotNegative90Y.Location = new System.Drawing.Point(3, 108);
this.chkBoxRotNegative90Y.Name = "chkBoxRotNegative90Y";
this.chkBoxRotNegative90Y.Size = new System.Drawing.Size(117, 17);
this.chkBoxRotNegative90Y.TabIndex = 29;
this.chkBoxRotNegative90Y.Text = "Rotate -90 degrees";
this.chkBoxRotNegative90Y.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.chkBoxRotNegative90Y.UseVisualStyleBackColor = true;
//
// useMaterialLabel // useMaterialLabel
// //
this.useMaterialLabel.AutoSize = true; this.useMaterialLabel.AutoSize = true;
@ -452,7 +465,7 @@
// chkBoxEnableWeightIndices // chkBoxEnableWeightIndices
// //
this.chkBoxEnableWeightIndices.AutoSize = true; this.chkBoxEnableWeightIndices.AutoSize = true;
this.chkBoxEnableWeightIndices.Location = new System.Drawing.Point(238, 159); this.chkBoxEnableWeightIndices.Location = new System.Drawing.Point(240, 154);
this.chkBoxEnableWeightIndices.Name = "chkBoxEnableWeightIndices"; this.chkBoxEnableWeightIndices.Name = "chkBoxEnableWeightIndices";
this.chkBoxEnableWeightIndices.Size = new System.Drawing.Size(140, 17); this.chkBoxEnableWeightIndices.Size = new System.Drawing.Size(140, 17);
this.chkBoxEnableWeightIndices.TabIndex = 25; this.chkBoxEnableWeightIndices.TabIndex = 25;
@ -462,7 +475,7 @@
// chkBoxEnableBitans // chkBoxEnableBitans
// //
this.chkBoxEnableBitans.AutoSize = true; this.chkBoxEnableBitans.AutoSize = true;
this.chkBoxEnableBitans.Location = new System.Drawing.Point(238, 136); this.chkBoxEnableBitans.Location = new System.Drawing.Point(240, 131);
this.chkBoxEnableBitans.Name = "chkBoxEnableBitans"; this.chkBoxEnableBitans.Name = "chkBoxEnableBitans";
this.chkBoxEnableBitans.Size = new System.Drawing.Size(112, 17); this.chkBoxEnableBitans.Size = new System.Drawing.Size(112, 17);
this.chkBoxEnableBitans.TabIndex = 24; this.chkBoxEnableBitans.TabIndex = 24;
@ -472,7 +485,7 @@
// chkBoxEnableTans // chkBoxEnableTans
// //
this.chkBoxEnableTans.AutoSize = true; this.chkBoxEnableTans.AutoSize = true;
this.chkBoxEnableTans.Location = new System.Drawing.Point(238, 113); this.chkBoxEnableTans.Location = new System.Drawing.Point(240, 108);
this.chkBoxEnableTans.Name = "chkBoxEnableTans"; this.chkBoxEnableTans.Name = "chkBoxEnableTans";
this.chkBoxEnableTans.Size = new System.Drawing.Size(107, 17); this.chkBoxEnableTans.Size = new System.Drawing.Size(107, 17);
this.chkBoxEnableTans.TabIndex = 23; this.chkBoxEnableTans.TabIndex = 23;
@ -483,7 +496,7 @@
// chkBoxEnableVertColors // chkBoxEnableVertColors
// //
this.chkBoxEnableVertColors.AutoSize = true; this.chkBoxEnableVertColors.AutoSize = true;
this.chkBoxEnableVertColors.Location = new System.Drawing.Point(238, 90); this.chkBoxEnableVertColors.Location = new System.Drawing.Point(240, 85);
this.chkBoxEnableVertColors.Name = "chkBoxEnableVertColors"; this.chkBoxEnableVertColors.Name = "chkBoxEnableVertColors";
this.chkBoxEnableVertColors.Size = new System.Drawing.Size(124, 17); this.chkBoxEnableVertColors.Size = new System.Drawing.Size(124, 17);
this.chkBoxEnableVertColors.TabIndex = 22; this.chkBoxEnableVertColors.TabIndex = 22;
@ -494,7 +507,7 @@
// chkBoxEnableUVs // chkBoxEnableUVs
// //
this.chkBoxEnableUVs.AutoSize = true; this.chkBoxEnableUVs.AutoSize = true;
this.chkBoxEnableUVs.Location = new System.Drawing.Point(238, 67); this.chkBoxEnableUVs.Location = new System.Drawing.Point(240, 62);
this.chkBoxEnableUVs.Name = "chkBoxEnableUVs"; this.chkBoxEnableUVs.Name = "chkBoxEnableUVs";
this.chkBoxEnableUVs.Size = new System.Drawing.Size(82, 17); this.chkBoxEnableUVs.Size = new System.Drawing.Size(82, 17);
this.chkBoxEnableUVs.TabIndex = 21; this.chkBoxEnableUVs.TabIndex = 21;
@ -505,7 +518,7 @@
// chkBoxEnableNormals // chkBoxEnableNormals
// //
this.chkBoxEnableNormals.AutoSize = true; this.chkBoxEnableNormals.AutoSize = true;
this.chkBoxEnableNormals.Location = new System.Drawing.Point(238, 44); this.chkBoxEnableNormals.Location = new System.Drawing.Point(240, 39);
this.chkBoxEnableNormals.Name = "chkBoxEnableNormals"; this.chkBoxEnableNormals.Name = "chkBoxEnableNormals";
this.chkBoxEnableNormals.Size = new System.Drawing.Size(100, 17); this.chkBoxEnableNormals.Size = new System.Drawing.Size(100, 17);
this.chkBoxEnableNormals.TabIndex = 20; this.chkBoxEnableNormals.TabIndex = 20;
@ -517,7 +530,7 @@
// //
this.chkBoxEnablePositions.AutoSize = true; this.chkBoxEnablePositions.AutoSize = true;
this.chkBoxEnablePositions.Enabled = false; this.chkBoxEnablePositions.Enabled = false;
this.chkBoxEnablePositions.Location = new System.Drawing.Point(238, 21); this.chkBoxEnablePositions.Location = new System.Drawing.Point(240, 16);
this.chkBoxEnablePositions.Name = "chkBoxEnablePositions"; this.chkBoxEnablePositions.Name = "chkBoxEnablePositions";
this.chkBoxEnablePositions.Size = new System.Drawing.Size(104, 17); this.chkBoxEnablePositions.Size = new System.Drawing.Size(104, 17);
this.chkBoxEnablePositions.TabIndex = 19; this.chkBoxEnablePositions.TabIndex = 19;
@ -528,7 +541,7 @@
// chkBoxRecalcNormals // chkBoxRecalcNormals
// //
this.chkBoxRecalcNormals.AutoSize = true; this.chkBoxRecalcNormals.AutoSize = true;
this.chkBoxRecalcNormals.Location = new System.Drawing.Point(3, 136); this.chkBoxRecalcNormals.Location = new System.Drawing.Point(3, 154);
this.chkBoxRecalcNormals.Name = "chkBoxRecalcNormals"; this.chkBoxRecalcNormals.Name = "chkBoxRecalcNormals";
this.chkBoxRecalcNormals.Size = new System.Drawing.Size(124, 17); this.chkBoxRecalcNormals.Size = new System.Drawing.Size(124, 17);
this.chkBoxRecalcNormals.TabIndex = 18; this.chkBoxRecalcNormals.TabIndex = 18;
@ -553,7 +566,7 @@
// chkBoxTransformMatrix // chkBoxTransformMatrix
// //
this.chkBoxTransformMatrix.AutoSize = true; this.chkBoxTransformMatrix.AutoSize = true;
this.chkBoxTransformMatrix.Location = new System.Drawing.Point(3, 113); this.chkBoxTransformMatrix.Location = new System.Drawing.Point(3, 131);
this.chkBoxTransformMatrix.Name = "chkBoxTransformMatrix"; this.chkBoxTransformMatrix.Name = "chkBoxTransformMatrix";
this.chkBoxTransformMatrix.Size = new System.Drawing.Size(104, 17); this.chkBoxTransformMatrix.Size = new System.Drawing.Size(104, 17);
this.chkBoxTransformMatrix.TabIndex = 14; this.chkBoxTransformMatrix.TabIndex = 14;
@ -565,7 +578,7 @@
// chkBoxRot90Y // chkBoxRot90Y
// //
this.chkBoxRot90Y.AutoSize = true; this.chkBoxRot90Y.AutoSize = true;
this.chkBoxRot90Y.Location = new System.Drawing.Point(3, 67); this.chkBoxRot90Y.Location = new System.Drawing.Point(3, 85);
this.chkBoxRot90Y.Name = "chkBoxRot90Y"; this.chkBoxRot90Y.Name = "chkBoxRot90Y";
this.chkBoxRot90Y.Size = new System.Drawing.Size(114, 17); this.chkBoxRot90Y.Size = new System.Drawing.Size(114, 17);
this.chkBoxRot90Y.TabIndex = 13; this.chkBoxRot90Y.TabIndex = 13;
@ -577,7 +590,7 @@
// pictureBox1 // pictureBox1
// //
this.pictureBox1.BackColor = System.Drawing.Color.White; this.pictureBox1.BackColor = System.Drawing.Color.White;
this.pictureBox1.Location = new System.Drawing.Point(3, 162); this.pictureBox1.Location = new System.Drawing.Point(3, 180);
this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(17, 17); this.pictureBox1.Size = new System.Drawing.Size(17, 17);
this.pictureBox1.TabIndex = 12; this.pictureBox1.TabIndex = 12;
@ -586,7 +599,7 @@
// checkBox9 // checkBox9
// //
this.checkBox9.AutoSize = true; this.checkBox9.AutoSize = true;
this.checkBox9.Location = new System.Drawing.Point(25, 163); this.checkBox9.Location = new System.Drawing.Point(25, 181);
this.checkBox9.Name = "checkBox9"; this.checkBox9.Name = "checkBox9";
this.checkBox9.Size = new System.Drawing.Size(130, 17); this.checkBox9.Size = new System.Drawing.Size(130, 17);
this.checkBox9.TabIndex = 11; this.checkBox9.TabIndex = 11;
@ -672,16 +685,16 @@
this.tabPageAdvanced.TabIndex = 0; this.tabPageAdvanced.TabIndex = 0;
this.tabPageAdvanced.Text = "Advanced Settings"; this.tabPageAdvanced.Text = "Advanced Settings";
// //
// chkBoxRotNegative90Y // chkBoxParamDefaults
// //
this.chkBoxRotNegative90Y.AutoSize = true; this.chkBoxParamDefaults.AutoSize = true;
this.chkBoxRotNegative90Y.Location = new System.Drawing.Point(3, 90); this.chkBoxParamDefaults.Location = new System.Drawing.Point(3, 16);
this.chkBoxRotNegative90Y.Name = "chkBoxRotNegative90Y"; this.chkBoxParamDefaults.Name = "chkBoxParamDefaults";
this.chkBoxRotNegative90Y.Size = new System.Drawing.Size(117, 17); this.chkBoxParamDefaults.Size = new System.Drawing.Size(117, 17);
this.chkBoxRotNegative90Y.TabIndex = 29; this.chkBoxParamDefaults.TabIndex = 30;
this.chkBoxRotNegative90Y.Text = "Rotate -90 degrees"; this.chkBoxParamDefaults.Text = "Set Param Defaults";
this.chkBoxRotNegative90Y.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.chkBoxParamDefaults.UseVisualStyleBackColor = true;
this.chkBoxRotNegative90Y.UseVisualStyleBackColor = true; this.chkBoxParamDefaults.CheckedChanged += new System.EventHandler(this.chkBoxSettings_CheckedChanged);
// //
// BfresModelImportSettings // BfresModelImportSettings
// //
@ -779,5 +792,6 @@
private System.Windows.Forms.Label useMaterialLabel; private System.Windows.Forms.Label useMaterialLabel;
private System.Windows.Forms.TextBox textBoxMaterialPath; private System.Windows.Forms.TextBox textBoxMaterialPath;
private System.Windows.Forms.CheckBox chkBoxRotNegative90Y; private System.Windows.Forms.CheckBox chkBoxRotNegative90Y;
private System.Windows.Forms.CheckBox chkBoxParamDefaults;
} }
} }

View File

@ -43,6 +43,7 @@ namespace FirstPlugin
public bool Rotate90DegreesNegativeX; public bool Rotate90DegreesNegativeX;
public bool RecalculateNormals; public bool RecalculateNormals;
public string ExternalMaterialPath; public string ExternalMaterialPath;
public bool SetDefaultParamData;
public void DisableMaterialEdits() public void DisableMaterialEdits()
{ {
@ -60,6 +61,8 @@ namespace FirstPlugin
chkBoxEnableBitans.Checked = obj.HasUv0; chkBoxEnableBitans.Checked = obj.HasUv0;
chkBoxEnableWeightIndices.Checked = obj.HasWeights; chkBoxEnableWeightIndices.Checked = obj.HasWeights;
chkBoxEnableVertColors.Checked = obj.HasVertColors; chkBoxEnableVertColors.Checked = obj.HasVertColors;
chkBoxParamDefaults.Checked = true;
chkBoxTransformMatrix.Checked = true;
if (!obj.HasPos) if (!obj.HasPos)
DisableAttribute(chkBoxEnablePositions, comboBoxFormatPositions); DisableAttribute(chkBoxEnablePositions, comboBoxFormatPositions);
@ -257,6 +260,7 @@ namespace FirstPlugin
Rotate90DegreesY = chkBoxRot90Y.Checked; Rotate90DegreesY = chkBoxRot90Y.Checked;
Rotate90DegreesNegativeY = chkBoxRotNegative90Y.Checked; Rotate90DegreesNegativeY = chkBoxRotNegative90Y.Checked;
RecalculateNormals = chkBoxRecalcNormals.Checked; RecalculateNormals = chkBoxRecalcNormals.Checked;
SetDefaultParamData = chkBoxParamDefaults.Checked;
} }
private AttribFormat SetAttribFormat(string Format) private AttribFormat SetAttribFormat(string Format)
{ {

View File

@ -89,12 +89,9 @@ namespace FirstPlugin
case "DX10": case "DX10":
IsDX10 = true; IsDX10 = true;
break; break;
case "":
return SurfaceFormat.R8_G8_B8_A8_SRGB;
default: default:
throw new Exception($"Format {fourCC} not supported!"); return SurfaceFormat.R8_G8_B8_A8_SRGB;
} }
if (IsDX10) if (IsDX10)
{ {
switch (dds.DX10header.DXGI_Format) switch (dds.DX10header.DXGI_Format)

View File

@ -81,11 +81,19 @@ namespace FirstPlugin
public void Load() public void Load()
{ {
MainF = MainForm; MainF = MainForm;
DockedViewport = DockedEditor;
DockedEditor = Viewport.Instance;
Config.StartupFromFile("Lib/Plugins/config.xml"); Config.StartupFromFile("Lib/Plugins/config.xml");
if (!Runtime.DisableViewport)
{
DockedViewport = DockedEditor;
DockedEditor = Viewport.Instance;
}
else
{
PluginRuntime.FSHPDockState = DockState.Document;
}
} }
public void Unload() public void Unload()
{ {

View File

@ -46,8 +46,7 @@
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="BezelEngineArchive_Lib"> <Reference Include="BezelEngineArchive_Lib">
<HintPath>Externals\BezelEngineArchive_Lib.dll</HintPath> <HintPath>..\Switch_Toolbox\Lib\BezelEngineArchive_Lib.dll</HintPath>
<Private>False</Private>
</Reference> </Reference>
<Reference Include="ByamlExt"> <Reference Include="ByamlExt">
<HintPath>..\Switch_Toolbox\Lib\ByamlExt.dll</HintPath> <HintPath>..\Switch_Toolbox\Lib\ByamlExt.dll</HintPath>
@ -58,7 +57,6 @@
</Reference> </Reference>
<Reference Include="EditorCoreCommon"> <Reference Include="EditorCoreCommon">
<HintPath>..\Switch_Toolbox\Lib\EditorCoreCommon.dll</HintPath> <HintPath>..\Switch_Toolbox\Lib\EditorCoreCommon.dll</HintPath>
<Private>False</Private>
</Reference> </Reference>
<Reference Include="KCLExt, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="KCLExt, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
@ -66,8 +64,7 @@
</Reference> </Reference>
<Reference Include="Microsoft.VisualBasic" /> <Reference Include="Microsoft.VisualBasic" />
<Reference Include="NAudio"> <Reference Include="NAudio">
<HintPath>Externals\NAudio.dll</HintPath> <HintPath>..\Switch_Toolbox\Lib\NAudio.dll</HintPath>
<Private>False</Private>
</Reference> </Reference>
<Reference Include="OpenTK"> <Reference Include="OpenTK">
<HintPath>..\..\..\..\Documents\Visual Studio 2017\Projects\WindowsFormsApp2\WindowsFormsApp2\Lib\OpenTK.dll</HintPath> <HintPath>..\..\..\..\Documents\Visual Studio 2017\Projects\WindowsFormsApp2\WindowsFormsApp2\Lib\OpenTK.dll</HintPath>
@ -84,8 +81,7 @@
<EmbedInteropTypes>False</EmbedInteropTypes> <EmbedInteropTypes>False</EmbedInteropTypes>
</Reference> </Reference>
<Reference Include="SARCExt"> <Reference Include="SARCExt">
<HintPath>Externals\SARCExt.dll</HintPath> <HintPath>..\Switch_Toolbox\Lib\SARCExt.dll</HintPath>
<Private>False</Private>
</Reference> </Reference>
<Reference Include="SFGraphics"> <Reference Include="SFGraphics">
<HintPath>..\..\..\..\Documents\Visual Studio 2017\Projects\WindowsFormsApp2\WindowsFormsApp2\Lib\SFGraphics.dll</HintPath> <HintPath>..\..\..\..\Documents\Visual Studio 2017\Projects\WindowsFormsApp2\WindowsFormsApp2\Lib\SFGraphics.dll</HintPath>
@ -96,26 +92,19 @@
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="Syroot.BinaryData"> <Reference Include="Syroot.BinaryData">
<HintPath>..\..\..\..\Documents\Visual Studio 2017\Projects\WindowsFormsApp2\WindowsFormsApp2\Lib\Syroot.BinaryData.dll</HintPath> <HintPath>..\Switch_Toolbox\Lib\Syroot.BinaryData.dll</HintPath>
<Private>False</Private>
</Reference> </Reference>
<Reference Include="Syroot.Maths"> <Reference Include="Syroot.Maths">
<HintPath>..\..\..\..\Documents\Visual Studio 2017\Projects\WindowsFormsApp2\WindowsFormsApp2\Lib\Syroot.Maths.dll</HintPath> <HintPath>..\Switch_Toolbox\Lib\Syroot.Maths.dll</HintPath>
<Private>False</Private>
</Reference> </Reference>
<Reference Include="Syroot.NintenTools.Bfres"> <Reference Include="Syroot.NintenTools.Bfres">
<HintPath>..\Switch_Toolbox\Lib\Syroot.NintenTools.Bfres.dll</HintPath> <HintPath>..\Switch_Toolbox\Lib\Syroot.NintenTools.Bfres.dll</HintPath>
<Private>False</Private>
</Reference> </Reference>
<Reference Include="Syroot.NintenTools.NSW.Bfres, Version=1.2.3.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Syroot.NintenTools.NSW.Bfres">
<SpecificVersion>False</SpecificVersion> <HintPath>..\Switch_Toolbox\Lib\Syroot.NintenTools.NSW.Bfres.dll</HintPath>
<HintPath>Externals\Syroot.NintenTools.NSW.Bfres.dll</HintPath>
<Private>False</Private>
</Reference> </Reference>
<Reference Include="Syroot.NintenTools.NSW.Bntx, Version=1.2.3.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Syroot.NintenTools.NSW.Bntx">
<SpecificVersion>False</SpecificVersion> <HintPath>..\Switch_Toolbox\Lib\Syroot.NintenTools.NSW.Bntx.dll</HintPath>
<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>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
@ -134,8 +123,7 @@
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="VGAudio"> <Reference Include="VGAudio">
<HintPath>Externals\VGAudio.dll</HintPath> <HintPath>..\Switch_Toolbox\Lib\VGAudio.dll</HintPath>
<Private>False</Private>
</Reference> </Reference>
<Reference Include="VisualStudioTabControl"> <Reference Include="VisualStudioTabControl">
<HintPath>..\..\..\..\Documents\GitHub\Nintendo_Switch_BFRES_Library\src - Copy (3)\VisualStudioTabControl.dll</HintPath> <HintPath>..\..\..\..\Documents\GitHub\Nintendo_Switch_BFRES_Library\src - Copy (3)\VisualStudioTabControl.dll</HintPath>
@ -147,8 +135,7 @@
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="ZstdNet"> <Reference Include="ZstdNet">
<HintPath>Externals\ZstdNet.dll</HintPath> <HintPath>..\Switch_Toolbox\Lib\ZstdNet.dll</HintPath>
<Private>False</Private>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -44,6 +44,9 @@ namespace Switch_Toolbox
case "OpenStartupWindow": case "OpenStartupWindow":
bool.TryParse(node.InnerText, out Runtime.OpenStartupWindow); bool.TryParse(node.InnerText, out Runtime.OpenStartupWindow);
break; break;
case "DisableViewport":
bool.TryParse(node.InnerText, out Runtime.DisableViewport);
break;
case "RenderModels": case "RenderModels":
bool.TryParse(node.InnerText, out Runtime.RenderModels); bool.TryParse(node.InnerText, out Runtime.RenderModels);
break; break;
@ -86,7 +89,7 @@ namespace Switch_Toolbox
private static XmlDocument CreateXmlFromSettings() private static XmlDocument CreateXmlFromSettings()
{ {
XmlDocument doc = new XmlDocument(); XmlDocument doc = new XmlDocument();
XmlNode mainNode = doc.CreateElement("FORGECONFIG"); XmlNode mainNode = doc.CreateElement("TOOLCONFIG");
doc.AppendChild(mainNode); doc.AppendChild(mainNode);
AppendMainFormSettings(doc, mainNode); AppendMainFormSettings(doc, mainNode);
@ -101,6 +104,7 @@ namespace Switch_Toolbox
XmlNode mainSettingsNode = doc.CreateElement("MAINFORM"); XmlNode mainSettingsNode = doc.CreateElement("MAINFORM");
parentNode.AppendChild(mainSettingsNode); parentNode.AppendChild(mainSettingsNode);
mainSettingsNode.AppendChild(createNode(doc, "OpenStartupWindow", Runtime.OpenStartupWindow.ToString())); mainSettingsNode.AppendChild(createNode(doc, "OpenStartupWindow", Runtime.OpenStartupWindow.ToString()));
mainSettingsNode.AppendChild(createNode(doc, "DisableViewport", Runtime.DisableViewport.ToString()));
} }
private static void AppendOCompressionFilelistSettings(XmlDocument doc, XmlNode parentNode) private static void AppendOCompressionFilelistSettings(XmlDocument doc, XmlNode parentNode)
{ {

View File

@ -54,6 +54,7 @@
this.label7 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label();
this.yazoCompressionLevelUD = new System.Windows.Forms.NumericUpDown(); this.yazoCompressionLevelUD = new System.Windows.Forms.NumericUpDown();
this.panel3 = new System.Windows.Forms.Panel(); this.panel3 = new System.Windows.Forms.Panel();
this.disableViewportCHKBX = new System.Windows.Forms.CheckBox();
this.panel2.SuspendLayout(); this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.previewScaleUD)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.previewScaleUD)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.camFarNumUD)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.camFarNumUD)).BeginInit();
@ -323,6 +324,7 @@
// //
// panel1 // panel1
// //
this.panel1.Controls.Add(this.disableViewportCHKBX);
this.panel1.Controls.Add(this.GLSLVerLabel); this.panel1.Controls.Add(this.GLSLVerLabel);
this.panel1.Controls.Add(this.openGLVerLabel); this.panel1.Controls.Add(this.openGLVerLabel);
this.panel1.Location = new System.Drawing.Point(12, 13); this.panel1.Location = new System.Drawing.Point(12, 13);
@ -402,6 +404,18 @@
this.panel3.Size = new System.Drawing.Size(313, 138); this.panel3.Size = new System.Drawing.Size(313, 138);
this.panel3.TabIndex = 18; this.panel3.TabIndex = 18;
// //
// disableViewportCHKBX
//
this.disableViewportCHKBX.AutoSize = true;
this.disableViewportCHKBX.ForeColor = System.Drawing.Color.White;
this.disableViewportCHKBX.Location = new System.Drawing.Point(0, 67);
this.disableViewportCHKBX.Name = "disableViewportCHKBX";
this.disableViewportCHKBX.Size = new System.Drawing.Size(105, 17);
this.disableViewportCHKBX.TabIndex = 16;
this.disableViewportCHKBX.Text = "Disable Viewport";
this.disableViewportCHKBX.UseVisualStyleBackColor = true;
this.disableViewportCHKBX.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged_2);
//
// Settings // Settings
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -458,5 +472,6 @@
private System.Windows.Forms.Label label7; private System.Windows.Forms.Label label7;
private System.Windows.Forms.NumericUpDown yazoCompressionLevelUD; private System.Windows.Forms.NumericUpDown yazoCompressionLevelUD;
private System.Windows.Forms.Panel panel3; private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.CheckBox disableViewportCHKBX;
} }
} }

View File

@ -44,6 +44,7 @@ namespace Switch_Toolbox
camFarNumUD.Value = (decimal)Runtime.CameraFar; camFarNumUD.Value = (decimal)Runtime.CameraFar;
previewScaleUD.Value = (decimal)Runtime.previewScale; previewScaleUD.Value = (decimal)Runtime.previewScale;
yazoCompressionLevelUD.Value = Runtime.Yaz0CompressionLevel; yazoCompressionLevelUD.Value = Runtime.Yaz0CompressionLevel;
disableViewportCHKBX.Checked = Runtime.DisableViewport;
GLSLVerLabel.Text = $"Open GL Version: {Runtime.GLSLVersion}"; GLSLVerLabel.Text = $"Open GL Version: {Runtime.GLSLVersion}";
openGLVerLabel.Text = $"GLSL Version: {Runtime.openGLVersion}"; openGLVerLabel.Text = $"GLSL Version: {Runtime.openGLVersion}";
@ -133,5 +134,10 @@ namespace Switch_Toolbox
{ {
Runtime.Yaz0CompressionLevel = (int)yazoCompressionLevelUD.Value; Runtime.Yaz0CompressionLevel = (int)yazoCompressionLevelUD.Value;
} }
private void checkBox1_CheckedChanged_2(object sender, EventArgs e)
{
Runtime.DisableViewport = disableViewportCHKBX.Checked;
}
} }
} }

Binary file not shown.

View File

@ -39,8 +39,13 @@ namespace Switch_Toolbox
ShaderTools.executableDir = executableDir; ShaderTools.executableDir = executableDir;
Config.StartupFromFile(MainForm.executableDir + "\\config.xml"); Config.StartupFromFile(MainForm.executableDir + "\\config.xml");
dockContent = new DockContentST(); dockContent = new DockContentST();
if (!Runtime.DisableViewport)
{
dockContent = Viewport.Instance; dockContent = Viewport.Instance;
}
GenericPluginLoader.LoadPlugin(); GenericPluginLoader.LoadPlugin();
@ -129,8 +134,10 @@ namespace Switch_Toolbox
fileRecent.ForeColor = Color.White; fileRecent.ForeColor = Color.White;
recentToolStripMenuItem.DropDownItems.Add(fileRecent); //add the menu to "recent" menu recentToolStripMenuItem.DropDownItems.Add(fileRecent); //add the menu to "recent" menu
} }
if (!Runtime.DisableViewport)
dockContent.Show(dockPanel1, DockState.Document); dockContent.Show(dockPanel1, DockState.Document);
if (OpenTK.Graphics.GraphicsContext.CurrentContext != null) if (OpenTK.Graphics.GraphicsContext.CurrentContext != null)
{ {
OpenTKSharedResources.InitializeSharedResources(); OpenTKSharedResources.InitializeSharedResources();

View File

@ -24,6 +24,7 @@ namespace Switch_Toolbox.Library
public static bool RenderModelWireframe = false; public static bool RenderModelWireframe = false;
public static ViewportShading viewportShading; public static ViewportShading viewportShading;
public static bool IsDebugMode = false; //Enables experimental features and other things to debug. public static bool IsDebugMode = false; //Enables experimental features and other things to debug.
public static bool DisableViewport = false;
public static bool enableVSync = false; public static bool enableVSync = false;
public static float floorSize = 30f; public static float floorSize = 30f;