Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ HandleUseReqest()

override void Terraria.GameContent.AnOutlinedDrawRenderTargetContent.HandleUseReqest ( GraphicsDevice device,
SpriteBatch spriteBatch )
inlineprotectedinherited

Definition at line 24 of file AnOutlinedDrawRenderTargetContent.cs.

25 {
26 Effect pixelShader = Main.pixelShader;
27 if (_coloringShader == null)
28 {
29 _coloringShader = pixelShader.CurrentTechnique.Passes["ColorOnly"];
30 }
31 new Rectangle(0, 0, width, height);
35 device.Clear(Color.Transparent);
37 DrawTheContent(spriteBatch);
38 spriteBatch.End();
40 device.Clear(Color.Transparent);
43 int num = 2;
44 int num2 = num * 2;
45 for (int i = -num2; i <= num2; i += num)
46 {
47 for (int j = -num2; j <= num2; j += num)
48 {
49 if (Math.Abs(i) + Math.Abs(j) == num2)
50 {
51 spriteBatch.Draw(_helperTarget, new Vector2(i, j), Color.Black);
52 }
53 }
54 }
55 num2 = num;
56 for (int k = -num2; k <= num2; k += num)
57 {
58 for (int l = -num2; l <= num2; l += num)
59 {
60 if (Math.Abs(k) + Math.Abs(l) == num2)
61 {
62 spriteBatch.Draw(_helperTarget, new Vector2(k, l), _borderColor);
63 }
64 }
65 }
66 pixelShader.CurrentTechnique.Passes[0].Apply();
68 spriteBatch.End();
69 device.SetRenderTarget(null);
70 _wasPrepared = true;
71 }
static readonly BlendState AlphaBlend
Definition BlendState.cs:36
unsafe EffectTechnique CurrentTechnique
Definition Effect.cs:34
void Clear(ClearOptions options, Vector4 color, float depth, int stencil)
unsafe void SetRenderTarget(RenderTargetCube renderTarget, CubeMapFace cubeMapFace)
static readonly RasterizerState CullCounterClockwise
static readonly SamplerState PointClamp
void Draw(Texture2D texture, Vector2 position, Color color)
static double Abs(double value)
void PrepareARenderTarget_AndListenToEvents(ref RenderTarget2D target, GraphicsDevice device, int neededWidth, int neededHeight, RenderTargetUsage usage)
void PrepareARenderTarget_WithoutListeningToEvents(ref RenderTarget2D target, GraphicsDevice device, int neededWidth, int neededHeight, RenderTargetUsage usage)
static Color Transparent
Definition Color.cs:76

References Terraria.GameContent.AnOutlinedDrawRenderTargetContent._borderColor, Terraria.GameContent.AnOutlinedDrawRenderTargetContent._coloringShader, Terraria.GameContent.AnOutlinedDrawRenderTargetContent._helperTarget, Terraria.GameContent.ARenderTargetContentByRequest._target, Terraria.GameContent.ARenderTargetContentByRequest._wasPrepared, System.Math.Abs(), Microsoft.Xna.Framework.Graphics.BlendState.AlphaBlend, Microsoft.Xna.Framework.Graphics.EffectPass.Apply(), Microsoft.Xna.Framework.Graphics.SpriteBatch.Begin(), Microsoft.Xna.Framework.Color.Black, Microsoft.Xna.Framework.Graphics.GraphicsDevice.Clear(), Microsoft.Xna.Framework.Graphics.RasterizerState.CullCounterClockwise, Microsoft.Xna.Framework.Graphics.Effect.CurrentTechnique, Microsoft.Xna.Framework.Graphics.SpriteBatch.Draw(), Terraria.GameContent.AnOutlinedDrawRenderTargetContent.DrawTheContent(), Microsoft.Xna.Framework.Graphics.SpriteBatch.End(), Terraria.GameContent.AnOutlinedDrawRenderTargetContent.height, Microsoft.Xna.Framework.Graphics.DepthStencilState.None, Microsoft.Xna.Framework.Graphics.EffectTechnique.Passes, Terraria.Main.pixelShader, Microsoft.Xna.Framework.Graphics.SamplerState.PointClamp, Terraria.GameContent.ARenderTargetContentByRequest.PrepareARenderTarget_AndListenToEvents(), Terraria.GameContent.ARenderTargetContentByRequest.PrepareARenderTarget_WithoutListeningToEvents(), Microsoft.Xna.Framework.Graphics.GraphicsDevice.SetRenderTarget(), Microsoft.Xna.Framework.Color.Transparent, Microsoft.Xna.Framework.Graphics.Vector2, Microsoft.Xna.Framework.Color.White, Terraria.GameContent.AnOutlinedDrawRenderTargetContent.width, and Microsoft.Xna.Framework.Vector2.Zero.