From b625da59b0bbe60a9380dbd00df1ae982e6b5a58 Mon Sep 17 00:00:00 2001 From: Treeki Date: Wed, 16 Mar 2011 05:14:49 +0100 Subject: now uses 8-bit vertex data indexes where possible. quite a big optimisation! --- TestApp/Main.cs | 18 ++++++++++++++---- TestApp/RenderWindow.cs | 4 ++-- TestApp/TestApp.pidb | Bin 4427 -> 4427 bytes TestApp/bin/Debug/NW4RTools.dll | Bin 236544 -> 237568 bytes TestApp/bin/Debug/NW4RTools.dll.mdb | Bin 114305 -> 114410 bytes TestApp/bin/Debug/TestApp.exe | Bin 7680 -> 7680 bytes TestApp/bin/Debug/TestApp.exe.mdb | Bin 1246 -> 1300 bytes 7 files changed, 16 insertions(+), 6 deletions(-) (limited to 'TestApp') diff --git a/TestApp/Main.cs b/TestApp/Main.cs index 56991bd..71b577b 100644 --- a/TestApp/Main.cs +++ b/TestApp/Main.cs @@ -17,7 +17,7 @@ namespace TestApp { // Going to create a model! //string filename = "crapmap", resmdlname = "CrapMap"; - string filename = "SMGoldwood"; + /*string filename = "SMGoldwood"; ResFile rf = new ResFile(); @@ -25,15 +25,25 @@ namespace TestApp { ObjImporter.ImportModel(mdlPath, File.OpenText(mdlPath + "BrownTree.obj"), rf, "BrownTree", ObjImporter.LightmapType.MapObj); ObjImporter.ImportModel(mdlPath, File.OpenText(mdlPath + "RedTree.obj"), rf, "RedTree", ObjImporter.LightmapType.MapObj); - File.WriteAllBytes(mdlPath + "SMGoldwood.brres", BrresWriter.WriteFile(rf)); + File.WriteAllBytes(mdlPath + "SMGoldwood.brres", BrresWriter.WriteFile(rf));*/ - /*ResFile rf2 = BrresReader.LoadFile(File.ReadAllBytes(mdlPath + filename + ".brres")); + string filename = "MMFullWorld"; + string resmdlname = "WorldBase"; + + ResFile rf = new ResFile(); + + ObjImporter.ImportModel(mdlPath, File.OpenText(mdlPath + "fullworld-Z6-fail.obj"), rf, resmdlname, ObjImporter.LightmapType.Map); + + File.WriteAllBytes(mdlPath + filename + ".brres", BrresWriter.WriteFile(rf)); + + 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); - }*/ + } + //*/ diff --git a/TestApp/RenderWindow.cs b/TestApp/RenderWindow.cs index f314146..fed1b9a 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(-50, 20, 50), new Vector3(0, 0, 0), Vector3.UnitY); + Matrix4 modelview = Matrix4.LookAt(new Vector3(0, 400, 1000), new Vector3(0, 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 4763179..af45428 100644 Binary files a/TestApp/TestApp.pidb and b/TestApp/TestApp.pidb differ diff --git a/TestApp/bin/Debug/NW4RTools.dll b/TestApp/bin/Debug/NW4RTools.dll index 6f24c8e..6cd7365 100755 Binary files a/TestApp/bin/Debug/NW4RTools.dll and b/TestApp/bin/Debug/NW4RTools.dll differ diff --git a/TestApp/bin/Debug/NW4RTools.dll.mdb b/TestApp/bin/Debug/NW4RTools.dll.mdb index 0dab4c1..208c344 100644 Binary files a/TestApp/bin/Debug/NW4RTools.dll.mdb and b/TestApp/bin/Debug/NW4RTools.dll.mdb differ diff --git a/TestApp/bin/Debug/TestApp.exe b/TestApp/bin/Debug/TestApp.exe index 48903c9..ee143e2 100755 Binary files a/TestApp/bin/Debug/TestApp.exe and b/TestApp/bin/Debug/TestApp.exe differ diff --git a/TestApp/bin/Debug/TestApp.exe.mdb b/TestApp/bin/Debug/TestApp.exe.mdb index f2f707d..b46c061 100644 Binary files a/TestApp/bin/Debug/TestApp.exe.mdb and b/TestApp/bin/Debug/TestApp.exe.mdb differ -- cgit v1.2.3