From 799330e70c7d074c4d923c12cc71ae39c3d0c20d Mon Sep 17 00:00:00 2001 From: Treeki Date: Wed, 23 Mar 2011 22:27:17 +0100 Subject: just testing --- TestApp/Main.cs | 24 ++++++++++++++++++------ TestApp/bin/Debug/NW4RTools.dll | Bin 237568 -> 238592 bytes TestApp/bin/Debug/NW4RTools.dll.mdb | Bin 114610 -> 114661 bytes TestApp/bin/Debug/TestApp.exe | Bin 7680 -> 8192 bytes TestApp/bin/Debug/TestApp.exe.mdb | Bin 1300 -> 1334 bytes 5 files changed, 18 insertions(+), 6 deletions(-) (limited to 'TestApp') diff --git a/TestApp/Main.cs b/TestApp/Main.cs index 4901ec4..8e144f9 100644 --- a/TestApp/Main.cs +++ b/TestApp/Main.cs @@ -28,16 +28,28 @@ namespace TestApp { File.WriteAllBytes(mdlPath + "SMGoldwood.brres", BrresWriter.WriteFile(rf));*/ - string filename = "MMFullWorld"; - string resmdlname = "WorldBase"; + for (int i = 0; i < 10; i++) { + string filename = "MMFullWorld"; + string resmdlname = "WorldBase"; - ResFile rf = new ResFile(); + ResFile rf = new ResFile(); + + ObjImporter.ImportModel(mdlPath, File.OpenText(mdlPath + "fullworld-tree-fbx.obj"), rf, resmdlname, ObjImporter.LightmapType.Map); - ObjImporter.ImportModel(mdlPath, File.OpenText(mdlPath + "fullworld-tree-fbx.obj"), rf, resmdlname, ObjImporter.LightmapType.Map); + var m = rf.GetModelGroup()["WorldBase"]; + var bc = m.Bytecode["DrawOpa"]; + // trash most entries + var newList = new List(); + for (int j = 0; j < i; j++) { + newList.Add(bc.Instructions[j]); + } + newList.Add(new NW4RTools.Models.ByteCode.DoneInstruction()); + bc.Instructions = newList; - File.WriteAllBytes(mdlPath + filename + ".brres", BrresWriter.WriteFile(rf)); + File.WriteAllBytes(mdlPath + "base" + i.ToString() + ".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); diff --git a/TestApp/bin/Debug/NW4RTools.dll b/TestApp/bin/Debug/NW4RTools.dll index 111c9f0..e3c34c6 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 83824f2..d8213c7 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 4e6e71a..5c3a09f 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 f675c74..54eb541 100644 Binary files a/TestApp/bin/Debug/TestApp.exe.mdb and b/TestApp/bin/Debug/TestApp.exe.mdb differ -- cgit v1.2.3