diff --git a/Switch_FileFormatsMain/FileFormats/BFRES.cs b/Switch_FileFormatsMain/FileFormats/BFRES.cs index e3c04d33..c1ca82f4 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES.cs @@ -145,12 +145,14 @@ namespace FirstPlugin } private void SaveSwitch(MemoryStream mem) { + var resFile = bfres.ResFileNode.resFile; + int CurMdl = 0; foreach (FMDL model in bfres.models) { - bfres.resFile.Models[CurMdl].Shapes.Clear(); - bfres.resFile.Models[CurMdl].VertexBuffers.Clear(); - bfres.resFile.Models[CurMdl].Materials.Clear(); + resFile.Models[CurMdl].Shapes.Clear(); + resFile.Models[CurMdl].VertexBuffers.Clear(); + resFile.Models[CurMdl].Materials.Clear(); int i = 0; var duplicates = model.shapes.GroupBy(c => c.Text).Where(g => g.Skip(1).Any()).SelectMany(c => c); @@ -162,43 +164,45 @@ namespace FirstPlugin CheckMissingTextures(shape); BfresSwitch.SetShape(shape, shape.Shape); - bfres.resFile.Models[CurMdl].Shapes.Add(shape.Shape); - bfres.resFile.Models[CurMdl].VertexBuffers.Add(shape.VertexBuffer); - shape.Shape.VertexBufferIndex = (ushort)(bfres.resFile.Models[CurMdl].VertexBuffers.Count - 1); + resFile.Models[CurMdl].Shapes.Add(shape.Shape); + resFile.Models[CurMdl].VertexBuffers.Add(shape.VertexBuffer); + shape.Shape.VertexBufferIndex = (ushort)(resFile.Models[CurMdl].VertexBuffers.Count - 1); SetShaderAssignAttributes(shape.GetMaterial().shaderassign, shape); } foreach (FMAT mat in model.materials.Values) { BfresSwitch.SetMaterial(mat, mat.Material); - bfres.resFile.Models[CurMdl].Materials.Add(mat.Material); + resFile.Models[CurMdl].Materials.Add(mat.Material); } CurMdl++; } - bfres.resFile.SkeletalAnims.Clear(); + resFile.SkeletalAnims.Clear(); if (EditorRoot.Nodes.ContainsKey("FSKA")) { foreach (BfresSkeletonAnim ska in EditorRoot.Nodes["FSKA"].Nodes) { - bfres.resFile.SkeletalAnims.Add(ska.SkeletalAnim); + resFile.SkeletalAnims.Add(ska.SkeletalAnim); } } ErrorCheck(); - BfresSwitch.WriteExternalFiles(bfres.resFile, EditorRoot); - bfres.resFile.Save(mem); + BfresSwitch.WriteExternalFiles(resFile, EditorRoot); + resFile.Save(mem); } private void SaveWiiU(MemoryStream mem) { - bfres.resFileU.Save(mem); + var resFileU = bfres.ResFileNode.resFileU; + + resFileU.Save(mem); int CurMdl = 0; foreach (FMDL model in bfres.models) { - bfres.resFileU.Models[CurMdl].Shapes.Clear(); - bfres.resFileU.Models[CurMdl].VertexBuffers.Clear(); - bfres.resFileU.Models[CurMdl].Materials.Clear(); + resFileU.Models[CurMdl].Shapes.Clear(); + resFileU.Models[CurMdl].VertexBuffers.Clear(); + resFileU.Models[CurMdl].Materials.Clear(); int i = 0; var duplicates = model.shapes.GroupBy(c => c.Text).Where(g => g.Skip(1).Any()).SelectMany(c => c); @@ -210,16 +214,16 @@ namespace FirstPlugin CheckMissingTextures(shape); BfresWiiU.SetShape(shape, shape.ShapeU); - bfres.resFileU.Models[CurMdl].Shapes.Add(shape.Text, shape.ShapeU); - bfres.resFileU.Models[CurMdl].VertexBuffers.Add(shape.VertexBufferU); - shape.ShapeU.VertexBufferIndex = (ushort)(bfres.resFileU.Models[CurMdl].VertexBuffers.Count - 1); + resFileU.Models[CurMdl].Shapes.Add(shape.Text, shape.ShapeU); + resFileU.Models[CurMdl].VertexBuffers.Add(shape.VertexBufferU); + shape.ShapeU.VertexBufferIndex = (ushort)(resFileU.Models[CurMdl].VertexBuffers.Count - 1); SetShaderAssignAttributes(shape.GetMaterial().shaderassign, shape); } foreach (FMAT mat in model.materials.Values) { BfresWiiU.SetMaterial(mat, mat.MaterialU); - bfres.resFileU.Models[CurMdl].Materials.Add(mat.Text, mat.MaterialU); + resFileU.Models[CurMdl].Materials.Add(mat.Text, mat.MaterialU); } CurMdl++; } diff --git a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/ExternalFiles.cs b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/ExternalFiles.cs index 7cbd6983..8430afbd 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/ExternalFiles.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/ExternalFiles.cs @@ -37,7 +37,16 @@ namespace Bfres.Structs if (dialogResult == DialogResult.Yes) { + foreach (var ext in Nodes) + { + if (ext is BinaryTextureContainer) + { + PluginRuntime.bntxContainers.Remove((BinaryTextureContainer)ext); + } + } + Nodes.Clear(); + Viewport.Instance.Refresh(); } } public override void OnClick(TreeView treeView) diff --git a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FMAA.cs b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FMAA.cs index 8192ce76..a40f5c3c 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FMAA.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FMAA.cs @@ -37,7 +37,7 @@ namespace Bfres.Structs foreach (FMAA fmaa in Nodes) { string FileName = folderPath + '\\' + fmaa.Text + ".bfmaa"; - ((FMAA)fmaa).MaterialAnim.Export(FileName, fmaa.BFRESRender.resFile); + ((FMAA)fmaa).MaterialAnim.Export(FileName, fmaa.GetResFile()); } } @@ -62,6 +62,10 @@ namespace Bfres.Structs public BFRESRender BFRESRender; public MaterialAnim MaterialAnim; + public ResFile GetResFile() + { + return ((ResourceFile)Parent.Parent).resFile; + } public void Read(MaterialAnim anim) { MaterialAnim = anim; diff --git a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FMAT.cs b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FMAT.cs index d70fa968..0328e698 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FMAT.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FMAT.cs @@ -65,13 +65,26 @@ namespace Bfres.Structs rename.Click += Rename; } - public BFRESRender BFRESRender; public bool Enabled = true; public override void OnClick(TreeView treeView) { FormLoader.LoadMatEditor(this); } + public ResFile GetResFile() + { + //ResourceFile -> FMDL -> Material Folder -> this + return ((FMDL)Parent.Parent).GetResFile(); + } + public ResU.ResFile GetResFileU() + { + return ((FMDL)Parent.Parent).GetResFileU(); + } + + public void UpdateTextureMaps() + { + ((ResourceFile)Parent.Parent.Parent.Parent).BFRESRender.UpdateSingleMaterialTextureMaps(this); + } public void SetActiveGame() { @@ -115,7 +128,7 @@ namespace Bfres.Structs if (sfd.ShowDialog() == DialogResult.OK) { - Material.Export(sfd.FileName, BFRESRender.resFile); + Material.Export(sfd.FileName, GetResFile()); } } private void Replace(object sender, EventArgs args) diff --git a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FMDL.cs b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FMDL.cs index f19a22df..008fa761 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FMDL.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FMDL.cs @@ -60,10 +60,28 @@ namespace Bfres.Structs { public List shapes = new List(); public Dictionary materials = new Dictionary(); - public BFRESRender BFRESRender; public Model Model; public ResU.Model ModelU; + public ResFile GetResFile() + { + //ResourceFile -> FMDL -> Material Folder -> this + return ((ResourceFile)Parent.Parent).resFile; + } + public ResU.ResFile GetResFileU() + { + return ((ResourceFile)Parent.Parent).resFileU; + } + public void UpdateVertexData() + { + ((ResourceFile)Parent.Parent).BFRESRender.UpdateVertexData(); + } + public List GetModelList() + { + return ((ResourceFile)Parent.Parent).BFRESRender.models; + } + + public FMDL() { ImageKey = "model"; @@ -105,7 +123,7 @@ namespace Bfres.Structs shp.SaveVertexBuffer(); } - BFRESRender.UpdateVertexData(); + UpdateVertexData(); Cursor.Current = Cursors.Default; } private void RecalculateNormals(object sender, EventArgs args) @@ -119,7 +137,7 @@ namespace Bfres.Structs shp.SaveVertexBuffer(); } - BFRESRender.UpdateVertexData(); + UpdateVertexData(); Cursor.Current = Cursors.Default; } private void Rename(object sender, EventArgs args) @@ -181,13 +199,13 @@ namespace Bfres.Structs shp.SaveVertexBuffer(); } - BFRESRender.UpdateVertexData(); + UpdateVertexData(); Cursor.Current = Cursors.Default; } public void CopyMaterial(FMAT selectedMaterial) { CopyMaterialMenu menu = new CopyMaterialMenu(); - menu.LoadMaterials(selectedMaterial.Text, BFRESRender.models); + menu.LoadMaterials(selectedMaterial.Text, GetModelList()); if (menu.ShowDialog() == DialogResult.OK) { foreach (TreeNode mdl in menu.materialTreeView.Nodes) @@ -281,7 +299,7 @@ namespace Bfres.Structs switch (ext) { case ".bfmdl": - Model.Export(sfd.FileName, BFRESRender.resFile); + Model.Export(sfd.FileName, GetResFile()); break; case ".csv": CsvModel csv = new CsvModel(); @@ -360,7 +378,6 @@ namespace Bfres.Structs FSHP shapeS = new FSHP(); shapeS.Shape = shpS; - shapeS.BFRESRender = BFRESRender; BfresSwitch.ReadShapesVertices(shapeS, shpS, vertexBuffer, this); shapes.Add(shapeS); Nodes["FshpFolder"].Nodes.Add(shapeS); @@ -370,7 +387,7 @@ namespace Bfres.Structs Cursor.Current = Cursors.WaitCursor; shapes.Clear(); Model mdl = new Model(); - mdl.Import(FileName, BFRESRender.resFile); + mdl.Import(FileName, GetResFile()); mdl.Name = Text; shapes.Clear(); Nodes["FshpFolder"].Nodes.Clear(); @@ -417,7 +434,6 @@ namespace Bfres.Structs shape.ApplyImportSettings(csvsettings, GetMaterial(shape.MaterialIndex)); shape.SaveShape(); shape.SaveVertexBuffer(); - shape.BFRESRender = BFRESRender; shape.BoneIndices = new List(); Nodes["FshpFolder"].Nodes.Add(shape); @@ -574,7 +590,6 @@ namespace Bfres.Structs shape.ApplyImportSettings(settings, GetMaterial(shape.MaterialIndex)); shape.SaveShape(); shape.SaveVertexBuffer(); - shape.BFRESRender = BFRESRender; shape.BoneIndices = new List(); List keyList = shapes.Select(o => o.Text).ToList(); @@ -587,7 +602,7 @@ namespace Bfres.Structs } break; } - BFRESRender.UpdateVertexData(); + UpdateVertexData(); } public FMAT GetMaterial(int index) { @@ -611,7 +626,6 @@ namespace Bfres.Structs mat.Material = new Material(); mat.Material.Import(FileName); mat.ReadMaterial(mat.Material); - mat.BFRESRender = BFRESRender; mat.Text = mat.Material.Name; materials.Add(mat.Text, mat); diff --git a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FSCN.cs b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FSCN.cs index e6a62d8f..dfbb9b67 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FSCN.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FSCN.cs @@ -40,17 +40,6 @@ namespace Bfres.Structs Nodes.Clear(); } } - public void LoadAnimations(ResFile resFile, BFRESRender BFRESRender) - { - foreach (var scn in resFile.SceneAnims) - { - FSCN sceneAnim = new FSCN(); - sceneAnim.Text = scn.Name; - sceneAnim.BFRESRender = BFRESRender; - sceneAnim.Read(scn); - Nodes.Add(sceneAnim); - } - } public override void OnClick(TreeView treeView) { @@ -61,8 +50,6 @@ namespace Bfres.Structs public class FSCN : TreeNodeCustom { public SceneAnim SceneAnim; - public BFRESRender BFRESRender; - public FSCN() { ImageKey = "skeletonAnimation"; @@ -77,6 +64,11 @@ namespace Bfres.Structs replace.Click += Replace; } + public ResFile GetResFile() + { + return ((ResourceFile)Parent.Parent).resFile; + } + private void Export(object sender, EventArgs args) { SaveFileDialog sfd = new SaveFileDialog(); @@ -86,7 +78,7 @@ namespace Bfres.Structs if (sfd.ShowDialog() == DialogResult.OK) { - SceneAnim.Export(sfd.FileName, BFRESRender.resFile); + SceneAnim.Export(sfd.FileName, GetResFile()); } } private void Replace(object sender, EventArgs args) diff --git a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FSHP.cs b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FSHP.cs index ea94c3d5..b9aa775e 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FSHP.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FSHP.cs @@ -41,7 +41,7 @@ namespace Bfres.Structs { Nodes.Clear(); ((FMDL)Parent).shapes.Clear(); - ((FMDL)Parent).BFRESRender.UpdateVertexData(); + ((FMDL)Parent).UpdateVertexData(); } } private void ExportAll(object sender, EventArgs args) @@ -134,8 +134,6 @@ namespace Bfres.Structs ContextMenu.MenuItems.Add(rename); rename.Click += Rename; } - - public BFRESRender BFRESRender; public FMATEditor editor; public int ModelIndex; //For getting the model the shape is in @@ -144,6 +142,24 @@ namespace Bfres.Structs public ResU.VertexBuffer VertexBufferU; public ResU.Shape ShapeU; + public ResFile GetResFile() + { + //ResourceFile -> FMDL -> Material Folder -> this + return ((FMDL)Parent.Parent).GetResFile(); + } + public ResU.ResFile GetResFileU() + { + return ((FMDL)Parent.Parent).GetResFileU(); + } + public void UpdateVertexData() + { + ((FMDL)Parent.Parent).UpdateVertexData(); + } + public List GetModelList() + { + return ((FMDL)Parent.Parent).GetModelList(); + } + public FMAT GetMaterial() { return ((FMDL)Parent.Parent).materials.Values.ElementAt(MaterialIndex); @@ -162,7 +178,7 @@ namespace Bfres.Structs Cursor.Current = Cursors.WaitCursor; SmoothNormals(); SaveVertexBuffer(); - BFRESRender.UpdateVertexData(); + UpdateVertexData(); Cursor.Current = Cursors.Default; } private void RecalculateNormals(object sender, EventArgs args) @@ -170,7 +186,7 @@ namespace Bfres.Structs Cursor.Current = Cursors.WaitCursor; CalculateNormals(); SaveVertexBuffer(); - BFRESRender.UpdateVertexData(); + UpdateVertexData(); Cursor.Current = Cursors.Default; } private void Rename(object sender, EventArgs args) @@ -190,7 +206,7 @@ namespace Bfres.Structs if (dialogResult == DialogResult.Yes) { ((FMDL)Parent.Parent).shapes.Remove(this); - ((FMDL)Parent.Parent).BFRESRender.UpdateVertexData(); + ((FMDL)Parent.Parent).UpdateVertexData(); Parent.Nodes.Remove(this); } } @@ -320,7 +336,7 @@ namespace Bfres.Structs CalculateTangentBitangent(); SaveVertexBuffer(); - BFRESRender.UpdateVertexData(); + UpdateVertexData(); Cursor.Current = Cursors.Default; } public bool HasUV0() @@ -345,7 +361,7 @@ namespace Bfres.Structs FlipUvsVertical(); SaveVertexBuffer(); - BFRESRender.UpdateVertexData(); + UpdateVertexData(); } public void FlipUvsHorizontal(object sender, EventArgs args) { @@ -357,7 +373,7 @@ namespace Bfres.Structs FlipUvsHorizontal(); SaveVertexBuffer(); - BFRESRender.UpdateVertexData(); + UpdateVertexData(); } public void ExportMaterials(object sender, EventArgs args) { @@ -368,7 +384,7 @@ namespace Bfres.Structs if (sfd.ShowDialog() == DialogResult.OK) { - GetMaterial().Material.Export(sfd.FileName, BFRESRender.resFile); + GetMaterial().Material.Export(sfd.FileName, GetResFile()); } } public void ReplaceMaterials(object sender, EventArgs args) @@ -414,7 +430,7 @@ namespace Bfres.Structs } public void ExportBinaryObject(string FileName) { - Shape.Export(FileName, BFRESRender.resFile); + Shape.Export(FileName, GetResFile()); } public void Replace(object sender, EventArgs args) { @@ -438,7 +454,7 @@ namespace Bfres.Structs shp.Import(ofd.FileName, VertexBuffer); shp.Name = Text; shp.MaterialIndex = (ushort)MaterialIndex; - BfresSwitch.ReadShapesVertices(this, shp, VertexBuffer, BFRESRender.models[ModelIndex]); + BfresSwitch.ReadShapesVertices(this, shp, VertexBuffer, GetModelList()[ModelIndex]); break; default: AssimpData assimp = new AssimpData(); @@ -474,7 +490,7 @@ namespace Bfres.Structs } break; } - BFRESRender.UpdateVertexData(); + UpdateVertexData(); } } public void CreateIndexList(GenericObject ob, FMDL mdl = null) diff --git a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FSKA.cs b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FSKA.cs index e0dae800..933788bf 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FSKA.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FSKA.cs @@ -60,7 +60,6 @@ namespace Bfres.Structs ZROT = 0x28, } public SkeletalAnim SkeletalAnim; - public BFRESRender BFRESRender; public BfresSkeletonAnim() { @@ -90,6 +89,11 @@ namespace Bfres.Structs ContextMenu.MenuItems.Add(replace); replace.Click += Replace; } + public ResFile GetResFile() + { + //ResourceFile -> FMDL -> Material Folder -> this + return ((ResourceFile)Parent.Parent).resFile; + } private void Export(object sender, EventArgs args) { SaveFileDialog sfd = new SaveFileDialog(); @@ -99,7 +103,7 @@ namespace Bfres.Structs if (sfd.ShowDialog() == DialogResult.OK) { - SkeletalAnim.Export(sfd.FileName, BFRESRender.resFile); + SkeletalAnim.Export(sfd.FileName, GetResFile()); } } private void Replace(object sender, EventArgs args) diff --git a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FSKL.cs b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FSKL.cs index 2c9c6b12..7db3dd58 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FSKL.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/FSKL.cs @@ -43,7 +43,7 @@ namespace Bfres.Structs if (sfd.ShowDialog() == DialogResult.OK) { - Skeleton.Export(sfd.FileName, BFRESRender.resFile); + Skeleton.Export(sfd.FileName, ((FMDL)Parent).GetResFile()); } } public void Replace(object sender, EventArgs args) @@ -58,12 +58,10 @@ namespace Bfres.Structs Skeleton.Import(ofd.FileName); } } - public override void OnClick(TreeView treeView) { } - } public FSKL() { @@ -107,6 +105,11 @@ namespace Bfres.Structs ContextMenu.MenuItems.Add(replace); replace.Click += Replace; } + public ResFile GetResFile() + { + //ResourceFile -> FMDL -> Material Folder -> this + return ((FMDL)Parent.Parent).GetResFile(); + } public void Export(object sender, EventArgs args) { SaveFileDialog sfd = new SaveFileDialog(); @@ -116,7 +119,7 @@ namespace Bfres.Structs if (sfd.ShowDialog() == DialogResult.OK) { - Bone.Export(sfd.FileName, BFRESRender.resFile); + Bone.Export(sfd.FileName, GetResFile()); } } public void Replace(object sender, EventArgs args) diff --git a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/ResourceFile.cs b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/ResourceFile.cs index fdd79e34..04a541fc 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/ResourceFile.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/ResourceFile.cs @@ -31,6 +31,9 @@ namespace Bfres.Structs { public BFRESRender BFRESRender; + public ResFile resFile = null; + public ResU.ResFile resFileU = null; + public TreeNode TextureFolder = new TreeNode("Textures"); public ResourceFile(IFileFormat handler) { @@ -116,44 +119,46 @@ namespace Bfres.Structs BFRESRender.UpdateVertexData(); } } - public void Load(ResU.ResFile resFile) + public void Load(ResU.ResFile res) { - Text = resFile.Name; + resFileU = res; - if (resFile.Models.Count > 0) + Text = resFileU.Name; + + if (resFileU.Models.Count > 0) Nodes.Add(new FmdlFolder()); - if (resFile.Textures.Count > 0) - AddFTEXTextures(resFile); - if (resFile.SkeletalAnims.Count > 0) - AddSkeletonAnims(resFile); - if (resFile.ShaderParamAnims.Count > 0) + if (resFileU.Textures.Count > 0) + AddFTEXTextures(resFileU); + if (resFileU.SkeletalAnims.Count > 0) + AddSkeletonAnims(resFileU); + if (resFileU.ShaderParamAnims.Count > 0) Nodes.Add(new FshuFolder()); - if (resFile.ColorAnims.Count > 0) + if (resFileU.ColorAnims.Count > 0) Nodes.Add(new FshuColorFolder()); - if (resFile.TexSrtAnims.Count > 0) + if (resFileU.TexSrtAnims.Count > 0) Nodes.Add(new TexSrtFolder()); - if (resFile.TexPatternAnims.Count > 0) + if (resFileU.TexPatternAnims.Count > 0) Nodes.Add(new TexPatFolder()); - if (resFile.ShapeAnims.Count > 0) + if (resFileU.ShapeAnims.Count > 0) Nodes.Add(new FshpaFolder()); - if (resFile.BoneVisibilityAnims.Count > 0) + if (resFileU.BoneVisibilityAnims.Count > 0) Nodes.Add(new FbnvFolder()); - if (resFile.SceneAnims.Count > 0) + if (resFileU.SceneAnims.Count > 0) Nodes.Add(new FscnFolder()); - if (resFile.ExternalFiles.Count > 0) + if (resFileU.ExternalFiles.Count > 0) Nodes.Add(new EmbeddedFilesFolder()); - foreach (var anim in resFile.ShaderParamAnims) + foreach (var anim in resFileU.ShaderParamAnims) Nodes["FSHA"].Nodes.Add(anim.Key); - foreach (var anim in resFile.ColorAnims) + foreach (var anim in resFileU.ColorAnims) Nodes["FSHAColor"].Nodes.Add(anim.Key); - foreach (var anim in resFile.TexSrtAnims) + foreach (var anim in resFileU.TexSrtAnims) Nodes["TEXSRT"].Nodes.Add(anim.Key); - foreach (var anim in resFile.TexPatternAnims) + foreach (var anim in resFileU.TexPatternAnims) Nodes["TEXPAT"].Nodes.Add(anim.Key); int ext = 0; - foreach (var extfile in resFile.ExternalFiles) + foreach (var extfile in resFileU.ExternalFiles) { string Name = extfile.Key; @@ -172,8 +177,10 @@ namespace Bfres.Structs ext++; } } - public void Load(ResFile resFile) + public void Load(ResFile res) { + resFile = res; + Text = resFile.Name; UpdateTree(resFile); @@ -214,9 +221,9 @@ namespace Bfres.Structs private void NewTextureFile(object sender, EventArgs args) { string Name = "textures"; - for (int i = 0; i < BFRESRender.resFile.ExternalFiles.Count; i++) + for (int i = 0; i < resFile.ExternalFiles.Count; i++) { - if (BFRESRender.resFile.ExternalFileDict.GetKey(i) == Name) + if (resFile.ExternalFileDict.GetKey(i) == Name) Name = Name + i; } if (!Nodes.ContainsKey("EXT")) @@ -225,7 +232,7 @@ namespace Bfres.Structs } BNTX bntx = new BNTX(); bntx.Data = new byte[0]; - BinaryTextureContainer bntxTreeNode = new BinaryTextureContainer(new byte[0], "textures", BFRESRender.resFile.Name); + BinaryTextureContainer bntxTreeNode = new BinaryTextureContainer(new byte[0], "textures", resFile.Name); Nodes["EXT"].Nodes.Add(bntxTreeNode); } @@ -288,7 +295,6 @@ namespace Bfres.Structs foreach (ResU.SkeletalAnim ska in resFile.SkeletalAnims.Values) { BfresSkeletonAnim skeletonAnim = new BfresSkeletonAnim(ska.Name); - skeletonAnim.BFRESRender = BFRESRender; skeletonAnim.Read(ska, resFile); fksaFolder.Nodes.Add(skeletonAnim); } @@ -300,7 +306,6 @@ namespace Bfres.Structs foreach (SkeletalAnim ska in resFile.SkeletalAnims) { BfresSkeletonAnim skeletonAnim = new BfresSkeletonAnim(ska.Name); - skeletonAnim.BFRESRender = BFRESRender; skeletonAnim.Read(ska, resFile); fksaFolder.Nodes.Add(skeletonAnim); } @@ -318,7 +323,6 @@ namespace Bfres.Structs { FSCN sceneAnim = new FSCN(); sceneAnim.Text = scn.Name; - sceneAnim.BFRESRender = BFRESRender; sceneAnim.Read(scn); fscnFolder.Nodes.Add(sceneAnim); } diff --git a/Switch_FileFormatsMain/FileFormats/BFRES/BfresSwitch.cs b/Switch_FileFormatsMain/FileFormats/BFRES/BfresSwitch.cs index aa3e27dc..011782b5 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES/BfresSwitch.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES/BfresSwitch.cs @@ -28,13 +28,11 @@ namespace FirstPlugin model.Nodes.Add(model.Skeleton.node); model.Skeleton.reset(); model.Skeleton.update(); - model.BFRESRender = renderer; model.Skeleton.node.BFRESRender = renderer; model.Model = mdl; foreach (Material mat in mdl.Materials) { FMAT FMAT = new FMAT(); - FMAT.BFRESRender = renderer; FMAT.Text = mat.Name; FMAT.ReadMaterial(mat); model.Nodes[1].Nodes.Add(FMAT); @@ -45,7 +43,6 @@ namespace FirstPlugin VertexBuffer vertexBuffer = mdl.VertexBuffers[shp.VertexBufferIndex]; Material material = mdl.Materials[shp.MaterialIndex]; FSHP mesh = new FSHP(); - mesh.BFRESRender = renderer; mesh.ModelIndex = CurMdl; ReadShapesVertices(mesh, shp, vertexBuffer, model); mesh.MaterialIndex = shp.MaterialIndex; @@ -449,9 +446,6 @@ namespace FirstPlugin curve.CurveType = AnimCurveType.StepBool; curve.Keys = new float[keyGroup.Keys.Count, 1]; } - - - return curve; } @@ -472,7 +466,6 @@ namespace FirstPlugin { BfresBone STBone = new BfresBone(RenderableSkeleton); SetBone(STBone, bone); - STBone.BFRESRender = RenderableSkeleton.node.BFRESRender; //to update viewport on bone edits RenderableSkeleton.bones.Add(STBone); } RenderableSkeleton.update(); diff --git a/Switch_FileFormatsMain/FileFormats/BFRES/BfresWiiU.cs b/Switch_FileFormatsMain/FileFormats/BFRES/BfresWiiU.cs index 7a0df1e8..9f688432 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES/BfresWiiU.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES/BfresWiiU.cs @@ -30,13 +30,11 @@ namespace FirstPlugin model.Nodes.Add(model.Skeleton.node); model.Skeleton.reset(); model.Skeleton.update(); - model.BFRESRender = renderer; model.Skeleton.node.BFRESRender = renderer; model.ModelU = mdl; foreach (Material mat in mdl.Materials.Values) { FMAT FMAT = new FMAT(); - FMAT.BFRESRender = renderer; FMAT.Text = mat.Name; FMAT.ReadMaterial(mat); model.Nodes[1].Nodes.Add(FMAT); @@ -47,7 +45,6 @@ namespace FirstPlugin VertexBuffer vertexBuffer = mdl.VertexBuffers[shp.VertexBufferIndex]; Material material = mdl.Materials[shp.MaterialIndex]; FSHP mesh = new FSHP(); - mesh.BFRESRender = renderer; mesh.ModelIndex = CurMdl; ReadShapesVertices(mesh, shp, vertexBuffer, model); mesh.MaterialIndex = shp.MaterialIndex; @@ -619,7 +616,7 @@ namespace FirstPlugin TextureRef texref = new TextureRef(); texref.Name = textu.Name; Texture texMapped = new Texture(); - m.BFRESRender.resFileU.Textures.TryGetValue(textu.Name, out texMapped); + m.GetResFileU().Textures.TryGetValue(textu.Name, out texMapped); texref.Texture = texMapped; mat.TextureRefs.Add(texref); } diff --git a/Switch_FileFormatsMain/FileFormats/Texture/FTEX.cs b/Switch_FileFormatsMain/FileFormats/Texture/FTEX.cs index cc70e147..f0620fb5 100644 --- a/Switch_FileFormatsMain/FileFormats/Texture/FTEX.cs +++ b/Switch_FileFormatsMain/FileFormats/Texture/FTEX.cs @@ -170,6 +170,7 @@ namespace FirstPlugin format = (int)tex.Format; int swizzle = (int)tex.Swizzle; int pitch = (int)tex.Pitch; + renderedTex.data = GTX.swizzleBC(tex.Data, renderedTex.width, renderedTex.height, format, (int)tex.TileMode, pitch, swizzle); } @@ -393,6 +394,7 @@ namespace FirstPlugin } set { + mipmaps.Clear(); List mips = new List(); mips.Add(value); mipmaps.Add(mips); diff --git a/Switch_FileFormatsMain/GL/BFRES_Render.cs b/Switch_FileFormatsMain/GL/BFRES_Render.cs index 2ac8e538..d396ec37 100644 --- a/Switch_FileFormatsMain/GL/BFRES_Render.cs +++ b/Switch_FileFormatsMain/GL/BFRES_Render.cs @@ -28,9 +28,6 @@ namespace FirstPlugin int vbo_position; int ibo_elements; - public ResFile resFile = null; - public ResU.ResFile resFileU = null; - public Shader shader = null; public List models = new List(); @@ -51,18 +48,16 @@ namespace FirstPlugin GL.GenBuffers(1, out vbo_position); GL.GenBuffers(1, out ibo_elements); } - public void LoadFile(ResU.ResFile r) + public void LoadFile(ResU.ResFile resFileU) { - resFileU = r; ResFileNode.Load(resFileU); BfresWiiU.Read(this, resFileU, ResFileNode); UpdateVertexData(); UpdateTextureMaps(); } - public void LoadFile(ResFile r) + public void LoadFile(ResFile resFile) { - resFile = r; ResFileNode.Load(resFile); BfresSwitch.Read(this, resFile, ResFileNode); diff --git a/Switch_FileFormatsMain/GUI/BFRES/BfresMaterialEditor.cs b/Switch_FileFormatsMain/GUI/BFRES/BfresMaterialEditor.cs index c0605263..6953d464 100644 --- a/Switch_FileFormatsMain/GUI/BFRES/BfresMaterialEditor.cs +++ b/Switch_FileFormatsMain/GUI/BFRES/BfresMaterialEditor.cs @@ -19,8 +19,6 @@ namespace FirstPlugin { public FMAT material; - public BFRESRender bfresRender; - public ImageList textureImageList; public string SelectedMatParam = ""; public ImageList il = new ImageList(); @@ -46,9 +44,8 @@ namespace FirstPlugin { } - public void LoadMaterial(FMAT mat, BFRESRender bfres) + public void LoadMaterial(FMAT mat) { - bfresRender = bfres; material = mat; textBoxMaterialName.Text = material.Text; @@ -320,7 +317,7 @@ namespace FirstPlugin { material.textures[index].Name = tex.GetSelectedTexture(); InitializeTextureListView(material); - bfresRender.UpdateSingleMaterialTextureMaps(material); + material.UpdateTextureMaps(); } } diff --git a/Switch_FileFormatsMain/GUI/BFRES/BfresShapeEditor.cs b/Switch_FileFormatsMain/GUI/BFRES/BfresShapeEditor.cs index 122f3fb8..9adfef2f 100644 --- a/Switch_FileFormatsMain/GUI/BFRES/BfresShapeEditor.cs +++ b/Switch_FileFormatsMain/GUI/BFRES/BfresShapeEditor.cs @@ -324,7 +324,7 @@ namespace FirstPlugin if (LODMeshCB.SelectedIndex != -1) { activeShape.DisplayLODIndex = LODMeshCB.SelectedIndex; - activeShape.BFRESRender.UpdateVertexData(); + activeShape.UpdateVertexData(); Viewport.Instance.UpdateViewport(); } } diff --git a/Switch_FileFormatsMain/GUI/FormLoader.cs b/Switch_FileFormatsMain/GUI/FormLoader.cs index 932a69e8..e814fb29 100644 --- a/Switch_FileFormatsMain/GUI/FormLoader.cs +++ b/Switch_FileFormatsMain/GUI/FormLoader.cs @@ -75,7 +75,7 @@ namespace FirstPlugin FMATEditor editor = new FMATEditor(); editor.Text = mat.Text; editor.Dock = DockStyle.Fill; - editor.LoadMaterial(mat, mat.BFRESRender); + editor.LoadMaterial(mat); LibraryGUI.Instance.LoadDockContent(editor, PluginRuntime.FSHPDockState); } diff --git a/Switch_Toolbox.sln b/Switch_Toolbox.sln index 87565988..65455d44 100644 --- a/Switch_Toolbox.sln +++ b/Switch_Toolbox.sln @@ -18,8 +18,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Updater", "Updater\Updater. EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTex", "Switch_Toolbox\Lib\DirectXTex\DirectXTex.vcxproj", "{755AB64B-16B4-4C90-AA3B-BFF448E5A21E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DirectXTexNet", "DirectXTexNet-master\DirectXTexNet\DirectXTexNet.csproj", "{98495BF2-DED3-4E08-B965-C12D471BC86F}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -75,14 +73,6 @@ Global {755AB64B-16B4-4C90-AA3B-BFF448E5A21E}.Release|Any CPU.Build.0 = Release|Win32 {755AB64B-16B4-4C90-AA3B-BFF448E5A21E}.Release|x64.ActiveCfg = Release|x64 {755AB64B-16B4-4C90-AA3B-BFF448E5A21E}.Release|x64.Build.0 = Release|x64 - {98495BF2-DED3-4E08-B965-C12D471BC86F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {98495BF2-DED3-4E08-B965-C12D471BC86F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {98495BF2-DED3-4E08-B965-C12D471BC86F}.Debug|x64.ActiveCfg = Debug|Any CPU - {98495BF2-DED3-4E08-B965-C12D471BC86F}.Debug|x64.Build.0 = Debug|Any CPU - {98495BF2-DED3-4E08-B965-C12D471BC86F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {98495BF2-DED3-4E08-B965-C12D471BC86F}.Release|Any CPU.Build.0 = Release|Any CPU - {98495BF2-DED3-4E08-B965-C12D471BC86F}.Release|x64.ActiveCfg = Release|Any CPU - {98495BF2-DED3-4E08-B965-C12D471BC86F}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Switch_Toolbox/Lib/Syroot.NintenTools.NSW.Bfres.dll b/Switch_Toolbox/Lib/Syroot.NintenTools.NSW.Bfres.dll index b27bd462..99a3286d 100644 Binary files a/Switch_Toolbox/Lib/Syroot.NintenTools.NSW.Bfres.dll and b/Switch_Toolbox/Lib/Syroot.NintenTools.NSW.Bfres.dll differ diff --git a/Switch_Toolbox/Lib/Syroot.NintenTools.NSW.Bfres.pdb b/Switch_Toolbox/Lib/Syroot.NintenTools.NSW.Bfres.pdb new file mode 100644 index 00000000..a8815baf Binary files /dev/null and b/Switch_Toolbox/Lib/Syroot.NintenTools.NSW.Bfres.pdb differ diff --git a/Switch_Toolbox/Lib/Syroot.NintenTools.NSW.Bfres.xml b/Switch_Toolbox/Lib/Syroot.NintenTools.NSW.Bfres.xml new file mode 100644 index 00000000..9bb139db --- /dev/null +++ b/Switch_Toolbox/Lib/Syroot.NintenTools.NSW.Bfres.xml @@ -0,0 +1,5659 @@ + + + + Syroot.NintenTools.NSW.Bfres + + + + + Represents an animation curve used by several sections to control different parameters over time. + + + + + Alignment of curve data + + + + + Gets or sets the data type in which are loaded and saved. For simplicity, the class + always stores frames as converted instances. + + + + + Gets or sets the data type in which are loaded and saved. For simplicity, the class + always stores frames as converted instances. + + + + + Gets or sets the curve type, determining the number of elements stored with each key. + + + + + Gets or sets the memory offset relative to the start of the corresponding animation data structure to + animate the field stored at that address. Note that enums exist in the specific animation which map offsets + to names. + + + + + Gets or sets the first frame at which a key is placed. + + + + + Gets or sets the last frame at which a key is placed. + + + + + Gets or sets the scale to multiply values of the curve by. + + + + + Gets or sets the offset to add to the values of the curve (after multiplicating them). + + + + + Gets or sets the difference between the lowest and highest key value. + + + + + Gets the frame numbers at which keys of the same index in the array are placed. + + + + + Gets an array of elements forming the elements of keys placed at the frames of the same index in the + array. + + + + + Represents the possible data types in which are stored. For simple library use, + they are always converted them to and from instances. + + + + + The frames are stored as instances. + + + + + The frames are stored as instances. + + + + + The frames are stored as instances. + + + + + Represents the possible data types in which are stored. For simple library use, + they are always converted them to and from instances. + + + + + The keys are stored as instances. + + + + + The keys are stored as instances. + + + + + The keys are stored as instances. + + + + + Represents the type of key values stored by this curve. This also determines the number of required elements to + define a key in the array. Use the + method to retrieve the number of elements required for the of that curve. + + + + + The curve uses cubic interpolation. 4 elements of the array form a key. + + + + + The curve uses linear interpolation. 2 elements of the array form a key. + + + + + 1 element of the array forms a key. + + + + + 1 element of the array forms a key. + + + + + 1 element of the array forms a key. + + + + + 1 element of the array forms a key. + + + + + 1 element of the array forms a key. + + + + + Gets or sets the memory offset relative to the start of the corresponding animation data structure to + animate the field stored at that address. Note that enums exist in the specific animation which map offsets + to names. + + + + + Represents a 16-bit fixed-point decimal consisting of 1 sign bit, 10 integer bits and 5 fractional bits (denoted + as Q10.5). Note that the implementation is not reporting over- and underflowing errors. + + + Examples: + SIIIIIII_IIIFFFFF + 0b00000000_00010000 = 0.5 + 0b00000000_00100000 = 1 + 0b00000001_00000000 = 8 + 0b01000000_00000000 = 512 + 0b10000000_00000000 = -1024 + + + + + Represents the largest possible value of . + + + + + Represents the smallest possible value of . + + + + + Initializes a new instance of the struct from the given + representation. + + The raw representation of the internally stored bits. + + + + Gets the internally stored value to represent the instance. + + Signed to get arithmetic rather than logical shifts. + + + + Returns the given . + + The . + The result. + + + + Adds the first to the second one. + + The first . + The second . + The addition result. + + + + Negates the given . + + The to negate. + The negated result. + + + + Subtracts the first from the second one. + + The first . + The second . + The subtraction result. + + + + Multiplicates the given by the scalar. + + The . + The scalar. + The multiplication result. + + + + Multiplicates the first by the second one. + + The first . + The second . + The multiplication result. + + + + Divides the given through the scalar. + + The . + The scalar. + The division result. + + + + Divides the first through the second one. + + The first . + The second . + The division result. + + + + Gets a value indicating whether the first specified is the same as the second + specified . + + The first to compare. + The second to compare. + true, if both are the same. + + + + Gets a value indicating whether the first specified is not the same as the second + specified . + + The first to compare. + The second to compare. + true, if both are not the same. + + + + Converts the given value to a instance. + + The value to represent in the new + instance. + + + + Converts the given value to a instance. + + The value to represent in the new + instance. + + + + Converts the given value to a instance. + + The value to represent in the new + instance. + + + + Converts the given value to a instance. + + The value to represent in the new + instance. + + + + Converts the given value to a instance. + + The value to represent in the new + instance. + + + + Converts the given value to a instance. + + The value to represent in the new + instance. + + + + Gets a value indicating whether this is the same as the second specified + . + + The object to compare, if it is a . + true, if both are the same. + + + + Gets a hash code as an indication for object equality. + + The hash code. + + + + Gets a string describing this . + + A string describing this . + + + + Indicates whether the current is equal to another . + + A to compare with this . + true if the current is equal to the other parameter; otherwise, false. + + + + + Represents a 4-byte value which can hold differently typed data. + + + + + The data as an . + + + + + The data as a . + + + + + The data as an . + + + + + Converts the given value to a instance. + + The value to represent in the new instance. + + + + + Converts the given value to a instance. + + The value to represent in the new instance. + + + + + Converts the given value to a instance. + + The value to represent in the new instance. + + + + + Converts the given value to an instance. + + The value to represent in the new instance. + + + + + Converts the given value to a instance. + + The value to represent in the new instance. + + + + + Converts the given value to an instance. + + The value to represent in the new instance. + + + + + Returns the for this instance. + + The enumerated constant that is the of the class or value type that + implements this interface. + + + + This operation is not supported. + + + + + This operation is not supported. + + + + + This operation is not supported. + + + + + This operation is not supported. + + + + + This operation is not supported. + + + + + Converts the value of this instance to an equivalent double-precision floating-point number using the + specified culture-specific formatting information. + + An interface implementation that supplies + culture-specific formatting information. + A double-precision floating-point number equivalent to the value of this instance. + + + + This operation is not supported. + + + + + Converts the value of this instance to an equivalent 32-bit signed integer using the specified + culture-specific formatting information. + + An interface implementation that supplies + culture-specific formatting information. + An 32-bit signed integer equivalent to the value of this instance. + + + + Converts the value of this instance to an equivalent 64-bit signed integer using the specified + culture-specific formatting information. + + An interface implementation that supplies + culture-specific formatting information. + An 64-bit signed integer equivalent to the value of this instance. + + + + This operation is not supported. + + + + + Converts the value of this instance to an equivalent single-precision floating-point number using the + specified culture-specific formatting information. + + An interface implementation that supplies + culture-specific formatting information. + A single-precision floating-point number equivalent to the value of this instance. + + + + This operation is not supported. + + + + + Converts the value of this instance to an of the specified that has + an equivalent value, using the specified culture-specific formatting information. + + The to which the value of this instance is converted. + + An interface implementation that supplies + culture-specific formatting information. + An instance of type conversionType whose value is equivalent to the value of + this instance. + + + + This operation is not supported. + + + + + This operation is not supported. + + + + + This operation is not supported. + + + + + Represents a 16-bit half-precision floating point value according to the IEEE 754 standard. + + + Examples: + SEEEEEFF_FFFFFFFF + 0b00000000_00000000 = 0 + 1b00000000_00000000 = -0 + 0b00111100_00000000 = 1 + 0b11000000_00000000 = -2 + 0b11111011_11111111 = 65504 (MaxValue) + 0b01111100_00000000 = PositiveInfinity + 0b11111100_00000000 = NegativeInfinity + + + + + Represents the smallest positive value greater than zero. + + + + + Represents the largest possible value of . + + + + + Represents the smallest possible value of . + + + + + Represents not a number (NaN). + + + + + Represents negative infinity. + + + + + Represents positive infinity. + + + + + Initializes a new instance of the struct from the given + representation. + + The raw representation of the internally stored bits. + + + + Gets the internally stored value to represent the instance. + + Signed to get arithmetic rather than logical shifts. + + + + Returns the given . + + The . + The result. + + + + Adds the first to the second one. + + The first . + The second . + The addition result. + + + + Negates the given . + + The to negate. + The negated result. + + + + Subtracts the first from the second one. + + The first . + The second . + The subtraction result. + + + + Multiplicates the first by the second one. + + The first . + The second . + The multiplication result. + + + + Divides the first through the second one. + + The first . + The second . + The division result. + + + + Gets a value indicating whether the first specified is the same as the second + specified . + + The first to compare. + The second to compare. + true, if both are the same. + + + + Gets a value indicating whether the first specified is not the same as the second + specified . + + The first to compare. + The second to compare. + true, if both are not the same. + + + + Converts the given value to a instance. + + The value to represent in the new + instance. + + + + Converts the given value to a instance. + + The value to represent in the new + instance. + + + + Converts the given value to a instance. + + The value to represent in the new + instance. + + + + Converts the given value to a instance. + + The value to represent in the new + instance. + + + + Converts the given value to a instance. + + The value to represent in the new + instance. + + + + Converts the given value to a instance. + + The value to represent in the new + instance. + + + + Gets a value indicating whether this is the same as the second specified + . + + The object to compare, if it is a . + true, if both are the same. + + + + Gets a hash code as an indication for object equality. + + The hash code. + + + + Gets a string describing this . + + A string describing this . + + + + Indicates whether the current is equal to another . + + A to compare with this . + true if the current is equal to the other parameter; otherwise, false. + + + + + Returns a value indicating whether the specified number evaluates to not a number (). + + A half-precision floating-point number. + true if value evaluates to not a number (); otherwise false. + + + + Returns a value indicating whether the specified number evaluates to negative or positive infinity. + + A half-precision floating-point number. + true if half evaluates to or ; + otherwise false. + + + + Returns a value indicating whether the specified number evaluates to negative infinity. + + A half-precision floating-point number. + true if half evaluates to ; otherwise false. + + + + Returns a value indicating whether the specified number evaluates to positive infinity. + + A half-precision floating-point number. + true if half evaluates to ; otherwise false. + + + + Represents an buffer info section in a subfile. References vertex and index buffers + + + + + Gets or sets the buffer instance that stores face data first, then vertex buffer after. + + + + + Gets or sets the buffer instance that stores face data + + + + + Gets or sets the buffer instance that stores vertex data + + + + + Gets or sets an unkown value + + + + + Represents a buffer info section + + + + + the buffer size + + + + + Flag + + + + + Represents a buffer info section + + + + + Load and display information of RLT + + + + + Represents the non-generic base of a dictionary which can quickly look up instances via + key or index. + + + + + Initializes a new instance of the class. + + + + + Gets the number of instances stored. + + + + + Adds the given to insert in the dictionary. + + Duplicated instances + already exists. + + + + Removes the given from the dictionary. + + Duplicated instances + already exists. + + + + Determines whether the given is in the dictionary. + + true if was found in the dictionary; otherwise false. + + + + + Returns the key given is within range of the dictionary. + + + + + Removes all elements from the dictionary. + + + + + Returns only the publically visible nodes, excluding the root node. + + + + + Represents a node forming the Patricia trie of the dictionary. + + + + + Represents a which is stored in a . + + + + + The textual represented by this instance. + + + + + The with which this string was read or will be written. + + + + + Converts the given value to a instance. + + The value to represent in the new instance. + + + + + Converts the given value to an instance. + + The value to represent in the new instance. + + + + + Returns the value of the property. + + The value of the property. + + + + Represents a 2D transformation. + + + + + The size of this structure. + + + + + The scaling amount of the transformation. + + + + + The rotation angle of the transformation. + + + + + The translation amount of the transformation. + + + + + Represents a 3D transformation. + + + + + The size of this structure. + + + + + The scaling amount of the transformation. + + + + + The rotation amount of the transformation. + + + + + The translation amount of the transformation. + + + + + Represents a 2D texture transformation. + + + + + The size of this structure. + + + + + The with which the transformation is applied. + + + + + The scaling amount of the transformation. + + + + + The rotation angle of the transformation. + + + + + The translation amount of the transformation. + + + + + Represents a 2D texture transformation which is multiplied by a 3x4 matrix referenced at runtime by the + . + + + + + The size of this structure. + + + + + The with which the transformation is applied. + + + + + The scaling amount of the transformation. + + + + + The rotation angle of the transformation. + + + + + The translation amount of the transformation. + + + + + A pointer to a 3x4 matrix to multiply the transformation with. Set at runtime. + + + + + Represents the texture transformation mode used in and . + + + + + Represents custom user variables which can be attached to many sections and subfiles of a . + + + + + Gets or sets the name with which the instance can be referenced uniquely in + instances. + + + + + The data type of the stored values. + + + + + Returns the stored value as an array of instances when the is + . + + The typed value. + + + + Returns the stored value as an array of instances when the is + . + + The typed value. + + + + Returns the stored value as an array of instances when the is + or . + + The typed value. + + + + Returns the stored value as an array of instances when the is + . + + The typed value. + + + + Sets the stored as an array and the to + + + The value to store. + + + + Sets the stored as a array and the to + + + The value to store. + + + + Sets the stored as a array and the to + or depending on + . + + true to store data as UTF-16 encoded strings, or false to store it + as ASCII encoded strings. + The value to store. + + + + Sets the stored as a array and the to + + + The value to store. + + + + Represents the possible data types of values stored in instances. + + + + + The values is an array. + + + + + The values is a array. + + + + + The values is a array encoded in ASCII. + + + + + The values is a array. + + + + + The values is a array encoded in UTF-16. + + + + + Represents custom user variables which can be attached to many sections and subfiles of a . + + + + + Gets or sets the name with which the instance can be referenced uniquely in + instances. + + + + + The data type of the stored values. + + + + + Represents extension methods for the class. + + + + + Reads a instance from the current stream and returns it. + + The extended . + The instance. + + + + Reads a instance from the current stream and returns it. + + The extended . + The number of instances to read. + The instance. + + + + Reads a instance from the current stream and returns it. + + The extended . + The instance. + + + + Reads instances from the current stream and returns them. + + The extended . + The number of instances to read. + The instances. + + + + Reads a instance from the current stream and returns it. + + The extended . + The instance. + + + + Reads instances from the current stream and returns them. + + The extended . + The number of instances to read. + The instances. + + + + Reads a instance from the current stream and returns it. + + The extended . + The instance. + + + + Reads instances from the current stream and returns them. + + The extended . + The number of instances to read. + The instances. + + + + Reads a instance from the current stream and returns it. + + The extended . + The instance. + + + + Reads instances from the current stream and returns them. + + The extended . + The number of instances to read. + The instances. + + + + Reads a instance from the current stream and returns it. + + The extended . + The instance. + + + + Reads instances from the current stream and returns them. + + The extended . + The number of instances to read. + The instances. + + + + Reads a instance from the current stream and returns it. + + The extended . + The in which values are stored. + The instance. + + + + Reads instances from the current stream and returns them. + + The extended . + The number of instances to read. + The in which values are stored. + The instances. + + + + Reads a instance from the current stream and returns it. + + The extended . + The instance. + + + + Reads instances from the current stream and returns them. + + The extended . + The number of instances to read. + The instances. + + + + Reads a instance from the current stream and returns it. + + The extended . + The instance. + + + + Reads instances from the current stream and returns them. + + The extended . + The number of instances to read. + The instances. + + + + Reads a instance from the current stream and returns it. + + The extended . + The instance. + + + + Reads instances from the current stream and returns them. + + The extended . + The number of instances to read. + The instances. + + + + Reads a instance from the current stream and returns it. + + The extended . + The in which values are stored. + The instance. + + + + Reads instances from the current stream and returns them. + + The extended . + The number of instances to read. + The in which values are stored. + The instances. + + + + Reads a instance from the current stream and returns it. + + The extended . + The instance. + + + + Reads instances from the current stream and returns them. + + The extended . + The number of instances to read. + The instances. + + + + Reads a instance from the current stream and returns it. + + The extended . + The instance. + + + + Reads instances from the current stream and returns them. + + The extended . + The number of instances to read. + The instances. + + + + Reads a instance from the current stream and returns it. + + The extended . + The instance. + + + + Reads instances from the current stream and returns them. + + The extended . + The number of instances to read. + The instances. + + + + Reads a instance from the current stream and returns it. + + The extended . + The in which values are stored. + The instance. + + + + Reads instances from the current stream and returns them. + + The extended . + The number of instances to read. + The in which values are stored. + The instances. + + + + Reads a instance from the current stream and returns it. + + The extended . + The instance. + + + + Reads instances from the current stream and returns them. + + The extended . + The number of instances to read. + The instances. + + + + Reads a instance from the current stream and returns it. + + The extended . + The instance. + + + + Reads instances from the current stream and returns them. + + The extended . + The number of instances to read. + The instances. + + + + Returns the conversion delegate for converting data available in the given + into a instance. Useful to prevent repetitive lookup for multiple values. + + The extended . + The of the data. + A conversion delegate for the data. + + + + Reads a instance converted from the given and + returns it. + + The extended . + The of the data. + The instance. + + + + Reads a instances converted from the given and + returns them. + + The extended . + The number of instances to read. + The of the data. + The instances. + + + + Represents extension methods for the class. + + + + + Writes a instance into the current stream. + + The extended . + The instance. + + + + Writes instances into the current stream. + + The extended . + The instances. + + + + Writes a instance into the current stream. + + The extended . + The instance. + + + + Writes instances into the current stream. + + The extended . + The instances. + + + + Writes a instance into the current stream. + + The extended . + The instance. + + + + Writes instances into the current stream. + + The extended . + The instances. + + + + Writes a instance into the current stream. + + The extended . + The instance. + + + + Writes instances into the current stream. + + The extended . + The instances. + + + + Writes a instance into the current stream. + + The extended . + The instance. + + + + Writes instances into the current stream. + + The extended . + The instances. + + + + Writes a instance into the current stream. + + The extended . + The instance. + The in which values are stored. + + + + Writes instances into the current stream. + + The extended . + The instances. + The in which values are stored. + + + + Writes a instance into the current stream. + + The extended . + The instance. + + + + Writes instances into the current stream. + + The extended . + The instances. + + + + Writes a instance into the current stream. + + The extended . + The instance. + + + + Writes instances into the current stream. + + The extended . + The instances. + + + + Writes a instance into the current stream. + + The extended . + The instance. + + + + Writes instances into the current stream. + + The extended . + The instances. + + + + Writes a instance into the current stream. + + The extended . + The instance. + The in which values are stored. + + + + Writes instances into the current stream. + + The extended . + The instances. + The in which values are stored. + + + + Writes a instance into the current stream. + + The extended . + The instance. + + + + Writes instances into the current stream. + + The extended . + The instances. + + + + Writes a instance into the current stream. + + The extended . + The instance. + + + + Writes instances into the current stream. + + The extended . + The instances. + + + + Writes a instance into the current stream. + + The extended . + The instance. + + + + Writes instances into the current stream. + + The extended . + The instances. + + + + Writes a instance into the current stream. + + The extended . + The instance. + The in which values are stored. + + + + Writes instances into the current stream. + + The extended . + The instances. + The in which values are stored. + + + + Writes a instance into the current stream. + + The extended . + The instance. + + + + Writes instances into the current stream. + + The extended . + The instances. + + + + Writes a instance into the current stream. + + The extended . + The instance. + + + + Writes instances into the current stream. + + The extended . + The instances. + + + + Returns the conversion delegate for converting data available in the given + from a instance. Useful to prevent repetitive lookup for multiple values. + + The extended . + The of the data. + A conversion delegate for the data. + + + + Returns the conversion delegate for converting data available in the given + from a instance. Useful to prevent repetitive lookup for multiple values. + + The extended . + The of the data. + A conversion delegate for the data. + + + + Writes a instance into the current stream with the given + . + + The extended . + The instance. + The of the data. + + + + Writes instances into the current stream with the given + . + + The extended . + The instances. + The of the data. + + + + Represents extension methods for instances. + + + + + Returns an instance represented by the given number of , starting + at the . + + The extended instance. + The first bit of the encoded value. + The number of least significant bits which are used to store the + value. + The decoded . + + + + Returns the current with the bit at the set (being 1). + + The extended instance. + The 0-based index of the bit to enable. + The current with the bit enabled. + + + + Returns the current with the given set into the given number + of starting at . + + The extended instance. + The value to encode. + The first bit used for the encoded value. + The number of bits which are used to store the value. + The current with the value encoded into it. + + + + Returns the current with the bit at the cleared (being 0). + + The extended instance. + The 0-based index of the bit to disable. + The current with the bit disabled. + + + + Returns a value indicating whether the bit at the in the current + is enabled or disabled. + + The extended instance. + The 0-based index of the bit to check. + true when the bit is set; otherwise false. + + + + Returns the current with all bits rotated in the given , + where positive directions rotate left and negative directions rotate right. + + The extended instance. + The direction in which to rotate, where positive directions rotate left. + The current with the bits rotated. + + + + Returns the current with the bit at the enabled or disabled, + according to . + + The extended instance. + The 0-based index of the bit to enable or disable. + true to enable the bit; otherwise false. + The current with the bit enabled or disabled. + + + + Returns the current with the bit at the enabled when it is + disabled or disabled when it is enabled. + + The extended instance. + The 0-based index of the bit to toggle. + The current with the bit toggled. + + + + Represents extension methods for instances. + + + + + Returns an instance represented by the given number of , starting + at the . + + The extended instance. + The first bit of the encoded value. + The number of least significant bits which are used to store the + value. + The decoded . + + + + Returns the current with the bit at the set (being 1). + + The extended instance. + The 0-based index of the bit to enable. + The current with the bit enabled. + + + + Returns the current with the given set into the given number + of starting at . + + The extended instance. + The value to encode. + The first bit used for the encoded value. + The number of bits which are used to store the value. + The current with the value encoded into it. + + + + Returns the current with the bit at the cleared (being 0). + + The extended instance. + The 0-based index of the bit to disable. + The current with the bit disabled. + + + + Returns a value indicating whether the bit at the in the current + is enabled or disabled. + + The extended instance. + The 0-based index of the bit to check. + true when the bit is set; otherwise false. + + + + Returns the current with all bits rotated in the given , + where positive directions rotate left and negative directions rotate right. + + The extended instance. + The direction in which to rotate, where positive directions rotate left. + The current with the bits rotated. + + + + Returns the current with the bit at the enabled or disabled, + according to . + + The extended instance. + The 0-based index of the bit to enable or disable. + true to enable the bit; otherwise false. + The current with the bit enabled or disabled. + + + + Returns the current with the bit at the enabled when it is + disabled or disabled when it is enabled. + + The extended instance. + The 0-based index of the bit to toggle. + The current with the bit toggled. + + + + Represents the common interface for data instances. + + + + + Loads raw data from the data stream into instances. + + The to load data with. + + + + Saves header data of the instance and queues referenced data in the given . + + The to save headers and queue data with. + + + + Loads the hierachy and data of a . + + + + + Initializes a new instance of the class loading data into the given + from the specified which is optionally left open. + + The instance to load data into. + The to read data from. + true to leave the stream open after reading, otherwise false. + + + + Initializes a new instance of the class from the file with the given + . + + The instance to load data into. + The name of the file to load the data from. + + + + Gets the loaded instance. + + + + + Gets the loaded instance. + + + + + Gets the saved instance. + + + + + Gets the saved instance. + + + + + Gets the saved instance. + + + + + Gets the saved instance. + + + + + Gets the saved instance. + + + + + Gets the loaded instance. + + + + + Gets the saved instance. + + + + + Gets the saved instance. + + + + + Gets the loaded instance. + + + + + Starts deserializing the data from the root. + + + + + Reads and returns an instance of type from the following + offset or returns null if the read offset is 0. + + The type of the to read. + The instance or null. + + + + Reads and returns an instance of arbitrary type from the following offset with the + given or returns null if the read offset is 0. + + The type of the data to read. + The callback to read the instance data with. + The optional offset to use instead of reading a following one. + The data instance or null. + Offset required for ExtFile header (offset specified before size). + + + + Reads and returns an instance with elements of type from + the following offset or returns an empty instance if the read offset is 0. + + The type of the elements. + The instance. + + + + Reads and returns an instance with elements of type + from the following offset or returns null if the read offset is 0. + + The type of the elements. + The number of elements to expect for the list. + The optional offset to use instead of reading a following one. + The instance or null. + Offset required for FMDL FVTX lists (offset specified before count). + + + + Reads and returns a instance from the following offset or null if the read + offset is 0. + + The optional encoding of the text. + The read text. + + + + Reads and returns instances from the following offsets. + + The number of instances to read. + The optional encoding of the texts. + The read texts. + + + + Reads a BFRES signature consisting of 4 ASCII characters encoded as an and checks for + validity. + + A valid signature. + + + + Reads a BFRES offset which is the absolute address. + + The absolute address of the offset. + + + + Reads BFRES offsets which is the absolute addresses. + + The number of offsets to read. + The absolute addresses of the offsets. + + + + Saves the hierachy and data of a . + + + + + Gets or sets a data block alignment typically seen with . + + + + + Initializes a new instance of the class saving data from the given + into the specified which is optionally left open. + + The instance to save data from. + The to save data into. + true to leave the stream open after writing, otherwise false. + + + + Initializes a new instance of the class for the file with the given + . + + The instance to save. + The name of the file to save the data into. + + + + Initializes a new instance of the class for the file with the given + . + + The instance to save. + The name of the file to save the data into. + + + + Initializes a new instance of the class for the file with the given + . + + The instance to save. + The name of the file to save the data into. + + + + Initializes a new instance of the class for the file with the given + . + + The instance to save. + The name of the file to save the data into. + + + + Initializes a new instance of the class for the file with the given + . + + The instance to save. + The name of the file to save the data into. + + + + Initializes a new instance of the class for the file with the given + . + + The instance to save. + The name of the file to save the data into. + + + + Initializes a new instance of the class for the file with the given + . + + The instance to save. + The name of the file to save the data into. + + + + Initializes a new instance of the class for the file with the given + . + + The instance to save. + The name of the file to save the data into. + + + + Initializes a new instance of the class for the file with the given + . + + The instance to save. + The name of the file to save the data into. + + + + Initializes a new instance of the class for the file with the given + . + + The instance to save. + The name of the file to save the data into. + + + + Initializes a new instance of the class for the file with the given + . + + The instance to save. + The name of the file to save the data into. + + + + Gets the saved instance. + + + + + Gets the saved instance. + + + + + Gets the saved instance. + + + + + Gets the saved instance. + + + + + Gets the saved instance. + + + + + Gets the saved instance. + + + + + Gets the saved instance. + + + + + Gets the saved instance. + + + + + Gets the saved instance. + + + + + Gets the saved instance. + + + + + Gets the saved instance. + + + + + Gets the current index when writing lists or dicts. + + + + + Starts serializing the data from the root. + + + + + Gets the block size of all external files + + + + + Reserves space for an offset to the written later. + + The to save. + The index of the element, used for instances referenced by a . + The position the offset is saved to. + + + + + Reserves space for the file size field which is automatically filled later. + + + + + Save pointer array to be relocated in section 1 + + + + + Reserves space for the string pool size and offset fields which are automatically + filled later. + + + + + Reserves space for the memory pool field which is automatically filled later. + + + + + Reserves space for the memory pool field which is automatically filled later. + + + + + Saves the Index buffer pointer to be used later in the relocation table + + + + + Saves the Vertex buffer pointer to be used later in the relocation table + + + + + Reserves space for the memory pool field which is automatically filled later. + + + + + Reserves space for an offset to the written later. + + The type of the elements. + The to save. + + + + Reserves space for an offset to the written later. + + The type of the element values. + The to save. + + + + Reserves space for an offset to the written later with the + . + + The data to save. + The to invoke to write the data. + + + + Reserves space for an offset to the written later in the string pool with the + specified . + + The name to save. + The in which the name will be stored. + + + + Reserves space for offsets to the written later in the string pool with the + specified + + The names to save. + The in which the names will be stored. + + + + Reserves space for an offset and size for header block. + + + + + Reserves space for an offset to the written later in the data block pool. + + The data to save. + The alignment to seek to before invoking the callback. + The to invoke to write the data. + + + + Writes a BFRES signature consisting of 4 ASCII characters encoded as an . + + A valid signature. + + + + Represents a sorting empty strings to the end of lists. + + + + + Represents a file attachment to a which can be of arbitrary data. + + + + + Gets or sets the raw data stored by the external file. + + + + + Opens and returns a on the raw byte array, which optionally + can be written to. + + true to allow write access to the raw data. + The opened instance. + + + + Represents settings controlling additional alpha blending options. + + + + + Gets or sets a value indicating whether alpha testing is enabled at all. + + + + + Gets or sets the comparison functions to use for alpha testing. + + + + + Represents settings controlling color and alpha blending. + + + + + Gets or sets the color source blend operation. + + + + + Gets or sets the color combine operation. + + + + + Gets or sets the color destination blend operation. + + + + + Gets or sets the alpha source blend operation. + + + + + Gets or sets the alpha combine operation. + + + + + Gets or sets the alpha destination blend operation. + + + + + Gets or sets a value indicating whether alpha blending is separated from color blending. + + + + + Represents settings controlling additional color blending options. + + + + + Gets or sets a value indicating whether multi writes are enabled. + + + + + Gets or sets a value indicating whether the color buffer is enabled. + + + + + Gets or sets the bitmask used for blending. + + + + + Gets or sets the ROP3 logic operation. + + + + + Represents settings controlling how depth and stencil buffer checks are performed and handled. + + + + + Gets or sets a value indicating whether depth testing is enabled. + + + + + Gets or sets a value indicating whether writing to the depth buffer is enabled. + + + + + Gets or sets the depth buffer comparison function, controlling whether a new fragment is allowed to + overwrite the old value in the depth buffer. + + + + + Gets or sets a value indicating whether stencil testing is enabled. + + + + + Gets or sets a value indicating whether back-facing polygons are allowed to write to the stencil buffer or + not. + + + + + Gets or sets the front-facing polygon stencil comparison function. + + + + + Gets or sets the stencil function configuring what to do with the existing stencil value when the stencil + test fails for front-facing polygons. + + + + + Gets or sets the stencil function taking effect when the stencil test passes with the depth buffer for + front-facing polygons. + + + + + Gets or sets the function taking effect when the stencil test fails with the depth buffer for front-facing + polygons. + + + + + Gets or sets the back-facing polygon stencil comparison function. + + + + + Gets or sets the stencil function configuring what to do with the existing stencil value when the stencil + test fails for back-facing polygons. + + + + + Gets or sets the stencil function taking effect when the stencil test passes with the depth buffer for + back-facing polygons. + + + + + Gets or sets the function taking effect when the stencil test fails with the depth buffer for back-facing + polygons. + + + + + Represents the AA modes (number of samples) for a surface. + + + + + Represents the format of a vertex attribute entry. Possible type conversions: + UNorm: attrib unsigned integer is converted to/from [0.0, 1.0] in shader. + UInt: attrib unsigned integer is copied to/from shader as unsigned int. + SNorm: attrib signed integer is converted to/from [-1.0, 1.0] in shader. + SInt: attrib signed integer is copied to/from shader as signed int. + Single: attrib single is copied to/from shader as Single. + UIntToSingle: attrib unsigned integer is converted Single in shader. + SIntToSingle: attrib signed integer is converted Single in shader. + + + + + Represents how the terms of the blend function are combined. + + + + + Represents the factors used in the blend function. + + + + + Represents compare functions used for depth and stencil tests. + + + + + Represents the source channels to map to a color channel in textures. + + + + + Represents the vertex order of front-facing polygons. + + + + + Represents the type in which vertex indices are stored. + + + + + Represents the logic op function to perform. + + + + + Black + + + + + White + + + + + Source (Default) + + + + + ~Source + + + + + Destination + + + + + ~Destination + + + + + Source & Destination + + + + + ~(Source & Destination) + + + + + Source | Destination + + + + + ~(Source | Destination) + + + + + Source ^ Destination + + + + + ~(Source ^ Destination) + + + + + Source & ~Destination + + + + + ~Source & Destination + + + + + Source | ~Destination + + + + + ~Source | Destination + + + + + Represents the base primitive used to draw each side of the polygon when dual-sided polygon mode is enabled. + + + + + Represents the type of primitives to draw. + + + + + Requires at least 1 element and 1 more to draw another primitive. + + + + + Requires at least 2 elements and 2 more to draw another primitive. + + + + + Requires at least 2 elements and 1 more to draw another primitive. + + + + + Requires at least 3 elements and 3 more to draw another primitive. + + + + + Requires at least 2 elements and 1 more to draw another primitive. + + + + + Requires at least 3 elements and 1 more to draw another primitive. + + + + + Requires at least 3 elements and 1 more to draw another primitive. + + + + + Requires at least 4 elements and 4 more to draw another primitive. + + + + + Requires at least 4 elements and 2 more to draw another primitive. + + + + + Requires at least 4 elements and 4 more to draw another primitive. + + + + + Requires at least 4 elements and 4 more to draw another primitive. + + + + + Requires at least 4 elements and 1 more to draw another primitive. + + + + + Requires at least 6 elements and 6 more to draw another primitive. + + + + + Requires at least 6 elements and 2 more to draw another primitive. + + + + + + + + + Represents the stencil function to be performed if stencil tests pass. + + + + + Represents shapes of a given surface or texture. + + + + + Represents desired texture, color-buffer, depth-buffer, or scan-buffer formats. + + + + + Represents Indicates how a given surface may be used. A final TV render target is one that will be copied to a + TV scan buffer. It needs to be designated to handle certain display corner cases (when a HD surface must be + scaled down to display in NTSC/PAL). + + + + + Represents maximum desired anisotropic filter ratios. Higher ratios give better image quality, but slower + performance. + + + + + Represents type of border color to use. + + + + + Represents how to treat texture coordinates outside of the normalized coordinate texture range. + + + + + Represents desired texture filter options between mip levels. + + + + + Represents desired texture filter options within a plane. + + + + + Represents desired texture filter options between Z planes. + + + + + Represents the desired tiling modes for a surface. + + + + + Represents polygon drawing settings controlling if and how triangles are rendered. + + + + + Gets or sets a value indicating whether front-facing polygons are culled. + + + + + Gets or sets a value indicating whether back-facing polygons are culled. + + + + + Gets or sets the order in which vertices have to form the triangle to be handled as a front- rather than + back-face. + + + + + Gets or sets a value indicating whether polygons are drawn at all. + + + + + Gets or sets how front facing polygons are drawn. + + + + + Gets or sets how back facing polygons are drawn. + + + + + Gets or sets whether front-facing polygons are drawn offset (useful for decals to combat Z fighting). + + + + + Gets or sets whether back-facing polygons are drawn offset (useful for decals to combat Z fighting). + + + + + Gets or sets whether lines are drawn offset (useful for decals to combat Z fighting). + + + + + Represents a texture sampler controlling how a texture is samples and drawn onto a surface. + + + + + Initializes a new instance of the instance. + + + + + Gets or sets the texture repetition mode on the X axis. + + + + + Gets or sets the texture repetition mode on the Y axis. + + + + + Gets or sets the texture repetition mode on the Z axis. + + + + + Gets or sets the texture filtering on the X and Y axes when the texture is drawn larger than the actual + texture's resolution. + + + + + Gets or sets the texture filtering on the X and Y axes when the texture is drawn smaller than the actual + texture's resolution. + + + + + Gets or sets the texture filtering on the Z axis. + + + + + Gets or sets the texture filtering for mipmaps. + + + + + Gets or sets the maximum anisotropic filtering level to use. + + + + + Gets or sets what color to draw at places not reached by a texture if the clamp mode does not repeat it. + + + + + Gets or sets the depth comparison function. + + + + + Gets or sets the minimum LoD level. + + + + + Gets or sets the maximum LoD level. + + + + + Gets or sets the LoD bias. + + + + + Gets or sets a value indicating whether depth comparison is enabled (never set for a real console). + + + + + Represents a helper class for working with instances. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with data read from the given + . The data is available in the , which defaults + to system byte order. + + The to initially read data from. + The in which vertex data is available. null to use + system byte order. + + + + Gets or sets the in which vertex data will be stored when calling + . This should be the same as the remainder of the in + which it will be stored. + + + + + Gets or sets the number of bones influencing the vertices stored in the buffer. 0 influences equal + rigidbodies (no skinning), 1 equal rigid skinning and 2 or more smooth skinning. + + + + + Gets or sets the list of instances which store the data. + + + + + Gets or sets the instance at the given . + + The index of the instance. + The instance at the given index. + + + + Gets or sets the first instance with the given + . + + The name of the instance. + The instance with the given name. + + + + Returns a instance out of the stored helper data. + + A new . + + + + Represents an attribute and the data it stores in a instance. + + + + + The name of the attribute, typically used to determine the use of the data. + + + + + The into which data will be converted upon creating a + . + + + + + The data stored for this attribute. Has to be of the same length as every other + . Depending on , not every component of the + elements is used. + + + + + Represents an FMAA section in a subfile, storing material animation data. + + + + + Initializes a new instance of the class from the given which + is optionally left open. + + The to load the data from. + true to leave the stream open after reading, otherwise false. + + + + Initializes a new instance of the class from the file with the given + . + + The name of the file to load the data from. + + + + Saves the contents in the given and optionally leaves it open + + The to save the contents into. + true to leave the stream open after writing, otherwise false. + + + + Saves the contents in the file with the given . + + The name of the file to save the contents into. + + + + Gets or sets the name with which the instance can be referenced uniquely in + instances. + + + + + Gets or sets the path of the file which originally supplied the data of this instance. + + + + + Gets or sets the total number of frames this animation plays. + + + + + Gets or sets the number of bytes required to bake all . + + + + + Gets or sets the instance affected by this animation. + + + + + Gets the indices of the instances in the dictionary to + bind for each animation. specifies no binding. + + + + + Gets or sets customly attached instances. + + + + + Represents a material animation in a subfile, storing material animation data. + + + + + Gets or sets the list of instances. + + + + + Gets or sets the list of instances. + + + + + Gets or sets the list of instances. + + + + + Gets or sets instances animating properties of objects stored in this section. + + + + + Gets or sets the name with which the instance can be referenced uniquely in + instances. + + + + + Represents a material animation in a subfile, storing material animation data. + + + + + Gets or sets the index of the first instance in the parent + . + + + + + Gets or sets the index of the first instance in the parent + . + + + + + Gets or sets the number of instances used in the parent + . + + + + + Gets or sets the index of the in the . + + + + + Gets or sets the name with which the instance can be referenced uniquely in + instances. + + + + + Represents a material animation in a subfile, storing material animation data. + + + + + Gets or sets the index of the curve in the . + + + + + Gets or sets the index of the first instance in the parent + . + + + + + Gets or sets the index of the in the . + + + + + Gets or sets the name with which the instance can be referenced uniquely in + instances. + + + + + Represents an FMAT subsection of a subfile, storing information on with which textures and + how technically a surface is drawn. + + + + + Initializes a new instance of the class from the given which + is optionally left open. + + The to load the data from. + true to leave the stream open after reading, otherwise false. + + + + Initializes a new instance of the class from the file with the given + . + + The name of the file to load the data from. + + + + Saves the contents in the given and optionally leaves it open + + The to save the contents into. + true to leave the stream open after writing, otherwise false. + + + + Saves the contents in the file with the given . + + The name of the file to save the contents into. + + + + Gets or sets the name with which the instance can be referenced uniquely in + instances. + + + + + Gets or sets flags specifying how a is rendered. + + + + + Gets or sets the list of instances referencing the instances + required to draw the material. + + + + + Gets or sets a dictionary of instances which configure how to draw + instances referenced by the list. + + + + + Gets or sets the raw data block which stores values. + + + + + Gets or sets customly attached instances. + + + + + Gets or sets a set of bits determining whether instances are volatile. + + + + + Represents general flags specifying how a is rendered. + + + + + The material is not rendered at all. + + + + + The material is rendered. + + + + + Represents a render info in a FMAT section storing uniform parameters required to render the + . + + + + + Gets the determining the data type of the stored value. + + + + + Gets or sets the name with which the instance can be referenced uniquely in + instances. + + + + + Gets the stored value as an array. Only valid if is + . + + The stored value as an array. + + + + Gets the stored value as a array. Only valid if is + . + + The stored value as a array. + + + + Gets the stored value as a array. Only valid if is + . + + The stored value as a array. + + + + Sets the stored value as an array and sets to + . + + The array to set as the value. + + + + Sets the stored value as a array and sets to + . + + The array to set as the value. + + + + Sets the stored value as a array and sets to + . + + The array to set as the value. + + + + Represents the data type of elements of the value array. + + + + + The elements are instances. + + + + + The elements are instances. + + + + + The elements are instances. + + + + + Represents a sampler in a section, storing configuration on how to + draw and interpolate textures. + + + + + Gets or sets the name with which the instance can be referenced uniquely in + instances. + + + + + Gets or sets the UV wrap mode in the U direction + + + + + Gets or sets the UV wrap mode in the V direction + + + + + Gets or sets the UV wrap mode in the W direction + + + + + Gets or sets the compare function + + + + + Gets or sets the border color + + + + + Gets or sets the max anisotropic filtering value + + + + + Gets or sets the anisotropic filtering mode + + + + + Represents a parameter value in a section, passing data to shader variables. + + + + + Gets or sets the type of the value. + + + + + Gets the offset in the byte array in bytes. + + + + + Gets or sets the name with which the instance can be referenced uniquely in + instances. + + + + + Gets the size of the value in bytes. + + + + + Represents the data types in which instances can store their value. + + + + + The value is a single . + + + + + The value is a . + + + + + The value is a . + + + + + The value is a . + + + + + The value is a single . + + + + + The value is a . + + + + + The value is a . + + + + + The value is a . + + + + + The value is a single . + + + + + The value is a . + + + + + The value is a . + + + + + The value is a . + + + + + The value is a single . + + + + + The value is a . + + + + + The value is a . + + + + + The value is a . + + + + + An invalid type for values, only used for internal computations. + + + + + The value is a . + + + + + The value is a . + + + + + The value is a . + + + + + An invalid type for values, only used for internal computations. + + + + + The value is a . + + + + + The value is a . + + + + + The value is a . + + + + + An invalid type for values, only used for internal computations. + + + + + The value is a . + + + + + The value is a . + + + + + The value is a . + + + + + The value is a . + + + + + The value is a . + + + + + The value is a . + + + + + The value is a . + + + + + Represents an FMDL subfile in a , storing model vertex data, skeletons and used materials. + + + + + Initializes a new instance of the class from the given which + is optionally left open. + + The to load the data from. + true to leave the stream open after reading, otherwise false. + + + + Initializes a new instance of the class from the file with the given + . + + The name of the file to load the data from. + + + + Saves the contents in the given and optionally leaves it open + + The to save the contents into. + true to leave the stream open after writing, otherwise false. + + + + Saves the contents in the file with the given . + + The name of the file to save the contents into. + + + + Gets or sets the name with which the instance can be referenced uniquely in + instances. + + + + + Gets or sets the path of the file which originally supplied the data of this instance. + + + + + Gets the instance to deform the model with animations. + + + + + Gets or sets the instances storing the vertex data used by the + . + + + + + Gets or sets the instances forming the surface of the model. + + + + + Gets or sets the instances forming the surface of the model. + + + + + Gets or sets the names. + + + + + Gets or sets the instance applied on the to color their surface. + + + + + Gets or sets customly attached names. + + + + + Gets or sets customly attached instances. + + + + + Gets the total number of vertices to process when drawing this model. + + This excludes vertices which are not processed by any shader. However, the exact value does not + seem to matter, so the total count of all vertices is taken to keep things trivial for now. + + + + Represents a spatial bounding box. + + + + + The center point of the bounding box. + + + + + The extent from the center point to the furthest point. + + + + + Represents a node in a bounding tree to determine when to show which sub mesh of a + . + + + + + Represents the surface net of a section, storing information on which + index to use for referencing vertices of the shape, mostly used for different levels of + detail (LoD) models. + + + + + Gets or sets the instance storing buffer data at runtime + + + + + Gets or sets the instance storing buffer size + + + + + Gets or sets the which determines how indices are used to form polygons. + + + + + Gets the determining the data type of the indices in the + . + + + + + Gets the number of indices stored in the . + + + + + Gets or sets the list of instances which split up a mesh into parts which can be + hidden if they are not visible to optimize rendering performance. + + + + + Gets or sets the offset to the first vertex element of a to reference by indices. + + + + + Returns the indices stored in the as instances. + + The indices stored in the . + + + + Stores the given in the in the provided + , or the current if none was specified. + + The indices to store in the . + The to use or null to use the current format. + + + + + Represents a sphere boundry in a to determine when to show which sub mesh of a + . + + + + + Represents an FSHP section in a subfile. + + + + + Initializes a new instance of the class from the given which + is optionally left open. + + The to load the data from. + true to leave the stream open after reading, otherwise false. + + + + Initializes a new instance of the class from the file with the given + . + + The name of the file to load the data from. + + + + Saves the contents in the given and optionally leaves it open + + The to save the contents into. + true to leave the stream open after writing, otherwise false. + + + + Saves the contents in the file with the given . + + The name of the file to save the contents into. + + + + Gets or sets the name with which the instance can be referenced uniquely in + instances. + + + + + Gets or sets flags determining which data is available for this instance. + + + + + Gets or sets the index of the material to apply to the shapes surface in the owning + list. + + + + + Gets or sets the index of the to which this instance is directly attached to. The bone + must be part of the skeleton referenced by the owning instance. + + + + + Gets or sets the index of the in the owning + list. + + + + + Gets or sets the bounding radius/radii spanning the shape for each LOD mesh + + + + + Gets or sets the number of bones influencing the vertices stored in this buffer. 0 influences equal + rigidbodies (no skinning), 1 equal rigid skinning and 2 or more smooth skinning. + + + + + Gets or sets a value with unknown purpose. + + + + + Gets or sets the list of which are used to represent different level of details of the + shape. + + + + + Gets or sets the instances forming the bounding tree with which parts of a mesh + are culled when not visible. + + + + + Gets or sets the instance storing the data which forms the shape's surface. Saved + depending on . + + + + + Represents flags determining which data is available for instances. + + + + + The instance references a . + + + + + The boundings in all submeshes are consistent. + + + + + Represents a subarray of a section, storing a slice of indices to draw from the index buffer + referenced in the mesh, mostly used for hiding parts of a model when not visible. + + + + + Gets the offset into the index buffer in bytes. + + + + + Gets the number of indices to reference. + + + + + Represents a single bone in a section, storing its initial transform and transformation + effects. + + + + + Initializes a new instance of the class from the given which + is optionally left open. + + The to load the data from. + true to leave the stream open after reading, otherwise false. + + + + Initializes a new instance of the class from the file with the given + . + + The name of the file to load the data from. + + + + Saves the contents in the given and optionally leaves it open + + The to save the contents into. + true to leave the stream open after writing, otherwise false. + + + + Saves the contents in the file with the given . + + The name of the file to save the contents into. + + + + Gets or sets the name with which the instance can be referenced uniquely in + instances. + + + + + Gets or sets the index of the parent this instance is a child of. + + + + + Gets or sets the index of a matrix used for smooth skinning. + + + + + Gets or sets the index of a matrix used for rigid skinning. + + + + + Gets or sets flags controlling bone behavior. + + + + + Gets or sets the rotation method used to store bone rotations in . + + + + + Gets or sets the billboard transformation applied to the bone. + + + + + Gets or sets the spatial scale of the bone. + + + + + Gets or sets the spatial rotation of the bone. If is used, the + fourth component is always 1.0f. + + + + + Gets or sets the spatial position of the bone. + + + + + Gets or sets customly attached names. + + + + + Gets or sets customly attached instances. + + + + + Represents flags controlling bone behavior. + + + + + Set when the bone is visible. + + + + + Represents the rotation method used to store bone rotations. + + + + + A quaternion represents the rotation. + + + + + A represents the Euler rotation in XYZ order. + + + + + Represents the possible transformations for bones to handle them as billboards. + + + + + No transformation is applied. + + + + + Transforms of the child are applied. + + + + + Transforms the Z axis parallel to the camera. + + + + + Transforms the Z axis parallel to the direction of the camera. + + + + + Transforms the Y axis parallel to the camera up vector, and the Z parallel to the camera up-vector. + + + + + Transforms the Y axis parallel to the camera up vector, and the Z axis parallel to the direction of the + camera. + + + + + Transforms the Z axis parallel to the camera by rotating only the Y axis. + + + + + Transforms the Z axis parallel to the direction of the camera by rotating only the Y axis. + + + + + Represents an FSKL section in a subfile, storing armature data. + + + + + Initializes a new instance of the class from the given which + is optionally left open. + + The to load the data from. + true to leave the stream open after reading, otherwise false. + + + + Initializes a new instance of the class from the file with the given + . + + The name of the file to load the data from. + + + + Saves the contents in the given and optionally leaves it open + + The to save the contents into. + true to leave the stream open after writing, otherwise false. + + + + Saves the contents in the file with the given . + + The name of the file to save the contents into. + + + + Gets or sets the rotation method used to store bone rotations. + + + + + Gets or sets the list of names. + + + + + Gets or sets the list of instances forming the skeleton. + + + + + Represents the rotation method used to store bone rotations. + + + + + A quaternion represents the rotation. + + + + + A represents the Euler rotation in XYZ order. + + + + + Represents an attribute of a describing the data format, type and layout of a + specific data subset in the buffer. + + + + + Gets or sets the name with which the instance can be referenced uniquely in + instances. + + + + + Gets or sets the index of the buffer storing the data in the list. + + + + + Gets or sets the offset in bytes to the attribute in each vertex. + + + + + Gets or sets the determining the type in which attribute data is available. + + + + + Represents a data buffer holding vertices for a subfile. + + + + + Gets or sets the number of bones influencing the vertices stored in this buffer. 0 influences equal + rigidbodies (no skinning), 1 equal rigid skinning and 2 or more smooth skinning. + + + + + Gets the number of vertices stored by the . It is calculated from the size of the first + in bytes divided by the . + + + + + Gets or sets the instance storing buffer data at runtime + + + + + The size of a full vertex in bytes. + + + + + Gets or sets the dictionary of instances describing how to interprete data in the + . + + + + + Gets or sets the list of instances storing raw unformatted vertex data. + + + + + Represents stride and size in a + specific data subset in the buffer. + + + + + The size of a full vertex in bytes. + + + + + Represents stride and size in a + specific data subset in the buffer. + + + + + The size of a full vertex in bytes. + + + + + Represents an exception raised when handling data. + + + + + Initializes a new instance of the class with a specified error + . + + The error message that explains the reason for the exception. + + + + Initializes a new instance of the class with a specified error message created + from the given and . + + The format of the error message. + The parameters to format the error message with. + + + + Represents a NintendoWare for Cafe (NW4F) graphics data archive file. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class from the given which + is optionally left open. + + The to load the data from. + true to leave the stream open after reading, otherwise false. + + + + Initializes a new instance of the class from the file with the given + . + + The name of the file to load the data from. + + + + Gets or sets the major revision of the BFRES structure formats. + + + + + Gets or sets the second major revision of the BFRES structure formats. + + + + + Gets or sets the minor revision of the BFRES structure formats. + + + + + Gets or sets the second minor revision of the BFRES structure formats. + + + + + Gets the byte order in which data is stored. Must be the endianness of the target platform. + + + + + Gets or sets the alignment value. + + + + + Gets or sets the alignment to use for raw data blocks in the file. + + + + + Gets or sets the target adress size to use for raw data blocks in the file. + + + + + Gets or sets the flag. Unknown purpose. + + + + + Gets or sets the BlockOffset. + + + + + Gets or sets a name describing the contents. + + + + + Gets or sets the stored (FMDL) names. + + + + + Gets or sets the stored (FMDL) instances. + + + + + Gets or sets the stored (FSKA) instances. + + + + + Gets or sets the stored (FSKA) instances for many types of skeletal animations. + + + + + Gets or sets the stored (FMAA) names. + + + + + Gets or sets the stored (FMAA) instances for many types of material animations. + + + + + Gets or sets the stored (FVIS) names + + + + + Gets or sets the stored (FVIS) instances for bone visibility animations. + + + + + Gets or sets the stored (FSHA) names. + + + + + Gets or sets the stored (FSHA) instances. + + + + + Gets or sets the stored (FSCN) names. + + + + + Gets or sets the stored (FSCN) instances. + + + + + Gets or sets the stored instances. + + + + + Gets or sets the stored instances. + + + + + Gets or sets attached names + + + + + Gets or sets attached instances. The key of the dictionary typically represents + the name of the file they were originally created from. + + + + + Saves the contents in the given and optionally leaves it open + + The to save the contents into. + true to leave the stream open after writing, otherwise false. + + + + Saves the contents in the file with the given . + + The name of the file to save the contents into. + + + + Represents an FCAM section in a subfile, storing animations controlling camera settings. + + + + + Gets or sets flags controlling how animation data is stored or how the animation should be played. + + + + + Gets or sets the total number of frames this animation plays. + + + + + Gets or sets the number of bytes required to bake all . + + + + + Gets or sets the name with which the instance can be referenced uniquely in + instances. + + + + + Gets or sets instances animating properties of objects stored in this section. + + + + + Gets the instance storing initial camera parameters. + + + + + Gets or sets customly attached instances. + + + + + Gets or sets customly attached instances. + + + + + Represents flags specifying how animation data is stored or should be played. + + + + + The stored curve data has been baked. + + + + + The animation repeats from the start after the last frame has been played. + + + + + The rotation mode stores ZXY angles rather than look-at points in combination with a twist. + + + + + The projection mode is perspective rather than ortographic. + + + + + Represents the animatable data of scene cameras. + + + + + The near clipping plane distance. + + + + + The far clipping plane distance. + + + + + The aspect ratio of the projected image. + + + + + The field of view of the projected image. + + + + + The spatial position of the camera. + + + + + The spatial rotation of the camera. + + + + + The spatial twist of the camera. + + + + + Gets the for instances. + + + + + Animates . + + + + + Animates . + + + + + Animates . + + + + + Animates . + + + + + Animates the X component of . + + + + + Animates the Y component of . + + + + + Animates the Z component of . + + + + + Animates the X component of . + + + + + Animates the Y component of . + + + + + Animates the Z component of . + + + + + Animates . + + + + + Represents an FCAM section in a subfile, storing animations controlling fog settings. + + + + + Gets or sets flags controlling how animation data is stored or how the animation should be played. + + + + + Gets or sets the total number of frames this animation plays. + + + + + Gets or sets the index of the distance attenuation function to use. + + + + + Gets or sets the number of bytes required to bake all . + + + + + Gets or sets the name with which the instance can be referenced uniquely in + instances. + + + + + Gets or sets the name of the distance attenuation function to use. + + + + + Gets or sets instances animating properties of objects stored in this section. + + + + + Gets or sets the instance storing initial fog parameters. + + + + + Gets or sets customly attached instances. + + + + + Gets or sets customly attached instances. + + + + + Represents flags specifying how animation data is stored or should be played. + + + + + The stored curve data has been baked. + + + + + The animation repeats from the start after the last frame has been played. + + + + + Represents the animatable data of scene fog. + + + + + The distance attenuation of the fog depth. + + + + + The color of the fog. + + + + + Gets the for instances. + + + + + Animates the X component of . + + + + + Animates the Y component of . + + + + + Animates the X (red) component of . + + + + + Animates the Y (green) component of . + + + + + Animates the Z (blue) component of . + + + + + Represents an FLIT section in a subfile, storing animations controlling light settings. + + + + + Gets or sets flags controlling how the animation should be played. + + + + + Gets or sets flags controlling how animation data is stored or how the animation should be played. + + + + + Gets or sets the total number of frames this animation plays. + + + + + Gets or sets the index of the light type. + + + + + Gets or sets the index of the distance attenuation function to use. + + + + + Gets or sets the index of the angle attenuation function to use. + + + + + Gets or sets the number of bytes required to bake all . + + + + + Gets or sets the name with which the instance can be referenced uniquely in + instances. + + + + + Gets or sets the name of the light type. + + + + + Gets or sets the name of the distance attenuation function to use. + + + + + Gets or sets the name of the angle attenuation function to use. + + + + + Gets or sets instances animating properties of objects stored in this section. + + + + + Gets the instance storing initial light parameters. + + + + + Gets or sets customly attached instances. + + + + + Gets or sets customly attached instances. + + + + + Represents flags specifying how animation data is stored. + + + + + The stored curve data has been baked. + + + + + The animation repeats from the start after the last frame has been played. + + + + + Represents flags specifying which fields are animated. + + + + + Enabled state is animated. + + + + + Position is animated. + + + + + Rotation is animated. + + + + + Distance attenuation is animated. + + + + + Angle attenuation is animated in degrees. + + + + + Color 0 is animated. + + + + + Color 1 is animated. + + + + + Represents the animatable data of scene lighting. + + + + + Enables or disables the light in total. + + + + + The spatial origin of the light source for point or spot lights. + + + + + The spatial rotation of the light source. + + + + + The distance attenuation of the light. + + + + + The angle attenuation of the light in degrees. + + + + + The first light source color. + + + + + The second light source color. + + + + + Gets the for instances. + + + + + Animates . + + + + + Animates the X component of . + + + + + Animates the Y component of . + + + + + Animates the Z component of . + + + + + Animates the X component of . + + + + + Animates the Y component of . + + + + + Animates the Z component of . + + + + + Animates the X component of . + + + + + Animates the Y component of . + + + + + Animates the X component of . + + + + + Animates the Y component of . + + + + + Animates the X (red) component of . + + + + + Animates the Y (green) component of . + + + + + Animates the Z (blue) component of . + + + + + Animates the X (red) component of . + + + + + Animates the Y (green) component of . + + + + + Animates the Z (blue) component of . + + + + + Represents an FSCN subfile in a , storing scene animations controlling camera, light and + fog settings. + + + + + Initializes a new instance of the class from the given which + is optionally left open. + + The to load the data from. + true to leave the stream open after reading, otherwise false. + + + + Initializes a new instance of the class from the file with the given + . + + The name of the file to load the data from. + + + + Saves the contents in the given and optionally leaves it open + + The to save the contents into. + true to leave the stream open after writing, otherwise false. + + + + Saves the contents in the file with the given . + + The name of the file to save the contents into. + + + + Gets or sets the name with which the instance can be referenced uniquely in + instances. + + + + + Gets or sets the path of the file which originally supplied the data of this instance. + + + + + Gets or sets the instances. + + + + + Gets or sets the instances. + + + + + Gets or sets the instances. + + + + + Gets or sets customly attached instances. + + + + + Gets or sets the instances. + + + + + Gets or sets the instances. + + + + + Gets or sets the instances. + + + + + Gets or sets customly attached instances. + + + + + Represents a key shape animation info in a instance. + + + + + Gets or sets the index of the curve in the . + + + + + Gets or sets the index of the in the . + + + + + Gets or sets the name of the in the . + + + + + Represents an FSHA subfile in a , storing shape animations of a + instance. + + + + + Initializes a new instance of the class from the given which + is optionally left open. + + The to load the data from. + true to leave the stream open after reading, otherwise false. + + + + Initializes a new instance of the class from the file with the given + . + + The name of the file to load the data from. + + + + Saves the contents in the given and optionally leaves it open + + The to save the contents into. + true to leave the stream open after writing, otherwise false. + + + + Saves the contents in the file with the given . + + The name of the file to save the contents into. + + + + Gets or sets the name with which the instance can be referenced uniquely in + instances. + + + + + Gets or sets the path of the file which originally supplied the data of this instance. + + + + + Gets or sets flags controlling how animation data is stored or how the animation should be played. + + + + + Gets or sets the total number of frames this animation plays. + + + + + Gets or sets the number of bytes required to bake all instances of all + . + + + + + Gets or sets the instance affected by this animation. + + + + + Gets or sets the indices of the instances in the dictionary + to bind for each animation. specifies no binding. + + + + + Gets or sets the instances creating the animation. + + + + + Gets or sets customly attached instances. + + + + + Represents flags specifying how animation data is stored or should be played. + + + + + The stored curve data has been baked. + + + + + The animation repeats from the start after the last frame has been played. + + + + + Represents a vertex shape animation in a subfile. + + + + + Gets or sets the name of the animated . + + + + + Gets or sets the list of instances. + + + + + Gets or sets instances animating properties of objects stored in this section. + + + + + Gets or sets the list of base values, excluding the base shape (which is always being initialized with 0f). + + + + + Gets or sets the index of the first relative to all curves of the parent + instances. + + + + + Gets or sets the index of the first relative to all key shape anim infos of + the parent instances. + + + + + Represents the animation of a single in a subfile. + + + + + Gets or sets a set of flags indicating whether initial transformation values exist in + . + + + + + Gets or sets a set of flags indicating whether curves animating the corresponding transformation exist. + + + + + Gets or sets a set of flags controlling how to transform bones. + + + + + Gets or sets the name of the animated . + + + + + Gets or sets a field with unknown purpose. + + + + + Gets or sets a field with unknown purpose. + + + + + Gets or sets the element offset in the to an initial translation. + + + + + Gets or sets instances animating properties of objects stored in this section. + + + + + Gets or sets initial transformation values. Only stores specific transformations according to + . + + + + + Gets the index of the first relative to all curves of the parent + instances. + + + + + Represents if initial values exist for the corresponding transformation in the base animation data. + + + + + Initial scaling values exist. + + + + + Initial rotation values exist. + + + + + Initial translation values exist. + + + + + Represents if curves exist which animate the corresponding transformation component. + + + + + Curve animating the X component of a bone's scale. + + + + + Curve animating the Y component of a bone's scale. + + + + + Curve animating the Z component of a bone's scale. + + + + + Curve animating the X component of a bone's rotation. + + + + + Curve animating the Y component of a bone's rotation. + + + + + Curve animating the Z component of a bone's rotation. + + + + + Curve animating the W component of a bone's rotation. + + + + + Curve animating the X component of a bone's translation. + + + + + Curve animating the Y component of a bone's translation. + + + + + Curve animating the Z component of a bone's translation. + + + + + Represents how a bone transformation has to be applied. + + + + + Represents the animatable data of a instance. + + + + + The scaling of the bone. + + + + + The translation of the bone. + + + + + An unused field. + + + + + The rotation of the bone. + + + + + Gets the for instances. + + + + + Animates (never seen in files). + + + + + Animates the X component of . + + + + + Animates the Y component of . + + + + + Animates the Z component of . + + + + + Animates the X component of . + + + + + Animates the Y component of . + + + + + Animates the Z component of . + + + + + Animates the X component of . + + + + + Animates the Y component of . + + + + + Animates the Z component of . + + + + + Animates the W component of . + + + + + Represents an FSKA subfile in a , storing armature animations of + instances in a . + + + + + Initializes a new instance of the class from the given which + is optionally left open. + + The to load the data from. + true to leave the stream open after reading, otherwise false. + + + + Initializes a new instance of the class from the file with the given + . + + The name of the file to load the data from. + + + + Saves the contents in the given and optionally leaves it open + + The to save the contents into. + true to leave the stream open after writing, otherwise false. + + + + Saves the contents in the file with the given . + + The name of the file to save the contents into. + + + + Gets or sets the name with which the instance can be referenced uniquely in + instances. + + + + + Gets or sets the path of the file which originally supplied the data of this instance. + + + + + Gets or sets the mode used to control looping and baked settings. + + + + + Gets or sets the mode used to store scaling values. + + + + + Gets or sets the mode used to store rotation values. + + + + + Gets or sets the total number of frames this animation plays. + + + + + Gets or sets the number of bytes required to bake all instances of all + . + + + + + Gets or sets the instances creating the animation. + + + + + Gets or sets the instance affected by this animation. + + + + + Gets or sets the indices of the instances in the dictionary + to bind for each animation. specifies no binding. + + + + + Gets or sets customly attached instances. + + + + + Represents flags specifying how animation data is stored or should be played. + + + + + The stored curve data has been baked. + + + + + The animation repeats from the start after the last frame has been played. + + + + + Represents the data format in which scaling values are stored. + + + + + No scaling. + + + + + Default scaling. + + + + + Autodesk Maya scaling. + + + + + Autodesk Softimage scaling. + + + + + Represents the data format in which rotation values are stored. + + + + + Quaternion, 4 components. + + + + + Euler XYZ, 3 components. + + + + + Represents an FVIS subfile in a , storing visibility animations of or + instances. + + + + + Initializes a new instance of the class from the given which + is optionally left open. + + The to load the data from. + true to leave the stream open after reading, otherwise false. + + + + Initializes a new instance of the class from the file with the given + . + + The name of the file to load the data from. + + + + Saves the contents in the given and optionally leaves it open + + The to save the contents into. + true to leave the stream open after writing, otherwise false. + + + + Saves the contents in the file with the given . + + The name of the file to save the contents into. + + + + Gets or sets the name with which the instance can be referenced uniquely in + instances. + + + + + Gets or sets the path of the file which originally supplied the data of this instance. + + + + + Gets or sets flags controlling how animation data is stored or how the animation should be played. + + + + + Gets or sets the kind of data the animation controls. + + + + + Gets or sets the total number of frames this animation plays. + + + + + Gets or sets the number of bytes required to bake all . + + + + + Gets or sets the instance affected by this animation. + + + + + Gets or sets the indices of entries in the or + dictionaries to bind to for each animation. specifies no binding. + + + + + Gets or sets the names of entries in the or + dictionaries to bind to for each animation. + + + + + Gets or sets instances animating properties of objects stored in this section. + + + + + Gets or sets boolean values storing the initial visibility for each or + . + + + + + Gets or sets customly attached instances. + + + + + Represents flags specifying how animation data is stored or should be played. + + + + + The stored curve data has been baked. + + + + + The animation repeats from the start after the last frame has been played. + + + + + Represents the kind of data the visibility animation controls. + + + + + Bone visiblity is controlled. + + + + + Material visibility is controlled. + + + + diff --git a/Switch_Toolbox/MainForm.cs b/Switch_Toolbox/MainForm.cs index 16213359..804c2e84 100644 --- a/Switch_Toolbox/MainForm.cs +++ b/Switch_Toolbox/MainForm.cs @@ -265,9 +265,9 @@ namespace Switch_Toolbox f.Dispose(); f.Close(); + //Check magic first regardless of extension foreach (IFileFormat format in SupportedFormats) { - if (format.Magic == Magic || format.Magic == Magic2 || format.Magic.Reverse() == Magic2) { format.CompressionType = CompType; @@ -290,34 +290,35 @@ namespace Switch_Toolbox if (format.UseEditMenu) editToolStripMenuItem.Enabled = true; } - else + } + //If magic fails, then check extensions + foreach (IFileFormat format in SupportedFormats) + { + foreach (string ext in format.Extension) { - foreach (string ext in format.Extension) + if (ext.Remove(0, 1) == Path.GetExtension(FileName)) { - if (ext.Remove(0, 1) == Path.GetExtension(FileName)) + format.CompressionType = CompType; + format.FileIsCompressed = Compressed; + format.Data = data; + format.FileName = Path.GetFileName(FileName); + format.FilePath = FileName; + format.Load(); + + if (format.EditorRoot != null) { - format.CompressionType = CompType; - format.FileIsCompressed = Compressed; - format.Data = data; - format.FileName = Path.GetFileName(FileName); - format.FilePath = FileName; - format.Load(); - - if (format.EditorRoot != null) - { - objectList.treeView1.Nodes.Add(format.EditorRoot); - } - - if (format.CanSave) - { - saveAsToolStripMenuItem.Enabled = true; - saveToolStripMenuItem.Enabled = true; - } - if (format.UseEditMenu) - editToolStripMenuItem.Enabled = true; + objectList.treeView1.Nodes.Add(format.EditorRoot); } + + if (format.CanSave) + { + saveAsToolStripMenuItem.Enabled = true; + saveToolStripMenuItem.Enabled = true; + } + if (format.UseEditMenu) + editToolStripMenuItem.Enabled = true; } - } + } } } private void DisposeControls() @@ -326,7 +327,9 @@ namespace Switch_Toolbox } private void RecentFile_click(object sender, EventArgs e) { + Cursor.Current = Cursors.WaitCursor; OpenFile(sender.ToString()); + Cursor.Current = Cursors.Default; } private void menuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { @@ -362,8 +365,12 @@ namespace Switch_Toolbox if (ofd.ShowDialog() == DialogResult.OK) { + Cursor.Current = Cursors.WaitCursor; + foreach (string file in ofd.FileNames) OpenFile(file); + + Cursor.Current = Cursors.Default; } } @@ -375,11 +382,15 @@ namespace Switch_Toolbox private void dockPanel1_DragDrop(object sender, DragEventArgs e) { + Cursor.Current = Cursors.WaitCursor; + string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); foreach (string filename in files) { OpenFile(filename); } + + Cursor.Current = Cursors.Default; } private void dockPanel1_DragEnter(object sender, DragEventArgs e)