-
Notifications
You must be signed in to change notification settings - Fork 5
/
SMCReader.cs
54 lines (52 loc) · 2.01 KB
/
SMCReader.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Decompiled with JetBrains decompiler
// Type: LcDevPack_TeamDamonA.SMCReader
// Assembly: LcDevPack_TeamDamonA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 6B9BC8BF-B510-4945-A515-04135CC0F4A4
// Assembly location: C:\Users\NTServer\Desktop\LcDevPack_TeamDamonA\LcDevPack_TeamDamonA\LcDevPack_TeamDamonA.exe
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace LcDevPack_TeamDamonA
{
public class SMCReader
{
public static List<smcMesh> ReadFile(string FileName)
{
string[] strArray1 = Path.GetDirectoryName(FileName).Split('\\');
string str = "";
bool flag = true;
for (int index = 0; index < (strArray1).Count<string>(); ++index)
{
if (strArray1[index].ToUpper() == "DATA")
flag = false;
if (flag)
str = str + strArray1[index] + "\\";
}
List<string> list = ( File.ReadAllLines(FileName)).ToList<string>();
for (int index = list.Count<string>() - 1; index >= 0; --index)
{
list[index] = list[index].Trim();
list[index] = list[index].Replace("TFNM", "");
if (list[index].Contains("{") || list[index].Contains("}") || (list[index].Contains(",") || list[index].Contains("NAME")) || (list[index].Contains("COLISION") || list[index].Contains("TEXTURES") || (list[index].Contains("ANIM") || list[index].Contains("SKELETON"))) || list[index].Contains("_TAG"))
list.RemoveAt(index);
}
int index1 = -1;
List<smcMesh> smcMeshList = new List<smcMesh>();
for (int index2 = 0; index2 < list.Count<string>(); ++index2)
{
if (list[index2].Substring(0, 4) == "MESH")
{
++index1;
string[] strArray2 = list[index2].Split('"');
smcMeshList.Add(new smcMesh(str + strArray2[1]));
}
else
{
string[] strArray2 = list[index2].Split('"');
smcMeshList[index1].Object.Add(new smcObject(strArray2[1], str + strArray2[3]));
}
}
return smcMeshList;
}
}
}