Skip to content

Instantly share code, notes, and snippets.

@clarvalon
Created April 22, 2021 20:26
Show Gist options
  • Save clarvalon/3e0ca11f0744ca5718fdf18b48af1182 to your computer and use it in GitHub Desktop.
Save clarvalon/3e0ca11f0744ca5718fdf18b48af1182 to your computer and use it in GitHub Desktop.
ContentTypeReaderManager.cs Tweak for FNA WASM
// WASM BUG: https://github.com/mono/mono/issues/20258
// We need to find the types manually as per: https://gist.github.com/TheSpydog/e94c8c23c01615a5a3b2cc1a0857415c
// Following types needed for loading SpriteFonts
if (l_readerType == null)
{
if (readerTypeString == "Microsoft.Xna.Framework.Content.SpriteFontReader, FNA")
{
l_readerType = typeof(SpriteFontReader);
}
if (readerTypeString == "Microsoft.Xna.Framework.Content.Texture2DReader")
{
l_readerType = typeof(Texture2DReader);
}
if (readerTypeString == "Xna.Framework.Content.ListReader`1[[Microsoft.Xna.Framework.Rectangle, FNA]]")
{
l_readerType = typeof(ListReader<Rectangle>);
}
if (readerTypeString == "Microsoft.Xna.Framework.Content.RectangleReader")
{
l_readerType = typeof(RectangleReader);
}
if (readerTypeString == "Microsoft.Xna.Framework.Content.ListReader`1[[System.Char, System.Private.CoreLib]]")
{
l_readerType = typeof(ListReader<char>);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment