templeos-info/public/Wb/Adam/Gr/SpriteMain.HC.HTML

1270 lines
136 KiB
HTML
Executable File

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="generator" content="TempleOS V5.03">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="/style/templeos.css">
<script src="/script/templeos.js"></script>
<style type="text/css">
.cF0{color:#000000;background-color:#ffffff;}
.cF1{color:#0000aa;background-color:#ffffff;}
.cF2{color:#00aa00;background-color:#ffffff;}
.cF3{color:#00aaaa;background-color:#ffffff;}
.cF4{color:#aa0000;background-color:#ffffff;}
.cF5{color:#aa00aa;background-color:#ffffff;}
.cF6{color:#aa5500;background-color:#ffffff;}
.cF7{color:#aaaaaa;background-color:#ffffff;}
.cF8{color:#555555;background-color:#ffffff;}
.cF9{color:#5555ff;background-color:#ffffff;}
.cFA{color:#55ff55;background-color:#ffffff;}
.cFB{color:#55ffff;background-color:#ffffff;}
.cFC{color:#ff5555;background-color:#ffffff;}
.cFD{color:#ff55ff;background-color:#ffffff;}
.cFE{color:#ffff55;background-color:#ffffff;}
.cFF{color:#ffffff;background-color:#ffffff;}
</style>
</head>
<body>
<pre id="content">
<a name="l1"></a><span class=cF0>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>&quot;Graphics/Sprite;Sprites&quot;</span><span class=cF0>
<a name="l2"></a>
<a name="l3"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPT_MENU</span><span class=cF0> -2
<a name="l4"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPT_INS_SCRN_BITMAP</span><span class=cF0> -3
<a name="l5"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPT_INS_TRANSPARENT_SCRN_BITMAP</span><span class=cF0> -4
<a name="l6"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPT_ED_MENU</span><span class=cF0> -5
<a name="l7"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>SPT_EXIT</span><span class=cF0> -6
<a name="l8"></a>
<a name="l9"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>PopUpSpriteMain</span><span class=cF0>(</span><span class=cF9>CSprite</span><span class=cF0> **_head,</span><span class=cF9>I64</span><span class=cF0> *_cur_elem_num,
<a name="l10"></a> </span><span class=cF9>CDoc</span><span class=cF0> *_doc,</span><span class=cF9>CDocEntry</span><span class=cF0> *_doc_e)
<a name="l11"></a>{
<a name="l12"></a> </span><span class=cF9>CTask</span><span class=cF0> *pu_task;
<a name="l13"></a> </span><span class=cF9>I64</span><span class=cF0> res;
<a name="l14"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc=</span><span class=cF5>DocNew</span><span class=cF0>;
<a name="l15"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_de;
<a name="l16"></a> </span><span class=cF1>U8</span><span class=cF0> *st;
<a name="l17"></a>
<a name="l18"></a> doc_de=</span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot;$PURPLE$$TX+CX,\&quot;Sprite Main Menu\&quot;$\n&quot;</span><span class=cF0>
<a name="l19"></a> </span><span class=cF6>&quot;$LK+PU+CX,\&quot;Click for Help\&quot;,A=\&quot;FI:::/Doc/SpriteMain.DD.Z\&quot;$\n&quot;</span><span class=cF0>
<a name="l20"></a> </span><span class=cF6>&quot;\n$LTBLUE$$DA+M,A=\&quot;Tag Text:%%s\&quot;$\n\n&quot;</span><span class=cF0>);
<a name="l21"></a> doc_de-&gt;data=</span><span class=cF5>StrNew</span><span class=cF0>(_doc_e-&gt;tag,doc-&gt;mem_task);
<a name="l22"></a> </span><span class=cF5>DocDataFmt</span><span class=cF0>(doc,doc_de);
<a name="l23"></a>
<a name="l24"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot;$MU-UL,\&quot;Color (4-bit)\&quot;,LE=SPT_COLOR$\n&quot;</span><span class=cF0>
<a name="l25"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Dither Color (4-bit)\&quot;,LE=SPT_DITHER_COLOR$\n&quot;</span><span class=cF0>
<a name="l26"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Thick\&quot;,LE=SPT_THICK$\n&quot;</span><span class=cF0>
<a name="l27"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Planar Symmetry\&quot;,LE=SPT_PLANAR_SYMMETRY$\n&quot;</span><span class=cF0>
<a name="l28"></a> </span><span class=cF6>&quot;\n$MU-UL,\&quot;Point\&quot;,LE=SPT_PT$\n&quot;</span><span class=cF0>
<a name="l29"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Line\&quot;,LE=SPT_LINE$\n&quot;</span><span class=cF0>
<a name="l30"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Arrow\&quot;,LE=SPT_ARROW$\n&quot;</span><span class=cF0>
<a name="l31"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Rect\&quot;,LE=SPT_RECT$\n&quot;</span><span class=cF0>
<a name="l32"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Circle\&quot;,LE=SPT_CIRCLE$\n&quot;</span><span class=cF0>
<a name="l33"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Ellipse\&quot;,LE=SPT_ELLIPSE$\n&quot;</span><span class=cF0>
<a name="l34"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Polygon\&quot;,LE=SPT_POLYGON$\n&quot;</span><span class=cF0>
<a name="l35"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Text\&quot;,LE=SPT_TEXT$\n&quot;</span><span class=cF0>
<a name="l36"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Text Box\&quot;,LE=SPT_TEXT_BOX$\n&quot;</span><span class=cF0>
<a name="l37"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Text Diamond\&quot;,LE=SPT_TEXT_DIAMOND$\n&quot;</span><span class=cF0>
<a name="l38"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Flood Fill\&quot;,LE=SPT_FLOOD_FILL$\n&quot;</span><span class=cF0>
<a name="l39"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Flood Fill Not Color\&quot;,LE=SPT_FLOOD_FILL_NOT$\n&quot;</span><span class=cF0>
<a name="l40"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;PolyLine\&quot;,LE=SPT_POLYLINE$\n&quot;</span><span class=cF0>
<a name="l41"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;PolyPoint\&quot;,LE=SPT_POLYPT$\n&quot;</span><span class=cF0>
<a name="l42"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;BSpline2\&quot;,LE=SPT_BSPLINE2$\n&quot;</span><span class=cF0>
<a name="l43"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;BSpline3\&quot;,LE=SPT_BSPLINE3$\n&quot;</span><span class=cF0>
<a name="l44"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;BSpline2 Closed\&quot;,LE=SPT_BSPLINE2_CLOSED$\n&quot;</span><span class=cF0>
<a name="l45"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;BSpline3 Closed\&quot;,LE=SPT_BSPLINE3_CLOSED$\n&quot;</span><span class=cF0>
<a name="l46"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Insert Scrn-Captured BitMap\&quot;,LE=SPT_INS_SCRN_BITMAP$\n&quot;</span><span class=cF0>
<a name="l47"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Insert Transparent Scrn-Captured BitMap\&quot;,&quot;</span><span class=cF0>
<a name="l48"></a> </span><span class=cF6>&quot;LE=SPT_INS_TRANSPARENT_SCRN_BITMAP$\n&quot;</span><span class=cF0>
<a name="l49"></a> </span><span class=cF6>&quot;$PURPLE$$MU-UL,\&quot;+] Create or Edit 3D Mesh\&quot;,LE=SPT_MESH$\n&quot;</span><span class=cF0>
<a name="l50"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;+] Create or Edit Shiftable 3D Mesh\&quot;,&quot;</span><span class=cF0>
<a name="l51"></a> </span><span class=cF6>&quot;LE=SPT_SHIFTABLE_MESH$\n&quot;</span><span class=cF0>
<a name="l52"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;+] Convert to BitMap or Edit BitMap\&quot;,&quot;</span><span class=cF0>
<a name="l53"></a> </span><span class=cF6>&quot;LE=SPT_BITMAP$$LTBLUE$\n&quot;</span><span class=cF0>
<a name="l54"></a> </span><span class=cF6>&quot;\n$MU-UL,\&quot;Transform On (for use with 3D icons)\&quot;,&quot;</span><span class=cF0>
<a name="l55"></a> </span><span class=cF6>&quot;LE=SPT_TRANSFORM_ON$\n&quot;</span><span class=cF0>
<a name="l56"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Transform Off (for use with 3D icons)\&quot;,&quot;</span><span class=cF0>
<a name="l57"></a> </span><span class=cF6>&quot;LE=SPT_TRANSFORM_OFF$\n&quot;</span><span class=cF0>
<a name="l58"></a> </span><span class=cF6>&quot;\n&quot;</span><span class=cF0>
<a name="l59"></a> </span><span class=cF6>&quot;$PURPLE$$MU-UL,\&quot;+] Sprite Edit Menu\&quot;,LE=SPT_ED_MENU$$LTBLUE$\n&quot;</span><span class=cF0>
<a name="l60"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Exit Sprite\&quot;,LE=SPT_EXIT$\n&quot;</span><span class=cF0>
<a name="l61"></a> </span><span class=cF6>&quot;$MU-UL,\&quot;Abort Sprite\&quot;,LE=DOCM_CANCEL$\n&quot;</span><span class=cF0>
<a name="l62"></a> </span><span class=cF6>&quot;\nRight-Click to get back to this menu.&quot;</span><span class=cF0>);
<a name="l63"></a> st=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>&quot;SpriteSideBarTask(0x%X,0x%X,0x%X);&quot;</span><span class=cF0>,</span><span class=cF5>Fs</span><span class=cF0>,_head,_cur_elem_num);
<a name="l64"></a> </span><span class=cF5>PopUp</span><span class=cF0>(st,</span><span class=cF3>NULL</span><span class=cF0>,&amp;pu_task);
<a name="l65"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l66"></a> res=</span><span class=cF5>PopUpMenu</span><span class=cF0>(doc);
<a name="l67"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>TaskValidate</span><span class=cF7>(</span><span class=cF0>pu_task</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l68"></a> *_head=</span><span class=cF5>SpriteSideBar2SpriteQue</span><span class=cF0>(</span><span class=cF5>DocPut</span><span class=cF7>(</span><span class=cF0>pu_task</span><span class=cF7>)</span><span class=cF0>,*_head,_cur_elem_num);
<a name="l69"></a> </span><span class=cF5>Kill</span><span class=cF0>(pu_task);
<a name="l70"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l71"></a> </span><span class=cF5>Free</span><span class=cF0>(_doc_e-&gt;tag);
<a name="l72"></a> _doc_e-&gt;tag=</span><span class=cF5>StrNew</span><span class=cF0>(doc_de-&gt;data,_doc-&gt;mem_task);
<a name="l73"></a> _doc-&gt;cur_col=0;
<a name="l74"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc);
<a name="l75"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l76"></a>}
<a name="l77"></a>
<a name="l78"></a></span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>PopUpExtents</span><span class=cF0>(</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="l79"></a>{
<a name="l80"></a> </span><span class=cF9>I64</span><span class=cF0> res;
<a name="l81"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc=</span><span class=cF5>DocNew</span><span class=cF0>;
<a name="l82"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e;
<a name="l83"></a> doc_e=</span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot; $DA,A=\&quot;x1:%%d\&quot;$\n&quot;</span><span class=cF0>);
<a name="l84"></a> doc_e-&gt;data=_x1;
<a name="l85"></a> </span><span class=cF5>DocDataFmt</span><span class=cF0>(doc,doc_e);
<a name="l86"></a> doc_e=</span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot; $DA,A=\&quot;x2:%%d\&quot;$\n&quot;</span><span class=cF0>);
<a name="l87"></a> doc_e-&gt;data=_x2;
<a name="l88"></a> </span><span class=cF5>DocDataFmt</span><span class=cF0>(doc,doc_e);
<a name="l89"></a> doc_e=</span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot; $DA,A=\&quot;y1:%%d\&quot;$\n&quot;</span><span class=cF0>);
<a name="l90"></a> doc_e-&gt;data=_y1;
<a name="l91"></a> </span><span class=cF5>DocDataFmt</span><span class=cF0>(doc,doc_e);
<a name="l92"></a> doc_e=</span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot; $DA,A=\&quot;y2:%%d\&quot;$\n\n&quot;</span><span class=cF0>);
<a name="l93"></a> doc_e-&gt;data=_y2;
<a name="l94"></a> </span><span class=cF5>DocDataFmt</span><span class=cF0>(doc,doc_e);
<a name="l95"></a>
<a name="l96"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot; $BT,\&quot;Use These Extents\&quot;,LE=TRUE$&quot;</span><span class=cF0>);
<a name="l97"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot;$CM,3,0$$BT,\&quot;Drag-Out New Extents\&quot;,LE=FALSE$\n\n&quot;</span><span class=cF0>);
<a name="l98"></a> </span><span class=cF1>do</span><span class=cF0> res=</span><span class=cF5>PopUpMenu</span><span class=cF0>(doc);
<a name="l99"></a> </span><span class=cF1>while</span><span class=cF0> (res!=</span><span class=cF3>FALSE</span><span class=cF0> &amp;&amp; res!=</span><span class=cF3>TRUE</span><span class=cF0>);
<a name="l100"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc);
<a name="l101"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l102"></a>}
<a name="l103"></a>
<a name="l104"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>SpriteScrnInit</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *dc,</span><span class=cF9>I64</span><span class=cF0>,</span><span class=cF9>I64</span><span class=cF0>)
<a name="l105"></a>{
<a name="l106"></a></span><span class=cF2>//Uses </span><a href="/Wb/Demo/Lectures/FixedPoint.HC.HTML#l1"><span class=cF4>fixed-point</span></a><span class=cF2>.</span><span class=cF0>
<a name="l107"></a> </span><span class=cF9>I64</span><span class=cF0> xx,yy,old_pen_width=dc-&gt;thick;
<a name="l108"></a> </span><span class=cF9>CColorROPU32</span><span class=cF0> old_color=dc-&gt;color;
<a name="l109"></a> </span><span class=cF5>Refresh</span><span class=cF0>;
<a name="l110"></a> </span><span class=cF5>DCFill</span><span class=cF0>(dc);
<a name="l111"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags&amp;</span><span class=cF3>DCF_SYMMETRY</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l112"></a> dc-&gt;flags&amp;=~</span><span class=cF3>DCF_SYMMETRY</span><span class=cF0>;
<a name="l113"></a> dc-&gt;thick=1;
<a name="l114"></a> xx=dc-&gt;sym.sny*8192;
<a name="l115"></a> yy=-dc-&gt;sym.snx*8192;
<a name="l116"></a> dc-&gt;color=</span><span class=cF3>RED</span><span class=cF0>;
<a name="l117"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(dc,dc-&gt;sym.sx-xx.i32[1],dc-&gt;sym.sy-yy.i32[1],0,
<a name="l118"></a> dc-&gt;sym.sx+xx.i32[1],dc-&gt;sym.sy+yy.i32[1],0,3,0);
<a name="l119"></a> dc-&gt;color=</span><span class=cF3>WHITE</span><span class=cF0>;
<a name="l120"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(dc,dc-&gt;sym.sx-xx.i32[1],dc-&gt;sym.sy-yy.i32[1],0,
<a name="l121"></a> dc-&gt;sym.sx+xx.i32[1],dc-&gt;sym.sy+yy.i32[1],0,3,1);
<a name="l122"></a> dc-&gt;color=</span><span class=cF3>BLACK</span><span class=cF0>;
<a name="l123"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(dc,dc-&gt;sym.sx-xx.i32[1],dc-&gt;sym.sy-yy.i32[1],0,
<a name="l124"></a> dc-&gt;sym.sx+xx.i32[1],dc-&gt;sym.sy+yy.i32[1],0,3,2);
<a name="l125"></a> dc-&gt;flags|=</span><span class=cF3>DCF_SYMMETRY</span><span class=cF0>;
<a name="l126"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l127"></a> dc-&gt;color=old_color;
<a name="l128"></a> dc-&gt;thick=old_pen_width;
<a name="l129"></a>}
<a name="l130"></a>
<a name="l131"></a></span><span class=cF9>CSprite</span><span class=cF0> *</span><span class=cF5>SMLine</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *dc,</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> arg1,</span><span class=cF9>I64</span><span class=cF0> arg2,</span><span class=cF9>CColorROPU32</span><span class=cF0> color)
<a name="l132"></a>{
<a name="l133"></a> </span><span class=cF9>I64</span><span class=cF0> msg_code,x1=arg1,y1=arg2,x2=arg1,y2=arg2;
<a name="l134"></a> </span><span class=cF9>CSprite</span><span class=cF0> *res;
<a name="l135"></a> </span><span class=cF1>do</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l136"></a> dc-&gt;color=color&amp;</span><span class=cF3>COLORROP_NO_ROP0_MASK</span><span class=cF0>;
<a name="l137"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(dc,x1,y1,0,x2,y2,0);
<a name="l138"></a> msg_code=</span><span class=cF5>GetMsg</span><span class=cF0>(&amp;arg1,&amp;arg2,1&lt;&lt;</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>+1&lt;&lt;</span><span class=cF3>MSG_MS_MOVE</span><span class=cF0>);
<a name="l139"></a> </span><span class=cF5>SpriteScrnInit</span><span class=cF0>(dc,x,y);
<a name="l140"></a> x2=arg1; y2=arg2;
<a name="l141"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>while</span><span class=cF0> (msg_code!=</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>);
<a name="l142"></a> dc-&gt;color=color&amp;</span><span class=cF3>COLORROP_NO_ROP0_MASK</span><span class=cF0>;
<a name="l143"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(dc,x1,y1,0,x2,y2,0);
<a name="l144"></a> res=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF3>SPT_LINE</span><span class=cF7>)</span><span class=cF0>);
<a name="l145"></a> res-&gt;type=</span><span class=cF3>SPT_LINE</span><span class=cF0>;
<a name="l146"></a> res-&gt;pp.x1=x1-x;
<a name="l147"></a> res-&gt;pp.y1=y1-y;
<a name="l148"></a> res-&gt;pp.x2=x2-x;
<a name="l149"></a> res-&gt;pp.y2=y2-y;
<a name="l150"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l151"></a>}
<a name="l152"></a>
<a name="l153"></a></span><span class=cF9>CSprite</span><span class=cF0> *</span><span class=cF5>SMArrow</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *dc,</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> arg1,</span><span class=cF9>I64</span><span class=cF0> arg2,</span><span class=cF9>CColorROPU32</span><span class=cF0> color)
<a name="l154"></a>{
<a name="l155"></a> </span><span class=cF9>I64</span><span class=cF0> msg_code,x1=arg1,y1=arg2,x2=arg1,y2=arg2;
<a name="l156"></a> </span><span class=cF9>CSprite</span><span class=cF0> *res;
<a name="l157"></a> </span><span class=cF1>do</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l158"></a> dc-&gt;color=color&amp;</span><span class=cF3>COLORROP_NO_ROP0_MASK</span><span class=cF0>;
<a name="l159"></a> </span><span class=cF5>GrArrow3</span><span class=cF0>(dc,x1,y1,0,x2,y2,0);
<a name="l160"></a> msg_code=</span><span class=cF5>GetMsg</span><span class=cF0>(&amp;arg1,&amp;arg2,1&lt;&lt;</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>+1&lt;&lt;</span><span class=cF3>MSG_MS_MOVE</span><span class=cF0>);
<a name="l161"></a> </span><span class=cF5>SpriteScrnInit</span><span class=cF0>(dc,x,y);
<a name="l162"></a> x2=arg1; y2=arg2;
<a name="l163"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>while</span><span class=cF0> (msg_code!=</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>);
<a name="l164"></a> dc-&gt;color=color&amp;</span><span class=cF3>COLORROP_NO_ROP0_MASK</span><span class=cF0>;
<a name="l165"></a> </span><span class=cF5>GrArrow3</span><span class=cF0>(dc,x1,y1,0,x2,y2,0);
<a name="l166"></a> res=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF3>SPT_ARROW</span><span class=cF7>)</span><span class=cF0>);
<a name="l167"></a> res-&gt;type=</span><span class=cF3>SPT_ARROW</span><span class=cF0>;
<a name="l168"></a> res-&gt;pp.x1=x1-x;
<a name="l169"></a> res-&gt;pp.y1=y1-y;
<a name="l170"></a> res-&gt;pp.x2=x2-x;
<a name="l171"></a> res-&gt;pp.y2=y2-y;
<a name="l172"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l173"></a>}
<a name="l174"></a>
<a name="l175"></a></span><span class=cF9>CSprite</span><span class=cF0> *</span><span class=cF5>SMPlanarSymmetry</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *dc,</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> arg1,</span><span class=cF9>I64</span><span class=cF0> arg2)
<a name="l176"></a>{
<a name="l177"></a> </span><span class=cF9>I64</span><span class=cF0> msg_code,x1=arg1,y1=arg2,x2=arg1,y2=arg2,old_width,old_flags;
<a name="l178"></a> </span><span class=cF9>CSprite</span><span class=cF0> *res;
<a name="l179"></a> old_width=dc-&gt;thick;
<a name="l180"></a> old_flags=dc-&gt;flags;
<a name="l181"></a> dc-&gt;flags&amp;=~</span><span class=cF3>DCF_SYMMETRY</span><span class=cF0>;
<a name="l182"></a> dc-&gt;thick=1;
<a name="l183"></a> </span><span class=cF1>do</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l184"></a> dc-&gt;color=</span><span class=cF3>ROPF_DITHER</span><span class=cF0>+</span><span class=cF3>WHITE</span><span class=cF0>&lt;&lt;16+</span><span class=cF3>BLACK</span><span class=cF0>;
<a name="l185"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(dc,x1,y1,0,x2,y2,0);
<a name="l186"></a> msg_code=</span><span class=cF5>GetMsg</span><span class=cF0>(&amp;arg1,&amp;arg2,1&lt;&lt;</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>+1&lt;&lt;</span><span class=cF3>MSG_MS_MOVE</span><span class=cF0>);
<a name="l187"></a> </span><span class=cF5>SpriteScrnInit</span><span class=cF0>(dc,x,y);
<a name="l188"></a> x2=arg1; y2=arg2;
<a name="l189"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>while</span><span class=cF0> (msg_code!=</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>);
<a name="l190"></a> dc-&gt;flags=old_flags&amp;</span><span class=cF3>DCF_SYMMETRY</span><span class=cF0>|dc-&gt;flags&amp;~</span><span class=cF3>DCF_SYMMETRY</span><span class=cF0>;
<a name="l191"></a> dc-&gt;thick=old_width;
<a name="l192"></a> res=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF3>SPT_PLANAR_SYMMETRY</span><span class=cF7>)</span><span class=cF0>);
<a name="l193"></a> res-&gt;type=</span><span class=cF3>SPT_PLANAR_SYMMETRY</span><span class=cF0>;
<a name="l194"></a> res-&gt;pp.x1=x1-x;
<a name="l195"></a> res-&gt;pp.y1=y1-y;
<a name="l196"></a> res-&gt;pp.x2=x2-x;
<a name="l197"></a> res-&gt;pp.y2=y2-y;
<a name="l198"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l199"></a>}
<a name="l200"></a>
<a name="l201"></a></span><span class=cF9>CSprite</span><span class=cF0> *</span><span class=cF5>SMRect</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *dc,</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> arg1,</span><span class=cF9>I64</span><span class=cF0> arg2,</span><span class=cF9>CColorROPU32</span><span class=cF0> color)
<a name="l202"></a>{
<a name="l203"></a> </span><span class=cF9>I64</span><span class=cF0> msg_code,x1=arg1,y1=arg2,x2=arg1,y2=arg2,
<a name="l204"></a> xx1=arg1,yy1=arg2,xx2=arg1,yy2=arg2;
<a name="l205"></a> </span><span class=cF9>CSprite</span><span class=cF0> *res;
<a name="l206"></a> </span><span class=cF1>do</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l207"></a> dc-&gt;color=color&amp;</span><span class=cF3>COLORROP_NO_ROP0_MASK</span><span class=cF0>;
<a name="l208"></a> </span><span class=cF5>GrRect3</span><span class=cF0>(dc,xx1,yy1,0,xx2-xx1,yy2-yy1);
<a name="l209"></a> msg_code=</span><span class=cF5>GetMsg</span><span class=cF0>(&amp;arg1,&amp;arg2,1&lt;&lt;</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>+1&lt;&lt;</span><span class=cF3>MSG_MS_MOVE</span><span class=cF0>);
<a name="l210"></a> </span><span class=cF5>SpriteScrnInit</span><span class=cF0>(dc,x,y);
<a name="l211"></a> x2=arg1; y2=arg2;
<a name="l212"></a> </span><span class=cF1>if</span><span class=cF0> (x2&lt;x1) {
<a name="l213"></a> xx1=x2; xx2=x1;
<a name="l214"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l215"></a> xx1=x1; xx2=x2;
<a name="l216"></a> }
<a name="l217"></a> </span><span class=cF1>if</span><span class=cF0> (y2&lt;y1) {
<a name="l218"></a> yy1=y2; yy2=y1;
<a name="l219"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l220"></a> yy1=y1; yy2=y2;
<a name="l221"></a> }
<a name="l222"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>while</span><span class=cF0> (msg_code!=</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>);
<a name="l223"></a> dc-&gt;color=color&amp;</span><span class=cF3>COLORROP_NO_ROP0_MASK</span><span class=cF0>;
<a name="l224"></a> </span><span class=cF5>GrRect3</span><span class=cF0>(dc,xx1,yy1,0,xx2-xx1,yy2-yy1);
<a name="l225"></a> res=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF3>SPT_RECT</span><span class=cF7>)</span><span class=cF0>);
<a name="l226"></a> res-&gt;type=</span><span class=cF3>SPT_RECT</span><span class=cF0>;
<a name="l227"></a> res-&gt;pp.x1=xx1-x;
<a name="l228"></a> res-&gt;pp.y1=yy1-y;
<a name="l229"></a> res-&gt;pp.x2=xx2-x;
<a name="l230"></a> res-&gt;pp.y2=yy2-y;
<a name="l231"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l232"></a>}
<a name="l233"></a>
<a name="l234"></a></span><span class=cF9>CSprite</span><span class=cF0> *</span><span class=cF5>SMScrnBitMap</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> eletype,</span><span class=cF9>CDC</span><span class=cF0> *dc,</span><span class=cF9>CDC</span><span class=cF0> *dc2,</span><span class=cF9>I64</span><span class=cF0> x,</span><span class=cF9>I64</span><span class=cF0> y,
<a name="l235"></a> </span><span class=cF9>I64</span><span class=cF0> arg1,</span><span class=cF9>I64</span><span class=cF0> arg2,</span><span class=cF9>CColorROPU32</span><span class=cF0> bm_bkcolor)
<a name="l236"></a>{
<a name="l237"></a> </span><span class=cF9>I64</span><span class=cF0> i,msg_code,x1=arg1,y1=arg2,x2=arg1,y2=arg2,
<a name="l238"></a> xx1=arg1,yy1=arg2,xx2=arg1,yy2=arg2,old_width;
<a name="l239"></a> </span><span class=cF9>CDC</span><span class=cF0> *dc3,*img;
<a name="l240"></a> </span><span class=cF9>CSprite</span><span class=cF0> *res;
<a name="l241"></a> old_width=dc2-&gt;thick;
<a name="l242"></a> dc2-&gt;thick=1;
<a name="l243"></a> </span><span class=cF1>do</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l244"></a> dc2-&gt;color=</span><span class=cF3>ROPF_DITHER</span><span class=cF0>+</span><span class=cF3>WHITE</span><span class=cF0>&lt;&lt;16+</span><span class=cF3>BLACK</span><span class=cF0>;
<a name="l245"></a> </span><span class=cF5>GrBorder</span><span class=cF0>(dc2,xx1+</span><span class=cF5>Fs</span><span class=cF0>-&gt;pix_left+</span><span class=cF5>Fs</span><span class=cF0>-&gt;scroll_x,yy1+</span><span class=cF5>Fs</span><span class=cF0>-&gt;pix_top+</span><span class=cF5>Fs</span><span class=cF0>-&gt;scroll_y,
<a name="l246"></a> xx2+</span><span class=cF5>Fs</span><span class=cF0>-&gt;pix_left+</span><span class=cF5>Fs</span><span class=cF0>-&gt;scroll_x,yy2+</span><span class=cF5>Fs</span><span class=cF0>-&gt;pix_top+</span><span class=cF5>Fs</span><span class=cF0>-&gt;scroll_y);
<a name="l247"></a> msg_code=</span><span class=cF5>GetMsg</span><span class=cF0>(&amp;arg1,&amp;arg2,1&lt;&lt;</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>+1&lt;&lt;</span><span class=cF3>MSG_MS_MOVE</span><span class=cF0>);
<a name="l248"></a> </span><span class=cF5>SpriteScrnInit</span><span class=cF0>(dc,x,y);
<a name="l249"></a> x2=arg1; y2=arg2;
<a name="l250"></a> </span><span class=cF1>if</span><span class=cF0> (x2&lt;x1) {
<a name="l251"></a> xx1=x2; xx2=x1;
<a name="l252"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l253"></a> xx1=x1; xx2=x2;
<a name="l254"></a> }
<a name="l255"></a> </span><span class=cF1>if</span><span class=cF0> (y2&lt;y1) {
<a name="l256"></a> yy1=y2; yy2=y1;
<a name="l257"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l258"></a> yy1=y1; yy2=y2;
<a name="l259"></a> }
<a name="l260"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>while</span><span class=cF0> (msg_code!=</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>);
<a name="l261"></a> xx2++; yy2++;
<a name="l262"></a> res=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF3>SPT_BITMAP</span><span class=cF7>)</span><span class=cF0>+</span><span class=cF7>(</span><span class=cF0>(xx2-xx1+7)&amp;~7</span><span class=cF7>)</span><span class=cF0>*</span><span class=cF7>(</span><span class=cF0>yy2-yy1</span><span class=cF7>)</span><span class=cF0>);
<a name="l263"></a> res-&gt;type=</span><span class=cF3>SPT_BITMAP</span><span class=cF0>;
<a name="l264"></a> res-&gt;pwhu.width=xx2-xx1;
<a name="l265"></a> res-&gt;pwhu.height=yy2-yy1;
<a name="l266"></a> res-&gt;pwhu.x1=0;
<a name="l267"></a> res-&gt;pwhu.y1=0;
<a name="l268"></a> </span><span class=cF5>SpriteScrnInit</span><span class=cF0>(dc,x,y);
<a name="l269"></a> i=</span><span class=cFB>gr</span><span class=cF0>.scrn_zoom;
<a name="l270"></a> </span><span class=cF5>GrScaleZoom</span><span class=cF0>(1.0/i);
<a name="l271"></a> </span><span class=cF5>Refresh</span><span class=cF0>(2,</span><span class=cF3>TRUE</span><span class=cF0>);
<a name="l272"></a>
<a name="l273"></a> dc3=</span><span class=cF5>DCScrnCapture</span><span class=cF0>;
<a name="l274"></a> img=</span><span class=cF5>DCExt</span><span class=cF0>(dc3,</span><span class=cF5>Fs</span><span class=cF0>-&gt;pix_left+</span><span class=cF5>Fs</span><span class=cF0>-&gt;scroll_x+xx1,</span><span class=cF5>Fs</span><span class=cF0>-&gt;pix_top+</span><span class=cF5>Fs</span><span class=cF0>-&gt;scroll_y+yy1,
<a name="l275"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;pix_left+</span><span class=cF5>Fs</span><span class=cF0>-&gt;scroll_x+xx2-1,</span><span class=cF5>Fs</span><span class=cF0>-&gt;pix_top+</span><span class=cF5>Fs</span><span class=cF0>-&gt;scroll_y+yy2-1);
<a name="l276"></a> </span><span class=cF1>if</span><span class=cF0> (eletype==</span><span class=cF3>SPT_INS_TRANSPARENT_SCRN_BITMAP</span><span class=cF0>)
<a name="l277"></a> </span><span class=cF5>DCColorChg</span><span class=cF0>(img,bm_bkcolor);
<a name="l278"></a> </span><span class=cF5>GrScaleZoom</span><span class=cF0>(i);
<a name="l279"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(&amp;res-&gt;pwhu.u,img-&gt;body,</span><span class=cF7>(</span><span class=cF0>(xx2-xx1+7)&amp;~7</span><span class=cF7>)</span><span class=cF0>*</span><span class=cF7>(</span><span class=cF0>yy2-yy1</span><span class=cF7>)</span><span class=cF0>);
<a name="l280"></a> </span><span class=cF5>DCDel</span><span class=cF0>(img);
<a name="l281"></a> </span><span class=cF5>DCDel</span><span class=cF0>(dc3);
<a name="l282"></a> dc2-&gt;thick=old_width;
<a name="l283"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;win_inhibit=</span><span class=cF3>WIG_TASK_DFT</span><span class=cF0>-</span><span class=cF3>WIF_SELF_FOCUS</span><span class=cF0>
<a name="l284"></a> -</span><span class=cF3>WIF_SELF_BORDER</span><span class=cF0>-</span><span class=cF3>WIF_SELF_GRAB_SCROLL</span><span class=cF0>;
<a name="l285"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l286"></a>}
<a name="l287"></a>
<a name="l288"></a></span><span class=cF9>CSprite</span><span class=cF0> *</span><span class=cF5>SMCircle</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *dc,</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> arg1,</span><span class=cF9>I64</span><span class=cF0> arg2,</span><span class=cF9>CColorROPU32</span><span class=cF0> color)
<a name="l289"></a>{
<a name="l290"></a> </span><span class=cF9>I64</span><span class=cF0> msg_code,x1=arg1,y1=arg2,x2=arg1,y2=arg2;
<a name="l291"></a> </span><span class=cF9>CSprite</span><span class=cF0> *res;
<a name="l292"></a> </span><span class=cF1>do</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l293"></a> dc-&gt;color=color&amp;</span><span class=cF3>COLORROP_NO_ROP0_MASK</span><span class=cF0>;
<a name="l294"></a> </span><span class=cF5>GrCircle3</span><span class=cF0>(dc,x1,y1,0,</span><span class=cF5>Sqrt</span><span class=cF7>(</span><span class=cF5>SqrI64</span><span class=cF0>(x1-x2)+</span><span class=cF5>SqrI64</span><span class=cF0>(y1-y2)</span><span class=cF7>)</span><span class=cF0>);
<a name="l295"></a> msg_code=</span><span class=cF5>GetMsg</span><span class=cF0>(&amp;arg1,&amp;arg2,1&lt;&lt;</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>+1&lt;&lt;</span><span class=cF3>MSG_MS_MOVE</span><span class=cF0>);
<a name="l296"></a> </span><span class=cF5>SpriteScrnInit</span><span class=cF0>(dc,x,y);
<a name="l297"></a> x2=arg1; y2=arg2;
<a name="l298"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>while</span><span class=cF0> (msg_code!=</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>);
<a name="l299"></a> dc-&gt;color=color&amp;</span><span class=cF3>COLORROP_NO_ROP0_MASK</span><span class=cF0>;
<a name="l300"></a> </span><span class=cF5>GrCircle3</span><span class=cF0>(dc,x1,y1,0,</span><span class=cF5>Sqrt</span><span class=cF7>(</span><span class=cF5>SqrI64</span><span class=cF0>(x1-x2)+</span><span class=cF5>SqrI64</span><span class=cF0>(y1-y2)</span><span class=cF7>)</span><span class=cF0>);
<a name="l301"></a> res=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF3>SPT_CIRCLE</span><span class=cF7>)</span><span class=cF0>);
<a name="l302"></a> res-&gt;type=</span><span class=cF3>SPT_CIRCLE</span><span class=cF0>;
<a name="l303"></a> res-&gt;pr.x1=x1-x;
<a name="l304"></a> res-&gt;pr.y1=y1-y;
<a name="l305"></a> res-&gt;pr.radius=</span><span class=cF5>Sqrt</span><span class=cF0>(</span><span class=cF5>SqrI64</span><span class=cF7>(</span><span class=cF0>x1-x2</span><span class=cF7>)</span><span class=cF0>+</span><span class=cF5>SqrI64</span><span class=cF7>(</span><span class=cF0>y1-y2</span><span class=cF7>)</span><span class=cF0>);
<a name="l306"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l307"></a>}
<a name="l308"></a>
<a name="l309"></a></span><span class=cF9>CSprite</span><span class=cF0> *</span><span class=cF5>SMEllipse</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *dc,</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> arg1,</span><span class=cF9>I64</span><span class=cF0> arg2,</span><span class=cF9>CColorROPU32</span><span class=cF0> color)
<a name="l310"></a>{
<a name="l311"></a> </span><span class=cF9>I64</span><span class=cF0> msg_code,x1=arg1,y1=arg2,x2=arg1,y2=arg2;
<a name="l312"></a> </span><span class=cF1>F64</span><span class=cF0> angle1,angle2;
<a name="l313"></a> </span><span class=cF9>CSprite</span><span class=cF0> *res;
<a name="l314"></a> </span><span class=cF1>do</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l315"></a> dc-&gt;color=color&amp;</span><span class=cF3>COLORROP_NO_ROP0_MASK</span><span class=cF0>;
<a name="l316"></a> </span><span class=cF5>GrEllipse3</span><span class=cF0>(dc,</span><span class=cF7>(</span><span class=cF0>x1+x2</span><span class=cF7>)</span><span class=cF0>&gt;&gt;1,</span><span class=cF7>(</span><span class=cF0>y1+y2</span><span class=cF7>)</span><span class=cF0>&gt;&gt;1,0,</span><span class=cF5>AbsI64</span><span class=cF7>(</span><span class=cF0>x1-x2</span><span class=cF7>)</span><span class=cF0>&gt;&gt;1,</span><span class=cF5>AbsI64</span><span class=cF7>(</span><span class=cF0>y1-y2</span><span class=cF7>)</span><span class=cF0>&gt;&gt;1);
<a name="l317"></a> msg_code=</span><span class=cF5>GetMsg</span><span class=cF0>(&amp;arg1,&amp;arg2,1&lt;&lt;</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>+1&lt;&lt;</span><span class=cF3>MSG_MS_MOVE</span><span class=cF0>);
<a name="l318"></a> </span><span class=cF5>SpriteScrnInit</span><span class=cF0>(dc,x,y);
<a name="l319"></a> x2=arg1; y2=arg2;
<a name="l320"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>while</span><span class=cF0> (msg_code!=</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>);
<a name="l321"></a> res=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF3>SPT_ELLIPSE</span><span class=cF7>)</span><span class=cF0>);
<a name="l322"></a> res-&gt;type=</span><span class=cF3>SPT_ELLIPSE</span><span class=cF0>;
<a name="l323"></a> res-&gt;pwha.x1=(x1+x2)&gt;&gt;1-x;
<a name="l324"></a> res-&gt;pwha.y1=(y1+y2)&gt;&gt;1-y;
<a name="l325"></a> res-&gt;pwha.width =</span><span class=cF5>AbsI64</span><span class=cF0>(x1-x2)&gt;&gt;1;
<a name="l326"></a> res-&gt;pwha.height=</span><span class=cF5>AbsI64</span><span class=cF0>(y1-y2)&gt;&gt;1;
<a name="l327"></a> angle2=</span><span class=cF5>Arg</span><span class=cF0>(x2-</span><span class=cF7>(</span><span class=cF0>res-&gt;pwha.x1+x</span><span class=cF7>)</span><span class=cF0>,y2-</span><span class=cF7>(</span><span class=cF0>res-&gt;pwha.y1+y</span><span class=cF7>)</span><span class=cF0>);
<a name="l328"></a> </span><span class=cF1>if</span><span class=cF0> (res-&gt;pwha.width&lt;res-&gt;pwha.height)
<a name="l329"></a> angle2-=</span><span class=cF3>pi</span><span class=cF0>/2.0;
<a name="l330"></a> </span><span class=cF1>do</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l331"></a> angle1=</span><span class=cF5>Arg</span><span class=cF0>(x2-</span><span class=cF7>(</span><span class=cF0>res-&gt;pwha.x1+x</span><span class=cF7>)</span><span class=cF0>,y2-</span><span class=cF7>(</span><span class=cF0>res-&gt;pwha.y1+y</span><span class=cF7>)</span><span class=cF0>);
<a name="l332"></a> </span><span class=cF1>if</span><span class=cF0> (res-&gt;pwha.width&gt;=res-&gt;pwha.height)
<a name="l333"></a> res-&gt;pwha.angle=-(angle1-angle2);
<a name="l334"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l335"></a> res-&gt;pwha.angle=-(angle1-angle2)+</span><span class=cF3>pi</span><span class=cF0>/2.0;
<a name="l336"></a> dc-&gt;color=color&amp;</span><span class=cF3>COLORROP_NO_ROP0_MASK</span><span class=cF0>;
<a name="l337"></a> </span><span class=cF5>GrEllipse3</span><span class=cF0>(dc,res-&gt;pwha.x1+x,res-&gt;pwha.y1+y,0,
<a name="l338"></a> res-&gt;pwha.width,res-&gt;pwha.height,res-&gt;pwha.angle);
<a name="l339"></a> msg_code=</span><span class=cF5>GetMsg</span><span class=cF0>(&amp;arg1,&amp;arg2,1&lt;&lt;</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>+1&lt;&lt;</span><span class=cF3>MSG_MS_MOVE</span><span class=cF0>);
<a name="l340"></a> </span><span class=cF5>SpriteScrnInit</span><span class=cF0>(dc,x,y);
<a name="l341"></a> x2=arg1; y2=arg2;
<a name="l342"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>while</span><span class=cF0> (msg_code!=</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>);
<a name="l343"></a> angle1=</span><span class=cF5>Arg</span><span class=cF0>(x2-</span><span class=cF7>(</span><span class=cF0>res-&gt;pwha.x1+x</span><span class=cF7>)</span><span class=cF0>,y2-</span><span class=cF7>(</span><span class=cF0>res-&gt;pwha.y1+y</span><span class=cF7>)</span><span class=cF0>);
<a name="l344"></a> </span><span class=cF1>if</span><span class=cF0> (res-&gt;pwha.width&gt;=res-&gt;pwha.height)
<a name="l345"></a> res-&gt;pwha.angle=-(angle1-angle2);
<a name="l346"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l347"></a> res-&gt;pwha.angle=-(angle1-angle2)+</span><span class=cF3>pi</span><span class=cF0>/2.0;
<a name="l348"></a> dc-&gt;color=color&amp;</span><span class=cF3>COLORROP_NO_ROP0_MASK</span><span class=cF0>;
<a name="l349"></a> </span><span class=cF5>GrEllipse3</span><span class=cF0>(dc,res-&gt;pwha.x1+x,res-&gt;pwha.y1+y,0,
<a name="l350"></a> res-&gt;pwha.width,res-&gt;pwha.height,res-&gt;pwha.angle);
<a name="l351"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l352"></a>}
<a name="l353"></a>
<a name="l354"></a></span><span class=cF9>CSprite</span><span class=cF0> *</span><span class=cF5>SMPolygon</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *dc,</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> arg1,</span><span class=cF9>I64</span><span class=cF0> arg2,</span><span class=cF9>I64</span><span class=cF0> sides,
<a name="l355"></a> </span><span class=cF9>CColorROPU32</span><span class=cF0> color)
<a name="l356"></a>{
<a name="l357"></a> </span><span class=cF9>I64</span><span class=cF0> msg_code,x1=arg1,y1=arg2,x2=arg1,y2=arg2;
<a name="l358"></a> </span><span class=cF1>F64</span><span class=cF0> angle1,angle2;
<a name="l359"></a> </span><span class=cF9>CSprite</span><span class=cF0> *res;
<a name="l360"></a> </span><span class=cF1>do</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l361"></a> dc-&gt;color=color&amp;</span><span class=cF3>COLORROP_NO_ROP0_MASK</span><span class=cF0>;
<a name="l362"></a> </span><span class=cF5>GrRegPoly3</span><span class=cF0>(dc,</span><span class=cF7>(</span><span class=cF0>x1+x2</span><span class=cF7>)</span><span class=cF0>&gt;&gt;1,</span><span class=cF7>(</span><span class=cF0>y1+y2</span><span class=cF7>)</span><span class=cF0>&gt;&gt;1,0,
<a name="l363"></a> </span><span class=cF5>AbsI64</span><span class=cF7>(</span><span class=cF0>x1-x2</span><span class=cF7>)</span><span class=cF0>&gt;&gt;1,</span><span class=cF5>AbsI64</span><span class=cF7>(</span><span class=cF0>y1-y2</span><span class=cF7>)</span><span class=cF0>&gt;&gt;1,sides);
<a name="l364"></a> msg_code=</span><span class=cF5>GetMsg</span><span class=cF0>(&amp;arg1,&amp;arg2,1&lt;&lt;</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>+1&lt;&lt;</span><span class=cF3>MSG_MS_MOVE</span><span class=cF0>);
<a name="l365"></a> </span><span class=cF5>SpriteScrnInit</span><span class=cF0>(dc,x,y);
<a name="l366"></a> x2=arg1; y2=arg2;
<a name="l367"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>while</span><span class=cF0> (msg_code!=</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>);
<a name="l368"></a> res=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF3>SPT_POLYGON</span><span class=cF7>)</span><span class=cF0>);
<a name="l369"></a> res-&gt;type=</span><span class=cF3>SPT_POLYGON</span><span class=cF0>;
<a name="l370"></a> res-&gt;pwhas.x1=(x1+x2)&gt;&gt;1-x;
<a name="l371"></a> res-&gt;pwhas.y1=(y1+y2)&gt;&gt;1-y;
<a name="l372"></a> res-&gt;pwhas.width =</span><span class=cF5>AbsI64</span><span class=cF0>(x1-x2)&gt;&gt;1;
<a name="l373"></a> res-&gt;pwhas.height=</span><span class=cF5>AbsI64</span><span class=cF0>(y1-y2)&gt;&gt;1;
<a name="l374"></a> res-&gt;pwhas.sides=sides;
<a name="l375"></a> angle2=</span><span class=cF5>Arg</span><span class=cF0>(x2-</span><span class=cF7>(</span><span class=cF0>res-&gt;pwhas.x1+x</span><span class=cF7>)</span><span class=cF0>,y2-</span><span class=cF7>(</span><span class=cF0>res-&gt;pwhas.y1+y</span><span class=cF7>)</span><span class=cF0>);
<a name="l376"></a> </span><span class=cF1>if</span><span class=cF0> (res-&gt;pwhas.width&lt;res-&gt;pwhas.height)
<a name="l377"></a> angle2-=</span><span class=cF3>pi</span><span class=cF0>/2.0;
<a name="l378"></a> </span><span class=cF1>do</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l379"></a> angle1=</span><span class=cF5>Arg</span><span class=cF0>(x2-</span><span class=cF7>(</span><span class=cF0>res-&gt;pwhas.x1+x</span><span class=cF7>)</span><span class=cF0>,y2-</span><span class=cF7>(</span><span class=cF0>res-&gt;pwhas.y1+y</span><span class=cF7>)</span><span class=cF0>);
<a name="l380"></a> </span><span class=cF1>if</span><span class=cF0> (res-&gt;pwhas.width&gt;=res-&gt;pwhas.height)
<a name="l381"></a> res-&gt;pwhas.angle=-(angle1-angle2);
<a name="l382"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l383"></a> res-&gt;pwhas.angle=-(angle1-angle2)+</span><span class=cF3>pi</span><span class=cF0>/2.0;
<a name="l384"></a> dc-&gt;color=color&amp;</span><span class=cF3>COLORROP_NO_ROP0_MASK</span><span class=cF0>;
<a name="l385"></a> </span><span class=cF5>GrRegPoly3</span><span class=cF0>(dc,res-&gt;pwhas.x1+x,res-&gt;pwhas.y1+y,0,
<a name="l386"></a> res-&gt;pwhas.width,res-&gt;pwhas.height,
<a name="l387"></a> res-&gt;pwhas.sides,res-&gt;pwhas.angle);
<a name="l388"></a> msg_code=</span><span class=cF5>GetMsg</span><span class=cF0>(&amp;arg1,&amp;arg2,1&lt;&lt;</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>+1&lt;&lt;</span><span class=cF3>MSG_MS_MOVE</span><span class=cF0>);
<a name="l389"></a> </span><span class=cF5>SpriteScrnInit</span><span class=cF0>(dc,x,y);
<a name="l390"></a> x2=arg1; y2=arg2;
<a name="l391"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>while</span><span class=cF0> (msg_code!=</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>);
<a name="l392"></a> angle1=</span><span class=cF5>Arg</span><span class=cF0>(x2-</span><span class=cF7>(</span><span class=cF0>res-&gt;pwhas.x1+x</span><span class=cF7>)</span><span class=cF0>,y2-</span><span class=cF7>(</span><span class=cF0>res-&gt;pwhas.y1+y</span><span class=cF7>)</span><span class=cF0>);
<a name="l393"></a> </span><span class=cF1>if</span><span class=cF0> (res-&gt;pwhas.width&gt;=res-&gt;pwhas.height)
<a name="l394"></a> res-&gt;pwhas.angle=-(angle1-angle2);
<a name="l395"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l396"></a> res-&gt;pwhas.angle=-(angle1-angle2)+</span><span class=cF3>pi</span><span class=cF0>/2.0;
<a name="l397"></a> dc-&gt;color=color&amp;</span><span class=cF3>COLORROP_NO_ROP0_MASK</span><span class=cF0>;
<a name="l398"></a> </span><span class=cF5>GrRegPoly3</span><span class=cF0>(dc,res-&gt;pwhas.x1+x,res-&gt;pwhas.y1+y,0,
<a name="l399"></a> res-&gt;pwhas.width,res-&gt;pwhas.height,res-&gt;pwhas.sides,
<a name="l400"></a> res-&gt;pwhas.angle);
<a name="l401"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l402"></a>}
<a name="l403"></a>
<a name="l404"></a></span><span class=cF9>CSprite</span><span class=cF0> *</span><span class=cF5>SMPolyLineFamily</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> eletype,</span><span class=cF9>CDC</span><span class=cF0> *dc,</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> arg1,</span><span class=cF9>I64</span><span class=cF0> arg2,
<a name="l405"></a> </span><span class=cF9>CColorROPU32</span><span class=cF0> color)
<a name="l406"></a>{
<a name="l407"></a> </span><span class=cF9>I64</span><span class=cF0> i,num=0,msg_code,x1=arg1,y1=arg2,x2=arg1,y2=arg2;
<a name="l408"></a> </span><span class=cF9>I32</span><span class=cF0> *ptr;
<a name="l409"></a> </span><span class=cF9>CD3I32</span><span class=cF0> *p;
<a name="l410"></a> </span><span class=cF9>CSprite</span><span class=cF0> *res,*tmpg,*tmpg1,head2;
<a name="l411"></a>
<a name="l412"></a> </span><span class=cF5>QueInit</span><span class=cF0>(&amp;head2);
<a name="l413"></a> </span><span class=cF1>do</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l414"></a> </span><span class=cF1>do</span><span class=cF0> {
<a name="l415"></a> dc-&gt;color=color&amp;</span><span class=cF3>COLORROP_NO_ROP0_MASK</span><span class=cF0>;
<a name="l416"></a> </span><span class=cF1>if</span><span class=cF0> (num)
<a name="l417"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(dc,x1,y1,0,x2,y2,0);
<a name="l418"></a> msg_code=</span><span class=cF5>GetMsg</span><span class=cF0>(&amp;arg1,&amp;arg2,
<a name="l419"></a> 1&lt;&lt;</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>+1&lt;&lt;</span><span class=cF3>MSG_MS_MOVE</span><span class=cF0>+1&lt;&lt;</span><span class=cF3>MSG_MS_R_UP</span><span class=cF0>);
<a name="l420"></a> dc-&gt;color=</span><span class=cF3>TRANSPARENT</span><span class=cF0>;
<a name="l421"></a> </span><span class=cF1>if</span><span class=cF0> (num)
<a name="l422"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(dc,x1,y1,0,x2,y2,0);
<a name="l423"></a> x2=arg1; y2=arg2;
<a name="l424"></a> } </span><span class=cF1>while</span><span class=cF0> (msg_code!=</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0> &amp;&amp; msg_code!=</span><span class=cF3>MSG_MS_R_UP</span><span class=cF0>);
<a name="l425"></a> dc-&gt;color=color&amp;</span><span class=cF3>COLORROP_NO_ROP0_MASK</span><span class=cF0>;
<a name="l426"></a> </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="l427"></a> </span><span class=cF1>if</span><span class=cF0> (num)
<a name="l428"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(dc,x1,y1,0,x2,y2,0);
<a name="l429"></a> res=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF3>SPT_PT</span><span class=cF7>)</span><span class=cF0>);
<a name="l430"></a> res-&gt;type=</span><span class=cF3>SPT_PT</span><span class=cF0>;
<a name="l431"></a> res-&gt;p.x1=x2-x;
<a name="l432"></a> res-&gt;p.y1=y2-y;
<a name="l433"></a> </span><span class=cF5>QueIns</span><span class=cF0>(res,head2.last);
<a name="l434"></a> x1=x2;y1=y2;
<a name="l435"></a> num++;
<a name="l436"></a> }
<a name="l437"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>while</span><span class=cF0> (msg_code!=</span><span class=cF3>MSG_MS_R_UP</span><span class=cF0>);
<a name="l438"></a>
<a name="l439"></a> </span><span class=cF1>switch</span><span class=cF0> (eletype) </span><span class=cF7>{</span><span class=cF0>
<a name="l440"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_POLYLINE</span><span class=cF0>:
<a name="l441"></a> </span><span class=cF1>if</span><span class=cF0> (num&gt;1) {
<a name="l442"></a> res=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF3>SPT_POLYLINE</span><span class=cF7>)</span><span class=cF0>+num*</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CD2I32</span><span class=cF7>)</span><span class=cF0>);
<a name="l443"></a> ptr=&amp;res-&gt;nu.u;
<a name="l444"></a> tmpg1=head2.next;
<a name="l445"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;num;i++) </span><span class=cF7>{</span><span class=cF0>
<a name="l446"></a> tmpg=tmpg1-&gt;next;
<a name="l447"></a> ptr[i&lt;&lt;1]=tmpg1-&gt;p.x1;
<a name="l448"></a> ptr[i&lt;&lt;1+1]=tmpg1-&gt;p.y1;
<a name="l449"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpg1);
<a name="l450"></a> tmpg1=tmpg;
<a name="l451"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l452"></a> res-&gt;type=</span><span class=cF3>SPT_POLYLINE</span><span class=cF0>;
<a name="l453"></a> res-&gt;nu.num=num;
<a name="l454"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l455"></a> tmpg1=head2.next;
<a name="l456"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;num;i++) </span><span class=cF7>{</span><span class=cF0>
<a name="l457"></a> tmpg=tmpg1-&gt;next;
<a name="l458"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpg1);
<a name="l459"></a> tmpg1=tmpg;
<a name="l460"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l461"></a> res=</span><span class=cF3>NULL</span><span class=cF0>;
<a name="l462"></a> }
<a name="l463"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l464"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_BSPLINE2</span><span class=cF0>:
<a name="l465"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_BSPLINE3</span><span class=cF0>:
<a name="l466"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_BSPLINE2_CLOSED</span><span class=cF0>:
<a name="l467"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_BSPLINE3_CLOSED</span><span class=cF0>:
<a name="l468"></a> </span><span class=cF1>if</span><span class=cF0> (num&gt;2) {
<a name="l469"></a> res=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF0>eletype</span><span class=cF7>)</span><span class=cF0>+num*</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CD3I32</span><span class=cF7>)</span><span class=cF0>);
<a name="l470"></a> p=&amp;res-&gt;nu.u;
<a name="l471"></a> tmpg1=head2.next;
<a name="l472"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;num;i++) </span><span class=cF7>{</span><span class=cF0>
<a name="l473"></a> tmpg=tmpg1-&gt;next;
<a name="l474"></a> p[i].x=tmpg1-&gt;p.x1;
<a name="l475"></a> p[i].y=tmpg1-&gt;p.y1;
<a name="l476"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpg1);
<a name="l477"></a> tmpg1=tmpg;
<a name="l478"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l479"></a> res-&gt;type=eletype;
<a name="l480"></a> res-&gt;nu.num=num;
<a name="l481"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l482"></a> tmpg1=head2.next;
<a name="l483"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;num;i++) </span><span class=cF7>{</span><span class=cF0>
<a name="l484"></a> tmpg=tmpg1-&gt;next;
<a name="l485"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpg1);
<a name="l486"></a> tmpg1=tmpg;
<a name="l487"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l488"></a> res=</span><span class=cF3>NULL</span><span class=cF0>;
<a name="l489"></a> }
<a name="l490"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l491"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l492"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l493"></a>}
<a name="l494"></a>
<a name="l495"></a></span><span class=cF9>CSprite</span><span class=cF0> *</span><span class=cF5>SMPolyPoint</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *dc,</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> arg1,</span><span class=cF9>I64</span><span class=cF0> arg2,</span><span class=cF9>CColorROPU32</span><span class=cF0> color)
<a name="l496"></a>{
<a name="l497"></a> </span><span class=cF9>I64</span><span class=cF0> i,num=0,msg_code,x1=arg1,y1=arg2,x2=arg1,y2=arg2,x3,y3;
<a name="l498"></a> </span><span class=cF9>I32</span><span class=cF0> *ptr;
<a name="l499"></a> </span><span class=cF9>CSprite</span><span class=cF0> *res,*tmpg,*tmpg1,head2;
<a name="l500"></a>
<a name="l501"></a> </span><span class=cF5>QueInit</span><span class=cF0>(&amp;head2);
<a name="l502"></a> x3=arg1-x; y3=arg2-y;
<a name="l503"></a> dc-&gt;color=color&amp;</span><span class=cF3>COLORROP_NO_ROP0_MASK</span><span class=cF0>;
<a name="l504"></a> </span><span class=cF1>do</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l505"></a> msg_code=</span><span class=cF5>GetMsg</span><span class=cF0>(&amp;arg1,&amp;arg2,1&lt;&lt;</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>+1&lt;&lt;</span><span class=cF3>MSG_MS_MOVE</span><span class=cF0>);
<a name="l506"></a> x2=arg1; y2=arg2;
<a name="l507"></a> </span><span class=cF5>GrLine3</span><span class=cF0>(dc,x1,y1,0,x2,y2,0);
<a name="l508"></a> </span><span class=cF5>Line</span><span class=cF0>(&amp;head2,x1-x,y1-y,0,x2-x,y2-y,0,&amp;</span><span class=cF5>SpritePolyPtPlot</span><span class=cF0>);
<a name="l509"></a> x1=x2;y1=y2;
<a name="l510"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>while</span><span class=cF0> (msg_code!=</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>);
<a name="l511"></a>
<a name="l512"></a> num=0;
<a name="l513"></a> res=head2.next;
<a name="l514"></a> x1=x3; y1=y3;
<a name="l515"></a> </span><span class=cF1>while</span><span class=cF0> (res!=&amp;head2) </span><span class=cF7>{</span><span class=cF0>
<a name="l516"></a> tmpg=res-&gt;next;
<a name="l517"></a> </span><span class=cF1>if</span><span class=cF0> (res-&gt;p.x1==x1 &amp;&amp; res-&gt;p.y1==y1) {
<a name="l518"></a> </span><span class=cF5>QueRem</span><span class=cF0>(res);
<a name="l519"></a> </span><span class=cF5>Free</span><span class=cF0>(res);
<a name="l520"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l521"></a> num++;
<a name="l522"></a> x1=res-&gt;p.x1;
<a name="l523"></a> y1=res-&gt;p.y1;
<a name="l524"></a> }
<a name="l525"></a> res=tmpg;
<a name="l526"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l527"></a>
<a name="l528"></a> res=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF3>SPT_POLYPT</span><span class=cF7>)</span><span class=cF0>+</span><span class=cF7>(</span><span class=cF0>num*3+7</span><span class=cF7>)</span><span class=cF0>&gt;&gt;3);
<a name="l529"></a> res-&gt;npu.x=x3;
<a name="l530"></a> res-&gt;npu.y=y3;
<a name="l531"></a> ptr=&amp;res-&gt;npu.u;
<a name="l532"></a> x1=x3; y1=y3;
<a name="l533"></a> i=0;
<a name="l534"></a> tmpg1=head2.next;
<a name="l535"></a> </span><span class=cF1>while</span><span class=cF0> (tmpg1!=&amp;head2) </span><span class=cF7>{</span><span class=cF0>
<a name="l536"></a> tmpg=tmpg1-&gt;next;
<a name="l537"></a> </span><span class=cF5>BFieldOrU32</span><span class=cF0>(ptr,i,</span><span class=cFB>polypt_map</span><span class=cF0>[</span><span class=cF5>SignI64</span><span class=cF7>(</span><span class=cF0>tmpg1-&gt;p.x1-x1</span><span class=cF7>)</span><span class=cF0>+1+
<a name="l538"></a> 3*</span><span class=cF7>(</span><span class=cF5>SignI64</span><span class=cF0>(tmpg1-&gt;p.y1-y1)+1</span><span class=cF7>)</span><span class=cF0>]);
<a name="l539"></a> i+=3;
<a name="l540"></a> x1=tmpg1-&gt;p.x1;y1=tmpg1-&gt;p.y1;
<a name="l541"></a> </span><span class=cF5>QueRem</span><span class=cF0>(tmpg1);
<a name="l542"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpg1);
<a name="l543"></a> tmpg1=tmpg;
<a name="l544"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l545"></a> res-&gt;type=</span><span class=cF3>SPT_POLYPT</span><span class=cF0>;
<a name="l546"></a> res-&gt;npu.num=num;
<a name="l547"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l548"></a>}
<a name="l549"></a>
<a name="l550"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>SMTextFamily</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> eletype,</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF9>CDocEntry</span><span class=cF0> *doc_ce,</span><span class=cF9>CSprite</span><span class=cF0> *head,</span><span class=cF9>CDC</span><span class=cF0> *dc,
<a name="l551"></a> </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> arg1,</span><span class=cF9>I64</span><span class=cF0> arg2,</span><span class=cF9>CColorROPU32</span><span class=cF0> color,</span><span class=cF9>I64</span><span class=cF0> *_cur_elem_num,
<a name="l552"></a> </span><span class=cF9>I64</span><span class=cF0> old_de_flags)
<a name="l553"></a>{
<a name="l554"></a> </span><span class=cF9>CSprite</span><span class=cF0> *tmpg,*insert_pt=</span><span class=cF5>SpriteSetSettings</span><span class=cF0>(,head,*_cur_elem_num);
<a name="l555"></a> </span><span class=cF9>I64</span><span class=cF0> msg_code,x1,y1;
<a name="l556"></a> </span><span class=cF1>U8</span><span class=cF0> *st;
<a name="l557"></a> doc_ce-&gt;de_flags|=</span><span class=cF3>DOCEF_DONT_DRAW</span><span class=cF0>;
<a name="l558"></a> st=</span><span class=cF5>PopUpGetStr</span><span class=cF0>(</span><span class=cF6>&quot;Enter text and press &lt;ESC&gt;.\n&quot;</span><span class=cF0>);
<a name="l559"></a> doc_ce-&gt;de_flags=old_de_flags;
<a name="l560"></a> </span><span class=cF1>if</span><span class=cF0> (st &amp;&amp; *st) </span><span class=cF7>{</span><span class=cF0>
<a name="l561"></a> x1=0; y1=0;
<a name="l562"></a> </span><span class=cF1>do</span><span class=cF0> {
<a name="l563"></a> dc-&gt;color=color&amp;</span><span class=cF3>COLORROP_NO_ROP0_MASK</span><span class=cF0>;
<a name="l564"></a> </span><span class=cF1>switch</span><span class=cF0> (eletype) </span><span class=cF7>{</span><span class=cF0>
<a name="l565"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_TEXT</span><span class=cF0>: </span><span class=cF5>GrPrint3</span><span class=cF0>(dc,x1,y1,0,</span><span class=cF6>&quot;%s&quot;</span><span class=cF0>,st); </span><span class=cF1>break</span><span class=cF0>;
<a name="l566"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_TEXT_BOX</span><span class=cF0>: </span><span class=cF5>GrTextBox3</span><span class=cF0>(dc,x1,y1,0,st); </span><span class=cF1>break</span><span class=cF0>;
<a name="l567"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_TEXT_DIAMOND</span><span class=cF0>: </span><span class=cF5>GrTextDiamond3</span><span class=cF0>(dc,x1,y1,0,st); </span><span class=cF1>break</span><span class=cF0>;
<a name="l568"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l569"></a> msg_code=</span><span class=cF5>GetMsg</span><span class=cF0>(&amp;arg1,&amp;arg2,1&lt;&lt;</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>+1&lt;&lt;</span><span class=cF3>MSG_MS_MOVE</span><span class=cF0>);
<a name="l570"></a> </span><span class=cF5>SpriteScrnInit</span><span class=cF0>(dc,x,y);
<a name="l571"></a> x1=arg1; y1=arg2;
<a name="l572"></a> } </span><span class=cF1>while</span><span class=cF0> (msg_code!=</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>);
<a name="l573"></a> tmpg=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF0>eletype</span><span class=cF7>)</span><span class=cF0>+</span><span class=cF5>StrLen</span><span class=cF7>(</span><span class=cF0>st</span><span class=cF7>)</span><span class=cF0>+1);
<a name="l574"></a> tmpg-&gt;type=eletype;
<a name="l575"></a> tmpg-&gt;ps.x1=x1-x;
<a name="l576"></a> tmpg-&gt;ps.y1=y1-y;
<a name="l577"></a> </span><span class=cF5>StrCpy</span><span class=cF0>(tmpg-&gt;ps.st,st);
<a name="l578"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpg,insert_pt-&gt;last);
<a name="l579"></a> </span><span class=cF5>SpriteEdUpdate</span><span class=cF0>(doc,doc_ce,head);
<a name="l580"></a> *_cur_elem_num+=1;
<a name="l581"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l582"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l583"></a>}
<a name="l584"></a>
<a name="l585"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>SMBitMap</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> eletype,</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF9>CDocEntry</span><span class=cF0> *doc_ce,</span><span class=cF9>CSprite</span><span class=cF0> *head,
<a name="l586"></a> </span><span class=cF9>CDC</span><span class=cF0> *dc,</span><span class=cF9>I64</span><span class=cF0> xx,</span><span class=cF9>I64</span><span class=cF0> yy,</span><span class=cF9>I64</span><span class=cF0> arg1,</span><span class=cF9>I64</span><span class=cF0> arg2,</span><span class=cF9>CColorROPU32</span><span class=cF0> bm_bkcolor,
<a name="l587"></a> </span><span class=cF1>Bool</span><span class=cF0> sel,</span><span class=cF9>I64</span><span class=cF0> xx1=0,</span><span class=cF9>I64</span><span class=cF0> yy1=0,</span><span class=cF9>I64</span><span class=cF0> xx2=0,</span><span class=cF9>I64</span><span class=cF0> yy2=0,</span><span class=cF9>I64</span><span class=cF0> *_cur_elem_num)
<a name="l588"></a>{
<a name="l589"></a> </span><span class=cF9>I64</span><span class=cF0> i,msg_code,x=xx,y=yy,x1=arg1,y1=arg2,x2=arg1,y2=arg2,old_width;
<a name="l590"></a> </span><span class=cF9>CSprite</span><span class=cF0> *tmpg,*tmpg1,*insert_pt;
<a name="l591"></a> </span><span class=cF9>CDC</span><span class=cF0> *img;
<a name="l592"></a>
<a name="l593"></a> insert_pt=</span><span class=cF5>SpriteSetSettings</span><span class=cF0>(,head,*_cur_elem_num,xx,yy,,,&amp;x,&amp;y);
<a name="l594"></a> x+=xx; y+=yy;
<a name="l595"></a>
<a name="l596"></a> </span><span class=cF1>if</span><span class=cF0> (sel) </span><span class=cF7>{</span><span class=cF0>
<a name="l597"></a> xx1=arg1; yy1=arg2;
<a name="l598"></a> xx2=arg1; yy2=arg2;
<a name="l599"></a> old_width=dc-&gt;thick;
<a name="l600"></a> dc-&gt;thick=1;
<a name="l601"></a> </span><span class=cF1>do</span><span class=cF0> {
<a name="l602"></a> dc-&gt;color=</span><span class=cF3>ROPF_DITHER</span><span class=cF0>+</span><span class=cF3>WHITE</span><span class=cF0>&lt;&lt;16+</span><span class=cF3>BLACK</span><span class=cF0>;
<a name="l603"></a> </span><span class=cF5>GrBorder</span><span class=cF0>(dc,xx1,yy1,xx2,yy2);
<a name="l604"></a> msg_code=</span><span class=cF5>GetMsg</span><span class=cF0>(&amp;arg1,&amp;arg2,1&lt;&lt;</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>+1&lt;&lt;</span><span class=cF3>MSG_MS_MOVE</span><span class=cF0>);
<a name="l605"></a> </span><span class=cF5>SpriteScrnInit</span><span class=cF0>(dc,x,y);
<a name="l606"></a> x2=arg1; y2=arg2;
<a name="l607"></a> </span><span class=cF1>if</span><span class=cF0> (x2&lt;x1) </span><span class=cF7>{</span><span class=cF0>
<a name="l608"></a> xx1=x2; xx2=x1;
<a name="l609"></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="l610"></a> xx1=x1; xx2=x2;
<a name="l611"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l612"></a> </span><span class=cF1>if</span><span class=cF0> (y2&lt;y1) </span><span class=cF7>{</span><span class=cF0>
<a name="l613"></a> yy1=y2; yy2=y1;
<a name="l614"></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="l615"></a> yy1=y1; yy2=y2;
<a name="l616"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l617"></a> } </span><span class=cF1>while</span><span class=cF0> (msg_code!=</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>);
<a name="l618"></a> dc-&gt;thick=old_width;
<a name="l619"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l620"></a>
<a name="l621"></a> xx2++; yy2++;
<a name="l622"></a> tmpg=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF3>SPT_BITMAP</span><span class=cF7>)</span><span class=cF0>+
<a name="l623"></a> </span><span class=cF7>(</span><span class=cF0>(xx2-xx1+7)&amp;~7</span><span class=cF7>)</span><span class=cF0>*</span><span class=cF7>(</span><span class=cF0>yy2-yy1</span><span class=cF7>)</span><span class=cF0>);
<a name="l624"></a> tmpg-&gt;type=</span><span class=cF3>SPT_BITMAP</span><span class=cF0>;
<a name="l625"></a> tmpg-&gt;pwhu.width=xx2-xx1;
<a name="l626"></a> tmpg-&gt;pwhu.height=yy2-yy1;
<a name="l627"></a> tmpg-&gt;pwhu.x1=xx1-x;
<a name="l628"></a> tmpg-&gt;pwhu.y1=yy1-y;
<a name="l629"></a> img=</span><span class=cF5>DCNew</span><span class=cF0>(tmpg-&gt;pwhu.width,tmpg-&gt;pwhu.height,</span><span class=cF5>Fs</span><span class=cF0>);
<a name="l630"></a> img-&gt;color=bm_bkcolor;
<a name="l631"></a> </span><span class=cF5>GrRect</span><span class=cF0>(img,0,0,tmpg-&gt;pwhu.width,tmpg-&gt;pwhu.height);
<a name="l632"></a> tmpg1=insert_pt;
<a name="l633"></a> </span><span class=cF1>if</span><span class=cF0> (tmpg1==head || tmpg1-&gt;type&amp;</span><span class=cF3>SPG_TYPE_MASK</span><span class=cF0>!=</span><span class=cF3>SPT_BITMAP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l634"></a> </span><span class=cF5>SpriteSetSettings</span><span class=cF0>(img,head,0,-</span><span class=cF7>(</span><span class=cF0>xx1-x</span><span class=cF7>)</span><span class=cF0>,-</span><span class=cF7>(</span><span class=cF0>yy1-y</span><span class=cF7>)</span><span class=cF0>);
<a name="l635"></a> x=xx; y=yy;
<a name="l636"></a> </span><span class=cF5>Sprite3</span><span class=cF0>(img,-</span><span class=cF7>(</span><span class=cF0>xx1-x</span><span class=cF7>)</span><span class=cF0>,-</span><span class=cF7>(</span><span class=cF0>yy1-y</span><span class=cF7>)</span><span class=cF0>,0,doc_ce-&gt;bin_data-&gt;data);
<a name="l637"></a> </span><span class=cF5>QueDel</span><span class=cF0>(head);
<a name="l638"></a> insert_pt=head-&gt;next=head-&gt;last=head;
<a name="l639"></a> *_cur_elem_num=1;
<a name="l640"></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="l641"></a> </span><span class=cF5>SpriteSetSettings</span><span class=cF0>(img,head,*_cur_elem_num,-</span><span class=cF7>(</span><span class=cF0>xx1-x</span><span class=cF7>)</span><span class=cF0>,-</span><span class=cF7>(</span><span class=cF0>yy1-y</span><span class=cF7>)</span><span class=cF0>);
<a name="l642"></a> </span><span class=cF5>Sprite3</span><span class=cF0>(img,-</span><span class=cF7>(</span><span class=cF0>xx1-x</span><span class=cF7>)</span><span class=cF0>,-</span><span class=cF7>(</span><span class=cF0>yy1-y</span><span class=cF7>)</span><span class=cF0>,0,&amp;tmpg1-&gt;</span><span class=cF1>start</span><span class=cF0>,</span><span class=cF3>TRUE</span><span class=cF0>);
<a name="l643"></a> insert_pt=tmpg1-&gt;next;
<a name="l644"></a> </span><span class=cF5>QueRem</span><span class=cF0>(tmpg1);
<a name="l645"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpg1);
<a name="l646"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l647"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(&amp;tmpg-&gt;pwhu.u,img-&gt;body,</span><span class=cF7>(</span><span class=cF0>(xx2-xx1+7)&amp;~7</span><span class=cF7>)</span><span class=cF0>*</span><span class=cF7>(</span><span class=cF0>yy2-yy1</span><span class=cF7>)</span><span class=cF0>);
<a name="l648"></a>
<a name="l649"></a> </span><span class=cF1>switch</span><span class=cF0> (i=</span><span class=cF5>SpriteBitMapEd</span><span class=cF7>(</span><span class=cF0>doc,doc_ce,dc,&amp;xx1,&amp;yy1,
<a name="l650"></a> &amp;xx2,&amp;yy2,&amp;img,bm_bkcolor</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l651"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPE_EXIT</span><span class=cF0>:
<a name="l652"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPE_CONT</span><span class=cF0>:
<a name="l653"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpg);
<a name="l654"></a> tmpg=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF3>SPT_BITMAP</span><span class=cF7>)</span><span class=cF0>+
<a name="l655"></a> </span><span class=cF7>(</span><span class=cF0>(xx2-xx1+7)&amp;~7</span><span class=cF7>)</span><span class=cF0>*</span><span class=cF7>(</span><span class=cF0>yy2-yy1</span><span class=cF7>)</span><span class=cF0>);
<a name="l656"></a> tmpg-&gt;type=eletype;
<a name="l657"></a> tmpg-&gt;pwhu.width=xx2-xx1;
<a name="l658"></a> tmpg-&gt;pwhu.height=yy2-yy1;
<a name="l659"></a> tmpg-&gt;pwhu.x1=xx1-x;
<a name="l660"></a> tmpg-&gt;pwhu.y1=yy1-y;
<a name="l661"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(&amp;tmpg-&gt;pwhu.u,img-&gt;body,</span><span class=cF7>(</span><span class=cF0>(xx2-xx1+7)&amp;~7</span><span class=cF7>)</span><span class=cF0>*</span><span class=cF7>(</span><span class=cF0>yy2-yy1</span><span class=cF7>)</span><span class=cF0>);
<a name="l662"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l663"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l664"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpg,insert_pt-&gt;last);
<a name="l665"></a> </span><span class=cF5>DCDel</span><span class=cF0>(img);
<a name="l666"></a> </span><span class=cF5>SpriteEdUpdate</span><span class=cF0>(doc,doc_ce,head);
<a name="l667"></a> </span><span class=cF1>return</span><span class=cF0> i;
<a name="l668"></a>}
<a name="l669"></a>
<a name="l670"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>SMMesh</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF9>CDocEntry</span><span class=cF0> *doc_ce,</span><span class=cF9>CSprite</span><span class=cF0> *head,</span><span class=cF9>I64</span><span class=cF0> *_cur_elem_num)
<a name="l671"></a>{
<a name="l672"></a> </span><span class=cF9>CSprite</span><span class=cF0> *tmpg,*insert_pt=</span><span class=cF5>SpriteSetSettings</span><span class=cF0>(,head,*_cur_elem_num),
<a name="l673"></a> *tmpg1=insert_pt;
<a name="l674"></a> </span><span class=cF9>CD3I32</span><span class=cF0> *p;
<a name="l675"></a> </span><span class=cF9>I64</span><span class=cF0> i,size,x1,y1,z1;
<a name="l676"></a> </span><span class=cF9>I32</span><span class=cF0> *mesh,*old_mesh;
<a name="l677"></a> </span><span class=cF1>if</span><span class=cF0> (tmpg1!=head &amp;&amp; tmpg1-&gt;type&amp;</span><span class=cF3>SPG_TYPE_MASK</span><span class=cF0>==</span><span class=cF3>SPT_MESH</span><span class=cF0>)
<a name="l678"></a> old_mesh=&amp;tmpg1-&gt;mu.vertex_cnt;
<a name="l679"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (tmpg1!=head &amp;&amp; tmpg1-&gt;type&amp;</span><span class=cF3>SPG_TYPE_MASK</span><span class=cF0>==</span><span class=cF3>SPT_SHIFTABLE_MESH</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l680"></a> x1=tmpg1-&gt;pmu.x;
<a name="l681"></a> y1=tmpg1-&gt;pmu.y;
<a name="l682"></a> z1=tmpg1-&gt;pmu.z;
<a name="l683"></a> p=&amp;tmpg1-&gt;pmu.u;
<a name="l684"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;tmpg1-&gt;pmu.vertex_cnt;i++,p++) {
<a name="l685"></a> p-&gt;x+=x1;
<a name="l686"></a> p-&gt;y+=y1;
<a name="l687"></a> p-&gt;z+=z1;
<a name="l688"></a> }
<a name="l689"></a> old_mesh=&amp;tmpg1-&gt;pmu.vertex_cnt;
<a name="l690"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l691"></a> old_mesh=</span><span class=cF3>NULL</span><span class=cF0>;
<a name="l692"></a> </span><span class=cF1>if</span><span class=cF0> (mesh=</span><span class=cF5>SpriteMeshEd</span><span class=cF7>(</span><span class=cF0>old_mesh,&amp;size,</span><span class=cF3>TRUE</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l693"></a> tmpg=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF3>SPT_MESH</span><span class=cF7>)</span><span class=cF0>-</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>I32</span><span class=cF7>)</span><span class=cF0>*2+size);
<a name="l694"></a> tmpg-&gt;type=</span><span class=cF3>SPT_MESH</span><span class=cF0>;
<a name="l695"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(&amp;tmpg-&gt;mu.vertex_cnt,mesh,size);
<a name="l696"></a> </span><span class=cF5>Free</span><span class=cF0>(mesh);
<a name="l697"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpg,insert_pt-&gt;last);
<a name="l698"></a> </span><span class=cF5>SpriteEdUpdate</span><span class=cF0>(doc,doc_ce,head);
<a name="l699"></a> </span><span class=cF1>if</span><span class=cF0> (old_mesh) {
<a name="l700"></a> insert_pt=tmpg;
<a name="l701"></a> </span><span class=cF5>QueRem</span><span class=cF0>(tmpg1);
<a name="l702"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpg1);
<a name="l703"></a> </span><span class=cF5>SpriteEdUpdate</span><span class=cF0>(doc,doc_ce,head);
<a name="l704"></a> } </span><span class=cF1>else</span><span class=cF0>
<a name="l705"></a> *_cur_elem_num+=1;
<a name="l706"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (old_mesh &amp;&amp; tmpg1-&gt;type&amp;</span><span class=cF3>SPG_TYPE_MASK</span><span class=cF0>==</span><span class=cF3>SPT_SHIFTABLE_MESH</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l707"></a> x1=tmpg1-&gt;pmu.x;
<a name="l708"></a> y1=tmpg1-&gt;pmu.y;
<a name="l709"></a> z1=tmpg1-&gt;pmu.z;
<a name="l710"></a> p=&amp;tmpg1-&gt;pmu.u;
<a name="l711"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;tmpg1-&gt;pmu.vertex_cnt;i++,p++) {
<a name="l712"></a> p-&gt;x-=x1;
<a name="l713"></a> p-&gt;y-=y1;
<a name="l714"></a> p-&gt;z-=z1;
<a name="l715"></a> }
<a name="l716"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l717"></a>}
<a name="l718"></a>
<a name="l719"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>SMShiftableMesh</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF9>CDocEntry</span><span class=cF0> *doc_ce,</span><span class=cF9>CSprite</span><span class=cF0> *head,
<a name="l720"></a> </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> arg1,</span><span class=cF9>I64</span><span class=cF0> arg2,</span><span class=cF9>I64</span><span class=cF0> *_cur_elem_num)
<a name="l721"></a>{
<a name="l722"></a> </span><span class=cF9>CSprite</span><span class=cF0> *tmpg,*insert_pt=</span><span class=cF5>SpriteSetSettings</span><span class=cF0>(,head,*_cur_elem_num),
<a name="l723"></a> *tmpg1=insert_pt;
<a name="l724"></a> </span><span class=cF9>CD3I32</span><span class=cF0> *p;
<a name="l725"></a> </span><span class=cF9>I64</span><span class=cF0> i,size,z,x1,y1,z1;
<a name="l726"></a> </span><span class=cF9>I32</span><span class=cF0> *mesh,*old_mesh;
<a name="l727"></a> </span><span class=cF1>if</span><span class=cF0> (tmpg1!=head &amp;&amp; tmpg1-&gt;type&amp;</span><span class=cF3>SPG_TYPE_MASK</span><span class=cF0>==</span><span class=cF3>SPT_MESH</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l728"></a> z=0;
<a name="l729"></a> x1=-(arg1-x);
<a name="l730"></a> y1=-(arg2-y);
<a name="l731"></a> z1=z;
<a name="l732"></a> p=&amp;tmpg1-&gt;mu.u;
<a name="l733"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;tmpg1-&gt;mu.vertex_cnt;i++,p++) {
<a name="l734"></a> p-&gt;x+=x1;
<a name="l735"></a> p-&gt;y+=y1;
<a name="l736"></a> p-&gt;z+=z1;
<a name="l737"></a> }
<a name="l738"></a> old_mesh=&amp;tmpg1-&gt;mu.vertex_cnt;
<a name="l739"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (tmpg1!=head &amp;&amp; tmpg1-&gt;type&amp;</span><span class=cF3>SPG_TYPE_MASK</span><span class=cF0>==</span><span class=cF3>SPT_SHIFTABLE_MESH</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l740"></a> z=-tmpg1-&gt;pmu.z;
<a name="l741"></a> x1=tmpg1-&gt;pmu.x-(arg1-x);
<a name="l742"></a> y1=tmpg1-&gt;pmu.y-(arg2-y);
<a name="l743"></a> z1=tmpg1-&gt;pmu.z+z;
<a name="l744"></a> p=&amp;tmpg1-&gt;pmu.u;
<a name="l745"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;tmpg1-&gt;pmu.vertex_cnt;i++,p++) {
<a name="l746"></a> p-&gt;x+=x1;
<a name="l747"></a> p-&gt;y+=y1;
<a name="l748"></a> p-&gt;z+=z1;
<a name="l749"></a> }
<a name="l750"></a> old_mesh=&amp;tmpg1-&gt;pmu.vertex_cnt;
<a name="l751"></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="l752"></a> z=0;
<a name="l753"></a> old_mesh=</span><span class=cF3>NULL</span><span class=cF0>;
<a name="l754"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l755"></a> </span><span class=cF1>if</span><span class=cF0> (mesh=</span><span class=cF5>SpriteMeshEd</span><span class=cF7>(</span><span class=cF0>old_mesh,&amp;size,</span><span class=cF3>TRUE</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l756"></a> tmpg=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF3>SPT_SHIFTABLE_MESH</span><span class=cF7>)</span><span class=cF0>-</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>I32</span><span class=cF7>)</span><span class=cF0>*2+size);
<a name="l757"></a> tmpg-&gt;type=</span><span class=cF3>SPT_SHIFTABLE_MESH</span><span class=cF0>;
<a name="l758"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(&amp;tmpg-&gt;pmu.vertex_cnt,mesh,size);
<a name="l759"></a> </span><span class=cF5>Free</span><span class=cF0>(mesh);
<a name="l760"></a> tmpg-&gt;pmu.x=arg1-x;
<a name="l761"></a> tmpg-&gt;pmu.y=arg2-y;
<a name="l762"></a> tmpg-&gt;pmu.z=-z;
<a name="l763"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpg,insert_pt-&gt;last);
<a name="l764"></a> </span><span class=cF5>SpriteEdUpdate</span><span class=cF0>(doc,doc_ce,head);
<a name="l765"></a> </span><span class=cF1>if</span><span class=cF0> (old_mesh) {
<a name="l766"></a> insert_pt=tmpg;
<a name="l767"></a> </span><span class=cF5>QueRem</span><span class=cF0>(tmpg1);
<a name="l768"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpg1);
<a name="l769"></a> </span><span class=cF5>SpriteEdUpdate</span><span class=cF0>(doc,doc_ce,head);
<a name="l770"></a> } </span><span class=cF1>else</span><span class=cF0>
<a name="l771"></a> *_cur_elem_num+=1;
<a name="l772"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (old_mesh &amp;&amp; tmpg1-&gt;type&amp;</span><span class=cF3>SPG_TYPE_MASK</span><span class=cF0>==</span><span class=cF3>SPT_SHIFTABLE_MESH</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l773"></a> x1=tmpg1-&gt;pmu.x-(arg1-x);
<a name="l774"></a> y1=tmpg1-&gt;pmu.y-(arg2-y);
<a name="l775"></a> z1=tmpg1-&gt;pmu.z+z;
<a name="l776"></a> p=&amp;tmpg1-&gt;pmu.u;
<a name="l777"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;tmpg1-&gt;pmu.vertex_cnt;i++,p++) {
<a name="l778"></a> p-&gt;x-=x1;
<a name="l779"></a> p-&gt;y-=y1;
<a name="l780"></a> p-&gt;z-=z1;
<a name="l781"></a> }
<a name="l782"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (old_mesh &amp;&amp; tmpg1-&gt;type&amp;</span><span class=cF3>SPG_TYPE_MASK</span><span class=cF0>==</span><span class=cF3>SPT_MESH</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l783"></a> x1=-(arg1-x);
<a name="l784"></a> y1=-(arg2-y);
<a name="l785"></a> z1= z;
<a name="l786"></a> p=&amp;tmpg1-&gt;mu.u;
<a name="l787"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;tmpg1-&gt;mu.vertex_cnt;i++,p++) {
<a name="l788"></a> p-&gt;x-=x1;
<a name="l789"></a> p-&gt;y-=y1;
<a name="l790"></a> p-&gt;z-=z1;
<a name="l791"></a> }
<a name="l792"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l793"></a>}
<a name="l794"></a>
<a name="l795"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>SMTaskTitleSet</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> eletype)
<a name="l796"></a>{
<a name="l797"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;title_src=</span><span class=cF3>TTS_CONST</span><span class=cF0>; </span><span class=cF2>//Violates TTS_LOCKED_CONST</span><span class=cF0>
<a name="l798"></a> </span><span class=cF1>switch</span><span class=cF0> (eletype) </span><span class=cF7>{</span><span class=cF0>
<a name="l799"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_INS_SCRN_BITMAP</span><span class=cF0>:
<a name="l800"></a> </span><span class=cF5>StrCpy</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>-&gt;task_title,</span><span class=cF6>&quot;Insert Scrn BitMap&quot;</span><span class=cF0>);
<a name="l801"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l802"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_INS_TRANSPARENT_SCRN_BITMAP</span><span class=cF0>:
<a name="l803"></a> </span><span class=cF5>StrCpy</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>-&gt;task_title,</span><span class=cF6>&quot;Insert Transparent Scrn BitMap&quot;</span><span class=cF0>);
<a name="l804"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l805"></a> </span><span class=cF1>default</span><span class=cF0>:
<a name="l806"></a> </span><span class=cF1>if</span><span class=cF0> (eletype&gt;=0)
<a name="l807"></a> </span><span class=cF5>StrCpy</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>-&gt;task_title,</span><span class=cF5>DefineSub</span><span class=cF7>(</span><span class=cF0>eletype,</span><span class=cF6>&quot;ST_SPRITE_ELEM_TYPES&quot;</span><span class=cF7>)</span><span class=cF0>);
<a name="l808"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l809"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;border_src=</span><span class=cF3>BDS_CONST</span><span class=cF0>;
<a name="l810"></a>}
<a name="l811"></a>
<a name="l812"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>SpriteMainEd</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc)
<a name="l813"></a>{
<a name="l814"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_ce=doc-&gt;cur_entry;
<a name="l815"></a> </span><span class=cF9>I64</span><span class=cF0> res,i,x,y,arg1,arg2,xx,yy,xx1,yy1,xx2,yy2,thick,eletype=</span><span class=cF3>SPT_MENU</span><span class=cF0>,
<a name="l816"></a> cur_elem_num,old_border_src=</span><span class=cF5>Fs</span><span class=cF0>-&gt;border_src,old_title_src=</span><span class=cF5>Fs</span><span class=cF0>-&gt;title_src,
<a name="l817"></a> old_de_flags=doc_ce-&gt;de_flags;
<a name="l818"></a> </span><span class=cF9>CColorROPU32</span><span class=cF0> bm_bkcolor,color;
<a name="l819"></a> </span><span class=cF9>CSprite</span><span class=cF0> *head,*tmpg,*insert_pt;
<a name="l820"></a> </span><span class=cF9>CDC</span><span class=cF0> *dc=</span><span class=cF5>DCAlias</span><span class=cF0>(,</span><span class=cF5>Fs</span><span class=cF0>),*dc2=</span><span class=cF5>DCAlias</span><span class=cF0>(,</span><span class=cFB>sys_winmgr_task</span><span class=cF0>),*dc3;
<a name="l821"></a> </span><span class=cF1>U8</span><span class=cF0> *old_task_title=</span><span class=cF5>StrNew</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>-&gt;task_title);
<a name="l822"></a>
<a name="l823"></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="l824"></a> </span><span class=cF5>AutoComplete</span><span class=cF0>;
<a name="l825"></a> </span><span class=cF5>Refresh</span><span class=cF0>(2,</span><span class=cF3>TRUE</span><span class=cF0>);
<a name="l826"></a> dc2-&gt;flags|=</span><span class=cF3>DCF_ON_TOP</span><span class=cF0>;
<a name="l827"></a> head=</span><span class=cF5>Sprite2SpriteQue</span><span class=cF0>(doc_ce-&gt;bin_data-&gt;data);
<a name="l828"></a> cur_elem_num=</span><span class=cF5>QueCnt</span><span class=cF0>(head);
<a name="l829"></a> xx=(doc_ce-&gt;x+doc_ce-&gt;max_col-doc-&gt;line_start_col)*</span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
<a name="l830"></a> yy=(doc_ce-&gt;y-doc-&gt;top_line_num)*</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
<a name="l831"></a>
<a name="l832"></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="l833"></a> insert_pt=</span><span class=cF5>SpriteSetSettings</span><span class=cF0>(dc,head,cur_elem_num,xx,yy,
<a name="l834"></a> &amp;color,&amp;thick,&amp;x,&amp;y);
<a name="l835"></a> x+=xx; y+=yy;
<a name="l836"></a> </span><span class=cF5>DCFill</span><span class=cF0>;
<a name="l837"></a> </span><span class=cF1>if</span><span class=cF0> (eletype==</span><span class=cF3>SPT_MENU</span><span class=cF0>) {
<a name="l838"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;win_inhibit=</span><span class=cF3>WIG_TASK_DFT</span><span class=cF0>-</span><span class=cF3>WIF_SELF_FOCUS</span><span class=cF0>
<a name="l839"></a> -</span><span class=cF3>WIF_SELF_BORDER</span><span class=cF0>-</span><span class=cF3>WIF_SELF_GRAB_SCROLL</span><span class=cF0>;
<a name="l840"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>winmgr</span><span class=cF0>.fps&lt;10)
<a name="l841"></a> doc_ce-&gt;de_flags|=</span><span class=cF3>DOCEF_DONT_DRAW</span><span class=cF0>;
<a name="l842"></a> </span><span class=cF5>StrCpy</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>-&gt;task_title,old_task_title);
<a name="l843"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;border_src=old_border_src;
<a name="l844"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;title_src =old_title_src;
<a name="l845"></a>
<a name="l846"></a> xx-=</span><span class=cF5>StrLen</span><span class=cF0>(doc_ce-&gt;tag)*</span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
<a name="l847"></a> eletype=</span><span class=cF5>PopUpSpriteMain</span><span class=cF0>(&amp;head,&amp;cur_elem_num,doc,doc_ce);
<a name="l848"></a> xx+=</span><span class=cF5>StrLen</span><span class=cF0>(doc_ce-&gt;tag)*</span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
<a name="l849"></a> insert_pt=</span><span class=cF5>SpriteSetSettings</span><span class=cF0>(dc,head,cur_elem_num,x,y,
<a name="l850"></a> &amp;color,&amp;thick,&amp;x,&amp;y);
<a name="l851"></a> x+=xx; y+=yy;
<a name="l852"></a>
<a name="l853"></a> </span><span class=cF5>SpriteEdUpdate</span><span class=cF0>(doc,doc_ce,head);
<a name="l854"></a> </span><span class=cF1>switch</span><span class=cF0> (eletype) </span><span class=cF7>{</span><span class=cF0>
<a name="l855"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_FLOOD_FILL</span><span class=cF0>:
<a name="l856"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_FLOOD_FILL_NOT</span><span class=cF0>:
<a name="l857"></a> </span><span class=cF5>RegOneTimePopUp</span><span class=cF0>(</span><span class=cF3>ARf_FLOODFILL</span><span class=cF0>,
<a name="l858"></a> </span><span class=cF3>ST_WARN_ST</span><span class=cF0> </span><span class=cF6>&quot;This is affected by what's underneath\n&quot;</span><span class=cF0>
<a name="l859"></a> </span><span class=cF6>&quot;when it is drawn. You will probably want to\n&quot;</span><span class=cF0>
<a name="l860"></a> </span><span class=cF6>&quot;convert it to a bitmap.\n\n&quot;</span><span class=cF0>
<a name="l861"></a> </span><span class=cF6>&quot;A tip on artistry you might consider\n&quot;</span><span class=cF0>
<a name="l862"></a> </span><span class=cF6>&quot;is using lines to fill regions because\n&quot;</span><span class=cF0>
<a name="l863"></a> </span><span class=cF6>&quot;brush strokes look cool.\n&quot;</span><span class=cF0>);
<a name="l864"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l865"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_PLANAR_SYMMETRY</span><span class=cF0>:
<a name="l866"></a> </span><span class=cF5>RegOneTimePopUp</span><span class=cF0>(</span><span class=cF3>ARf_PLANAR_SYMMETRY</span><span class=cF0>,
<a name="l867"></a> </span><span class=cF6>&quot;Right-click to turn-off symmetry.\n&quot;</span><span class=cF0>);
<a name="l868"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l869"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l870"></a> doc_ce-&gt;de_flags=old_de_flags;
<a name="l871"></a> }
<a name="l872"></a> </span><span class=cF5>SMTaskTitleSet</span><span class=cF0>(eletype);
<a name="l873"></a> </span><span class=cF1>switch</span><span class=cF0> (eletype) {
<a name="l874"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_COLOR</span><span class=cF0>:
<a name="l875"></a> doc_ce-&gt;de_flags|=</span><span class=cF3>DOCEF_DONT_DRAW</span><span class=cF0>;
<a name="l876"></a> i=</span><span class=cF5>PopUpColor</span><span class=cF0>(,,</span><span class=cF3>FALSE</span><span class=cF0>);
<a name="l877"></a> </span><span class=cF1>if</span><span class=cF0> (i&gt;=0) </span><span class=cF7>{</span><span class=cF0>
<a name="l878"></a> color=i;
<a name="l879"></a> tmpg=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF3>SPT_COLOR</span><span class=cF7>)</span><span class=cF0>);
<a name="l880"></a> tmpg-&gt;type=</span><span class=cF3>SPT_COLOR</span><span class=cF0>;
<a name="l881"></a> tmpg-&gt;c.color=color;
<a name="l882"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpg,insert_pt-&gt;last);
<a name="l883"></a> </span><span class=cF5>SpriteEdUpdate</span><span class=cF0>(doc,doc_ce,head);
<a name="l884"></a> cur_elem_num++;
<a name="l885"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l886"></a> doc_ce-&gt;de_flags=old_de_flags;
<a name="l887"></a> eletype=</span><span class=cF3>SPT_MENU</span><span class=cF0>;
<a name="l888"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l889"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_DITHER_COLOR</span><span class=cF0>:
<a name="l890"></a> doc_ce-&gt;de_flags|=</span><span class=cF3>DOCEF_DONT_DRAW</span><span class=cF0>;
<a name="l891"></a> i=</span><span class=cF5>PopUpColorDither</span><span class=cF0>;
<a name="l892"></a> </span><span class=cF1>if</span><span class=cF0> (i&gt;=0) </span><span class=cF7>{</span><span class=cF0>
<a name="l893"></a> color=i;
<a name="l894"></a> tmpg=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF3>SPT_DITHER_COLOR</span><span class=cF7>)</span><span class=cF0>);
<a name="l895"></a> tmpg-&gt;type=</span><span class=cF3>SPT_DITHER_COLOR</span><span class=cF0>;
<a name="l896"></a> tmpg-&gt;d.dither_color=color.c0.color|color.c1.color&lt;&lt;8;
<a name="l897"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpg,insert_pt-&gt;last);
<a name="l898"></a> </span><span class=cF5>SpriteEdUpdate</span><span class=cF0>(doc,doc_ce,head);
<a name="l899"></a> cur_elem_num++;
<a name="l900"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l901"></a> doc_ce-&gt;de_flags=old_de_flags;
<a name="l902"></a> eletype=</span><span class=cF3>SPT_MENU</span><span class=cF0>;
<a name="l903"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l904"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_ED_MENU</span><span class=cF0>:
<a name="l905"></a> </span><span class=cF1>switch</span><span class=cF0> (</span><span class=cF5>SpriteEd</span><span class=cF7>(</span><span class=cF0>doc,doc_ce,x,y,&amp;head,&amp;cur_elem_num</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l906"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPE_ABORT</span><span class=cF0>: eletype=</span><span class=cF3>DOCM_CANCEL</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
<a name="l907"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPE_EXIT</span><span class=cF0>: eletype=</span><span class=cF3>SPT_EXIT</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
<a name="l908"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPE_CONT</span><span class=cF0>: eletype=</span><span class=cF3>SPT_MENU</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
<a name="l909"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l910"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l911"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_MESH</span><span class=cF0>:
<a name="l912"></a> doc_ce-&gt;de_flags|=</span><span class=cF3>DOCEF_DONT_DRAW</span><span class=cF0>;
<a name="l913"></a> </span><span class=cF5>SMMesh</span><span class=cF0>(doc,doc_ce,head,&amp;cur_elem_num);
<a name="l914"></a> doc_ce-&gt;de_flags=old_de_flags;
<a name="l915"></a> eletype=</span><span class=cF3>SPT_MENU</span><span class=cF0>;
<a name="l916"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l917"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_SHIFTABLE_MESH</span><span class=cF0>:
<a name="l918"></a> doc_ce-&gt;de_flags|=</span><span class=cF3>DOCEF_DONT_DRAW</span><span class=cF0>;
<a name="l919"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>PopUpNoYes</span><span class=cF7>(</span><span class=cF6>&quot;Study the $LK,\&quot;X-Caliber\&quot;,&quot;</span><span class=cF0>
<a name="l920"></a> </span><span class=cF6>&quot;A=\&quot;FF:::/PersonalMenu.DD.Z,X-Caliber\&quot;$ icon.\n\n&quot;</span><span class=cF0>
<a name="l921"></a> </span><span class=cF6>&quot;It has black rectangle background with stars. The\n&quot;</span><span class=cF0>
<a name="l922"></a> </span><span class=cF6>&quot;mesh is in front and rotates. To keep the background\n&quot;</span><span class=cF0>
<a name="l923"></a> </span><span class=cF6>&quot;rectangle from rotating, &quot;</span><span class=cF0>
<a name="l924"></a> </span><span class=cF6>&quot;$GREEN$TRANSFORM OFF$FG$ has been used.\n\n&quot;</span><span class=cF0>
<a name="l925"></a> </span><span class=cF6>&quot;The X-Caliber mesh has a different origin for rotation.\n&quot;</span><span class=cF0>
<a name="l926"></a> </span><span class=cF6>&quot;To avoid clipping, it also has also been moved in the\n&quot;</span><span class=cF0>
<a name="l927"></a> </span><span class=cF6>&quot;negative Z direction by editing the sprite as text\n&quot;</span><span class=cF0>
<a name="l928"></a> </span><span class=cF6>&quot;and changing the first vector.\n\n&quot;</span><span class=cF0>
<a name="l929"></a> </span><span class=cF6>&quot;For the mesh you are creating, use same origin as\n&quot;</span><span class=cF0>
<a name="l930"></a> </span><span class=cF6>&quot;the rest of the sprite? If $GREEN$YES$FG$, you can always\n&quot;</span><span class=cF0>
<a name="l931"></a> </span><span class=cF6>&quot;shift the mesh origin point in the sprite edit menu.\n&quot;</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l932"></a> doc_ce-&gt;de_flags=old_de_flags;
<a name="l933"></a> arg1=x; arg2=y;
<a name="l934"></a> </span><span class=cF5>SMShiftableMesh</span><span class=cF0>(doc,doc_ce,head,x,y,arg1,arg2,&amp;cur_elem_num);
<a name="l935"></a> eletype=</span><span class=cF3>SPT_MENU</span><span class=cF0>;
<a name="l936"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l937"></a> </span><span class=cF5>PopUpOk</span><span class=cF0>(</span><span class=cF6>&quot;Select Origin.\n&quot;</span><span class=cF0>);
<a name="l938"></a> doc_ce-&gt;de_flags=old_de_flags;
<a name="l939"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l940"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_INS_SCRN_BITMAP</span><span class=cF0>:
<a name="l941"></a> doc_ce-&gt;de_flags|=</span><span class=cF3>DOCEF_DONT_DRAW</span><span class=cF0>;
<a name="l942"></a> </span><span class=cF5>PopUpOk</span><span class=cF0>(</span><span class=cF6>&quot;Drag-out a rect for the extents of the\nbitmap.\n&quot;</span><span class=cF0>);
<a name="l943"></a> doc_ce-&gt;de_flags=old_de_flags;
<a name="l944"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;win_inhibit=</span><span class=cF3>WIG_TASK_DFT</span><span class=cF0>|</span><span class=cF3>WIF_FOCUS_TASK_MS_L</span><span class=cF0>|</span><span class=cF3>WIF_FOCUS_TASK_MS_R</span><span class=cF0>|
<a name="l945"></a> </span><span class=cF3>WIF_FOCUS_TASK_BORDER</span><span class=cF0>-</span><span class=cF3>WIF_SELF_FOCUS</span><span class=cF0>-</span><span class=cF3>WIF_SELF_GRAB_SCROLL</span><span class=cF0>;
<a name="l946"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l947"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_BITMAP</span><span class=cF0>:
<a name="l948"></a> doc_ce-&gt;de_flags|=</span><span class=cF3>DOCEF_DONT_DRAW</span><span class=cF0>;
<a name="l949"></a> i=</span><span class=cF5>PopUpColor</span><span class=cF0>(</span><span class=cF6>&quot;Background Color\n\n&quot;</span><span class=cF0>,,</span><span class=cF3>FALSE</span><span class=cF0>);
<a name="l950"></a> </span><span class=cF1>if</span><span class=cF0> (i&lt;0)
<a name="l951"></a> eletype=</span><span class=cF3>SPT_MENU</span><span class=cF0>;
<a name="l952"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l953"></a> bm_bkcolor=i;
<a name="l954"></a> </span><span class=cF5>SpriteEdUpdate</span><span class=cF0>(doc,doc_ce,head);
<a name="l955"></a> </span><span class=cF5>SpriteExtents</span><span class=cF0>(doc_ce-&gt;bin_data-&gt;data,&amp;xx1,&amp;xx2,&amp;yy1,&amp;yy2);
<a name="l956"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>xx1&lt;=xx2 &amp;&amp; yy1&lt;=yy2</span><span class=cF7>)</span><span class=cF0>)
<a name="l957"></a> xx1=xx2=yy1=yy2=0;
<a name="l958"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>PopUpExtents</span><span class=cF7>(</span><span class=cF0>&amp;xx1,&amp;xx2,&amp;yy1,&amp;yy2</span><span class=cF7>)</span><span class=cF0>) {
<a name="l959"></a> doc_ce-&gt;de_flags=old_de_flags;
<a name="l960"></a> xx1+=xx; yy1+=yy;
<a name="l961"></a> xx2+=xx; yy2+=yy;
<a name="l962"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>SMBitMap</span><span class=cF7>(</span><span class=cF0>eletype,doc,doc_ce,head,dc,xx,yy,arg1,arg2,bm_bkcolor,
<a name="l963"></a> </span><span class=cF3>FALSE</span><span class=cF0>,xx1,yy1,xx2,yy2,&amp;cur_elem_num</span><span class=cF7>)</span><span class=cF0>==</span><span class=cF3>SPE_EXIT</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l964"></a> res=</span><span class=cF3>SPE_EXIT</span><span class=cF0>;
<a name="l965"></a> </span><span class=cF1>goto</span><span class=cF0> ei_done;
<a name="l966"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l967"></a> eletype=</span><span class=cF3>SPT_MENU</span><span class=cF0>;
<a name="l968"></a> }
<a name="l969"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l970"></a> doc_ce-&gt;de_flags=old_de_flags;
<a name="l971"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l972"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_INS_TRANSPARENT_SCRN_BITMAP</span><span class=cF0>:
<a name="l973"></a> doc_ce-&gt;de_flags|=</span><span class=cF3>DOCEF_DONT_DRAW</span><span class=cF0>;
<a name="l974"></a> i=</span><span class=cF5>PopUpColor</span><span class=cF0>(</span><span class=cF6>&quot;Color to Become Transparent\n\n&quot;</span><span class=cF0>,,</span><span class=cF3>FALSE</span><span class=cF0>);
<a name="l975"></a> </span><span class=cF1>if</span><span class=cF0> (i&lt;0)
<a name="l976"></a> eletype=</span><span class=cF3>SPT_MENU</span><span class=cF0>;
<a name="l977"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l978"></a> bm_bkcolor=i;
<a name="l979"></a> </span><span class=cF5>PopUpOk</span><span class=cF0>(</span><span class=cF6>&quot;Drag-out a rect for the extents of the\nbitmap.\n&quot;</span><span class=cF0>);
<a name="l980"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l981"></a> doc_ce-&gt;de_flags=old_de_flags;
<a name="l982"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;win_inhibit=</span><span class=cF3>WIG_TASK_DFT</span><span class=cF0>|</span><span class=cF3>WIF_FOCUS_TASK_MS_L</span><span class=cF0>|</span><span class=cF3>WIF_FOCUS_TASK_MS_R</span><span class=cF0>|
<a name="l983"></a> </span><span class=cF3>WIF_FOCUS_TASK_BORDER</span><span class=cF0>-</span><span class=cF3>WIF_SELF_FOCUS</span><span class=cF0>-</span><span class=cF3>WIF_SELF_GRAB_SCROLL</span><span class=cF0>;
<a name="l984"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l985"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_THICK</span><span class=cF0>:
<a name="l986"></a> doc_ce-&gt;de_flags|=</span><span class=cF3>DOCEF_DONT_DRAW</span><span class=cF0>;
<a name="l987"></a> i=</span><span class=cF5>PopUpRangeI64</span><span class=cF0>(1,16,1,</span><span class=cF6>&quot;Thick\n&quot;</span><span class=cF0>);
<a name="l988"></a> </span><span class=cF1>if</span><span class=cF0> (i&gt;=1) </span><span class=cF7>{</span><span class=cF0>
<a name="l989"></a> thick=i;
<a name="l990"></a> tmpg=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF3>SPT_THICK</span><span class=cF7>)</span><span class=cF0>);
<a name="l991"></a> tmpg-&gt;type=</span><span class=cF3>SPT_THICK</span><span class=cF0>;
<a name="l992"></a> tmpg-&gt;t.thick=thick;
<a name="l993"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpg,insert_pt-&gt;last);
<a name="l994"></a> </span><span class=cF5>SpriteEdUpdate</span><span class=cF0>(doc,doc_ce,head);
<a name="l995"></a> cur_elem_num++;
<a name="l996"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l997"></a> doc_ce-&gt;de_flags=old_de_flags;
<a name="l998"></a> eletype=</span><span class=cF3>SPT_MENU</span><span class=cF0>;
<a name="l999"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1000"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_TRANSFORM_ON</span><span class=cF0>:
<a name="l1001"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_TRANSFORM_OFF</span><span class=cF0>:
<a name="l1002"></a> tmpg=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF3>SPT_TRANSFORM_ON</span><span class=cF7>)</span><span class=cF0>);
<a name="l1003"></a> </span><span class=cF1>if</span><span class=cF0> (eletype==</span><span class=cF3>SPT_TRANSFORM_ON</span><span class=cF0>)
<a name="l1004"></a> tmpg-&gt;type=</span><span class=cF3>SPT_TRANSFORM_ON</span><span class=cF0>;
<a name="l1005"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1006"></a> tmpg-&gt;type=</span><span class=cF3>SPT_TRANSFORM_OFF</span><span class=cF0>;
<a name="l1007"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpg,insert_pt-&gt;last);
<a name="l1008"></a> </span><span class=cF5>SpriteEdUpdate</span><span class=cF0>(doc,doc_ce,head);
<a name="l1009"></a> cur_elem_num++;
<a name="l1010"></a> eletype=</span><span class=cF3>SPT_MENU</span><span class=cF0>;
<a name="l1011"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1012"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_POLYGON</span><span class=cF0>:
<a name="l1013"></a> doc_ce-&gt;de_flags|=</span><span class=cF3>DOCEF_DONT_DRAW</span><span class=cF0>;
<a name="l1014"></a> i=</span><span class=cF5>PopUpRangeI64</span><span class=cF0>(3,16,1,</span><span class=cF6>&quot;Num of Sides\n&quot;</span><span class=cF0>);
<a name="l1015"></a> doc_ce-&gt;de_flags=old_de_flags;
<a name="l1016"></a> </span><span class=cF1>if</span><span class=cF0> (i&lt;3)
<a name="l1017"></a> eletype=</span><span class=cF3>SPT_MENU</span><span class=cF0>;
<a name="l1018"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1019"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_TEXT</span><span class=cF0>:
<a name="l1020"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_TEXT_BOX</span><span class=cF0>:
<a name="l1021"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_TEXT_DIAMOND</span><span class=cF0>:
<a name="l1022"></a> </span><span class=cF5>SMTextFamily</span><span class=cF0>(eletype,doc,doc_ce,head,dc,xx,yy,arg1,arg2,
<a name="l1023"></a> color,&amp;cur_elem_num,old_de_flags);
<a name="l1024"></a> eletype=</span><span class=cF3>SPT_MENU</span><span class=cF0>;
<a name="l1025"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1026"></a> }
<a name="l1027"></a>
<a name="l1028"></a> </span><span class=cF1>if</span><span class=cF0> (eletype!=</span><span class=cF3>SPT_MENU</span><span class=cF0>) {
<a name="l1029"></a> insert_pt=</span><span class=cF5>SpriteSetSettings</span><span class=cF0>(dc,head,cur_elem_num,xx,yy,
<a name="l1030"></a> &amp;color,&amp;thick,&amp;x,&amp;y);
<a name="l1031"></a> x+=xx; y+=yy;
<a name="l1032"></a> </span><span class=cF5>SpriteScrnInit</span><span class=cF0>(dc,x,y);
<a name="l1033"></a> </span><span class=cF1>if</span><span class=cF0> (eletype==</span><span class=cF3>SPT_EXIT</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1034"></a> res=</span><span class=cF3>SPE_EXIT</span><span class=cF0>;
<a name="l1035"></a> </span><span class=cF1>goto</span><span class=cF0> ei_done;
<a name="l1036"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (eletype==</span><span class=cF3>DOCM_CANCEL</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1037"></a> res=</span><span class=cF3>SPE_ABORT</span><span class=cF0>;
<a name="l1038"></a> </span><span class=cF1>goto</span><span class=cF0> ei_done;
<a name="l1039"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1040"></a> </span><span class=cF1>switch</span><span class=cF0> (</span><span class=cF5>GetMsg</span><span class=cF7>(</span><span class=cF0>&amp;arg1,&amp;arg2,
<a name="l1041"></a> 1&lt;&lt;</span><span class=cF3>MSG_KEY_DOWN</span><span class=cF0>|1&lt;&lt;</span><span class=cF3>MSG_MS_R_UP</span><span class=cF0>|1&lt;&lt;</span><span class=cF3>MSG_MS_L_DOWN</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1042"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MSG_KEY_DOWN</span><span class=cF0>:
<a name="l1043"></a> </span><span class=cF1>switch</span><span class=cF0> (arg1) {
<a name="l1044"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_ESC</span><span class=cF0>:
<a name="l1045"></a> res=</span><span class=cF3>SPE_EXIT</span><span class=cF0>;
<a name="l1046"></a> </span><span class=cF1>goto</span><span class=cF0> ei_done;
<a name="l1047"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_SHIFT_ESC</span><span class=cF0>:
<a name="l1048"></a> res=</span><span class=cF3>SPE_ABORT</span><span class=cF0>;
<a name="l1049"></a> </span><span class=cF1>goto</span><span class=cF0> ei_done;
<a name="l1050"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'c'</span><span class=cF0>: </span><span class=cF2>//eye-dropper</span><span class=cF0>
<a name="l1051"></a> dc3=</span><span class=cF5>DCScrnCapture</span><span class=cF0>(</span><span class=cF3>FALSE</span><span class=cF0>);
<a name="l1052"></a> color=</span><span class=cF5>GrPeek</span><span class=cF0>(dc3,</span><span class=cFB>ms</span><span class=cF0>.pos.x,</span><span class=cFB>ms</span><span class=cF0>.pos.y)^15;</span><span class=cF2>//Mouse cursor is XORed.</span><span class=cF0>
<a name="l1053"></a> </span><span class=cF5>DCDel</span><span class=cF0>(dc3);
<a name="l1054"></a> tmpg=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF3>SPT_COLOR</span><span class=cF7>)</span><span class=cF0>);
<a name="l1055"></a> tmpg-&gt;type=</span><span class=cF3>SPT_COLOR</span><span class=cF0>;
<a name="l1056"></a> tmpg-&gt;c.color=color;
<a name="l1057"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpg,insert_pt-&gt;last);
<a name="l1058"></a> </span><span class=cF5>SpriteEdUpdate</span><span class=cF0>(doc,doc_ce,head);
<a name="l1059"></a> cur_elem_num++;
<a name="l1060"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1061"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'t'</span><span class=cF0>: </span><span class=cF2>//Set to transparent color</span><span class=cF0>
<a name="l1062"></a> tmpg=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF3>SPT_COLOR</span><span class=cF7>)</span><span class=cF0>);
<a name="l1063"></a> tmpg-&gt;type=</span><span class=cF3>SPT_COLOR</span><span class=cF0>;
<a name="l1064"></a> tmpg-&gt;c.color=</span><span class=cF3>TRANSPARENT</span><span class=cF0>;
<a name="l1065"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpg,insert_pt-&gt;last);
<a name="l1066"></a> </span><span class=cF5>SpriteEdUpdate</span><span class=cF0>(doc,doc_ce,head);
<a name="l1067"></a> cur_elem_num++;
<a name="l1068"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1069"></a> }
<a name="l1070"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1071"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MSG_MS_R_UP</span><span class=cF0>:
<a name="l1072"></a> </span><span class=cF1>if</span><span class=cF0> (eletype==</span><span class=cF3>SPT_PLANAR_SYMMETRY</span><span class=cF0>) {
<a name="l1073"></a> tmpg=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF3>SPT_PLANAR_SYMMETRY</span><span class=cF7>)</span><span class=cF0>);
<a name="l1074"></a> tmpg-&gt;type=</span><span class=cF3>SPT_PLANAR_SYMMETRY</span><span class=cF0>;
<a name="l1075"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpg,insert_pt-&gt;last);
<a name="l1076"></a> </span><span class=cF5>SpriteEdUpdate</span><span class=cF0>(doc,doc_ce,head);
<a name="l1077"></a> cur_elem_num++;
<a name="l1078"></a> eletype=</span><span class=cF3>SPT_MENU</span><span class=cF0>;
<a name="l1079"></a> } </span><span class=cF1>else</span><span class=cF0>
<a name="l1080"></a> eletype=</span><span class=cF3>SPT_MENU</span><span class=cF0>;
<a name="l1081"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1082"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MSG_MS_L_DOWN</span><span class=cF0>:
<a name="l1083"></a> </span><span class=cF1>switch</span><span class=cF0> (eletype) {
<a name="l1084"></a> </span><span class=cF1>start</span><span class=cF0>:
<a name="l1085"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_LINE</span><span class=cF0>:
<a name="l1086"></a> tmpg=</span><span class=cF5>SMLine</span><span class=cF0>(dc,x,y,arg1,arg2,color);
<a name="l1087"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1088"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_ARROW</span><span class=cF0>:
<a name="l1089"></a> tmpg=</span><span class=cF5>SMArrow</span><span class=cF0>(dc,x,y,arg1,arg2,color);
<a name="l1090"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1091"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_PLANAR_SYMMETRY</span><span class=cF0>:
<a name="l1092"></a> tmpg=</span><span class=cF5>SMPlanarSymmetry</span><span class=cF0>(dc,x,y,arg1,arg2);
<a name="l1093"></a> eletype=</span><span class=cF3>SPT_MENU</span><span class=cF0>;
<a name="l1094"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1095"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_RECT</span><span class=cF0>:
<a name="l1096"></a> tmpg=</span><span class=cF5>SMRect</span><span class=cF0>(dc,x,y,arg1,arg2,color);
<a name="l1097"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1098"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_INS_SCRN_BITMAP</span><span class=cF0>:
<a name="l1099"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_INS_TRANSPARENT_SCRN_BITMAP</span><span class=cF0>:
<a name="l1100"></a> tmpg=</span><span class=cF5>SMScrnBitMap</span><span class=cF0>(eletype,dc,dc2,x,y,arg1,arg2,bm_bkcolor);
<a name="l1101"></a> eletype=</span><span class=cF3>SPT_MENU</span><span class=cF0>;
<a name="l1102"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1103"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_CIRCLE</span><span class=cF0>:
<a name="l1104"></a> tmpg=</span><span class=cF5>SMCircle</span><span class=cF0>(dc,x,y,arg1,arg2,color);
<a name="l1105"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1106"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_ELLIPSE</span><span class=cF0>:
<a name="l1107"></a> tmpg=</span><span class=cF5>SMEllipse</span><span class=cF0>(dc,x,y,arg1,arg2,color);
<a name="l1108"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1109"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_POLYGON</span><span class=cF0>:
<a name="l1110"></a> tmpg=</span><span class=cF5>SMPolygon</span><span class=cF0>(dc,x,y,arg1,arg2,i,color);
<a name="l1111"></a> eletype=</span><span class=cF3>SPT_MENU</span><span class=cF0>;
<a name="l1112"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1113"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_PT</span><span class=cF0>:
<a name="l1114"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_FLOOD_FILL</span><span class=cF0>:
<a name="l1115"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_FLOOD_FILL_NOT</span><span class=cF0>:
<a name="l1116"></a> tmpg=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF5>SpriteElemQuedBaseSize</span><span class=cF7>(</span><span class=cF0>eletype</span><span class=cF7>)</span><span class=cF0>);
<a name="l1117"></a> tmpg-&gt;type=eletype;
<a name="l1118"></a> tmpg-&gt;p.x1=arg1-x;
<a name="l1119"></a> tmpg-&gt;p.y1=arg2-y;
<a name="l1120"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1121"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_POLYLINE</span><span class=cF0>:
<a name="l1122"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_BSPLINE2</span><span class=cF0>:
<a name="l1123"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_BSPLINE3</span><span class=cF0>:
<a name="l1124"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_BSPLINE2_CLOSED</span><span class=cF0>:
<a name="l1125"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_BSPLINE3_CLOSED</span><span class=cF0>:
<a name="l1126"></a> tmpg=</span><span class=cF5>SMPolyLineFamily</span><span class=cF0>(eletype,dc,x,y,arg1,arg2,color);
<a name="l1127"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1128"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_POLYPT</span><span class=cF0>:
<a name="l1129"></a> tmpg=</span><span class=cF5>SMPolyPoint</span><span class=cF0>(dc,x,y,arg1,arg2,color);
<a name="l1130"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1131"></a> </span><span class=cF1>end</span><span class=cF0>:
<a name="l1132"></a> </span><span class=cF1>if</span><span class=cF0> (tmpg) </span><span class=cF7>{</span><span class=cF0>
<a name="l1133"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpg,insert_pt-&gt;last);
<a name="l1134"></a> </span><span class=cF5>SpriteEdUpdate</span><span class=cF0>(doc,doc_ce,head);
<a name="l1135"></a> cur_elem_num++;
<a name="l1136"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1137"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1138"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_BITMAP</span><span class=cF0>:
<a name="l1139"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>SMBitMap</span><span class=cF7>(</span><span class=cF0>eletype,doc,doc_ce,head,dc,xx,yy,
<a name="l1140"></a> arg1,arg2,bm_bkcolor,</span><span class=cF3>TRUE</span><span class=cF0>,,,,,&amp;cur_elem_num</span><span class=cF7>)</span><span class=cF0>==</span><span class=cF3>SPE_EXIT</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1141"></a> res=</span><span class=cF3>SPE_EXIT</span><span class=cF0>;
<a name="l1142"></a> </span><span class=cF1>goto</span><span class=cF0> ei_done;
<a name="l1143"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1144"></a> doc_ce-&gt;de_flags=old_de_flags;
<a name="l1145"></a> eletype=</span><span class=cF3>SPT_MENU</span><span class=cF0>;
<a name="l1146"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1147"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SPT_SHIFTABLE_MESH</span><span class=cF0>:
<a name="l1148"></a> </span><span class=cF5>GetMsg</span><span class=cF0>(</span><span class=cF3>NULL</span><span class=cF0>,</span><span class=cF3>NULL</span><span class=cF0>,1&lt;&lt;</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>);
<a name="l1149"></a> doc_ce-&gt;de_flags|=</span><span class=cF3>DOCEF_DONT_DRAW</span><span class=cF0>;
<a name="l1150"></a> </span><span class=cF5>SMShiftableMesh</span><span class=cF0>(doc,doc_ce,head,x,y,arg1,arg2,&amp;cur_elem_num);
<a name="l1151"></a> doc_ce-&gt;de_flags=old_de_flags;
<a name="l1152"></a> eletype=</span><span class=cF3>SPT_MENU</span><span class=cF0>;
<a name="l1153"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1154"></a> }
<a name="l1155"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1156"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1157"></a> }
<a name="l1158"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1159"></a>ei_done:
<a name="l1160"></a> </span><span class=cF5>DCFill</span><span class=cF0>;
<a name="l1161"></a> </span><span class=cF5>SettingsPop</span><span class=cF0>;
<a name="l1162"></a> doc_ce-&gt;de_flags=old_de_flags;
<a name="l1163"></a> </span><span class=cF5>DCDel</span><span class=cF0>(dc);
<a name="l1164"></a> </span><span class=cF5>DCDel</span><span class=cF0>(dc2);
<a name="l1165"></a> </span><span class=cF5>StrCpy</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>-&gt;task_title,old_task_title);
<a name="l1166"></a> </span><span class=cF5>Free</span><span class=cF0>(old_task_title);
<a name="l1167"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;border_src=old_border_src;
<a name="l1168"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;title_src =old_title_src;
<a name="l1169"></a> </span><span class=cF5>QueDel</span><span class=cF0>(head);
<a name="l1170"></a> </span><span class=cF5>Free</span><span class=cF0>(head);
<a name="l1171"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l1172"></a>}
<a name="l1173"></a>
<a name="l1174"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>EdSpriteIns</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc)
<a name="l1175"></a>{
<a name="l1176"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock;
<a name="l1177"></a> </span><span class=cF1>U8</span><span class=cF0> *st;
<a name="l1178"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e;
<a name="l1179"></a> </span><span class=cF9>CDocBin</span><span class=cF0> *tmpb;
<a name="l1180"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Fs</span><span class=cF0>!=doc-&gt;mem_task)
<a name="l1181"></a> </span><span class=cF5>throw</span><span class=cF0>(</span><span class=cF6>'Graphics'</span><span class=cF0>);
<a name="l1182"></a> </span><span class=cF1>if</span><span class=cF0> (st=</span><span class=cF5>EdSprite</span><span class=cF7>(</span><span class=cF0>doc-&gt;cur_bin_num</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1183"></a> unlock=</span><span class=cF5>DocLock</span><span class=cF0>(doc);
<a name="l1184"></a> tmpb=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CDocBin</span><span class=cF7>)</span><span class=cF0>,doc-&gt;mem_task);
<a name="l1185"></a> tmpb-&gt;size=</span><span class=cFB>sprite_elem_base_sizes</span><span class=cF0>[</span><span class=cF3>SPT_END</span><span class=cF0>];
<a name="l1186"></a> tmpb-&gt;data=</span><span class=cF5>CAlloc</span><span class=cF0>(tmpb-&gt;size,doc-&gt;mem_task);
<a name="l1187"></a> tmpb-&gt;num=doc-&gt;cur_bin_num++;
<a name="l1188"></a> tmpb-&gt;use_cnt=1;
<a name="l1189"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpb,doc-&gt;bin_head.last);
<a name="l1190"></a> doc_e=</span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot;%s&quot;</span><span class=cF0>,st);
<a name="l1191"></a> doc_e-&gt;bin_data=tmpb;
<a name="l1192"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l1193"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e) {
<a name="l1194"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e-&gt;de_flags&amp;</span><span class=cF3>DOCEF_TAG</span><span class=cF0> &amp;&amp; doc_e-&gt;tag &amp;&amp; *doc_e-&gt;tag)
<a name="l1195"></a> tmpb-&gt;tag=</span><span class=cF5>StrNew</span><span class=cF0>(doc_e-&gt;tag,doc-&gt;mem_task);
<a name="l1196"></a> doc-&gt;cur_entry=doc_e;
<a name="l1197"></a> doc-&gt;cur_col=0;
<a name="l1198"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
<a name="l1199"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc);
<a name="l1200"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>SpriteMainEd</span><span class=cF7>(</span><span class=cF0>doc</span><span class=cF7>)</span><span class=cF0>==</span><span class=cF3>SPE_ABORT</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1201"></a> </span><span class=cF5>DocLock</span><span class=cF0>(doc);
<a name="l1202"></a> </span><span class=cF5>DocEntryDel</span><span class=cF0>(doc,doc_e);
<a name="l1203"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l1204"></a> </span><span class=cF5>SpriteSelAll</span><span class=cF0>(tmpb-&gt;data,</span><span class=cF3>FALSE</span><span class=cF0>);
<a name="l1205"></a> } </span><span class=cF1>else</span><span class=cF0>
<a name="l1206"></a> </span><span class=cF5>DocBinDel</span><span class=cF0>(doc,tmpb);
<a name="l1207"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
<a name="l1208"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
<a name="l1209"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1210"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>doc-&gt;flags &amp; (</span><span class=cF3>DOCF_PLAIN_TEXT</span><span class=cF0>|</span><span class=cF3>DOCF_PLAIN_TEXT_TABS</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>)
<a name="l1211"></a> </span><span class=cF5>DocBinsValidate</span><span class=cF0>(doc);
<a name="l1212"></a>}
<a name="l1213"></a>
<a name="l1214"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>EdSpriteEd</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc)
<a name="l1215"></a>{
<a name="l1216"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_ce;
<a name="l1217"></a> </span><span class=cF9>CDocBin</span><span class=cF0> *tmpb;
<a name="l1218"></a> </span><span class=cF9>CSprite</span><span class=cF0> *old_csprite;
<a name="l1219"></a> </span><span class=cF9>I64</span><span class=cF0> old_size;
<a name="l1220"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock=</span><span class=cF5>DocLock</span><span class=cF0>(doc);
<a name="l1221"></a> doc_ce=doc-&gt;cur_entry;
<a name="l1222"></a> tmpb=doc_ce-&gt;bin_data;
<a name="l1223"></a> old_size=tmpb-&gt;size;
<a name="l1224"></a> old_csprite=tmpb-&gt;data;
<a name="l1225"></a> tmpb-&gt;data=</span><span class=cF5>MAllocIdent</span><span class=cF0>(old_csprite,doc-&gt;mem_task);
<a name="l1226"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
<a name="l1227"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>SpriteMainEd</span><span class=cF7>(</span><span class=cF0>doc</span><span class=cF7>)</span><span class=cF0>==</span><span class=cF3>SPE_ABORT</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1228"></a> </span><span class=cF5>DocLock</span><span class=cF0>(doc);
<a name="l1229"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpb-&gt;data);
<a name="l1230"></a> tmpb-&gt;data=old_csprite;
<a name="l1231"></a> tmpb-&gt;size=old_size;
<a name="l1232"></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="l1233"></a> </span><span class=cF5>SpriteSelAll</span><span class=cF0>(tmpb-&gt;data,</span><span class=cF3>FALSE</span><span class=cF0>);
<a name="l1234"></a> </span><span class=cF5>Free</span><span class=cF0>(old_csprite);
<a name="l1235"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1236"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
<a name="l1237"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
<a name="l1238"></a>}
</span></pre></body>
</html>