freeso/TSOClient/tso.content/Codecs/SmartCodec.cs
riperiperi b57ebbd141 Cleanup: Remove most unused usings and MPL per-file licenses
MPL per-file was used in older project files, but should apply to the whole project, so having it there was redundant.
2023-11-25 03:45:29 +00:00

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;
}
}
}