public static byte[] getFileResourceBytes( string path )
{
#if FNA
path = path.Replace( ".mgfxo", ".fxb" );
#endif
byte[] bytes;
try
{
using( var stream = TitleContainer.OpenStream( path ) )
{
bytes = new byte[stream.Length];
stream.Read( bytes, 0, bytes.Length );
}
}
catch( Exception e )
{
var txt = string.Format( "OpenStream failed to find file at path: {0}. Did you add it to the Content folder?", path );
throw new Exception( txt, e );
}
return bytes;
}
}