summaryrefslogtreecommitdiff
path: root/TestApp/Main.cs
blob: 1196f0870597218f5a06bc3d61f39b5f9b28abb8 (plain)
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
using System;
using System.IO;
using NW4RTools;

namespace TestApp {
	class MainClass {
		public static void Main(string[] args) {
			string mdlPath = "/home/me/Games/Newer/ModelRev/";

			// NOTE: CS_W7 is broken!!

			string mdlName = "CS_W7";
			//string mdlName = "bgB_4502";

			string whatever = (mdlName == "CS_W2" || mdlName == "CS_W3" || mdlName == "CS_W6") ? "a" : "";

			byte[] file = File.ReadAllBytes(mdlPath + mdlName + ".brres");
			ResFile rf = BrresReader.LoadFile(file);

			//var objFile = File.Open(mdlPath + mdlName + ".obj", FileMode.OpenOrCreate);
			var objFile = File.Open(mdlPath + mdlName + ".dae", FileMode.OpenOrCreate);
			//var sw = new StreamWriter(objFile);
			//ObjWriter.WriteModel(sw, rf, mdlName);
			ColladaWriter.WriteModel(objFile, rf, mdlName + whatever);
			objFile.Close();
		}
	}
}