diff --git a/Penumbra.GameData/Structs/EqpEntry.cs b/Penumbra.GameData/Structs/EqpEntry.cs index b2f3f22c..b628aa63 100644 --- a/Penumbra.GameData/Structs/EqpEntry.cs +++ b/Penumbra.GameData/Structs/EqpEntry.cs @@ -24,7 +24,7 @@ public enum EqpEntry : ulong BodyShowBracelet = 0x10_00ul, BodyShowTail = 0x20_00ul, BodyDisableBreastPhysics = 0x40_00ul, - BodyHasVfxObject = 0x80_00ul, + BodyUsesEvpTable = 0x80_00ul, BodyMask = 0xFF_FFul, LegsEnabled = 0x01ul << 16, @@ -75,7 +75,7 @@ public enum EqpEntry : ulong _55 = 0x00_80_00ul << 40, HeadShowHrothgarHat = 0x01_00_00ul << 40, HeadShowVieraHat = 0x02_00_00ul << 40, - HeadHasVfxObject = 0x04_00_00ul << 40, + HeadUsesEvpTable = 0x04_00_00ul << 40, _59 = 0x08_00_00ul << 40, _60 = 0x10_00_00ul << 40, _61 = 0x20_00_00ul << 40, @@ -151,7 +151,7 @@ public static class Eqp EqpEntry.BodyShowBracelet => EquipSlot.Body, EqpEntry.BodyShowTail => EquipSlot.Body, EqpEntry.BodyDisableBreastPhysics => EquipSlot.Body, - EqpEntry.BodyHasVfxObject => EquipSlot.Body, + EqpEntry.BodyUsesEvpTable => EquipSlot.Body, EqpEntry.LegsEnabled => EquipSlot.Legs, EqpEntry.LegsHideKneePads => EquipSlot.Legs, @@ -198,7 +198,7 @@ public static class Eqp EqpEntry._55 => EquipSlot.Head, EqpEntry.HeadShowHrothgarHat => EquipSlot.Head, EqpEntry.HeadShowVieraHat => EquipSlot.Head, - EqpEntry.HeadHasVfxObject => EquipSlot.Head, + EqpEntry.HeadUsesEvpTable => EquipSlot.Head, // currently unused EqpEntry._59 => EquipSlot.Unknown, @@ -230,7 +230,7 @@ public static class Eqp EqpEntry.BodyShowBracelet => "Show Bracelet", EqpEntry.BodyShowTail => "Show Tail", EqpEntry.BodyDisableBreastPhysics => "Disable Breast Physics", - EqpEntry.BodyHasVfxObject => "Has Special Effects", + EqpEntry.BodyUsesEvpTable => "Uses EVP Table", EqpEntry.LegsEnabled => "Enabled", EqpEntry.LegsHideKneePads => "Hide Knee Pads", @@ -277,7 +277,7 @@ public static class Eqp EqpEntry._55 => "Unknown 55", EqpEntry.HeadShowHrothgarHat => "Show on Hrothgar", EqpEntry.HeadShowVieraHat => "Show on Viera", - EqpEntry.HeadHasVfxObject => "Has Special Effects", + EqpEntry.HeadUsesEvpTable => "Uses EVP Table", EqpEntry._59 => "Unknown 59", EqpEntry._60 => "Unknown 60", diff --git a/Penumbra/Import/TexToolsImporter.Archives.cs b/Penumbra/Import/TexToolsImporter.Archives.cs index 1b8a45fa..12f7428f 100644 --- a/Penumbra/Import/TexToolsImporter.Archives.cs +++ b/Penumbra/Import/TexToolsImporter.Archives.cs @@ -8,7 +8,11 @@ using Newtonsoft.Json.Linq; using OtterGui.Filesystem; using Penumbra.Mods; using SharpCompress.Archives; +using SharpCompress.Archives.Rar; +using SharpCompress.Archives.SevenZip; +using SharpCompress.Archives.Zip; using SharpCompress.Common; +using SharpCompress.Readers; namespace Penumbra.Import; @@ -30,7 +34,14 @@ public partial class TexToolsImporter _currentModName = modPackFile.Name; _currentGroupName = string.Empty; _currentOptionName = DefaultTexToolsData.Name; - _currentNumFiles = archive.Entries.Count( e => !e.IsDirectory ); + _currentNumFiles = + archive switch + { + RarArchive r => r.Entries.Count, + ZipArchive z => z.Entries.Count, + SevenZipArchive s => s.Entries.Count, + _ => archive.Entries.Count(), + }; PluginLog.Log( $" -> Importing {archive.Type} Archive." ); _currentModDirectory = Mod.CreateModFolder( _baseDirectory, baseName ); @@ -42,18 +53,20 @@ public partial class TexToolsImporter State = ImporterState.ExtractingModFiles; _currentFileIdx = 0; - foreach( var entry in archive.Entries ) + var reader = archive.ExtractAllEntries(); + + while(reader.MoveToNextEntry()) { _token.ThrowIfCancellationRequested(); - if( entry.IsDirectory ) + if( reader.Entry.IsDirectory ) { ++_currentFileIdx; continue; } - PluginLog.Log( " -> Extracting {0}", entry.Key ); - entry.WriteToDirectory( _currentModDirectory.FullName, options ); + PluginLog.Log( " -> Extracting {0}", reader.Entry.Key ); + reader.WriteEntryToDirectory( _currentModDirectory.FullName, options ); ++_currentFileIdx; } diff --git a/Penumbra/Interop/Resolver/PathResolver.AnimationState.cs b/Penumbra/Interop/Resolver/PathResolver.AnimationState.cs index ca282732..518e4a93 100644 --- a/Penumbra/Interop/Resolver/PathResolver.AnimationState.cs +++ b/Penumbra/Interop/Resolver/PathResolver.AnimationState.cs @@ -110,16 +110,19 @@ public unsafe partial class PathResolver var old = _animationLoadCollection; try { - var getGameObjectIdx = ( ( delegate* unmanaged< IntPtr, int >** )timeline )[ 0 ][ 28 ]; - var idx = getGameObjectIdx( timeline ); - if( idx >= 0 && idx < Dalamud.Objects.Length ) + if( timeline != IntPtr.Zero ) { - var obj = Dalamud.Objects[ idx ]; - _animationLoadCollection = obj != null ? IdentifyCollection( ( GameObject* )obj.Address ) : null; - } - else - { - _animationLoadCollection = null; + var getGameObjectIdx = ( ( delegate* unmanaged< IntPtr, int >** )timeline )[ 0 ][ 28 ]; + var idx = getGameObjectIdx( timeline ); + if( idx >= 0 && idx < Dalamud.Objects.Length ) + { + var obj = Dalamud.Objects[ idx ]; + _animationLoadCollection = obj != null ? IdentifyCollection( ( GameObject* )obj.Address ) : null; + } + else + { + _animationLoadCollection = null; + } } } finally diff --git a/Penumbra/Meta/Files/EvpFile.cs b/Penumbra/Meta/Files/EvpFile.cs index b6dcbb30..5b72c449 100644 --- a/Penumbra/Meta/Files/EvpFile.cs +++ b/Penumbra/Meta/Files/EvpFile.cs @@ -9,7 +9,8 @@ namespace Penumbra.Meta.Files; // NumModels x [ModelId:ushort] // Containing the relevant model IDs. Seems to be sorted. // NumModels x [DataArray]:512 Byte] -// Containing Flags in each byte, 0x01 set for Body, 0x02 set for Helmet. Unsure where the index into this array comes from. +// Containing Flags in each byte, 0x01 set for Body, 0x02 set for Helmet. +// Each flag corresponds to a mount row from the Mounts table and determines whether the mount disables the effect. public unsafe class EvpFile : MetaBaseFile { public const int FlagArraySize = 512; diff --git a/Penumbra/lib/DirectXTexC.dll b/Penumbra/lib/DirectXTexC.dll index 7a2d217a..083c20e9 100644 Binary files a/Penumbra/lib/DirectXTexC.dll and b/Penumbra/lib/DirectXTexC.dll differ diff --git a/Penumbra/lib/OtterTex.dll b/Penumbra/lib/OtterTex.dll index f0d0db79..44793977 100644 Binary files a/Penumbra/lib/OtterTex.dll and b/Penumbra/lib/OtterTex.dll differ