Allow viewport to be completely disabled for potato PCs.
This commit is contained in:
parent
021b34afba
commit
c7ee9ed16b
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -290,8 +290,9 @@ namespace FirstPlugin
|
|||||||
foreach (var mdl in BFRESRender.models)
|
foreach (var mdl in BFRESRender.models)
|
||||||
drawables.Add(mdl.Skeleton);
|
drawables.Add(mdl.Skeleton);
|
||||||
}
|
}
|
||||||
bfresEditor.LoadViewport(drawables, toolstrips);
|
|
||||||
|
|
||||||
|
if (Runtime.UseViewport)
|
||||||
|
bfresEditor.LoadViewport(drawables, toolstrips);
|
||||||
|
|
||||||
if (!IsLoaded)
|
if (!IsLoaded)
|
||||||
{
|
{
|
||||||
|
@ -302,22 +302,25 @@ namespace FirstPlugin
|
|||||||
bool IsLoaded = false;
|
bool IsLoaded = false;
|
||||||
public override void OnClick(TreeView treeView)
|
public override void OnClick(TreeView treeView)
|
||||||
{
|
{
|
||||||
if (viewport == null)
|
if (Runtime.UseViewport)
|
||||||
{
|
{
|
||||||
viewport = new Viewport();
|
if (viewport == null)
|
||||||
viewport.Dock = DockStyle.Fill;
|
{
|
||||||
|
viewport = new Viewport();
|
||||||
|
viewport.Dock = DockStyle.Fill;
|
||||||
|
}
|
||||||
|
LibraryGUI.Instance.LoadEditor(viewport);
|
||||||
|
|
||||||
|
viewport.Text = Text;
|
||||||
|
|
||||||
|
if (!IsLoaded)
|
||||||
|
{
|
||||||
|
viewport.AddDrawable(Renderer);
|
||||||
|
viewport.LoadObjects();
|
||||||
|
}
|
||||||
|
|
||||||
|
IsLoaded = true;
|
||||||
}
|
}
|
||||||
LibraryGUI.Instance.LoadEditor(viewport);
|
|
||||||
|
|
||||||
viewport.Text = Text;
|
|
||||||
|
|
||||||
if (!IsLoaded)
|
|
||||||
{
|
|
||||||
viewport.AddDrawable(Renderer);
|
|
||||||
viewport.LoadObjects();
|
|
||||||
}
|
|
||||||
|
|
||||||
IsLoaded = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MarioKart.MK7.KCL kcl = null;
|
public MarioKart.MK7.KCL kcl = null;
|
||||||
|
@ -20,7 +20,10 @@ namespace FirstPlugin.Forms
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
var editor = LibraryGUI.Instance.GetObjectEditor();
|
if (!Runtime.UseViewport)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
var editor = LibraryGUI.Instance.GetObjectEditor();
|
||||||
return editor.GetViewport();
|
return editor.GetViewport();
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
@ -50,13 +53,14 @@ namespace FirstPlugin.Forms
|
|||||||
stTabControl2.myBackColor = FormThemes.BaseTheme.FormBackColor;
|
stTabControl2.myBackColor = FormThemes.BaseTheme.FormBackColor;
|
||||||
|
|
||||||
|
|
||||||
if (viewport == null)
|
if (viewport == null && Runtime.UseViewport)
|
||||||
{
|
{
|
||||||
viewport = new Viewport();
|
viewport = new Viewport();
|
||||||
viewport.Dock = DockStyle.Fill;
|
viewport.Dock = DockStyle.Fill;
|
||||||
}
|
}
|
||||||
|
|
||||||
stPanel5.Controls.Add(viewport);
|
if (Runtime.UseViewport)
|
||||||
|
stPanel5.Controls.Add(viewport);
|
||||||
|
|
||||||
OnLoadedTab();
|
OnLoadedTab();
|
||||||
|
|
||||||
@ -93,7 +97,7 @@ namespace FirstPlugin.Forms
|
|||||||
|
|
||||||
public void UpdateViewport()
|
public void UpdateViewport()
|
||||||
{
|
{
|
||||||
if (viewport != null)
|
if (viewport != null && Runtime.UseViewport)
|
||||||
viewport.UpdateViewport();
|
viewport.UpdateViewport();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,6 +107,9 @@ namespace FirstPlugin.Forms
|
|||||||
|
|
||||||
public void LoadViewport(List<AbstractGlDrawable> drawables, List<ToolStripMenuItem> customContextMenus = null)
|
public void LoadViewport(List<AbstractGlDrawable> drawables, List<ToolStripMenuItem> customContextMenus = null)
|
||||||
{
|
{
|
||||||
|
if (!Runtime.UseViewport)
|
||||||
|
return;
|
||||||
|
|
||||||
Drawables = drawables;
|
Drawables = drawables;
|
||||||
|
|
||||||
if (customContextMenus != null)
|
if (customContextMenus != null)
|
||||||
@ -114,6 +121,9 @@ namespace FirstPlugin.Forms
|
|||||||
|
|
||||||
public void AddDrawable(AbstractGlDrawable draw)
|
public void AddDrawable(AbstractGlDrawable draw)
|
||||||
{
|
{
|
||||||
|
if (!Runtime.UseViewport)
|
||||||
|
return;
|
||||||
|
|
||||||
Drawables.Add(draw);
|
Drawables.Add(draw);
|
||||||
|
|
||||||
if (!viewport.scene.staticObjects.Contains(draw) &&
|
if (!viewport.scene.staticObjects.Contains(draw) &&
|
||||||
@ -125,6 +135,9 @@ namespace FirstPlugin.Forms
|
|||||||
|
|
||||||
public void RemoveDrawable(AbstractGlDrawable draw)
|
public void RemoveDrawable(AbstractGlDrawable draw)
|
||||||
{
|
{
|
||||||
|
if (!Runtime.UseViewport)
|
||||||
|
return;
|
||||||
|
|
||||||
Drawables.Remove(draw);
|
Drawables.Remove(draw);
|
||||||
viewport.RemoveDrawable(draw);
|
viewport.RemoveDrawable(draw);
|
||||||
}
|
}
|
||||||
@ -137,7 +150,7 @@ namespace FirstPlugin.Forms
|
|||||||
public void OnLoadedTab()
|
public void OnLoadedTab()
|
||||||
{
|
{
|
||||||
//If a model was loaded we don't need to load the drawables again
|
//If a model was loaded we don't need to load the drawables again
|
||||||
if (IsLoaded || Drawables == null)
|
if (IsLoaded || Drawables == null || !Runtime.UseViewport)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
foreach (var draw in Drawables)
|
foreach (var draw in Drawables)
|
||||||
|
@ -38,7 +38,6 @@
|
|||||||
this.tabPage2 = new System.Windows.Forms.TabPage();
|
this.tabPage2 = new System.Windows.Forms.TabPage();
|
||||||
this.samplerEditor1 = new Forms.SamplerEditor();
|
this.samplerEditor1 = new Forms.SamplerEditor();
|
||||||
this.tabPage1 = new System.Windows.Forms.TabPage();
|
this.tabPage1 = new System.Windows.Forms.TabPage();
|
||||||
this.uvEditor1 = new Switch_Toolbox.Library.Forms.UVEditor();
|
|
||||||
this.tabPage3 = new System.Windows.Forms.TabPage();
|
this.tabPage3 = new System.Windows.Forms.TabPage();
|
||||||
this.shaderParamEditor1 = new Forms.ShaderParamEditor();
|
this.shaderParamEditor1 = new Forms.ShaderParamEditor();
|
||||||
this.tabPage4 = new System.Windows.Forms.TabPage();
|
this.tabPage4 = new System.Windows.Forms.TabPage();
|
||||||
@ -151,7 +150,6 @@
|
|||||||
//
|
//
|
||||||
// tabPage1
|
// tabPage1
|
||||||
//
|
//
|
||||||
this.tabPage1.Controls.Add(this.uvEditor1);
|
|
||||||
this.tabPage1.Location = new System.Drawing.Point(4, 25);
|
this.tabPage1.Location = new System.Drawing.Point(4, 25);
|
||||||
this.tabPage1.Name = "tabPage1";
|
this.tabPage1.Name = "tabPage1";
|
||||||
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
|
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
|
||||||
@ -160,16 +158,6 @@
|
|||||||
this.tabPage1.Text = "UV View";
|
this.tabPage1.Text = "UV View";
|
||||||
this.tabPage1.UseVisualStyleBackColor = true;
|
this.tabPage1.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
// uvEditor1
|
|
||||||
//
|
|
||||||
this.uvEditor1.Dock = System.Windows.Forms.DockStyle.Fill;
|
|
||||||
this.uvEditor1.Location = new System.Drawing.Point(3, 3);
|
|
||||||
this.uvEditor1.Name = "uvEditor1";
|
|
||||||
this.uvEditor1.Size = new System.Drawing.Size(524, 504);
|
|
||||||
this.uvEditor1.TabIndex = 0;
|
|
||||||
this.uvEditor1.Load += new System.EventHandler(this.uvEditor1_Load);
|
|
||||||
this.uvEditor1.Click += new System.EventHandler(this.uvEditor1_Click);
|
|
||||||
//
|
|
||||||
// tabPage3
|
// tabPage3
|
||||||
//
|
//
|
||||||
this.tabPage3.Controls.Add(this.shaderParamEditor1);
|
this.tabPage3.Controls.Add(this.shaderParamEditor1);
|
||||||
@ -394,7 +382,6 @@
|
|||||||
private RenderInfoEditor renderInfoEditor1;
|
private RenderInfoEditor renderInfoEditor1;
|
||||||
private ShaderOptionsEditor shaderOptionsEditor1;
|
private ShaderOptionsEditor shaderOptionsEditor1;
|
||||||
private System.Windows.Forms.TabPage tabPage1;
|
private System.Windows.Forms.TabPage tabPage1;
|
||||||
private Switch_Toolbox.Library.Forms.UVEditor uvEditor1;
|
|
||||||
private Switch_Toolbox.Library.Forms.STLabel stLabel1;
|
private Switch_Toolbox.Library.Forms.STLabel stLabel1;
|
||||||
private Switch_Toolbox.Library.Forms.STButton btnViotileFlags;
|
private Switch_Toolbox.Library.Forms.STButton btnViotileFlags;
|
||||||
private Switch_Toolbox.Library.Forms.STButton btnSamplerInputEditor;
|
private Switch_Toolbox.Library.Forms.STButton btnSamplerInputEditor;
|
||||||
|
@ -36,6 +36,9 @@ namespace FirstPlugin.Forms
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UVEditor uvEditor1 = null;
|
||||||
|
|
||||||
public void LoadMaterial(FMAT mat)
|
public void LoadMaterial(FMAT mat)
|
||||||
{
|
{
|
||||||
if (mat.MaterialU != null)
|
if (mat.MaterialU != null)
|
||||||
@ -68,6 +71,21 @@ namespace FirstPlugin.Forms
|
|||||||
|
|
||||||
FillForm();
|
FillForm();
|
||||||
|
|
||||||
|
if (Runtime.UseViewport)
|
||||||
|
{
|
||||||
|
LoadUVEditor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadUVEditor()
|
||||||
|
{
|
||||||
|
uvEditor1 = new UVEditor();
|
||||||
|
|
||||||
|
this.uvEditor1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.uvEditor1.Load += new System.EventHandler(this.uvEditor1_Load);
|
||||||
|
this.uvEditor1.Click += new System.EventHandler(this.uvEditor1_Click);
|
||||||
|
this.tabPage1.Controls.Add(this.uvEditor1);
|
||||||
|
|
||||||
uvEditor1.ActiveObjects.Clear();
|
uvEditor1.ActiveObjects.Clear();
|
||||||
uvEditor1.Textures.Clear();
|
uvEditor1.Textures.Clear();
|
||||||
|
|
||||||
@ -105,6 +123,7 @@ namespace FirstPlugin.Forms
|
|||||||
uvEditor1.ActiveMaterial = material;
|
uvEditor1.ActiveMaterial = material;
|
||||||
uvEditor1.Refresh();
|
uvEditor1.Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
private UVEditor.ActiveTexture LoadTextureUvMap(STGenericMatTexture texmap, STGenericTexture genericTexture)
|
private UVEditor.ActiveTexture LoadTextureUvMap(STGenericMatTexture texmap, STGenericTexture genericTexture)
|
||||||
{
|
{
|
||||||
Vector2 scale = new Vector2(1);
|
Vector2 scale = new Vector2(1);
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -104,6 +104,8 @@ namespace Switch_Toolbox.Library
|
|||||||
|
|
||||||
public static bool renderFloorLines = true;
|
public static bool renderFloorLines = true;
|
||||||
|
|
||||||
|
public static bool UseViewport = true;
|
||||||
|
|
||||||
//Viewport Background
|
//Viewport Background
|
||||||
public static BackgroundStyle backgroundStyle = BackgroundStyle.Gradient;
|
public static BackgroundStyle backgroundStyle = BackgroundStyle.Gradient;
|
||||||
public static bool renderBackGround = true;
|
public static bool renderBackGround = true;
|
||||||
|
@ -167,6 +167,9 @@ namespace Toolbox
|
|||||||
case "renderBoundingBoxes":
|
case "renderBoundingBoxes":
|
||||||
bool.TryParse(node.InnerText, out Runtime.renderBoundingBoxes);
|
bool.TryParse(node.InnerText, out Runtime.renderBoundingBoxes);
|
||||||
break;
|
break;
|
||||||
|
case "UseViewport":
|
||||||
|
bool.TryParse(node.InnerText, out Runtime.UseViewport);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -274,6 +277,8 @@ namespace Toolbox
|
|||||||
XmlNode mainSettingsNode = doc.CreateElement("MAINFORM");
|
XmlNode mainSettingsNode = doc.CreateElement("MAINFORM");
|
||||||
parentNode.AppendChild(mainSettingsNode);
|
parentNode.AppendChild(mainSettingsNode);
|
||||||
|
|
||||||
|
|
||||||
|
mainSettingsNode.AppendChild(createNode(doc, "UseViewport", Runtime.UseViewport.ToString()));
|
||||||
mainSettingsNode.AppendChild(createNode(doc, "UseDebugDomainExceptionHandler", Runtime.UseDebugDomainExceptionHandler.ToString()));
|
mainSettingsNode.AppendChild(createNode(doc, "UseDebugDomainExceptionHandler", Runtime.UseDebugDomainExceptionHandler.ToString()));
|
||||||
mainSettingsNode.AppendChild(createNode(doc, "OpenStartupWindow", Runtime.OpenStartupWindow.ToString()));
|
mainSettingsNode.AppendChild(createNode(doc, "OpenStartupWindow", Runtime.OpenStartupWindow.ToString()));
|
||||||
mainSettingsNode.AppendChild(createNode(doc, "EnableVersionCheck", Runtime.EnableVersionCheck.ToString()));
|
mainSettingsNode.AppendChild(createNode(doc, "EnableVersionCheck", Runtime.EnableVersionCheck.ToString()));
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -72,9 +72,6 @@ namespace Toolbox
|
|||||||
|
|
||||||
private void Form1_Load(object sender, EventArgs e)
|
private void Form1_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//Create an instance of this to help load open gl data easier and quicker after boot
|
|
||||||
var viewport = new Viewport(false);
|
|
||||||
|
|
||||||
VersionCheck version = new VersionCheck();
|
VersionCheck version = new VersionCheck();
|
||||||
Runtime.ProgramVersion = version.ProgramVersion;
|
Runtime.ProgramVersion = version.ProgramVersion;
|
||||||
Runtime.CommitInfo = version.CommitInfo;
|
Runtime.CommitInfo = version.CommitInfo;
|
||||||
@ -86,14 +83,20 @@ namespace Toolbox
|
|||||||
|
|
||||||
Application.Idle += Application_Idle;
|
Application.Idle += Application_Idle;
|
||||||
|
|
||||||
if (OpenTK.Graphics.GraphicsContext.CurrentContext != null)
|
if (Runtime.UseViewport)
|
||||||
{
|
{
|
||||||
Runtime.OpenTKInitialized = true;
|
//Create an instance of this to help load open gl data easier and quicker after boot
|
||||||
|
var viewport = new Viewport(false);
|
||||||
|
|
||||||
Runtime.renderer = GL.GetString(StringName.Renderer);
|
if (OpenTK.Graphics.GraphicsContext.CurrentContext != null)
|
||||||
Runtime.openGLVersion = GL.GetString(StringName.Version);
|
{
|
||||||
Runtime.GLSLVersion = GL.GetString(StringName.ShadingLanguageVersion);
|
Runtime.OpenTKInitialized = true;
|
||||||
ParseGLVersion();
|
|
||||||
|
Runtime.renderer = GL.GetString(StringName.Renderer);
|
||||||
|
Runtime.openGLVersion = GL.GetString(StringName.Version);
|
||||||
|
Runtime.GLSLVersion = GL.GetString(StringName.ShadingLanguageVersion);
|
||||||
|
ParseGLVersion();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadPLugins();
|
LoadPLugins();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user