summaryrefslogtreecommitdiff
path: root/TestApp/Main.cs
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-03-23 22:27:17 +0100
committerTreeki <treeki@gmail.com>2011-03-23 22:27:17 +0100
commit799330e70c7d074c4d923c12cc71ae39c3d0c20d (patch)
tree821a2aad1285c352dca067d294727b73bd08e649 /TestApp/Main.cs
parentd1c9bf937e6efd59af45b3d38b9ba96ef927dade (diff)
downloadnw4rtools-799330e70c7d074c4d923c12cc71ae39c3d0c20d.tar.gz
nw4rtools-799330e70c7d074c4d923c12cc71ae39c3d0c20d.zip
just testing
Diffstat (limited to '')
-rw-r--r--TestApp/Main.cs24
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);