public FileBase CreateFileAsFormat(FileFormat aFormat, FileChunkStorageType aChunkStorageType, CompressionType aCompressionType, uint aMaxChunks, uint aSingleMipChunkArea)
 {
     if (!this.CanBeExportedAsFormat(aFormat))
     {
         return((FileBase)null);
     }
     return(this.CreateFileAsFormatImpl(aFormat, aChunkStorageType, aCompressionType, aMaxChunks, aSingleMipChunkArea));
 }
        protected override FileBase CreateFileAsFormatImpl(FileFormat aFormat, FileChunkStorageType aChunkStorageType, CompressionType aCompressionType, uint aMaxChunks, uint aSingleMipChunkArea)
        {
            FileBase fileBase = (FileBase)null;

            switch (aFormat)
            {
            case FileFormat.General:
                fileBase = (FileBase) new GeneralFile(aChunkStorageType, this.ArchiveName);
                break;

            case FileFormat.DDS:
            case FileFormat.XBoxDDS:
                fileBase = (FileBase) new ImageDDSFile(aChunkStorageType, this.ArchiveName, aMaxChunks, aSingleMipChunkArea);
                break;

            case FileFormat.GNF:
                fileBase = (FileBase) new ImageGNFFile(aChunkStorageType, this.ArchiveName, aMaxChunks, aSingleMipChunkArea);
                break;
            }
            fileBase.LoadFromFile(this.looseFilename, aCompressionType);
            return(fileBase);
        }
示例#3
0
 protected override FileBase CreateFileAsFormatImpl(FileFormat aFormat, FileChunkStorageType aChunkStorageType, CompressionType aCompressionType, uint aMaxChunks, uint aSingleMipChunkArea)
 {
     this.EnsureDataLoaded();
     return(this.archivedFile);
 }
 public Archive(Archive.LoggingDelegate aMessageDelegate, Archive.LoggingDelegate aErrorDelegate, FileChunkStorageType aChunkStorageType)
 {
     this.ArchiveFormat       = FileFormat.General;
     this.ChunkStorageType    = aChunkStorageType;
     this.FileCompressionType = CompressionType.Default;
     this.MessageDelegate     = aMessageDelegate;
     this.ErrorDelegate       = aErrorDelegate;
 }
 protected abstract FileBase CreateFileAsFormatImpl(FileFormat aFormat, FileChunkStorageType aChunkStorageType, CompressionType aCompressionType, uint aMaxChunks, uint aSingleMipChunkArea);