summaryrefslogtreecommitdiff
path: root/TestApp/Main.cs
diff options
context:
space:
mode:
Diffstat (limited to 'TestApp/Main.cs')
-rw-r--r--TestApp/Main.cs9
1 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);