public ShadowCasterMap(PrecisionSettings precision, GraphicsDeviceManager graphics, SpriteBatch spriteBatch)
        {
            this.PrecisionSettings = precision;
            switch (this.PrecisionSettings)
            {
            case PrecisionSettings.VeryLow:
                this.precisionRatio = 0.1f;
                break;

            case PrecisionSettings.Low:
                this.precisionRatio = 0.25f;
                break;

            case PrecisionSettings.Normal:
                this.precisionRatio = 0.5f;
                break;

            case PrecisionSettings.High:
                this.precisionRatio = 0.8f;
                break;

            case PrecisionSettings.VeryHigh:
                this.precisionRatio = 1f;
                break;
            }
            this.graphics      = graphics;
            this.spriteBatch   = spriteBatch;
            this.Map           = new RenderTarget2D(graphics.GraphicsDevice, (int)(this.graphics.PreferredBackBufferWidth * this.precisionRatio), (int)(this.graphics.PreferredBackBufferHeight * this.precisionRatio));
            this.pixelSizeHLSL = new Vector2(1f / (float)this.Map.Width, 1f / (float)this.Map.Height);
        }
Пример #2
0
 public ShadowCasterMap(PrecisionSettings precision, GraphicsDevice graphics, SpriteBatch spriteBatch)
 {
     this.PrecisionSettings = precision;
     switch (this.PrecisionSettings)
     {
         case PrecisionSettings.VeryLow:
             this.precisionRatio = 0.1f;
             break;
         case PrecisionSettings.Low:
             this.precisionRatio = 0.25f;
             break;
         case PrecisionSettings.Normal:
             this.precisionRatio = 0.5f;
             break;
         case PrecisionSettings.High:
             this.precisionRatio = 0.8f;
             break;
         case PrecisionSettings.VeryHigh:
             this.precisionRatio = 1f;
             break;
     }
     this.graphics = graphics;
     this.spriteBatch = spriteBatch;
     this.Map = new RenderTarget2D(graphics, (int)(this.graphics.Viewport.Width * this.precisionRatio), (int)(this.graphics.Viewport.Height * this.precisionRatio));
     this.pixelSizeHLSL = new Vector2(1f / (float)this.Map.Width, 1f / (float)this.Map.Height);
 }