Пример #1
0
 // Token: 0x06000D72 RID: 3442 RVA: 0x003E4C14 File Offset: 0x003E2E14
 public void DrawTick()
 {
     Monitor.Enter(this._captureLock);
     if (this._activeSettings == null)
     {
         return;
     }
     if (this._renderQueue.Count > 0)
     {
         CaptureCamera.CaptureChunk captureChunk = this._renderQueue.Dequeue();
         this._graphics.SetRenderTarget(this._frameBuffer);
         this._graphics.Clear(Microsoft.Xna.Framework.Color.Transparent);
         Main.instance.DrawCapture(captureChunk.Area, this._activeSettings);
         if (this._activeSettings.UseScaling)
         {
             this._graphics.SetRenderTarget(this._scaledFrameBuffer);
             this._graphics.Clear(Microsoft.Xna.Framework.Color.Transparent);
             this._spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, this._downscaleSampleState, DepthStencilState.Default, RasterizerState.CullNone);
             this._spriteBatch.Draw(this._frameBuffer, new Microsoft.Xna.Framework.Rectangle(0, 0, this._scaledFrameBuffer.Width, this._scaledFrameBuffer.Height), Microsoft.Xna.Framework.Color.White);
             this._spriteBatch.End();
             this._graphics.SetRenderTarget(null);
             this._scaledFrameBuffer.GetData <byte>(this._scaledFrameData, 0, this._scaledFrameBuffer.Width * this._scaledFrameBuffer.Height * 4);
             this.DrawBytesToBuffer(this._scaledFrameData, this._outputData, this._scaledFrameBuffer.Width, this._outputImageSize.Width, captureChunk.ScaledArea);
         }
         else
         {
             this._graphics.SetRenderTarget(null);
             this.SaveImage(this._frameBuffer, captureChunk.ScaledArea.Width, captureChunk.ScaledArea.Height, ImageFormat.Png, this._activeSettings.OutputName, string.Concat(new object[]
             {
                 captureChunk.Area.X,
                 "-",
                 captureChunk.Area.Y,
                 ".png"
             }));
         }
         this._tilesProcessed += (float)(captureChunk.Area.Width * captureChunk.Area.Height);
     }
     if (this._renderQueue.Count == 0)
     {
         this.FinishCapture();
     }
     Monitor.Exit(this._captureLock);
 }
Пример #2
0
 public void DrawTick()
 {
     Monitor.Enter(this._captureLock);
     if (this._activeSettings == null)
     {
         return;
     }
     if (this._renderQueue.Count > 0)
     {
         CaptureCamera.CaptureChunk captureChunk = this._renderQueue.Dequeue();
         this._graphics.SetRenderTarget(this._frameBuffer);
         this._graphics.Clear(Color.get_Transparent());
         Main.instance.DrawCapture(captureChunk.Area, this._activeSettings);
         if (this._activeSettings.UseScaling)
         {
             this._graphics.SetRenderTarget(this._scaledFrameBuffer);
             this._graphics.Clear(Color.get_Transparent());
             this._spriteBatch.Begin((SpriteSortMode)0, (BlendState)BlendState.AlphaBlend, this._downscaleSampleState, (DepthStencilState)DepthStencilState.Default, (RasterizerState)RasterizerState.CullNone);
             this._spriteBatch.Draw((Texture2D)this._frameBuffer, new Rectangle(0, 0, ((Texture2D)this._scaledFrameBuffer).get_Width(), ((Texture2D)this._scaledFrameBuffer).get_Height()), Color.get_White());
             this._spriteBatch.End();
             this._graphics.SetRenderTarget((RenderTarget2D)null);
             ((Texture2D)this._scaledFrameBuffer).GetData <byte>((M0[])this._scaledFrameData, 0, ((Texture2D)this._scaledFrameBuffer).get_Width() * ((Texture2D)this._scaledFrameBuffer).get_Height() * 4);
             this.DrawBytesToBuffer(this._scaledFrameData, this._outputData, ((Texture2D)this._scaledFrameBuffer).get_Width(), this._outputImageSize.Width, captureChunk.ScaledArea);
         }
         else
         {
             this._graphics.SetRenderTarget((RenderTarget2D)null);
             this.SaveImage((Texture2D)this._frameBuffer, (int)captureChunk.ScaledArea.Width, (int)captureChunk.ScaledArea.Height, ImageFormat.Png, this._activeSettings.OutputName, captureChunk.Area.X.ToString() + "-" + (object)(int)captureChunk.Area.Y + ".png");
         }
         this._tilesProcessed = this._tilesProcessed + (float)(captureChunk.Area.Width * captureChunk.Area.Height);
     }
     if (this._renderQueue.Count == 0)
     {
         this.FinishCapture();
     }
     Monitor.Exit(this._captureLock);
 }
