Advertisement
Guest User

Untitled

a guest
Nov 12th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.59 KB | None | 0 0
  1. private void RenderPawnInternal (Vector3 rootLoc, Quaternion quat, bool renderBody, Rot4 bodyFacing, Rot4 headFacing, RotDrawMode bodyDrawType = RotDrawMode.Fresh, bool portrait = false)
  2.         {
  3.             if (!this.graphics.AllResolved) {
  4.                 this.graphics.ResolveAllGraphics ();
  5.             }
  6.             Mesh mesh = null;
  7.             if (renderBody) {
  8.                 Vector3 loc = rootLoc;
  9.                 loc.y += 0.005;
  10.                 if (bodyDrawType == RotDrawMode.Dessicated && !this.pawn.RaceProps.Humanlike && this.graphics.dessicatedGraphic != null && !portrait) {
  11.                     this.graphics.dessicatedGraphic.Draw (loc, bodyFacing, this.pawn);
  12.                 }
  13.                 else {
  14.                     if (this.pawn.RaceProps.Humanlike) {
  15.                         mesh = MeshPool.humanlikeBodySet.MeshAt (bodyFacing);
  16.                     }
  17.                     else {
  18.                         mesh = this.graphics.nakedGraphic.MeshAt (bodyFacing);
  19.                     }
  20.                     List<Material> list = this.graphics.MatsBodyBaseAt (bodyFacing, bodyDrawType);
  21.                     for (int i = 0; i < list.Count; i++) {
  22.                         Material damagedMat = this.graphics.flasher.GetDamagedMat (list [i]);
  23.                         GenDraw.DrawMeshNowOrLater (mesh, loc, quat, damagedMat, portrait);
  24.                         loc.y += 0.005;
  25.                     }
  26.                     if (bodyDrawType == RotDrawMode.Fresh) {
  27.                         Vector3 drawLoc = rootLoc;
  28.                         drawLoc.y += 0.02;
  29.                         this.woundOverlays.RenderOverBody (drawLoc, mesh, quat, portrait);
  30.                     }
  31.                 }
  32.             }
  33.             Vector3 loc2 = rootLoc;
  34.             Vector3 a = rootLoc;
  35.             if (bodyFacing != Rot4.North) {
  36.                 a.y += 0.03;
  37.                 loc2.y += 0.025;
  38.             }
  39.             else {
  40.                 a.y += 0.025;
  41.                 loc2.y += 0.03;
  42.             }
  43.             if (this.graphics.headGraphic != null) {
  44.                 Vector3 b = quat * this.BaseHeadOffsetAt (headFacing);
  45.                 Mesh mesh2 = MeshPool.humanlikeHeadSet.MeshAt (headFacing);
  46.                 Material mat = this.graphics.HeadMatAt (headFacing, bodyDrawType);
  47.                 GenDraw.DrawMeshNowOrLater (mesh2, a + b, quat, mat, portrait);
  48.                 Vector3 loc3 = rootLoc + b;
  49.                 loc3.y += 0.035;
  50.                 bool flag = false;
  51.                 Mesh mesh3 = this.graphics.HairMeshSet.MeshAt (headFacing);
  52.                 List<ApparelGraphicRecord> apparelGraphics = this.graphics.apparelGraphics;
  53.                 for (int j = 0; j < apparelGraphics.Count; j++) {
  54.                     if (apparelGraphics [j].sourceApparel.def.apparel.LastLayer == ApparelLayer.Overhead) {
  55.                         flag = true;
  56.                         Material material = apparelGraphics [j].graphic.MatAt (bodyFacing, null);
  57.                         material = this.graphics.flasher.GetDamagedMat (material);
  58.                         GenDraw.DrawMeshNowOrLater (mesh3, loc3, quat, material, portrait);
  59.                     }
  60.                 }
  61.                 if (!flag && bodyDrawType != RotDrawMode.Dessicated) {
  62.                     Mesh mesh4 = this.graphics.HairMeshSet.MeshAt (headFacing);
  63.                     Material mat2 = this.graphics.HairMatAt (headFacing);
  64.                     GenDraw.DrawMeshNowOrLater (mesh4, loc3, quat, mat2, portrait);
  65.                 }
  66.             }
  67.             if (renderBody) {
  68.                 for (int k = 0; k < this.graphics.apparelGraphics.Count; k++) {
  69.                     ApparelGraphicRecord apparelGraphicRecord = this.graphics.apparelGraphics [k];
  70.                     if (apparelGraphicRecord.sourceApparel.def.apparel.LastLayer == ApparelLayer.Shell) {
  71.                         Material material2 = apparelGraphicRecord.graphic.MatAt (bodyFacing, null);
  72.                         material2 = this.graphics.flasher.GetDamagedMat (material2);
  73.                         GenDraw.DrawMeshNowOrLater (mesh, loc2, quat, material2, portrait);
  74.                     }
  75.                 }
  76.             }
  77.             if (!portrait) {
  78.                 this.DrawEquipment (rootLoc);
  79.                 if (this.pawn.apparel != null) {
  80.                     List<Apparel> wornApparel = this.pawn.apparel.WornApparel;
  81.                     for (int l = 0; l < wornApparel.Count; l++) {
  82.                         wornApparel [l].DrawWornExtras ();
  83.                     }
  84.                 }
  85.                 Vector3 bodyLoc = rootLoc;
  86.                 bodyLoc.y += 0.045;
  87.                 this.statusOverlays.RenderStatusOverlays (bodyLoc, quat, MeshPool.humanlikeHeadSet.MeshAt (headFacing));
  88.             }
  89.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement