/// <summary> /// Construct a new legacy skin instance. /// </summary> /// <param name="skin">The model for this skin.</param> /// <param name="storage">A storage for looking up files within this skin using user-facing filenames.</param> /// <param name="resources">Access to raw game resources.</param> /// <param name="configurationStream">An optional stream containing the contents of a skin.ini file.</param> protected LegacySkin(SkinInfo skin, [CanBeNull] IResourceStore <byte[]> storage, [CanBeNull] IStorageResourceProvider resources, [CanBeNull] Stream configurationStream) : base(skin, resources, configurationStream) { if (storage != null) { var samples = resources?.AudioManager?.GetSampleStore(storage); if (samples != null) { samples.PlaybackConcurrency = OsuGameBase.SAMPLE_CONCURRENCY; } Samples = samples; Textures = new TextureStore(resources?.CreateTextureLoaderStore(storage)); (storage as ResourceStore <byte[]>)?.AddExtension("ogg"); } // todo: this shouldn't really be duplicated here (from ManiaLegacySkinTransformer). we need to come up with a better solution. hasKeyTexture = new Lazy <bool>(() => this.GetAnimation( lookupForMania <string>(new LegacyManiaSkinConfigurationLookup(4, LegacyManiaSkinConfigurationLookups.KeyImage, 0))?.Value ?? "mania-key1", true, true) != null); }
public IResourceStore <TextureUpload> CreateTextureLoaderStore(IResourceStore <byte[]> underlyingStore) => resources.CreateTextureLoaderStore(underlyingStore);