Пример #3
0
        public void DrawTick()
        {
            Monitor.Enter(this._captureLock);
            if (this._activeSettings == null)
            {
                return;
            }
            bool notRetro = Lighting.NotRetro;

            if (this._renderQueue.Count > 0)
            {
                CaptureCamera.CaptureChunk captureChunk = this._renderQueue.Dequeue();
                this._graphics.SetRenderTarget((RenderTarget2D)null);
                this._graphics.Clear(Microsoft.Xna.Framework.Color.Transparent);
                TileDrawing tilesRenderer = Main.instance.TilesRenderer;
                Microsoft.Xna.Framework.Rectangle area = captureChunk.Area;
                int left = area.Left;
                area = captureChunk.Area;
                int right = area.Right;
                area = captureChunk.Area;
                int top = area.Top;
                area = captureChunk.Area;
                int bottom = area.Bottom;
                tilesRenderer.PrepareForAreaDrawing(left, right, top, bottom);
                Main.instance.TilePaintSystem.PrepareAllRequests();
                this._graphics.SetRenderTarget(this._frameBuffer);
                this._graphics.Clear(Microsoft.Xna.Framework.Color.Transparent);
                if (notRetro)
                {
                    Microsoft.Xna.Framework.Color clearColor = this._activeSettings.CaptureBackground ? Microsoft.Xna.Framework.Color.Black : Microsoft.Xna.Framework.Color.Transparent;
                    Filters.Scene.BeginCapture(this._filterFrameBuffer1, clearColor);
                    Main.instance.DrawCapture(captureChunk.Area, this._activeSettings);
                    Filters.Scene.EndCapture(this._frameBuffer, this._filterFrameBuffer1, this._filterFrameBuffer2, clearColor);
                }
                else
                {
                    Main.instance.DrawCapture(captureChunk.Area, this._activeSettings);
                }
                if (this._activeSettings.UseScaling)
                {
                    this._graphics.SetRenderTarget(this._scaledFrameBuffer);
                    this._graphics.Clear(Microsoft.Xna.Framework.Color.Transparent);
                    this._spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, this._downscaleSampleState, DepthStencilState.Default, RasterizerState.CullNone);
                    this._spriteBatch.Draw((Texture2D)this._frameBuffer, new Microsoft.Xna.Framework.Rectangle(0, 0, this._scaledFrameBuffer.Width, this._scaledFrameBuffer.Height), Microsoft.Xna.Framework.Color.White);
                    this._spriteBatch.End();
                    this._graphics.SetRenderTarget((RenderTarget2D)null);
                    this._scaledFrameBuffer.GetData <byte>(this._scaledFrameData, 0, this._scaledFrameBuffer.Width * this._scaledFrameBuffer.Height * 4);
                    this.DrawBytesToBuffer(this._scaledFrameData, this._outputData, this._scaledFrameBuffer.Width, this._outputImageSize.Width, captureChunk.ScaledArea);
                }
                else
                {
                    this._graphics.SetRenderTarget((RenderTarget2D)null);
                    this.SaveImage((Texture2D)this._frameBuffer, captureChunk.ScaledArea.Width, captureChunk.ScaledArea.Height, ImageFormat.Png, this._activeSettings.OutputName, captureChunk.Area.X.ToString() + "-" + (object)captureChunk.Area.Y + ".png");
                }
                this._tilesProcessed += (float)(captureChunk.Area.Width * captureChunk.Area.Height);
            }
            if (this._renderQueue.Count == 0)
            {
                this.FinishCapture();
            }
            Monitor.Exit(this._captureLock);
        }