More renaming...

This commit is contained in:
Ottermandias 2023-03-23 20:42:34 +01:00
parent 7bad131542
commit f38a252295
55 changed files with 423 additions and 407 deletions

View file

@ -3,6 +3,7 @@ using Penumbra.GameData.Enums;
using Penumbra.GameData.Structs;
using Penumbra.Interop.Structs;
using System.Collections.Generic;
using Penumbra.Interop.Services;
using Penumbra.String.Functions;
namespace Penumbra.Meta.Files;
@ -11,8 +12,8 @@ namespace Penumbra.Meta.Files;
// We only support manipulating the racial scaling parameters at the moment.
public sealed unsafe class CmpFile : MetaBaseFile
{
public static readonly Interop.CharacterUtility.InternalIndex InternalIndex =
Interop.CharacterUtility.ReverseIndices[ ( int )CharacterUtility.Index.HumanCmp ];
public static readonly CharacterUtility.InternalIndex InternalIndex =
CharacterUtility.ReverseIndices[ ( int )MetaIndex.HumanCmp ];
private const int RacialScalingStart = 0x2A800;
@ -34,7 +35,7 @@ public sealed unsafe class CmpFile : MetaBaseFile
}
public CmpFile()
: base( CharacterUtility.Index.HumanCmp )
: base( MetaIndex.HumanCmp )
{
AllocateData( DefaultData.Length );
Reset();

View file

@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using Penumbra.GameData.Enums;
using Penumbra.GameData.Structs;
using Penumbra.Interop.Services;
using Penumbra.Interop.Structs;
using Penumbra.String.Functions;
@ -96,7 +97,7 @@ public sealed unsafe class ExpandedEqdpFile : MetaBaseFile
}
public ExpandedEqdpFile( GenderRace raceCode, bool accessory )
: base( CharacterUtility.EqdpIdx( raceCode, accessory ) )
: base( CharacterUtilityData.EqdpIdx( raceCode, accessory ) )
{
var def = ( byte* )DefaultData.Data;
var blockSize = *( ushort* )( def + IdentifierSize );
@ -114,7 +115,7 @@ public sealed unsafe class ExpandedEqdpFile : MetaBaseFile
public EqdpEntry GetDefault( int setIdx )
=> GetDefault( Index, setIdx );
public static EqdpEntry GetDefault( Interop.CharacterUtility.InternalIndex idx, int setIdx )
public static EqdpEntry GetDefault( CharacterUtility.InternalIndex idx, int setIdx )
=> GetDefault( ( byte* )Penumbra.CharacterUtility.DefaultResource( idx ).Address, setIdx );
public static EqdpEntry GetDefault( byte* data, int setIdx )
@ -139,5 +140,5 @@ public sealed unsafe class ExpandedEqdpFile : MetaBaseFile
}
public static EqdpEntry GetDefault( GenderRace raceCode, bool accessory, int setIdx )
=> GetDefault( Interop.CharacterUtility.ReverseIndices[ ( int )CharacterUtility.EqdpIdx( raceCode, accessory ) ], setIdx );
=> GetDefault( CharacterUtility.ReverseIndices[ ( int )CharacterUtilityData.EqdpIdx( raceCode, accessory ) ], setIdx );
}

View file

