diff --git a/Penumbra.GameData b/Penumbra.GameData index 96e95378..13545143 160000 --- a/Penumbra.GameData +++ b/Penumbra.GameData @@ -1 +1 @@ -Subproject commit 96e95378325ff1533ca41b934fcb712f24d5260b +Subproject commit 135451430344f2f12e8c02fd4c4c6f0875d74e60 diff --git a/Penumbra/Import/Models/ModelManager.cs b/Penumbra/Import/Models/ModelManager.cs index 8c6dc31a..7f1171f3 100644 --- a/Penumbra/Import/Models/ModelManager.cs +++ b/Penumbra/Import/Models/ModelManager.cs @@ -244,14 +244,7 @@ public sealed class ModelManager(IFramework framework, ActiveCollections collect private Image ConvertImage(MtrlFile.Texture texture, CancellationToken cancel) { // Work out the texture's path - the DX11 material flag controls a file name prefix. - var texturePath = texture.Path; - if (texture.DX11) - { - var fileName = Path.GetFileName(texturePath); - if (!fileName.StartsWith("--")) - texturePath = $"{Path.GetDirectoryName(texturePath)}/--{fileName}"; - } - + GamePaths.Tex.HandleDx11Path(texture, out var texturePath); using var textureData = new MemoryStream(read(texturePath)); var image = TexFileParser.Parse(textureData); var pngImage = TextureManager.ConvertToPng(image, cancel).AsPng; diff --git a/Penumbra/Mods/ItemSwap/CustomizationSwap.cs b/Penumbra/Mods/ItemSwap/CustomizationSwap.cs index fc32df0c..78c49b59 100644 --- a/Penumbra/Mods/ItemSwap/CustomizationSwap.cs +++ b/Penumbra/Mods/ItemSwap/CustomizationSwap.cs @@ -79,21 +79,9 @@ public static class CustomizationSwap } public static FileSwap CreateTex(MetaFileManager manager, Func redirections, BodySlot slot, GenderRace race, - PrimaryId idFrom, ref MtrlFile.Texture texture, - ref bool dataWasChanged) + PrimaryId idFrom, ref MtrlFile.Texture texture, ref bool dataWasChanged) { - var path = texture.Path; - var addedDashes = false; - if (texture.DX11) - { - var fileName = Path.GetFileName(path); - if (!fileName.StartsWith("--")) - { - path = path.Replace(fileName, $"--{fileName}"); - addedDashes = true; - } - } - + var addedDashes = GamePaths.Tex.HandleDx11Path(texture, out var path); var newPath = ItemSwap.ReplaceAnyRace(path, race); newPath = ItemSwap.ReplaceAnyBody(newPath, slot, idFrom); newPath = ItemSwap.AddSuffix(newPath, ".tex", $"_{Path.GetFileName(texture.Path).GetStableHashCode():x8}", true); diff --git a/Penumbra/Mods/ItemSwap/EquipmentSwap.cs b/Penumbra/Mods/ItemSwap/EquipmentSwap.cs index 516df251..5a5181a5 100644 --- a/Penumbra/Mods/ItemSwap/EquipmentSwap.cs +++ b/Penumbra/Mods/ItemSwap/EquipmentSwap.cs @@ -402,22 +402,10 @@ public static class EquipmentSwap => CreateTex(manager, redirections, prefix, EquipSlot.Unknown, EquipSlot.Unknown, idFrom, idTo, ref texture, ref dataWasChanged); public static FileSwap CreateTex(MetaFileManager manager, Func redirections, char prefix, EquipSlot slotFrom, - EquipSlot slotTo, PrimaryId idFrom, - PrimaryId idTo, ref MtrlFile.Texture texture, ref bool dataWasChanged) + EquipSlot slotTo, PrimaryId idFrom, PrimaryId idTo, ref MtrlFile.Texture texture, ref bool dataWasChanged) { - var path = texture.Path; - var addedDashes = false; - if (texture.DX11) - { - var fileName = Path.GetFileName(path); - if (!fileName.StartsWith("--")) - { - path = path.Replace(fileName, $"--{fileName}"); - addedDashes = true; - } - } - - var newPath = ItemSwap.ReplaceAnyId(path, prefix, idFrom); + var addedDashes = GamePaths.Tex.HandleDx11Path(texture, out var path); + var newPath = ItemSwap.ReplaceAnyId(path, prefix, idFrom); newPath = ItemSwap.ReplaceSlot(newPath, slotTo, slotFrom, slotTo != slotFrom); newPath = ItemSwap.AddSuffix(newPath, ".tex", $"_{Path.GetFileName(texture.Path).GetStableHashCode():x8}"); if (newPath != path)