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

◆ DrawSurfaceBG_Forest()

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

Definition at line 77636 of file Main.cs.

77637 {
77638 //IL_0536: Unknown result type (might be due to invalid IL or missing references)
77639 //IL_0545: Unknown result type (might be due to invalid IL or missing references)
77640 //IL_0551: Unknown result type (might be due to invalid IL or missing references)
77641 //IL_0557: Unknown result type (might be due to invalid IL or missing references)
77642 //IL_0769: Unknown result type (might be due to invalid IL or missing references)
77643 //IL_0778: Unknown result type (might be due to invalid IL or missing references)
77644 //IL_0784: Unknown result type (might be due to invalid IL or missing references)
77645 //IL_078a: Unknown result type (might be due to invalid IL or missing references)
77646 //IL_0357: Unknown result type (might be due to invalid IL or missing references)
77647 //IL_0366: Unknown result type (might be due to invalid IL or missing references)
77648 //IL_0372: Unknown result type (might be due to invalid IL or missing references)
77649 //IL_0378: Unknown result type (might be due to invalid IL or missing references)
77650 bgScale = 1.25f;
77651 bgParallax = 0.4;
77652 bgTopY = (int)(backgroundTopMagicNumber * 1800.0 + 1500.0) + (int)scAdj + pushBGTopHack;
77653 if (bgTexIndexes[0] == 91)
77654 {
77655 bgParallax = 0.27000001072883606;
77656 bgScale = 1.2f;
77657 }
77658 if (bgTexIndexes[0] == 173)
77659 {
77660 bgParallax = 0.25;
77661 bgScale = 1.3f;
77662 }
77663 if (bgTexIndexes[0] == 178)
77664 {
77665 bgParallax = 0.30000001192092896;
77666 bgScale = 1.2f;
77667 }
77668 if (bgTexIndexes[0] == 184)
77669 {
77670 bgParallax = 0.25;
77671 bgScale = 1.2f;
77672 }
77673 if (bgTexIndexes[0] == 282)
77674 {
77675 bgScale = 1.4f;
77676 }
77679 SkyManager.Instance.DrawToDepth(spriteBatch, 1f / (float)bgParallax);
77680 if (bgTexIndexes[0] >= 0)
77681 {
77684 bgWidthScaled = (int)((float)backgroundWidth[bgTexIndexes[0]] * bgScale);
77685 bgStartX = (int)(0.0 - Math.IEEERemainder((double)screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
77686 if (bgTexIndexes[0] == 91)
77687 {
77688 bgTopY = (int)(backgroundTopMagicNumber * 1600.0 + 1400.0) + (int)scAdj + pushBGTopHack;
77689 }
77690 if (bgTexIndexes[0] == 173)
77691 {
77692 bgTopY = (int)(backgroundTopMagicNumber * 1600.0 + 1400.0) + (int)scAdj + pushBGTopHack;
77693 }
77694 if (bgTexIndexes[0] == 184)
77695 {
77696 bgTopY = (int)(backgroundTopMagicNumber * 1600.0 + 1400.0) + (int)scAdj + pushBGTopHack;
77697 }
77698 if (gameMenu)
77699 {
77700 bgTopY = 320 + pushBGTopHack;
77701 }
77702 if (bgTexIndexes[0] == 50)
77703 {
77704 bgTopY -= 50;
77705 }
77706 if (bgTexIndexes[0] == 53)
77707 {
77708 bgTopY -= 100;
77709 }
77710 if (bgTexIndexes[0] == 91)
77711 {
77712 bgTopY += 200;
77713 }
77714 if (bgTexIndexes[0] == 173)
77715 {
77716 bgTopY += 200;
77717 }
77718 if (bgTexIndexes[0] == 178)
77719 {
77720 bgTopY += 75;
77721 }
77723 if ((double)screenPosition.Y < worldSurface * 16.0 + 16.0)
77724 {
77725 for (int i = 0; i < bgLoops; i++)
77726 {
77727 if (bgTexIndexes[0] != -1)
77728 {
77730 if (bgTexIndexes[0] == 173)
77731 {
77732 int num2 = (int)(GetBackgroundCounter() / 10);
77733 num2 %= 4;
77734 int num3 = 251 + num2;
77737 }
77738 if (asset.Value != null)
77739 {
77740 spriteBatch.Draw(asset.Value, new Vector2((float)(bgStartX + bgWidthScaled * i), (float)bgTopY), GetBackgroundRect(bgTexIndexes[0]), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, (SpriteEffects)0, 0f);
77741 }
77742 }
77743 }
77744 }
77745 }
77746 if (bgTexIndexes[1] >= 0)
77747 {
77749 bgScale = 1.31f;
77751 bgWidthScaled = (int)((float)backgroundWidth[bgTexIndexes[1]] * bgScale);
77752 if (bgWidthScaled == 0)
77753 {
77754 bgWidthScaled = 1;
77755 }
77756 bgParallax = 0.43;
77758 SkyManager.Instance.DrawToDepth(spriteBatch, 1f / (float)bgParallax);
77759 bgStartX = (int)(0.0 - Math.IEEERemainder((double)screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
77760 bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1750.0) + (int)scAdj + pushBGTopHack;
77761 if (gameMenu)
77762 {
77763 bgTopY = 400 + pushBGTopHack;
77764 bgStartX -= 80;
77765 }
77766 if (bgTexIndexes[1] == 51)
77767 {
77768 bgTopY -= 50;
77769 }
77770 if (bgTexIndexes[1] == 54)
77771 {
77772 bgTopY -= 100;
77773 }
77775 if ((double)screenPosition.Y < worldSurface * 16.0 + 16.0)
77776 {
77777 for (int j = 0; j < bgLoops; j++)
77778 {
77779 spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[1]].Value, new Vector2((float)(bgStartX + bgWidthScaled * j), (float)bgTopY), GetBackgroundRect(bgTexIndexes[1]), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, (SpriteEffects)1, 0f);
77780 }
77781 }
77782 }
77783 if (bgTexIndexes[2] < 0)
77784 {
77785 return;
77786 }
77788 bgScale = 1.34f;
77790 bgParallax = 0.49;
77792 SkyManager.Instance.DrawToDepth(spriteBatch, 1f / (float)bgParallax);
77793 if (bgTexIndexes[0] == 91)
77794 {
77795 bgScale = 1.3f;
77797 bgParallax = 0.42;
77798 }
77799 if (bgTexIndexes[2] < 0 && WorldGen.drunkWorldGen)
77800 {
77801 return;
77802 }
77803 bgWidthScaled = (int)((float)backgroundWidth[bgTexIndexes[2]] * bgScale);
77804 if (bgWidthScaled == 0)
77805 {
77806 bgWidthScaled = 1;
77807 }
77808 bgStartX = (int)(0.0 - Math.IEEERemainder((double)screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
77809 bgTopY = (int)(backgroundTopMagicNumber * 2100.0 + 2000.0) + (int)scAdj + pushBGTopHack;
77810 if (gameMenu)
77811 {
77812 bgTopY = 480 + pushBGTopHack;
77813 bgStartX -= 120;
77814 }
77815 if (bgTexIndexes[2] == 52)
77816 {
77817 bgTopY -= 50;
77818 }
77819 if (bgTexIndexes[2] == 55)
77820 {
77821 bgTopY -= 100;
77822 }
77823 if (bgTexIndexes[2] == 92)
77824 {
77825 bgTopY += 150;
77826 }
77828 if ((double)screenPosition.Y < worldSurface * 16.0 + 16.0)
77829 {
77830 for (int k = 0; k < bgLoops; k++)
77831 {
77832 spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[2]].Value, new Vector2((float)(bgStartX + bgWidthScaled * k), (float)bgTopY), GetBackgroundRect(bgTexIndexes[2]), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, (SpriteEffects)0, 0f);
77833 }
77834 }
77835 }
static Asset< Texture2D >[] Background
float scAdj
Definition Main.cs:2668
double bgParallax
Definition Main.cs:1025
static int bgWidthScaled
Definition Main.cs:2658
uint GetBackgroundCounter()
Definition Main.cs:77627
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 Vector2 screenPosition
The position of the top left corner of the screen in world coordinates. Modify in M:Terraria....
Definition Main.cs:1864
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
Rectangle? GetBackgroundRect(int backgroundTextureIndex)
Definition Main.cs:77586
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.backgroundWidth, Terraria.Main.bgLoops, Terraria.Main.bgParallax, Terraria.Main.bgScale, Terraria.Main.bgStartX, Terraria.Main.bgTopY, Terraria.Main.bgWidthScaled, Terraria.Main.ColorOfSurfaceBackgroundsModified, Terraria.WorldGen.drunkWorldGen, Terraria.Main.gameMenu, Terraria.Main.GetBackgroundCounter(), Terraria.Main.GetBackgroundRect(), Terraria.Graphics.Effects.SkyManager.Instance, Terraria.Main.LoadBackground(), Terraria.Main.scAdj, Terraria.Main.screenPosition, 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: