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

◆ DrawSurfaceBG_Corrupt()

void Terraria.Main.DrawSurfaceBG_Corrupt ( double backgroundTopMagicNumber,
float bgGlobalScaleMultiplier,
int pushBGTopHack,
int[] bgTexIndexes )
inlineprivate

Definition at line 57864 of file Main.cs.

57865 {
57866 bgScale = 1.25f;
57867 bgParallax = 0.4;
57868 bgTopY = (int)(backgroundTopMagicNumber * 1800.0 + 1500.0) + (int)scAdj + pushBGTopHack;
57873 {
57874 return;
57875 }
57876 bgWidthScaled = (int)((float)backgroundWidth[bgTexIndexes[0]] * bgScale);
57877 SkyManager.Instance.DrawToDepth(spriteBatch, 1f / (float)bgParallax);
57878 bgStartX = (int)(0.0 - Math.IEEERemainder((double)screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
57879 if (gameMenu)
57880 {
57881 bgTopY = 320 + pushBGTopHack;
57882 }
57883 if (bgTexIndexes[0] == 56)
57884 {
57885 bgTopY -= 100;
57886 }
57888 if ((double)screenPosition.Y < worldSurface * 16.0 + 16.0)
57889 {
57890 for (int i = 0; i < bgLoops; i++)
57891 {
57893 }
57894 }
57895 bgScale = 1.31f;
57896 bgParallax = 0.43;
57897 bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1750.0) + (int)scAdj + pushBGTopHack;
57901 bgWidthScaled = (int)((float)backgroundWidth[bgTexIndexes[1]] * bgScale);
57902 SkyManager.Instance.DrawToDepth(spriteBatch, 1f / (float)bgParallax);
57903 bgStartX = (int)(0.0 - Math.IEEERemainder((double)screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
57904 if (gameMenu)
57905 {
57906 bgTopY = 400 + pushBGTopHack;
57907 bgStartX -= 80;
57908 }
57909 if (bgTexIndexes[0] == 56)
57910 {
57911 bgTopY -= 100;
57912 }
57913 if (bgWidthScaled == 0)
57914 {
57915 bgWidthScaled = 1;
57916 }
57918 if ((double)screenPosition.Y < worldSurface * 16.0 + 16.0)
57919 {
57920 try
57921 {
57923 if (value != null)
57924 {
57925 for (int j = 0; j < bgLoops; j++)
57926 {
57928 }
57929 }
57930 }
57931 catch
57932 {
57934 }
57935 }
57936 bgScale = 1.34f;
57937 bgParallax = 0.49;
57938 bgTopY = (int)(backgroundTopMagicNumber * 2100.0 + 2000.0) + (int)scAdj + pushBGTopHack;
57942 bgWidthScaled = (int)((float)backgroundWidth[bgTexIndexes[2]] * bgScale);
57943 if (bgWidthScaled == 0)
57944 {
57945 bgWidthScaled = 150;
57946 }
57947 SkyManager.Instance.DrawToDepth(spriteBatch, 1f / (float)bgParallax);
57948 bgStartX = (int)(0.0 - Math.IEEERemainder((double)screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
57949 if (gameMenu)
57950 {
57951 bgTopY = 480 + pushBGTopHack;
57952 bgStartX -= 120;
57953 }
57954 if (bgTexIndexes[0] == 56)
57955 {
57956 bgTopY -= 100;
57957 }
57959 if ((double)screenPosition.Y < worldSurface * 16.0 + 16.0)
57960 {
57961 for (int k = 0; k < bgLoops; k++)
57962 {
57964 }
57965 }
57966 }
static double IEEERemainder(double x, double y)
Definition Math.cs:679
static Asset< Texture2D >[] Background
float scAdj
Definition Main.cs:2585
double bgParallax
Definition Main.cs:956
static int bgWidthScaled
Definition Main.cs:2575
void LoadBackground(int i)
Definition Main.cs:55998
static SpriteBatch spriteBatch
Definition Main.cs:974
static double worldSurface
Definition Main.cs:1272
int bgTopY
Definition Main.cs:966
static int[] backgroundWidth
Definition Main.cs:1665
void SetBackgroundOffsets(int backgroundID, double backgroundTopMagicNumber, int pushBGTopHack)
Definition Main.cs:57314
int bgLoops
Definition Main.cs:960
int bgStartX
Definition Main.cs:958
static Microsoft.Xna.Framework.Color ColorOfSurfaceBackgroundsModified
Definition Main.cs:2581
static int[] backgroundHeight
Definition Main.cs:1667
static float bgScale
Definition Main.cs:2573
static int screenWidth
Definition Main.cs:1719
static bool gameMenu
Definition Main.cs:1926

References Terraria.GameContent.TextureAssets.Background, Terraria.Main.backgroundHeight, Terraria.Main.backgroundWidth, Terraria.Main.bgLoops, Terraria.Main.bgParallax, Terraria.Main.bgScale, Terraria.Main.bgStartX, Terraria.Main.bgTopY, Terraria.Main.bgWidthScaled, Terraria.Main.ColorOfSurfaceBackgroundsModified, Terraria.Main.gameMenu, System.Text.RegularExpressions.i, System.Math.IEEERemainder(), Terraria.Graphics.Effects.SkyManager.Instance, Terraria.Main.LoadBackground(), Terraria.Main.scAdj, Terraria.Main.screenWidth, Terraria.Main.SetBackgroundOffsets(), Terraria.Main.spriteBatch, System.value, Microsoft.Xna.Framework.Graphics.Vector2, and Terraria.Main.worldSurface.

Referenced by Terraria.Main.DrawSurfaceBG().