Definition at line 49686 of file Main.cs.
49687 {
49689 if (num == 1f)
49690 {
49692 return;
49693 }
49695 {
49697 return;
49698 }
49720 {
49722 }
49724 {
49726 {
49728 {
49730 }
49731 }
49732 else
49733 {
49735 }
49736 }
49738 {
49740 }
49742 {
49744 {
49746 {
49748 }
49750 {
49752 }
49754 {
49756 }
49757 }
49759 {
49761 }
49763 {
49765 }
49767 {
49769 }
49770 }
49772 {
49774 }
49776 {
49780 }
49781 if (num > 0f)
49782 {
49784 }
49786 {
49788 }
49790 {
49792 }
49793 int[]
array =
new int[7];
49794 int[]
array2 =
new int[7];
49795 for (
int i = 0;
i < 2;
i++)
49796 {
49799 {
49801 }
49802 int[]
array3 =
new int[7];
49804 {
49805 case 0:
49812 break;
49813 case 1:
49815 {
49820 }
49822 {
49827 }
49829 {
49834 }
49835 else
49836 {
49841 }
49843 break;
49844 case 2:
49850 break;
49851 case 3:
49857 break;
49858 case 4:
49864 break;
49865 case 5:
49871 break;
49872 case 6:
49878 break;
49879 case 7:
49885 break;
49886 case 8:
49892 break;
49893 case 9:
49899 break;
49900 case 10:
49906 break;
49907 case 11:
49909 {
49915 }
49916 else
49917 {
49923 }
49924 break;
49925 case 12:
49926 case 13:
49927 case 14:
49933 {
49934 case 12:
49936 break;
49937 case 13:
49939 break;
49940 case 14:
49942 break;
49943 }
49944 break;
49945 default:
49947 {
49953 {
49954 case 15:
49956 break;
49957 case 16:
49959 break;
49960 case 17:
49962 break;
49963 }
49964 break;
49965 }
49967 {
49968 case 18:
49971 break;
49972 case 19:
49975 break;
49976 case 20:
49979 break;
49980 case 21:
49983 break;
49984 }
49985 break;
49986 }
49988 {
49990 }
49992 {
49994 }
49996 {
49998 }
50008 {
50009 for (
int j = 0;
j < 7;
j++)
50010 {
50012 }
50013 }
50014 else
50015 {
50016 for (
int k = 0;
k < 7;
k++)
50017 {
50019 }
50020 }
50021 }
50032 {
50033 for (
int m = 0;
m <
num6 / 16;
m++)
50034 {
50037 {
50039 }
50043 color.R = (byte)((
float)(int)color.
R * x);
50044 color.G = (byte)((
float)(int)color.
G * y);
50045 color.B = (byte)((
float)(int)color.
B *
z);
50046 if (num > 0f)
50047 {
50048 color *= 1f - num;
50049 }
50051 }
50052 }
50054 {
50059 {
50061 {
50064 {
50066 }
50070 color2.R = (byte)((
float)(int)
color2.R * x);
50071 color2.G = (byte)((
float)(int)
color2.G * y);
50072 color2.B = (byte)((
float)(int)
color2.B *
z);
50079 }
50080 }
50081 }
50082 bool flag = false;
50083 bool flag2 =
false;
50086 {
50091 if (
worldSurface * 16.0 < (
double)(screenPosition.Y - 16f))
50092 {
50095 }
50096 else
50097 {
50100 }
50101 if (
rockLayer * 16.0 < (
double)(Camera.ScaledPosition.Y + 600f))
50102 {
50105 }
50108 {
50110 }
50112 {
50114 {
50116 {
50118 {
50124 {
50125 continue;
50126 }
50128 {
50130 }
50132 {
50134 {
50138 tileBatch.Draw(
TextureAssets.
Background[
array[1]].Value,
new Vector2(
bgStartX +
num6 *
num19 + 16 *
num21 +
num18,
bgStartY +
backgroundHeight[
array2[1]] *
num20 + 16 *
num22) +
vector,
new Microsoft.
Xna.
Framework.
Rectangle(16 *
num21 +
num18 + 16, 16 *
num22, 16, 16), vertices,
Vector2.
Zero, 1f,
SpriteEffects.None);
50139 }
50141 {
50143 try
50144 {
50146 {
50149 int width = 4;
50150 int height = 4;
50154 {
50155 case 0:
50157 {
50159 }
50160 break;
50161 case 1:
50162 width = 8;
50165 {
50167 }
50168 break;
50169 case 2:
50172 {
50174 }
50175 break;
50176 case 3:
50177 height = 8;
50180 {
50182 }
50183 break;
50184 case 4:
50185 width = 8;
50186 height = 8;
50189 break;
50190 case 5:
50193 height = 8;
50195 {
50197 }
50198 break;
50199 case 6:
50202 {
50204 }
50205 break;
50206 case 7:
50207 width = 8;
50208 height = 4;
50212 {
50214 }
50215 break;
50216 case 8:
50220 {
50222 }
50223 break;
50224 }
50228 color5.R = (byte)((
float)(int)
color5.R * x);
50229 color5.G = (byte)((
float)(int)
color5.G * y);
50230 color5.B = (byte)((
float)(int)
color5.B *
z);
50233 {
50240 }
50241 }
50242 }
50243 catch
50244 {
50245 color4.R = (byte)((
float)(int)
color4.R * x);
50246 color4.G = (byte)((
float)(int)
color4.G * y);
50247 color4.B = (byte)((
float)(int)
color4.B *
z);
50249 }
50250 }
50252 {
50255 {
50261 {
50262 case 1:
50264 break;
50265 case 2:
50267 break;
50268 case 3:
50271 break;
50272 }
50276 color8.R = (byte)((
float)(int)
color8.R * x);
50277 color8.G = (byte)((
float)(int)
color8.G * y);
50278 color8.B = (byte)((
float)(int)
color8.B *
z);
50281 {
50288 }
50289 }
50290 }
50291 else
50292 {
50293 color4.R = (byte)((
float)(int)
color4.R * x);
50294 color4.G = (byte)((
float)(int)
color4.G * y);
50295 color4.B = (byte)((
float)(int)
color4.B *
z);
50298 {
50305 }
50306 }
50307 }
50308 else
50309 {
50310 color4.R = (byte)((
float)(int)
color4.R * x);
50311 color4.G = (byte)((
float)(int)
color4.G * y);
50312 color4.B = (byte)((
float)(int)
color4.B *
z);
50313 if (num > 0f)
50314 {
50316 }
50318 }
50319 }
50320 }
50321 }
50322 }
50324 {
50330 {
50332 }
50334 {
50336 {
50338 {
50340 {
50345 {
50348 {
50350 }
50352 {
50355 vertices2.BottomLeftColor.A =
a;
50356 vertices2.BottomRightColor.A =
a;
50357 vertices2.TopLeftColor.A =
a;
50358 vertices2.TopRightColor.A =
a;
50359 tileBatch.Draw(
TextureAssets.
Background[
array2[1]].Value,
new Vector2(
bgStartX +
num6 *
num32 + 16 *
num34 +
num18,
bgStartY +
backgroundHeight[
array2[1]] *
num33 + 16 *
num35) +
vector,
new Microsoft.
Xna.
Framework.
Rectangle(16 *
num34 +
num18 + 16, 16 *
num35, 16, 16),
vertices2,
Vector2.
Zero, 1f,
SpriteEffects.None);
50360 }
50361 }
50362 }
50363 }
50364 }
50365 }
50366 }
50369 {
50375 {
50377 {
50379 {
50383 color13.R = (byte)((
float)(int)
color13.R * x);
50384 color13.G = (byte)((
float)(int)
color13.G * y);
50385 color13.B = (byte)((
float)(int)
color13.B *
z);
50386 if (num > 0f)
50387 {
50389 }
50392 {
50399 }
50400 }
50401 }
50402 }
50403 }
50404 }
50406 {
50412 {
50415 {
50417 }
50418 }
50420 }
50422 bgTopY = (int)((
float)((int)
rockLayer * 16) - screenPosition.Y + 16f + 600f - 8f);
50424 {
50429 {
50432 }
50433 else
50434 {
50437 }
50439 {
50441 flag = true;
50442 }
50445 {
50447 }
50449 {
50451 {
50453 {
50455 {
50460 {
50461 continue;
50462 }
50465 {
50466 continue;
50467 }
50469 {
50471 {
50474 {
50482 {
50483 case 0:
50485 {
50487 }
50488 break;
50489 case 1:
50493 {
50495 }
50496 break;
50497 case 2:
50500 {
50502 }
50503 break;
50504 case 3:
50508 {
50510 }
50511 break;
50512 case 4:
50517 break;
50518 case 5:
50523 {
50525 }
50526 break;
50527 case 6:
50530 {
50532 }
50533 break;
50534 case 7:
50540 {
50542 }
50543 break;
50544 case 8:
50548 {
50550 }
50551 break;
50552 }
50556 color16.R = (byte)((
float)(int)
color16.R * x);
50557 color16.G = (byte)((
float)(int)
color16.G * y);
50558 color16.B = (byte)((
float)(int)
color16.B *
z);
50561 {
50568 }
50569 }
50570 }
50572 {
50575 {
50581 {
50582 case 1:
50584 break;
50585 case 2:
50587 break;
50588 case 3:
50591 break;
50592 }
50596 color19.R = (byte)((
float)(int)
color19.R * x);
50597 color19.G = (byte)((
float)(int)
color19.G * y);
50598 color19.B = (byte)((
float)(int)
color19.B *
z);
50601 {
50608 }
50609 }
50610 }
50611 else
50612 {
50613 color15.R = (byte)((
float)(int)
color15.R * x);
50614 color15.G = (byte)((
float)(int)
color15.G * y);
50615 color15.B = (byte)((
float)(int)
color15.B *
z);
50618 {
50625 }
50626 }
50627 }
50628 else
50629 {
50630 color15.R = (byte)((
float)(int)
color15.R * x);
50631 color15.G = (byte)((
float)(int)
color15.G * y);
50632 color15.B = (byte)((
float)(int)
color15.B *
z);
50633 if (num > 0f)
50634 {
50636 }
50639 {
50646 }
50647 }
50648 }
50649 }
50650 }
50651 }
50653 if (flag)
50654 {
50660 {
50662 {
50666 color24.R = (byte)((
float)(int)
color24.R * x);
50667 color24.G = (byte)((
float)(int)
color24.G * y);
50668 color24.B = (byte)((
float)(int)
color24.B *
z);
50671 {
50678 }
50679 }
50680 }
50681 }
50682 }
50683 bgTopY = (int)((
float)((int)
num2 * 16) - screenPosition.Y + 16f + 600f) - 8;
50684 bool flag3 =
false;
50686 {
50690 {
50693 }
50694 else
50695 {
50698 }
50700 {
50703 }
50708 {
50710 }
50712 {
50714 {
50716 {
50718 {
50723 {
50724 continue;
50725 }
50728 {
50729 continue;
50730 }
50732 {
50734 {
50737 {
50745 {
50746 case 0:
50748 {
50750 }
50751 break;
50752 case 1:
50756 {
50758 }
50759 break;
50760 case 2:
50763 {
50765 }
50766 break;
50767 case 3:
50771 {
50773 }
50774 break;
50775 case 4:
50780 break;
50781 case 5:
50786 {
50788 }
50789 break;
50790 case 6:
50793 {
50795 }
50796 break;
50797 case 7:
50803 {
50805 }
50806 break;
50807 case 8:
50811 {
50813 }
50814 break;
50815 }
50819 color27.R = (byte)((
float)(int)
color27.R * x);
50820 color27.G = (byte)((
float)(int)
color27.G * y);
50821 color27.B = (byte)((
float)(int)
color27.B *
z);
50822 spriteBatch.Draw(
TextureAssets.
Background[
array[5]].Value,
new Vector2(
bgStartX +
num6 *
num64 + 16 *
num66 +
num72 +
num63,
bgStartY +
backgroundHeight[2] *
num65 + 16 *
num67 +
num73) +
vector,
new Microsoft.
Xna.
Framework.
Rectangle(16 *
num66 +
num72 +
num63 + 16, 16 *
num67 +
backgroundHeight[2] *
magmaBGFrame +
num73,
width4,
height3),
color27, 0f,
default(
Vector2), 1f,
SpriteEffects.None, 0f);
50823 }
50824 }
50826 {
50829 {
50835 {
50836 case 1:
50838 break;
50839 case 2:
50841 break;
50842 case 3:
50845 break;
50846 }
50850 color29.R = (byte)((
float)(int)
color29.R * x);
50851 color29.G = (byte)((
float)(int)
color29.G * y);
50852 color29.B = (byte)((
float)(int)
color29.B *
z);
50853 spriteBatch.Draw(
TextureAssets.
Background[
array[5]].Value,
new Vector2(
bgStartX +
num6 *
num64 + 16 *
num66 +
num75 +
num63,
bgStartY +
backgroundHeight[2] *
num65 + 16 *
num67 +
num76) +
vector,
new Microsoft.
Xna.
Framework.
Rectangle(16 *
num66 +
num75 +
num63 + 16, 16 *
num67 +
backgroundHeight[2] *
magmaBGFrame +
num76, 8, 8),
color29, 0f,
default(
Vector2), 1f,
SpriteEffects.None, 0f);
50854 }
50855 }
50856 else
50857 {
50858 color26.R = (byte)((
float)(int)
color26.R * x);
50859 color26.G = (byte)((
float)(int)
color26.G * y);
50860 color26.B = (byte)((
float)(int)
color26.B *
z);
50861 spriteBatch.Draw(
TextureAssets.
Background[
array[5]].Value,
new Vector2(
bgStartX +
num6 *
num64 + 16 *
num66 +
num63,
bgStartY +
backgroundHeight[2] *
num65 + 16 *
num67) +
vector,
new Microsoft.
Xna.
Framework.
Rectangle(16 *
num66 +
num63 + 16, 16 *
num67 +
backgroundHeight[2] *
magmaBGFrame, 16, 16),
color26, 0f,
default(
Vector2), 1f,
SpriteEffects.None, 0f);
50862 }
50863 }
50864 else
50865 {
50866 color26.R = (byte)((
float)(int)
color26.R * x);
50867 color26.G = (byte)((
float)(int)
color26.G * y);
50868 color26.B = (byte)((
float)(int)
color26.B *
z);
50869 spriteBatch.Draw(
TextureAssets.
Background[
array[5]].Value,
new Vector2(
bgStartX +
num6 *
num64 + 16 *
num66 +
num63,
bgStartY +
backgroundHeight[2] *
num65 + 16 *
num67) +
vector,
new Microsoft.
Xna.
Framework.
Rectangle(16 *
num66 +
num63 + 16, 16 *
num67 +
backgroundHeight[2] *
magmaBGFrame, 16, 16),
color26, 0f,
default(
Vector2), 1f,
SpriteEffects.None, 0f);
50870 }
50871 }
50872 }
50873 }
50874 }
50876 {
50883 {
50885 {
50889 color31.R = (byte)((
float)(int)
color31.R * x);
50890 color31.G = (byte)((
float)(int)
color31.G * y);
50891 color31.B = (byte)((
float)(int)
color31.B *
z);
50894 {
50901 }
50902 }
50903 }
50904 }
50905 }
50907 TimeLogger.DrawTime(3,
stopwatch.Elapsed.TotalMilliseconds);
50908 }
static float Clamp(float value, float min, float max)
static decimal Round(decimal d)
static double Ceiling(double a)
static double IEEERemainder(double x, double y)
static Asset< Texture2D >[] Background
static Asset< Texture2D > BlackTile
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 bool BackgroundEnabled
static int undergroundBackground
static int offScreenRange
static TileBatch tileBatch
static int jungleBackStyle
static int[] backgroundHeight
static float caveParallax
static int UnderworldLayer
static bool ShouldDrawBackgroundTileAt(int i, int j)
static float shimmerAlpha
References System.array, Microsoft.Xna.Framework.Color.B, Terraria.GameContent.TextureAssets.Background, Terraria.Main.BackgroundEnabled, Terraria.Main.backgroundHeight, Terraria.Main.bgLoops, Terraria.Main.bgLoopsY, Terraria.Main.bgParallax, Terraria.Main.bgStartX, Terraria.Main.bgStartY, Terraria.Main.bgTopY, Terraria.GameContent.TextureAssets.BlackTile, Terraria.Main.caveBackStyle, Terraria.Main.caveBackX, Terraria.Main.caveParallax, System.Math.Ceiling(), Microsoft.Xna.Framework.MathHelper.Clamp(), Terraria.TimeLogger.DrawTime(), Terraria.Main.drawToScreen, 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.Main.hellBlackBoxBottom, System.Text.RegularExpressions.i, Terraria.Main.iceBackStyle, System.Math.IEEERemainder(), Terraria.WorldGen.InWorld(), Terraria.Main.jungleBackStyle, Terraria.SceneMetrics.JungleTileCount, Terraria.SceneMetrics.JungleTileThreshold, Terraria.Main.LoadBackground(), Terraria.Main.magmaBGFrame, Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Main.myPlayer, Terraria.Lighting.NotRetro, Terraria.WorldGen.oceanDepths(), Terraria.Main.offScreenRange, Terraria.Main.OldDrawBackground(), Terraria.Main.oldUndergroundBackground, Terraria.Main.player, Microsoft.Xna.Framework.Color.R, Terraria.Main.remixWorld, Terraria.Main.rockLayer, System.Math.Round(), Terraria.Main.screenHeight, Terraria.Main.screenPosition, Terraria.Main.screenWidth, Terraria.Main.shimmerAlpha, 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, Terraria.Main.UnderworldLayer, System.value, Microsoft.Xna.Framework.Graphics.Vector2, Microsoft.Xna.Framework.Graphics.Vector3, Terraria.Main.WallLightAt(), Terraria.Main.worldID, Terraria.Main.worldSurface, and Microsoft.Xna.Framework.Vector2.Zero.
Referenced by Terraria.Main.DoDraw(), Terraria.Main.DrawCapture(), and Terraria.Main.RenderBackground().