mirror of
https://github.com/riperiperi/FreeSO
synced 2026-08-13 20:26:13 -04:00
MPL per-file was used in older project files, but should apply to the whole project, so having it there was redundant.
39 lines
1.2 KiB
C#
39 lines
1.2 KiB
C#
using FSO.Content.Framework;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
|
|
namespace FSO.Content.Codecs
|
|
{
|
|
public static class SmartCodec
|
|
{
|
|
public static Dictionary<string, IGenericContentCodec> CodecForExtension = new Dictionary<string, IGenericContentCodec>
|
|
{
|
|
{".iff", new IffCodec() },
|
|
{".flr", new IffCodec() },
|
|
{".wll", new IffCodec() },
|
|
{".bcf", new BCFCodec() },
|
|
{".skn", new SKNCodec() },
|
|
{".cmx", new CMXCodec() },
|
|
{".bmf", new BMFCodec() },
|
|
{".cfp", new CFPCodec() },
|
|
{".bmp", new TextureCodec() },
|
|
{".tga", new TextureCodec() },
|
|
{".jpg", new TextureCodec() },
|
|
{".wav", new SFXCodec() },
|
|
{".mp3", new SFXCodec() },
|
|
{".xa", new SFXCodec() },
|
|
{".utk", new SFXCodec() }
|
|
};
|
|
|
|
public static object Decode(Stream stream, string extension)
|
|
{
|
|
extension = extension.ToLowerInvariant();
|
|
IGenericContentCodec codec = null;
|
|
if (CodecForExtension.TryGetValue(extension, out codec))
|
|
{
|
|
return codec.GenDecode(stream);
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
}
|