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

◆ DrawSurfaceBG_Mushroom()

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

Definition at line 76417 of file Main.cs.

76418 {
76419 //IL_0068: Unknown result type (might be due to invalid IL or missing references)
76420 //IL_006e: Unknown result type (might be due to invalid IL or missing references)
76421 //IL_0073: Unknown result type (might be due to invalid IL or missing references)
76422 //IL_0074: Unknown result type (might be due to invalid IL or missing references)
76423 //IL_007a: Unknown result type (might be due to invalid IL or missing references)
76424 //IL_007f: Unknown result type (might be due to invalid IL or missing references)
76425 //IL_0080: Unknown result type (might be due to invalid IL or missing references)
76426 //IL_0087: Unknown result type (might be due to invalid IL or missing references)
76427 //IL_008c: Unknown result type (might be due to invalid IL or missing references)
76428 //IL_00a1: Unknown result type (might be due to invalid IL or missing references)
76429 //IL_00a6: Unknown result type (might be due to invalid IL or missing references)
76430 //IL_00d6: Unknown result type (might be due to invalid IL or missing references)
76431 //IL_00de: Unknown result type (might be due to invalid IL or missing references)
76432 //IL_00ef: Unknown result type (might be due to invalid IL or missing references)
76433 //IL_0352: Unknown result type (might be due to invalid IL or missing references)
76434 //IL_0357: Unknown result type (might be due to invalid IL or missing references)
76435 //IL_0387: Unknown result type (might be due to invalid IL or missing references)
76436 //IL_038f: Unknown result type (might be due to invalid IL or missing references)
76437 //IL_03a0: Unknown result type (might be due to invalid IL or missing references)
76438 //IL_0312: Unknown result type (might be due to invalid IL or missing references)
76439 //IL_0321: Unknown result type (might be due to invalid IL or missing references)
76440 //IL_032a: Unknown result type (might be due to invalid IL or missing references)
76441 //IL_0330: Unknown result type (might be due to invalid IL or missing references)
76442 //IL_0601: Unknown result type (might be due to invalid IL or missing references)
76443 //IL_0606: Unknown result type (might be due to invalid IL or missing references)
76444 //IL_0636: Unknown result type (might be due to invalid IL or missing references)
76445 //IL_063f: Unknown result type (might be due to invalid IL or missing references)
76446 //IL_0651: Unknown result type (might be due to invalid IL or missing references)
76447 //IL_05c1: Unknown result type (might be due to invalid IL or missing references)
76448 //IL_05d0: Unknown result type (might be due to invalid IL or missing references)
76449 //IL_05d9: Unknown result type (might be due to invalid IL or missing references)
76450 //IL_05df: Unknown result type (might be due to invalid IL or missing references)
76451 //IL_086a: Unknown result type (might be due to invalid IL or missing references)
76452 //IL_0879: Unknown result type (might be due to invalid IL or missing references)
76453 //IL_0882: Unknown result type (might be due to invalid IL or missing references)
76454 //IL_0888: Unknown result type (might be due to invalid IL or missing references)
76455 float num = 0.33f;
76456 Vector3 vector = default(Vector3);
76457 ((Vector3)(ref vector))._002Ector(0.1f, 0.15f, 0.3f);
76458 float num2 = 0.5f;
76459 Vector3 vector2 = default(Vector3);
76460 ((Vector3)(ref vector2))._002Ector(0.1f, 0.175f, 0.3f);
76461 float num3 = 0.75f;
76462 Vector3 vector3 = default(Vector3);
76463 ((Vector3)(ref vector3))._002Ector(0.125f, 0.2f, 0.3f);
76464 num = 0.5f;
76465 num2 = 0.625f;
76466 num3 = 0.75f;
76467 vector *= 3f;
76468 vector2 *= 3f;
76469 vector3 *= 3f;
76470 float num4 = (float)(int)((Color)(ref ColorOfSurfaceBackgroundsModified)).A / 255f;
76472 float num5 = (float)rand.Next(28, 42) * 0.001f;
76473 num5 += (float)(270 - mouseTextColor) / 5000f;
76474 float x = vector.X;
76475 float num6 = vector.Y + num5 / 2f;
76476 float num7 = vector.Z + num5;
76477 x *= 255f;
76478 num6 *= 255f;
76479 num7 *= 255f;
76480 x *= num * num4;
76481 num6 *= num * num4;
76482 num7 *= num * num4;
76483 if (x > 255f)
76484 {
76485 x = 255f;
76486 }
76487 if (num6 > 255f)
76488 {
76489 num6 = 255f;
76490 }
76491 if (num7 > 255f)
76492 {
76493 num7 = 255f;
76494 }
76495 if (x > (float)(int)((Color)(ref colorOfSurfaceBackgroundsModified)).R)
76496 {
76498 }
76499 if (num6 > (float)(int)((Color)(ref colorOfSurfaceBackgroundsModified)).G)
76500 {
76502 }
76503 if (num7 > (float)(int)((Color)(ref colorOfSurfaceBackgroundsModified)).B)
76504 {
76506 }
76507 bgScale = 1.25f;
76510 bgWidthScaled = (int)((float)backgroundWidth[bgTexIndexes[0]] * bgScale);
76511 bgParallax = 0.4;
76513 SkyManager.Instance.DrawToDepth(spriteBatch, 1f / (float)bgParallax);
76514 bgStartX = (int)(0.0 - Math.IEEERemainder((double)screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
76515 bgTopY = (int)(backgroundTopMagicNumber * 1800.0 + 1400.0) + (int)scAdj + pushBGTopHack;
76517 if (gameMenu)
76518 {
76519 bgTopY = 320 + pushBGTopHack;
76520 }
76521 if (bgWidthScaled != 0)
76522 {
76524 }
76525 if (TextureAssets.Background[bgTexIndexes[0]].Value == null)
76526 {
76527 return;
76528 }
76529 if ((double)screenPosition.Y < worldSurface * 16.0 + 16.0)
76530 {
76531 for (int i = 0; i < bgLoops; i++)
76532 {
76533 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);
76534 }
76535 }
76537 num5 = (float)rand.Next(28, 42) * 0.001f;
76538 num5 += (float)(270 - mouseTextColor) / 5000f;
76539 x = vector2.X;
76540 num6 = vector2.Y + num5 / 2f;
76541 num7 = vector2.Z + num5;
76542 x *= 255f;
76543 num6 *= 255f;
76544 num7 *= 255f;
76545 x *= num2 * num4;
76546 num6 *= num2 * num4;
76547 num7 *= num2 * num4;
76548 if (x > 255f)
76549 {
76550 x = 255f;
76551 }
76552 if (num6 > 255f)
76553 {
76554 num6 = 255f;
76555 }
76556 if (num7 > 255f)
76557 {
76558 num7 = 255f;
76559 }
76560 if (x > (float)(int)((Color)(ref colorOfSurfaceBackgroundsModified)).R)
76561 {
76563 }
76564 if (num6 > (float)(int)((Color)(ref colorOfSurfaceBackgroundsModified)).G)
76565 {
76567 }
76568 if (num7 > (float)(int)((Color)(ref colorOfSurfaceBackgroundsModified)).B)
76569 {
76571 }
76572 bgScale = 1.32f;
76575 bgWidthScaled = (int)((float)backgroundWidth[bgTexIndexes[1]] * bgScale);
76576 bgParallax = 0.43;
76578 SkyManager.Instance.DrawToDepth(spriteBatch, 1f / (float)bgParallax);
76579 bgStartX = (int)(0.0 - Math.IEEERemainder((double)screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
76580 bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1675.0) + (int)scAdj + pushBGTopHack;
76582 if (gameMenu)
76583 {
76584 bgTopY = 400 + pushBGTopHack;
76585 bgStartX -= 80;
76586 }
76587 if (bgWidthScaled == 0)
76588 {
76589 return;
76590 }
76592 if ((double)screenPosition.Y < worldSurface * 16.0 + 16.0)
76593 {
76594 for (int j = 0; j < bgLoops; j++)
76595 {
76596 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);
76597 }
76598 }
76600 num5 = (float)rand.Next(28, 42) * 0.001f;
76601 num5 += (float)(270 - mouseTextColor) / 3000f;
76602 x = vector3.X;
76603 num6 = vector3.Y + num5 / 2f;
76604 num7 = vector3.Z + num5;
76605 x *= 255f * num4 * num3;
76606 num6 *= 255f * num4 * num3;
76607 num7 *= 255f * num4 * num3;
76608 if (x > 255f)
76609 {
76610 x = 255f;
76611 }
76612 if (num6 > 255f)
76613 {
76614 num6 = 255f;
76615 }
76616 if (num7 > 255f)
76617 {
76618 num7 = 255f;
76619 }
76620 if (x > (float)(int)((Color)(ref colorOfSurfaceBackgroundsModified)).R)
76621 {
76623 }
76624 if (num6 > (float)(int)((Color)(ref colorOfSurfaceBackgroundsModified)).G)
76625 {
76627 }
76628 if (num7 > (float)(int)((Color)(ref colorOfSurfaceBackgroundsModified)).B)
76629 {
76631 }
76632 bgScale = 1.36f;
76635 bgWidthScaled = (int)((float)backgroundWidth[bgTexIndexes[2]] * bgScale);
76636 bgParallax = 0.49;
76638 SkyManager.Instance.DrawToDepth(spriteBatch, 1f / (float)bgParallax);
76639 bgStartX = (int)(0.0 - Math.IEEERemainder((double)screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2));
76640 bgTopY = (int)(backgroundTopMagicNumber * 2100.0 + 1950.0) + (int)scAdj + pushBGTopHack;
76642 if (gameMenu)
76643 {
76644 bgTopY = 480 + pushBGTopHack;
76645 bgStartX -= 120;
76646 }
76647 if (bgWidthScaled == 0)
76648 {
76649 return;
76650 }
76652 if ((double)screenPosition.Y < worldSurface * 16.0 + 16.0)
76653 {
76654 for (int k = 0; k < bgLoops; k++)
76655 {
76656 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);
76657 }
76658 }
76659 SkyManager.Instance.DrawToDepth(spriteBatch, 1f);
76660 }
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 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
static byte mouseTextColor
A value that oscillates between 190 and 255. It is used to drive the slight pulsing color effect seen...
Definition Main.cs:1904
int bgLoops
Definition Main.cs:1029
int bgStartX
Definition Main.cs:1027
Rectangle? GetBackgroundRect(int backgroundTextureIndex)
Definition Main.cs:77586
static UnifiedRandom rand
Definition Main.cs:2758
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.Graphics.Light.Color, Terraria.Main.ColorOfSurfaceBackgroundsModified, Terraria.Main.gameMenu, Terraria.Main.GetBackgroundRect(), Terraria.Graphics.Effects.SkyManager.Instance, Terraria.Main.LoadBackground(), Terraria.Main.mouseTextColor, Terraria.Main.rand, 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: