@@ -635,36 +635,29 @@ public async Task<int> TexDDSImporter(XivTex xivTex, IItem item, DirectoryInfo d
635
635
break ;
636
636
}
637
637
638
- if ( textureType == xivTex . TextureFormat )
639
- {
640
- xivTex . TextureFormat = textureType ;
641
- var uncompressedLength = ( int ) new FileInfo ( ddsFileDirectory . FullName ) . Length - 128 ;
642
- var newTex = new List < byte > ( ) ;
638
+ xivTex . TextureFormat = textureType ;
639
+ var uncompressedLength = ( int ) new FileInfo ( ddsFileDirectory . FullName ) . Length - 128 ;
640
+ var newTex = new List < byte > ( ) ;
643
641
644
- if ( ! xivTex . TextureTypeAndPath . Path . Contains ( ".atex" ) )
645
- {
646
- var DDSInfo = await DDS . ReadDDS ( br , xivTex , newWidth , newHeight , newMipCount ) ;
642
+ if ( ! xivTex . TextureTypeAndPath . Path . Contains ( ".atex" ) )
643
+ {
644
+ var DDSInfo = await DDS . ReadDDS ( br , xivTex , newWidth , newHeight , newMipCount ) ;
647
645
648
- newTex . AddRange ( _dat . MakeType4DatHeader ( xivTex , DDSInfo . mipPartOffsets , DDSInfo . mipPartCounts , uncompressedLength , newMipCount , newWidth , newHeight ) ) ;
649
- newTex . AddRange ( MakeTextureInfoHeader ( xivTex , newWidth , newHeight , newMipCount ) ) ;
650
- newTex . AddRange ( DDSInfo . compressedDDS ) ;
646
+ newTex . AddRange ( _dat . MakeType4DatHeader ( xivTex , DDSInfo . mipPartOffsets , DDSInfo . mipPartCounts , uncompressedLength , newMipCount , newWidth , newHeight ) ) ;
647
+ newTex . AddRange ( MakeTextureInfoHeader ( xivTex , newWidth , newHeight , newMipCount ) ) ;
648
+ newTex . AddRange ( DDSInfo . compressedDDS ) ;
651
649
652
- offset = await _dat . WriteToDat ( newTex , modEntry , xivTex . TextureTypeAndPath . Path ,
653
- item . ItemCategory , item . Name , xivTex . TextureTypeAndPath . DataFile , source , 4 ) ;
654
- }
655
- else
656
- {
657
- br . BaseStream . Seek ( 128 , SeekOrigin . Begin ) ;
658
- newTex . AddRange ( MakeTextureInfoHeader ( xivTex , newWidth , newHeight , newMipCount ) ) ;
659
- newTex . AddRange ( br . ReadBytes ( uncompressedLength ) ) ;
660
-
661
- offset = await _dat . ImportType2Data ( newTex . ToArray ( ) , item . Name , xivTex . TextureTypeAndPath . Path ,
662
- item . ItemCategory , source ) ;
663
- }
650
+ offset = await _dat . WriteToDat ( newTex , modEntry , xivTex . TextureTypeAndPath . Path ,
651
+ item . ItemCategory , item . Name , xivTex . TextureTypeAndPath . DataFile , source , 4 ) ;
664
652
}
665
653
else
666
654
{
667
- throw new Exception ( $ "Incorrect file type. Expected: { xivTex . TextureFormat } Given: { textureType } ") ;
655
+ br . BaseStream . Seek ( 128 , SeekOrigin . Begin ) ;
656
+ newTex . AddRange ( MakeTextureInfoHeader ( xivTex , newWidth , newHeight , newMipCount ) ) ;
657
+ newTex . AddRange ( br . ReadBytes ( uncompressedLength ) ) ;
658
+
659
+ offset = await _dat . ImportType2Data ( newTex . ToArray ( ) , item . Name , xivTex . TextureTypeAndPath . Path ,
660
+ item . ItemCategory , source ) ;
668
661
}
669
662
}
670
663
}
0 commit comments