public override System.IO.Stream OpenResource( string resourceName, string groupName, bool searchGroupsIfNotFound, Resource resourceBeingLoaded )
{
string extension = System.IO.Path.GetExtension( resourceName ).Substring( 1 );
if ( extension == "xnb" )
{
return base.OpenResource( resourceName, groupName, searchGroupsIfNotFound, resourceBeingLoaded );
}
if ( Root.Instance.RenderSystem.ConfigOptions[ "Use Content Pipeline" ].Value == "Yes" )
{
if ( CodecManager.Instance.GetCodec( extension ).GetType().Name != "NullCodec" )
{
AxiomContentManager acm = new AxiomContentManager( (XnaRenderSystem)Root.Instance.RenderSystem, "" );
XFG.Texture2D texture = acm.Load<XFG.Texture2D>( resourceName );
return new XnaImageCodecStream( texture );
}
return base.OpenResource( resourceName, groupName, searchGroupsIfNotFound, resourceBeingLoaded );
}
return base.OpenResource( resourceName, groupName, searchGroupsIfNotFound, resourceBeingLoaded );
}
}