From 52aada22e106b6fd36b6b94fb3064510ac3ee40c Mon Sep 17 00:00:00 2001 From: Treeki Date: Sun, 13 Feb 2011 04:03:59 +0100 Subject: it converts textures too, now! some formats missing, I'll add them later. --- TestApp/Main.cs | 9 ++++++++- TestApp/bin/Debug/NW4RTools.dll | Bin 159232 -> 162816 bytes TestApp/bin/Debug/NW4RTools.dll.mdb | Bin 87942 -> 89888 bytes TestApp/bin/Debug/TestApp.exe | Bin 4096 -> 4608 bytes TestApp/bin/Debug/TestApp.exe.mdb | Bin 479 -> 548 bytes 5 files changed, 8 insertions(+), 1 deletion(-) (limited to 'TestApp') diff --git a/TestApp/Main.cs b/TestApp/Main.cs index afe6dda..408c95f 100644 --- a/TestApp/Main.cs +++ b/TestApp/Main.cs @@ -1,5 +1,6 @@ using System; using System.IO; +using System.Collections.Generic; using NW4RTools; namespace TestApp { @@ -7,7 +8,7 @@ namespace TestApp { public static void Main(string[] args) { string mdlPath = "/home/me/Games/Newer/ModelRev/"; - string mdlName = "CS_W7"; + string mdlName = "CS_W9"; //string mdlName = "bgB_4502"; string whatever = (mdlName == "CS_W2" || mdlName == "CS_W3" || mdlName == "CS_W6") ? "a" : ""; @@ -15,6 +16,12 @@ namespace TestApp { byte[] file = File.ReadAllBytes(mdlPath + mdlName + ".brres"); ResFile rf = BrresReader.LoadFile(file); + var texs = rf.GetGroup("Textures(NW4R)"); + // wtf C#?! + foreach (var kv in (IEnumerable>)texs) { + kv.Value.BaseImage.Save(mdlPath + kv.Key + ".png"); + } + //var objFile = File.Open(mdlPath + mdlName + ".obj", FileMode.OpenOrCreate); var objFile = File.Open(mdlPath + mdlName + ".dae", FileMode.OpenOrCreate); //var sw = new StreamWriter(objFile); diff --git a/TestApp/bin/Debug/NW4RTools.dll b/TestApp/bin/Debug/NW4RTools.dll index 611af6c..870660f 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 a9dff6f..d8889f1 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 5845276..4c3f608 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 a86d949..46a6888 100644 Binary files a/TestApp/bin/Debug/TestApp.exe.mdb and b/TestApp/bin/Debug/TestApp.exe.mdb differ -- cgit v1.2.3