summaryrefslogtreecommitdiff
path: root/TestApp/Main.cs
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-03-05 05:25:14 +0100
committerTreeki <treeki@gmail.com>2011-03-05 05:25:14 +0100
commite962fd89af865d6e01522e9752f5fbd855ce128a (patch)
tree0fb19e74a2d87b2ece48152fee2b2f4ed963828c /TestApp/Main.cs
parenta5b6dc1789f2e06a26fe6a0510aee04aeccdc70b (diff)
downloadnw4rtools-e962fd89af865d6e01522e9752f5fbd855ce128a.tar.gz
nw4rtools-e962fd89af865d6e01522e9752f5fbd855ce128a.zip
partially working obj importer. still untested in-game
Diffstat (limited to 'TestApp/Main.cs')
-rw-r--r--TestApp/Main.cs19
1 files changed, 17 insertions, 2 deletions
diff --git a/TestApp/Main.cs b/TestApp/Main.cs
index b9a8f13..a5db889 100644
--- a/TestApp/Main.cs
+++ b/TestApp/Main.cs
@@ -11,7 +11,7 @@ namespace TestApp {
public static void Main(string[] args) {
string mdlPath = "/home/me/Games/Newer/ModelRev/";
- //string mdlName = "CS_W1";
+ /*//string mdlName = "CS_W1";
//string mdlName = "bgB_4502";
//string mdlName = "cobKoopaCastle";
string mdlName = "waterPlate_W4boss";
@@ -22,7 +22,22 @@ namespace TestApp {
byte[] file = File.ReadAllBytes(mdlPath + mdlName + ".brres");
ResFile rf = BrresReader.LoadFile(file);
- File.WriteAllBytes(mdlPath + mdlName + "_rewritten.brres", BrresWriter.WriteFile(rf));
+ File.WriteAllBytes(mdlPath + mdlName + "_rewritten.brres", BrresWriter.WriteFile(rf));*/
+
+ // Going to create a model!
+ ResFile rf = new ResFile();
+
+ ObjImporter.ImportModel(mdlPath, File.OpenText(mdlPath + "crapmap.obj"), rf, "CrapMap");
+
+ File.WriteAllBytes(mdlPath + "crapmap.brres", BrresWriter.WriteFile(rf));
+
+
+ ResFile rf2 = BrresReader.LoadFile(File.ReadAllBytes(mdlPath + "crapmap.brres"));
+ using (var gw = new RenderWindow()) {
+ gw.Title = "crapmap";
+ gw.SetModel(rf2, "CrapMap");
+ gw.Run(1, 1);
+ }
/*using (var gw = new RenderWindow()) {
gw.Title = mdlName;