1540 lines
161 KiB
Plaintext
1540 lines
161 KiB
Plaintext
|
<!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=cF0>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>"Graphics/Mesh"</span><span class=cF0>
|
||
|
<a name="l2"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>MESH_WORKSPACE_SIZE</span><span class=cF0> 4000
|
||
|
<a name="l3"></a>
|
||
|
<a name="l4"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>VF_SEL</span><span class=cF0> 1
|
||
|
<a name="l5"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>VF_COPIED</span><span class=cF0> 2
|
||
|
<a name="l6"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>VF_IGNORE</span><span class=cF0> 4
|
||
|
<a name="l7"></a>
|
||
|
<a name="l8"></a></span><span class=cF1>class</span><span class=cF0> </span><span class=cF9>CMeshEdVertex</span><span class=cF0>
|
||
|
<a name="l9"></a>{
|
||
|
<a name="l10"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *next,*last,*copy;
|
||
|
<a name="l11"></a>
|
||
|
<a name="l12"></a> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF1>start</span><span class=cF0>;
|
||
|
<a name="l13"></a> </span><span class=cF9>CD3I32</span><span class=cF0> p; </span><span class=cF2>//World coordinates of the point.</span><span class=cF0>
|
||
|
<a name="l14"></a> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF1>end</span><span class=cF0>;
|
||
|
<a name="l15"></a> </span><span class=cF9>CD3I32</span><span class=cF0> p0,
|
||
|
<a name="l16"></a> pt; </span><span class=cF2>//Transformed coordinates.</span><span class=cF0> </span><span class=cF2>(Scrn)</span><span class=cF0>
|
||
|
<a name="l17"></a> </span><span class=cF9>I32</span><span class=cF0> num,flags;
|
||
|
<a name="l18"></a>};
|
||
|
<a name="l19"></a>
|
||
|
<a name="l20"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>TF_SEL</span><span class=cF0> 1
|
||
|
<a name="l21"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>TF_COPIED</span><span class=cF0> 2
|
||
|
<a name="l22"></a>
|
||
|
<a name="l23"></a></span><span class=cF1>class</span><span class=cF0> </span><span class=cF9>CMeshEdTri</span><span class=cF0>
|
||
|
<a name="l24"></a>{
|
||
|
<a name="l25"></a> </span><span class=cF9>CMeshEdTri</span><span class=cF0> *next,*last;
|
||
|
<a name="l26"></a>
|
||
|
<a name="l27"></a> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF1>start</span><span class=cF0>;
|
||
|
<a name="l28"></a> </span><span class=cF9>CMeshTri</span><span class=cF0> mt;
|
||
|
<a name="l29"></a> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF1>end</span><span class=cF0>;
|
||
|
<a name="l30"></a>
|
||
|
<a name="l31"></a> </span><span class=cF9>I32</span><span class=cF0> cpu_num,flags; </span><span class=cF2>//Draw different tris with different cores.</span><span class=cF0>
|
||
|
<a name="l32"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *t[3];
|
||
|
<a name="l33"></a>};
|
||
|
<a name="l34"></a>
|
||
|
<a name="l35"></a></span><span class=cF1>class</span><span class=cF0> </span><span class=cF9>CMeshFrame</span><span class=cF0>
|
||
|
<a name="l36"></a>{
|
||
|
<a name="l37"></a> </span><span class=cF9>I64</span><span class=cF0> ms_z,thickness; </span><span class=cF2>//Mouse Z-coordinate</span><span class=cF0>
|
||
|
<a name="l38"></a> </span><span class=cF9>I64</span><span class=cF0> ed_mode,cx,cy;
|
||
|
<a name="l39"></a> </span><span class=cF9>CColorROPU32</span><span class=cF0> cur_color;
|
||
|
<a name="l40"></a> </span><span class=cF1>Bool</span><span class=cF0> grid_on,flip_y,sel_rect,vertex_on,closed,pad[3];
|
||
|
<a name="l41"></a> </span><span class=cF9>I64</span><span class=cF0> mp_not_done_flags; </span><span class=cF2>//Used for multiprocessing signaling.</span><span class=cF0>
|
||
|
<a name="l42"></a> </span><span class=cF1>F64</span><span class=cF0> view_scale;
|
||
|
<a name="l43"></a> </span><span class=cF9>CDC</span><span class=cF0> *dc;
|
||
|
<a name="l44"></a> </span><span class=cF9>I32</span><span class=cF0> *depth_buf;
|
||
|
<a name="l45"></a> </span><span class=cF9>I64</span><span class=cF0> *w2s,*s2w; </span><span class=cF2>//Scrn-to-world and world-to-scrn transform matrices.</span><span class=cF0>
|
||
|
<a name="l46"></a> </span><span class=cF9>I64</span><span class=cF0> vertex_cnt,tri_cnt; </span><span class=cF2>//Set by MeshSize</span><span class=cF0>
|
||
|
<a name="l47"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> vertex_head,*cur_vertex,*chain_pred;
|
||
|
<a name="l48"></a> </span><span class=cF9>CMeshEdTri</span><span class=cF0> tri_head,*cur_tri;
|
||
|
<a name="l49"></a> </span><span class=cF9>I64</span><span class=cF0> x1,y1,x2,y2,cur_snap;
|
||
|
<a name="l50"></a>};
|
||
|
<a name="l51"></a>
|
||
|
<a name="l52"></a></span><span class=cF9>CMeshEdVertex</span><span class=cF0> *</span><span class=cF5>MeshVertexNew</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e,</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="l53"></a>{
|
||
|
<a name="l54"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *tmpv=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CMeshEdVertex</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l55"></a> tmpv->p.x=x;
|
||
|
<a name="l56"></a> tmpv->p.y=y;
|
||
|
<a name="l57"></a> tmpv->p.z=z;
|
||
|
<a name="l58"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpv,e->vertex_head.last);
|
||
|
<a name="l59"></a> </span><span class=cF1>return</span><span class=cF0> tmpv;
|
||
|
<a name="l60"></a>}
|
||
|
<a name="l61"></a>
|
||
|
<a name="l62"></a></span><span class=cF9>CMeshEdTri</span><span class=cF0> *</span><span class=cF5>MeshTriNew</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e,</span><span class=cF9>CColorROPU32</span><span class=cF0> color,
|
||
|
<a name="l63"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *v1,</span><span class=cF9>CMeshEdVertex</span><span class=cF0> *v2,</span><span class=cF9>CMeshEdVertex</span><span class=cF0> *v3)
|
||
|
<a name="l64"></a>{
|
||
|
<a name="l65"></a> </span><span class=cF1>static</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> cpu_num=0;
|
||
|
<a name="l66"></a> </span><span class=cF9>CMeshEdTri</span><span class=cF0> *tmpt=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CMeshEdTri</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l67"></a> tmpt->cpu_num=cpu_num++%</span><span class=cFB>mp_cnt</span><span class=cF0>;
|
||
|
<a name="l68"></a> tmpt->mt.color=color;
|
||
|
<a name="l69"></a> tmpt->t[0]=v1;
|
||
|
<a name="l70"></a> tmpt->t[1]=v2;
|
||
|
<a name="l71"></a> tmpt->t[2]=v3;
|
||
|
<a name="l72"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpt,e->tri_head.last);
|
||
|
<a name="l73"></a> </span><span class=cF1>return</span><span class=cF0> tmpt;
|
||
|
<a name="l74"></a>}
|
||
|
<a name="l75"></a>
|
||
|
<a name="l76"></a></span><span class=cF9>CMeshEdVertex</span><span class=cF0> *</span><span class=cF5>MeshVertexFindScrPt</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e,</span><span class=cF9>I64</span><span class=cF0> x,</span><span class=cF9>I64</span><span class=cF0> y)
|
||
|
<a name="l77"></a>{</span><span class=cF2>//Scrn coordinates</span><span class=cF0>
|
||
|
<a name="l78"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *res=</span><span class=cF3>NULL</span><span class=cF0>,*tmpv=e->vertex_head.next;
|
||
|
<a name="l79"></a> </span><span class=cF9>I64</span><span class=cF0> dd,dz,best_dd=</span><span class=cF3>I64_MAX</span><span class=cF0>,best_dz=</span><span class=cF3>I64_MAX</span><span class=cF0>;
|
||
|
<a name="l80"></a> </span><span class=cF1>while</span><span class=cF0> (tmpv!=&e->vertex_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l81"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>tmpv->flags&</span><span class=cF3>VF_IGNORE</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l82"></a> dd=</span><span class=cF5>SqrI64</span><span class=cF0>(x-tmpv->pt.x)+</span><span class=cF5>SqrI64</span><span class=cF0>(y-tmpv->pt.y);
|
||
|
<a name="l83"></a> dz=</span><span class=cF5>AbsI64</span><span class=cF0>(e->ms_z-tmpv->p.z);
|
||
|
<a name="l84"></a> </span><span class=cF1>if</span><span class=cF0> (dd<best_dd || dd==best_dd && dz<best_dz) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l85"></a> res=tmpv;
|
||
|
<a name="l86"></a> best_dd=dd;
|
||
|
<a name="l87"></a> best_dz=dz;
|
||
|
<a name="l88"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l89"></a> }
|
||
|
<a name="l90"></a> tmpv=tmpv->next;
|
||
|
<a name="l91"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l92"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
||
|
<a name="l93"></a>}
|
||
|
<a name="l94"></a>
|
||
|
<a name="l95"></a></span><span class=cF9>CMeshEdVertex</span><span class=cF0> *</span><span class=cF5>MeshVertexFindNum</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *haystack_e,</span><span class=cF9>I64</span><span class=cF0> needle_num)
|
||
|
<a name="l96"></a>{
|
||
|
<a name="l97"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *tmpv=haystack_e->vertex_head.next;
|
||
|
<a name="l98"></a> </span><span class=cF1>while</span><span class=cF0> (tmpv!=&haystack_e->vertex_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l99"></a> </span><span class=cF1>if</span><span class=cF0> (tmpv->num==needle_num)
|
||
|
<a name="l100"></a> </span><span class=cF1>return</span><span class=cF0> tmpv;
|
||
|
<a name="l101"></a> tmpv=tmpv->next;
|
||
|
<a name="l102"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l103"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l104"></a>}
|
||
|
<a name="l105"></a>
|
||
|
<a name="l106"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshTriDel</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e,</span><span class=cF9>CMeshEdTri</span><span class=cF0> *tmpt)
|
||
|
<a name="l107"></a>{
|
||
|
<a name="l108"></a> </span><span class=cF1>if</span><span class=cF0> (tmpt) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l109"></a> </span><span class=cF1>if</span><span class=cF0> (tmpt==e->cur_tri)
|
||
|
<a name="l110"></a> e->cur_tri=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l111"></a> </span><span class=cF5>QueRem</span><span class=cF0>(tmpt);
|
||
|
<a name="l112"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpt);
|
||
|
<a name="l113"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l114"></a>}
|
||
|
<a name="l115"></a>
|
||
|
<a name="l116"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshVertexDel</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e,</span><span class=cF9>CMeshEdVertex</span><span class=cF0> *tmpv)
|
||
|
<a name="l117"></a>{
|
||
|
<a name="l118"></a> </span><span class=cF9>I64</span><span class=cF0> i;
|
||
|
<a name="l119"></a> </span><span class=cF9>CMeshEdTri</span><span class=cF0> *tmpt,*tmpt1;
|
||
|
<a name="l120"></a> </span><span class=cF1>if</span><span class=cF0> (tmpv) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l121"></a> tmpt=e->tri_head.next;
|
||
|
<a name="l122"></a> </span><span class=cF1>while</span><span class=cF0> (tmpt!=&e->tri_head) {
|
||
|
<a name="l123"></a> tmpt1=tmpt->next;
|
||
|
<a name="l124"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<3;i++)
|
||
|
<a name="l125"></a> </span><span class=cF1>if</span><span class=cF0> (tmpt->t[i]==tmpv)
|
||
|
<a name="l126"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l127"></a> </span><span class=cF1>if</span><span class=cF0> (i<3)
|
||
|
<a name="l128"></a> </span><span class=cF5>MeshTriDel</span><span class=cF0>(e,tmpt);
|
||
|
<a name="l129"></a> tmpt=tmpt1;
|
||
|
<a name="l130"></a> }
|
||
|
<a name="l131"></a> </span><span class=cF1>if</span><span class=cF0> (tmpv==e->cur_vertex)
|
||
|
<a name="l132"></a> e->cur_vertex=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l133"></a> </span><span class=cF1>if</span><span class=cF0> (tmpv==e->chain_pred)
|
||
|
<a name="l134"></a> e->chain_pred=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l135"></a> </span><span class=cF5>QueRem</span><span class=cF0>(tmpv);
|
||
|
<a name="l136"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpv);
|
||
|
<a name="l137"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l138"></a>}
|
||
|
<a name="l139"></a>
|
||
|
<a name="l140"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshFence</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e)
|
||
|
<a name="l141"></a>{
|
||
|
<a name="l142"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *tmpv,*tmpv1,*tmpv_last=</span><span class=cF3>NULL</span><span class=cF0>,*tmpv1_last=</span><span class=cF3>NULL</span><span class=cF0>,
|
||
|
<a name="l143"></a> *</span><span class=cF1>start</span><span class=cF0>=e->chain_pred->next,*</span><span class=cF1>end</span><span class=cF0>=e->vertex_head.last;
|
||
|
<a name="l144"></a> tmpv=</span><span class=cF1>start</span><span class=cF0>;
|
||
|
<a name="l145"></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="l146"></a> tmpv1=</span><span class=cF5>MeshVertexNew</span><span class=cF0>(e,tmpv->p.x,tmpv->p.y,tmpv->p.z+e->thickness);
|
||
|
<a name="l147"></a> </span><span class=cF1>if</span><span class=cF0> (tmpv_last) {
|
||
|
<a name="l148"></a> </span><span class=cF5>MeshTriNew</span><span class=cF0>(e,e->cur_color,tmpv_last,tmpv,tmpv1);
|
||
|
<a name="l149"></a> </span><span class=cF5>MeshTriNew</span><span class=cF0>(e,e->cur_color,tmpv1,tmpv1_last,tmpv_last);
|
||
|
<a name="l150"></a> }
|
||
|
<a name="l151"></a> tmpv_last=tmpv;
|
||
|
<a name="l152"></a> tmpv1_last=tmpv1;
|
||
|
<a name="l153"></a> </span><span class=cF1>if</span><span class=cF0> (tmpv==</span><span class=cF1>end</span><span class=cF0>)
|
||
|
<a name="l154"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l155"></a> tmpv=tmpv->next;
|
||
|
<a name="l156"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l157"></a> </span><span class=cF1>if</span><span class=cF0> (e->closed && tmpv_last) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l158"></a> </span><span class=cF5>MeshTriNew</span><span class=cF0>(e,e->cur_color,tmpv_last,</span><span class=cF1>start</span><span class=cF0>,</span><span class=cF1>end</span><span class=cF0>->next);
|
||
|
<a name="l159"></a> </span><span class=cF5>MeshTriNew</span><span class=cF0>(e,e->cur_color,</span><span class=cF1>end</span><span class=cF0>->next,tmpv1_last,tmpv_last);
|
||
|
<a name="l160"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l161"></a>}
|
||
|
<a name="l162"></a>
|
||
|
<a name="l163"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshPolygon</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e,</span><span class=cF9>CMeshEdVertex</span><span class=cF0> *</span><span class=cF1>start</span><span class=cF0>,</span><span class=cF9>CMeshEdVertex</span><span class=cF0> *</span><span class=cF1>end</span><span class=cF0>,</span><span class=cF1>Bool</span><span class=cF0> rev)
|
||
|
<a name="l164"></a>{
|
||
|
<a name="l165"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *tmpv,*tmpv1;
|
||
|
<a name="l166"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF1>start</span><span class=cF0>!=</span><span class=cF1>end</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l167"></a> tmpv=</span><span class=cF1>start</span><span class=cF0>;
|
||
|
<a name="l168"></a> tmpv1=tmpv->next;
|
||
|
<a name="l169"></a> </span><span class=cF1>while</span><span class=cF0> (tmpv1!=</span><span class=cF1>end</span><span class=cF0>) {
|
||
|
<a name="l170"></a> </span><span class=cF1>if</span><span class=cF0> (rev)
|
||
|
<a name="l171"></a> </span><span class=cF5>MeshTriNew</span><span class=cF0>(e,e->cur_color,tmpv1,tmpv,</span><span class=cF1>end</span><span class=cF0>);
|
||
|
<a name="l172"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l173"></a> </span><span class=cF5>MeshTriNew</span><span class=cF0>(e,e->cur_color,tmpv,tmpv1,</span><span class=cF1>end</span><span class=cF0>);
|
||
|
<a name="l174"></a> tmpv=tmpv->next;
|
||
|
<a name="l175"></a> tmpv1=tmpv1->next;
|
||
|
<a name="l176"></a> }
|
||
|
<a name="l177"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l178"></a>}
|
||
|
<a name="l179"></a>
|
||
|
<a name="l180"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshPrism</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e)
|
||
|
<a name="l181"></a>{
|
||
|
<a name="l182"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *</span><span class=cF1>start</span><span class=cF0>=e->chain_pred->next,*</span><span class=cF1>end</span><span class=cF0>=e->vertex_head.last;
|
||
|
<a name="l183"></a> </span><span class=cF5>MeshFence</span><span class=cF0>(e);
|
||
|
<a name="l184"></a> </span><span class=cF5>MeshPolygon</span><span class=cF0>(e,</span><span class=cF1>start</span><span class=cF0>,</span><span class=cF1>end</span><span class=cF0>,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l185"></a> </span><span class=cF5>MeshPolygon</span><span class=cF0>(e,</span><span class=cF1>end</span><span class=cF0>->next,e->vertex_head.last,</span><span class=cF3>TRUE</span><span class=cF0>);
|
||
|
<a name="l186"></a>}
|
||
|
<a name="l187"></a>
|
||
|
<a name="l188"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshVertexSelAll</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e,</span><span class=cF1>Bool</span><span class=cF0> val)
|
||
|
<a name="l189"></a>{
|
||
|
<a name="l190"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *tmpv=e->vertex_head.next;
|
||
|
<a name="l191"></a> </span><span class=cF1>while</span><span class=cF0> (tmpv!=&e->vertex_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l192"></a> </span><span class=cF1>if</span><span class=cF0> (val)
|
||
|
<a name="l193"></a> tmpv->flags|=</span><span class=cF3>VF_SEL</span><span class=cF0>;
|
||
|
<a name="l194"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l195"></a> tmpv->flags&=~</span><span class=cF3>VF_SEL</span><span class=cF0>;
|
||
|
<a name="l196"></a> tmpv=tmpv->next;
|
||
|
<a name="l197"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l198"></a>}
|
||
|
<a name="l199"></a>
|
||
|
<a name="l200"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshTriSelAll</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e,</span><span class=cF1>Bool</span><span class=cF0> val)
|
||
|
<a name="l201"></a>{
|
||
|
<a name="l202"></a> </span><span class=cF9>CMeshEdTri</span><span class=cF0> *tmpt=e->tri_head.next;
|
||
|
<a name="l203"></a> </span><span class=cF1>while</span><span class=cF0> (tmpt!=&e->tri_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l204"></a> </span><span class=cF1>if</span><span class=cF0> (val)
|
||
|
<a name="l205"></a> tmpt->flags|=</span><span class=cF3>TF_SEL</span><span class=cF0>;
|
||
|
<a name="l206"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l207"></a> tmpt->flags&=~</span><span class=cF3>TF_SEL</span><span class=cF0>;
|
||
|
<a name="l208"></a> tmpt=tmpt->next;
|
||
|
<a name="l209"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l210"></a>}
|
||
|
<a name="l211"></a>
|
||
|
<a name="l212"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshVertexIgnoreSet</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e,</span><span class=cF1>Bool</span><span class=cF0> val)
|
||
|
<a name="l213"></a>{
|
||
|
<a name="l214"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *tmpv=e->vertex_head.next;
|
||
|
<a name="l215"></a> </span><span class=cF1>while</span><span class=cF0> (tmpv!=&e->vertex_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l216"></a> tmpv->flags&=~</span><span class=cF3>VF_IGNORE</span><span class=cF0>;
|
||
|
<a name="l217"></a> </span><span class=cF1>if</span><span class=cF0> (tmpv->flags&</span><span class=cF3>VF_SEL</span><span class=cF0> && val)
|
||
|
<a name="l218"></a> tmpv->flags|=</span><span class=cF3>VF_IGNORE</span><span class=cF0>;
|
||
|
<a name="l219"></a> tmpv=tmpv->next;
|
||
|
<a name="l220"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l221"></a>}
|
||
|
<a name="l222"></a>
|
||
|
<a name="l223"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshP0Capture</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e)
|
||
|
<a name="l224"></a>{
|
||
|
<a name="l225"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *tmpv=e->vertex_head.next;
|
||
|
<a name="l226"></a> </span><span class=cF1>while</span><span class=cF0> (tmpv!=&e->vertex_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l227"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(&tmpv->p0,&tmpv->p,</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CD3I32</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l228"></a> tmpv=tmpv->next;
|
||
|
<a name="l229"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l230"></a>}
|
||
|
<a name="l231"></a>
|
||
|
<a name="l232"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshP0Offset</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e,</span><span class=cF9>I64</span><span class=cF0> dx,</span><span class=cF9>I64</span><span class=cF0> dy,</span><span class=cF9>I64</span><span class=cF0> dz)
|
||
|
<a name="l233"></a>{
|
||
|
<a name="l234"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *tmpv=e->vertex_head.next;
|
||
|
<a name="l235"></a> </span><span class=cF1>while</span><span class=cF0> (tmpv!=&e->vertex_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l236"></a> </span><span class=cF1>if</span><span class=cF0> (tmpv->flags&</span><span class=cF3>VF_SEL</span><span class=cF0>) {
|
||
|
<a name="l237"></a> tmpv->p.x=tmpv->p0.x+dx;
|
||
|
<a name="l238"></a> tmpv->p.y=tmpv->p0.y+dy;
|
||
|
<a name="l239"></a> tmpv->p.z=tmpv->p0.z+dz;
|
||
|
<a name="l240"></a> }
|
||
|
<a name="l241"></a> tmpv=tmpv->next;
|
||
|
<a name="l242"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l243"></a>}
|
||
|
<a name="l244"></a>
|
||
|
<a name="l245"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SEL_MESH_EQU</span><span class=cF0> 0
|
||
|
<a name="l246"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SEL_MESH_OR</span><span class=cF0> 1
|
||
|
<a name="l247"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SEL_MESH_AND</span><span class=cF0> 2
|
||
|
<a name="l248"></a>
|
||
|
<a name="l249"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshVertexSelRect</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e,</span><span class=cF9>I64</span><span class=cF0> sel_mode,</span><span class=cF9>I64</span><span class=cF0> x1,</span><span class=cF9>I64</span><span class=cF0> x2,</span><span class=cF9>I64</span><span class=cF0> y1,</span><span class=cF9>I64</span><span class=cF0> y2)
|
||
|
<a name="l250"></a>{
|
||
|
<a name="l251"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *tmpv=e->vertex_head.next;
|
||
|
<a name="l252"></a> </span><span class=cF1>if</span><span class=cF0> (x1>x2) </span><span class=cF5>SwapI64</span><span class=cF0>(&x1,&x2);
|
||
|
<a name="l253"></a> </span><span class=cF1>if</span><span class=cF0> (y1>y2) </span><span class=cF5>SwapI64</span><span class=cF0>(&y1,&y2);
|
||
|
<a name="l254"></a> </span><span class=cF1>while</span><span class=cF0> (tmpv!=&e->vertex_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l255"></a> </span><span class=cF1>if</span><span class=cF0> (x1<=tmpv->pt.x<=x2 &&
|
||
|
<a name="l256"></a> y1<=tmpv->pt.y<=y2) {
|
||
|
<a name="l257"></a> </span><span class=cF1>if</span><span class=cF0> (sel_mode==</span><span class=cF3>SEL_MESH_AND</span><span class=cF0>)
|
||
|
<a name="l258"></a> tmpv->flags&=~</span><span class=cF3>VF_SEL</span><span class=cF0>;
|
||
|
<a name="l259"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l260"></a> tmpv->flags|=</span><span class=cF3>VF_SEL</span><span class=cF0>;
|
||
|
<a name="l261"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (sel_mode==</span><span class=cF3>SEL_MESH_EQU</span><span class=cF0>)
|
||
|
<a name="l262"></a> tmpv->flags&=~</span><span class=cF3>VF_SEL</span><span class=cF0>;
|
||
|
<a name="l263"></a> tmpv=tmpv->next;
|
||
|
<a name="l264"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l265"></a>}
|
||
|
<a name="l266"></a>
|
||
|
<a name="l267"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshTriSelRect</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e,</span><span class=cF9>I64</span><span class=cF0> sel_mode,</span><span class=cF9>I64</span><span class=cF0> x1,</span><span class=cF9>I64</span><span class=cF0> x2,</span><span class=cF9>I64</span><span class=cF0> y1,</span><span class=cF9>I64</span><span class=cF0> y2)
|
||
|
<a name="l268"></a>{
|
||
|
<a name="l269"></a> </span><span class=cF9>CMeshEdTri</span><span class=cF0> *tmpt=e->tri_head.next;
|
||
|
<a name="l270"></a> </span><span class=cF1>if</span><span class=cF0> (x1>x2) </span><span class=cF5>SwapI64</span><span class=cF0>(&x1,&x2);
|
||
|
<a name="l271"></a> </span><span class=cF1>if</span><span class=cF0> (y1>y2) </span><span class=cF5>SwapI64</span><span class=cF0>(&y1,&y2);
|
||
|
<a name="l272"></a> </span><span class=cF1>while</span><span class=cF0> (tmpt!=&e->tri_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l273"></a> </span><span class=cF1>if</span><span class=cF0> (x1<=tmpt->t[0]->pt.x<=x2 &&
|
||
|
<a name="l274"></a> y1<=tmpt->t[0]->pt.y<=y2 &&
|
||
|
<a name="l275"></a> x1<=tmpt->t[1]->pt.x<=x2 &&
|
||
|
<a name="l276"></a> y1<=tmpt->t[1]->pt.y<=y2 &&
|
||
|
<a name="l277"></a> x1<=tmpt->t[2]->pt.x<=x2 &&
|
||
|
<a name="l278"></a> y1<=tmpt->t[2]->pt.y<=y2) {
|
||
|
<a name="l279"></a> </span><span class=cF1>if</span><span class=cF0> (sel_mode==</span><span class=cF3>SEL_MESH_AND</span><span class=cF0>)
|
||
|
<a name="l280"></a> tmpt->flags&=~</span><span class=cF3>TF_SEL</span><span class=cF0>;
|
||
|
<a name="l281"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l282"></a> tmpt->flags|=</span><span class=cF3>TF_SEL</span><span class=cF0>;
|
||
|
<a name="l283"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l284"></a> </span><span class=cF1>if</span><span class=cF0> (sel_mode==</span><span class=cF3>SEL_MESH_EQU</span><span class=cF0>)
|
||
|
<a name="l285"></a> tmpt->flags&=~</span><span class=cF3>TF_SEL</span><span class=cF0>;
|
||
|
<a name="l286"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (sel_mode==</span><span class=cF3>SEL_MESH_AND</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l287"></a> </span><span class=cF1>if</span><span class=cF0> (x1<=tmpt->t[0]->pt.x<=x2 &&
|
||
|
<a name="l288"></a> y1<=tmpt->t[0]->pt.y<=y2 ||
|
||
|
<a name="l289"></a> x1<=tmpt->t[1]->pt.x<=x2 &&
|
||
|
<a name="l290"></a> y1<=tmpt->t[1]->pt.y<=y2 ||
|
||
|
<a name="l291"></a> x1<=tmpt->t[2]->pt.x<=x2 &&
|
||
|
<a name="l292"></a> y1<=tmpt->t[2]->pt.y<=y2)
|
||
|
<a name="l293"></a> tmpt->flags&=~</span><span class=cF3>TF_SEL</span><span class=cF0>;
|
||
|
<a name="l294"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l295"></a> }
|
||
|
<a name="l296"></a> tmpt=tmpt->next;
|
||
|
<a name="l297"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l298"></a>}
|
||
|
<a name="l299"></a>
|
||
|
<a name="l300"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>MeshSelCnt</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e)
|
||
|
<a name="l301"></a>{
|
||
|
<a name="l302"></a> </span><span class=cF9>I64</span><span class=cF0> res=0;
|
||
|
<a name="l303"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *tmpv=e->vertex_head.next;
|
||
|
<a name="l304"></a> </span><span class=cF9>CMeshEdTri</span><span class=cF0> *tmpt=e->tri_head.next;
|
||
|
<a name="l305"></a> </span><span class=cF1>while</span><span class=cF0> (tmpv!=&e->vertex_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l306"></a> </span><span class=cF1>if</span><span class=cF0> (tmpv->flags&</span><span class=cF3>VF_SEL</span><span class=cF0>)
|
||
|
<a name="l307"></a> res++;
|
||
|
<a name="l308"></a> tmpv=tmpv->next;
|
||
|
<a name="l309"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l310"></a> </span><span class=cF1>while</span><span class=cF0> (tmpt!=&e->tri_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l311"></a> </span><span class=cF1>if</span><span class=cF0> (tmpt->flags&</span><span class=cF3>TF_SEL</span><span class=cF0>)
|
||
|
<a name="l312"></a> res++;
|
||
|
<a name="l313"></a> tmpt=tmpt->next;
|
||
|
<a name="l314"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l315"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
||
|
<a name="l316"></a>}
|
||
|
<a name="l317"></a>
|
||
|
<a name="l318"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshSwapAxes</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e,</span><span class=cF9>I64</span><span class=cF0> o1,</span><span class=cF9>I64</span><span class=cF0> o2)
|
||
|
<a name="l319"></a>{
|
||
|
<a name="l320"></a> </span><span class=cF1>Bool</span><span class=cF0> unsel;
|
||
|
<a name="l321"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *tmpv=e->vertex_head.next;
|
||
|
<a name="l322"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>MeshSelCnt</span><span class=cF7>(</span><span class=cF0>e</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l323"></a> </span><span class=cF5>MeshVertexSelAll</span><span class=cF0>(e,</span><span class=cF3>TRUE</span><span class=cF0>);
|
||
|
<a name="l324"></a> unsel=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l325"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l326"></a> unsel=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l327"></a> </span><span class=cF1>while</span><span class=cF0> (tmpv!=&e->vertex_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l328"></a> </span><span class=cF1>if</span><span class=cF0> (tmpv->flags&</span><span class=cF3>VF_SEL</span><span class=cF0>)
|
||
|
<a name="l329"></a> </span><span class=cF5>SwapU32</span><span class=cF0>(</span><span class=cF7>(</span><span class=cF0>&tmpv->p</span><span class=cF7>)(</span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>+o1,</span><span class=cF7>(</span><span class=cF0>&tmpv->p</span><span class=cF7>)(</span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>+o2);
|
||
|
<a name="l330"></a> tmpv=tmpv->next;
|
||
|
<a name="l331"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l332"></a> </span><span class=cF1>if</span><span class=cF0> (unsel)
|
||
|
<a name="l333"></a> </span><span class=cF5>MeshVertexSelAll</span><span class=cF0>(e,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l334"></a>}
|
||
|
<a name="l335"></a>
|
||
|
<a name="l336"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshInvertAxis</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e,</span><span class=cF9>I64</span><span class=cF0> o)
|
||
|
<a name="l337"></a>{
|
||
|
<a name="l338"></a> </span><span class=cF1>Bool</span><span class=cF0> unsel;
|
||
|
<a name="l339"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *tmpv=e->vertex_head.next;
|
||
|
<a name="l340"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>MeshSelCnt</span><span class=cF7>(</span><span class=cF0>e</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l341"></a> </span><span class=cF5>MeshVertexSelAll</span><span class=cF0>(e,</span><span class=cF3>TRUE</span><span class=cF0>);
|
||
|
<a name="l342"></a> unsel=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l343"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l344"></a> unsel=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l345"></a> </span><span class=cF1>while</span><span class=cF0> (tmpv!=&e->vertex_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l346"></a> </span><span class=cF1>if</span><span class=cF0> (tmpv->flags&</span><span class=cF3>VF_SEL</span><span class=cF0>)
|
||
|
<a name="l347"></a> *(</span><span class=cF7>(</span><span class=cF0>&tmpv->p</span><span class=cF7>)(</span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>+o)(</span><span class=cF9>I32</span><span class=cF0> *)=-*(</span><span class=cF7>(</span><span class=cF0>&tmpv->p</span><span class=cF7>)(</span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>+o)(</span><span class=cF9>I32</span><span class=cF0> *);
|
||
|
<a name="l348"></a> tmpv=tmpv->next;
|
||
|
<a name="l349"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l350"></a> </span><span class=cF1>if</span><span class=cF0> (unsel)
|
||
|
<a name="l351"></a> </span><span class=cF5>MeshVertexSelAll</span><span class=cF0>(e,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l352"></a>}
|
||
|
<a name="l353"></a>
|
||
|
<a name="l354"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshTransformSel</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e)
|
||
|
<a name="l355"></a>{
|
||
|
<a name="l356"></a> </span><span class=cF1>Bool</span><span class=cF0> unsel;
|
||
|
<a name="l357"></a> </span><span class=cF9>I64</span><span class=cF0> r[16],x,y,z;
|
||
|
<a name="l358"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *tmpv=e->vertex_head.next;
|
||
|
<a name="l359"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>PopUpTransform</span><span class=cF7>(</span><span class=cF0>r</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l360"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>MeshSelCnt</span><span class=cF7>(</span><span class=cF0>e</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l361"></a> </span><span class=cF5>MeshVertexSelAll</span><span class=cF0>(e,</span><span class=cF3>TRUE</span><span class=cF0>);
|
||
|
<a name="l362"></a> unsel=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l363"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l364"></a> unsel=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l365"></a> </span><span class=cF1>while</span><span class=cF0> (tmpv!=&e->vertex_head) {
|
||
|
<a name="l366"></a> </span><span class=cF1>if</span><span class=cF0> (tmpv->flags&</span><span class=cF3>VF_SEL</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l367"></a> x=tmpv->p.x; y=tmpv->p.y; z=tmpv->p.z;
|
||
|
<a name="l368"></a> </span><span class=cF5>Mat4x4MulXYZ</span><span class=cF0>(r,&x,&y,&z);
|
||
|
<a name="l369"></a> tmpv->p.x=x; tmpv->p.y=y; tmpv->p.z=z;
|
||
|
<a name="l370"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l371"></a> tmpv=tmpv->next;
|
||
|
<a name="l372"></a> }
|
||
|
<a name="l373"></a> </span><span class=cF1>if</span><span class=cF0> (unsel)
|
||
|
<a name="l374"></a> </span><span class=cF5>MeshVertexSelAll</span><span class=cF0>(e,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l375"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l376"></a>}
|
||
|
<a name="l377"></a>
|
||
|
<a name="l378"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshColorTris</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e)
|
||
|
<a name="l379"></a>{
|
||
|
<a name="l380"></a> </span><span class=cF1>Bool</span><span class=cF0> unsel;
|
||
|
<a name="l381"></a> </span><span class=cF9>CMeshEdTri</span><span class=cF0> *tmpt=e->tri_head.next;
|
||
|
<a name="l382"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>MeshSelCnt</span><span class=cF7>(</span><span class=cF0>e</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l383"></a> </span><span class=cF5>MeshTriSelAll</span><span class=cF0>(e,</span><span class=cF3>TRUE</span><span class=cF0>);
|
||
|
<a name="l384"></a> unsel=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l385"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l386"></a> unsel=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l387"></a> </span><span class=cF1>while</span><span class=cF0> (tmpt!=&e->tri_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l388"></a> </span><span class=cF1>if</span><span class=cF0> (tmpt->flags & </span><span class=cF3>TF_SEL</span><span class=cF0>)
|
||
|
<a name="l389"></a> tmpt->mt.color=e->cur_color;
|
||
|
<a name="l390"></a> tmpt=tmpt->next;
|
||
|
<a name="l391"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l392"></a> </span><span class=cF1>if</span><span class=cF0> (unsel)
|
||
|
<a name="l393"></a> </span><span class=cF5>MeshTriSelAll</span><span class=cF0>(e,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l394"></a>}
|
||
|
<a name="l395"></a>
|
||
|
<a name="l396"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshRevTris</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e)
|
||
|
<a name="l397"></a>{
|
||
|
<a name="l398"></a> </span><span class=cF1>Bool</span><span class=cF0> unsel;
|
||
|
<a name="l399"></a> </span><span class=cF9>CMeshEdTri</span><span class=cF0> *tmpt=e->tri_head.next;
|
||
|
<a name="l400"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>MeshSelCnt</span><span class=cF7>(</span><span class=cF0>e</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l401"></a> </span><span class=cF5>MeshTriSelAll</span><span class=cF0>(e,</span><span class=cF3>TRUE</span><span class=cF0>);
|
||
|
<a name="l402"></a> unsel=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l403"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l404"></a> unsel=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l405"></a> </span><span class=cF1>while</span><span class=cF0> (tmpt!=&e->tri_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l406"></a> </span><span class=cF1>if</span><span class=cF0> (tmpt->flags & </span><span class=cF3>TF_SEL</span><span class=cF0>)
|
||
|
<a name="l407"></a> </span><span class=cF5>SwapI64</span><span class=cF0>(&tmpt->t[1],&tmpt->t[2]);
|
||
|
<a name="l408"></a> tmpt=tmpt->next;
|
||
|
<a name="l409"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l410"></a> </span><span class=cF1>if</span><span class=cF0> (unsel)
|
||
|
<a name="l411"></a> </span><span class=cF5>MeshTriSelAll</span><span class=cF0>(e,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l412"></a>}
|
||
|
<a name="l413"></a>
|
||
|
<a name="l414"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshRecalcCxCy</span><span class=cF0>(</span><span class=cF9>CTask</span><span class=cF0> *task,</span><span class=cF9>CMeshFrame</span><span class=cF0> *e)
|
||
|
<a name="l415"></a>{
|
||
|
<a name="l416"></a> e->cx=</span><span class=cF5>RoundI64</span><span class=cF0>(task->pix_width/2 -task->horz_scroll.pos,e->cur_snap);
|
||
|
<a name="l417"></a> e->cy=</span><span class=cF5>RoundI64</span><span class=cF0>(task->pix_height/2-task->vert_scroll.pos,e->cur_snap);
|
||
|
<a name="l418"></a>}
|
||
|
<a name="l419"></a>
|
||
|
<a name="l420"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshCurSnap</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e)
|
||
|
<a name="l421"></a>{
|
||
|
<a name="l422"></a> </span><span class=cF9>I64</span><span class=cF0> x1,y1,z1,x2,y2,z2;
|
||
|
<a name="l423"></a> </span><span class=cF1>if</span><span class=cF0> (e->w2s) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l424"></a> x1=e->cur_snap<<16; y1=0; z1=0;
|
||
|
<a name="l425"></a> </span><span class=cF5>Mat4x4MulXYZ</span><span class=cF0>(e->w2s,&x1,&y1,&z1);
|
||
|
<a name="l426"></a> x2=0; y2=e->cur_snap<<16; z2=0;
|
||
|
<a name="l427"></a> </span><span class=cF5>Mat4x4MulXYZ</span><span class=cF0>(e->w2s,&x2,&y2,&z2);
|
||
|
<a name="l428"></a> </span><span class=cFB>ms_grid</span><span class=cF0>.x=</span><span class=cF5>Max</span><span class=cF0>(1,</span><span class=cF5>MaxI64</span><span class=cF7>(</span><span class=cF0>x1,x2</span><span class=cF7>)</span><span class=cF0>>>16);
|
||
|
<a name="l429"></a> </span><span class=cFB>ms_grid</span><span class=cF0>.y=</span><span class=cF5>Max</span><span class=cF0>(1,</span><span class=cF5>MaxI64</span><span class=cF7>(</span><span class=cF0>y1,y2</span><span class=cF7>)</span><span class=cF0>>>16);
|
||
|
<a name="l430"></a> </span><span class=cFB>ms_grid</span><span class=cF0>.z=</span><span class=cF5>Min</span><span class=cF0>(</span><span class=cFB>ms_grid</span><span class=cF0>.x,</span><span class=cFB>ms_grid</span><span class=cF0>.y);
|
||
|
<a name="l431"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l432"></a>}
|
||
|
<a name="l433"></a>
|
||
|
<a name="l434"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshScaleZoom</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e,</span><span class=cF1>F64</span><span class=cF0> scale)
|
||
|
<a name="l435"></a>{
|
||
|
<a name="l436"></a> </span><span class=cF9>CTask</span><span class=cF0> *task=</span><span class=cF5>Fs</span><span class=cF0>;
|
||
|
<a name="l437"></a> </span><span class=cF9>I64</span><span class=cF0> x=</span><span class=cFB>ms</span><span class=cF0>.pos.x-task->pix_left-task->scroll_x-task->pix_width/2,
|
||
|
<a name="l438"></a> y=</span><span class=cFB>ms</span><span class=cF0>.pos.y-task->pix_top-task->scroll_y-task->pix_height/2;
|
||
|
<a name="l439"></a> task->horz_scroll.pos*=scale;
|
||
|
<a name="l440"></a> task->vert_scroll.pos*=scale;
|
||
|
<a name="l441"></a> task->horz_scroll.pos+=scale*x-x;
|
||
|
<a name="l442"></a> task->vert_scroll.pos+=scale*y-y;
|
||
|
<a name="l443"></a> e->view_scale*=scale;
|
||
|
<a name="l444"></a> </span><span class=cF5>MeshRecalcCxCy</span><span class=cF0>(task,e);
|
||
|
<a name="l445"></a> </span><span class=cF5>MeshCurSnap</span><span class=cF0>(e);
|
||
|
<a name="l446"></a>}
|
||
|
<a name="l447"></a>
|
||
|
<a name="l448"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MPDrawIt</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e)
|
||
|
<a name="l449"></a>{</span><span class=cF2>//Multiprocessing draw it, called by each core.</span><span class=cF0>
|
||
|
<a name="l450"></a>
|
||
|
<a name="l451"></a> </span><span class=cF2>//Makes a copy of e->dc so we can change dc->color member and stuff.</span><span class=cF0>
|
||
|
<a name="l452"></a> </span><span class=cF9>CDC</span><span class=cF0> *dc=</span><span class=cF5>DCAlias</span><span class=cF0>(e->dc,e->dc->win_task);
|
||
|
<a name="l453"></a>
|
||
|
<a name="l454"></a> </span><span class=cF9>CMeshEdTri</span><span class=cF0> *tmpt=e->tri_head.next;
|
||
|
<a name="l455"></a> </span><span class=cF9>I64</span><span class=cF0> i,*old_r=dc->r;
|
||
|
<a name="l456"></a>
|
||
|
<a name="l457"></a> </span><span class=cF2>//</span><a href="/Wb/Adam/Gr/GrDC.HC.HTML#l168"><span class=cF4>DCAlias</span></a><span class=cF2>() allocs a new identity rotation matrix.</span><span class=cF0>
|
||
|
<a name="l458"></a> </span><span class=cF2>//We want e->dc's rotation matrix.</span><span class=cF0>
|
||
|
<a name="l459"></a> dc->r=e->dc->r;
|
||
|
<a name="l460"></a> dc->depth_buf=e->depth_buf;
|
||
|
<a name="l461"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(&dc->ls,&e->dc->ls,</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CD3I32</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l462"></a>
|
||
|
<a name="l463"></a> </span><span class=cF2>//... and translation (shift) vals.</span><span class=cF0>
|
||
|
<a name="l464"></a> dc->x=e->dc->x;
|
||
|
<a name="l465"></a> dc->y=e->dc->y;
|
||
|
<a name="l466"></a> dc->z=e->dc->z;
|
||
|
<a name="l467"></a> dc->flags|=</span><span class=cF3>DCF_TRANSFORMATION</span><span class=cF0>;
|
||
|
<a name="l468"></a>
|
||
|
<a name="l469"></a> </span><span class=cF1>if</span><span class=cF0> (e->grid_on)
|
||
|
<a name="l470"></a></span><span class=cF2>//Draw grid with different cores.</span><span class=cF0>
|
||
|
<a name="l471"></a> </span><span class=cF1>for</span><span class=cF0> (i=-500+25*</span><span class=cF5>Gs</span><span class=cF0>->num;i<=500;i+=25*</span><span class=cFB>mp_cnt</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l472"></a> </span><span class=cF1>if</span><span class=cF0> (i) {
|
||
|
<a name="l473"></a> dc->color=</span><span class=cF3>DKGRAY</span><span class=cF0>;
|
||
|
<a name="l474"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(dc,i,-500,0,i,500,0);
|
||
|
<a name="l475"></a> dc->color=</span><span class=cF3>LTGRAY</span><span class=cF0>;
|
||
|
<a name="l476"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(dc,-500,i,0,500,i,0);
|
||
|
<a name="l477"></a> }
|
||
|
<a name="l478"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l479"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Gs</span><span class=cF0>->num) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l480"></a> dc->color=</span><span class=cF3>RED</span><span class=cF0>; </span><span class=cF2>//Y-Axis red</span><span class=cF0>
|
||
|
<a name="l481"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(dc,0,0,0,0,500,0);
|
||
|
<a name="l482"></a> dc->color=</span><span class=cF3>ROPF_DITHER</span><span class=cF0>+</span><span class=cF3>RED</span><span class=cF0>; </span><span class=cF2>//Y-Axis red</span><span class=cF0>
|
||
|
<a name="l483"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(dc,0,-500,0,0,0,0);
|
||
|
<a name="l484"></a>
|
||
|
<a name="l485"></a> dc->color=</span><span class=cF3>YELLOW</span><span class=cF0>; </span><span class=cF2>//X-Axis yellow</span><span class=cF0>
|
||
|
<a name="l486"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(dc,0,0,0,500,0,0);
|
||
|
<a name="l487"></a> dc->color=</span><span class=cF3>ROPF_DITHER</span><span class=cF0>+</span><span class=cF3>YELLOW</span><span class=cF0>; </span><span class=cF2>//X-Axis yellow</span><span class=cF0>
|
||
|
<a name="l488"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(dc,-500,0,0,0,0,0);
|
||
|
<a name="l489"></a>
|
||
|
<a name="l490"></a> dc->color=</span><span class=cF3>GREEN</span><span class=cF0>; </span><span class=cF2>//Z-Axis green</span><span class=cF0>
|
||
|
<a name="l491"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(dc,0,0,0,0,0,500);
|
||
|
<a name="l492"></a> dc->color=</span><span class=cF3>ROPF_DITHER</span><span class=cF0>+</span><span class=cF3>GREEN</span><span class=cF0>; </span><span class=cF2>//Z-Axis green</span><span class=cF0>
|
||
|
<a name="l493"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(dc,0,0,-500,0,0,0);
|
||
|
<a name="l494"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l495"></a>
|
||
|
<a name="l496"></a> </span><span class=cF1>while</span><span class=cF0> (tmpt!=&e->tri_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l497"></a> </span><span class=cF1>if</span><span class=cF0> (tmpt->cpu_num==</span><span class=cF5>Gs</span><span class=cF0>->num) {
|
||
|
<a name="l498"></a> </span><span class=cF1>if</span><span class=cF0> (tmpt->flags & </span><span class=cF3>TF_SEL</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l499"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Blink</span><span class=cF0>)
|
||
|
<a name="l500"></a> dc->color=</span><span class=cF3>ROPF_DITHER</span><span class=cF0>+</span><span class=cF3>WHITE</span><span class=cF0><<16+</span><span class=cF3>RED</span><span class=cF0>;
|
||
|
<a name="l501"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l502"></a> dc->color=</span><span class=cF3>ROPF_DITHER</span><span class=cF0>+</span><span class=cF3>RED</span><span class=cF0><<16+</span><span class=cF3>WHITE</span><span class=cF0>;
|
||
|
<a name="l503"></a> </span><span class=cF5>GrFillTri0</span><span class=cF0>(dc,&tmpt->t[0]->pt,&tmpt->t[1]->pt,&tmpt->t[2]->pt);
|
||
|
<a name="l504"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l505"></a> (*dc->lighting)(dc,&tmpt->t[0]->pt,&tmpt->t[1]->pt,
|
||
|
<a name="l506"></a> &tmpt->t[2]->pt,tmpt->mt.color);
|
||
|
<a name="l507"></a> </span><span class=cF5>GrFillTri0</span><span class=cF0>(dc,&tmpt->t[0]->pt,&tmpt->t[1]->pt,&tmpt->t[2]->pt);
|
||
|
<a name="l508"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l509"></a> }
|
||
|
<a name="l510"></a> tmpt=tmpt->next;
|
||
|
<a name="l511"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l512"></a> dc->r=old_r;
|
||
|
<a name="l513"></a>
|
||
|
<a name="l514"></a> </span><span class=cF2>//e->dc's depth buf was copied but we don't want it freed during </span><a href="/Wb/Adam/Gr/GrDC.HC.HTML#l208"><span class=cF4>DCDel</span></a><span class=cF2>().</span><span class=cF0>
|
||
|
<a name="l515"></a> dc->depth_buf=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l516"></a>
|
||
|
<a name="l517"></a> </span><span class=cF5>DCDel</span><span class=cF0>(dc);
|
||
|
<a name="l518"></a> </span><span class=cF5>LBtr</span><span class=cF0>(&e->mp_not_done_flags,</span><span class=cF5>Gs</span><span class=cF0>->num);
|
||
|
<a name="l519"></a>}
|
||
|
<a name="l520"></a>
|
||
|
<a name="l521"></a></span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF5>MeshW2S</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e,</span><span class=cF9>CTask</span><span class=cF0> *task)
|
||
|
<a name="l522"></a>{</span><span class=cF2>//World to scrn coordinate transform matrix.</span><span class=cF0>
|
||
|
<a name="l523"></a> </span><span class=cF9>CCtrl</span><span class=cF0> *c=</span><span class=cF5>CtrlFindUnique</span><span class=cF0>(task,</span><span class=cF3>CTRLT_VIEWING_ANGLES</span><span class=cF0>);
|
||
|
<a name="l524"></a> </span><span class=cF9>CViewAngles</span><span class=cF0> *s=c->state;
|
||
|
<a name="l525"></a> </span><span class=cF9>I64</span><span class=cF0> *r=</span><span class=cF5>Mat4x4IdentNew</span><span class=cF0>(task);
|
||
|
<a name="l526"></a> </span><span class=cF5>Mat4x4Scale</span><span class=cF0>(r,e->view_scale);
|
||
|
<a name="l527"></a> </span><span class=cF5>Mat4x4RotZ</span><span class=cF0>(r,s->az);
|
||
|
<a name="l528"></a> </span><span class=cF5>Mat4x4RotY</span><span class=cF0>(r,s->ay);
|
||
|
<a name="l529"></a> </span><span class=cF1>if</span><span class=cF0> (e->flip_y)
|
||
|
<a name="l530"></a> </span><span class=cF5>Mat4x4RotX</span><span class=cF0>(r,s->ax);
|
||
|
<a name="l531"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l532"></a> </span><span class=cF5>Mat4x4RotX</span><span class=cF0>(r,s->ax+</span><span class=cF3>pi</span><span class=cF0>);
|
||
|
<a name="l533"></a> </span><span class=cF1>return</span><span class=cF0> r;
|
||
|
<a name="l534"></a>}
|
||
|
<a name="l535"></a>
|
||
|
<a name="l536"></a></span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF5>MeshS2W</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e,</span><span class=cF9>CTask</span><span class=cF0> *task)
|
||
|
<a name="l537"></a>{</span><span class=cF2>//Scrn to world coordinate transform matrix.</span><span class=cF0>
|
||
|
<a name="l538"></a> </span><span class=cF9>CCtrl</span><span class=cF0> *c=</span><span class=cF5>CtrlFindUnique</span><span class=cF0>(task,</span><span class=cF3>CTRLT_VIEWING_ANGLES</span><span class=cF0>);
|
||
|
<a name="l539"></a> </span><span class=cF9>CViewAngles</span><span class=cF0> *s=c->state;
|
||
|
<a name="l540"></a> </span><span class=cF9>I64</span><span class=cF0> *r=</span><span class=cF5>Mat4x4IdentNew</span><span class=cF0>(task);
|
||
|
<a name="l541"></a> </span><span class=cF1>if</span><span class=cF0> (e->flip_y)
|
||
|
<a name="l542"></a> </span><span class=cF5>Mat4x4RotX</span><span class=cF0>(r,-s->ax);
|
||
|
<a name="l543"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l544"></a> </span><span class=cF5>Mat4x4RotX</span><span class=cF0>(r,-</span><span class=cF7>(</span><span class=cF0>s->ax+</span><span class=cF3>pi</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l545"></a> </span><span class=cF5>Mat4x4RotY</span><span class=cF0>(r,-s->ay);
|
||
|
<a name="l546"></a> </span><span class=cF5>Mat4x4RotZ</span><span class=cF0>(r,-s->az);
|
||
|
<a name="l547"></a> </span><span class=cF5>Mat4x4Scale</span><span class=cF0>(r,1/e->view_scale);
|
||
|
<a name="l548"></a> </span><span class=cF1>return</span><span class=cF0> r;
|
||
|
<a name="l549"></a>}
|
||
|
<a name="l550"></a>
|
||
|
<a name="l551"></a></span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF5>MeshSetW2S</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e,</span><span class=cF9>CTask</span><span class=cF0> *task)
|
||
|
<a name="l552"></a>{
|
||
|
<a name="l553"></a> </span><span class=cF5>Free</span><span class=cF0>(e->w2s);
|
||
|
<a name="l554"></a> e->w2s=</span><span class=cF5>MeshW2S</span><span class=cF0>(e,task);
|
||
|
<a name="l555"></a> </span><span class=cF5>Free</span><span class=cF0>(e->s2w);
|
||
|
<a name="l556"></a> e->s2w=</span><span class=cF5>MeshS2W</span><span class=cF0>(e,task);
|
||
|
<a name="l557"></a></span><span class=cF2>//returned matrix is assigned to dc->r and will be freed by </span><a href="/Wb/Adam/Gr/GrDC.HC.HTML#l208"><span class=cF4>DCDel</span></a><span class=cF2>().</span><span class=cF0>
|
||
|
<a name="l558"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>Mat4x4New</span><span class=cF0>(e->w2s,task);
|
||
|
<a name="l559"></a>}
|
||
|
<a name="l560"></a>
|
||
|
<a name="l561"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshCursorW</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e,</span><span class=cF9>CTask</span><span class=cF0> *task,</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="l562"></a>{
|
||
|
<a name="l563"></a> </span><span class=cF9>I64</span><span class=cF0> x_shadow,y_shadow,z_shadow,
|
||
|
<a name="l564"></a> xc=</span><span class=cFB>ms</span><span class=cF0>.pos.x-task->pix_left-task->scroll_x-e->cx,
|
||
|
<a name="l565"></a> yc=</span><span class=cFB>ms</span><span class=cF0>.pos.y-task->pix_top-task->scroll_y-e->cy,zc=0,
|
||
|
<a name="l566"></a> x=0,y=0,z=e->ms_z,
|
||
|
<a name="l567"></a> i,x2,y2,z2;
|
||
|
<a name="l568"></a> </span><span class=cF5>Mat4x4MulXYZ</span><span class=cF0>(e->w2s,&x,&y,&z); </span><span class=cF2>//scrn of Z vect</span><span class=cF0>
|
||
|
<a name="l569"></a>
|
||
|
<a name="l570"></a> </span><span class=cF2>//Converges onto a solution for zc, an unknown.</span><span class=cF0>
|
||
|
<a name="l571"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<128;i++) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l572"></a> x_shadow=xc-x; </span><span class=cF2>//Shadow of mouse cursor on xy plane</span><span class=cF0>
|
||
|
<a name="l573"></a> y_shadow=yc-y;
|
||
|
<a name="l574"></a> z_shadow=zc-z;
|
||
|
<a name="l575"></a> </span><span class=cF5>Mat4x4MulXYZ</span><span class=cF0>(e->s2w,&x_shadow,&y_shadow,&z_shadow);
|
||
|
<a name="l576"></a> x2=0; y2=0; z2=-z_shadow;
|
||
|
<a name="l577"></a> </span><span class=cF5>Mat4x4MulXYZ</span><span class=cF0>(e->w2s,&x2,&y2,&z2);
|
||
|
<a name="l578"></a> zc+=</span><span class=cF5>Round</span><span class=cF0>(</span><span class=cF5>Sqrt</span><span class=cF7>(</span><span class=cF0>x2*x2+y2*y2+z2*z2</span><span class=cF7>)</span><span class=cF0>)*</span><span class=cF5>SignI64</span><span class=cF0>(z2);
|
||
|
<a name="l579"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l580"></a>
|
||
|
<a name="l581"></a> x=xc-x;
|
||
|
<a name="l582"></a> y=yc-y;
|
||
|
<a name="l583"></a> z=zc-z;
|
||
|
<a name="l584"></a> </span><span class=cF5>Mat4x4MulXYZ</span><span class=cF0>(e->s2w,&x,&y,&z);
|
||
|
<a name="l585"></a> x=</span><span class=cF5>RoundI64</span><span class=cF0>(x,e->cur_snap);
|
||
|
<a name="l586"></a> y=</span><span class=cF5>RoundI64</span><span class=cF0>(y,e->cur_snap);
|
||
|
<a name="l587"></a> z=</span><span class=cF5>RoundI64</span><span class=cF0>(e->ms_z,e->cur_snap);
|
||
|
<a name="l588"></a> *_x=x; *_y=y; *_z=z;
|
||
|
<a name="l589"></a>}
|
||
|
<a name="l590"></a>
|
||
|
<a name="l591"></a></span><span class=cF9>CMeshEdVertex</span><span class=cF0> </span><span class=cFB>sys_clip_vertex_head</span><span class=cF0>;
|
||
|
<a name="l592"></a></span><span class=cF9>CMeshEdTri</span><span class=cF0> </span><span class=cFB>sys_clip_tri_head</span><span class=cF0>;
|
||
|
<a name="l593"></a>
|
||
|
<a name="l594"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshClipInit</span><span class=cF0>()
|
||
|
<a name="l595"></a>{
|
||
|
<a name="l596"></a> </span><span class=cF5>QueInit</span><span class=cF0>(&</span><span class=cFB>sys_clip_vertex_head</span><span class=cF0>);
|
||
|
<a name="l597"></a> </span><span class=cF5>QueInit</span><span class=cF0>(&</span><span class=cFB>sys_clip_tri_head</span><span class=cF0>);
|
||
|
<a name="l598"></a>}
|
||
|
<a name="l599"></a>
|
||
|
<a name="l600"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshClipRst</span><span class=cF0>()
|
||
|
<a name="l601"></a>{
|
||
|
<a name="l602"></a> </span><span class=cF5>QueDel</span><span class=cF0>(&</span><span class=cFB>sys_clip_vertex_head</span><span class=cF0>,</span><span class=cF3>TRUE</span><span class=cF0>);
|
||
|
<a name="l603"></a> </span><span class=cF5>QueDel</span><span class=cF0>(&</span><span class=cFB>sys_clip_tri_head</span><span class=cF0>,</span><span class=cF3>TRUE</span><span class=cF0>);
|
||
|
<a name="l604"></a> </span><span class=cF5>MeshClipInit</span><span class=cF0>;
|
||
|
<a name="l605"></a>}
|
||
|
<a name="l606"></a>
|
||
|
<a name="l607"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshClipCopy</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e)
|
||
|
<a name="l608"></a>{
|
||
|
<a name="l609"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *tmpv=e->vertex_head.next,*tmpv2;
|
||
|
<a name="l610"></a> </span><span class=cF9>CMeshEdTri</span><span class=cF0> *tmpt=e->tri_head.next,*tmpt2;
|
||
|
<a name="l611"></a>
|
||
|
<a name="l612"></a> </span><span class=cF5>MeshClipRst</span><span class=cF0>;
|
||
|
<a name="l613"></a> </span><span class=cF1>while</span><span class=cF0> (tmpv!=&e->vertex_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l614"></a> </span><span class=cF1>if</span><span class=cF0> (tmpv->flags&</span><span class=cF3>VF_SEL</span><span class=cF0>) {
|
||
|
<a name="l615"></a> tmpv->copy=tmpv2=</span><span class=cF5>ACAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CMeshEdVertex</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l616"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(&tmpv2->p,&tmpv->p,</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CD3I32</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l617"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpv2,</span><span class=cFB>sys_clip_vertex_head</span><span class=cF0>.last);
|
||
|
<a name="l618"></a> tmpv->flags|=</span><span class=cF3>VF_COPIED</span><span class=cF0>;
|
||
|
<a name="l619"></a> tmpv->flags&=~</span><span class=cF3>VF_SEL</span><span class=cF0>;
|
||
|
<a name="l620"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l621"></a> tmpv->copy=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l622"></a> tmpv->flags&=~(</span><span class=cF3>VF_COPIED</span><span class=cF0>|</span><span class=cF3>VF_SEL</span><span class=cF0>);
|
||
|
<a name="l623"></a> }
|
||
|
<a name="l624"></a> tmpv=tmpv->next;
|
||
|
<a name="l625"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l626"></a> </span><span class=cF1>while</span><span class=cF0> (tmpt!=&e->tri_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l627"></a> </span><span class=cF1>if</span><span class=cF0> (tmpt->flags&</span><span class=cF3>TF_SEL</span><span class=cF0> &&
|
||
|
<a name="l628"></a> tmpt->t[0]->copy && tmpt->t[1]->copy && tmpt->t[2]->copy) {
|
||
|
<a name="l629"></a> tmpt2=</span><span class=cF5>ACAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CMeshEdTri</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l630"></a> tmpt2->t[0]=tmpt->t[0]->copy;
|
||
|
<a name="l631"></a> tmpt2->t[1]=tmpt->t[1]->copy;
|
||
|
<a name="l632"></a> tmpt2->t[2]=tmpt->t[2]->copy;
|
||
|
<a name="l633"></a> tmpt2->mt.color=tmpt->mt.color;
|
||
|
<a name="l634"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpt2,</span><span class=cFB>sys_clip_tri_head</span><span class=cF0>.last);
|
||
|
<a name="l635"></a> tmpt->flags|=</span><span class=cF3>TF_COPIED</span><span class=cF0>;
|
||
|
<a name="l636"></a> tmpt->flags&=~</span><span class=cF3>TF_SEL</span><span class=cF0>;
|
||
|
<a name="l637"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l638"></a> tmpt->flags&=~(</span><span class=cF3>TF_COPIED</span><span class=cF0>|</span><span class=cF3>TF_SEL</span><span class=cF0>);
|
||
|
<a name="l639"></a> tmpt=tmpt->next;
|
||
|
<a name="l640"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l641"></a>}
|
||
|
<a name="l642"></a>
|
||
|
<a name="l643"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshClipCut</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e)
|
||
|
<a name="l644"></a>{
|
||
|
<a name="l645"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *tmpv=e->vertex_head.next,*tmpv1;
|
||
|
<a name="l646"></a> </span><span class=cF9>CMeshEdTri</span><span class=cF0> *tmpt=e->tri_head.next,*tmpt1;
|
||
|
<a name="l647"></a> </span><span class=cF5>MeshClipCopy</span><span class=cF0>(e);
|
||
|
<a name="l648"></a> </span><span class=cF1>while</span><span class=cF0> (tmpt!=&e->tri_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l649"></a> tmpt1=tmpt->next;
|
||
|
<a name="l650"></a> </span><span class=cF1>if</span><span class=cF0> (tmpt->flags&</span><span class=cF3>TF_COPIED</span><span class=cF0>)
|
||
|
<a name="l651"></a> </span><span class=cF5>MeshTriDel</span><span class=cF0>(e,tmpt);
|
||
|
<a name="l652"></a> tmpt=tmpt1;
|
||
|
<a name="l653"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l654"></a> </span><span class=cF1>while</span><span class=cF0> (tmpv!=&e->vertex_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l655"></a> tmpv1=tmpv->next;
|
||
|
<a name="l656"></a> </span><span class=cF1>if</span><span class=cF0> (tmpv->flags&</span><span class=cF3>VF_COPIED</span><span class=cF0>)
|
||
|
<a name="l657"></a> </span><span class=cF5>MeshVertexDel</span><span class=cF0>(e,tmpv);
|
||
|
<a name="l658"></a> tmpv=tmpv1;
|
||
|
<a name="l659"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l660"></a>}
|
||
|
<a name="l661"></a>
|
||
|
<a name="l662"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshClipDel</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e)
|
||
|
<a name="l663"></a>{</span><span class=cF2>//Technically not clip</span><span class=cF0>
|
||
|
<a name="l664"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *tmpv=e->vertex_head.next,*tmpv1;
|
||
|
<a name="l665"></a> </span><span class=cF9>CMeshEdTri</span><span class=cF0> *tmpt=e->tri_head.next,*tmpt1;
|
||
|
<a name="l666"></a> </span><span class=cF1>while</span><span class=cF0> (tmpt!=&e->tri_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l667"></a> tmpt1=tmpt->next;
|
||
|
<a name="l668"></a> </span><span class=cF1>if</span><span class=cF0> (tmpt->flags&</span><span class=cF3>TF_SEL</span><span class=cF0>)
|
||
|
<a name="l669"></a> </span><span class=cF5>MeshTriDel</span><span class=cF0>(e,tmpt);
|
||
|
<a name="l670"></a> tmpt=tmpt1;
|
||
|
<a name="l671"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l672"></a> </span><span class=cF1>while</span><span class=cF0> (tmpv!=&e->vertex_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l673"></a> tmpv1=tmpv->next;
|
||
|
<a name="l674"></a> </span><span class=cF1>if</span><span class=cF0> (tmpv->flags&</span><span class=cF3>VF_SEL</span><span class=cF0>)
|
||
|
<a name="l675"></a> </span><span class=cF5>MeshVertexDel</span><span class=cF0>(e,tmpv);
|
||
|
<a name="l676"></a> tmpv=tmpv1;
|
||
|
<a name="l677"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l678"></a>}
|
||
|
<a name="l679"></a>
|
||
|
<a name="l680"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshClipPaste</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e)
|
||
|
<a name="l681"></a>{
|
||
|
<a name="l682"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *tmpv2=</span><span class=cFB>sys_clip_vertex_head</span><span class=cF0>.next,*tmpv;
|
||
|
<a name="l683"></a> </span><span class=cF9>CMeshEdTri</span><span class=cF0> *tmpt2=</span><span class=cFB>sys_clip_tri_head</span><span class=cF0>.next,*tmpt;
|
||
|
<a name="l684"></a>
|
||
|
<a name="l685"></a> </span><span class=cF5>MeshVertexSelAll</span><span class=cF0>(e,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l686"></a> </span><span class=cF5>MeshTriSelAll</span><span class=cF0>(e,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l687"></a> </span><span class=cF1>while</span><span class=cF0> (tmpv2!=&</span><span class=cFB>sys_clip_vertex_head</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l688"></a> tmpv2->copy=tmpv=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CMeshEdVertex</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l689"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(&tmpv->p,&tmpv2->p,</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CD3I32</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l690"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpv,e->vertex_head.last);
|
||
|
<a name="l691"></a> tmpv->flags|=</span><span class=cF3>VF_SEL</span><span class=cF0>;
|
||
|
<a name="l692"></a> tmpv2=tmpv2->next;
|
||
|
<a name="l693"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l694"></a>
|
||
|
<a name="l695"></a> </span><span class=cF1>while</span><span class=cF0> (tmpt2!=&</span><span class=cFB>sys_clip_tri_head</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l696"></a> tmpt=</span><span class=cF5>MeshTriNew</span><span class=cF0>(e,tmpt2->mt.color,tmpt2->t[0]->copy,
|
||
|
<a name="l697"></a> tmpt2->t[1]->copy,tmpt2->t[2]->copy);
|
||
|
<a name="l698"></a> tmpt->flags|=</span><span class=cF3>TF_SEL</span><span class=cF0>;
|
||
|
<a name="l699"></a> tmpt2=tmpt2->next;
|
||
|
<a name="l700"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l701"></a>}
|
||
|
<a name="l702"></a>
|
||
|
<a name="l703"></a></span><span class=cF5>MeshClipInit</span><span class=cF0>;
|
||
|
<a name="l704"></a>
|
||
|
<a name="l705"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>DrawIt</span><span class=cF0>(</span><span class=cF9>CTask</span><span class=cF0> *task,</span><span class=cF9>CDC</span><span class=cF0> *dc)
|
||
|
<a name="l706"></a>{
|
||
|
<a name="l707"></a> </span><span class=cF9>CMeshFrame</span><span class=cF0> *e=</span><span class=cF5>FramePtr</span><span class=cF0>(</span><span class=cF6>"CMeshFrame"</span><span class=cF0>,task);
|
||
|
<a name="l708"></a> </span><span class=cF9>CCtrl</span><span class=cF0> *c=</span><span class=cF5>CtrlFindUnique</span><span class=cF0>(task,</span><span class=cF3>CTRLT_VIEWING_ANGLES</span><span class=cF0>);
|
||
|
<a name="l709"></a> </span><span class=cF1>F64</span><span class=cF0> d;
|
||
|
<a name="l710"></a> </span><span class=cF9>I64</span><span class=cF0> i,x,y,z;
|
||
|
<a name="l711"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *tmpv;
|
||
|
<a name="l712"></a>
|
||
|
<a name="l713"></a> task->horz_scroll.min=-(</span><span class=cF3>MESH_WORKSPACE_SIZE</span><span class=cF0>-task->pix_width)/2;
|
||
|
<a name="l714"></a> task->horz_scroll.max= (</span><span class=cF3>MESH_WORKSPACE_SIZE</span><span class=cF0>-task->pix_width)/2;
|
||
|
<a name="l715"></a> task->vert_scroll.min=-(</span><span class=cF3>MESH_WORKSPACE_SIZE</span><span class=cF0>-task->pix_height)/2;
|
||
|
<a name="l716"></a> task->vert_scroll.max= (</span><span class=cF3>MESH_WORKSPACE_SIZE</span><span class=cF0>-task->pix_height)/2;
|
||
|
<a name="l717"></a> </span><span class=cF5>TaskDerivedValsUpdate</span><span class=cF0>(task);
|
||
|
<a name="l718"></a> </span><span class=cF5>MeshRecalcCxCy</span><span class=cF0>(task,e);
|
||
|
<a name="l719"></a>
|
||
|
<a name="l720"></a> dc->flags|=</span><span class=cF3>DCF_TRANSFORMATION</span><span class=cF0>;
|
||
|
<a name="l721"></a>
|
||
|
<a name="l722"></a> </span><span class=cF5>Free</span><span class=cF0>(dc->r); </span><span class=cF2>//Set rotmat doesn't free old dc->r matrix.</span><span class=cF0>
|
||
|
<a name="l723"></a> </span><span class=cF5>DCMat4x4Set</span><span class=cF0>(dc,</span><span class=cF5>MeshSetW2S</span><span class=cF7>(</span><span class=cF0>e,task</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l724"></a>
|
||
|
<a name="l725"></a> dc->x=e->cx;
|
||
|
<a name="l726"></a> dc->y=e->cy;
|
||
|
<a name="l727"></a></span><span class=cF2>//z-vals less than zero are in front of scrn and not drawn.</span><span class=cF0>
|
||
|
<a name="l728"></a> </span><span class=cF2>//we want to shift all Z-vals into a drawable range.</span><span class=cF0>
|
||
|
<a name="l729"></a> </span><span class=cF2>//GR_Z_ALL is set to half of the Z-range which is an I32.</span><span class=cF0>
|
||
|
<a name="l730"></a> dc->z=</span><span class=cF3>GR_Z_ALL</span><span class=cF0>;
|
||
|
<a name="l731"></a>
|
||
|
<a name="l732"></a> </span><span class=cF2>//Light source set to mouse.</span><span class=cF0>
|
||
|
<a name="l733"></a> </span><span class=cF5>MeshCursorW</span><span class=cF0>(e,task,&x,&y,&z);
|
||
|
<a name="l734"></a> dc->ls.x=x;
|
||
|
<a name="l735"></a> dc->ls.y=y;
|
||
|
<a name="l736"></a> dc->ls.z=z;
|
||
|
<a name="l737"></a> d=1<<16/</span><span class=cF5>D3I32Norm</span><span class=cF0>(&dc->ls); </span><span class=cF2>//Light source normalized to 65536.</span><span class=cF0>
|
||
|
<a name="l738"></a> dc->ls.x*=d;
|
||
|
<a name="l739"></a> dc->ls.y*=d;
|
||
|
<a name="l740"></a> dc->ls.z*=d;
|
||
|
<a name="l741"></a>
|
||
|
<a name="l742"></a> </span><span class=cF5>DCDepthBufAlloc</span><span class=cF0>(dc);
|
||
|
<a name="l743"></a>
|
||
|
<a name="l744"></a> tmpv=e->vertex_head.next;
|
||
|
<a name="l745"></a> </span><span class=cF1>while</span><span class=cF0> (tmpv!=&e->vertex_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l746"></a> x=tmpv->p.x; y=tmpv->p.y; z=tmpv->p.z;
|
||
|
<a name="l747"></a> (*dc->transform)(dc,&x,&y,&z);
|
||
|
<a name="l748"></a> tmpv->pt.x=x; tmpv->pt.y=y; tmpv->pt.z=z;
|
||
|
<a name="l749"></a> tmpv=tmpv->next;
|
||
|
<a name="l750"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l751"></a>
|
||
|
<a name="l752"></a> e->mp_not_done_flags=1<<</span><span class=cFB>mp_cnt</span><span class=cF0>-1; </span><span class=cF2>//Issue jobs to all cores.</span><span class=cF0>
|
||
|
<a name="l753"></a> e->dc=dc;
|
||
|
<a name="l754"></a> e->depth_buf=dc->depth_buf;
|
||
|
<a name="l755"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<</span><span class=cFB>mp_cnt</span><span class=cF0>;i++)
|
||
|
<a name="l756"></a> </span><span class=cF5>JobQue</span><span class=cF0>(&</span><span class=cF5>MPDrawIt</span><span class=cF0>,e,i);
|
||
|
<a name="l757"></a>
|
||
|
<a name="l758"></a> tmpv=e->vertex_head.next;
|
||
|
<a name="l759"></a> </span><span class=cF1>while</span><span class=cF0> (tmpv!=&e->vertex_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l760"></a> x=tmpv->pt.x; y=tmpv->pt.y; z=tmpv->pt.z;
|
||
|
<a name="l761"></a> </span><span class=cF1>if</span><span class=cF0> (e->vertex_on) {
|
||
|
<a name="l762"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Blink</span><span class=cF7>(</span><span class=cF0>10</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF2>//This blinks at 10 Hz.</span><span class=cF0>
|
||
|
<a name="l763"></a> dc->color=</span><span class=cF3>ROPF_DITHER</span><span class=cF0>+</span><span class=cF3>BLACK</span><span class=cF0><<16+</span><span class=cF3>WHITE</span><span class=cF0>;
|
||
|
<a name="l764"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l765"></a> dc->color=</span><span class=cF3>ROPF_DITHER</span><span class=cF0>+</span><span class=cF3>WHITE</span><span class=cF0><<16+</span><span class=cF3>BLACK</span><span class=cF0>;
|
||
|
<a name="l766"></a> </span><span class=cF5>GrLine</span><span class=cF0>(dc,x-3,y-3,x+3,y+3);
|
||
|
<a name="l767"></a> </span><span class=cF5>GrLine</span><span class=cF0>(dc,x-3,y+3,x+3,y-3);
|
||
|
<a name="l768"></a> }
|
||
|
<a name="l769"></a> </span><span class=cF1>if</span><span class=cF0> (tmpv->flags&</span><span class=cF3>VF_SEL</span><span class=cF0>) {
|
||
|
<a name="l770"></a> </span><span class=cF1>if</span><span class=cF0> (e->ed_mode==</span><span class=cF6>'t'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l771"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Blink</span><span class=cF7>(</span><span class=cF0>10</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF2>//This blinks at 10 Hz.</span><span class=cF0>
|
||
|
<a name="l772"></a> dc->color=</span><span class=cF3>ROPF_DITHER</span><span class=cF0>+e->cur_color.c0.color<<16+
|
||
|
<a name="l773"></a> e->cur_color.c0.color^8;
|
||
|
<a name="l774"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l775"></a> dc->color=</span><span class=cF3>ROPF_DITHER</span><span class=cF0>+(e->cur_color.c0.color^8)<<16+
|
||
|
<a name="l776"></a> e->cur_color.c0.color;
|
||
|
<a name="l777"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l778"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Blink</span><span class=cF0>)
|
||
|
<a name="l779"></a> dc->color=</span><span class=cF3>ROPF_DITHER</span><span class=cF0>+</span><span class=cF3>RED</span><span class=cF0><<16+</span><span class=cF3>WHITE</span><span class=cF0>;
|
||
|
<a name="l780"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l781"></a> dc->color=</span><span class=cF3>ROPF_DITHER</span><span class=cF0>+</span><span class=cF3>WHITE</span><span class=cF0><<16+</span><span class=cF3>RED</span><span class=cF0>;
|
||
|
<a name="l782"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l783"></a> </span><span class=cF5>GrCircle</span><span class=cF0>(dc,x,y,3);
|
||
|
<a name="l784"></a> }
|
||
|
<a name="l785"></a> tmpv=tmpv->next;
|
||
|
<a name="l786"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l787"></a>
|
||
|
<a name="l788"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>CtrlInside</span><span class=cF7>(</span><span class=cF0>c,</span><span class=cFB>ms</span><span class=cF0>.presnap.x,</span><span class=cFB>ms</span><span class=cF0>.presnap.y</span><span class=cF7>)</span><span class=cF0>||</span><span class=cFB>winmgr</span><span class=cF0>.show_menu) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l789"></a> </span><span class=cF5>GridInit</span><span class=cF0>;
|
||
|
<a name="l790"></a> task->win_inhibit=</span><span class=cF3>WIF_SELF_DOC</span><span class=cF0>;
|
||
|
<a name="l791"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l792"></a> </span><span class=cF5>MeshCurSnap</span><span class=cF0>(e);
|
||
|
<a name="l793"></a> task->win_inhibit=</span><span class=cF3>WIG_TASK_DFT</span><span class=cF0>|</span><span class=cF3>WIF_SELF_DOC</span><span class=cF0>-</span><span class=cF3>WIF_SELF_FOCUS</span><span class=cF0>-</span><span class=cF3>WIF_SELF_BORDER</span><span class=cF0>
|
||
|
<a name="l794"></a> -</span><span class=cF3>WIF_SELF_CTRLS</span><span class=cF0>-</span><span class=cF3>WIF_FOCUS_TASK_MENU</span><span class=cF0>-</span><span class=cF3>WIF_SELF_GRAB_SCROLL</span><span class=cF0>;
|
||
|
<a name="l795"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l796"></a>
|
||
|
<a name="l797"></a> </span><span class=cF5>MeshCursorW</span><span class=cF0>(e,task,&x,&y,&z);
|
||
|
<a name="l798"></a> </span><span class=cF1>if</span><span class=cF0> (z<0)
|
||
|
<a name="l799"></a> dc->color=</span><span class=cF3>ROP_XOR</span><span class=cF0>+</span><span class=cF3>RED</span><span class=cF0>^</span><span class=cF3>TRANSPARENT</span><span class=cF0>;
|
||
|
<a name="l800"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l801"></a> dc->color=</span><span class=cF3>ROP_XOR</span><span class=cF0>+</span><span class=cF3>TRANSPARENT</span><span class=cF0>;
|
||
|
<a name="l802"></a> </span><span class=cF5>GrPrint</span><span class=cF0>(dc,0,0,</span><span class=cF6>"%6.3f%% (%d,%d,%d)"</span><span class=cF0>,e->view_scale*100,x,y,z);
|
||
|
<a name="l803"></a> dc->thick=1;
|
||
|
<a name="l804"></a> dc->color&=0xF;
|
||
|
<a name="l805"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Blink</span><span class=cF7>(</span><span class=cF0>10</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l806"></a> dc->color^=0xF;
|
||
|
<a name="l807"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(dc,x,y,z,x,y,0);
|
||
|
<a name="l808"></a>
|
||
|
<a name="l809"></a> </span><span class=cF1>if</span><span class=cF0> (e->sel_rect) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l810"></a> dc->flags&=~</span><span class=cF3>DCF_TRANSFORMATION</span><span class=cF0>;
|
||
|
<a name="l811"></a> dc->thick=1;
|
||
|
<a name="l812"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Blink</span><span class=cF0>)
|
||
|
<a name="l813"></a> dc->color=</span><span class=cF3>ROPF_DITHER</span><span class=cF0>+</span><span class=cF3>RED</span><span class=cF0><<16+</span><span class=cF3>WHITE</span><span class=cF0>;
|
||
|
<a name="l814"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l815"></a> dc->color=</span><span class=cF3>ROPF_DITHER</span><span class=cF0>+</span><span class=cF3>WHITE</span><span class=cF0><<16+</span><span class=cF3>RED</span><span class=cF0>;
|
||
|
<a name="l816"></a> </span><span class=cF5>GrBorder</span><span class=cF0>(dc,e->x1,e->y1,e->x2,e->y2);
|
||
|
<a name="l817"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l818"></a></span><span class=cF2>//Wait for all cores to complete.</span><span class=cF0>
|
||
|
<a name="l819"></a> </span><span class=cF1>while</span><span class=cF0> (e->mp_not_done_flags)
|
||
|
<a name="l820"></a> </span><span class=cF5>Yield</span><span class=cF0>;
|
||
|
<a name="l821"></a>}
|
||
|
<a name="l822"></a>
|
||
|
<a name="l823"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshInit</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e,</span><span class=cF1>Bool</span><span class=cF0> flip_y)
|
||
|
<a name="l824"></a>{
|
||
|
<a name="l825"></a> </span><span class=cF5>MemSet</span><span class=cF0>(e,0,</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CMeshFrame</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l826"></a> </span><span class=cF5>QueInit</span><span class=cF0>(&e->vertex_head);
|
||
|
<a name="l827"></a> </span><span class=cF5>QueInit</span><span class=cF0>(&e->tri_head);
|
||
|
<a name="l828"></a> e->ed_mode=</span><span class=cF6>'v'</span><span class=cF0>;
|
||
|
<a name="l829"></a> e->grid_on=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l830"></a> e->vertex_on=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l831"></a> e->ms_z=0;
|
||
|
<a name="l832"></a> e->thickness=25;
|
||
|
<a name="l833"></a> e->closed=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l834"></a> e->view_scale=1.0;
|
||
|
<a name="l835"></a> e->w2s=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l836"></a> e->s2w=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l837"></a> e->cur_color=</span><span class=cF3>RED</span><span class=cF0>;
|
||
|
<a name="l838"></a> e->cur_snap=5;
|
||
|
<a name="l839"></a> e->flip_y=flip_y;
|
||
|
<a name="l840"></a> e->sel_rect=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l841"></a> e->cur_tri=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l842"></a> e->cur_vertex=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l843"></a> e->chain_pred=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l844"></a>}
|
||
|
<a name="l845"></a>
|
||
|
<a name="l846"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshLoad</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e,</span><span class=cF1>U8</span><span class=cF0> *src)
|
||
|
<a name="l847"></a>{
|
||
|
<a name="l848"></a> </span><span class=cF9>I64</span><span class=cF0> i,j,x,y,z;
|
||
|
<a name="l849"></a> </span><span class=cF9>CColorROPU32</span><span class=cF0> color;
|
||
|
<a name="l850"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *tmpv,*va[3];
|
||
|
<a name="l851"></a>
|
||
|
<a name="l852"></a> </span><span class=cF5>QueInit</span><span class=cF0>(&e->vertex_head);
|
||
|
<a name="l853"></a> </span><span class=cF5>QueInit</span><span class=cF0>(&e->tri_head);
|
||
|
<a name="l854"></a>
|
||
|
<a name="l855"></a> e->vertex_cnt =*src(</span><span class=cF9>I32</span><span class=cF0> *)++;
|
||
|
<a name="l856"></a> e->tri_cnt=*src(</span><span class=cF9>I32</span><span class=cF0> *)++;
|
||
|
<a name="l857"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<e->vertex_cnt;i++) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l858"></a> x=*src(</span><span class=cF9>I32</span><span class=cF0> *)++;
|
||
|
<a name="l859"></a> y=*src(</span><span class=cF9>I32</span><span class=cF0> *)++;
|
||
|
<a name="l860"></a> z=*src(</span><span class=cF9>I32</span><span class=cF0> *)++;
|
||
|
<a name="l861"></a> tmpv=</span><span class=cF5>MeshVertexNew</span><span class=cF0>(e,x,y,z);
|
||
|
<a name="l862"></a> tmpv->num=i;
|
||
|
<a name="l863"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l864"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<e->tri_cnt;i++) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l865"></a> color=*src(</span><span class=cF9>I32</span><span class=cF0> *)++;
|
||
|
<a name="l866"></a> </span><span class=cF1>for</span><span class=cF0> (j=0;j<3;j++)
|
||
|
<a name="l867"></a> va[j]=</span><span class=cF5>MeshVertexFindNum</span><span class=cF0>(e,*src</span><span class=cF7>(</span><span class=cF9>I32</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++);
|
||
|
<a name="l868"></a> </span><span class=cF5>MeshTriNew</span><span class=cF0>(e,color,va[0],va[1],va[2]);
|
||
|
<a name="l869"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l870"></a>}
|
||
|
<a name="l871"></a>
|
||
|
<a name="l872"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>MeshSize</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e)
|
||
|
<a name="l873"></a>{
|
||
|
<a name="l874"></a> </span><span class=cF9>I64</span><span class=cF0> i;
|
||
|
<a name="l875"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *tmpv=e->vertex_head.next;
|
||
|
<a name="l876"></a> </span><span class=cF9>CMeshEdTri</span><span class=cF0> *tmpt=e->tri_head.next;
|
||
|
<a name="l877"></a>
|
||
|
<a name="l878"></a> e->vertex_cnt=0;
|
||
|
<a name="l879"></a> </span><span class=cF1>while</span><span class=cF0> (tmpv!=&e->vertex_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l880"></a> tmpv->num=e->vertex_cnt++;
|
||
|
<a name="l881"></a> tmpv=tmpv->next;
|
||
|
<a name="l882"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l883"></a>
|
||
|
<a name="l884"></a> e->tri_cnt=0;
|
||
|
<a name="l885"></a> </span><span class=cF1>while</span><span class=cF0> (tmpt!=&e->tri_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l886"></a> e->tri_cnt++;
|
||
|
<a name="l887"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<3;i++)
|
||
|
<a name="l888"></a> tmpt->mt.nums[i]=tmpt->t[i]->num;
|
||
|
<a name="l889"></a> tmpt=tmpt->next;
|
||
|
<a name="l890"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l891"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>I32</span><span class=cF0>)*2+
|
||
|
<a name="l892"></a> (</span><span class=cF1>offset</span><span class=cF7>(</span><span class=cF9>CMeshEdVertex</span><span class=cF0>.</span><span class=cF1>end</span><span class=cF7>)</span><span class=cF0>-</span><span class=cF1>offset</span><span class=cF7>(</span><span class=cF9>CMeshEdVertex</span><span class=cF0>.</span><span class=cF1>start</span><span class=cF7>)</span><span class=cF0>)*e->vertex_cnt+
|
||
|
<a name="l893"></a> (</span><span class=cF1>offset</span><span class=cF7>(</span><span class=cF9>CMeshEdTri</span><span class=cF0>.</span><span class=cF1>end</span><span class=cF7>)</span><span class=cF0>-</span><span class=cF1>offset</span><span class=cF7>(</span><span class=cF9>CMeshEdTri</span><span class=cF0>.</span><span class=cF1>start</span><span class=cF7>)</span><span class=cF0>)*e->tri_cnt;
|
||
|
<a name="l894"></a>}
|
||
|
<a name="l895"></a>
|
||
|
<a name="l896"></a></span><span class=cF9>I32</span><span class=cF0> *</span><span class=cF5>MeshSave</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e,</span><span class=cF9>I64</span><span class=cF0> *_size=</span><span class=cF3>NULL</span><span class=cF0>)
|
||
|
<a name="l897"></a>{
|
||
|
<a name="l898"></a> </span><span class=cF9>I64</span><span class=cF0> size=</span><span class=cF5>MeshSize</span><span class=cF0>(e);
|
||
|
<a name="l899"></a> </span><span class=cF1>U8</span><span class=cF0> *res=</span><span class=cF5>MAlloc</span><span class=cF0>(size),*dst=res;
|
||
|
<a name="l900"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *tmpv=e->vertex_head.next;
|
||
|
<a name="l901"></a> </span><span class=cF9>CMeshEdTri</span><span class=cF0> *tmpt=e->tri_head.next;
|
||
|
<a name="l902"></a>
|
||
|
<a name="l903"></a> *dst(</span><span class=cF9>I32</span><span class=cF0> *)++=e->vertex_cnt;
|
||
|
<a name="l904"></a> *dst(</span><span class=cF9>I32</span><span class=cF0> *)++=e->tri_cnt;
|
||
|
<a name="l905"></a>
|
||
|
<a name="l906"></a> e->vertex_cnt=0;
|
||
|
<a name="l907"></a> </span><span class=cF1>while</span><span class=cF0> (tmpv!=&e->vertex_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l908"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(dst,&tmpv-></span><span class=cF1>start</span><span class=cF0>,</span><span class=cF1>offset</span><span class=cF7>(</span><span class=cF9>CMeshEdVertex</span><span class=cF0>.</span><span class=cF1>end</span><span class=cF7>)</span><span class=cF0>
|
||
|
<a name="l909"></a> -</span><span class=cF1>offset</span><span class=cF7>(</span><span class=cF9>CMeshEdVertex</span><span class=cF0>.</span><span class=cF1>start</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l910"></a> dst+=</span><span class=cF1>offset</span><span class=cF0>(</span><span class=cF9>CMeshEdVertex</span><span class=cF0>.</span><span class=cF1>end</span><span class=cF0>)-</span><span class=cF1>offset</span><span class=cF0>(</span><span class=cF9>CMeshEdVertex</span><span class=cF0>.</span><span class=cF1>start</span><span class=cF0>);
|
||
|
<a name="l911"></a> tmpv=tmpv->next;
|
||
|
<a name="l912"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l913"></a>
|
||
|
<a name="l914"></a> e->tri_cnt=0;
|
||
|
<a name="l915"></a> </span><span class=cF1>while</span><span class=cF0> (tmpt!=&e->tri_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l916"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(dst,&tmpt-></span><span class=cF1>start</span><span class=cF0>,</span><span class=cF1>offset</span><span class=cF7>(</span><span class=cF9>CMeshEdTri</span><span class=cF0>.</span><span class=cF1>end</span><span class=cF7>)</span><span class=cF0>-</span><span class=cF1>offset</span><span class=cF7>(</span><span class=cF9>CMeshEdTri</span><span class=cF0>.</span><span class=cF1>start</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l917"></a> dst+=</span><span class=cF1>offset</span><span class=cF0>(</span><span class=cF9>CMeshEdTri</span><span class=cF0>.</span><span class=cF1>end</span><span class=cF0>)-</span><span class=cF1>offset</span><span class=cF0>(</span><span class=cF9>CMeshEdTri</span><span class=cF0>.</span><span class=cF1>start</span><span class=cF0>);
|
||
|
<a name="l918"></a> tmpt=tmpt->next;
|
||
|
<a name="l919"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l920"></a> </span><span class=cF1>if</span><span class=cF0> (_size) *_size=size;
|
||
|
<a name="l921"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
||
|
<a name="l922"></a>}
|
||
|
<a name="l923"></a>
|
||
|
<a name="l924"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshCleanUp</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e)
|
||
|
<a name="l925"></a>{
|
||
|
<a name="l926"></a> </span><span class=cF5>QueDel</span><span class=cF0>(&e->vertex_head,</span><span class=cF3>TRUE</span><span class=cF0>);
|
||
|
<a name="l927"></a> </span><span class=cF5>QueDel</span><span class=cF0>(&e->tri_head,</span><span class=cF3>TRUE</span><span class=cF0>);
|
||
|
<a name="l928"></a> </span><span class=cF5>Free</span><span class=cF0>(e->w2s);
|
||
|
<a name="l929"></a> </span><span class=cF5>Free</span><span class=cF0>(e->s2w);
|
||
|
<a name="l930"></a>}
|
||
|
<a name="l931"></a>
|
||
|
<a name="l932"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>MeshUpdateMenu</span><span class=cF0>(</span><span class=cF9>CMeshFrame</span><span class=cF0> *e)
|
||
|
<a name="l933"></a>{
|
||
|
<a name="l934"></a> </span><span class=cF9>CMenuEntry</span><span class=cF0> *tmpse;
|
||
|
<a name="l935"></a> </span><span class=cF1>if</span><span class=cF0> (tmpse=</span><span class=cF5>MenuEntryFind</span><span class=cF7>(</span><span class=cF5>Fs</span><span class=cF0>->cur_menu,</span><span class=cF6>"View/Grid"</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l936"></a> tmpse->checked=</span><span class=cF5>ToBool</span><span class=cF0>(e->grid_on);
|
||
|
<a name="l937"></a> </span><span class=cF1>if</span><span class=cF0> (tmpse=</span><span class=cF5>MenuEntryFind</span><span class=cF7>(</span><span class=cF5>Fs</span><span class=cF0>->cur_menu,</span><span class=cF6>"View/Vertex"</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l938"></a> tmpse->checked=</span><span class=cF5>ToBool</span><span class=cF0>(e->vertex_on);
|
||
|
<a name="l939"></a> </span><span class=cF1>if</span><span class=cF0> (tmpse=</span><span class=cF5>MenuEntryFind</span><span class=cF7>(</span><span class=cF5>Fs</span><span class=cF0>->cur_menu,</span><span class=cF6>"Mode/PlaceVertex"</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l940"></a> tmpse->checked=</span><span class=cF5>ToBool</span><span class=cF0>(e->ed_mode==</span><span class=cF6>'v'</span><span class=cF0>);
|
||
|
<a name="l941"></a> </span><span class=cF1>if</span><span class=cF0> (tmpse=</span><span class=cF5>MenuEntryFind</span><span class=cF7>(</span><span class=cF5>Fs</span><span class=cF0>->cur_menu,</span><span class=cF6>"Mode/MoveVertex"</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l942"></a> tmpse->checked=</span><span class=cF5>ToBool</span><span class=cF0>(e->ed_mode==</span><span class=cF6>'m'</span><span class=cF0>);
|
||
|
<a name="l943"></a> </span><span class=cF1>if</span><span class=cF0> (tmpse=</span><span class=cF5>MenuEntryFind</span><span class=cF7>(</span><span class=cF5>Fs</span><span class=cF0>->cur_menu,</span><span class=cF6>"Mode/MoveVertexZ"</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l944"></a> tmpse->checked=</span><span class=cF5>ToBool</span><span class=cF0>(e->ed_mode==</span><span class=cF6>'M'</span><span class=cF0>);
|
||
|
<a name="l945"></a> </span><span class=cF1>if</span><span class=cF0> (tmpse=</span><span class=cF5>MenuEntryFind</span><span class=cF7>(</span><span class=cF5>Fs</span><span class=cF0>->cur_menu,</span><span class=cF6>"Mode/Triangle"</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l946"></a> tmpse->checked=</span><span class=cF5>ToBool</span><span class=cF0>(e->ed_mode==</span><span class=cF6>'t'</span><span class=cF0>);
|
||
|
<a name="l947"></a> </span><span class=cF1>if</span><span class=cF0> (tmpse=</span><span class=cF5>MenuEntryFind</span><span class=cF7>(</span><span class=cF5>Fs</span><span class=cF0>->cur_menu,</span><span class=cF6>"Mode/Polygon"</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l948"></a> tmpse->checked=</span><span class=cF5>ToBool</span><span class=cF0>(e->ed_mode==</span><span class=cF6>'n'</span><span class=cF0>);
|
||
|
<a name="l949"></a> </span><span class=cF1>if</span><span class=cF0> (tmpse=</span><span class=cF5>MenuEntryFind</span><span class=cF7>(</span><span class=cF5>Fs</span><span class=cF0>->cur_menu,</span><span class=cF6>"Mode/Fence"</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l950"></a> tmpse->checked=</span><span class=cF5>ToBool</span><span class=cF0>(e->ed_mode==</span><span class=cF6>'f'</span><span class=cF0>);
|
||
|
<a name="l951"></a> </span><span class=cF1>if</span><span class=cF0> (tmpse=</span><span class=cF5>MenuEntryFind</span><span class=cF7>(</span><span class=cF5>Fs</span><span class=cF0>->cur_menu,</span><span class=cF6>"Mode/Prism"</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l952"></a> tmpse->checked=</span><span class=cF5>ToBool</span><span class=cF0>(e->ed_mode==</span><span class=cF6>'p'</span><span class=cF0>);
|
||
|
<a name="l953"></a> </span><span class=cF1>if</span><span class=cF0> (tmpse=</span><span class=cF5>MenuEntryFind</span><span class=cF7>(</span><span class=cF5>Fs</span><span class=cF0>->cur_menu,</span><span class=cF6>"View/FlipY"</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l954"></a> tmpse->checked=</span><span class=cF5>ToBool</span><span class=cF0>(e->flip_y);
|
||
|
<a name="l955"></a>}
|
||
|
<a name="l956"></a>
|
||
|
<a name="l957"></a></span><span class=cF9>I32</span><span class=cF0> *</span><span class=cF5>SpriteMeshEd</span><span class=cF0>(</span><span class=cF9>I32</span><span class=cF0> *head=</span><span class=cF3>NULL</span><span class=cF0>,</span><span class=cF9>I64</span><span class=cF0> *_size=</span><span class=cF3>NULL</span><span class=cF0>,</span><span class=cF1>Bool</span><span class=cF0> flip_y=</span><span class=cF3>FALSE</span><span class=cF0>)
|
||
|
<a name="l958"></a>{</span><span class=cF2>/*Fmt for mesh:</span><span class=cF0>
|
||
|
<a name="l959"></a></span><span class=cF2>{</span><span class=cF0>
|
||
|
<a name="l960"></a></span><span class=cF2>I32 vertex_cnt;</span><span class=cF0>
|
||
|
<a name="l961"></a></span><span class=cF2>I32 tri_cnt;</span><span class=cF0>
|
||
|
<a name="l962"></a></span><span class=cF2>CD3I32 vertices[];</span><span class=cF0>
|
||
|
<a name="l963"></a></span><span class=cF2>CMeshTri tris[];</span><span class=cF0>
|
||
|
<a name="l964"></a></span><span class=cF2>}</span><span class=cF0>
|
||
|
<a name="l965"></a>
|
||
|
<a name="l966"></a></span><span class=cF2>If head points to a mesh, it will load it.</span><span class=cF0>
|
||
|
<a name="l967"></a>
|
||
|
<a name="l968"></a></span><span class=cF2>Returns a newly malloced mesh or NULL.</span><span class=cF0>
|
||
|
<a name="l969"></a>
|
||
|
<a name="l970"></a></span><span class=cF2>See </span><a href="/Wb/Demo/Graphics/SpritePlot3D.HC.HTML#l1"><span class=cF4>::/Demo/Graphics/SpritePlot3D.HC</span></a><span class=cF2>.</span><span class=cF0>
|
||
|
<a name="l971"></a></span><span class=cF2>*/</span><span class=cF0>
|
||
|
<a name="l972"></a> </span><span class=cF9>CCtrl</span><span class=cF0> *c=</span><span class=cF5>CtrlFindUnique</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>,</span><span class=cF3>CTRLT_VIEWING_ANGLES</span><span class=cF0>);
|
||
|
<a name="l973"></a> </span><span class=cF9>CViewAngles</span><span class=cF0> *s,*old_s;
|
||
|
<a name="l974"></a> </span><span class=cF9>I64</span><span class=cF0> i,msg_code,sel_mode,arg1,arg2,make_tri_vertex_num=0,x,y,z;
|
||
|
<a name="l975"></a> </span><span class=cF9>CD3I32</span><span class=cF0> p0a,p0b;
|
||
|
<a name="l976"></a> </span><span class=cF9>CMeshEdVertex</span><span class=cF0> *va[3],*tmpv;
|
||
|
<a name="l977"></a> </span><span class=cF1>Bool</span><span class=cF0> adjusting_z=</span><span class=cF3>FALSE</span><span class=cF0>,moving,save_and_exit;
|
||
|
<a name="l978"></a> </span><span class=cF9>CMeshFrame</span><span class=cF0> e;
|
||
|
<a name="l979"></a>
|
||
|
<a name="l980"></a> </span><span class=cF1>if</span><span class=cF0> (c) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l981"></a> old_s=</span><span class=cF5>MAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CViewAngles</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l982"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(old_s,c->state,</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CViewAngles</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l983"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l984"></a> c=</span><span class=cF5>ViewAnglesNew</span><span class=cF0>;
|
||
|
<a name="l985"></a> old_s=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l986"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l987"></a>
|
||
|
<a name="l988"></a> s=c->state;
|
||
|
<a name="l989"></a> s->sx=0;
|
||
|
<a name="l990"></a> s->sy=0;
|
||
|
<a name="l991"></a> s->sz=0;
|
||
|
<a name="l992"></a> s->cx=</span><span class=cF3>YELLOW</span><span class=cF0>;
|
||
|
<a name="l993"></a> s->cy=</span><span class=cF3>RED</span><span class=cF0>;
|
||
|
<a name="l994"></a> s->cz=</span><span class=cF3>GREEN</span><span class=cF0>;
|
||
|
<a name="l995"></a>
|
||
|
<a name="l996"></a> </span><span class=cF5>MenuPush</span><span class=cF0>(
|
||
|
<a name="l997"></a> </span><span class=cF6>"File {"</span><span class=cF0>
|
||
|
<a name="l998"></a> </span><span class=cF6>" Abort(,CH_SHIFT_ESC);"</span><span class=cF0>
|
||
|
<a name="l999"></a> </span><span class=cF6>" Exit(,CH_ESC);"</span><span class=cF0>
|
||
|
<a name="l1000"></a> </span><span class=cF6>"}"</span><span class=cF0>
|
||
|
<a name="l1001"></a> </span><span class=cF6>"Edit {"</span><span class=cF0>
|
||
|
<a name="l1002"></a> </span><span class=cF6>" Delete(,,SC_DELETE);"</span><span class=cF0>
|
||
|
<a name="l1003"></a> </span><span class=cF6>" DelLast(,CH_BACKSPACE);"</span><span class=cF0>
|
||
|
<a name="l1004"></a> </span><span class=cF6>" Cut(,CH_CTRLX);"</span><span class=cF0>
|
||
|
<a name="l1005"></a> </span><span class=cF6>" Copy(,CH_CTRLC);"</span><span class=cF0>
|
||
|
<a name="l1006"></a> </span><span class=cF6>" Paste(,CH_CTRLV);"</span><span class=cF0>
|
||
|
<a name="l1007"></a> </span><span class=cF6>" SelectAll(,'A');"</span><span class=cF0>
|
||
|
<a name="l1008"></a> </span><span class=cF6>" UnSelectAll(,'U');"</span><span class=cF0>
|
||
|
<a name="l1009"></a> </span><span class=cF6>" SelectRect(,'a');"</span><span class=cF0>
|
||
|
<a name="l1010"></a> </span><span class=cF6>" UnSelectRect(,'u');"</span><span class=cF0>
|
||
|
<a name="l1011"></a> </span><span class=cF6>" OrSelectRect(,'o');"</span><span class=cF0>
|
||
|
<a name="l1012"></a> </span><span class=cF6>" JumpToZ(,'j');"</span><span class=cF0>
|
||
|
<a name="l1013"></a> </span><span class=cF6>" ResetColor(,'C');"</span><span class=cF0>
|
||
|
<a name="l1014"></a> </span><span class=cF6>" ReverseTri(,'r');"</span><span class=cF0>
|
||
|
<a name="l1015"></a> </span><span class=cF6>"}"</span><span class=cF0>
|
||
|
<a name="l1016"></a> </span><span class=cF6>"Mode {"</span><span class=cF0>
|
||
|
<a name="l1017"></a> </span><span class=cF6>" PlaceVertex(,'v');"</span><span class=cF0>
|
||
|
<a name="l1018"></a> </span><span class=cF6>" MoveVertex(,'m');"</span><span class=cF0>
|
||
|
<a name="l1019"></a> </span><span class=cF6>" MoveVertexZ(,'M');"</span><span class=cF0>
|
||
|
<a name="l1020"></a> </span><span class=cF6>" Triangle(,'t');"</span><span class=cF0>
|
||
|
<a name="l1021"></a> </span><span class=cF6>" Polygon(,'n');"</span><span class=cF0>
|
||
|
<a name="l1022"></a> </span><span class=cF6>" Fence(,'f');"</span><span class=cF0>
|
||
|
<a name="l1023"></a> </span><span class=cF6>" Prism(,'p');"</span><span class=cF0>
|
||
|
<a name="l1024"></a> </span><span class=cF6>"}"</span><span class=cF0>
|
||
|
<a name="l1025"></a> </span><span class=cF6>"Settings {"</span><span class=cF0>
|
||
|
<a name="l1026"></a> </span><span class=cF6>" Color(,'c');"</span><span class=cF0>
|
||
|
<a name="l1027"></a> </span><span class=cF6>" Snap(,'s');"</span><span class=cF0>
|
||
|
<a name="l1028"></a> </span><span class=cF6>"}"</span><span class=cF0>
|
||
|
<a name="l1029"></a> </span><span class=cF6>"View {"</span><span class=cF0>
|
||
|
<a name="l1030"></a> </span><span class=cF6>" ZoomIn(,'z');"</span><span class=cF0>
|
||
|
<a name="l1031"></a> </span><span class=cF6>" ZoomOut(,'Z');"</span><span class=cF0>
|
||
|
<a name="l1032"></a> </span><span class=cF6>" NullAngles(,'N');"</span><span class=cF0>
|
||
|
<a name="l1033"></a> </span><span class=cF6>" FlipY(,'y');"</span><span class=cF0>
|
||
|
<a name="l1034"></a> </span><span class=cF6>" Grid(,'g');"</span><span class=cF0>
|
||
|
<a name="l1035"></a> </span><span class=cF6>" Vertex(,'V');"</span><span class=cF0>
|
||
|
<a name="l1036"></a> </span><span class=cF6>" ToggleBorder(,CH_CTRLB);"</span><span class=cF0>
|
||
|
<a name="l1037"></a> </span><span class=cF6>"}"</span><span class=cF0>
|
||
|
<a name="l1038"></a> </span><span class=cF6>"Transforms {"</span><span class=cF0>
|
||
|
<a name="l1039"></a> </span><span class=cF6>" Transform(,'T');"</span><span class=cF0>
|
||
|
<a name="l1040"></a> </span><span class=cF6>" SwapXY(,'1');"</span><span class=cF0>
|
||
|
<a name="l1041"></a> </span><span class=cF6>" SwapXZ(,'2');"</span><span class=cF0>
|
||
|
<a name="l1042"></a> </span><span class=cF6>" SwapYZ(,'3');"</span><span class=cF0>
|
||
|
<a name="l1043"></a> </span><span class=cF6>" InvertX(,'4');"</span><span class=cF0>
|
||
|
<a name="l1044"></a> </span><span class=cF6>" InvertY(,'5');"</span><span class=cF0>
|
||
|
<a name="l1045"></a> </span><span class=cF6>" InvertZ(,'6');"</span><span class=cF0>
|
||
|
<a name="l1046"></a> </span><span class=cF6>" ReverseTri(,'R');"</span><span class=cF0>
|
||
|
<a name="l1047"></a> </span><span class=cF6>"}"</span><span class=cF0>);
|
||
|
<a name="l1048"></a>
|
||
|
<a name="l1049"></a> </span><span class=cF5>SettingsPush</span><span class=cF0>; </span><span class=cF2>//See </span><a href="/Wb/Adam/TaskSettings.HC.HTML#l3"><span class=cF4>SettingsPush</span></a><span class=cF0>
|
||
|
<a name="l1050"></a> </span><span class=cF5>AutoComplete</span><span class=cF0>;
|
||
|
<a name="l1051"></a> </span><span class=cF5>RegOneTimePopUp</span><span class=cF0>(</span><span class=cF3>ARf_MESH_ED</span><span class=cF0>,
|
||
|
<a name="l1052"></a> </span><span class=cF6>"$GREEN$Right Mouse$FG$: Hold and move to shift cursor z\n"</span><span class=cF0>
|
||
|
<a name="l1053"></a> </span><span class=cF6>"$GREEN$'j'$FG$: Jump cursor Z to nearest vertex's Z\n"</span><span class=cF0>
|
||
|
<a name="l1054"></a> </span><span class=cF6>"$GREEN$'v'$FG$: Place Vertex Mode\n"</span><span class=cF0>
|
||
|
<a name="l1055"></a> </span><span class=cF6>"$GREEN$'m'$FG$: Move Vertex Mode\n"</span><span class=cF0>
|
||
|
<a name="l1056"></a> </span><span class=cF6>"$GREEN$'M'$FG$: Move Vertex Z\n"</span><span class=cF0>
|
||
|
<a name="l1057"></a> </span><span class=cF6>"$GREEN$'t'$FG$: Form Triangle Mode\n"</span><span class=cF0>
|
||
|
<a name="l1058"></a> </span><span class=cF6>"$GREEN$'n'$FG$: Polygon Mode\n"</span><span class=cF0>
|
||
|
<a name="l1059"></a> </span><span class=cF6>"$GREEN$'f'$FG$: Fence Mode\n"</span><span class=cF0>
|
||
|
<a name="l1060"></a> </span><span class=cF6>"$GREEN$'p'$FG$: Prism Mode\n"</span><span class=cF0>
|
||
|
<a name="l1061"></a> </span><span class=cF6>"$GREEN$'c'$FG$: Set color\n"</span><span class=cF0>
|
||
|
<a name="l1062"></a> </span><span class=cF6>"$GREEN$'s'$FG$: Set snap\n"</span><span class=cF0>
|
||
|
<a name="l1063"></a> </span><span class=cF6>"\nSee menu at top of scrn for more.\n"</span><span class=cF0>);
|
||
|
<a name="l1064"></a>
|
||
|
<a name="l1065"></a> </span><span class=cF5>Fs</span><span class=cF0>->win_inhibit=</span><span class=cF3>WIG_TASK_DFT</span><span class=cF0>|</span><span class=cF3>WIF_SELF_DOC</span><span class=cF0>-</span><span class=cF3>WIF_SELF_FOCUS</span><span class=cF0>-</span><span class=cF3>WIF_SELF_BORDER</span><span class=cF0>
|
||
|
<a name="l1066"></a> -</span><span class=cF3>WIF_SELF_CTRLS</span><span class=cF0>-</span><span class=cF3>WIF_FOCUS_TASK_MENU</span><span class=cF0>-</span><span class=cF3>WIF_SELF_GRAB_SCROLL</span><span class=cF0>;
|
||
|
<a name="l1067"></a> </span><span class=cF5>Fs</span><span class=cF0>->horz_scroll.pos=0;
|
||
|
<a name="l1068"></a> </span><span class=cF5>Fs</span><span class=cF0>->vert_scroll.pos=0;
|
||
|
<a name="l1069"></a> </span><span class=cF5>MeshInit</span><span class=cF0>(&e,flip_y);
|
||
|
<a name="l1070"></a> </span><span class=cF1>if</span><span class=cF0> (head)
|
||
|
<a name="l1071"></a> </span><span class=cF5>MeshLoad</span><span class=cF0>(&e,head);
|
||
|
<a name="l1072"></a> </span><span class=cF5>FramePtrAdd</span><span class=cF0>(</span><span class=cF6>"CMeshFrame"</span><span class=cF0>,&e);
|
||
|
<a name="l1073"></a> </span><span class=cF5>Fs</span><span class=cF0>->draw_it=&</span><span class=cF5>DrawIt</span><span class=cF0>;
|
||
|
<a name="l1074"></a> </span><span class=cF5>MeshCurSnap</span><span class=cF0>(&e);
|
||
|
<a name="l1075"></a> </span><span class=cF5>MeshRecalcCxCy</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>,&e);
|
||
|
<a name="l1076"></a>
|
||
|
<a name="l1077"></a> </span><span class=cF1>try</span><span class=cF0> </span><span class=cF7>{</span><span class=cF2>//In case of <CTRL-ALT-c></span><span class=cF0>
|
||
|
<a name="l1078"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>) {
|
||
|
<a name="l1079"></a> </span><span class=cF5>MeshUpdateMenu</span><span class=cF0>(&e);
|
||
|
<a name="l1080"></a> msg_code=</span><span class=cF5>GetMsg</span><span class=cF0>(&arg1,&arg2,
|
||
|
<a name="l1081"></a> 1<<</span><span class=cF3>MSG_MS_MOVE</span><span class=cF0>|1<<</span><span class=cF3>MSG_KEY_DOWN</span><span class=cF0>|1<<</span><span class=cF3>MSG_MS_L_DOWN</span><span class=cF0>|
|
||
|
<a name="l1082"></a> 1<<</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>|1<<</span><span class=cF3>MSG_MS_R_DOWN</span><span class=cF0>|1<<</span><span class=cF3>MSG_MS_R_UP</span><span class=cF0>);
|
||
|
<a name="l1083"></a>me_restart:
|
||
|
<a name="l1084"></a> </span><span class=cF1>switch</span><span class=cF0> (msg_code) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1085"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MSG_KEY_DOWN</span><span class=cF0>:
|
||
|
<a name="l1086"></a> </span><span class=cF1>switch</span><span class=cF0> (arg1) {
|
||
|
<a name="l1087"></a> </span><span class=cF1>case</span><span class=cF0> 0:
|
||
|
<a name="l1088"></a> </span><span class=cF1>switch</span><span class=cF0> (arg2.u8[0]) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1089"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SC_DELETE</span><span class=cF0>:
|
||
|
<a name="l1090"></a> </span><span class=cF1>if</span><span class=cF0> (arg2&</span><span class=cF3>SCF_SHIFT</span><span class=cF0>)
|
||
|
<a name="l1091"></a> </span><span class=cF1>goto</span><span class=cF0> me_clip_cut;
|
||
|
<a name="l1092"></a> </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l1093"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>MeshSelCnt</span><span class=cF7>(</span><span class=cF0>&e</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l1094"></a> </span><span class=cF5>MeshClipDel</span><span class=cF0>(&e);
|
||
|
<a name="l1095"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (e.ed_mode!=</span><span class=cF6>'t'</span><span class=cF0>)
|
||
|
<a name="l1096"></a> </span><span class=cF5>MeshVertexDel</span><span class=cF0>(&e,</span><span class=cF5>MeshVertexFindScrPt</span><span class=cF7>(</span><span class=cF0>&e,
|
||
|
<a name="l1097"></a> </span><span class=cFB>ms</span><span class=cF0>.presnap.x-</span><span class=cF5>Fs</span><span class=cF0>->pix_left-</span><span class=cF5>Fs</span><span class=cF0>->scroll_x,
|
||
|
<a name="l1098"></a> </span><span class=cFB>ms</span><span class=cF0>.presnap.y-</span><span class=cF5>Fs</span><span class=cF0>->pix_top-</span><span class=cF5>Fs</span><span class=cF0>->scroll_y</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l1099"></a> </span><span class=cF5>MeshVertexSelAll</span><span class=cF0>(&e,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l1100"></a> </span><span class=cF5>MeshTriSelAll</span><span class=cF0>(&e,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l1101"></a> make_tri_vertex_num=0;
|
||
|
<a name="l1102"></a> }
|
||
|
<a name="l1103"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1104"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SC_INS</span><span class=cF0>:
|
||
|
<a name="l1105"></a> </span><span class=cF1>if</span><span class=cF0> (arg2&</span><span class=cF3>SCF_CTRL</span><span class=cF0>)
|
||
|
<a name="l1106"></a> </span><span class=cF1>goto</span><span class=cF0> me_clip_copy;
|
||
|
<a name="l1107"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (arg2&</span><span class=cF3>SCF_SHIFT</span><span class=cF0>)
|
||
|
<a name="l1108"></a> </span><span class=cF1>goto</span><span class=cF0> me_clip_paste;
|
||
|
<a name="l1109"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1110"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1111"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_BACKSPACE</span><span class=cF0>:
|
||
|
<a name="l1112"></a> </span><span class=cF1>switch</span><span class=cF0> (e.ed_mode) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1113"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'n'</span><span class=cF0>:
|
||
|
<a name="l1114"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'f'</span><span class=cF0>:
|
||
|
<a name="l1115"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'p'</span><span class=cF0>:
|
||
|
<a name="l1116"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'v'</span><span class=cF0>:
|
||
|
<a name="l1117"></a> </span><span class=cF5>MeshVertexDel</span><span class=cF0>(&e,e.cur_vertex);
|
||
|
<a name="l1118"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1119"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'t'</span><span class=cF0>:
|
||
|
<a name="l1120"></a> </span><span class=cF1>if</span><span class=cF0> (make_tri_vertex_num) {
|
||
|
<a name="l1121"></a> </span><span class=cF5>MeshVertexSelAll</span><span class=cF0>(&e,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l1122"></a> </span><span class=cF5>MeshTriSelAll</span><span class=cF0>(&e,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l1123"></a> make_tri_vertex_num=0;
|
||
|
<a name="l1124"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1125"></a> </span><span class=cF5>MeshTriDel</span><span class=cF0>(&e,e.cur_tri);
|
||
|
<a name="l1126"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1127"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1128"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1129"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'f'</span><span class=cF0>:
|
||
|
<a name="l1130"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'p'</span><span class=cF0>:
|
||
|
<a name="l1131"></a> e.thickness=</span><span class=cF5>PopUpGetI64</span><span class=cF0>(</span><span class=cF6>"Thickness (%d):"</span><span class=cF0>,e.thickness);
|
||
|
<a name="l1132"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'n'</span><span class=cF0>:
|
||
|
<a name="l1133"></a> </span><span class=cF1>if</span><span class=cF0> (arg1==</span><span class=cF6>'n'</span><span class=cF0> || arg1==</span><span class=cF6>'p'</span><span class=cF0>)
|
||
|
<a name="l1134"></a> e.closed=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l1135"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1136"></a> e.closed=</span><span class=cF5>PopUpNoYes</span><span class=cF0>(</span><span class=cF6>"Closed?\n"</span><span class=cF0>);
|
||
|
<a name="l1137"></a>me_chain:
|
||
|
<a name="l1138"></a> e.chain_pred=e.vertex_head.last;
|
||
|
<a name="l1139"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'t'</span><span class=cF0>:
|
||
|
<a name="l1140"></a> </span><span class=cF5>MeshVertexSelAll</span><span class=cF0>(&e,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l1141"></a> </span><span class=cF5>MeshTriSelAll</span><span class=cF0>(&e,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l1142"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'v'</span><span class=cF0>:
|
||
|
<a name="l1143"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'m'</span><span class=cF0>:
|
||
|
<a name="l1144"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'M'</span><span class=cF0>:
|
||
|
<a name="l1145"></a> adjusting_z=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l1146"></a> moving=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l1147"></a> e.ed_mode=arg1;
|
||
|
<a name="l1148"></a> make_tri_vertex_num=0;
|
||
|
<a name="l1149"></a> </span><span class=cF5>Snd</span><span class=cF0>;
|
||
|
<a name="l1150"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1151"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'T'</span><span class=cF0>:
|
||
|
<a name="l1152"></a> </span><span class=cF5>MeshTransformSel</span><span class=cF0>(&e);
|
||
|
<a name="l1153"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1154"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'A'</span><span class=cF0>:
|
||
|
<a name="l1155"></a> </span><span class=cF5>MeshTriSelAll</span><span class=cF0>(&e,</span><span class=cF3>TRUE</span><span class=cF0>);
|
||
|
<a name="l1156"></a> </span><span class=cF1>if</span><span class=cF0> (e.ed_mode!=</span><span class=cF6>'t'</span><span class=cF0>)
|
||
|
<a name="l1157"></a> </span><span class=cF5>MeshVertexSelAll</span><span class=cF0>(&e,</span><span class=cF3>TRUE</span><span class=cF0>);
|
||
|
<a name="l1158"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1159"></a> </span><span class=cF5>MeshVertexSelAll</span><span class=cF0>(&e,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l1160"></a> make_tri_vertex_num=0;
|
||
|
<a name="l1161"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1162"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'U'</span><span class=cF0>:
|
||
|
<a name="l1163"></a> </span><span class=cF5>MeshTriSelAll</span><span class=cF0>(&e,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l1164"></a> </span><span class=cF5>MeshVertexSelAll</span><span class=cF0>(&e,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l1165"></a> make_tri_vertex_num=0;
|
||
|
<a name="l1166"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1167"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'a'</span><span class=cF0>:
|
||
|
<a name="l1168"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'u'</span><span class=cF0>:
|
||
|
<a name="l1169"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'o'</span><span class=cF0>:
|
||
|
<a name="l1170"></a> </span><span class=cF1>if</span><span class=cF0> (arg1==</span><span class=cF6>'a'</span><span class=cF0>)
|
||
|
<a name="l1171"></a> sel_mode=</span><span class=cF3>SEL_MESH_EQU</span><span class=cF0>;
|
||
|
<a name="l1172"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (arg1==</span><span class=cF6>'u'</span><span class=cF0>)
|
||
|
<a name="l1173"></a> sel_mode=</span><span class=cF3>SEL_MESH_AND</span><span class=cF0>;
|
||
|
<a name="l1174"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1175"></a> sel_mode=</span><span class=cF3>SEL_MESH_OR</span><span class=cF0>;
|
||
|
<a name="l1176"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>msg_code=</span><span class=cF5>GetMsg</span><span class=cF0>(&arg1,&arg2,1<<</span><span class=cF3>MSG_KEY_DOWN</span><span class=cF0>|1<<</span><span class=cF3>MSG_MS_L_DOWN</span><span class=cF0>|
|
||
|
<a name="l1177"></a> 1<<</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>|1<<</span><span class=cF3>MSG_MS_R_DOWN</span><span class=cF0>|1<<</span><span class=cF3>MSG_MS_R_UP</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>
|
||
|
<a name="l1178"></a> !=</span><span class=cF3>MSG_MS_L_DOWN</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1179"></a> </span><span class=cF5>Beep</span><span class=cF0>; </span><span class=cF5>Beep</span><span class=cF0>;
|
||
|
<a name="l1180"></a> </span><span class=cF1>goto</span><span class=cF0> me_restart;
|
||
|
<a name="l1181"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1182"></a> e.x1=arg1; e.y1=arg2;
|
||
|
<a name="l1183"></a> e.x2=arg1; e.y2=arg2;
|
||
|
<a name="l1184"></a> e.sel_rect=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l1185"></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="l1186"></a> msg_code=</span><span class=cF5>GetMsg</span><span class=cF0>(&arg1,&arg2,1<<</span><span class=cF3>MSG_MS_MOVE</span><span class=cF0>|1<<</span><span class=cF3>MSG_KEY_DOWN</span><span class=cF0>|
|
||
|
<a name="l1187"></a> 1<<</span><span class=cF3>MSG_MS_L_DOWN</span><span class=cF0>|1<<</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>|1<<</span><span class=cF3>MSG_MS_R_DOWN</span><span class=cF0>|
|
||
|
<a name="l1188"></a> 1<<</span><span class=cF3>MSG_MS_R_UP</span><span class=cF0>);
|
||
|
<a name="l1189"></a> </span><span class=cF1>if</span><span class=cF0> (msg_code==</span><span class=cF3>MSG_MS_MOVE</span><span class=cF0>) {
|
||
|
<a name="l1190"></a> e.x2=arg1; e.y2=arg2;
|
||
|
<a name="l1191"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (msg_code==</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>) {
|
||
|
<a name="l1192"></a> e.x2=arg1; e.y2=arg2;
|
||
|
<a name="l1193"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1194"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l1195"></a> e.sel_rect=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l1196"></a> </span><span class=cF5>Beep</span><span class=cF0>; </span><span class=cF5>Beep</span><span class=cF0>;
|
||
|
<a name="l1197"></a> </span><span class=cF1>goto</span><span class=cF0> me_restart;
|
||
|
<a name="l1198"></a> }
|
||
|
<a name="l1199"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1200"></a> e.sel_rect=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l1201"></a> </span><span class=cF5>MeshTriSelRect</span><span class=cF0>(&e,sel_mode,e.x1,e.x2,e.y1,e.y2);
|
||
|
<a name="l1202"></a> </span><span class=cF1>if</span><span class=cF0> (e.ed_mode!=</span><span class=cF6>'t'</span><span class=cF0>)
|
||
|
<a name="l1203"></a> </span><span class=cF5>MeshVertexSelRect</span><span class=cF0>(&e,sel_mode,e.x1,e.x2,e.y1,e.y2);
|
||
|
<a name="l1204"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1205"></a> </span><span class=cF5>MeshVertexSelAll</span><span class=cF0>(&e,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l1206"></a> make_tri_vertex_num=0;
|
||
|
<a name="l1207"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1208"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_CTRLB</span><span class=cF0>:
|
||
|
<a name="l1209"></a> </span><span class=cF5>WinBorder</span><span class=cF0>(</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&</span><span class=cF5>Fs</span><span class=cF0>->display_flags,</span><span class=cF3>DISPLAYf_NO_BORDER</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l1210"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1211"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_CTRLC</span><span class=cF0>:
|
||
|
<a name="l1212"></a>me_clip_copy:
|
||
|
<a name="l1213"></a> </span><span class=cF1>if</span><span class=cF0> (e.ed_mode==</span><span class=cF6>'t'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1214"></a> </span><span class=cF5>Beep</span><span class=cF0>;</span><span class=cF5>Beep</span><span class=cF0>;
|
||
|
<a name="l1215"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1216"></a> </span><span class=cF5>MeshClipCopy</span><span class=cF0>(&e);
|
||
|
<a name="l1217"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1218"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_CTRLV</span><span class=cF0>:
|
||
|
<a name="l1219"></a>me_clip_paste:
|
||
|
<a name="l1220"></a> </span><span class=cF1>if</span><span class=cF0> (e.ed_mode==</span><span class=cF6>'t'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1221"></a> </span><span class=cF5>Beep</span><span class=cF0>;</span><span class=cF5>Beep</span><span class=cF0>;
|
||
|
<a name="l1222"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1223"></a> </span><span class=cF5>MeshClipPaste</span><span class=cF0>(&e);
|
||
|
<a name="l1224"></a> e.ed_mode=</span><span class=cF6>'m'</span><span class=cF0>;
|
||
|
<a name="l1225"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1226"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1227"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_CTRLX</span><span class=cF0>:
|
||
|
<a name="l1228"></a>me_clip_cut:
|
||
|
<a name="l1229"></a> </span><span class=cF1>if</span><span class=cF0> (e.ed_mode==</span><span class=cF6>'t'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1230"></a> </span><span class=cF5>Beep</span><span class=cF0>;</span><span class=cF5>Beep</span><span class=cF0>;
|
||
|
<a name="l1231"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1232"></a> </span><span class=cF5>MeshClipCut</span><span class=cF0>(&e);
|
||
|
<a name="l1233"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1234"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_SHIFT_ESC</span><span class=cF0>:
|
||
|
<a name="l1235"></a> save_and_exit=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l1236"></a> </span><span class=cF1>goto</span><span class=cF0> me_done;
|
||
|
<a name="l1237"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_ESC</span><span class=cF0>:
|
||
|
<a name="l1238"></a> save_and_exit=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l1239"></a> </span><span class=cF1>goto</span><span class=cF0> me_done;
|
||
|
<a name="l1240"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'z'</span><span class=cF0>:
|
||
|
<a name="l1241"></a> </span><span class=cF5>MeshScaleZoom</span><span class=cF0>(&e,1.5);
|
||
|
<a name="l1242"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1243"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'Z'</span><span class=cF0>:
|
||
|
<a name="l1244"></a> </span><span class=cF5>MeshScaleZoom</span><span class=cF0>(&e,1/1.5);
|
||
|
<a name="l1245"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1246"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'c'</span><span class=cF0>:
|
||
|
<a name="l1247"></a> e.cur_color=</span><span class=cF5>PopUpColorLighting</span><span class=cF0>;
|
||
|
<a name="l1248"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1249"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'s'</span><span class=cF0>:
|
||
|
<a name="l1250"></a> i=</span><span class=cF5>PopUpRangeI64</span><span class=cF0>(1,25,1,</span><span class=cF6>"New Snap\n"</span><span class=cF0>);
|
||
|
<a name="l1251"></a> </span><span class=cF1>if</span><span class=cF0> (i>=1)
|
||
|
<a name="l1252"></a> e.cur_snap=i;
|
||
|
<a name="l1253"></a> </span><span class=cF5>MeshCurSnap</span><span class=cF0>(&e);
|
||
|
<a name="l1254"></a> </span><span class=cF5>MeshRecalcCxCy</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>,&e);
|
||
|
<a name="l1255"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1256"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'g'</span><span class=cF0>:
|
||
|
<a name="l1257"></a> e.grid_on=!e.grid_on;
|
||
|
<a name="l1258"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1259"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'V'</span><span class=cF0>:
|
||
|
<a name="l1260"></a> e.vertex_on=!e.vertex_on;
|
||
|
<a name="l1261"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1262"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'N'</span><span class=cF0>:
|
||
|
<a name="l1263"></a> s->sx=s->sy=s->sz=0;
|
||
|
<a name="l1264"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1265"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'y'</span><span class=cF0>:
|
||
|
<a name="l1266"></a> e.flip_y=!e.flip_y;
|
||
|
<a name="l1267"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1268"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'j'</span><span class=cF0>:
|
||
|
<a name="l1269"></a> </span><span class=cF1>if</span><span class=cF0> (moving)
|
||
|
<a name="l1270"></a> </span><span class=cF5>MeshVertexIgnoreSet</span><span class=cF0>(&e,</span><span class=cF3>TRUE</span><span class=cF0>);
|
||
|
<a name="l1271"></a> </span><span class=cF1>if</span><span class=cF0> (tmpv=</span><span class=cF5>MeshVertexFindScrPt</span><span class=cF7>(</span><span class=cF0>&e,
|
||
|
<a name="l1272"></a> </span><span class=cFB>ms</span><span class=cF0>.pos.x-</span><span class=cF5>Fs</span><span class=cF0>->pix_left-</span><span class=cF5>Fs</span><span class=cF0>->scroll_x,
|
||
|
<a name="l1273"></a> </span><span class=cFB>ms</span><span class=cF0>.pos.y-</span><span class=cF5>Fs</span><span class=cF0>->pix_top-</span><span class=cF5>Fs</span><span class=cF0>->scroll_y</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1274"></a> </span><span class=cF5>Noise</span><span class=cF0>(25,86,110);
|
||
|
<a name="l1275"></a> e.ms_z=</span><span class=cF5>RoundI64</span><span class=cF0>(tmpv->p.z,e.cur_snap);
|
||
|
<a name="l1276"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1277"></a> </span><span class=cF5>Beep</span><span class=cF0>; </span><span class=cF5>Beep</span><span class=cF0>;
|
||
|
<a name="l1278"></a> e.ms_z=0;
|
||
|
<a name="l1279"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1280"></a> </span><span class=cF5>MeshVertexIgnoreSet</span><span class=cF0>(&e,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l1281"></a> </span><span class=cF1>if</span><span class=cF0> (moving) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1282"></a> </span><span class=cF5>MeshCursorW</span><span class=cF0>(&e,</span><span class=cF5>Fs</span><span class=cF0>,&x,&y,&z);
|
||
|
<a name="l1283"></a> </span><span class=cF1>if</span><span class=cF0> (adjusting_z)
|
||
|
<a name="l1284"></a> </span><span class=cF5>MeshP0Offset</span><span class=cF0>(&e,0,0,z-p0a.z);
|
||
|
<a name="l1285"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1286"></a> </span><span class=cF5>MeshP0Offset</span><span class=cF0>(&e,x-p0a.x,y-p0a.y,z-p0a.z);
|
||
|
<a name="l1287"></a> p0a.x=x;
|
||
|
<a name="l1288"></a> p0a.y=y;
|
||
|
<a name="l1289"></a> p0a.z=z;
|
||
|
<a name="l1290"></a> </span><span class=cF5>MeshP0Capture</span><span class=cF0>(&e);
|
||
|
<a name="l1291"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1292"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1293"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'1'</span><span class=cF0>:
|
||
|
<a name="l1294"></a> </span><span class=cF5>MeshSwapAxes</span><span class=cF0>(&e,</span><span class=cF1>offset</span><span class=cF7>(</span><span class=cF9>CD3I32</span><span class=cF0>.x</span><span class=cF7>)</span><span class=cF0>,</span><span class=cF1>offset</span><span class=cF7>(</span><span class=cF9>CD3I32</span><span class=cF0>.y</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l1295"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1296"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'2'</span><span class=cF0>:
|
||
|
<a name="l1297"></a> </span><span class=cF5>MeshSwapAxes</span><span class=cF0>(&e,</span><span class=cF1>offset</span><span class=cF7>(</span><span class=cF9>CD3I32</span><span class=cF0>.x</span><span class=cF7>)</span><span class=cF0>,</span><span class=cF1>offset</span><span class=cF7>(</span><span class=cF9>CD3I32</span><span class=cF0>.z</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l1298"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1299"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'3'</span><span class=cF0>:
|
||
|
<a name="l1300"></a> </span><span class=cF5>MeshSwapAxes</span><span class=cF0>(&e,</span><span class=cF1>offset</span><span class=cF7>(</span><span class=cF9>CD3I32</span><span class=cF0>.y</span><span class=cF7>)</span><span class=cF0>,</span><span class=cF1>offset</span><span class=cF7>(</span><span class=cF9>CD3I32</span><span class=cF0>.z</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l1301"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1302"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'4'</span><span class=cF0>:
|
||
|
<a name="l1303"></a> </span><span class=cF5>MeshInvertAxis</span><span class=cF0>(&e,</span><span class=cF1>offset</span><span class=cF7>(</span><span class=cF9>CD3I32</span><span class=cF0>.x</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l1304"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1305"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'5'</span><span class=cF0>:
|
||
|
<a name="l1306"></a> </span><span class=cF5>MeshInvertAxis</span><span class=cF0>(&e,</span><span class=cF1>offset</span><span class=cF7>(</span><span class=cF9>CD3I32</span><span class=cF0>.y</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l1307"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1308"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'6'</span><span class=cF0>:
|
||
|
<a name="l1309"></a> </span><span class=cF5>MeshInvertAxis</span><span class=cF0>(&e,</span><span class=cF1>offset</span><span class=cF7>(</span><span class=cF9>CD3I32</span><span class=cF0>.z</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l1310"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1311"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'r'</span><span class=cF0>:
|
||
|
<a name="l1312"></a> </span><span class=cF1>if</span><span class=cF0> (e.cur_tri)
|
||
|
<a name="l1313"></a> </span><span class=cF5>SwapI64</span><span class=cF0>(&e.cur_tri->t[1],&e.cur_tri->t[2]);
|
||
|
<a name="l1314"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1315"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'C'</span><span class=cF0>:
|
||
|
<a name="l1316"></a> </span><span class=cF5>MeshColorTris</span><span class=cF0>(&e);
|
||
|
<a name="l1317"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1318"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'R'</span><span class=cF0>:
|
||
|
<a name="l1319"></a> </span><span class=cF5>MeshRevTris</span><span class=cF0>(&e);
|
||
|
<a name="l1320"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1321"></a> }
|
||
|
<a name="l1322"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1323"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MSG_MS_L_DOWN</span><span class=cF0>:
|
||
|
<a name="l1324"></a> </span><span class=cF1>switch</span><span class=cF0> (e.ed_mode) {
|
||
|
<a name="l1325"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'m'</span><span class=cF0>:
|
||
|
<a name="l1326"></a> </span><span class=cF1>if</span><span class=cF0> (!moving) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1327"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>MeshSelCnt</span><span class=cF7>(</span><span class=cF0>&e</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l1328"></a> </span><span class=cF7>(</span><span class=cF0>tmpv=</span><span class=cF5>MeshVertexFindScrPt</span><span class=cF0>(&e,arg1,arg2)</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l1329"></a> tmpv->flags|=</span><span class=cF3>VF_SEL</span><span class=cF0>;
|
||
|
<a name="l1330"></a> e.ms_z=</span><span class=cF5>RoundI64</span><span class=cF0>(tmpv->p.z,e.cur_snap);
|
||
|
<a name="l1331"></a> }
|
||
|
<a name="l1332"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>MeshSelCnt</span><span class=cF7>(</span><span class=cF0>&e</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l1333"></a> </span><span class=cF5>MeshCursorW</span><span class=cF0>(&e,</span><span class=cF5>Fs</span><span class=cF0>,&x,&y,&z);
|
||
|
<a name="l1334"></a> p0a.x=x;
|
||
|
<a name="l1335"></a> p0a.y=y;
|
||
|
<a name="l1336"></a> p0a.z=z;
|
||
|
<a name="l1337"></a> </span><span class=cF5>MeshP0Capture</span><span class=cF0>(&e);
|
||
|
<a name="l1338"></a> moving=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l1339"></a> }
|
||
|
<a name="l1340"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1341"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1342"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'M'</span><span class=cF0>:
|
||
|
<a name="l1343"></a> </span><span class=cF1>if</span><span class=cF0> (!adjusting_z && !moving) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1344"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>MeshSelCnt</span><span class=cF7>(</span><span class=cF0>&e</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l1345"></a> </span><span class=cF7>(</span><span class=cF0>tmpv=</span><span class=cF5>MeshVertexFindScrPt</span><span class=cF0>(&e,arg1,arg2)</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l1346"></a> tmpv->flags|=</span><span class=cF3>VF_SEL</span><span class=cF0>;
|
||
|
<a name="l1347"></a> e.ms_z=</span><span class=cF5>RoundI64</span><span class=cF0>(tmpv->p.z,e.cur_snap);
|
||
|
<a name="l1348"></a> }
|
||
|
<a name="l1349"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>MeshSelCnt</span><span class=cF7>(</span><span class=cF0>&e</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l1350"></a> </span><span class=cF5>MeshCursorW</span><span class=cF0>(&e,</span><span class=cF5>Fs</span><span class=cF0>,&x,&y,&z);
|
||
|
<a name="l1351"></a> p0a.x=x;
|
||
|
<a name="l1352"></a> p0a.y=y;
|
||
|
<a name="l1353"></a> p0a.z=z;
|
||
|
<a name="l1354"></a> </span><span class=cF5>MeshP0Capture</span><span class=cF0>(&e);
|
||
|
<a name="l1355"></a> moving=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l1356"></a>
|
||
|
<a name="l1357"></a> p0b.x=</span><span class=cFB>ms</span><span class=cF0>.presnap.x;
|
||
|
<a name="l1358"></a> p0b.y=</span><span class=cFB>ms</span><span class=cF0>.presnap.y;
|
||
|
<a name="l1359"></a> p0b.z=e.ms_z;
|
||
|
<a name="l1360"></a> adjusting_z=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l1361"></a> </span><span class=cF5>Snd</span><span class=cF0>(</span><span class=cF5>ClampI64</span><span class=cF7>(</span><span class=cF5>Freq2Ona</span><span class=cF0>(3*e.ms_z+1500),0,</span><span class=cF3>I8_MAX</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l1362"></a> }
|
||
|
<a name="l1363"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1364"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1365"></a> }
|
||
|
<a name="l1366"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1367"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>:
|
||
|
<a name="l1368"></a> </span><span class=cF1>switch</span><span class=cF0> (e.ed_mode) {
|
||
|
<a name="l1369"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'n'</span><span class=cF0>:
|
||
|
<a name="l1370"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'f'</span><span class=cF0>:
|
||
|
<a name="l1371"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'p'</span><span class=cF0>:
|
||
|
<a name="l1372"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'v'</span><span class=cF0>:
|
||
|
<a name="l1373"></a> </span><span class=cF5>Noise</span><span class=cF0>(25,86,110);
|
||
|
<a name="l1374"></a> </span><span class=cF5>MeshCursorW</span><span class=cF0>(&e,</span><span class=cF5>Fs</span><span class=cF0>,&x,&y,&z);
|
||
|
<a name="l1375"></a> e.cur_vertex=</span><span class=cF5>MeshVertexNew</span><span class=cF0>(&e,x,y,z);
|
||
|
<a name="l1376"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1377"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'m'</span><span class=cF0>:
|
||
|
<a name="l1378"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'M'</span><span class=cF0>:
|
||
|
<a name="l1379"></a> </span><span class=cF1>if</span><span class=cF0> (moving) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1380"></a> </span><span class=cF1>if</span><span class=cF0> (adjusting_z) {
|
||
|
<a name="l1381"></a> e.ms_z=</span><span class=cF5>RoundI64</span><span class=cF0>(</span><span class=cF5>Sign</span><span class=cF7>(</span><span class=cF0>p0b.y-</span><span class=cFB>ms</span><span class=cF0>.presnap.y</span><span class=cF7>)</span><span class=cF0>
|
||
|
<a name="l1382"></a> *</span><span class=cF5>Sqrt</span><span class=cF7>(</span><span class=cF5>Sqr</span><span class=cF0>(p0b.x-</span><span class=cFB>ms</span><span class=cF0>.presnap.x)+</span><span class=cF5>Sqr</span><span class=cF0>(p0b.y-</span><span class=cFB>ms</span><span class=cF0>.presnap.y)</span><span class=cF7>)</span><span class=cF0>
|
||
|
<a name="l1383"></a> +p0b.z,e.cur_snap);
|
||
|
<a name="l1384"></a> </span><span class=cF5>Snd</span><span class=cF0>;
|
||
|
<a name="l1385"></a> adjusting_z=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l1386"></a> </span><span class=cF5>MeshCursorW</span><span class=cF0>(&e,</span><span class=cF5>Fs</span><span class=cF0>,&x,&y,&z);
|
||
|
<a name="l1387"></a> </span><span class=cF5>MeshP0Offset</span><span class=cF0>(&e,0,0,z-p0a.z);
|
||
|
<a name="l1388"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l1389"></a> </span><span class=cF5>MeshCursorW</span><span class=cF0>(&e,</span><span class=cF5>Fs</span><span class=cF0>,&x,&y,&z);
|
||
|
<a name="l1390"></a> </span><span class=cF5>MeshP0Offset</span><span class=cF0>(&e,x-p0a.x,y-p0a.y,z-p0a.z);
|
||
|
<a name="l1391"></a> }
|
||
|
<a name="l1392"></a> </span><span class=cF5>MeshTriSelAll</span><span class=cF0>(&e,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l1393"></a> </span><span class=cF5>MeshVertexSelAll</span><span class=cF0>(&e,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l1394"></a> moving=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l1395"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1396"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1397"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'t'</span><span class=cF0>:
|
||
|
<a name="l1398"></a> </span><span class=cF1>if</span><span class=cF0> (tmpv=</span><span class=cF5>MeshVertexFindScrPt</span><span class=cF7>(</span><span class=cF0>&e,arg1,arg2</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1399"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<make_tri_vertex_num;i++)
|
||
|
<a name="l1400"></a> </span><span class=cF1>if</span><span class=cF0> (va[i]==tmpv) {
|
||
|
<a name="l1401"></a> </span><span class=cF5>Beep</span><span class=cF0>; </span><span class=cF5>Beep</span><span class=cF0>;
|
||
|
<a name="l1402"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1403"></a> }
|
||
|
<a name="l1404"></a> </span><span class=cF1>if</span><span class=cF0> (i==make_tri_vertex_num) {
|
||
|
<a name="l1405"></a> </span><span class=cF5>Noise</span><span class=cF0>(25,86,110);
|
||
|
<a name="l1406"></a> va[make_tri_vertex_num++]=tmpv;
|
||
|
<a name="l1407"></a> tmpv->flags|=</span><span class=cF3>VF_SEL</span><span class=cF0>;
|
||
|
<a name="l1408"></a> </span><span class=cF1>if</span><span class=cF0> (make_tri_vertex_num==3) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1409"></a> e.cur_tri=</span><span class=cF5>MeshTriNew</span><span class=cF0>(&e,e.cur_color,va[0],va[1],va[2]);
|
||
|
<a name="l1410"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<make_tri_vertex_num;i++)
|
||
|
<a name="l1411"></a> va[i]->flags&=~</span><span class=cF3>VF_SEL</span><span class=cF0>;
|
||
|
<a name="l1412"></a> make_tri_vertex_num=0;
|
||
|
<a name="l1413"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1414"></a> }
|
||
|
<a name="l1415"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1416"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1417"></a> }
|
||
|
<a name="l1418"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1419"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MSG_MS_R_DOWN</span><span class=cF0>:
|
||
|
<a name="l1420"></a> </span><span class=cF1>if</span><span class=cF0> (!adjusting_z && e.ed_mode!=</span><span class=cF6>'M'</span><span class=cF0> &&
|
||
|
<a name="l1421"></a> </span><span class=cF7>(</span><span class=cF0>e.chain_pred==e.vertex_head.last ||
|
||
|
<a name="l1422"></a> e.ed_mode!=</span><span class=cF6>'n'</span><span class=cF0> && e.ed_mode!=</span><span class=cF6>'f'</span><span class=cF0> && e.ed_mode!=</span><span class=cF6>'p'</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l1423"></a> </span><span class=cF1>if</span><span class=cF0> (moving) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1424"></a> </span><span class=cF5>MeshCursorW</span><span class=cF0>(&e,</span><span class=cF5>Fs</span><span class=cF0>,&x,&y,&z);
|
||
|
<a name="l1425"></a> </span><span class=cF5>MeshP0Offset</span><span class=cF0>(&e,x-p0a.x,y-p0a.y,z-p0a.z);
|
||
|
<a name="l1426"></a> p0a.x=x;
|
||
|
<a name="l1427"></a> p0a.y=y;
|
||
|
<a name="l1428"></a> p0a.z=z;
|
||
|
<a name="l1429"></a> </span><span class=cF5>MeshP0Capture</span><span class=cF0>(&e);
|
||
|
<a name="l1430"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1431"></a> p0b.x=</span><span class=cFB>ms</span><span class=cF0>.presnap.x;
|
||
|
<a name="l1432"></a> p0b.y=</span><span class=cFB>ms</span><span class=cF0>.presnap.y;
|
||
|
<a name="l1433"></a> p0b.z=e.ms_z;
|
||
|
<a name="l1434"></a> adjusting_z=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l1435"></a> </span><span class=cF5>Snd</span><span class=cF0>(</span><span class=cF5>ClampI64</span><span class=cF7>(</span><span class=cF5>Freq2Ona</span><span class=cF0>(3*e.ms_z+1500),0,</span><span class=cF3>I8_MAX</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l1436"></a> }
|
||
|
<a name="l1437"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1438"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MSG_MS_R_UP</span><span class=cF0>:
|
||
|
<a name="l1439"></a> </span><span class=cF1>if</span><span class=cF0> (adjusting_z) {
|
||
|
<a name="l1440"></a> e.ms_z=</span><span class=cF5>RoundI64</span><span class=cF0>(</span><span class=cF5>Sign</span><span class=cF7>(</span><span class=cF0>p0b.y-</span><span class=cFB>ms</span><span class=cF0>.presnap.y</span><span class=cF7>)</span><span class=cF0>
|
||
|
<a name="l1441"></a> *</span><span class=cF5>Sqrt</span><span class=cF7>(</span><span class=cF5>Sqr</span><span class=cF0>(p0b.x-</span><span class=cFB>ms</span><span class=cF0>.presnap.x)+</span><span class=cF5>Sqr</span><span class=cF0>(p0b.y-</span><span class=cFB>ms</span><span class=cF0>.presnap.y)</span><span class=cF7>)</span><span class=cF0>
|
||
|
<a name="l1442"></a> +p0b.z,e.cur_snap);
|
||
|
<a name="l1443"></a> </span><span class=cF5>Snd</span><span class=cF0>;
|
||
|
<a name="l1444"></a> adjusting_z=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l1445"></a> </span><span class=cF1>if</span><span class=cF0> (moving) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1446"></a> </span><span class=cF5>MeshCursorW</span><span class=cF0>(&e,</span><span class=cF5>Fs</span><span class=cF0>,&x,&y,&z);
|
||
|
<a name="l1447"></a> </span><span class=cF5>MeshP0Offset</span><span class=cF0>(&e,0,0,z-p0a.z);
|
||
|
<a name="l1448"></a> p0a.x=x;
|
||
|
<a name="l1449"></a> p0a.y=y;
|
||
|
<a name="l1450"></a> p0a.z=z;
|
||
|
<a name="l1451"></a> </span><span class=cF5>MeshP0Capture</span><span class=cF0>(&e);
|
||
|
<a name="l1452"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1453"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (e.ed_mode==</span><span class=cF6>'n'</span><span class=cF0>) {
|
||
|
<a name="l1454"></a> </span><span class=cF1>if</span><span class=cF0> (e.chain_pred && e.chain_pred!=e.vertex_head.last)
|
||
|
<a name="l1455"></a> </span><span class=cF5>MeshPolygon</span><span class=cF0>(&e,e.chain_pred->next,e.vertex_head.last,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l1456"></a> arg1=e.ed_mode;
|
||
|
<a name="l1457"></a> </span><span class=cF1>goto</span><span class=cF0> me_chain;
|
||
|
<a name="l1458"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (e.ed_mode==</span><span class=cF6>'f'</span><span class=cF0>) {
|
||
|
<a name="l1459"></a> </span><span class=cF1>if</span><span class=cF0> (e.chain_pred && e.chain_pred!=e.vertex_head.last)
|
||
|
<a name="l1460"></a> </span><span class=cF5>MeshFence</span><span class=cF0>(&e);
|
||
|
<a name="l1461"></a> arg1=e.ed_mode;
|
||
|
<a name="l1462"></a> </span><span class=cF1>goto</span><span class=cF0> me_chain;
|
||
|
<a name="l1463"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (e.ed_mode==</span><span class=cF6>'p'</span><span class=cF0>) {
|
||
|
<a name="l1464"></a> </span><span class=cF1>if</span><span class=cF0> (e.chain_pred && e.chain_pred!=e.vertex_head.last)
|
||
|
<a name="l1465"></a> </span><span class=cF5>MeshPrism</span><span class=cF0>(&e);
|
||
|
<a name="l1466"></a> arg1=e.ed_mode;
|
||
|
<a name="l1467"></a> </span><span class=cF1>goto</span><span class=cF0> me_chain;
|
||
|
<a name="l1468"></a> }
|
||
|
<a name="l1469"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1470"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MSG_MS_MOVE</span><span class=cF0>:
|
||
|
<a name="l1471"></a> </span><span class=cF1>if</span><span class=cF0> (adjusting_z) {
|
||
|
<a name="l1472"></a> e.ms_z=</span><span class=cF5>RoundI64</span><span class=cF0>(</span><span class=cF5>Sign</span><span class=cF7>(</span><span class=cF0>p0b.y-</span><span class=cFB>ms</span><span class=cF0>.presnap.y</span><span class=cF7>)</span><span class=cF0>
|
||
|
<a name="l1473"></a> *</span><span class=cF5>Sqrt</span><span class=cF7>(</span><span class=cF5>Sqr</span><span class=cF0>(p0b.x-</span><span class=cFB>ms</span><span class=cF0>.presnap.x)+</span><span class=cF5>Sqr</span><span class=cF0>(p0b.y-</span><span class=cFB>ms</span><span class=cF0>.presnap.y)</span><span class=cF7>)</span><span class=cF0>
|
||
|
<a name="l1474"></a> +p0b.z,e.cur_snap);
|
||
|
<a name="l1475"></a> </span><span class=cF5>Snd</span><span class=cF0>(</span><span class=cF5>ClampI64</span><span class=cF7>(</span><span class=cF5>Freq2Ona</span><span class=cF0>(3*e.ms_z+1500),0,</span><span class=cF3>I8_MAX</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l1476"></a> }
|
||
|
<a name="l1477"></a> </span><span class=cF1>if</span><span class=cF0> (moving) {
|
||
|
<a name="l1478"></a> </span><span class=cF5>MeshCursorW</span><span class=cF0>(&e,</span><span class=cF5>Fs</span><span class=cF0>,&x,&y,&z);
|
||
|
<a name="l1479"></a> </span><span class=cF1>if</span><span class=cF0> (adjusting_z)
|
||
|
<a name="l1480"></a> </span><span class=cF5>MeshP0Offset</span><span class=cF0>(&e,0,0,z-p0a.z);
|
||
|
<a name="l1481"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1482"></a> </span><span class=cF5>MeshP0Offset</span><span class=cF0>(&e,x-p0a.x,y-p0a.y,z-p0a.z);
|
||
|
<a name="l1483"></a> p0a.x=x;
|
||
|
<a name="l1484"></a> p0a.y=y;
|
||
|
<a name="l1485"></a> p0a.z=z;
|
||
|
<a name="l1486"></a> </span><span class=cF5>MeshP0Capture</span><span class=cF0>(&e);
|
||
|
<a name="l1487"></a> }
|
||
|
<a name="l1488"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l1489"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l1490"></a> }
|
||
|
<a name="l1491"></a>me_done:
|
||
|
<a name="l1492"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>catch</span><span class=cF0>
|
||
|
<a name="l1493"></a> </span><span class=cF5>Fs</span><span class=cF0>->catch_except=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l1494"></a> </span><span class=cF5>SettingsPop</span><span class=cF0>;
|
||
|
<a name="l1495"></a> </span><span class=cF5>MenuPop</span><span class=cF0>;
|
||
|
<a name="l1496"></a> </span><span class=cF1>if</span><span class=cF0> (save_and_exit)
|
||
|
<a name="l1497"></a> head=</span><span class=cF5>MeshSave</span><span class=cF0>(&e,_size);
|
||
|
<a name="l1498"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1499"></a> head=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l1500"></a> </span><span class=cF5>MeshCleanUp</span><span class=cF0>(&e);
|
||
|
<a name="l1501"></a> </span><span class=cF5>FramePtrDel</span><span class=cF0>(</span><span class=cF6>"CMeshFrame"</span><span class=cF0>);
|
||
|
<a name="l1502"></a> </span><span class=cF1>if</span><span class=cF0> (old_s) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l1503"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(c->state,old_s,</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CViewAngles</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l1504"></a> </span><span class=cF5>Free</span><span class=cF0>(old_s);
|
||
|
<a name="l1505"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l1506"></a> </span><span class=cF5>ViewAnglesDel</span><span class=cF0>;
|
||
|
<a name="l1507"></a> </span><span class=cF1>return</span><span class=cF0> head;
|
||
|
<a name="l1508"></a>}
|
||
|
</span></pre></body>
|
||
|
</html>
|