Пример #1
0
 /// <summary>
 /// Called when graphics resources need to be loaded. Override this method to load any component-specific graphics resources.
 /// </summary>
 public virtual void LoadContent(ExtendedContentManager contentManager)
 {
     if (this.shaderAsset == null)
     {
         this.shaderAsset = contentManager.Load <Effect>(this.shaderAssetPath);
     }
 }
Пример #2
0
 public ContentLoader(string contentRoot, GraphicsDevice graphicsDevice, IServiceProvider provider)
 {
     mExtendedContentManager = new ExtendedContentManager(contentRoot, graphicsDevice);
     if (provider != null)
     {
         XnaContent = new ContentManager(provider, contentRoot);
     }
 }
        public GameBase(GameConfiguration configuration)
        {
            GameConfiguration = configuration;

            graphics = new GraphicsDeviceManager(this)
            {
                PreferredBackBufferWidth  = GameConfiguration.PreferredBackBufferWidth,
                PreferredBackBufferHeight = GameConfiguration.PreferredBackBufferHeight
            };
            graphics.ApplyChanges();

            Content = new ExtendedContentManager(this, GameConfiguration.ContentRootDirectory);
        }
Пример #4
0
        /// <summary>
        /// Called when graphics resources need to be loaded. Override this method to load any component-specific graphics resources.
        /// </summary>
        public override void LoadContent(ExtendedContentManager contentManager)
        {
            this.spriteTexture = contentManager.Load <Texture2D>(this.spriteTexturePath);
            uint[] pixelData = null;

            if (this.computeSpriteShape)
            {
                pixelData = new uint[this.spriteTexture.Width * this.spriteTexture.Height];
                this.spriteTexture.GetData(pixelData);
                this.spriteWorldVertices = PolygonTools.CreatePolygon(pixelData, this.spriteTexture.Width);
            }

            this.optionMapFlagsShader.LoadContent(contentManager);

            if (this.spriteTextureBoundingBox == null)
            {
                this.spriteTextureBoundingBox = this.spriteTexture.Bounds;
            }

            if (this.spriteNormalTexturePath != null)
            {
                this.spriteNormalTexture = contentManager.Load <Texture2D>(this.spriteNormalTexturePath);
            }
            else
            {
                this.spriteNormalTexture = new Texture2D(contentManager.Game.GraphicsDevice, this.spriteTextureBoundingBox.Value.Width, this.spriteTextureBoundingBox.Value.Height);

                if (pixelData == null)
                {
                    pixelData = new uint[this.spriteTexture.Width * this.spriteTexture.Height];
                    this.spriteTexture.GetData(pixelData);
                }

                // Convert the image to black (saving Alpha channel)
                for (int i = 0; i < pixelData.Length; i++)
                {
                    pixelData[i] = 0;
                }

                this.spriteNormalTexture.SetData(pixelData);
            }
        }
 /// <summary>
 /// Called when graphics resources need to be loaded. Override this method to load any component-specific graphics resources.
 /// </summary>
 /// <param name="contentManager">The content manager.</param>
 public void LoadContent(ExtendedContentManager contentManager)
 {
     this.postProcessEffect.LoadContent(contentManager);
 }
 public override void LoadContent(ExtendedContentManager contentManager)
 {
     this.browserTexture = new Texture2D(this.World.Game.GraphicsDevice, this.browserWidth, this.browserHeight, false, SurfaceFormat.Bgra32);
 }
        public GameBase()
        {
            graphics = new GraphicsDeviceManager(this);

            Content = new ExtendedContentManager(this, GameConfiguration.ContentRootDirectory);
        }
Пример #8
0
 /// <summary>
 /// Called when graphics resources need to be loaded. Override this method to load any component-specific graphics resources.
 /// </summary>
 /// <param name="contentManager">The content manager.</param>
 public override void LoadContent(ExtendedContentManager contentManager)
 {
     this.shadowMapShader.LoadContent(contentManager);
     base.LoadContent(contentManager);
 }
Пример #9
0
 /// <summary>
 /// Called when graphics resources need to be loaded. Override this method to load any component-specific graphics resources.
 /// </summary>
 public override void LoadContent(ExtendedContentManager contentManager)
 {
     this.optionMapFlagsShader.LoadContent(contentManager);
 }