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

◆ SetWaveMaskData()

void Terraria.GameContent.Liquid.LiquidRenderer.SetWaveMaskData ( ref Texture2D texture)
inline

Definition at line 847 of file LiquidRenderer.cs.

848 {
849 try
850 {
851 if (texture == null || texture.Width < _drawArea.Height || texture.Height < _drawArea.Width)
852 {
853 Console.WriteLine("WaveMaskData texture recreated. {0}x{1}", _drawArea.Height, _drawArea.Width);
854 if (texture != null)
855 {
856 try
857 {
858 texture.Dispose();
859 }
860 catch
861 {
862 }
863 }
864 texture = new Texture2D(Main.instance.GraphicsDevice, _drawArea.Height, _drawArea.Width, mipMap: false, SurfaceFormat.Color);
865 }
866 texture.SetData(0, new Rectangle(0, 0, _drawArea.Height, _drawArea.Width), _waveMask, 0, _drawArea.Width * _drawArea.Height);
867 }
868 catch
869 {
870 texture = new Texture2D(Main.instance.GraphicsDevice, _drawArea.Height, _drawArea.Width, mipMap: false, SurfaceFormat.Color);
871 texture.SetData(0, new Rectangle(0, 0, _drawArea.Height, _drawArea.Width), _waveMask, 0, _drawArea.Width * _drawArea.Height);
872 }
873 }
static void WriteLine()
Definition Console.cs:733

References Terraria.GameContent.Liquid.LiquidRenderer._drawArea, Terraria.GameContent.Liquid.LiquidRenderer._waveMask, Microsoft.Xna.Framework.Rectangle.Height, Terraria.Main.instance, Microsoft.Xna.Framework.Graphics.Texture2D, Microsoft.Xna.Framework.Rectangle.Width, and System.Console.WriteLine().