diff options
author | Treeki <treeki@gmail.com> | 2011-03-10 03:00:09 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2011-03-10 03:00:09 +0100 |
commit | 5926616de2bd346f1a1c69c93ff2aaa3c453a2b3 (patch) | |
tree | f282b05ae5616a05fb4db167fad20ec242775c27 /TestApp | |
parent | 7d391e33a0b3d9793c95fce832abb2c6d9002186 (diff) | |
download | nw4rtools-5926616de2bd346f1a1c69c93ff2aaa3c453a2b3.tar.gz nw4rtools-5926616de2bd346f1a1c69c93ff2aaa3c453a2b3.zip |
kinda hackish, but mostly working NSMBW lightmap support
Diffstat (limited to '')
-rw-r--r-- | TestApp/Main.cs | 19 | ||||
-rw-r--r-- | TestApp/RenderWindow.cs | 4 | ||||
-rw-r--r-- | TestApp/TestApp.pidb | bin | 4427 -> 4427 bytes | |||
-rwxr-xr-x | TestApp/bin/Debug/NW4RTools.dll | bin | 233472 -> 235008 bytes | |||
-rw-r--r-- | TestApp/bin/Debug/NW4RTools.dll.mdb | bin | 112974 -> 113949 bytes | |||
-rwxr-xr-x | TestApp/bin/Debug/TestApp.exe | bin | 7168 -> 7680 bytes | |||
-rw-r--r-- | TestApp/bin/Debug/TestApp.exe.mdb | bin | 1243 -> 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 Binary files differindex e8df7af..9242abe 100644 --- a/TestApp/TestApp.pidb +++ b/TestApp/TestApp.pidb diff --git a/TestApp/bin/Debug/NW4RTools.dll b/TestApp/bin/Debug/NW4RTools.dll Binary files differindex 40356de..d8f19a2 100755 --- a/TestApp/bin/Debug/NW4RTools.dll +++ b/TestApp/bin/Debug/NW4RTools.dll diff --git a/TestApp/bin/Debug/NW4RTools.dll.mdb b/TestApp/bin/Debug/NW4RTools.dll.mdb Binary files differindex 92742d0..330c38e 100644 --- a/TestApp/bin/Debug/NW4RTools.dll.mdb +++ b/TestApp/bin/Debug/NW4RTools.dll.mdb diff --git a/TestApp/bin/Debug/TestApp.exe b/TestApp/bin/Debug/TestApp.exe Binary files differindex 5b808e0..75cf443 100755 --- a/TestApp/bin/Debug/TestApp.exe +++ b/TestApp/bin/Debug/TestApp.exe diff --git a/TestApp/bin/Debug/TestApp.exe.mdb b/TestApp/bin/Debug/TestApp.exe.mdb Binary files differindex 8ec2779..f6489a1 100644 --- a/TestApp/bin/Debug/TestApp.exe.mdb +++ b/TestApp/bin/Debug/TestApp.exe.mdb |