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

◆ DrawToMap_Section()

void Terraria.Main.DrawToMap_Section ( int secX,
int secY )
inlineprotected

Definition at line 70497 of file Main.cs.

70498 {
70499 //IL_0065: Unknown result type (might be due to invalid IL or missing references)
70500 //IL_008b: Unknown result type (might be due to invalid IL or missing references)
70501 //IL_0090: Unknown result type (might be due to invalid IL or missing references)
70502 //IL_0145: Unknown result type (might be due to invalid IL or missing references)
70503 //IL_014a: Unknown result type (might be due to invalid IL or missing references)
70504 Stopwatch stopwatch = Stopwatch.StartNew();
70506 int num = secX * 200;
70507 int num2 = num + 200;
70508 int num3 = secY * 150;
70509 int num4 = num3 + 150;
70510 int num5 = num / textureMaxWidth;
70511 int num6 = num3 / textureMaxHeight;
70512 int num7 = num % textureMaxWidth;
70513 int num8 = num3 % textureMaxHeight;
70514 if (!checkMap(num5, num6))
70515 {
70516 return;
70517 }
70518 int num9 = 0;
70519 _ = Color.Transparent;
70520 for (int i = num3; i < num4; i++)
70521 {
70522 for (int j = num; j < num2; j++)
70523 {
70524 MapTile mapTile = Map[j, i];
70526 num9++;
70527 }
70528 }
70529 try
70530 {
70531 ((Game)this).GraphicsDevice.SetRenderTarget(mapTarget[num5, num6]);
70532 }
70534 {
70535 initMap[num5, num6] = false;
70536 return;
70537 }
70538 spriteBatch.Begin((SpriteSortMode)1, BlendState.AlphaBlend);
70539 _ = stopwatch.Elapsed.TotalMilliseconds;
70540 ((Texture2D)mapSectionTexture).SetData<Color>(mapColorCacheArray, 0, mapColorCacheArray.Length);
70541 _ = stopwatch.Elapsed.TotalMilliseconds;
70542 _ = stopwatch.Elapsed.TotalMilliseconds;
70543 spriteBatch.Draw((Texture2D)(object)mapSectionTexture, new Vector2((float)num7, (float)num8), Color.White);
70544 spriteBatch.End();
70545 ((Game)this).GraphicsDevice.SetRenderTarget((RenderTarget2D)null);
70546 _ = stopwatch.Elapsed.TotalMilliseconds;
70547 stopwatch.Stop();
70548 }
bool checkMap(int i, int j)
Definition Main.cs:74133
RenderTarget2D[,] mapTarget
Definition Main.cs:961
static SpriteBatch spriteBatch
Definition Main.cs:1043
static int textureMaxHeight
Definition Main.cs:939
static int textureMaxWidth
Definition Main.cs:937
RenderTarget2D mapSectionTexture
Definition Main.cs:963
static bool[,] initMap
Definition Main.cs:965
static Color[] _mapColorCacheArray
Definition Main.cs:419
static Color GetMapTileXnaColor(ref MapTile tile)

References Terraria.Main._mapColorCacheArray, Terraria.Main.checkMap(), Terraria.UI.Game, Terraria.Map.MapHelper.GetMapTileXnaColor(), Terraria.Main.initMap, Terraria.Main.mapSectionTexture, Terraria.Main.mapTarget, Terraria.Main.spriteBatch, Terraria.Main.textureMaxHeight, and Terraria.Main.textureMaxWidth.

Referenced by Terraria.Main.DoDraw().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: