optimizing
This commit is contained in:
parent
d523862fac
commit
35edb9d391
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="源文件">
|
||||
<UniqueIdentifier>{583fcf27-d43a-4d07-86f5-7757c1fa471b}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="头文件">
|
||||
<UniqueIdentifier>{444d070d-1fc6-4211-b76b-d4c5d708ac6f}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="AssemblyInfo.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="AssetStudioFBX.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="AssetStudioFBXExporter.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="AssetStudioFBX.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -218,7 +218,7 @@ namespace AssetStudio
|
|||
while (parent != nullptr)
|
||||
{
|
||||
exportFrames->Add(parent->Name);
|
||||
parent = (ImportedFrame^)parent->Parent;
|
||||
parent = parent->Parent;
|
||||
}
|
||||
|
||||
List<ImportedBone^>^ boneList = meshListSome->BoneList;
|
||||
|
@ -232,7 +232,7 @@ namespace AssetStudio
|
|||
while (boneParent != nullptr)
|
||||
{
|
||||
exportFrames->Add(boneParent->Name);
|
||||
boneParent = (ImportedFrame^)boneParent->Parent;
|
||||
boneParent = boneParent->Parent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Imported.cs" />
|
||||
<Compile Include="ObjChildren.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using SharpDX;
|
||||
|
@ -15,11 +16,61 @@ namespace AssetStudio
|
|||
List<ImportedMorph> MorphList { get; }
|
||||
}
|
||||
|
||||
public class ImportedFrame : ObjChildren<ImportedFrame>, IObjChild
|
||||
public class ImportedFrame : IEnumerable<ImportedFrame>
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public Matrix Matrix { get; set; }
|
||||
public dynamic Parent { get; set; }
|
||||
public ImportedFrame Parent { get; set; }
|
||||
|
||||
private List<ImportedFrame> children;
|
||||
|
||||
public ImportedFrame this[int i] => children[i];
|
||||
|
||||
public int Count => children.Count;
|
||||
|
||||
public void InitChildren(int count)
|
||||
{
|
||||
children = new List<ImportedFrame>(count);
|
||||
}
|
||||
|
||||
public void AddChild(ImportedFrame obj)
|
||||
{
|
||||
children.Add(obj);
|
||||
obj.Parent = this;
|
||||
}
|
||||
|
||||
public void InsertChild(int i, ImportedFrame obj)
|
||||
{
|
||||
children.Insert(i, obj);
|
||||
obj.Parent = this;
|
||||
}
|
||||
|
||||
public void RemoveChild(ImportedFrame obj)
|
||||
{
|
||||
obj.Parent = null;
|
||||
children.Remove(obj);
|
||||
}
|
||||
|
||||
public void RemoveChild(int i)
|
||||
{
|
||||
children[i].Parent = null;
|
||||
children.RemoveAt(i);
|
||||
}
|
||||
|
||||
public int IndexOf(ImportedFrame obj)
|
||||
{
|
||||
return children.IndexOf(obj);
|
||||
}
|
||||
|
||||
public IEnumerator<ImportedFrame> GetEnumerator()
|
||||
{
|
||||
return children.GetEnumerator();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
}
|
||||
|
||||
public class ImportedMesh
|
||||
|
|
|
@ -1,65 +0,0 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace AssetStudio
|
||||
{
|
||||
public interface IObjChild
|
||||
{
|
||||
dynamic Parent { get; set; }
|
||||
}
|
||||
|
||||
public abstract class ObjChildren<T> : IEnumerable<T> where T : IObjChild
|
||||
{
|
||||
protected List<T> children;
|
||||
|
||||
public T this[int i] => children[i];
|
||||
|
||||
public int Count => children.Count;
|
||||
|
||||
public void InitChildren(int count)
|
||||
{
|
||||
children = new List<T>(count);
|
||||
}
|
||||
|
||||
public void AddChild(T obj)
|
||||
{
|
||||
children.Add(obj);
|
||||
obj.Parent = this;
|
||||
}
|
||||
|
||||
public void InsertChild(int i, T obj)
|
||||
{
|
||||
children.Insert(i, obj);
|
||||
obj.Parent = this;
|
||||
}
|
||||
|
||||
public void RemoveChild(T obj)
|
||||
{
|
||||
obj.Parent = null;
|
||||
children.Remove(obj);
|
||||
}
|
||||
|
||||
public void RemoveChild(int i)
|
||||
{
|
||||
children[i].Parent = null;
|
||||
children.RemoveAt(i);
|
||||
}
|
||||
|
||||
public int IndexOf(T obj)
|
||||
{
|
||||
return children.IndexOf(obj);
|
||||
}
|
||||
|
||||
public IEnumerator<T> GetEnumerator()
|
||||
{
|
||||
return children.GetEnumerator();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue