diff --git a/GameRes/Audio.cs b/GameRes/Audio.cs index 00f59f9d..25ae4e3f 100644 --- a/GameRes/Audio.cs +++ b/GameRes/Audio.cs @@ -197,8 +197,8 @@ namespace GameRes return null; } - public static AudioFormat Wav { get { return s_WavFormat.Value; } } + public static AudioFormat Wav => s_WavFormat.Value; - static readonly Lazy s_WavFormat = new Lazy (() => FormatCatalog.Instance.AudioFormats.FirstOrDefault (x => x.Tag == "WAV")); + static readonly ResourceInstance s_WavFormat = new ResourceInstance ("WAV"); } } diff --git a/GameRes/Image.cs b/GameRes/Image.cs index aab3b796..f52ce64c 100644 --- a/GameRes/Image.cs +++ b/GameRes/Image.cs @@ -189,15 +189,15 @@ namespace GameRes return FormatCatalog.Instance.ImageFormats.FirstOrDefault (x => x.Tag == tag); } - static readonly Lazy s_JpegFormat = new Lazy (() => FindByTag ("JPEG")); - static readonly Lazy s_PngFormat = new Lazy (() => FindByTag ("PNG")); - static readonly Lazy s_BmpFormat = new Lazy (() => FindByTag ("BMP")); - static readonly Lazy s_TgaFormat = new Lazy (() => FindByTag ("TGA")); + static readonly ResourceInstance s_JpegFormat = new ResourceInstance ("JPEG"); + static readonly ResourceInstance s_PngFormat = new ResourceInstance ("PNG"); + static readonly ResourceInstance s_BmpFormat = new ResourceInstance ("BMP"); + static readonly ResourceInstance s_TgaFormat = new ResourceInstance ("TGA"); - public static ImageFormat Jpeg { get { return s_JpegFormat.Value; } } - public static ImageFormat Png { get { return s_PngFormat.Value; } } - public static ImageFormat Bmp { get { return s_BmpFormat.Value; } } - public static ImageFormat Tga { get { return s_TgaFormat.Value; } } + public static ImageFormat Jpeg => s_JpegFormat.Value; + public static ImageFormat Png => s_PngFormat.Value; + public static ImageFormat Bmp => s_BmpFormat.Value; + public static ImageFormat Tga => s_TgaFormat.Value; /// /// Desereialize color map from stream, consisting of specified number of