diff options
Diffstat (limited to '')
-rw-r--r-- | TestApp/Main.cs | 73 | ||||
-rw-r--r-- | TestApp/RenderWindow.cs | 20 | ||||
-rw-r--r-- | TestApp/TestApp.pidb | bin | 4240 -> 4427 bytes | |||
-rwxr-xr-x | TestApp/bin/Debug/NW4RTools.dll | bin | 232960 -> 233472 bytes | |||
-rw-r--r-- | TestApp/bin/Debug/NW4RTools.dll.mdb | bin | 112922 -> 112974 bytes | |||
-rwxr-xr-x | TestApp/bin/Debug/TestApp.exe | bin | 5632 -> 7168 bytes | |||
-rw-r--r-- | TestApp/bin/Debug/TestApp.exe.mdb | bin | 979 -> 1243 bytes |
7 files changed, 71 insertions, 22 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)); + + } } } diff --git a/TestApp/RenderWindow.cs b/TestApp/RenderWindow.cs index 2f29d0f..6013724 100644 --- a/TestApp/RenderWindow.cs +++ b/TestApp/RenderWindow.cs @@ -27,6 +27,22 @@ namespace TestApp { GL.Enable(EnableCap.Blend); GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha); + GL.Disable(EnableCap.CullFace); + + GL.Enable(EnableCap.Lighting); + + GL.ShadeModel(ShadingModel.Smooth); + + GL.Light(LightName.Light0, LightParameter.Position, new Vector4(0, 500, 1000, 0)); + GL.Material(MaterialFace.FrontAndBack, MaterialParameter.Specular, new Color4(1, 1, 1, 1)); + GL.Material(MaterialFace.FrontAndBack, MaterialParameter.Shininess, 50); + GL.Enable(EnableCap.Light0); + + GL.Light(LightName.Light1, LightParameter.Position, new Vector4(1000, 500, 0, 0)); + GL.Material(MaterialFace.FrontAndBack, MaterialParameter.Specular, new Color4(1, 1, 1, 1)); + GL.Material(MaterialFace.FrontAndBack, MaterialParameter.Shininess, 50); + GL.Enable(EnableCap.Light1); + m_glModel.Prepare(Context); } @@ -45,8 +61,8 @@ namespace TestApp { GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); - //Matrix4 modelview = Matrix4.LookAt(new Vector3(1000, 600, 1000), new Vector3(1000, 0, 0), Vector3.UnitY); - Matrix4 modelview = Matrix4.LookAt(new Vector3(0, 2, 4), new Vector3(0, 0, 0), Vector3.UnitY); + Matrix4 modelview = Matrix4.LookAt(new Vector3(1000, 400, 1000), new Vector3(1000, 0, 0), Vector3.UnitY); + //Matrix4 modelview = Matrix4.LookAt(new Vector3(-3, 2, 3), new Vector3(0, 0, 0), Vector3.UnitY); GL.MatrixMode(MatrixMode.Modelview); GL.LoadMatrix(ref modelview); diff --git a/TestApp/TestApp.pidb b/TestApp/TestApp.pidb Binary files differindex bbc694a..e8df7af 100644 --- a/TestApp/TestApp.pidb +++ b/TestApp/TestApp.pidb diff --git a/TestApp/bin/Debug/NW4RTools.dll b/TestApp/bin/Debug/NW4RTools.dll Binary files differindex e4c2ea1..40356de 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 62014b8..92742d0 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 a5251b0..5b808e0 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 7508ce0..8ec2779 100644 --- a/TestApp/bin/Debug/TestApp.exe.mdb +++ b/TestApp/bin/Debug/TestApp.exe.mdb |