diff options
author | Treeki <treeki@gmail.com> | 2011-03-05 05:25:14 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2011-03-05 05:25:14 +0100 |
commit | e962fd89af865d6e01522e9752f5fbd855ce128a (patch) | |
tree | 0fb19e74a2d87b2ece48152fee2b2f4ed963828c /TestApp | |
parent | a5b6dc1789f2e06a26fe6a0510aee04aeccdc70b (diff) | |
download | nw4rtools-e962fd89af865d6e01522e9752f5fbd855ce128a.tar.gz nw4rtools-e962fd89af865d6e01522e9752f5fbd855ce128a.zip |
partially working obj importer. still untested in-game
Diffstat (limited to '')
-rw-r--r-- | TestApp/Main.cs | 19 | ||||
-rw-r--r-- | TestApp/RenderWindow.cs | 2 | ||||
-rw-r--r-- | TestApp/TestApp.pidb | bin | 4288 -> 4240 bytes | |||
-rwxr-xr-x | TestApp/bin/Debug/NW4RTools.dll | bin | 206336 -> 232960 bytes | |||
-rw-r--r-- | TestApp/bin/Debug/NW4RTools.dll.mdb | bin | 102677 -> 112922 bytes | |||
-rwxr-xr-x | TestApp/bin/Debug/TestApp.exe | bin | 5632 -> 5632 bytes | |||
-rw-r--r-- | TestApp/bin/Debug/TestApp.exe.mdb | bin | 965 -> 979 bytes |
7 files changed, 18 insertions, 3 deletions
diff --git a/TestApp/Main.cs b/TestApp/Main.cs index b9a8f13..a5db889 100644 --- a/TestApp/Main.cs +++ b/TestApp/Main.cs @@ -11,7 +11,7 @@ namespace TestApp { public static void Main(string[] args) { string mdlPath = "/home/me/Games/Newer/ModelRev/"; - //string mdlName = "CS_W1"; + /*//string mdlName = "CS_W1"; //string mdlName = "bgB_4502"; //string mdlName = "cobKoopaCastle"; string mdlName = "waterPlate_W4boss"; @@ -22,7 +22,22 @@ namespace TestApp { byte[] file = File.ReadAllBytes(mdlPath + mdlName + ".brres"); ResFile rf = BrresReader.LoadFile(file); - File.WriteAllBytes(mdlPath + mdlName + "_rewritten.brres", BrresWriter.WriteFile(rf)); + 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"); + + File.WriteAllBytes(mdlPath + "crapmap.brres", BrresWriter.WriteFile(rf)); + + + ResFile rf2 = BrresReader.LoadFile(File.ReadAllBytes(mdlPath + "crapmap.brres")); + using (var gw = new RenderWindow()) { + gw.Title = "crapmap"; + gw.SetModel(rf2, "CrapMap"); + gw.Run(1, 1); + } /*using (var gw = new RenderWindow()) { gw.Title = mdlName; diff --git a/TestApp/RenderWindow.cs b/TestApp/RenderWindow.cs index 3215190..2f29d0f 100644 --- a/TestApp/RenderWindow.cs +++ b/TestApp/RenderWindow.cs @@ -46,7 +46,7 @@ namespace TestApp { GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); //Matrix4 modelview = Matrix4.LookAt(new Vector3(1000, 600, 1000), new Vector3(1000, 0, 0), Vector3.UnitY); - Matrix4 modelview = Matrix4.LookAt(new Vector3(0, 0, 1000), new Vector3(0, 0, 0), Vector3.UnitY); + Matrix4 modelview = Matrix4.LookAt(new Vector3(0, 2, 4), 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 ad64e77..bbc694a 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 aa8cfdd..e4c2ea1 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 02e5217..62014b8 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 d0238aa..a5251b0 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 2998706..7508ce0 100644 --- a/TestApp/bin/Debug/TestApp.exe.mdb +++ b/TestApp/bin/Debug/TestApp.exe.mdb |