@ -3,6 +3,7 @@ using System.Collections;
using System.Collections.Generic;
using System.Numerics;
using Penumbra.GameData.Structs;
using Penumbra.Interop.Services;
using Penumbra.Interop.Structs;
using Penumbra.String.Functions;
@ -75,13 +76,13 @@ public unsafe class ExpandedEqpGmpBase : MetaBaseFile
}
public ExpandedEqpGmpBase( bool gmp )
: base( gmp ? CharacterUtility.Index.Gmp : CharacterUtility.Index.Eqp )
: base( gmp ? MetaIndex.Gmp : MetaIndex.Eqp )
{
AllocateData( MaxSize );
Reset();
}
protected static ulong GetDefaultInternal( Interop.CharacterUtility.InternalIndex fileIndex, int setIdx, ulong def )
protected static ulong GetDefaultInternal( CharacterUtility.InternalIndex fileIndex, int setIdx, ulong def )
{
var data = ( byte* )Penumbra.CharacterUtility.DefaultResource(fileIndex).Address;
if( setIdx == 0 )
@ -111,8 +112,8 @@ public unsafe class ExpandedEqpGmpBase : MetaBaseFile
public sealed class ExpandedEqpFile : ExpandedEqpGmpBase, IEnumerable<EqpEntry>
{
public static readonly Interop.CharacterUtility.InternalIndex InternalIndex =
Interop.CharacterUtility.ReverseIndices[ (int) CharacterUtility.Index.Eqp ];
public static readonly CharacterUtility.InternalIndex InternalIndex =
CharacterUtility.ReverseIndices[ (int) MetaIndex.Eqp ];
public ExpandedEqpFile()
: base( false )
@ -158,8 +159,8 @@ public sealed class ExpandedEqpFile : ExpandedEqpGmpBase, IEnumerable<EqpEntry>
public sealed class ExpandedGmpFile : ExpandedEqpGmpBase, IEnumerable<GmpEntry>
{
public static readonly Interop.CharacterUtility.InternalIndex InternalIndex =
Interop.CharacterUtility.ReverseIndices[( int )CharacterUtility.Index.Gmp];
public static readonly CharacterUtility.InternalIndex InternalIndex =
CharacterUtility.ReverseIndices[( int )MetaIndex.Gmp];
public ExpandedGmpFile()
: base( true )

View file

@ -1,6 +1,7 @@
using System;
using System.Runtime.InteropServices;
using Penumbra.GameData.Enums;
using Penumbra.Interop.Services;
using Penumbra.Interop.Structs;
using Penumbra.Meta.Manipulations;
using Penumbra.String.Functions;
@ -175,7 +176,7 @@ public sealed unsafe class EstFile : MetaBaseFile
}
public EstFile( EstManipulation.EstType estType )
: base( ( CharacterUtility.Index )estType )
: base( ( MetaIndex )estType )
{
var length = DefaultData.Length;
AllocateData( length + IncreaseSize );
@ -185,7 +186,7 @@ public sealed unsafe class EstFile : MetaBaseFile
public ushort GetDefault( GenderRace genderRace, ushort setId )
=> GetDefault( Index, genderRace, setId );
public static ushort GetDefault( Interop.CharacterUtility.InternalIndex index, GenderRace genderRace, ushort setId )
public static ushort GetDefault( CharacterUtility.InternalIndex index, GenderRace genderRace, ushort setId )
{
var data = ( byte* )Penumbra.CharacterUtility.DefaultResource( index ).Address;
var count = *( int* )data;
@ -199,9 +200,9 @@ public sealed unsafe class EstFile : MetaBaseFile
return *( ushort* )( data + 4 + count * EntryDescSize + idx * EntrySize );
}
public static ushort GetDefault( CharacterUtility.Index index, GenderRace genderRace, ushort setId )
=> GetDefault( Interop.CharacterUtility.ReverseIndices[ ( int )index ], genderRace, setId );
public static ushort GetDefault( MetaIndex metaIndex, GenderRace genderRace, ushort setId )
=> GetDefault( CharacterUtility.ReverseIndices[ ( int )metaIndex ], genderRace, setId );
public static ushort GetDefault( EstManipulation.EstType estType, GenderRace genderRace, ushort setId )
=> GetDefault( ( CharacterUtility.Index )estType, genderRace, setId );
=> GetDefault( ( MetaIndex )estType, genderRace, setId );
}

View file

@ -1,4 +1,5 @@
using System;
using Penumbra.Interop.Structs;
namespace Penumbra.Meta.Files;
@ -64,6 +65,6 @@ public unsafe class EvpFile : MetaBaseFile
}
public EvpFile()
: base( ( Interop.Structs.CharacterUtility.Index )1 ) // TODO: Name
: base( ( MetaIndex )1 ) // TODO: Name
{ }
}

View file

@ -1,7 +1,8 @@
using System;
using Dalamud.Memory;
using Penumbra.Interop.Structs;
using Penumbra.String.Functions;
using CharacterUtility = Penumbra.Interop.CharacterUtility;
using CharacterUtility = Penumbra.Interop.Services.CharacterUtility;
namespace Penumbra.Meta.Files;
@ -11,7 +12,7 @@ public unsafe class MetaBaseFile : IDisposable
public int Length { get; private set; }
public CharacterUtility.InternalIndex Index { get; }
public MetaBaseFile( Interop.Structs.CharacterUtility.Index idx )
public MetaBaseFile( MetaIndex idx )
=> Index = CharacterUtility.ReverseIndices[ ( int )idx ];
protected (IntPtr Data, int Length) DefaultData