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

◆ DrawMapFullscreenBackground()

static void Terraria.Main.DrawMapFullscreenBackground ( Vector2 screenPosition,
int screenWidth,
int screenHeight )
inlinestaticprivate

Definition at line 53366 of file Main.cs.

53367 {
53369 int num = -1;
53371 if (tile[(int)(player[myPlayer].Center.X / 16f), (int)(player[myPlayer].Center.Y / 16f)] == null)
53372 {
53373 return;
53374 }
53375 int wall = tile[(int)(player[myPlayer].Center.X / 16f), (int)(player[myPlayer].Center.Y / 16f)].wall;
53376 if (screenPosition.Y > (float)((maxTilesY - 232) * 16))
53377 {
53378 num = 2;
53379 }
53380 else if (player[myPlayer].ZoneDungeon)
53381 {
53382 num = 4;
53383 }
53384 else if (wall == 87)
53385 {
53386 num = 13;
53387 }
53388 else if ((double)screenPosition.Y > worldSurface * 16.0)
53389 {
53390 switch (wall)
53391 {
53392 case 86:
53393 case 108:
53394 num = 15;
53395 break;
53396 case 180:
53397 case 184:
53398 num = 16;
53399 break;
53400 case 178:
53401 case 183:
53402 num = 17;
53403 break;
53404 case 62:
53405 case 263:
53406 num = 18;
53407 break;
53408 default:
53409 num = ((!player[myPlayer].ZoneGlowshroom) ? ((!player[myPlayer].ZoneCorrupt) ? ((!player[myPlayer].ZoneCrimson) ? ((!player[myPlayer].ZoneHallow) ? ((!player[myPlayer].ZoneSnow) ? ((!player[myPlayer].ZoneJungle) ? ((!player[myPlayer].ZoneDesert) ? ((!player[myPlayer].ZoneRockLayerHeight) ? 1 : 31) : 14) : 12) : 3) : ((!player[myPlayer].ZoneDesert) ? ((!player[myPlayer].ZoneSnow) ? 21 : 35) : 41)) : ((!player[myPlayer].ZoneDesert) ? ((!player[myPlayer].ZoneSnow) ? 23 : 34) : 40)) : ((!player[myPlayer].ZoneDesert) ? ((!player[myPlayer].ZoneSnow) ? 22 : 33) : 39)) : 20);
53410 break;
53411 }
53412 }
53413 else if (player[myPlayer].ZoneGlowshroom)
53414 {
53415 num = 19;
53416 }
53417 else
53418 {
53419 color = ColorOfTheSkies;
53420 int num2 = (int)((screenPosition.X + (float)(screenWidth / 2)) / 16f);
53421 if (player[myPlayer].ZoneSkyHeight)
53422 {
53423 num = 32;
53424 }
53425 else if (player[myPlayer].ZoneCorrupt)
53426 {
53427 num = ((!player[myPlayer].ZoneDesert) ? 5 : 36);
53428 }
53429 else if (player[myPlayer].ZoneCrimson)
53430 {
53431 num = ((!player[myPlayer].ZoneDesert) ? 6 : 37);
53432 }
53433 else if (player[myPlayer].ZoneHallow)
53434 {
53435 num = ((!player[myPlayer].ZoneDesert) ? 7 : 38);
53436 }
53437 else if ((double)(screenPosition.Y / 16f) < worldSurface + 10.0 && (num2 < 380 || num2 > maxTilesX - 380))
53438 {
53439 num = 10;
53440 }
53441 else if (player[myPlayer].ZoneSnow)
53442 {
53443 num = 11;
53444 }
53445 else if (player[myPlayer].ZoneJungle)
53446 {
53447 num = 8;
53448 }
53449 else if (player[myPlayer].ZoneDesert)
53450 {
53451 num = 9;
53452 }
53453 else if (bloodMoon)
53454 {
53455 color *= 2f;
53456 num = 25;
53457 }
53458 else if (player[myPlayer].ZoneGraveyard)
53459 {
53460 num = 26;
53461 }
53462 }
53463 if (num > -1)
53464 {
53465 val = TextureAssets.MapBGs[num];
53466 }
53467 spriteBatch.Draw(val.Value, new Microsoft.Xna.Framework.Rectangle(0, 0, screenWidth, screenHeight), color);
53468 }
static Asset< Texture2D >[] MapBGs
static Microsoft.Xna.Framework.Color ColorOfTheSkies
Definition Main.cs:2577
static int maxTilesY
Definition Main.cs:1116
static SpriteBatch spriteBatch
Definition Main.cs:974
static double worldSurface
Definition Main.cs:1272
static int myPlayer
Definition Main.cs:1801
static bool bloodMoon
Definition Main.cs:1296
static int screenHeight
Definition Main.cs:1721
static Vector2 screenPosition
Definition Main.cs:1715
static int maxTilesX
Definition Main.cs:1114
static Tile[,] tile
Definition Main.cs:1675
static int screenWidth
Definition Main.cs:1719
static Player[] player
Definition Main.cs:1803

References Terraria.Main.bloodMoon, Terraria.Main.ColorOfTheSkies, Terraria.GameContent.TextureAssets.MapBGs, Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Main.myPlayer, Terraria.Main.player, Terraria.Main.screenHeight, Terraria.Main.screenPosition, Terraria.Main.screenWidth, Terraria.Main.spriteBatch, Terraria.Main.tile, Microsoft.Xna.Framework.Color.White, and Terraria.Main.worldSurface.

Referenced by Terraria.Main.DrawMap().