Created
April 22, 2021 20:26
-
-
Save clarvalon/3e0ca11f0744ca5718fdf18b48af1182 to your computer and use it in GitHub Desktop.
ContentTypeReaderManager.cs Tweak for FNA WASM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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