This commit is contained in:
Perfare 2018-07-14 18:22:14 +08:00
parent e0dcd6ac10
commit a3e430d98d
2 changed files with 10 additions and 1 deletions

View File

@ -841,9 +841,13 @@ namespace AssetStudio
var m_Mesh = new Mesh(asset, true); var m_Mesh = new Mesh(asset, true);
if (m_Mesh.m_VertexCount > 0) if (m_Mesh.m_VertexCount > 0)
{ {
glControl1.Visible = true;
viewMatrixData = Matrix4.CreateRotationY(-(float)Math.PI / 4) * Matrix4.CreateRotationX(-(float)Math.PI / 6); viewMatrixData = Matrix4.CreateRotationY(-(float)Math.PI / 4) * Matrix4.CreateRotationX(-(float)Math.PI / 6);
#region Vertices #region Vertices
if (m_Mesh.m_Vertices == null || m_Mesh.m_Vertices.Length == 0)
{
StatusStripUpdate("Mesh can't be previewed.");
return;
}
int count = 3; int count = 3;
if (m_Mesh.m_Vertices.Length == m_Mesh.m_VertexCount * 4) if (m_Mesh.m_Vertices.Length == m_Mesh.m_VertexCount * 4)
{ {
@ -970,6 +974,7 @@ namespace AssetStudio
} }
} }
#endregion #endregion
glControl1.Visible = true;
createVAO(); createVAO();
} }
StatusStripUpdate("Using OpenGL Version: " + GL.GetString(StringName.Version) + "\n" StatusStripUpdate("Using OpenGL Version: " + GL.GetString(StringName.Version) + "\n"

View File

@ -178,6 +178,10 @@ namespace AssetStudio
var sb = new StringBuilder(); var sb = new StringBuilder();
sb.AppendLine("g " + m_Mesh.m_Name); sb.AppendLine("g " + m_Mesh.m_Name);
#region Vertices #region Vertices
if (m_Mesh.m_Vertices == null || m_Mesh.m_Vertices.Length == 0)
{
return false;
}
int c = 3; int c = 3;
if (m_Mesh.m_Vertices.Length == m_Mesh.m_VertexCount * 4) if (m_Mesh.m_Vertices.Length == m_Mesh.m_VertexCount * 4)
{ {