diff options
Diffstat (limited to 'TestApp/Main.cs')
| -rw-r--r-- | TestApp/Main.cs | 73 | 
1 files changed, 53 insertions, 20 deletions
| diff --git a/TestApp/Main.cs b/TestApp/Main.cs index a5db889..fbaa7dc 100644 --- a/TestApp/Main.cs +++ b/TestApp/Main.cs @@ -11,39 +11,30 @@ namespace TestApp {  		public static void Main(string[] args) {  			string mdlPath = "/home/me/Games/Newer/ModelRev/"; -			/*//string mdlName = "CS_W1"; -			//string mdlName = "bgB_4502"; -			//string mdlName = "cobKoopaCastle"; -			string mdlName = "waterPlate_W4boss"; -			mdlName = "test_lift"; +			//skawo(); +			//oldBehaviour(); +			//return; -			string whatever = (mdlName == "CS_W2" || mdlName == "CS_W3" || mdlName == "CS_W6") ? "a" : ""; -			byte[] file = File.ReadAllBytes(mdlPath + mdlName + ".brres"); -			ResFile rf = BrresReader.LoadFile(file); +			// Going to create a model! +			//string filename = "crapmap", resmdlname = "CrapMap"; +			string filename = "GoldwoodBase", resmdlname = "GoldwoodBase"; -			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"); +			ObjImporter.ImportModel(mdlPath, File.OpenText(mdlPath + filename + ".obj"), rf, resmdlname); -			File.WriteAllBytes(mdlPath + "crapmap.brres", BrresWriter.WriteFile(rf)); +			File.WriteAllBytes(mdlPath + filename + ".brres", BrresWriter.WriteFile(rf)); -			ResFile rf2 = BrresReader.LoadFile(File.ReadAllBytes(mdlPath + "crapmap.brres")); +			ResFile rf2 = BrresReader.LoadFile(File.ReadAllBytes(mdlPath + filename + ".brres"));  			using (var gw = new RenderWindow()) { -				gw.Title = "crapmap"; -				gw.SetModel(rf2, "CrapMap"); +				gw.Title = filename; +				gw.SetModel(rf2, resmdlname);  				gw.Run(1, 1);  			} -			/*using (var gw = new RenderWindow()) { -				gw.Title = mdlName; -				gw.SetModel(rf, mdlName); -				gw.Run(1, 1); -			}*/ @@ -60,6 +51,48 @@ namespace TestApp {  			ColladaWriter.WriteModel(objFile, rf, mdlName + whatever);  			objFile.Close();*/  		} + + +		private static void skawo() { +			string mdlPath = "/home/me/Games/Newer/ModelRev/"; +			string skawopath = "/home/me/Dropbox/NEWERsmbw/Nowy folder/obj/"; +			ResFile rf = new ResFile(); + +			ObjImporter.ImportModel(skawopath, File.OpenText(skawopath + "edited.obj"), rf, "Skawo"); + +			File.WriteAllBytes(skawopath + "skawo.brres", BrresWriter.WriteFile(rf)); + + +			ResFile rf2 = BrresReader.LoadFile(File.ReadAllBytes(skawopath + "skawo.brres")); +			using (var gw = new RenderWindow()) { +				gw.Title = "Skawo"; +				gw.SetModel(rf2, "Skawo"); +				gw.Run(1, 1); +			} +		} + +		private static void oldBehaviour() { +			string mdlPath = "/home/me/Games/Newer/ModelRev/"; +			string mdlName = "CS_W1"; +			//string mdlName = "bgB_4502"; +			//string mdlName = "cobKoopaCastle"; +			//string mdlName = "waterPlate_W4boss"; +			//mdlName = "test_lift"; + +			string whatever = (mdlName == "CS_W2" || mdlName == "CS_W3" || mdlName == "CS_W6") ? "a" : ""; + +			byte[] file = File.ReadAllBytes(mdlPath + mdlName + ".brres"); +			ResFile rf = BrresReader.LoadFile(file); + +			using (var gw = new RenderWindow()) { +				gw.Title = mdlName; +				gw.SetModel(rf, mdlName); +				gw.Run(1, 1); +			} + +			//File.WriteAllBytes(mdlPath + mdlName + "_rewritten.brres", BrresWriter.WriteFile(rf)); + +		}  	}  } | 
