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

◆ GetCornerColors()

static void Terraria.Lighting.GetCornerColors ( int centerX,
int centerY,
out VertexColors vertices,
float scale = 1f )
inlinestatic

Definition at line 432 of file Lighting.cs.

433 {
434 //IL_000e: Unknown result type (might be due to invalid IL or missing references)
435 //IL_0013: Unknown result type (might be due to invalid IL or missing references)
436 //IL_001d: Unknown result type (might be due to invalid IL or missing references)
437 //IL_002b: Unknown result type (might be due to invalid IL or missing references)
438 //IL_0030: Unknown result type (might be due to invalid IL or missing references)
439 //IL_003a: Unknown result type (might be due to invalid IL or missing references)
440 //IL_003f: Unknown result type (might be due to invalid IL or missing references)
441 //IL_0049: Unknown result type (might be due to invalid IL or missing references)
442 //IL_004e: Unknown result type (might be due to invalid IL or missing references)
443 //IL_005a: Unknown result type (might be due to invalid IL or missing references)
444 //IL_005f: Unknown result type (might be due to invalid IL or missing references)
445 //IL_006c: Unknown result type (might be due to invalid IL or missing references)
446 //IL_0071: Unknown result type (might be due to invalid IL or missing references)
447 //IL_007e: Unknown result type (might be due to invalid IL or missing references)
448 //IL_0083: Unknown result type (might be due to invalid IL or missing references)
449 //IL_0090: Unknown result type (might be due to invalid IL or missing references)
450 //IL_0095: Unknown result type (might be due to invalid IL or missing references)
451 //IL_00a6: Unknown result type (might be due to invalid IL or missing references)
452 //IL_00ac: Unknown result type (might be due to invalid IL or missing references)
453 //IL_00b4: Unknown result type (might be due to invalid IL or missing references)
454 //IL_00bb: Unknown result type (might be due to invalid IL or missing references)
455 //IL_00c8: Unknown result type (might be due to invalid IL or missing references)
456 //IL_00ce: Unknown result type (might be due to invalid IL or missing references)
457 //IL_00d6: Unknown result type (might be due to invalid IL or missing references)
458 //IL_00dd: Unknown result type (might be due to invalid IL or missing references)
459 //IL_00ea: Unknown result type (might be due to invalid IL or missing references)
460 //IL_00f0: Unknown result type (might be due to invalid IL or missing references)
461 //IL_00f8: Unknown result type (might be due to invalid IL or missing references)
462 //IL_00ff: Unknown result type (might be due to invalid IL or missing references)
463 //IL_0162: Unknown result type (might be due to invalid IL or missing references)
464 //IL_0168: Unknown result type (might be due to invalid IL or missing references)
465 //IL_0170: Unknown result type (might be due to invalid IL or missing references)
466 //IL_0177: Unknown result type (might be due to invalid IL or missing references)
467 //IL_0184: Unknown result type (might be due to invalid IL or missing references)
468 //IL_018a: Unknown result type (might be due to invalid IL or missing references)
469 //IL_0192: Unknown result type (might be due to invalid IL or missing references)
470 //IL_0199: Unknown result type (might be due to invalid IL or missing references)
471 //IL_01ab: Unknown result type (might be due to invalid IL or missing references)
472 //IL_01b3: Unknown result type (might be due to invalid IL or missing references)
473 //IL_01ba: Unknown result type (might be due to invalid IL or missing references)
474 //IL_021d: Unknown result type (might be due to invalid IL or missing references)
475 //IL_0223: Unknown result type (might be due to invalid IL or missing references)
476 //IL_022b: Unknown result type (might be due to invalid IL or missing references)
477 //IL_0232: Unknown result type (might be due to invalid IL or missing references)
478 //IL_023f: Unknown result type (might be due to invalid IL or missing references)
479 //IL_0245: Unknown result type (might be due to invalid IL or missing references)
480 //IL_024d: Unknown result type (might be due to invalid IL or missing references)
481 //IL_0254: Unknown result type (might be due to invalid IL or missing references)
482 //IL_0261: Unknown result type (might be due to invalid IL or missing references)
483 //IL_0267: Unknown result type (might be due to invalid IL or missing references)
484 //IL_026f: Unknown result type (might be due to invalid IL or missing references)
485 //IL_0276: Unknown result type (might be due to invalid IL or missing references)
486 //IL_02d9: Unknown result type (might be due to invalid IL or missing references)
487 //IL_02df: Unknown result type (might be due to invalid IL or missing references)
488 //IL_02e7: Unknown result type (might be due to invalid IL or missing references)
489 //IL_02ee: Unknown result type (might be due to invalid IL or missing references)
490 //IL_02fb: Unknown result type (might be due to invalid IL or missing references)
491 //IL_0301: Unknown result type (might be due to invalid IL or missing references)
492 //IL_0309: Unknown result type (might be due to invalid IL or missing references)
493 //IL_0310: Unknown result type (might be due to invalid IL or missing references)
494 //IL_031d: Unknown result type (might be due to invalid IL or missing references)
495 //IL_0323: Unknown result type (might be due to invalid IL or missing references)
496 //IL_032b: Unknown result type (might be due to invalid IL or missing references)
497 //IL_0332: Unknown result type (might be due to invalid IL or missing references)
498 vertices = default(VertexColors);
499 Vector3 color = _activeEngine.GetColor(centerX, centerY);
500 Vector3 color9 = _activeEngine.GetColor(centerX, centerY - 1);
501 Vector3 color2 = _activeEngine.GetColor(centerX, centerY + 1);
502 Vector3 color3 = _activeEngine.GetColor(centerX - 1, centerY);
503 Vector3 color4 = _activeEngine.GetColor(centerX + 1, centerY);
504 Vector3 color5 = _activeEngine.GetColor(centerX - 1, centerY - 1);
505 Vector3 color6 = _activeEngine.GetColor(centerX + 1, centerY - 1);
506 Vector3 color7 = _activeEngine.GetColor(centerX - 1, centerY + 1);
507 Vector3 color8 = _activeEngine.GetColor(centerX + 1, centerY + 1);
508 float num = GlobalBrightness * scale * 63.75f;
509 int num2 = (int)((color9.X + color5.X + color3.X + color.X) * num);
510 int num3 = (int)((color9.Y + color5.Y + color3.Y + color.Y) * num);
511 int num4 = (int)((color9.Z + color5.Z + color3.Z + color.Z) * num);
512 if (num2 > 255)
513 {
514 num2 = 255;
515 }
516 if (num3 > 255)
517 {
518 num3 = 255;
519 }
520 if (num4 > 255)
521 {
522 num4 = 255;
523 }
524 num3 <<= 8;
525 num4 <<= 16;
526 ((Color)(ref vertices.TopLeftColor)).PackedValue = (uint)(num2 | num3 | num4) | 0xFF000000u;
527 num2 = (int)((color9.X + color6.X + color4.X + color.X) * num);
528 num3 = (int)((color9.Y + color6.Y + color4.Y + color.Y) * num);
529 num4 = (int)((color9.Z + color6.Z + color4.Z + color.Z) * num);
530 if (num2 > 255)
531 {
532 num2 = 255;
533 }
534 if (num3 > 255)
535 {
536 num3 = 255;
537 }
538 if (num4 > 255)
539 {
540 num4 = 255;
541 }
542 num3 <<= 8;
543 num4 <<= 16;
544 ((Color)(ref vertices.TopRightColor)).PackedValue = (uint)(num2 | num3 | num4) | 0xFF000000u;
545 num2 = (int)((color2.X + color7.X + color3.X + color.X) * num);
546 num3 = (int)((color2.Y + color7.Y + color3.Y + color.Y) * num);
547 num4 = (int)((color2.Z + color7.Z + color3.Z + color.Z) * num);
548 if (num2 > 255)
549 {
550 num2 = 255;
551 }
552 if (num3 > 255)
553 {
554 num3 = 255;
555 }
556 if (num4 > 255)
557 {
558 num4 = 255;
559 }
560 num3 <<= 8;
561 num4 <<= 16;
562 ((Color)(ref vertices.BottomLeftColor)).PackedValue = (uint)(num2 | num3 | num4) | 0xFF000000u;
563 num2 = (int)((color2.X + color8.X + color4.X + color.X) * num);
564 num3 = (int)((color2.Y + color8.Y + color4.Y + color.Y) * num);
565 num4 = (int)((color2.Z + color8.Z + color4.Z + color.Z) * num);
566 if (num2 > 255)
567 {
568 num2 = 255;
569 }
570 if (num3 > 255)
571 {
572 num3 = 255;
573 }
574 if (num4 > 255)
575 {
576 num4 = 255;
577 }
578 num3 <<= 8;
579 num4 <<= 16;
580 ((Color)(ref vertices.BottomRightColor)).PackedValue = (uint)(num2 | num3 | num4) | 0xFF000000u;
581 }
static ILightingEngine _activeEngine
Definition Lighting.cs:25
static float GlobalBrightness
Definition Lighting.cs:27

References Terraria.Lighting._activeEngine, Terraria.Graphics.Light.Color, and Terraria.Lighting.GlobalBrightness.

Referenced by Terraria.Main.DrawBackground(), Terraria.GameContent.Liquid.LiquidRenderer.DrawNormalLiquids(), Terraria.GameContent.Liquid.LiquidRenderer.DrawShimmer(), Terraria.GameContent.Drawing.TileDrawing.DrawTile_LiquidBehindTile(), Terraria.GameContent.Drawing.WallDrawing.DrawWalls(), Terraria.WaterfallManager.DrawWaterfall(), and Terraria.Main.OldDrawBackground().

+ Here is the caller graph for this function: