TModLoader v1.4.4.9
TModLoader 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 77467 of file Main.cs.

77468 {
77469 //IL_0179: Unknown result type (might be due to invalid IL or missing references)
77470 //IL_0194: Unknown result type (might be due to invalid IL or missing references)
77471 //IL_019e: Unknown result type (might be due to invalid IL or missing references)
77472 //IL_01aa: Unknown result type (might be due to invalid IL or missing references)
77473 //IL_01b0: Unknown result type (might be due to invalid IL or missing references)
77474 //IL_0535: Unknown result type (might be due to invalid IL or missing references)
77475 //IL_0550: Unknown result type (might be due to invalid IL or missing references)
77476 //IL_055a: Unknown result type (might be due to invalid IL or missing references)
77477 //IL_0566: Unknown result type (might be due to invalid IL or missing references)
77478 //IL_056c: Unknown result type (might be due to invalid IL or missing references)
77479 //IL_034f: Unknown result type (might be due to invalid IL or missing references)
77480 //IL_036a: Unknown result type (might be due to invalid IL or missing references)
77481 //IL_0374: Unknown result type (might be due to invalid IL or missing references)
77482 //IL_0380: Unknown result type (might be due to invalid IL or missing references)
77483 //IL_0386: Unknown result type (might be due to invalid IL or missing references)
77484 bgScale = 1.25f;
77485 bgParallax = 0.4;
77486 bgTopY = (int)(backgroundTopMagicNumber * 1800.0 + 1500.0) + (int)scAdj + pushBGTopHack;
77491 {
77492 return;
77493 }
77494 bgWidthScaled = (int)((float)backgroundWidth[bgTexIndexes[0]] * bgScale);
77495 SkyManager.Instance.DrawToDepth(spriteBatch, 1f / (float)bgParallax);
77496 bgStartX = (int)(0.0 - Math.IEEERemainder((double)screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
77497 if (gameMenu)
77498 {
77499 bgTopY = 320 + pushBGTopHack;
77500 }
77501 if (bgTexIndexes[0] == 56)
77502 {
77503 bgTopY -= 100;
77504 }
77506 if ((double)screenPosition.Y < worldSurface * 16.0 + 16.0)
77507 {
77508 for (int i = 0; i < bgLoops; i++)
77509 {
77510 spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[0]].Value, new Vector2((float)(bgStartX + bgWidthScaled * i), (float)bgTopY), (Rectangle?)new Rectangle(0, 0, backgroundWidth[bgTexIndexes[0]], backgroundHeight[bgTexIndexes[0]]), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, (SpriteEffects)0, 0f);
77511 }
77512 }
77513 bgScale = 1.31f;
77514 bgParallax = 0.43;
77515 bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1750.0) + (int)scAdj + pushBGTopHack;
77519 bgWidthScaled = (int)((float)backgroundWidth[bgTexIndexes[1]] * bgScale);
77520 SkyManager.Instance.DrawToDepth(spriteBatch, 1f / (float)bgParallax);
77521 bgStartX = (int)(0.0 - Math.IEEERemainder((double)screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
77522 if (gameMenu)
77523 {
77524 bgTopY = 400 + pushBGTopHack;
77525 bgStartX -= 80;
77526 }
77527 if (bgTexIndexes[0] == 56)
77528 {
77529 bgTopY -= 100;
77530 }
77531 if (bgWidthScaled == 0)
77532 {
77533 bgWidthScaled = 1;
77534 }
77536 if ((double)screenPosition.Y < worldSurface * 16.0 + 16.0)
77537 {
77538 try
77539 {
77540 Texture2D value = TextureAssets.Background[bgTexIndexes[1]].Value;
77541 if (value != null)
77542 {
77543 for (int j = 0; j < bgLoops; j++)
77544 {
77545 spriteBatch.Draw(value, new Vector2((float)(bgStartX + bgWidthScaled * j), (float)bgTopY), (Rectangle?)new Rectangle(0, 0, backgroundWidth[bgTexIndexes[1]], backgroundHeight[bgTexIndexes[1]]), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, (SpriteEffects)1, 0f);
77546 }
77547 }
77548 }
77549 catch
77550 {
77552 }
77553 }
77554 bgScale = 1.34f;
77555 bgParallax = 0.49;
77556 bgTopY = (int)(backgroundTopMagicNumber * 2100.0 + 2000.0) + (int)scAdj + pushBGTopHack;
77560 bgWidthScaled = (int)((float)backgroundWidth[bgTexIndexes[2]] * bgScale);
77561 if (bgWidthScaled == 0)
77562 {
77563 bgWidthScaled = 150;
77564 }
77565 SkyManager.Instance.DrawToDepth(spriteBatch, 1f / (float)bgParallax);
77566 bgStartX = (int)(0.0 - Math.IEEERemainder((double)screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
77567 if (gameMenu)
77568 {
77569 bgTopY = 480 + pushBGTopHack;
77570 bgStartX -= 120;
77571 }
77572 if (bgTexIndexes[0] == 56)
77573 {
77574 bgTopY -= 100;
77575 }
77577 if ((double)screenPosition.Y < worldSurface * 16.0 + 16.0)
77578 {
77579 for (int k = 0; k < bgLoops; k++)
77580 {
77581 spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[2]].Value, new Vector2((float)(bgStartX + bgWidthScaled * k), (float)bgTopY), (Rectangle?)new Rectangle(0, 0, backgroundWidth[bgTexIndexes[2]], backgroundHeight[bgTexIndexes[2]]), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, (SpriteEffects)0, 0f);
77582 }
77583 }
77584 }
static Asset< Texture2D >[] Background
float scAdj
Definition Main.cs:2668
double bgParallax
Definition Main.cs:1025
static int bgWidthScaled
Definition Main.cs:2658
void LoadBackground(int i)
Definition Main.cs:75357
static Color ColorOfSurfaceBackgroundsModified
Definition Main.cs:2664
static SpriteBatch spriteBatch
Definition Main.cs:1043
static double worldSurface
The y-coordinate of the top of the dirt layer, in tile coordinates. Corresponds to 0' on the Depth Me...
Definition Main.cs:1351
static int[] backgroundWidth
Definition Main.cs:1810
void SetBackgroundOffsets(int backgroundID, double backgroundTopMagicNumber, int pushBGTopHack)
Definition Main.cs:76863
int bgLoops
Definition Main.cs:1029
int bgStartX
Definition Main.cs:1027
static int[] backgroundHeight
Definition Main.cs:1812
static float bgScale
Definition Main.cs:2656
static int screenWidth
Definition Main.cs:1868
static bool gameMenu
Definition Main.cs:2076

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, Terraria.Graphics.Effects.SkyManager.Instance, Terraria.Main.LoadBackground(), Terraria.Main.scAdj, Terraria.Main.screenWidth, Terraria.Main.SetBackgroundOffsets(), Terraria.Main.spriteBatch, and Terraria.Main.worldSurface.

Referenced by Terraria.Main.DrawSurfaceBG().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: