Definition at line 50915 of file Main.cs.
50916 {
50925 {
50927 }
50933 {
50935 }
50937 {
50939 }
50941 {
50943 }
50945 float num8 = (float)((
double)screenPosition.Y -
worldSurface * 16.0) / 300f;
50947 {
50949 }
50950 else if (
num8 > 1f)
50951 {
50953 }
50960 {
50964 }
50966 {
50970 }
50972 {
50976 }
50985 {
50987 }
50989 {
50991 {
50993 {
50995 }
50996 }
50997 else
50998 {
51000 }
51001 }
51003 {
51005 }
51007 {
51011 }
51013 {
51015 }
51017 {
51019 }
51020 int[]
array =
new int[6];
51021 int[]
array2 =
new int[6];
51022 for (
int i = 0;
i < 2;
i++)
51023 {
51026 {
51028 }
51029 int[]
array3 =
new int[6];
51031 {
51032 case 0:
51039 break;
51040 case 1:
51042 {
51047 }
51049 {
51054 }
51056 {
51061 }
51062 else
51063 {
51068 }
51070 break;
51071 case 2:
51077 break;
51078 case 3:
51084 break;
51085 case 4:
51091 break;
51092 case 5:
51098 break;
51099 case 6:
51105 break;
51106 case 7:
51112 break;
51113 case 8:
51119 break;
51120 case 9:
51126 break;
51127 case 10:
51133 break;
51134 case 11:
51136 {
51142 }
51143 else
51144 {
51150 }
51151 break;
51152 }
51154 {
51156 }
51158 {
51160 }
51162 {
51164 }
51172 {
51173 for (
int j = 0;
j < 6;
j++)
51174 {
51176 }
51177 }
51178 else
51179 {
51180 for (
int k = 0;
k < 6;
k++)
51181 {
51183 }
51184 }
51185 }
51192 {
51193 for (
int m = 0;
m <
num3 / 16;
m++)
51194 {
51197 {
51199 }
51203 color.R = (byte)((
float)(int)color.
R *
num4);
51204 color.G = (byte)((
float)(int)color.
G *
num5);
51205 color.B = (byte)((
float)(int)color.
B *
num6);
51208 {
51215 }
51216 }
51217 }
51221 bool flag = false;
51222 bool flag2 =
false;
51225 {
51229 if (
worldSurface * 16.0 < (
double)(screenPosition.Y - 16f))
51230 {
51233 }
51234 else
51235 {
51238 }
51239 if (
rockLayer * 16.0 < (
double)(Camera.ScaledPosition.Y + 600f))
51240 {
51243 }
51246 {
51248 }
51250 {
51252 {
51254 {
51256 {
51262 {
51264 }
51266 {
51268 {
51270 tileBatch.Draw(
TextureAssets.
Background[
array[1]].Value,
new Vector2(
bgStartX +
num3 *
n + 16 *
num20 +
num18,
bgStartY +
backgroundHeight[
array2[1]] *
num19 + 16 *
num21) +
vector,
new Microsoft.
Xna.
Framework.
Rectangle(16 *
num20 +
num18 + 16, 16 *
num21, 16, 16), vertices,
Vector2.
Zero, 1f,
SpriteEffects.None);
51271 }
51273 {
51275 try
51276 {
51278 {
51281 int width = 4;
51282 int height = 4;
51286 {
51287 case 0:
51289 {
51291 }
51292 break;
51293 case 1:
51294 width = 8;
51297 {
51299 }
51300 break;
51301 case 2:
51304 {
51306 }
51307 break;
51308 case 3:
51309 height = 8;
51312 {
51314 }
51315 break;
51316 case 4:
51317 width = 8;
51318 height = 8;
51321 break;
51322 case 5:
51325 height = 8;
51327 {
51329 }
51330 break;
51331 case 6:
51334 {
51336 }
51337 break;
51338 case 7:
51339 width = 8;
51340 height = 4;
51344 {
51346 }
51347 break;
51348 case 8:
51352 {
51354 }
51355 break;
51356 }
51360 color4.R = (byte)((
float)(int)
color4.R *
num4);
51361 color4.G = (byte)((
float)(int)
color4.G *
num5);
51362 color4.B = (byte)((
float)(int)
color4.B *
num6);
51365 {
51372 }
51373 }
51374 }
51375 catch
51376 {
51377 color3.R = (byte)((
float)(int)
color3.R *
num4);
51378 color3.G = (byte)((
float)(int)
color3.G *
num5);
51379 color3.B = (byte)((
float)(int)
color3.B *
num6);
51381 }
51382 }
51384 {
51387 {
51393 {
51394 case 1:
51396 break;
51397 case 2:
51399 break;
51400 case 3:
51403 break;
51404 }
51408 color7.R = (byte)((
float)(int)
color7.R *
num4);
51409 color7.G = (byte)((
float)(int)
color7.G *
num5);
51410 color7.B = (byte)((
float)(int)
color7.B *
num6);
51413 {
51420 }
51421 }
51422 }
51423 else
51424 {
51425 color3.R = (byte)((
float)(int)
color3.R *
num4);
51426 color3.G = (byte)((
float)(int)
color3.G *
num5);
51427 color3.B = (byte)((
float)(int)
color3.B *
num6);
51430 {
51437 }
51438 }
51439 }
51440 else
51441 {
51442 color3.R = (byte)((
float)(int)
color3.R *
num4);
51443 color3.G = (byte)((
float)(int)
color3.G *
num5);
51444 color3.B = (byte)((
float)(int)
color3.B *
num6);
51446 }
51447 }
51448 }
51449 }
51450 }
51452 {
51454 {
51456 {
51458 {
51460 {
51466 {
51468 }
51470 {
51473 vertices2.BottomLeftColor.A =
a;
51474 vertices2.BottomRightColor.A =
a;
51475 vertices2.TopLeftColor.A =
a;
51476 vertices2.TopRightColor.A =
a;
51477 tileBatch.Draw(
TextureAssets.
Background[
array2[1]].Value,
new Vector2(
bgStartX +
num3 *
num31 + 16 *
num33 +
num18,
bgStartY +
backgroundHeight[
array2[1]] *
num32 + 16 *
num34) +
vector,
new Microsoft.
Xna.
Framework.
Rectangle(16 *
num33 +
num18 + 16, 16 *
num34, 16, 16),
vertices2,
Vector2.
Zero, 1f,
SpriteEffects.None);
51478 }
51479 }
51480 }
51481 }
51482 }
51483 }
51485 {
51491 {
51493 {
51495 {
51499 color12.R = (byte)((
float)(int)
color12.R *
num4);
51500 color12.G = (byte)((
float)(int)
color12.G *
num5);
51501 color12.B = (byte)((
float)(int)
color12.B *
num6);
51504 {
51511 }
51512 }
51513 }
51514 }
51515 }
51516 }
51517 bgTopY = (int)((
float)((int)
rockLayer * 16) - screenPosition.Y + 16f + 600f - 8f);
51518 if (
rockLayer * 16.0 <= (
double)(screenPosition.Y + 600f))
51519 {
51524 {
51527 }
51528 else
51529 {
51532 }
51533 if (
num16 * 16.0 < (
double)(screenPosition.Y + 600f))
51534 {
51536 flag = true;
51537 }
51540 {
51542 }
51544 {
51546 {
51548 {
51550 {
51556 {
51557 continue;
51558 }
51560 {
51561 if ((
color14.R > num || (
double)(int)
color14.G > (
double)num * 1.1 || (double)(
int)color14.B > (double)num * 1.2) && !
tile[
num48,
num49].active())
51562 {
51565 {
51573 {
51574 case 0:
51576 {
51578 }
51579 break;
51580 case 1:
51584 {
51586 }
51587 break;
51588 case 2:
51591 {
51593 }
51594 break;
51595 case 3:
51599 {
51601 }
51602 break;
51603 case 4:
51608 break;
51609 case 5:
51614 {
51616 }
51617 break;
51618 case 6:
51621 {
51623 }
51624 break;
51625 case 7:
51631 {
51633 }
51634 break;
51635 case 8:
51639 {
51641 }
51642 break;
51643 }
51647 color15.R = (byte)((
float)(int)
color15.R *
num4);
51648 color15.G = (byte)((
float)(int)
color15.G *
num5);
51649 color15.B = (byte)((
float)(int)
color15.B *
num6);
51652 {
51659 }
51660 }
51661 }
51663 {
51666 {
51672 {
51673 case 1:
51675 break;
51676 case 2:
51678 break;
51679 case 3:
51682 break;
51683 }
51687 color18.R = (byte)((
float)(int)
color18.R *
num4);
51688 color18.G = (byte)((
float)(int)
color18.G *
num5);
51689 color18.B = (byte)((
float)(int)
color18.B *
num6);
51692 {
51699 }
51700 }
51701 }
51702 else
51703 {
51704 color14.R = (byte)((
float)(int)
color14.R *
num4);
51705 color14.G = (byte)((
float)(int)
color14.G *
num5);
51706 color14.B = (byte)((
float)(int)
color14.B *
num6);
51709 {
51716 }
51717 }
51718 }
51719 else
51720 {
51721 color14.R = (byte)((
float)(int)
color14.R *
num4);
51722 color14.G = (byte)((
float)(int)
color14.G *
num5);
51723 color14.B = (byte)((
float)(int)
color14.B *
num6);
51726 {
51733 }
51734 }
51735 }
51736 }
51737 }
51738 }
51740 if (flag)
51741 {
51747 {
51749 {
51753 color23.R = (byte)((
float)(int)
color23.R *
num4);
51754 color23.G = (byte)((
float)(int)
color23.G *
num5);
51755 color23.B = (byte)((
float)(int)
color23.B *
num6);
51758 {
51765 }
51766 }
51767 }
51768 }
51769 }
51770 bgTopY = (int)((
float)((int)
num16 * 16) - screenPosition.Y + 16f + 600f) - 8;
51771 if (
num16 * 16.0 <= (
double)(screenPosition.Y + 600f))
51772 {
51776 {
51779 }
51780 else
51781 {
51784 }
51785 num = (int)((double)num * 1.5);
51789 {
51791 }
51793 {
51795 {
51797 {
51799 {
51805 {
51806 continue;
51807 }
51809 {
51810 if ((
color25.R > num || (
double)(int)
color25.G > (
double)num * 1.1 || (double)(
int)color25.B > (double)num * 1.2) && !
tile[
num66,
num67].active())
51811 {
51814 {
51822 {
51823 case 0:
51825 {
51827 }
51828 break;
51829 case 1:
51833 {
51835 }
51836 break;
51837 case 2:
51840 {
51842 }
51843 break;
51844 case 3:
51848 {
51850 }
51851 break;
51852 case 4:
51857 break;
51858 case 5:
51863 {
51865 }
51866 break;
51867 case 6:
51870 {
51872 }
51873 break;
51874 case 7:
51880 {
51882 }
51883 break;
51884 case 8:
51888 {
51890 }
51891 break;
51892 }
51896 color26.R = (byte)((
float)(int)
color26.R *
num4);
51897 color26.G = (byte)((
float)(int)
color26.G *
num5);
51898 color26.B = (byte)((
float)(int)
color26.B *
num6);
51899 spriteBatch.Draw(
TextureAssets.
Background[
array[5]].Value,
new Vector2(
bgStartX +
num3 *
num61 + 16 *
num63 +
num69 +
num60,
bgStartY +
backgroundHeight[2] *
num62 + 16 *
num64 +
num70) +
vector,
new Microsoft.
Xna.
Framework.
Rectangle(16 *
num63 +
num69 +
num60 + 16, 16 *
num64 +
backgroundHeight[2] *
magmaBGFrame +
num70,
width3,
height3),
color26, 0f,
default(
Vector2), 1f,
SpriteEffects.None, 0f);
51900 }
51901 }
51903 {
51906 {
51912 {
51913 case 1:
51915 break;
51916 case 2:
51918 break;
51919 case 3:
51922 break;
51923 }
51927 color28.R = (byte)((
float)(int)
color28.R *
num4);
51928 color28.G = (byte)((
float)(int)
color28.G *
num5);
51929 color28.B = (byte)((
float)(int)
color28.B *
num6);
51930 spriteBatch.Draw(
TextureAssets.
Background[
array[5]].Value,
new Vector2(
bgStartX +
num3 *
num61 + 16 *
num63 +
num72 +
num60,
bgStartY +
backgroundHeight[2] *
num62 + 16 *
num64 +
num73) +
vector,
new Microsoft.
Xna.
Framework.
Rectangle(16 *
num63 +
num72 +
num60 + 16, 16 *
num64 +
backgroundHeight[2] *
magmaBGFrame +
num73, 8, 8),
color28, 0f,
default(
Vector2), 1f,
SpriteEffects.None, 0f);
51931 }
51932 }
51933 else
51934 {
51935 color25.R = (byte)((
float)(int)
color25.R *
num4);
51936 color25.G = (byte)((
float)(int)
color25.G *
num5);
51937 color25.B = (byte)((
float)(int)
color25.B *
num6);
51938 spriteBatch.Draw(
TextureAssets.
Background[
array[5]].Value,
new Vector2(
bgStartX +
num3 *
num61 + 16 *
num63 +
num60,
bgStartY +
backgroundHeight[2] *
num62 + 16 *
num64) +
vector,
new Microsoft.
Xna.
Framework.
Rectangle(16 *
num63 +
num60 + 16, 16 *
num64 +
backgroundHeight[2] *
magmaBGFrame, 16, 16),
color25, 0f,
default(
Vector2), 1f,
SpriteEffects.None, 0f);
51939 }
51940 }
51941 else
51942 {
51943 color25.R = (byte)((
float)(int)
color25.R *
num4);
51944 color25.G = (byte)((
float)(int)
color25.G *
num5);
51945 color25.B = (byte)((
float)(int)
color25.B *
num6);
51946 spriteBatch.Draw(
TextureAssets.
Background[
array[5]].Value,
new Vector2(
bgStartX +
num3 *
num61 + 16 *
num63 +
num60,
bgStartY +
backgroundHeight[2] *
num62 + 16 *
num64) +
vector,
new Microsoft.
Xna.
Framework.
Rectangle(16 *
num63 +
num60 + 16, 16 *
num64 +
backgroundHeight[2] *
magmaBGFrame, 16, 16),
color25, 0f,
default(
Vector2), 1f,
SpriteEffects.None, 0f);
51947 }
51948 }
51949 }
51950 }
51951 }
51952 }
51954 TimeLogger.DrawTime(3,
stopwatch.Elapsed.TotalMilliseconds);
51955 }
static float Clamp(float value, float min, float max)
static decimal Round(decimal d)
static double IEEERemainder(double x, double y)
static Asset< Texture2D >[] Background
static SceneMetrics SceneMetrics
void LoadBackground(int i)
static SpriteBatch spriteBatch
static double worldSurface
static bool WallLightAt(int i, int j)
static int oldUndergroundBackground
static int[] caveBackStyle
static float ugBackTransition
static Vector2 screenPosition
static int undergroundBackground
static int offScreenRange
static TileBatch tileBatch
static int jungleBackStyle
static int[] backgroundHeight
static float caveParallax
static bool ShouldDrawBackgroundTileAt(int i, int j)
References System.array, Microsoft.Xna.Framework.Color.B, Terraria.GameContent.TextureAssets.Background, Terraria.Main.backgroundHeight, Terraria.Main.bgLoops, Terraria.Main.bgLoopsY, Terraria.Main.bgParallax, Terraria.Main.bgStartX, Terraria.Main.bgStartY, Terraria.Main.bgTopY, Terraria.SceneMetrics.BloodTileCount, Terraria.Main.caveBackStyle, Terraria.Main.caveBackX, Terraria.Main.caveParallax, Microsoft.Xna.Framework.MathHelper.Clamp(), Terraria.TimeLogger.DrawTime(), Terraria.Main.drawToScreen, Terraria.SceneMetrics.EnoughTilesForGlowingMushroom, Terraria.SceneMetrics.EvilTileCount, Microsoft.Xna.Framework.Color.G, Terraria.Lighting.GetColor(), Terraria.Lighting.GetColor4Slice(), Terraria.Lighting.GetColor9Slice(), Terraria.Lighting.GetCornerColors(), Terraria.Main.gfxQuality, Terraria.Lighting.GlobalBrightness, Terraria.Main.hellBackStyle, Terraria.SceneMetrics.HolyTileCount, System.Text.RegularExpressions.i, Terraria.Main.iceBackStyle, System.Math.IEEERemainder(), Terraria.Main.jungleBackStyle, Terraria.SceneMetrics.JungleTileCount, Terraria.SceneMetrics.JungleTileThreshold, Terraria.Main.LoadBackground(), Terraria.Main.magmaBGFrame, Terraria.Main.maxTilesY, Terraria.Lighting.NotRetro, Terraria.Main.offScreenRange, Terraria.Main.oldUndergroundBackground, Microsoft.Xna.Framework.Color.R, Terraria.Main.rockLayer, System.Math.Round(), Terraria.Main.screenHeight, Terraria.Main.screenPosition, Terraria.Main.screenWidth, Terraria.Main.ShouldDrawBackgroundTileAt(), Terraria.SceneMetrics.SnowTileCount, Terraria.SceneMetrics.SnowTileThreshold, Terraria.Main.spriteBatch, Terraria.DataStructures.Tile, Terraria.Main.tile, Terraria.Main.tileBatch, Terraria.Main.ugBackTransition, Terraria.Main.undergroundBackground, System.value, Microsoft.Xna.Framework.Graphics.Vector2, Terraria.Main.WallLightAt(), Terraria.Main.worldSurface, and Microsoft.Xna.Framework.Vector2.Zero.
Referenced by Terraria.Main.DrawBackground().