mirror of
https://github.com/crskycode/GARbro.git
synced 2026-06-27 06:07:35 +08:00
(IResource.CanWrite): new property.
(ArchiveFormat.CanCreate): renamed to CanWrite.
This commit is contained in:
@@ -104,6 +104,7 @@ namespace GameRes
|
||||
public override string Tag { get { return "WAV"; } }
|
||||
public override string Description { get { return "Wave audio format"; } }
|
||||
public override uint Signature { get { return 0x46464952; } } // 'RIFF'
|
||||
public override bool CanWrite { get { return true; } }
|
||||
|
||||
static readonly HashSet<ushort> EmbeddedFormats = new HashSet<ushort> {
|
||||
0x674f, 0x6751, 0x6771, // Vorbis
|
||||
|
||||
@@ -76,6 +76,9 @@ namespace GameRes
|
||||
/// or zero if it could vary.</summary>
|
||||
public abstract uint Signature { get; }
|
||||
|
||||
/// <summary>Whether resource creation is supported by implementation.</summary>
|
||||
public virtual bool CanWrite { get { return false; } }
|
||||
|
||||
/// <summary>Signatures peculiar to the resource (the one above is also included here).</summary>
|
||||
public IEnumerable<uint> Signatures { get; protected set; }
|
||||
|
||||
@@ -169,8 +172,9 @@ namespace GameRes
|
||||
{
|
||||
public override string Type { get { return "archive"; } }
|
||||
|
||||
public virtual bool CanCreate { get { return false; } }
|
||||
|
||||
/// <summary>
|
||||
/// Whether archive file system could contain subdirectories.
|
||||
/// </summary>
|
||||
public abstract bool IsHierarchic { get; }
|
||||
|
||||
public abstract ArcFile TryOpen (ArcView view);
|
||||
|
||||
@@ -51,6 +51,7 @@ namespace GameRes
|
||||
public override string Tag { get { return "BMP"; } }
|
||||
public override string Description { get { return "Windows device independent bitmap"; } }
|
||||
public override uint Signature { get { return 0; } }
|
||||
public override bool CanWrite { get { return true; } }
|
||||
|
||||
#pragma warning disable 649
|
||||
[ImportMany(typeof(IBmpExtension))]
|
||||
|
||||
@@ -35,9 +35,10 @@ namespace GameRes
|
||||
[Export(typeof(ImageFormat))]
|
||||
public class JpegFormat : ImageFormat
|
||||
{
|
||||
public override string Tag { get { return "JPEG"; } }
|
||||
public override string Tag { get { return "JPEG"; } }
|
||||
public override string Description { get { return "JPEG image file format"; } }
|
||||
public override uint Signature { get { return 0; } }
|
||||
public override uint Signature { get { return 0; } }
|
||||
public override bool CanWrite { get { return true; } }
|
||||
|
||||
public int Quality { get; set; }
|
||||
|
||||
|
||||
@@ -36,9 +36,10 @@ namespace GameRes
|
||||
[Export(typeof(ImageFormat))]
|
||||
public class PngFormat : ImageFormat
|
||||
{
|
||||
public override string Tag { get { return "PNG"; } }
|
||||
public override string Tag { get { return "PNG"; } }
|
||||
public override string Description { get { return "Portable Network Graphics image"; } }
|
||||
public override uint Signature { get { return 0x474e5089; } }
|
||||
public override uint Signature { get { return 0x474e5089; } }
|
||||
public override bool CanWrite { get { return true; } }
|
||||
|
||||
public override ImageData Read (Stream file, ImageMetaData info)
|
||||
{
|
||||
|
||||
@@ -47,9 +47,10 @@ namespace GameRes
|
||||
[Export(typeof(ImageFormat))]
|
||||
public class TgaFormat : ImageFormat
|
||||
{
|
||||
public override string Tag { get { return "TGA"; } }
|
||||
public override string Tag { get { return "TGA"; } }
|
||||
public override string Description { get { return "Truevision TGA image"; } }
|
||||
public override uint Signature { get { return 0; } }
|
||||
public override uint Signature { get { return 0; } }
|
||||
public override bool CanWrite { get { return true; } }
|
||||
|
||||
public override ImageData Read (Stream stream, ImageMetaData metadata)
|
||||
{
|
||||
|
||||
@@ -35,9 +35,10 @@ namespace GameRes
|
||||
[Export(typeof(ImageFormat))]
|
||||
public class TifFormat : ImageFormat
|
||||
{
|
||||
public override string Tag { get { return "TIFF"; } }
|
||||
public override string Tag { get { return "TIFF"; } }
|
||||
public override string Description { get { return "Tagged Image File Format"; } }
|
||||
public override uint Signature { get { return 0; } }
|
||||
public override uint Signature { get { return 0; } }
|
||||
public override bool CanWrite { get { return true; } }
|
||||
|
||||
public TifFormat ()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user