templeos-info/public/Wb/Apps/GrModels/ManGen.HC.HTML

352 lines
27 KiB
HTML
Executable File

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="generator" content="TempleOS V5.03">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="/style/templeos.css">
<script src="/script/templeos.js"></script>
<style type="text/css">
.cF0{color:#000000;background-color:#ffffff;}
.cF1{color:#0000aa;background-color:#ffffff;}
.cF2{color:#00aa00;background-color:#ffffff;}
.cF3{color:#00aaaa;background-color:#ffffff;}
.cF4{color:#aa0000;background-color:#ffffff;}
.cF5{color:#aa00aa;background-color:#ffffff;}
.cF6{color:#aa5500;background-color:#ffffff;}
.cF7{color:#aaaaaa;background-color:#ffffff;}
.cF8{color:#555555;background-color:#ffffff;}
.cF9{color:#5555ff;background-color:#ffffff;}
.cFA{color:#55ff55;background-color:#ffffff;}
.cFB{color:#55ffff;background-color:#ffffff;}
.cFC{color:#ff5555;background-color:#ffffff;}
.cFD{color:#ff55ff;background-color:#ffffff;}
.cFE{color:#ffff55;background-color:#ffffff;}
.cFF{color:#ffffff;background-color:#ffffff;}
</style>
</head>
<body>
<pre id="content">
<a name="l1"></a><span class=cF2>//Makes a mesh man.</span><span class=cF0>
<a name="l2"></a>
<a name="l3"></a>#</span><span class=cF1>define</span><span class=cF0> VERTICES_NUM 1024
<a name="l4"></a>#</span><span class=cF1>define</span><span class=cF0> TRIS_NUM 1024
<a name="l5"></a>
<a name="l6"></a></span><span class=cF1>class</span><span class=cF0> </span><span class=cF5>Man</span><span class=cF0>
<a name="l7"></a>{
<a name="l8"></a> </span><span class=cF9>I32</span><span class=cF0> vertex_cnt;
<a name="l9"></a> </span><span class=cF9>I32</span><span class=cF0> tri_cnt;
<a name="l10"></a> </span><span class=cF9>CD3I32</span><span class=cF0> v[VERTICES_NUM];
<a name="l11"></a> </span><span class=cF9>CMeshTri</span><span class=cF0> t[TRIS_NUM];
<a name="l12"></a>} *m;
<a name="l13"></a>
<a name="l14"></a></span><span class=cF1>class</span><span class=cF0> ManDefineStruct
<a name="l15"></a>{
<a name="l16"></a> </span><span class=cF1>F64</span><span class=cF0> head_rad format
<a name="l17"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;Head Radius :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l18"></a>
<a name="l19"></a> </span><span class=cF1>F64</span><span class=cF0> torso_len format
<a name="l20"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;Torso Length :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l21"></a> </span><span class=cF1>F64</span><span class=cF0> arm_len format
<a name="l22"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;Arm Length :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l23"></a> </span><span class=cF1>F64</span><span class=cF0> hand_len format
<a name="l24"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;Hand Length :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l25"></a> </span><span class=cF1>F64</span><span class=cF0> leg_len format
<a name="l26"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;Leg Length :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l27"></a> </span><span class=cF1>F64</span><span class=cF0> foot_len format
<a name="l28"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;Foot Length :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l29"></a> </span><span class=cF1>F64</span><span class=cF0> torso_width format
<a name="l30"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;Torso Width :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l31"></a> </span><span class=cF1>F64</span><span class=cF0> torso_depth format
<a name="l32"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;Torso Depth :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l33"></a> </span><span class=cF1>F64</span><span class=cF0> arm_rad format
<a name="l34"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;Arm Radius :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l35"></a> </span><span class=cF1>F64</span><span class=cF0> hand_rad format
<a name="l36"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;Hand Radius :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l37"></a> </span><span class=cF1>F64</span><span class=cF0> leg_rad format
<a name="l38"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;Leg Radius :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l39"></a> </span><span class=cF1>F64</span><span class=cF0> foot_rad format
<a name="l40"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;Foot Radius :%8.3f\&quot;$\n\n&quot;</span><span class=cF0>;
<a name="l41"></a>
<a name="l42"></a> </span><span class=cF1>F64</span><span class=cF0> r_shoulder_a1 format
<a name="l43"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;R.Shoulder Front/Back Angle:%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l44"></a> </span><span class=cF1>F64</span><span class=cF0> l_shoulder_a1 format
<a name="l45"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;L.Shoulder Front/Back Angle:%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l46"></a> </span><span class=cF1>F64</span><span class=cF0> r_hip_a1 format
<a name="l47"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;R.Hip Front/Back Angle :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l48"></a> </span><span class=cF1>F64</span><span class=cF0> l_hip_a1 format
<a name="l49"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;L.Hip Front/Back Angle :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l50"></a>
<a name="l51"></a> </span><span class=cF1>F64</span><span class=cF0> r_shoulder_a2 format
<a name="l52"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;R.Shoulder Side Angle :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l53"></a> </span><span class=cF1>F64</span><span class=cF0> l_shoulder_a2 format
<a name="l54"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;L.Shoulder Side Angle :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l55"></a> </span><span class=cF1>F64</span><span class=cF0> r_hip_a2 format
<a name="l56"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;R.Hip Side Angle :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l57"></a> </span><span class=cF1>F64</span><span class=cF0> l_hip_a2 format
<a name="l58"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;L.Hip Side Angle :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l59"></a>
<a name="l60"></a> </span><span class=cF1>F64</span><span class=cF0> r_elbow_a format
<a name="l61"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;R.Elbow Angle :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l62"></a> </span><span class=cF1>F64</span><span class=cF0> l_elbow_a format
<a name="l63"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;L.Elbow Angle :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l64"></a> </span><span class=cF1>F64</span><span class=cF0> r_knee_a format
<a name="l65"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;R.Knee Angle :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l66"></a> </span><span class=cF1>F64</span><span class=cF0> l_knee_a format
<a name="l67"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;L.Knee Angle :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l68"></a>
<a name="l69"></a> </span><span class=cF1>F64</span><span class=cF0> r_wrist_a format
<a name="l70"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;R.Wrist Angle :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l71"></a> </span><span class=cF1>F64</span><span class=cF0> l_wrist_a format
<a name="l72"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;L.Wrist Angle :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l73"></a> </span><span class=cF1>F64</span><span class=cF0> r_ankle_a format
<a name="l74"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;R.Ankle Angle :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l75"></a> </span><span class=cF1>F64</span><span class=cF0> l_ankle_a format
<a name="l76"></a> </span><span class=cF6>&quot;$DA-TRM,A=\&quot;L.Ankle Angle :%8.3f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l77"></a>
<a name="l78"></a>};
<a name="l79"></a>
<a name="l80"></a></span><span class=cF1>U0</span><span class=cF0> MDInit(ManDefineStruct *md)
<a name="l81"></a>{
<a name="l82"></a> </span><span class=cF5>MemSet</span><span class=cF0>(md,0,</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>ManDefineStruct</span><span class=cF7>)</span><span class=cF0>);
<a name="l83"></a>
<a name="l84"></a> md-&gt;head_rad =5.0;
<a name="l85"></a>
<a name="l86"></a> md-&gt;torso_len =35.0;
<a name="l87"></a> md-&gt;arm_len =30.0;
<a name="l88"></a> md-&gt;hand_len =8.0;
<a name="l89"></a> md-&gt;leg_len =32.0;
<a name="l90"></a> md-&gt;foot_len =16.0;
<a name="l91"></a> md-&gt;torso_width=20.0;
<a name="l92"></a> md-&gt;torso_depth=10.0;
<a name="l93"></a> md-&gt;arm_rad =3.5;
<a name="l94"></a> md-&gt;hand_rad =2.0;
<a name="l95"></a> md-&gt;leg_rad =4.0;
<a name="l96"></a> md-&gt;foot_rad =3.0;
<a name="l97"></a>
<a name="l98"></a> md-&gt;r_shoulder_a1 =30;
<a name="l99"></a> md-&gt;l_shoulder_a1 =-30;
<a name="l100"></a> md-&gt;r_hip_a1 =-45;
<a name="l101"></a> md-&gt;l_hip_a1 =45;
<a name="l102"></a>
<a name="l103"></a> md-&gt;r_shoulder_a2 =10;
<a name="l104"></a> md-&gt;l_shoulder_a2 =10;
<a name="l105"></a> md-&gt;r_hip_a2 =-5;
<a name="l106"></a> md-&gt;l_hip_a2 =-5;
<a name="l107"></a>
<a name="l108"></a> md-&gt;r_elbow_a =30;
<a name="l109"></a> md-&gt;l_elbow_a =0;
<a name="l110"></a> md-&gt;r_knee_a =0;
<a name="l111"></a> md-&gt;l_knee_a =30;
<a name="l112"></a>
<a name="l113"></a> md-&gt;r_wrist_a =0;
<a name="l114"></a> md-&gt;l_wrist_a =0;
<a name="l115"></a> md-&gt;r_ankle_a =0;
<a name="l116"></a> md-&gt;l_ankle_a =0;
<a name="l117"></a>}
<a name="l118"></a>
<a name="l119"></a></span><span class=cF1>U0</span><span class=cF0> MDCorrect(ManDefineStruct *md)
<a name="l120"></a>{
<a name="l121"></a> md-&gt;r_ankle_a =-md-&gt;r_ankle_a;
<a name="l122"></a> md-&gt;l_ankle_a =-md-&gt;l_ankle_a;
<a name="l123"></a> md-&gt;r_knee_a =-md-&gt;r_knee_a;
<a name="l124"></a> md-&gt;l_knee_a =-md-&gt;l_knee_a;
<a name="l125"></a> md-&gt;r_hip_a2 =-md-&gt;r_hip_a2;
<a name="l126"></a> md-&gt;r_shoulder_a2=-md-&gt;r_shoulder_a2;
<a name="l127"></a> md-&gt;r_ankle_a+=90;
<a name="l128"></a> md-&gt;l_ankle_a+=90;
<a name="l129"></a>
<a name="l130"></a> md-&gt;foot_len-=md-&gt;leg_rad;
<a name="l131"></a>
<a name="l132"></a> md-&gt;r_elbow_a+=md-&gt;r_shoulder_a1;
<a name="l133"></a> md-&gt;l_elbow_a+=md-&gt;l_shoulder_a1;
<a name="l134"></a> md-&gt;r_knee_a+=md-&gt;r_hip_a1;
<a name="l135"></a> md-&gt;l_knee_a+=md-&gt;l_hip_a1;
<a name="l136"></a>
<a name="l137"></a> md-&gt;r_wrist_a+=md-&gt;r_elbow_a;
<a name="l138"></a> md-&gt;l_wrist_a+=md-&gt;l_elbow_a;
<a name="l139"></a> md-&gt;r_ankle_a+=md-&gt;r_knee_a;
<a name="l140"></a> md-&gt;l_ankle_a+=md-&gt;l_knee_a;
<a name="l141"></a>}
<a name="l142"></a>
<a name="l143"></a></span><span class=cF9>I64</span><span class=cF0> AddVertex(ManDefineStruct *md,</span><span class=cF9>I64</span><span class=cF0> x,</span><span class=cF9>I64</span><span class=cF0> y,</span><span class=cF9>I64</span><span class=cF0> z)
<a name="l144"></a>{
<a name="l145"></a> </span><span class=cF9>I64</span><span class=cF0> res=m-&gt;vertex_cnt++;
<a name="l146"></a> m-&gt;v[res].x=-x;
<a name="l147"></a> m-&gt;v[res].y=-y-md-&gt;leg_len-md-&gt;foot_rad*2;
<a name="l148"></a> m-&gt;v[res].z=-z;
<a name="l149"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l150"></a>}
<a name="l151"></a>
<a name="l152"></a></span><span class=cF9>I64</span><span class=cF0> AddTri(ManDefineStruct *,</span><span class=cF9>I64</span><span class=cF0> c,</span><span class=cF9>I64</span><span class=cF0> n0,</span><span class=cF9>I64</span><span class=cF0> n1,</span><span class=cF9>I64</span><span class=cF0> n2)
<a name="l153"></a>{
<a name="l154"></a> </span><span class=cF9>I64</span><span class=cF0> res=m-&gt;tri_cnt++;
<a name="l155"></a> m-&gt;t[res].color=c;
<a name="l156"></a> m-&gt;t[res].nums[0]=n1;
<a name="l157"></a> m-&gt;t[res].nums[1]=n0;
<a name="l158"></a> m-&gt;t[res].nums[2]=n2;
<a name="l159"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l160"></a>}
<a name="l161"></a>
<a name="l162"></a></span><span class=cF1>U0</span><span class=cF0> AddBox(ManDefineStruct *md,</span><span class=cF9>I64</span><span class=cF0> c,</span><span class=cF9>I64</span><span class=cF0> x1,</span><span class=cF9>I64</span><span class=cF0> y1,</span><span class=cF9>I64</span><span class=cF0> z1,
<a name="l163"></a> </span><span class=cF1>F64</span><span class=cF0> w,</span><span class=cF1>F64</span><span class=cF0> h,</span><span class=cF1>F64</span><span class=cF0> d,</span><span class=cF1>F64</span><span class=cF0> h2,</span><span class=cF1>F64</span><span class=cF0> h3,</span><span class=cF1>F64</span><span class=cF0> az,</span><span class=cF1>F64</span><span class=cF0> ay,</span><span class=cF1>F64</span><span class=cF0> ax,
<a name="l164"></a> </span><span class=cF9>I64</span><span class=cF0> *ox,</span><span class=cF9>I64</span><span class=cF0> *oy,</span><span class=cF9>I64</span><span class=cF0> *oz)
<a name="l165"></a>{
<a name="l166"></a> </span><span class=cF9>I64</span><span class=cF0> *r;
<a name="l167"></a> </span><span class=cF9>I64</span><span class=cF0> p1a,p2a,p3a,p4a;
<a name="l168"></a> </span><span class=cF9>I64</span><span class=cF0> p1b,p2b,p3b,p4b;
<a name="l169"></a> </span><span class=cF9>I64</span><span class=cF0> wx=w/2,wy=0,wz=0,hx=0,hy=h,hz=0,h2x=0,h2y=h2,h2z=0,
<a name="l170"></a> h3x=0,h3y=h3,h3z=0,dx=0,dy=0,dz=d/2;
<a name="l171"></a>
<a name="l172"></a> r=</span><span class=cF5>Mat4x4IdentNew</span><span class=cF0>;
<a name="l173"></a> </span><span class=cF5>Mat4x4RotZ</span><span class=cF0>(r,az*</span><span class=cF3>pi</span><span class=cF0>/180.0);
<a name="l174"></a> </span><span class=cF5>Mat4x4RotY</span><span class=cF0>(r,ay*</span><span class=cF3>pi</span><span class=cF0>/180.0);
<a name="l175"></a> </span><span class=cF5>Mat4x4RotX</span><span class=cF0>(r,ax*</span><span class=cF3>pi</span><span class=cF0>/180.0);
<a name="l176"></a> </span><span class=cF5>Mat4x4MulXYZ</span><span class=cF0>(r,&amp;wx,&amp;wy,&amp;wz);
<a name="l177"></a> </span><span class=cF5>Mat4x4MulXYZ</span><span class=cF0>(r,&amp;hx,&amp;hy,&amp;hz);
<a name="l178"></a> </span><span class=cF5>Mat4x4MulXYZ</span><span class=cF0>(r,&amp;h2x,&amp;h2y,&amp;h2z);
<a name="l179"></a> </span><span class=cF5>Mat4x4MulXYZ</span><span class=cF0>(r,&amp;h3x,&amp;h3y,&amp;h3z);
<a name="l180"></a> </span><span class=cF5>Mat4x4MulXYZ</span><span class=cF0>(r,&amp;dx,&amp;dy,&amp;dz);
<a name="l181"></a>
<a name="l182"></a> p1a=AddVertex(md,x1+dx -wx+h2x,y1+dy -wy+h2y,z1+dz -wz+h2z);
<a name="l183"></a> p2a=AddVertex(md,x1+dx +wx+h2x,y1+dy +wy+h2y,z1+dz +wz+h2z);
<a name="l184"></a> p3a=AddVertex(md,x1+dx+hx-wx ,y1+dy+hy-wy ,z1+dz+hz-wz);
<a name="l185"></a> p4a=AddVertex(md,x1+dx+hx+wx ,y1+dy+hy+wy ,z1+dz+hz+wz);
<a name="l186"></a> AddTri(md,c,p1a,p2a,p3a);
<a name="l187"></a> AddTri(md,c,p4a,p3a,p2a);
<a name="l188"></a>
<a name="l189"></a> p1b=AddVertex(md,x1-dx -wx+h2x,y1-dy -wy+h2y,z1-dz -wz+h2z);
<a name="l190"></a> p2b=AddVertex(md,x1-dx +wx+h2x,y1-dy +wy+h2y,z1-dz +wz+h2z);
<a name="l191"></a> p3b=AddVertex(md,x1-dx+hx-wx ,y1-dy+hy-wy ,z1-dz+hz-wz);
<a name="l192"></a> p4b=AddVertex(md,x1-dx+hx+wx ,y1-dy+hy+wy ,z1-dz+hz+wz);
<a name="l193"></a> AddTri(md,c,p1b,p2b,p3b);
<a name="l194"></a> AddTri(md,c,p4b,p3b,p2b);
<a name="l195"></a>
<a name="l196"></a> AddTri(md,c,p1a,p2a,p1b);
<a name="l197"></a> AddTri(md,c,p2b,p1b,p2a);
<a name="l198"></a> AddTri(md,c,p3a,p4a,p3b);
<a name="l199"></a> AddTri(md,c,p4b,p3b,p4a);
<a name="l200"></a> AddTri(md,c,p1a,p3a,p1b);
<a name="l201"></a> AddTri(md,c,p3b,p1b,p3a);
<a name="l202"></a> AddTri(md,c,p2a,p4a,p2b);
<a name="l203"></a> AddTri(md,c,p4b,p2b,p4a);
<a name="l204"></a>
<a name="l205"></a> *ox=x1+hx-h3x;
<a name="l206"></a> *oy=y1+hy-h3y;
<a name="l207"></a> *oz=z1+hz-h3z;
<a name="l208"></a>
<a name="l209"></a> </span><span class=cF5>Free</span><span class=cF0>(r);
<a name="l210"></a>}
<a name="l211"></a>
<a name="l212"></a></span><span class=cF1>U8</span><span class=cF0> *Man2CSprite()
<a name="l213"></a>{
<a name="l214"></a></span><span class=cF2>//See </span><a href="/Wb/Adam/Gr/GrSpritePlot.HC.HTML#l1"><span class=cF4>::/Adam/Gr/GrSpritePlot.HC</span></a><span class=cF2> for how CSprite are stored.</span><span class=cF0>
<a name="l215"></a> </span><span class=cF1>U8</span><span class=cF0> *res=</span><span class=cF5>MAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CSpriteMeshU8s</span><span class=cF7>)</span><span class=cF0>+
<a name="l216"></a> m-&gt;vertex_cnt*</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CD3I32</span><span class=cF7>)</span><span class=cF0>+m-&gt;tri_cnt*</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CMeshTri</span><span class=cF7>)</span><span class=cF0>+
<a name="l217"></a> </span><span class=cFB>sprite_elem_base_sizes</span><span class=cF0>[</span><span class=cF3>SPT_END</span><span class=cF0>]),
<a name="l218"></a> *dst=res;
<a name="l219"></a> *dst++ =</span><span class=cF3>SPT_MESH</span><span class=cF0>;
<a name="l220"></a> *dst(</span><span class=cF9>I32</span><span class=cF0> *)++ =m-&gt;vertex_cnt;
<a name="l221"></a> *dst(</span><span class=cF9>I32</span><span class=cF0> *)++ =m-&gt;tri_cnt;
<a name="l222"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(dst,&amp;m-&gt;v,m-&gt;vertex_cnt*</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CD3I32</span><span class=cF7>)</span><span class=cF0>);
<a name="l223"></a> dst+=m-&gt;vertex_cnt*</span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>CD3I32</span><span class=cF0>);
<a name="l224"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(dst,&amp;m-&gt;t,m-&gt;tri_cnt*</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CMeshTri</span><span class=cF7>)</span><span class=cF0>);
<a name="l225"></a> dst+=m-&gt;tri_cnt*</span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>CMeshTri</span><span class=cF0>);
<a name="l226"></a> *dst++ =</span><span class=cF3>SPT_END</span><span class=cF0>;
<a name="l227"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l228"></a>}
<a name="l229"></a>
<a name="l230"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U8</span><span class=cF0> *ManGen()
<a name="l231"></a>{
<a name="l232"></a> </span><span class=cF1>U8</span><span class=cF0> *res;
<a name="l233"></a> </span><span class=cF9>I64</span><span class=cF0> x,y,z,c1,c2,c3,c4;
<a name="l234"></a> ManDefineStruct md1,md2;
<a name="l235"></a> MDInit(&amp;md1);
<a name="l236"></a>
<a name="l237"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l238"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>DocForm</span><span class=cF7>(</span><span class=cF0>&amp;md1</span><span class=cF7>)</span><span class=cF0>)
<a name="l239"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l240"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(&amp;md2,&amp;md1,</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>ManDefineStruct</span><span class=cF7>)</span><span class=cF0>);
<a name="l241"></a> MDCorrect(&amp;md2);
<a name="l242"></a>
<a name="l243"></a> c1=</span><span class=cF5>PopUpColorLighting</span><span class=cF0>(</span><span class=cF6>&quot;$BK,1$Shirt$BK,0$\n&quot;</span><span class=cF0>);
<a name="l244"></a> </span><span class=cF1>if</span><span class=cF0> (c1&lt;0) </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l245"></a> c2=</span><span class=cF5>PopUpColorLighting</span><span class=cF0>(</span><span class=cF6>&quot;$BK,1$Pants$BK,0$\n&quot;</span><span class=cF0>);
<a name="l246"></a> </span><span class=cF1>if</span><span class=cF0> (c2&lt;0) </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l247"></a> c3=</span><span class=cF5>PopUpColorLighting</span><span class=cF0>(</span><span class=cF6>&quot;$BK,1$Skin$BK,0$\n&quot;</span><span class=cF0>);
<a name="l248"></a> </span><span class=cF1>if</span><span class=cF0> (c3&lt;0) </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l249"></a> c4=</span><span class=cF5>PopUpColorLighting</span><span class=cF0>(</span><span class=cF6>&quot;$BK,1$Shoes$BK,0$\n&quot;</span><span class=cF0>);
<a name="l250"></a> </span><span class=cF1>if</span><span class=cF0> (c4&lt;0) </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l251"></a>
<a name="l252"></a> m=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF5>Man</span><span class=cF7>)</span><span class=cF0>);
<a name="l253"></a>
<a name="l254"></a> </span><span class=cF2>//Head</span><span class=cF0>
<a name="l255"></a> AddBox(&amp;md2,c3,0,md2.torso_len+md2.head_rad*2,0,
<a name="l256"></a> md2.head_rad*2,-md2.head_rad*2,md2.head_rad*2,0,0, 0,0,0,
<a name="l257"></a> &amp;x,&amp;y,&amp;z);
<a name="l258"></a>
<a name="l259"></a> </span><span class=cF2>//Torso</span><span class=cF0>
<a name="l260"></a> AddBox(&amp;md2,c1,0,md2.torso_len,0,
<a name="l261"></a> md2.torso_width,-md2.torso_len,md2.torso_depth,0,0, 0,0,0,
<a name="l262"></a> &amp;x,&amp;y,&amp;z);
<a name="l263"></a>
<a name="l264"></a> </span><span class=cF2>//Right Arm</span><span class=cF0>
<a name="l265"></a> AddBox(&amp;md2,c1,-md2.torso_width/2-md2.arm_rad,md2.torso_len-md2.arm_rad,0,
<a name="l266"></a> md2.arm_rad*2,-md2.arm_len/2,md2.arm_rad*2,md2.arm_rad,0,
<a name="l267"></a> md2.r_shoulder_a2,0,md2.r_shoulder_a1,&amp;x,&amp;y,&amp;z);
<a name="l268"></a> AddBox(&amp;md2,c3,x,y,z,
<a name="l269"></a> md2.arm_rad*2,-md2.arm_len/2,md2.arm_rad*2,0,0,
<a name="l270"></a> md2.r_shoulder_a2,0,md2.r_elbow_a,&amp;x,&amp;y,&amp;z);
<a name="l271"></a> AddBox(&amp;md2,c3,x,y,z,
<a name="l272"></a> md2.arm_rad*2,-md2.hand_len,md2.hand_rad*2,0,0,
<a name="l273"></a> md2.r_shoulder_a2,0,md2.r_wrist_a,&amp;x,&amp;y,&amp;z);
<a name="l274"></a>
<a name="l275"></a> </span><span class=cF2>//Left Arm</span><span class=cF0>
<a name="l276"></a> AddBox(&amp;md2,c1,md2.torso_width/2+md2.arm_rad,md2.torso_len-md2.arm_rad,0,
<a name="l277"></a> md2.arm_rad*2,-md2.arm_len/2,md2.arm_rad*2,md2.arm_rad,0,
<a name="l278"></a> md2.l_shoulder_a2,0,md2.l_shoulder_a1,&amp;x,&amp;y,&amp;z);
<a name="l279"></a> AddBox(&amp;md2,c3,x,y,z,
<a name="l280"></a> md2.arm_rad*2,-md2.arm_len/2,md2.arm_rad*2,0,0,
<a name="l281"></a> md2.l_shoulder_a2,0,md2.l_elbow_a,&amp;x,&amp;y,&amp;z);
<a name="l282"></a> AddBox(&amp;md2,c3,x,y,z,
<a name="l283"></a> md2.arm_rad*2,-md2.hand_len,md2.hand_rad*2,0,0,
<a name="l284"></a> md2.l_shoulder_a2,0,md2.l_wrist_a,&amp;x,&amp;y,&amp;z);
<a name="l285"></a>
<a name="l286"></a> </span><span class=cF2>//Right Leg</span><span class=cF0>
<a name="l287"></a> AddBox(&amp;md2,c2,-md2.torso_width/2+md2.leg_rad,0,0,
<a name="l288"></a> md2.leg_rad*2,-md2.leg_len/2,md2.leg_rad*2,0,0,
<a name="l289"></a> md2.r_hip_a2,0,md2.r_hip_a1,&amp;x,&amp;y,&amp;z);
<a name="l290"></a> AddBox(&amp;md2,c3,x,y,z,
<a name="l291"></a> md2.leg_rad*2,-md2.leg_len/2,md2.leg_rad*2,0,md2.foot_rad,
<a name="l292"></a> md2.r_hip_a2,0,md2.r_knee_a,&amp;x,&amp;y,&amp;z);
<a name="l293"></a> AddBox(&amp;md2,c4,x,y,z,
<a name="l294"></a> md2.leg_rad*2,-md2.foot_len,md2.foot_rad*2,md2.leg_rad,0,
<a name="l295"></a> md2.r_hip_a2,0,md2.r_ankle_a,&amp;x,&amp;y,&amp;z);
<a name="l296"></a>
<a name="l297"></a> </span><span class=cF2>//Left Leg</span><span class=cF0>
<a name="l298"></a> AddBox(&amp;md2,c2,md2.torso_width/2-md2.leg_rad,0,0,
<a name="l299"></a> md2.leg_rad*2,-md2.leg_len/2,md2.leg_rad*2,0,0,
<a name="l300"></a> md2.l_hip_a2,0,md2.l_hip_a1,&amp;x,&amp;y,&amp;z);
<a name="l301"></a> AddBox(&amp;md2,c3,x,y,z,
<a name="l302"></a> md2.leg_rad*2,-md2.leg_len/2,md2.leg_rad*2,0,md2.foot_rad,
<a name="l303"></a> md2.l_hip_a2,0,md2.l_knee_a,&amp;x,&amp;y,&amp;z);
<a name="l304"></a> AddBox(&amp;md2,c4,x,y,z,
<a name="l305"></a> md2.leg_rad*2,-md2.foot_len,md2.foot_rad*2,md2.leg_rad,0,
<a name="l306"></a> md2.l_hip_a2,0,md2.l_ankle_a,&amp;x,&amp;y,&amp;z);
<a name="l307"></a>
<a name="l308"></a> res=Man2CSprite;
<a name="l309"></a> </span><span class=cF6>&quot;%h7c&quot;</span><span class=cF0>,</span><span class=cF6>'\n'</span><span class=cF0>;
<a name="l310"></a> </span><span class=cF5>Sprite</span><span class=cF0>(res,</span><span class=cF6>&quot;\t\t$SP,\&quot;&lt;1&gt;\&quot;,BI=%d$&quot;</span><span class=cF0>);
<a name="l311"></a> </span><span class=cF6>&quot;%h7c&quot;</span><span class=cF0>,</span><span class=cF6>'\n'</span><span class=cF0>;
<a name="l312"></a> </span><span class=cF5>Free</span><span class=cF0>(m);
<a name="l313"></a> </span><span class=cF6>&quot;Do another&quot;</span><span class=cF0>;
<a name="l314"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>YorN</span><span class=cF0>)
<a name="l315"></a> </span><span class=cF5>Free</span><span class=cF0>(res);
<a name="l316"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l317"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l318"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l319"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l320"></a>}
</span></pre></body>
</html>