Skip to content

Commit

Permalink
Fix some obsoletes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ottermandias committed Apr 4, 2024
1 parent 8375abd commit 0d427dc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Glamourer/Interop/ScalingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,27 +100,27 @@ private float CalculateHeightDetour(Character* character)

/// <summary> We do not change the Customize gender because the functions use the GetGender() vfunc, which uses the game objects gender value. </summary>
private static (byte Race, byte Clan, byte Gender) GetScaleRelevantCustomize(Character* character)
=> (character->DrawData.CustomizeData.Race, character->DrawData.CustomizeData.Clan, character->GameObject.Gender);
=> (character->DrawData.CustomizeData.Race, character->DrawData.CustomizeData.Tribe, character->GameObject.Sex);

private static (byte Gender, byte BodyType, byte Clan, byte Height) GetHeightRelevantCustomize(Character* character)
=> (character->DrawData.CustomizeData.Sex, character->DrawData.CustomizeData.BodyType,
character->DrawData.CustomizeData.Clan, character->DrawData.CustomizeData[(int)CustomizeIndex.Height]);
character->DrawData.CustomizeData.Tribe, character->DrawData.CustomizeData[(int)CustomizeIndex.Height]);

[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
private static void SetScaleCustomize(Character* character, Model model)
{
if (!model.IsHuman)
return;

SetScaleCustomize(character, model.AsHuman->Customize.Race, model.AsHuman->Customize.Clan, model.AsHuman->Customize.Sex);
SetScaleCustomize(character, model.AsHuman->Customize.Race, model.AsHuman->Customize.Tribe, model.AsHuman->Customize.Sex);
}

[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
private static void SetScaleCustomize(Character* character, byte race, byte clan, byte gender)
{
character->DrawData.CustomizeData.Race = race;
character->DrawData.CustomizeData.Clan = clan;
character->GameObject.Gender = gender;
character->DrawData.CustomizeData.Race = race;
character->DrawData.CustomizeData.Tribe = clan;
character->GameObject.Sex = gender;
}

[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
Expand All @@ -129,7 +129,7 @@ private static void SetHeightCustomize(Character* character, Model model)
if (!model.IsHuman)
return;

SetHeightCustomize(character, model.AsHuman->Customize.Sex, model.AsHuman->Customize.BodyType, model.AsHuman->Customize.Clan,
SetHeightCustomize(character, model.AsHuman->Customize.Sex, model.AsHuman->Customize.BodyType, model.AsHuman->Customize.Tribe,
model.AsHuman->Customize[(int)CustomizeIndex.Height]);
}

Expand All @@ -138,7 +138,7 @@ private static void SetHeightCustomize(Character* character, byte gender, byte b
{
character->DrawData.CustomizeData.Sex = gender;
character->DrawData.CustomizeData.BodyType = bodyType;
character->DrawData.CustomizeData.Clan = clan;
character->DrawData.CustomizeData.Tribe = clan;
character->DrawData.CustomizeData.Data[(int)CustomizeIndex.Height] = height;
}
}

0 comments on commit 0d427dc

Please sign in to comment.