summaryrefslogtreecommitdiff
path: root/TestApp/Main.cs
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-03-08 05:17:56 +0100
committerTreeki <treeki@gmail.com>2011-03-08 05:17:56 +0100
commit7d391e33a0b3d9793c95fce832abb2c6d9002186 (patch)
tree075f8ec6272ad3ea12be44a8c2083f89b0d55228 /TestApp/Main.cs
parente962fd89af865d6e01522e9752f5fbd855ce128a (diff)
downloadnw4rtools-7d391e33a0b3d9793c95fce832abb2c6d9002186.tar.gz
nw4rtools-7d391e33a0b3d9793c95fce832abb2c6d9002186.zip
late night commit! obj importer is basic but working. also, tidied up DL stuff
Diffstat (limited to 'TestApp/Main.cs')
-rw-r--r--TestApp/Main.cs73
1 files changed, 53 insertions, 20 deletions
diff --git a/TestApp/Main.cs b/TestApp/Main.cs
index a5db889..fbaa7dc 100644
--- a/TestApp/Main.cs
+++ b/TestApp/Main.cs
@@ -11,39 +11,30 @@ namespace TestApp {
public static void Main(string[] args) {
string mdlPath = "/home/me/Games/Newer/ModelRev/";
- /*//string mdlName = "CS_W1";
- //string mdlName = "bgB_4502";
- //string mdlName = "cobKoopaCastle";
- string mdlName = "waterPlate_W4boss";
- mdlName = "test_lift";
+ //skawo();
+ //oldBehaviour();
+ //return;
- string whatever = (mdlName == "CS_W2" || mdlName == "CS_W3" || mdlName == "CS_W6") ? "a" : "";
- byte[] file = File.ReadAllBytes(mdlPath + mdlName + ".brres");
- ResFile rf = BrresReader.LoadFile(file);
+ // Going to create a model!
+ //string filename = "crapmap", resmdlname = "CrapMap";
+ string filename = "GoldwoodBase", resmdlname = "GoldwoodBase";
- File.WriteAllBytes(mdlPath + mdlName + "_rewritten.brres", BrresWriter.WriteFile(rf));*/
- // Going to create a model!
ResFile rf = new ResFile();
- ObjImporter.ImportModel(mdlPath, File.OpenText(mdlPath + "crapmap.obj"), rf, "CrapMap");
+ ObjImporter.ImportModel(mdlPath, File.OpenText(mdlPath + filename + ".obj"), rf, resmdlname);
- File.WriteAllBytes(mdlPath + "crapmap.brres", BrresWriter.WriteFile(rf));
+ File.WriteAllBytes(mdlPath + filename + ".brres", BrresWriter.WriteFile(rf));
- ResFile rf2 = BrresReader.LoadFile(File.ReadAllBytes(mdlPath + "crapmap.brres"));
+ ResFile rf2 = BrresReader.LoadFile(File.ReadAllBytes(mdlPath + filename + ".brres"));
using (var gw = new RenderWindow()) {
- gw.Title = "crapmap";
- gw.SetModel(rf2, "CrapMap");
+ gw.Title = filename;
+ gw.SetModel(rf2, resmdlname);
gw.Run(1, 1);
}
- /*using (var gw = new RenderWindow()) {
- gw.Title = mdlName;
- gw.SetModel(rf, mdlName);
- gw.Run(1, 1);
- }*/
@@ -60,6 +51,48 @@ namespace TestApp {
ColladaWriter.WriteModel(objFile, rf, mdlName + whatever);
objFile.Close();*/
}
+
+
+ private static void skawo() {
+ string mdlPath = "/home/me/Games/Newer/ModelRev/";
+ string skawopath = "/home/me/Dropbox/NEWERsmbw/Nowy folder/obj/";
+ ResFile rf = new ResFile();
+
+ ObjImporter.ImportModel(skawopath, File.OpenText(skawopath + "edited.obj"), rf, "Skawo");
+
+ File.WriteAllBytes(skawopath + "skawo.brres", BrresWriter.WriteFile(rf));
+
+
+ ResFile rf2 = BrresReader.LoadFile(File.ReadAllBytes(skawopath + "skawo.brres"));
+ using (var gw = new RenderWindow()) {
+ gw.Title = "Skawo";
+ gw.SetModel(rf2, "Skawo");
+ gw.Run(1, 1);
+ }
+ }
+
+ private static void oldBehaviour() {
+ string mdlPath = "/home/me/Games/Newer/ModelRev/";
+ string mdlName = "CS_W1";
+ //string mdlName = "bgB_4502";
+ //string mdlName = "cobKoopaCastle";
+ //string mdlName = "waterPlate_W4boss";
+ //mdlName = "test_lift";
+
+ string whatever = (mdlName == "CS_W2" || mdlName == "CS_W3" || mdlName == "CS_W6") ? "a" : "";
+
+ byte[] file = File.ReadAllBytes(mdlPath + mdlName + ".brres");
+ ResFile rf = BrresReader.LoadFile(file);
+
+ using (var gw = new RenderWindow()) {
+ gw.Title = mdlName;
+ gw.SetModel(rf, mdlName);
+ gw.Run(1, 1);
+ }
+
+ //File.WriteAllBytes(mdlPath + mdlName + "_rewritten.brres", BrresWriter.WriteFile(rf));
+
+ }
}
}