summaryrefslogtreecommitdiff
path: root/TestApp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-02-13 04:03:59 +0100
committerTreeki <treeki@gmail.com>2011-02-13 04:03:59 +0100
commit52aada22e106b6fd36b6b94fb3064510ac3ee40c (patch)
tree5cf5eb6866e33b023bfdaaf94ab1deb4b8ff71ab /TestApp
parent8b48608d45c8266b765e8ee29e612fb18376aa65 (diff)
downloadnw4rtools-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.cs9
-rwxr-xr-xTestApp/bin/Debug/NW4RTools.dllbin159232 -> 162816 bytes
-rw-r--r--TestApp/bin/Debug/NW4RTools.dll.mdbbin87942 -> 89888 bytes
-rwxr-xr-xTestApp/bin/Debug/TestApp.exebin4096 -> 4608 bytes
-rw-r--r--TestApp/bin/Debug/TestApp.exe.mdbbin479 -> 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
index 611af6c..870660f 100755
--- a/TestApp/bin/Debug/NW4RTools.dll
+++ b/TestApp/bin/Debug/NW4RTools.dll
Binary files differ
diff --git a/TestApp/bin/Debug/NW4RTools.dll.mdb b/TestApp/bin/Debug/NW4RTools.dll.mdb
index a9dff6f..d8889f1 100644
--- a/TestApp/bin/Debug/NW4RTools.dll.mdb
+++ b/TestApp/bin/Debug/NW4RTools.dll.mdb
Binary files differ
diff --git a/TestApp/bin/Debug/TestApp.exe b/TestApp/bin/Debug/TestApp.exe
index 5845276..4c3f608 100755
--- a/TestApp/bin/Debug/TestApp.exe
+++ b/TestApp/bin/Debug/TestApp.exe
Binary files differ
diff --git a/TestApp/bin/Debug/TestApp.exe.mdb b/TestApp/bin/Debug/TestApp.exe.mdb
index a86d949..46a6888 100644
--- a/TestApp/bin/Debug/TestApp.exe.mdb
+++ b/TestApp/bin/Debug/TestApp.exe.mdb
Binary files differ