diff options
Diffstat (limited to 'TestApp/Main.cs')
-rw-r--r-- | TestApp/Main.cs | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/TestApp/Main.cs b/TestApp/Main.cs index fbaa7dc..3d7f063 100644 --- a/TestApp/Main.cs +++ b/TestApp/Main.cs @@ -28,12 +28,12 @@ namespace TestApp { File.WriteAllBytes(mdlPath + filename + ".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); gw.Run(1, 1); - } + }*/ @@ -73,7 +73,7 @@ namespace TestApp { private static void oldBehaviour() { string mdlPath = "/home/me/Games/Newer/ModelRev/"; - string mdlName = "CS_W1"; + string mdlName = "lift_han_wood"; //string mdlName = "bgB_4502"; //string mdlName = "cobKoopaCastle"; //string mdlName = "waterPlate_W4boss"; @@ -84,14 +84,23 @@ namespace TestApp { byte[] file = File.ReadAllBytes(mdlPath + mdlName + ".brres"); ResFile rf = BrresReader.LoadFile(file); - using (var gw = new RenderWindow()) { + /*using (var gw = new RenderWindow()) { gw.Title = mdlName; gw.SetModel(rf, mdlName); gw.Run(1, 1); - } + }*/ //File.WriteAllBytes(mdlPath + mdlName + "_rewritten.brres", BrresWriter.WriteFile(rf)); + var texs = rf.GetGroup<Texture>("Textures(NW4R)"); + // wtf C#?! + foreach (var kv in (IEnumerable<KeyValuePair<string,Texture>>)texs) { + kv.Value.Images[0].Save(mdlPath + "images/" + kv.Key + ".png"); + } + + var objFile = File.Open(mdlPath + "lift_han_wood_M.dae", FileMode.OpenOrCreate); + ColladaExporter.WriteModel(objFile, rf, "lift_han_wood_M"); + objFile.Close(); } } } |