Axiom.RenderSystems.Xna.XnaResourceGroupManager.OpenResource C# (CSharp) 메소드

OpenResource() 공개 메소드

public OpenResource ( string resourceName, string groupName, bool searchGroupsIfNotFound, Axiom.Core.Resource resourceBeingLoaded ) : Stream
resourceName string
groupName string
searchGroupsIfNotFound bool
resourceBeingLoaded Axiom.Core.Resource
리턴 System.IO.Stream
        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 );
        }
    }
XnaResourceGroupManager