summaryrefslogtreecommitdiff
path: root/TestApp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-03-10 03:00:09 +0100
committerTreeki <treeki@gmail.com>2011-03-10 03:00:09 +0100
commit5926616de2bd346f1a1c69c93ff2aaa3c453a2b3 (patch)
treef282b05ae5616a05fb4db167fad20ec242775c27 /TestApp
parent7d391e33a0b3d9793c95fce832abb2c6d9002186 (diff)
downloadnw4rtools-5926616de2bd346f1a1c69c93ff2aaa3c453a2b3.tar.gz
nw4rtools-5926616de2bd346f1a1c69c93ff2aaa3c453a2b3.zip
kinda hackish, but mostly working NSMBW lightmap support
Diffstat (limited to '')
-rw-r--r--TestApp/Main.cs19
-rw-r--r--TestApp/RenderWindow.cs4
-rw-r--r--TestApp/TestApp.pidbbin4427 -> 4427 bytes
-rwxr-xr-xTestApp/bin/Debug/NW4RTools.dllbin233472 -> 235008 bytes
-rw-r--r--TestApp/bin/Debug/NW4RTools.dll.mdbbin112974 -> 113949 bytes
-rwxr-xr-xTestApp/bin/Debug/TestApp.exebin7168 -> 7680 bytes
-rw-r--r--TestApp/bin/Debug/TestApp.exe.mdbbin1243 -> 1226 bytes
7 files changed, 16 insertions, 7 deletions
diff --git a/TestApp/Main.cs b/TestApp/Main.cs
index fbaa7dc..3d7f063 100644
--- a/TestApp/Main.cs
+++ b/TestApp/Main.cs
@@ -28,12 +28,12 @@ namespace TestApp {
File.WriteAllBytes(mdlPath + filename + ".brres", BrresWriter.WriteFile(rf));
- ResFile rf2 = BrresReader.LoadFile(File.ReadAllBytes(mdlPath + filename + ".brres"));
+ /*ResFile rf2 = BrresReader.LoadFile(File.ReadAllBytes(mdlPath + filename + ".brres"));
using (var gw = new RenderWindow()) {
gw.Title = filename;
gw.SetModel(rf2, resmdlname);
gw.Run(1, 1);
- }
+ }*/
@@ -73,7 +73,7 @@ namespace TestApp {
private static void oldBehaviour() {
string mdlPath = "/home/me/Games/Newer/ModelRev/";
- string mdlName = "CS_W1";
+ string mdlName = "lift_han_wood";
//string mdlName = "bgB_4502";
//string mdlName = "cobKoopaCastle";
//string mdlName = "waterPlate_W4boss";
@@ -84,14 +84,23 @@ namespace TestApp {
byte[] file = File.ReadAllBytes(mdlPath + mdlName + ".brres");
ResFile rf = BrresReader.LoadFile(file);
- using (var gw = new RenderWindow()) {
+ /*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));
+ var texs = rf.GetGroup<Texture>("Textures(NW4R)");
+ // wtf C#?!
+ foreach (var kv in (IEnumerable<KeyValuePair<string,Texture>>)texs) {
+ kv.Value.Images[0].Save(mdlPath + "images/" + kv.Key + ".png");
+ }
+
+ var objFile = File.Open(mdlPath + "lift_han_wood_M.dae", FileMode.OpenOrCreate);
+ ColladaExporter.WriteModel(objFile, rf, "lift_han_wood_M");
+ objFile.Close();
}
}
}
diff --git a/TestApp/RenderWindow.cs b/TestApp/RenderWindow.cs
index 6013724..f314146 100644
--- a/TestApp/RenderWindow.cs
+++ b/TestApp/RenderWindow.cs
@@ -61,8 +61,8 @@ namespace TestApp {
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
- Matrix4 modelview = Matrix4.LookAt(new Vector3(1000, 400, 1000), new Vector3(1000, 0, 0), Vector3.UnitY);
- //Matrix4 modelview = Matrix4.LookAt(new Vector3(-3, 2, 3), new Vector3(0, 0, 0), Vector3.UnitY);
+ //Matrix4 modelview = Matrix4.LookAt(new Vector3(1000, 400, 1000), new Vector3(1000, 0, 0), Vector3.UnitY);
+ Matrix4 modelview = Matrix4.LookAt(new Vector3(-50, 20, 50), new Vector3(0, 0, 0), Vector3.UnitY);
GL.MatrixMode(MatrixMode.Modelview);
GL.LoadMatrix(ref modelview);
diff --git a/TestApp/TestApp.pidb b/TestApp/TestApp.pidb
index e8df7af..9242abe 100644
--- a/TestApp/TestApp.pidb
+++ b/TestApp/TestApp.pidb
Binary files differ
diff --git a/TestApp/bin/Debug/NW4RTools.dll b/TestApp/bin/Debug/NW4RTools.dll
index 40356de..d8f19a2 100755
--- a/TestApp/bin/Debug/NW4RTools.dll
+++ b/TestApp/bin/Debug/NW4RTools.dll
Binary files differ
diff --git a/TestApp/bin/Debug/NW4RTools.dll.mdb b/TestApp/bin/Debug/NW4RTools.dll.mdb
index 92742d0..330c38e 100644
--- a/TestApp/bin/Debug/NW4RTools.dll.mdb
+++ b/TestApp/bin/Debug/NW4RTools.dll.mdb
Binary files differ
diff --git a/TestApp/bin/Debug/TestApp.exe b/TestApp/bin/Debug/TestApp.exe
index 5b808e0..75cf443 100755
--- a/TestApp/bin/Debug/TestApp.exe
+++ b/TestApp/bin/Debug/TestApp.exe
Binary files differ
diff --git a/TestApp/bin/Debug/TestApp.exe.mdb b/TestApp/bin/Debug/TestApp.exe.mdb
index 8ec2779..f6489a1 100644
--- a/TestApp/bin/Debug/TestApp.exe.mdb
+++ b/TestApp/bin/Debug/TestApp.exe.mdb
Binary files differ