Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void RenderPawnInternal (Vector3 rootLoc, Quaternion quat, bool renderBody, Rot4 bodyFacing, Rot4 headFacing, RotDrawMode bodyDrawType = RotDrawMode.Fresh, bool portrait = false)
- {
- if (!this.graphics.AllResolved) {
- this.graphics.ResolveAllGraphics ();
- }
- Mesh mesh = null;
- if (renderBody) {
- Vector3 loc = rootLoc;
- loc.y += 0.005;
- if (bodyDrawType == RotDrawMode.Dessicated && !this.pawn.RaceProps.Humanlike && this.graphics.dessicatedGraphic != null && !portrait) {
- this.graphics.dessicatedGraphic.Draw (loc, bodyFacing, this.pawn);
- }
- else {
- if (this.pawn.RaceProps.Humanlike) {
- mesh = MeshPool.humanlikeBodySet.MeshAt (bodyFacing);
- }
- else {
- mesh = this.graphics.nakedGraphic.MeshAt (bodyFacing);
- }
- List<Material> list = this.graphics.MatsBodyBaseAt (bodyFacing, bodyDrawType);
- for (int i = 0; i < list.Count; i++) {
- Material damagedMat = this.graphics.flasher.GetDamagedMat (list [i]);
- GenDraw.DrawMeshNowOrLater (mesh, loc, quat, damagedMat, portrait);
- loc.y += 0.005;
- }
- if (bodyDrawType == RotDrawMode.Fresh) {
- Vector3 drawLoc = rootLoc;
- drawLoc.y += 0.02;
- this.woundOverlays.RenderOverBody (drawLoc, mesh, quat, portrait);
- }
- }
- }
- Vector3 loc2 = rootLoc;
- Vector3 a = rootLoc;
- if (bodyFacing != Rot4.North) {
- a.y += 0.03;
- loc2.y += 0.025;
- }
- else {
- a.y += 0.025;
- loc2.y += 0.03;
- }
- if (this.graphics.headGraphic != null) {
- Vector3 b = quat * this.BaseHeadOffsetAt (headFacing);
- Mesh mesh2 = MeshPool.humanlikeHeadSet.MeshAt (headFacing);
- Material mat = this.graphics.HeadMatAt (headFacing, bodyDrawType);
- GenDraw.DrawMeshNowOrLater (mesh2, a + b, quat, mat, portrait);
- Vector3 loc3 = rootLoc + b;
- loc3.y += 0.035;
- bool flag = false;
- Mesh mesh3 = this.graphics.HairMeshSet.MeshAt (headFacing);
- List<ApparelGraphicRecord> apparelGraphics = this.graphics.apparelGraphics;
- for (int j = 0; j < apparelGraphics.Count; j++) {
- if (apparelGraphics [j].sourceApparel.def.apparel.LastLayer == ApparelLayer.Overhead) {
- flag = true;
- Material material = apparelGraphics [j].graphic.MatAt (bodyFacing, null);
- material = this.graphics.flasher.GetDamagedMat (material);
- GenDraw.DrawMeshNowOrLater (mesh3, loc3, quat, material, portrait);
- }
- }
- if (!flag && bodyDrawType != RotDrawMode.Dessicated) {
- Mesh mesh4 = this.graphics.HairMeshSet.MeshAt (headFacing);
- Material mat2 = this.graphics.HairMatAt (headFacing);
- GenDraw.DrawMeshNowOrLater (mesh4, loc3, quat, mat2, portrait);
- }
- }
- if (renderBody) {
- for (int k = 0; k < this.graphics.apparelGraphics.Count; k++) {
- ApparelGraphicRecord apparelGraphicRecord = this.graphics.apparelGraphics [k];
- if (apparelGraphicRecord.sourceApparel.def.apparel.LastLayer == ApparelLayer.Shell) {
- Material material2 = apparelGraphicRecord.graphic.MatAt (bodyFacing, null);
- material2 = this.graphics.flasher.GetDamagedMat (material2);
- GenDraw.DrawMeshNowOrLater (mesh, loc2, quat, material2, portrait);
- }
- }
- }
- if (!portrait) {
- this.DrawEquipment (rootLoc);
- if (this.pawn.apparel != null) {
- List<Apparel> wornApparel = this.pawn.apparel.WornApparel;
- for (int l = 0; l < wornApparel.Count; l++) {
- wornApparel [l].DrawWornExtras ();
- }
- }
- Vector3 bodyLoc = rootLoc;
- bodyLoc.y += 0.045;
- this.statusOverlays.RenderStatusOverlays (bodyLoc, quat, MeshPool.humanlikeHeadSet.MeshAt (headFacing));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement