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

◆ DrawGoreBehind()

void Terraria.Main.DrawGoreBehind ( )
inlineprotected

Definition at line 21283 of file Main.cs.

21284 {
21285 //IL_00d1: Unknown result type (might be due to invalid IL or missing references)
21286 //IL_00d6: Unknown result type (might be due to invalid IL or missing references)
21287 //IL_00f0: Unknown result type (might be due to invalid IL or missing references)
21288 //IL_0118: Unknown result type (might be due to invalid IL or missing references)
21289 //IL_0135: Unknown result type (might be due to invalid IL or missing references)
21290 //IL_013a: Unknown result type (might be due to invalid IL or missing references)
21291 //IL_013f: Unknown result type (might be due to invalid IL or missing references)
21292 //IL_0179: Unknown result type (might be due to invalid IL or missing references)
21293 //IL_019f: Unknown result type (might be due to invalid IL or missing references)
21294 //IL_01af: Unknown result type (might be due to invalid IL or missing references)
21295 //IL_01bb: Unknown result type (might be due to invalid IL or missing references)
21296 //IL_01c0: Unknown result type (might be due to invalid IL or missing references)
21297 //IL_01c5: Unknown result type (might be due to invalid IL or missing references)
21298 //IL_01cb: Unknown result type (might be due to invalid IL or missing references)
21299 //IL_01d9: Unknown result type (might be due to invalid IL or missing references)
21300 //IL_01e2: Unknown result type (might be due to invalid IL or missing references)
21301 //IL_01eb: Unknown result type (might be due to invalid IL or missing references)
21302 //IL_028c: Unknown result type (might be due to invalid IL or missing references)
21303 //IL_0291: Unknown result type (might be due to invalid IL or missing references)
21304 //IL_0296: Unknown result type (might be due to invalid IL or missing references)
21305 //IL_0322: Unknown result type (might be due to invalid IL or missing references)
21306 //IL_032e: Unknown result type (might be due to invalid IL or missing references)
21307 //IL_0333: Unknown result type (might be due to invalid IL or missing references)
21308 //IL_0368: Unknown result type (might be due to invalid IL or missing references)
21309 //IL_0372: Unknown result type (might be due to invalid IL or missing references)
21310 //IL_03b4: Unknown result type (might be due to invalid IL or missing references)
21311 for (int i = 0; i < 600; i++)
21312 {
21313 if (!gore[i].active || gore[i].type <= 0)
21314 {
21315 continue;
21316 }
21317 bool flag = false;
21318 if (GoreID.Sets.DrawBehind[gore[i].type])
21319 {
21320 if (gore[i].type < GoreID.Count)
21321 {
21322 byte frame = gore[i].frame;
21323 if (frame >= 7 && frame <= 9)
21324 {
21325 goto IL_006b;
21326 }
21327 }
21328 flag = true;
21329 }
21330 goto IL_006b;
21331 IL_006b:
21332 if (flag)
21333 {
21334 LoadGore(gore[i].type);
21335 if (gore[i].Frame.ColumnCount > 1 || gore[i].Frame.RowCount > 1)
21336 {
21337 Rectangle sourceRectangle = gore[i].Frame.GetSourceRectangle(TextureAssets.Gore[gore[i].type].Value);
21338 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)));
21339 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) + gore[i].drawOffset, (Rectangle?)sourceRectangle, alpha, gore[i].rotation, new Vector2((float)(sourceRectangle.Width / 2), (float)(sourceRectangle.Height / 2)), gore[i].scale, (SpriteEffects)0, 0f);
21340 }
21341 else
21342 {
21343 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)));
21344 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)) + gore[i].drawOffset, (Rectangle?)new Rectangle(0, 0, TextureAssets.Gore[gore[i].type].Width(), TextureAssets.Gore[gore[i].type].Height()), alpha2, gore[i].rotation, new Vector2((float)(TextureAssets.Gore[gore[i].type].Width() / 2), (float)(TextureAssets.Gore[gore[i].type].Height() / 2)), gore[i].scale, (SpriteEffects)0, 0f);
21345 }
21346 }
21347 }
21348 }
static Asset< Texture2D >[] Gore
static bool[] DrawBehind
If true for a given gore type (F:Terraria.Gore.type), then that gore draws behind tiles....
Definition GoreID.cs:42
static readonly short Count
Definition GoreID.cs:1517
static SpriteBatch spriteBatch
Definition Main.cs:1043
static Gore[] gore
Definition Main.cs:1832
static Vector2 screenPosition
The position of the top left corner of the screen in world coordinates. Modify in M:Terraria....
Definition Main.cs:1864
void LoadGore(int i)
Definition Main.cs:75405

References Terraria.ID.GoreID.Count, Terraria.ID.GoreID.Sets.DrawBehind, Terraria.Lighting.GetColor(), Terraria.GameContent.TextureAssets.Gore, Terraria.Main.gore, Terraria.Main.LoadGore(), Terraria.Main.screenPosition, and Terraria.Main.spriteBatch.

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

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