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

◆ OldDrawBackground()

void Terraria.Main.OldDrawBackground ( )
inlineprotected

Definition at line 50915 of file Main.cs.

50916 {
50919 stopwatch.Start();
50920 int num = (int)(255f * (1f - gfxQuality) + 140f * gfxQuality);
50921 int num2 = (int)(200f * (1f - gfxQuality) + 40f * gfxQuality);
50922 int num3 = 128;
50924 if (drawToScreen)
50925 {
50927 }
50928 float num4;
50929 float num5;
50930 float num6 = (num5 = (num4 = 0.9f));
50931 float num7 = 0f;
50932 if (SceneMetrics.BloodTileCount > SceneMetrics.EvilTileCount && SceneMetrics.BloodTileCount > SceneMetrics.HolyTileCount)
50933 {
50934 num7 = SceneMetrics.BloodTileCount;
50935 }
50936 else if (SceneMetrics.HolyTileCount > SceneMetrics.EvilTileCount)
50937 {
50938 num7 = SceneMetrics.HolyTileCount;
50939 }
50940 else if (SceneMetrics.EvilTileCount > SceneMetrics.HolyTileCount)
50941 {
50942 num7 = SceneMetrics.EvilTileCount;
50943 }
50944 num7 = MathHelper.Clamp(num7 / 800f, 0f, 1f);
50945 float num8 = (float)((double)screenPosition.Y - worldSurface * 16.0) / 300f;
50946 if (num8 < 0f)
50947 {
50948 num8 = 0f;
50949 }
50950 else if (num8 > 1f)
50951 {
50952 num8 = 1f;
50953 }
50954 float num9 = 1f * (1f - num8) + num4 * num8;
50955 float globalBrightness = Lighting.GlobalBrightness;
50956 Lighting.GlobalBrightness = globalBrightness * (1f - num8) + 1f * num8;
50957 float value = (float)((double)(screenPosition.Y - (float)(screenHeight / 2) + 200f) - rockLayer * 16.0) / 300f;
50958 value = MathHelper.Clamp(value, 0f, 1f);
50959 if (SceneMetrics.BloodTileCount > SceneMetrics.EvilTileCount && SceneMetrics.BloodTileCount > SceneMetrics.HolyTileCount)
50960 {
50961 num4 = 1f * num7 + num4 * (1f - num7);
50962 num5 = 0.55f * num7 + num5 * (1f - num7);
50963 num6 = 0.5f * num7 + num6 * (1f - num7);
50964 }
50965 else if (SceneMetrics.EvilTileCount > 0)
50966 {
50967 num4 = 0.8f * num7 + num4 * (1f - num7);
50968 num5 = 0.75f * num7 + num5 * (1f - num7);
50969 num6 = 1.1f * num7 + num6 * (1f - num7);
50970 }
50971 else if (SceneMetrics.HolyTileCount > 0)
50972 {
50973 num4 = 1f * num7 + num4 * (1f - num7);
50974 num5 = 0.7f * num7 + num5 * (1f - num7);
50975 num6 = 0.9f * num7 + num6 * (1f - num7);
50976 }
50977 num4 = 1f * (num9 - value) + num4 * value;
50978 num5 = 1f * (num9 - value) + num5 * value;
50979 num6 = 1f * (num9 - value) + num6 * value;
50980 int num10 = (int)((screenPosition.X + (float)(screenWidth / 2)) / 16f);
50981 int num11 = 3;
50982 num11 = ((num10 <= caveBackX[0]) ? caveBackStyle[0] : ((num10 <= caveBackX[1]) ? caveBackStyle[1] : ((num10 > caveBackX[2]) ? caveBackStyle[3] : caveBackStyle[2])));
50983 num11 += 3;
50984 if (SceneMetrics.SnowTileCount > SceneMetrics.SnowTileThreshold && (screenPosition.Y + (float)screenHeight) / 16f < (float)(maxTilesY - 250))
50985 {
50986 num11 = 1;
50987 }
50988 if (SceneMetrics.JungleTileCount > SceneMetrics.JungleTileThreshold)
50989 {
50990 if (num11 == 1)
50991 {
50992 if (SceneMetrics.JungleTileCount > SceneMetrics.SnowTileCount)
50993 {
50994 num11 = 11;
50995 }
50996 }
50997 else
50998 {
50999 num11 = 11;
51000 }
51001 }
51002 if (SceneMetrics.EnoughTilesForGlowingMushroom)
51003 {
51004 num11 = 2;
51005 }
51007 {
51010 ugBackTransition = 1f;
51011 }
51012 if (ugBackTransition > 0f)
51013 {
51014 ugBackTransition -= 0.25f;
51015 }
51016 if (ugBackTransition < 0f)
51017 {
51018 ugBackTransition = 0f;
51019 }
51020 int[] array = new int[6];
51021 int[] array2 = new int[6];
51022 for (int i = 0; i < 2; i++)
51023 {
51025 if (i == 1)
51026 {
51028 }
51029 int[] array3 = new int[6];
51030 switch (num12)
51031 {
51032 case 0:
51033 array3[0] = 1;
51034 array3[1] = 2;
51035 array3[2] = 4;
51036 array3[3] = 3;
51037 array3[4] = 6;
51038 array3[5] = 5;
51039 break;
51040 case 1:
51041 if (iceBackStyle == 0)
51042 {
51043 array3[1] = 33;
51044 array3[3] = 32;
51045 array3[0] = 40;
51046 array3[2] = 34;
51047 }
51048 else if (iceBackStyle == 1)
51049 {
51050 array3[1] = 118;
51051 array3[3] = 117;
51052 array3[0] = 160;
51053 array3[2] = 161;
51054 }
51055 else if (iceBackStyle == 2)
51056 {
51057 array3[1] = 165;
51058 array3[3] = 167;
51059 array3[0] = 164;
51060 array3[2] = 166;
51061 }
51062 else
51063 {
51064 array3[1] = 120;
51065 array3[3] = 119;
51066 array3[0] = 162;
51067 array3[2] = 163;
51068 }
51069 array3[4] = array3[3];
51070 break;
51071 case 2:
51072 array3[0] = 62;
51073 array3[1] = 63;
51074 array3[2] = 64;
51075 array3[3] = 65;
51076 array3[4] = 143 + hellBackStyle;
51077 break;
51078 case 3:
51079 array3[0] = 66;
51080 array3[1] = 67;
51081 array3[2] = 68;
51082 array3[3] = 69;
51083 array3[4] = 128 + hellBackStyle;
51084 break;
51085 case 4:
51086 array3[0] = 70;
51087 array3[1] = 71;
51088 array3[2] = 68;
51089 array3[3] = 72;
51090 array3[4] = 128 + hellBackStyle;
51091 break;
51092 case 5:
51093 array3[0] = 73;
51094 array3[1] = 74;
51095 array3[2] = 75;
51096 array3[3] = 76;
51097 array3[4] = 131 + hellBackStyle;
51098 break;
51099 case 6:
51100 array3[0] = 77;
51101 array3[1] = 78;
51102 array3[2] = 79;
51103 array3[3] = 80;
51104 array3[4] = 134 + hellBackStyle;
51105 break;
51106 case 7:
51107 array3[0] = 77;
51108 array3[1] = 81;
51109 array3[2] = 79;
51110 array3[3] = 82;
51111 array3[4] = 134 + hellBackStyle;
51112 break;
51113 case 8:
51114 array3[0] = 83;
51115 array3[1] = 84;
51116 array3[2] = 85;
51117 array3[3] = 86;
51118 array3[4] = 137 + hellBackStyle;
51119 break;
51120 case 9:
51121 array3[0] = 83;
51122 array3[1] = 87;
51123 array3[2] = 88;
51124 array3[3] = 89;
51125 array3[4] = 137 + hellBackStyle;
51126 break;
51127 case 10:
51128 array3[0] = 121;
51129 array3[1] = 122;
51130 array3[2] = 123;
51131 array3[3] = 124;
51132 array3[4] = 140 + hellBackStyle;
51133 break;
51134 case 11:
51135 if (jungleBackStyle == 0)
51136 {
51137 array3[0] = 153;
51138 array3[1] = 147;
51139 array3[2] = 148;
51140 array3[3] = 149;
51141 array3[4] = 150 + hellBackStyle;
51142 }
51143 else
51144 {
51145 array3[0] = 146;
51146 array3[1] = 154;
51147 array3[2] = 155;
51148 array3[3] = 156;
51149 array3[4] = 157 + hellBackStyle;
51150 }
51151 break;
51152 }
51153 if (hellBackStyle == 0)
51154 {
51155 array3[5] = 125;
51156 }
51157 if (hellBackStyle == 1)
51158 {
51159 array3[5] = 126;
51160 }
51161 if (hellBackStyle == 2)
51162 {
51163 array3[5] = 127;
51164 }
51171 if (i == 0)
51172 {
51173 for (int j = 0; j < 6; j++)
51174 {
51175 array[j] = array3[j];
51176 }
51177 }
51178 else
51179 {
51180 for (int k = 0; k < 6; k++)
51181 {
51182 array2[k] = array3[k];
51183 }
51184 }
51185 }
51186 globalBrightness = 1.2f * (1f - value) + 1f * value;
51188 bgStartX = (int)(0.0 - Math.IEEERemainder((double)num3 + (double)screenPosition.X * bgParallax, num3) - (double)(num3 / 2)) - (int)vector.X;
51189 bgLoops = (screenWidth + (int)vector.X * 2) / num3 + 2;
51190 bgTopY = (int)((float)((int)worldSurface * 16 - 16) - screenPosition.Y + 16f);
51191 for (int l = 0; l < bgLoops; l++)
51192 {
51193 for (int m = 0; m < num3 / 16; m++)
51194 {
51195 int num13 = (int)(float)Math.Round(0f - (float)Math.IEEERemainder((float)bgStartX + screenPosition.X, 16.0));
51196 if (num13 == -8)
51197 {
51198 num13 = 8;
51199 }
51200 float num14 = bgStartX + num3 * l + m * 16 + 8;
51201 float num15 = bgTopY;
51202 Microsoft.Xna.Framework.Color color = Lighting.GetColor((int)((num14 + screenPosition.X) / 16f), (int)((screenPosition.Y + num15) / 16f));
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);
51206 spriteBatch.Draw(TextureAssets.Background[array[0]].Value, new Vector2(bgStartX + num3 * l + 16 * m + num13, bgTopY) + vector, new Microsoft.Xna.Framework.Rectangle(16 * m + num13 + 16, 0, 16, 16), color);
51207 if (ugBackTransition > 0f)
51208 {
51210 color2.R = (byte)((float)(int)color2.R * ugBackTransition);
51211 color2.G = (byte)((float)(int)color2.G * ugBackTransition);
51212 color2.B = (byte)((float)(int)color2.B * ugBackTransition);
51213 color2.A = (byte)((float)(int)color2.A * ugBackTransition);
51214 spriteBatch.Draw(TextureAssets.Background[array2[0]].Value, new Vector2(bgStartX + num3 * l + 16 * m + num13, bgTopY) + vector, new Microsoft.Xna.Framework.Rectangle(16 * m + num13 + 16, 0, 16, 16), color2);
51215 }
51216 }
51217 }
51218 double num16 = maxTilesY - 230;
51219 double num17 = (int)((num16 - worldSurface) / 6.0) * 6;
51220 num16 = worldSurface + num17 - 5.0;
51221 bool flag = false;
51222 bool flag2 = false;
51223 bgTopY = (int)((float)((int)worldSurface * 16) - screenPosition.Y + 16f);
51224 if (worldSurface * 16.0 <= (double)(screenPosition.Y + (float)screenHeight + (float)offScreenRange))
51225 {
51227 bgStartX = (int)(0.0 - Math.IEEERemainder((double)num3 + (double)screenPosition.X * bgParallax, num3) - (double)(num3 / 2)) - (int)vector.X;
51228 bgLoops = (screenWidth + (int)vector.X * 2) / num3 + 2;
51229 if (worldSurface * 16.0 < (double)(screenPosition.Y - 16f))
51230 {
51232 bgLoopsY = (screenHeight - bgStartY + (int)vector.Y * 2) / backgroundHeight[2] + 1;
51233 }
51234 else
51235 {
51236 bgStartY = bgTopY;
51237 bgLoopsY = (screenHeight - bgTopY + (int)vector.Y * 2) / backgroundHeight[2] + 1;
51238 }
51239 if (rockLayer * 16.0 < (double)(Camera.ScaledPosition.Y + 600f))
51240 {
51241 bgLoopsY = (int)(rockLayer * 16.0 - (double)screenPosition.Y + 600.0 - (double)bgStartY) / backgroundHeight[2];
51242 flag2 = true;
51243 }
51244 int num18 = (int)(float)Math.Round(0f - (float)Math.IEEERemainder((float)bgStartX + screenPosition.X, 16.0));
51245 if (num18 == -8)
51246 {
51247 num18 = 8;
51248 }
51249 for (int n = 0; n < bgLoops; n++)
51250 {
51251 for (int num19 = 0; num19 < bgLoopsY; num19++)
51252 {
51253 for (int num20 = 0; num20 < num3 / 16; num20++)
51254 {
51255 for (int num21 = 0; num21 < 6; num21++)
51256 {
51257 float num22 = bgStartY + num19 * 96 + num21 * 16 + 8;
51258 int num23 = (int)(((float)(bgStartX + num3 * n + num20 * 16 + 8) + screenPosition.X) / 16f);
51259 int num24 = (int)((num22 + screenPosition.Y) / 16f);
51260 Microsoft.Xna.Framework.Color color3 = Lighting.GetColor(num23, num24);
51261 if (tile[num23, num24] == null)
51262 {
51263 tile[num23, num24] = new Tile();
51264 }
51265 if (color3.R > 0 || color3.G > 0 || color3.B > 0)
51266 {
51267 if (!drawToScreen)
51268 {
51269 Lighting.GetCornerColors(num23, num24, out var vertices);
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 }
51272 else if ((color3.R > num || (double)(int)color3.G > (double)num * 1.1 || (double)(int)color3.B > (double)num * 1.2) && !tile[num23, num24].active() && WallLightAt(num23, num24) && ugBackTransition == 0f)
51273 {
51274 Lighting.GetColor9Slice(num23, num24, ref slices);
51275 try
51276 {
51277 for (int num25 = 0; num25 < 9; num25++)
51278 {
51279 int num26 = 0;
51280 int num27 = 0;
51281 int width = 4;
51282 int height = 4;
51285 switch (num25)
51286 {
51287 case 0:
51288 if (!tile[num23 - 1, num24 - 1].active())
51289 {
51290 color5 = slices[num25];
51291 }
51292 break;
51293 case 1:
51294 width = 8;
51295 num26 = 4;
51296 if (!tile[num23, num24 - 1].active())
51297 {
51298 color5 = slices[num25];
51299 }
51300 break;
51301 case 2:
51302 num26 = 12;
51303 if (!tile[num23 + 1, num24 - 1].active())
51304 {
51305 color5 = slices[num25];
51306 }
51307 break;
51308 case 3:
51309 height = 8;
51310 num27 = 4;
51311 if (!tile[num23 - 1, num24].active())
51312 {
51313 color5 = slices[num25];
51314 }
51315 break;
51316 case 4:
51317 width = 8;
51318 height = 8;
51319 num26 = 4;
51320 num27 = 4;
51321 break;
51322 case 5:
51323 num26 = 12;
51324 num27 = 4;
51325 height = 8;
51326 if (!tile[num23 + 1, num24].active())
51327 {
51328 color5 = slices[num25];
51329 }
51330 break;
51331 case 6:
51332 num27 = 12;
51333 if (!tile[num23 - 1, num24 + 1].active())
51334 {
51335 color5 = slices[num25];
51336 }
51337 break;
51338 case 7:
51339 width = 8;
51340 height = 4;
51341 num26 = 4;
51342 num27 = 12;
51343 if (!tile[num23, num24 + 1].active())
51344 {
51345 color5 = slices[num25];
51346 }
51347 break;
51348 case 8:
51349 num26 = 12;
51350 num27 = 12;
51351 if (!tile[num23 + 1, num24 + 1].active())
51352 {
51353 color5 = slices[num25];
51354 }
51355 break;
51356 }
51357 color4.R = (byte)((color3.R + color5.R) / 2);
51358 color4.G = (byte)((color3.G + color5.G) / 2);
51359 color4.B = (byte)((color3.B + color5.B) / 2);
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);
51363 spriteBatch.Draw(TextureAssets.Background[array[1]].Value, new Vector2(bgStartX + num3 * n + 16 * num20 + num26 + num18, bgStartY + backgroundHeight[array[1]] * num19 + 16 * num21 + num27) + vector, new Microsoft.Xna.Framework.Rectangle(16 * num20 + num26 + num18 + 16, 16 * num21 + num27, width, height), color4);
51364 if (ugBackTransition > 0f)
51365 {
51367 color6.R = (byte)((float)(int)color6.R * ugBackTransition);
51368 color6.G = (byte)((float)(int)color6.G * ugBackTransition);
51369 color6.B = (byte)((float)(int)color6.B * ugBackTransition);
51370 color6.A = (byte)((float)(int)color6.A * ugBackTransition);
51371 spriteBatch.Draw(TextureAssets.Background[array2[1]].Value, new Vector2(bgStartX + num3 * n + 16 * num20 + num26 + num18, bgStartY + backgroundHeight[array2[1]] * num19 + 16 * num21 + num27) + vector, new Microsoft.Xna.Framework.Rectangle(16 * num20 + num26 + num18 + 16, 16 * num21 + num27, width, height), color6);
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);
51380 spriteBatch.Draw(TextureAssets.Background[array[1]].Value, new Vector2(bgStartX + num3 * n + 16 * num20 + num18, bgStartY + backgroundHeight[array[1]] * num19 + 16 * num21) + vector, new Microsoft.Xna.Framework.Rectangle(16 * num20 + num18 + 16, 16 * num21, 16, 16), color3);
51381 }
51382 }
51383 else if ((color3.R > num2 || (double)(int)color3.G > (double)num2 * 1.1 || (double)(int)color3.B > (double)num2 * 1.2) && ugBackTransition == 0f)
51384 {
51385 Lighting.GetColor4Slice(num23, num24, ref slices);
51386 for (int num28 = 0; num28 < 4; num28++)
51387 {
51388 int num29 = 0;
51389 int num30 = 0;
51392 switch (num28)
51393 {
51394 case 1:
51395 num29 = 8;
51396 break;
51397 case 2:
51398 num30 = 8;
51399 break;
51400 case 3:
51401 num29 = 8;
51402 num30 = 8;
51403 break;
51404 }
51405 color7.R = (byte)((color3.R + color8.R) / 2);
51406 color7.G = (byte)((color3.G + color8.G) / 2);
51407 color7.B = (byte)((color3.B + color8.B) / 2);
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);
51411 spriteBatch.Draw(TextureAssets.Background[array[1]].Value, new Vector2(bgStartX + num3 * n + 16 * num20 + num29 + num18, bgStartY + backgroundHeight[array[1]] * num19 + 16 * num21 + num30) + vector, new Microsoft.Xna.Framework.Rectangle(16 * num20 + num29 + num18 + 16, 16 * num21 + num30, 8, 8), color7);
51412 if (ugBackTransition > 0f)
51413 {
51415 color9.R = (byte)((float)(int)color9.R * ugBackTransition);
51416 color9.G = (byte)((float)(int)color9.G * ugBackTransition);
51417 color9.B = (byte)((float)(int)color9.B * ugBackTransition);
51418 color9.A = (byte)((float)(int)color9.A * ugBackTransition);
51419 spriteBatch.Draw(TextureAssets.Background[array2[1]].Value, new Vector2(bgStartX + num3 * n + 16 * num20 + num29 + num18, bgStartY + backgroundHeight[array2[1]] * num19 + 16 * num21 + num30) + vector, new Microsoft.Xna.Framework.Rectangle(16 * num20 + num29 + num18 + 16, 16 * num21 + num30, 8, 8), color9);
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);
51428 spriteBatch.Draw(TextureAssets.Background[array[1]].Value, new Vector2(bgStartX + num3 * n + 16 * num20 + num18, bgStartY + backgroundHeight[array[1]] * num19 + 16 * num21) + vector, new Microsoft.Xna.Framework.Rectangle(16 * num20 + num18 + 16, 16 * num21, 16, 16), color3);
51429 if (ugBackTransition > 0f)
51430 {
51432 color10.R = (byte)((float)(int)color10.R * ugBackTransition);
51433 color10.G = (byte)((float)(int)color10.G * ugBackTransition);
51434 color10.B = (byte)((float)(int)color10.B * ugBackTransition);
51435 color10.A = (byte)((float)(int)color10.A * ugBackTransition);
51436 spriteBatch.Draw(TextureAssets.Background[array2[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), color10);
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);
51445 spriteBatch.Draw(TextureAssets.Background[array[1]].Value, new Vector2(bgStartX + num3 * n + 16 * num20 + num18, bgStartY + backgroundHeight[array[1]] * num19 + 16 * num21) + vector, new Microsoft.Xna.Framework.Rectangle(16 * num20 + num18 + 16, 16 * num21, 16, 16), color3);
51446 }
51447 }
51448 }
51449 }
51450 }
51451 if (ugBackTransition > 0f)
51452 {
51453 for (int num31 = 0; num31 < bgLoops; num31++)
51454 {
51455 for (int num32 = 0; num32 < bgLoopsY; num32++)
51456 {
51457 for (int num33 = 0; num33 < num3 / 16; num33++)
51458 {
51459 for (int num34 = 0; num34 < 6; num34++)
51460 {
51461 float num35 = bgStartY + num32 * 96 + num34 * 16 + 8;
51462 int num36 = (int)(((float)(bgStartX + num3 * num31 + num33 * 16 + 8) + screenPosition.X) / 16f);
51463 int num37 = (int)((num35 + screenPosition.Y) / 16f);
51464 Microsoft.Xna.Framework.Color color11 = Lighting.GetColor(num36, num37);
51465 if (tile[num36, num37] == null)
51466 {
51467 tile[num36, num37] = new Tile();
51468 }
51469 if (color11.R > 0 || color11.G > 0 || color11.B > 0)
51470 {
51471 Lighting.GetCornerColors(num36, num37, out var vertices2, ugBackTransition);
51472 byte a = (byte)(255f * ugBackTransition);
51473 vertices2.BottomLeftColor.A = a;
51474 vertices2.BottomRightColor.A = a;
51475 vertices2.TopLeftColor.A = a;
51476 vertices2.TopRightColor.A = a;
51478 }
51479 }
51480 }
51481 }
51482 }
51483 }
51484 if (flag2)
51485 {
51487 bgStartX = (int)(0.0 - Math.IEEERemainder((double)num3 + (double)screenPosition.X * bgParallax, num3) - (double)(num3 / 2)) - (int)vector.X;
51488 bgLoops = (screenWidth + (int)vector.X * 2) / num3 + 2;
51490 if (bgTopY > -32)
51491 {
51492 for (int num38 = 0; num38 < bgLoops; num38++)
51493 {
51494 for (int num39 = 0; num39 < num3 / 16; num39++)
51495 {
51496 float num40 = bgStartX + num3 * num38 + num39 * 16 + 8;
51497 float num41 = bgTopY;
51498 Microsoft.Xna.Framework.Color color12 = Lighting.GetColor((int)((num40 + screenPosition.X) / 16f), (int)((screenPosition.Y + num41) / 16f));
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);
51502 spriteBatch.Draw(TextureAssets.Background[array[2]].Value, new Vector2(bgStartX + num3 * num38 + 16 * num39 + num18, bgTopY) + vector, new Microsoft.Xna.Framework.Rectangle(16 * num39 + num18 + 16, 0, 16, 16), color12);
51503 if (ugBackTransition > 0f)
51504 {
51506 color13.R = (byte)((float)(int)color13.R * ugBackTransition);
51507 color13.G = (byte)((float)(int)color13.G * ugBackTransition);
51508 color13.B = (byte)((float)(int)color13.B * ugBackTransition);
51509 color13.A = (byte)((float)(int)color13.A * ugBackTransition);
51510 spriteBatch.Draw(TextureAssets.Background[array2[2]].Value, new Vector2(bgStartX + num3 * num38 + 16 * num39 + num18, bgTopY) + vector, new Microsoft.Xna.Framework.Rectangle(16 * num39 + num18 + 16, 0, 16, 16), color13);
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 {
51521 bgStartX = (int)(0.0 - Math.IEEERemainder((double)num3 + (double)screenPosition.X * bgParallax, num3) - (double)(num3 / 2)) - (int)vector.X;
51522 bgLoops = (screenWidth + (int)vector.X * 2) / num3 + 2;
51523 if (rockLayer * 16.0 + (double)screenHeight < (double)(screenPosition.Y - 16f))
51524 {
51526 bgLoopsY = (screenHeight - bgStartY + (int)vector.Y * 2) / backgroundHeight[2] + 1;
51527 }
51528 else
51529 {
51530 bgStartY = bgTopY;
51531 bgLoopsY = (screenHeight - bgTopY + (int)vector.Y * 2) / backgroundHeight[2] + 1;
51532 }
51533 if (num16 * 16.0 < (double)(screenPosition.Y + 600f))
51534 {
51535 bgLoopsY = (int)(num16 * 16.0 - (double)screenPosition.Y + 600.0 - (double)bgStartY) / backgroundHeight[2];
51536 flag = true;
51537 }
51538 int num42 = (int)(float)Math.Round(0f - (float)Math.IEEERemainder((float)bgStartX + screenPosition.X, 16.0));
51539 if (num42 == -8)
51540 {
51541 num42 = 8;
51542 }
51543 for (int num43 = 0; num43 < bgLoops; num43++)
51544 {
51545 for (int num44 = 0; num44 < bgLoopsY; num44++)
51546 {
51547 for (int num45 = 0; num45 < num3 / 16; num45++)
51548 {
51549 for (int num46 = 0; num46 < 6; num46++)
51550 {
51551 float num47 = bgStartY + num44 * 96 + num46 * 16 + 8;
51552 int num48 = (int)(((float)(bgStartX + num3 * num43 + num45 * 16 + 8) + screenPosition.X) / 16f);
51553 int num49 = (int)((num47 + screenPosition.Y) / 16f);
51554 Microsoft.Xna.Framework.Color color14 = Lighting.GetColor(num48, num49);
51555 if ((!ShouldDrawBackgroundTileAt(num48, num49) && color14.R != 0 && color14.G != 0 && color14.B != 0) || (color14.R <= 0 && color14.G <= 0 && color14.B <= 0) || (!WallLightAt(num48, num49) && caveParallax == 0f))
51556 {
51557 continue;
51558 }
51559 if (Lighting.NotRetro && color14.R < 230 && color14.G < 230 && color14.B < 230 && ugBackTransition == 0f)
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 {
51563 Lighting.GetColor9Slice(num48, num49, ref slices);
51564 for (int num50 = 0; num50 < 9; num50++)
51565 {
51566 int num51 = 0;
51567 int num52 = 0;
51568 int width2 = 4;
51569 int height2 = 4;
51572 switch (num50)
51573 {
51574 case 0:
51575 if (!tile[num48 - 1, num49 - 1].active())
51576 {
51577 color16 = slices[num50];
51578 }
51579 break;
51580 case 1:
51581 width2 = 8;
51582 num51 = 4;
51583 if (!tile[num48, num49 - 1].active())
51584 {
51585 color16 = slices[num50];
51586 }
51587 break;
51588 case 2:
51589 num51 = 12;
51590 if (!tile[num48 + 1, num49 - 1].active())
51591 {
51592 color16 = slices[num50];
51593 }
51594 break;
51595 case 3:
51596 height2 = 8;
51597 num52 = 4;
51598 if (!tile[num48 - 1, num49].active())
51599 {
51600 color16 = slices[num50];
51601 }
51602 break;
51603 case 4:
51604 width2 = 8;
51605 height2 = 8;
51606 num51 = 4;
51607 num52 = 4;
51608 break;
51609 case 5:
51610 num51 = 12;
51611 num52 = 4;
51612 height2 = 8;
51613 if (!tile[num48 + 1, num49].active())
51614 {
51615 color16 = slices[num50];
51616 }
51617 break;
51618 case 6:
51619 num52 = 12;
51620 if (!tile[num48 - 1, num49 + 1].active())
51621 {
51622 color16 = slices[num50];
51623 }
51624 break;
51625 case 7:
51626 width2 = 8;
51627 height2 = 4;
51628 num51 = 4;
51629 num52 = 12;
51630 if (!tile[num48, num49 + 1].active())
51631 {
51632 color16 = slices[num50];
51633 }
51634 break;
51635 case 8:
51636 num51 = 12;
51637 num52 = 12;
51638 if (!tile[num48 + 1, num49 + 1].active())
51639 {
51640 color16 = slices[num50];
51641 }
51642 break;
51643 }
51644 color15.R = (byte)((color14.R + color16.R) / 2);
51645 color15.G = (byte)((color14.G + color16.G) / 2);
51646 color15.B = (byte)((color14.B + color16.B) / 2);
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);
51651 if (ugBackTransition > 0f)
51652 {
51654 color17.R = (byte)((float)(int)color17.R * ugBackTransition);
51655 color17.G = (byte)((float)(int)color17.G * ugBackTransition);
51656 color17.B = (byte)((float)(int)color17.B * ugBackTransition);
51657 color17.A = (byte)((float)(int)color17.A * ugBackTransition);
51659 }
51660 }
51661 }
51662 else if (color14.R > num2 || (double)(int)color14.G > (double)num2 * 1.1 || (double)(int)color14.B > (double)num2 * 1.2)
51663 {
51664 Lighting.GetColor4Slice(num48, num49, ref slices);
51665 for (int num53 = 0; num53 < 4; num53++)
51666 {
51667 int num54 = 0;
51668 int num55 = 0;
51671 switch (num53)
51672 {
51673 case 1:
51674 num54 = 8;
51675 break;
51676 case 2:
51677 num55 = 8;
51678 break;
51679 case 3:
51680 num54 = 8;
51681 num55 = 8;
51682 break;
51683 }
51684 color18.R = (byte)((color14.R + color19.R) / 2);
51685 color18.G = (byte)((color14.G + color19.G) / 2);
51686 color18.B = (byte)((color14.B + color19.B) / 2);
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);
51691 if (ugBackTransition > 0f)
51692 {
51694 color20.R = (byte)((float)(int)color20.R * ugBackTransition);
51695 color20.G = (byte)((float)(int)color20.G * ugBackTransition);
51696 color20.B = (byte)((float)(int)color20.B * ugBackTransition);
51697 color20.A = (byte)((float)(int)color20.A * ugBackTransition);
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);
51707 spriteBatch.Draw(TextureAssets.Background[array[3]].Value, new Vector2(bgStartX + num3 * num43 + 16 * num45 + num42, bgStartY + backgroundHeight[array[3]] * num44 + 16 * num46) + vector, new Microsoft.Xna.Framework.Rectangle(16 * num45 + num42 + 16, 16 * num46, 16, 16), color14);
51708 if (ugBackTransition > 0f)
51709 {
51711 color21.R = (byte)((float)(int)color21.R * ugBackTransition);
51712 color21.G = (byte)((float)(int)color21.G * ugBackTransition);
51713 color21.B = (byte)((float)(int)color21.B * ugBackTransition);
51714 color21.A = (byte)((float)(int)color21.A * ugBackTransition);
51715 spriteBatch.Draw(TextureAssets.Background[array2[3]].Value, new Vector2(bgStartX + num3 * num43 + 16 * num45 + num42, bgStartY + backgroundHeight[array2[3]] * num44 + 16 * num46) + vector, new Microsoft.Xna.Framework.Rectangle(16 * num45 + num42 + 16, 16 * num46, 16, 16), color21);
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);
51724 spriteBatch.Draw(TextureAssets.Background[array[3]].Value, new Vector2(bgStartX + num3 * num43 + 16 * num45 + num42, bgStartY + backgroundHeight[array[3]] * num44 + 16 * num46) + vector, new Microsoft.Xna.Framework.Rectangle(16 * num45 + num42 + 16, 16 * num46, 16, 16), color14);
51725 if (ugBackTransition > 0f)
51726 {
51728 color22.R = (byte)((float)(int)color22.R * ugBackTransition);
51729 color22.G = (byte)((float)(int)color22.G * ugBackTransition);
51730 color22.B = (byte)((float)(int)color22.B * ugBackTransition);
51731 color22.A = (byte)((float)(int)color22.A * ugBackTransition);
51732 spriteBatch.Draw(TextureAssets.Background[array2[3]].Value, new Vector2(bgStartX + num3 * num43 + 16 * num45 + num42, bgStartY + backgroundHeight[array2[3]] * num44 + 16 * num46) + vector, new Microsoft.Xna.Framework.Rectangle(16 * num45 + num42 + 16, 16 * num46, 16, 16), color22);
51733 }
51734 }
51735 }
51736 }
51737 }
51738 }
51739 num3 = 128;
51740 if (flag)
51741 {
51743 bgStartX = (int)(0.0 - Math.IEEERemainder((double)num3 + (double)screenPosition.X * bgParallax, num3) - (double)(num3 / 2)) - (int)vector.X;
51744 bgLoops = (screenWidth + (int)vector.X * 2) / num3 + 2;
51746 for (int num56 = 0; num56 < bgLoops; num56++)
51747 {
51748 for (int num57 = 0; num57 < num3 / 16; num57++)
51749 {
51750 float num58 = bgStartX + num3 * num56 + num57 * 16 + 8;
51751 float num59 = bgTopY;
51752 Microsoft.Xna.Framework.Color color23 = Lighting.GetColor((int)((num58 + screenPosition.X) / 16f), (int)((screenPosition.Y + num59) / 16f));
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);
51756 spriteBatch.Draw(TextureAssets.Background[array[4]].Value, new Vector2(bgStartX + num3 * num56 + 16 * num57 + num42, bgTopY) + vector, new Microsoft.Xna.Framework.Rectangle(16 * num57 + num42 + 16, magmaBGFrame * 16, 16, 16), color23);
51757 if (ugBackTransition > 0f)
51758 {
51760 color24.R = (byte)((float)(int)color24.R * ugBackTransition);
51761 color24.G = (byte)((float)(int)color24.G * ugBackTransition);
51762 color24.B = (byte)((float)(int)color24.B * ugBackTransition);
51763 color24.A = (byte)((float)(int)color24.A * ugBackTransition);
51764 spriteBatch.Draw(TextureAssets.Background[array2[4]].Value, new Vector2(bgStartX + num3 * num56 + 16 * num57 + num42, bgTopY) + vector, new Microsoft.Xna.Framework.Rectangle(16 * num57 + num42 + 16, magmaBGFrame * 16, 16, 16), color24);
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 {
51773 bgStartX = (int)(0.0 - Math.IEEERemainder((double)num3 + (double)screenPosition.X * bgParallax, num3) - (double)(num3 / 2)) - (int)vector.X;
51774 bgLoops = (screenWidth + (int)vector.X * 2) / num3 + 2;
51775 if (num16 * 16.0 + (double)screenHeight < (double)(screenPosition.Y - 16f))
51776 {
51778 bgLoopsY = (screenHeight - bgStartY + (int)vector.Y * 2) / backgroundHeight[2] + 1;
51779 }
51780 else
51781 {
51782 bgStartY = bgTopY;
51783 bgLoopsY = (screenHeight - bgTopY + (int)vector.Y * 2) / backgroundHeight[2] + 1;
51784 }
51785 num = (int)((double)num * 1.5);
51786 num2 = (int)((double)num2 * 1.5);
51787 int num60 = (int)(float)Math.Round(0f - (float)Math.IEEERemainder((float)bgStartX + screenPosition.X, 16.0));
51788 if (num60 == -8)
51789 {
51790 num60 = 8;
51791 }
51792 for (int num61 = 0; num61 < bgLoops; num61++)
51793 {
51794 for (int num62 = 0; num62 < bgLoopsY; num62++)
51795 {
51796 for (int num63 = 0; num63 < num3 / 16; num63++)
51797 {
51798 for (int num64 = 0; num64 < 6; num64++)
51799 {
51800 float num65 = bgStartY + num62 * 96 + num64 * 16 + 8;
51801 int num66 = (int)(((float)(bgStartX + num3 * num61 + num63 * 16 + 8) + screenPosition.X) / 16f);
51802 int num67 = (int)((num65 + screenPosition.Y) / 16f);
51803 Microsoft.Xna.Framework.Color color25 = Lighting.GetColor(num66, num67);
51804 if ((!ShouldDrawBackgroundTileAt(num66, num67) && color25.R != 0 && color25.G != 0 && color25.B != 0) || (color25.R <= 0 && color25.G <= 0 && color25.B <= 0) || (!WallLightAt(num66, num67) && caveParallax == 0f))
51805 {
51806 continue;
51807 }
51808 if (Lighting.NotRetro && color25.R < 230 && color25.G < 230 && color25.B < 230)
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 {
51812 Lighting.GetColor9Slice(num66, num67, ref slices);
51813 for (int num68 = 0; num68 < 9; num68++)
51814 {
51815 int num69 = 0;
51816 int num70 = 0;
51817 int width3 = 4;
51818 int height3 = 4;
51821 switch (num68)
51822 {
51823 case 0:
51824 if (!tile[num66 - 1, num67 - 1].active())
51825 {
51826 color27 = slices[num68];
51827 }
51828 break;
51829 case 1:
51830 width3 = 8;
51831 num69 = 4;
51832 if (!tile[num66, num67 - 1].active())
51833 {
51834 color27 = slices[num68];
51835 }
51836 break;
51837 case 2:
51838 num69 = 12;
51839 if (!tile[num66 + 1, num67 - 1].active())
51840 {
51841 color27 = slices[num68];
51842 }
51843 break;
51844 case 3:
51845 height3 = 8;
51846 num70 = 4;
51847 if (!tile[num66 - 1, num67].active())
51848 {
51849 color27 = slices[num68];
51850 }
51851 break;
51852 case 4:
51853 width3 = 8;
51854 height3 = 8;
51855 num69 = 4;
51856 num70 = 4;
51857 break;
51858 case 5:
51859 num69 = 12;
51860 num70 = 4;
51861 height3 = 8;
51862 if (!tile[num66 + 1, num67].active())
51863 {
51864 color27 = slices[num68];
51865 }
51866 break;
51867 case 6:
51868 num70 = 12;
51869 if (!tile[num66 - 1, num67 + 1].active())
51870 {
51871 color27 = slices[num68];
51872 }
51873 break;
51874 case 7:
51875 width3 = 8;
51876 height3 = 4;
51877 num69 = 4;
51878 num70 = 12;
51879 if (!tile[num66, num67 + 1].active())
51880 {
51881 color27 = slices[num68];
51882 }
51883 break;
51884 case 8:
51885 num69 = 12;
51886 num70 = 12;
51887 if (!tile[num66 + 1, num67 + 1].active())
51888 {
51889 color27 = slices[num68];
51890 }
51891 break;
51892 }
51893 color26.R = (byte)((color25.R + color27.R) / 2);
51894 color26.G = (byte)((color25.G + color27.G) / 2);
51895 color26.B = (byte)((color25.B + color27.B) / 2);
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);
51900 }
51901 }
51902 else if (color25.R > num2 || (double)(int)color25.G > (double)num2 * 1.1 || (double)(int)color25.B > (double)num2 * 1.2)
51903 {
51904 Lighting.GetColor4Slice(num66, num67, ref slices);
51905 for (int num71 = 0; num71 < 4; num71++)
51906 {
51907 int num72 = 0;
51908 int num73 = 0;
51911 switch (num71)
51912 {
51913 case 1:
51914 num72 = 8;
51915 break;
51916 case 2:
51917 num73 = 8;
51918 break;
51919 case 3:
51920 num72 = 8;
51921 num73 = 8;
51922 break;
51923 }
51924 color28.R = (byte)((color25.R + color29.R) / 2);
51925 color28.G = (byte)((color25.G + color29.G) / 2);
51926 color28.B = (byte)((color25.B + color29.B) / 2);
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 }
51953 Lighting.GlobalBrightness = globalBrightness;
51954 TimeLogger.DrawTime(3, stopwatch.Elapsed.TotalMilliseconds);
51955 }
static float Clamp(float value, float min, float max)
Definition MathHelper.cs:46
static decimal Round(decimal d)
Definition Math.cs:1096
static double IEEERemainder(double x, double y)
Definition Math.cs:679
static Asset< Texture2D >[] Background
static SceneMetrics SceneMetrics
Definition Main.cs:1344
double bgParallax
Definition Main.cs:956
static int maxTilesY
Definition Main.cs:1116
void LoadBackground(int i)
Definition Main.cs:55998
static SpriteBatch spriteBatch
Definition Main.cs:974
static double worldSurface
Definition Main.cs:1272
static float gfxQuality
Definition Main.cs:1056
static bool WallLightAt(int i, int j)
Definition Main.cs:51985
static double rockLayer
Definition Main.cs:1274
static bool drawToScreen
Definition Main.cs:600
static int magmaBGFrame
Definition Main.cs:1096
static int oldUndergroundBackground
Definition Main.cs:558
int bgTopY
Definition Main.cs:966
static int[] caveBackStyle
Definition Main.cs:674
static float ugBackTransition
Definition Main.cs:1268
static int screenHeight
Definition Main.cs:1721
static Vector2 screenPosition
Definition Main.cs:1715
static int undergroundBackground
Definition Main.cs:556
static int offScreenRange
Definition Main.cs:836
int bgLoops
Definition Main.cs:960
static Tile[,] tile
Definition Main.cs:1675
static int hellBackStyle
Definition Main.cs:678
int bgLoopsY
Definition Main.cs:964
static TileBatch tileBatch
Definition Main.cs:976
static int jungleBackStyle
Definition Main.cs:680
int bgStartX
Definition Main.cs:958
int bgStartY
Definition Main.cs:962
static int[] backgroundHeight
Definition Main.cs:1667
static float caveParallax
Definition Main.cs:1216
static int screenWidth
Definition Main.cs:1719
static int iceBackStyle
Definition Main.cs:676
static bool ShouldDrawBackgroundTileAt(int i, int j)
Definition Main.cs:51957
static int[] caveBackX
Definition Main.cs:672

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().