diff options
Diffstat (limited to 'TestApp/Main.cs')
-rw-r--r-- | TestApp/Main.cs | 24 |
1 files changed, 18 insertions, 6 deletions
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<NW4RTools.Models.ByteCode.Instruction>(); + 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); |