diff options
author | Treeki <treeki@gmail.com> | 2011-02-13 04:03:59 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2011-02-13 04:03:59 +0100 |
commit | 52aada22e106b6fd36b6b94fb3064510ac3ee40c (patch) | |
tree | 5cf5eb6866e33b023bfdaaf94ab1deb4b8ff71ab /TestApp | |
parent | 8b48608d45c8266b765e8ee29e612fb18376aa65 (diff) | |
download | nw4rtools-52aada22e106b6fd36b6b94fb3064510ac3ee40c.tar.gz nw4rtools-52aada22e106b6fd36b6b94fb3064510ac3ee40c.zip |
it converts textures too, now! some formats missing, I'll add them later.
Diffstat (limited to '')
-rw-r--r-- | TestApp/Main.cs | 9 | ||||
-rwxr-xr-x | TestApp/bin/Debug/NW4RTools.dll | bin | 159232 -> 162816 bytes | |||
-rw-r--r-- | TestApp/bin/Debug/NW4RTools.dll.mdb | bin | 87942 -> 89888 bytes | |||
-rwxr-xr-x | TestApp/bin/Debug/TestApp.exe | bin | 4096 -> 4608 bytes | |||
-rw-r--r-- | TestApp/bin/Debug/TestApp.exe.mdb | bin | 479 -> 548 bytes |
5 files changed, 8 insertions, 1 deletions
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<Texture>("Textures(NW4R)"); + // wtf C#?! + foreach (var kv in (IEnumerable<KeyValuePair<string,Texture>>)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 Binary files differindex 611af6c..870660f 100755 --- a/TestApp/bin/Debug/NW4RTools.dll +++ b/TestApp/bin/Debug/NW4RTools.dll diff --git a/TestApp/bin/Debug/NW4RTools.dll.mdb b/TestApp/bin/Debug/NW4RTools.dll.mdb Binary files differindex a9dff6f..d8889f1 100644 --- a/TestApp/bin/Debug/NW4RTools.dll.mdb +++ b/TestApp/bin/Debug/NW4RTools.dll.mdb diff --git a/TestApp/bin/Debug/TestApp.exe b/TestApp/bin/Debug/TestApp.exe Binary files differindex 5845276..4c3f608 100755 --- a/TestApp/bin/Debug/TestApp.exe +++ b/TestApp/bin/Debug/TestApp.exe diff --git a/TestApp/bin/Debug/TestApp.exe.mdb b/TestApp/bin/Debug/TestApp.exe.mdb Binary files differindex a86d949..46a6888 100644 --- a/TestApp/bin/Debug/TestApp.exe.mdb +++ b/TestApp/bin/Debug/TestApp.exe.mdb |