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

◆ DrawSurfaceBG_Hallow()

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

Definition at line 77115 of file Main.cs.

77116 {
77117 //IL_0150: Unknown result type (might be due to invalid IL or missing references)
77118 //IL_015f: Unknown result type (might be due to invalid IL or missing references)
77119 //IL_016b: Unknown result type (might be due to invalid IL or missing references)
77120 //IL_0171: Unknown result type (might be due to invalid IL or missing references)
77121 //IL_02ee: Unknown result type (might be due to invalid IL or missing references)
77122 //IL_02fd: Unknown result type (might be due to invalid IL or missing references)
77123 //IL_0309: Unknown result type (might be due to invalid IL or missing references)
77124 //IL_030f: Unknown result type (might be due to invalid IL or missing references)
77125 //IL_048a: Unknown result type (might be due to invalid IL or missing references)
77126 //IL_0499: Unknown result type (might be due to invalid IL or missing references)
77127 //IL_04a5: Unknown result type (might be due to invalid IL or missing references)
77128 //IL_04ab: Unknown result type (might be due to invalid IL or missing references)
77129 if (bgTexIndexes[0] > 0)
77130 {
77131 bgScale = 1.25f;
77132 bgParallax = 0.4;
77133 bgTopY = (int)(backgroundTopMagicNumber * 1800.0 + 1500.0) + (int)scAdj + pushBGTopHack;
77137 bgWidthScaled = (int)((float)backgroundWidth[bgTexIndexes[0]] * bgScale);
77138 SkyManager.Instance.DrawToDepth(spriteBatch, 1.2f / (float)bgParallax);
77139 bgStartX = (int)(0.0 - Math.IEEERemainder((double)screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
77140 if (gameMenu)
77141 {
77142 bgTopY = 320 + pushBGTopHack;
77143 }
77145 if ((double)screenPosition.Y < worldSurface * 16.0 + 16.0)
77146 {
77147 for (int i = 0; i < bgLoops; i++)
77148 {
77149 spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[0]].Value, new Vector2((float)(bgStartX + bgWidthScaled * i), (float)bgTopY), GetBackgroundRect(bgTexIndexes[0]), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, (SpriteEffects)0, 0f);
77150 }
77151 }
77152 }
77153 if (bgTexIndexes[1] > 0)
77154 {
77155 bgScale = 1.31f;
77156 bgParallax = 0.43;
77157 bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1750.0) + (int)scAdj + pushBGTopHack;
77161 bgWidthScaled = (int)((float)backgroundWidth[bgTexIndexes[1]] * bgScale);
77162 SkyManager.Instance.DrawToDepth(spriteBatch, 1f / (float)bgParallax);
77163 bgStartX = (int)(0.0 - Math.IEEERemainder((double)screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
77164 if (gameMenu)
77165 {
77166 bgTopY = 400 + pushBGTopHack;
77167 bgStartX -= 80;
77168 }
77170 if ((double)screenPosition.Y < worldSurface * 16.0 + 16.0)
77171 {
77172 for (int j = 0; j < bgLoops; j++)
77173 {
77174 spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[1]].Value, new Vector2((float)(bgStartX + bgWidthScaled * j), (float)bgTopY), GetBackgroundRect(bgTexIndexes[1]), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, (SpriteEffects)0, 0f);
77175 }
77176 }
77177 }
77178 if (bgTexIndexes[2] <= 0)
77179 {
77180 return;
77181 }
77182 bgScale = 1.34f;
77183 bgParallax = 0.49;
77184 bgTopY = (int)(backgroundTopMagicNumber * 2100.0 + 2000.0) + (int)scAdj + pushBGTopHack;
77188 bgWidthScaled = (int)((float)backgroundWidth[bgTexIndexes[2]] * bgScale);
77189 SkyManager.Instance.DrawToDepth(spriteBatch, 1f / (float)bgParallax);
77190 bgStartX = (int)(0.0 - Math.IEEERemainder((double)screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
77191 if (gameMenu)
77192 {
77193 bgTopY = 480 + pushBGTopHack;
77194 bgStartX -= 120;
77195 }
77197 if ((double)screenPosition.Y < worldSurface * 16.0 + 16.0)
77198 {
77199 for (int k = 0; k < bgLoops; k++)
77200 {
77201 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);
77202 }
77203 }
77204 }
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
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.Main.gameMenu, Terraria.Main.GetBackgroundRect(), 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: