From 9308bfd565104d7e3eebe6ebc76479fa87b5e1ed Mon Sep 17 00:00:00 2001 From: KillzXGaming Date: Fri, 2 Aug 2019 17:31:27 -0400 Subject: [PATCH] Some buffer check fixes and adjust sarc description --- .vs/Toolbox/v15/.suo | Bin 761856 -> 761344 bytes .../FileFormats/Archives/SARC.cs | 2 +- File_Format_Library/FileFormats/Grezzo/CMB.cs | 12 ++++++------ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.vs/Toolbox/v15/.suo b/.vs/Toolbox/v15/.suo index c893c4a2a79f57654df715290538bd3cac6935be..8fcadde652edc9024d5a8e6f8ec2d156786d4bb0 100644 GIT binary patch delta 4175 zcmds4dsJ0b8bAB&eIENLG zUNEzR^T<52DLBuOjaG1Nc7r}CMtgHz$Yk=aw<#o#+S2VlrX)x*lg9>|<-?q&TQ-!x z$da_*%n2K*&p;&|VOH05Hygteb$bU|-5DUu%V*T?AhmOpWXt5 zw|>YBs-MDj+OcC!iceRsVdt1)9*XbAY}Ve!_s-iDD*!)fc-F|`!YqVN2n z7|I!OF}vqInc0I>Omb`fA7eP!w(QaFh57qRl7oJOE-x&0d0i7?iSry%vi0rO;wNLG zTm2dbk1D1$v6neuT5w1Pa+%VcdUE~TPO`#TCRX9W?2EV6>A-_!DP1(xK{$0?P%fiKADCLbb@ zluJ_~auMy`E=_tyN|&CJ(xf?3rZh`Rk+P)cr76-tsQrfDPdt#AOQ*Mp_V_i?6jYop z%|t`<&`^uA^qW11+d1?kg@QclTD_QV4;(B}T!thKl!oB%0_h>Kdod-nw69avg)g7_ zNU3iHC6Jm=yFvL1s*3uN%1HvA6*RUgNr{miQ=~Xt%XBGQnguCEaj*UFNe z|25J@C|tz^1aDS)Lt-8)1E0UnA^sSPhAVqngcT#pkhGo_!MU?63K~)whcTO&B{oh} z3T0~p)k}L#R+trwVkx!STJXecsyI4TN#WK|ITZFhrkUWYrtQGfLyNRMaN)m$*2tpz z2#sgfWLbx+-Lxx$Wh#NxN|l4GYt#>FZz-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~<0)Jmif+Dc= zvE=c`Q8Is_Lwdc`tJ)(>2WX3<&N`7uViCBj%^ z5uxS~jc4&$mLtJ@sKC7GS|p2HYq=nS6D*0+SRoVkgXKv$XiA(<^|s6t;)LnKeEx6U z9MjZQU$Zg9YYBUSzl|mdV}xP+$*Po$_dK``Z6-YNV~5{Og&r{eFx_GM#cT;!y8X&Y F{s~K(H-Z2F diff --git a/File_Format_Library/FileFormats/Archives/SARC.cs b/File_Format_Library/FileFormats/Archives/SARC.cs index 6e9a3853..8948d992 100644 --- a/File_Format_Library/FileFormats/Archives/SARC.cs +++ b/File_Format_Library/FileFormats/Archives/SARC.cs @@ -17,7 +17,7 @@ namespace FirstPlugin public FileType FileType { get; set; } = FileType.Archive; public bool CanSave { get; set; } - public string[] Description { get; set; } = new string[] { "Sorted ARChive" }; + public string[] Description { get; set; } = new string[] { "Sead (hashed) Archived Resource" }; public string[] Extension { get; set; } = new string[] { "*.pack", "*.sarc", "*.bgenv", "*.sbfarc", "*.sblarc", "*.sbactorpack", ".arc" }; public string FileName { get; set; } public string FilePath { get; set; } diff --git a/File_Format_Library/FileFormats/Grezzo/CMB.cs b/File_Format_Library/FileFormats/Grezzo/CMB.cs index 3f3add9f..f83c2f4c 100644 --- a/File_Format_Library/FileFormats/Grezzo/CMB.cs +++ b/File_Format_Library/FileFormats/Grezzo/CMB.cs @@ -243,7 +243,7 @@ namespace FirstPlugin shape.Position.VertexData[v].Y, shape.Position.VertexData[v].Z); - if (shape.Normal != null) + if (shape.Normal.VertexData != null) { vert.nrm = new OpenTK.Vector3( shape.Normal.VertexData[v].X, @@ -260,19 +260,19 @@ namespace FirstPlugin shape.Color.VertexData[v].W).Normalized(); } - if (shape.TexCoord0 != null) + if (shape.TexCoord0.VertexData != null) { vert.uv0 = new OpenTK.Vector2( shape.TexCoord0.VertexData[v].X, shape.TexCoord0.VertexData[v].Y); } - if (shape.TexCoord1 != null) + if (shape.TexCoord1.VertexData != null) { } - if (shape.TexCoord2 != null) + if (shape.TexCoord2.VertexData != null) { } @@ -296,7 +296,7 @@ namespace FirstPlugin bool HasWeights = shape.Primatives[0].SkinningMode == SkinningMode.SMOOTH_SKINNING; - /* if (shape.BoneIndices != null && HasSkinning && shape.BoneIndices.VertexData.Length > v) + /* if (shape.BoneIndices.VertexData != null && HasSkinning && shape.BoneIndices.VertexData.Length > v) { var BoneIndices = shape.BoneIndices.VertexData[v]; for (int j = 0; j < shape.boneDimension; j++) @@ -305,7 +305,7 @@ namespace FirstPlugin vert.boneIds.Add((int)index); } } - if (shape.BoneWeights != null && HasWeights && shape.BoneWeights.VertexData.Length > v) + if (shape.BoneWeights.VertexData != null && HasWeights && shape.BoneWeights.VertexData.Length > v) { var BoneWeights = shape.BoneWeights.VertexData[v]; for (int j = 0; j < shape.boneDimension; j++)