diff --git a/Penumbra.GameData b/Penumbra.GameData index 5fa4d0e7..e8220a0a 160000 --- a/Penumbra.GameData +++ b/Penumbra.GameData @@ -1 +1 @@ -Subproject commit 5fa4d0e7972423b73f8cf569bb2bfbeddd825c8a +Subproject commit e8220a0a74e9480330e98ed7ca462353434b9649 diff --git a/Penumbra/Import/TexToolsMeta.Deserialization.cs b/Penumbra/Import/TexToolsMeta.Deserialization.cs index 325c9143..f062ae25 100644 --- a/Penumbra/Import/TexToolsMeta.Deserialization.cs +++ b/Penumbra/Import/TexToolsMeta.Deserialization.cs @@ -57,9 +57,7 @@ public partial class TexToolsMeta if (data == null) return; - using var reader = new BinaryReader(new MemoryStream(data)); - var value = (GmpEntry)reader.ReadUInt32(); - value.UnknownTotal = reader.ReadByte(); + var value = GmpEntry.FromTexToolsMeta(data.AsSpan(0, 5)); var def = ExpandedGmpFile.GetDefault(_metaFileManager, metaFileInfo.PrimaryId); if (_keepDefault || value != def) MetaManipulations.Add(new GmpManipulation(value, metaFileInfo.PrimaryId)); diff --git a/Penumbra/Meta/Files/CmpFile.cs b/Penumbra/Meta/Files/CmpFile.cs index 8a6040ec..b265a5e8 100644 --- a/Penumbra/Meta/Files/CmpFile.cs +++ b/Penumbra/Meta/Files/CmpFile.cs @@ -19,8 +19,8 @@ public sealed unsafe class CmpFile : MetaBaseFile public float this[SubRace subRace, RspAttribute attribute] { - get => *(float*)(Data + RacialScalingStart + ToRspIndex(subRace) * RspEntry.ByteSize + (int)attribute * 4); - set => *(float*)(Data + RacialScalingStart + ToRspIndex(subRace) * RspEntry.ByteSize + (int)attribute * 4) = value; + get => *(float*)(Data + RacialScalingStart + ToRspIndex(subRace) * RspData.ByteSize + (int)attribute * 4); + set => *(float*)(Data + RacialScalingStart + ToRspIndex(subRace) * RspData.ByteSize + (int)attribute * 4) = value; } public override void Reset() @@ -42,7 +42,7 @@ public sealed unsafe class CmpFile : MetaBaseFile public static float GetDefault(MetaFileManager manager, SubRace subRace, RspAttribute attribute) { var data = (byte*)manager.CharacterUtility.DefaultResource(InternalIndex).Address; - return *(float*)(data + RacialScalingStart + ToRspIndex(subRace) * RspEntry.ByteSize + (int)attribute * 4); + return *(float*)(data + RacialScalingStart + ToRspIndex(subRace) * RspData.ByteSize + (int)attribute * 4); } private static int ToRspIndex(SubRace subRace) diff --git a/Penumbra/Meta/Files/EqpGmpFile.cs b/Penumbra/Meta/Files/EqpGmpFile.cs index 97f57703..70067c2b 100644 --- a/Penumbra/Meta/Files/EqpGmpFile.cs +++ b/Penumbra/Meta/Files/EqpGmpFile.cs @@ -157,12 +157,12 @@ public sealed class ExpandedGmpFile : ExpandedEqpGmpBase, IEnumerable public GmpEntry this[PrimaryId idx] { - get => (GmpEntry)GetInternal(idx); - set => SetInternal(idx, (ulong)value); + get => new() { Value = GetInternal(idx) }; + set => SetInternal(idx, value.Value); } public static GmpEntry GetDefault(MetaFileManager manager, PrimaryId primaryIdx) - => (GmpEntry)GetDefaultInternal(manager, InternalIndex, primaryIdx, (ulong)GmpEntry.Default); + => new() { Value = GetDefaultInternal(manager, InternalIndex, primaryIdx, GmpEntry.Default.Value) }; public void Reset(IEnumerable entries) {