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

◆ DrawGore()

void Terraria.Main.DrawGore ( )
inlineprotected

Definition at line 20364 of file Main.cs.

20365 {
20366 drawBackGore = false;
20367 for (int i = 0; i < 600; i++)
20368 {
20369 if (!gore[i].active || gore[i].type <= 0)
20370 {
20371 continue;
20372 }
20373 if (((gore[i].type >= 706 && gore[i].type <= 717) || gore[i].type == 943 || gore[i].type == 1147 || (gore[i].type >= 1160 && gore[i].type <= 1162)) && (gore[i].frame < 7 || gore[i].frame > 9))
20374 {
20375 drawBackGore = true;
20376 continue;
20377 }
20378 LoadGore(gore[i].type);
20379 if (gore[i].Frame.ColumnCount > 1 || gore[i].Frame.RowCount > 1)
20380 {
20381 Microsoft.Xna.Framework.Rectangle sourceRectangle = gore[i].Frame.GetSourceRectangle(TextureAssets.Gore[gore[i].type].Value);
20382 Vector2 vector = new Vector2(0f, 0f);
20383 if (gore[i].type == 1217)
20384 {
20385 vector.Y += 4f;
20386 }
20387 Microsoft.Xna.Framework.Color alpha = gore[i].GetAlpha(Lighting.GetColor((int)((double)gore[i].position.X + (double)sourceRectangle.Width * 0.5) / 16, (int)(((double)gore[i].position.Y + (double)sourceRectangle.Height * 0.5) / 16.0)));
20388 spriteBatch.Draw(TextureAssets.Gore[gore[i].type].Value, new Vector2(gore[i].position.X - screenPosition.X + (float)(sourceRectangle.Width / 2), gore[i].position.Y - screenPosition.Y + (float)(sourceRectangle.Height / 2) - 2f) + vector, sourceRectangle, alpha, gore[i].rotation, new Vector2(sourceRectangle.Width / 2, sourceRectangle.Height / 2), gore[i].scale, SpriteEffects.None, 0f);
20389 }
20390 else
20391 {
20392 Microsoft.Xna.Framework.Color alpha2 = gore[i].GetAlpha(Lighting.GetColor((int)((double)gore[i].position.X + (double)TextureAssets.Gore[gore[i].type].Width() * 0.5) / 16, (int)(((double)gore[i].position.Y + (double)TextureAssets.Gore[gore[i].type].Height() * 0.5) / 16.0)));
20393 spriteBatch.Draw(TextureAssets.Gore[gore[i].type].Value, new Vector2(gore[i].position.X - screenPosition.X + (float)(TextureAssets.Gore[gore[i].type].Width() / 2), gore[i].position.Y - screenPosition.Y + (float)(TextureAssets.Gore[gore[i].type].Height() / 2)), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Gore[gore[i].type].Width(), TextureAssets.Gore[gore[i].type].Height()), alpha2, gore[i].rotation, new Vector2(TextureAssets.Gore[gore[i].type].Width() / 2, TextureAssets.Gore[gore[i].type].Height() / 2), gore[i].scale, SpriteEffects.None, 0f);
20394 }
20395 }
20396 TimeLogger.DetailedDrawTime(24);
20397 }
static Asset< Texture2D >[] Gore
static bool drawBackGore
Definition Main.cs:387
static SpriteBatch spriteBatch
Definition Main.cs:974
static Gore[] gore
Definition Main.cs:1687
static Vector2 screenPosition
Definition Main.cs:1715
void LoadGore(int i)
Definition Main.cs:56050

References Terraria.TimeLogger.DetailedDrawTime(), Terraria.Main.drawBackGore, Terraria.Lighting.GetColor(), Terraria.GameContent.TextureAssets.Gore, Terraria.Main.gore, System.Text.RegularExpressions.i, Terraria.Main.LoadGore(), Terraria.Main.screenPosition, Terraria.Main.spriteBatch, System.type, and Microsoft.Xna.Framework.Graphics.Vector2.

Referenced by Terraria.Main.DoDraw(), and Terraria.Main.DrawCapture().