<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
<meta name="generator" content="ZealOS V1.07">
<style type="text/css">
body {background-color:#1f1f1f;}
.cF0{color:#e3e3e3;background-color:#1f1f1f;}
.cF1{color:#4f84a6;background-color:#1f1f1f;}
.cF2{color:#73a255;background-color:#1f1f1f;}
.cF3{color:#297582;background-color:#1f1f1f;}
.cF4{color:#b34f4b;background-color:#1f1f1f;}
.cF5{color:#8a52c3;background-color:#1f1f1f;}
.cF6{color:#b7822f;background-color:#1f1f1f;}
.cF7{color:#444444;background-color:#1f1f1f;}
.cF8{color:#6d6d6d;background-color:#1f1f1f;}
.cF9{color:#94bfde;background-color:#1f1f1f;}
.cFA{color:#a1ce97;background-color:#1f1f1f;}
.cFB{color:#6db4be;background-color:#1f1f1f;}
.cFC{color:#e88e88;background-color:#1f1f1f;}
.cFD{color:#ca94e8;background-color:#1f1f1f;}
.cFE{color:#d4b475;background-color:#1f1f1f;}
.cFF{color:#1f1f1f;background-color:#1f1f1f;}
</style>
</head>
<body>
<pre style="font-family:monospace;font-size:12pt">
<a name="l1"></a><span class=cF0>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>&quot;Graphics/Input&quot;</span><span class=cF0>
<a name="l2"></a>
<a name="l3"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>PopUpColor</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *header=</span><span class=cF3>NULL</span><span class=cF0>, </span><span class=cF1>Bool</span><span class=cF0> allow_transparent=</span><span class=cF3>TRUE</span><span class=cF0>, </span><span class=cF1>Bool</span><span class=cF0> allow_default=</span><span class=cF3>TRUE</span><span class=cF0>)
<a name="l4"></a>{</span><span class=cF2>//Chooser for 16-color, default or transparent.</span><span class=cF0>
<a name="l5"></a>    </span><span class=cF9>I64</span><span class=cF0>   i;
<a name="l6"></a>    </span><span class=cF9>CDoc</span><span class=cF0> *doc = </span><span class=cF5>DocNew</span><span class=cF0>;
<a name="l7"></a>
<a name="l8"></a>    </span><span class=cF1>if</span><span class=cF0> (header)
<a name="l9"></a>        </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;%s&quot;</span><span class=cF0>,header);
<a name="l10"></a>    </span><span class=cF1>if</span><span class=cF0> (allow_transparent)
<a name="l11"></a>        </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;$MU,\&quot;TRANSPARENT\&quot;,LE=TRANSPARENT$\n&quot;</span><span class=cF0>);
<a name="l12"></a>    </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i &lt; </span><span class=cF3>COLORS_NUM</span><span class=cF0>; i++)
<a name="l13"></a>        </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;$BG,%d$$MU,\&quot;__%-8Z__\&quot;,LE=%d$$BG$\n&quot;</span><span class=cF0>, i, i, </span><span class=cF6>&quot;ST_COLORS&quot;</span><span class=cF0>, i);
<a name="l14"></a>    </span><span class=cF1>if</span><span class=cF0> (allow_default)
<a name="l15"></a>        </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;$BG,WHITE$$MU,\&quot;DEFAULT\&quot;,LE=DOC_DEFAULT$$BG$&quot;</span><span class=cF0>);
<a name="l16"></a>    i = </span><span class=cF5>PopUpMenu</span><span class=cF0>(doc);
<a name="l17"></a>    </span><span class=cF5>DocDel</span><span class=cF0>(doc);
<a name="l18"></a>
<a name="l19"></a>    </span><span class=cF1>return</span><span class=cF0> i;
<a name="l20"></a>}
<a name="l21"></a>
<a name="l22"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>PopUpColorLighting</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *header=</span><span class=cF3>NULL</span><span class=cF0>)
<a name="l23"></a>{</span><span class=cF2>//Chooser for std ZealOS </span><a href="https://zeal-operating-system.github.io/ZealOS/System/Gr/GrDC.ZC.html#l62"><span class=cF4>DCLighting</span></a><span class=cF2>() color.</span><span class=cF0>
<a name="l24"></a>    </span><span class=cF9>I64</span><span class=cF0>   i;
<a name="l25"></a>    </span><span class=cF9>CDoc</span><span class=cF0> *doc = </span><span class=cF5>DocNew</span><span class=cF0>;
<a name="l26"></a>
<a name="l27"></a>    </span><span class=cF1>if</span><span class=cF0> (header)
<a name="l28"></a>        </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;%s&quot;</span><span class=cF0>, header);
<a name="l29"></a>    </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;\nSingle-Sided means front and back different.&quot;</span><span class=cF0>
<a name="l30"></a>                  </span><span class=cF6>&quot;\nDouble-Sided means front and back same.&quot;</span><span class=cF0>
<a name="l31"></a>                  </span><span class=cF6>&quot;\n&quot;</span><span class=cF0>
<a name="l32"></a>                  </span><span class=cF6>&quot;\nHalf-Range means 0 to [0,7]&quot;</span><span class=cF0>
<a name="l33"></a>                  </span><span class=cF6>&quot;\n                 [8,15]-8 to [8,15]&quot;</span><span class=cF0>
<a name="l34"></a>                  </span><span class=cF6>&quot;\nFull-Range means 0 to [0,7] to [0,7]+8&quot;</span><span class=cF0>
<a name="l35"></a>                  </span><span class=cF6>&quot;\n&quot;</span><span class=cF0>);
<a name="l36"></a>    </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;\n$LTPURPLE$Single-Sided Full-Range Double-Sided Full-Range\n$BLACK$&quot;</span><span class=cF0>);
<a name="l37"></a>    </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i &lt; </span><span class=cF3>COLORS_NUM</span><span class=cF0> / </span><span class=cFE>2</span><span class=cF0>; i++)
<a name="l38"></a>    </span><span class=cF7>{</span><span class=cF0>
<a name="l39"></a>        </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;$BG,%d$$MU,\&quot;__%-19Z__\&quot;,LE=%d$$BG$ &quot;</span><span class=cF0>,  i, i, </span><span class=cF6>&quot;ST_COLORS&quot;</span><span class=cF0>, i);
<a name="l40"></a>        </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;$BG,%d$$MU,\&quot;__%-19Z__\&quot;,LE=%d$$BG$\n&quot;</span><span class=cF0>, i, i, </span><span class=cF6>&quot;ST_COLORS&quot;</span><span class=cF0>, </span><span class=cF3>ROPF_TWO_SIDED</span><span class=cF0>+i);
<a name="l41"></a>    </span><span class=cF7>}</span><span class=cF0>
<a name="l42"></a>    </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;\n$LTPURPLE$Single-Sided Half-Range Double-Sided Half-Range\n$BLACK$&quot;</span><span class=cF0>);
<a name="l43"></a>    </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i &lt; </span><span class=cF3>COLORS_NUM</span><span class=cF0>; i++)
<a name="l44"></a>    </span><span class=cF7>{</span><span class=cF0>
<a name="l45"></a>        </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;$BG,%d$$MU,\&quot;__%-19Z__\&quot;,LE=%d$$BG$ &quot;</span><span class=cF0>,  i, i, </span><span class=cF6>&quot;ST_COLORS&quot;</span><span class=cF0>, </span><span class=cF3>ROPF_HALF_RANGE_COLOR</span><span class=cF0>+i);
<a name="l46"></a>        </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;$BG,%d$$MU,\&quot;__%-19Z__\&quot;,LE=%d$$BG$\n&quot;</span><span class=cF0>, i, i, </span><span class=cF6>&quot;ST_COLORS&quot;</span><span class=cF0>, </span><span class=cF3>ROPF_TWO_SIDED</span><span class=cF0> + </span><span class=cF3>ROPF_HALF_RANGE_COLOR</span><span class=cF0> + i);
<a name="l47"></a>    </span><span class=cF7>}</span><span class=cF0>
<a name="l48"></a>    i = </span><span class=cF5>PopUpMenu</span><span class=cF0>(doc);
<a name="l49"></a>    </span><span class=cF5>DocDel</span><span class=cF0>(doc);
<a name="l50"></a>
<a name="l51"></a>    </span><span class=cF1>return</span><span class=cF0> i;
<a name="l52"></a>}
<a name="l53"></a>
<a name="l54"></a></span><span class=cF1>class</span><span class=cF0> </span><span class=cF9>CTransformForm</span><span class=cF0>
<a name="l55"></a>{
<a name="l56"></a>    </span><span class=cF1>F64</span><span class=cF0> x_scale     format </span><span class=cF6>&quot;$DA-TRM,A=\&quot;X Scale :%12.6f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l57"></a>    </span><span class=cF1>F64</span><span class=cF0> y_scale     format </span><span class=cF6>&quot;$DA-TRM,A=\&quot;Y Scale :%12.6f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l58"></a>    </span><span class=cF1>F64</span><span class=cF0> z_scale     format </span><span class=cF6>&quot;$DA-TRM,A=\&quot;Z Scale :%12.6f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l59"></a>
<a name="l60"></a>    </span><span class=cF1>F64</span><span class=cF0> theta_z         format </span><span class=cF6>&quot;\nAngles are in degrees\n&quot;</span><span class=cF0>
<a name="l61"></a>                           </span><span class=cF6>&quot;$DA-TRM,A=\&quot;Z-Axis  :%12.6f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l62"></a>    </span><span class=cF1>F64</span><span class=cF0> theta_y         format </span><span class=cF6>&quot;$DA-TRM,A=\&quot;Y-Axis  :%12.6f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l63"></a>    </span><span class=cF1>F64</span><span class=cF0> theta_x         format </span><span class=cF6>&quot;$DA-TRM,A=\&quot;X-Axis  :%12.6f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l64"></a>
<a name="l65"></a>    </span><span class=cF1>F64</span><span class=cF0> x_offset    format </span><span class=cF6>&quot;\n$DA-TRM,A=\&quot;X Offset:%12.6f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l66"></a>    </span><span class=cF1>F64</span><span class=cF0> y_offset    format </span><span class=cF6>&quot;$DA-TRM,A=\&quot;Y Offset:%12.6f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l67"></a>    </span><span class=cF1>F64</span><span class=cF0> z_offset    format </span><span class=cF6>&quot;$DA-TRM,A=\&quot;Z Offset:%12.6f\&quot;$\n&quot;</span><span class=cF0>;
<a name="l68"></a>};
<a name="l69"></a>
<a name="l70"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>&quot;Graphics/Input;Graphics/Math/3D Transformation&quot;</span><span class=cF0>
<a name="l71"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>PopUpTransform</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> *r)
<a name="l72"></a>{</span><span class=cF2>//Prompt for Mat4x4 transform.</span><span class=cF0>
<a name="l73"></a>    </span><span class=cF9>CTransformForm</span><span class=cF0> *tf = </span><span class=cF5>MAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CTransformForm</span><span class=cF7>)</span><span class=cF0>);
<a name="l74"></a>
<a name="l75"></a>    tf-&gt;x_scale     = </span><span class=cFE>1</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>;
<a name="l76"></a>    tf-&gt;y_scale     = </span><span class=cFE>1</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>;
<a name="l77"></a>    tf-&gt;z_scale     = </span><span class=cFE>1</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>;
<a name="l78"></a>    tf-&gt;theta_x         = </span><span class=cFE>0</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>;
<a name="l79"></a>    tf-&gt;theta_y         = </span><span class=cFE>0</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>;
<a name="l80"></a>    tf-&gt;theta_z         = </span><span class=cFE>0</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>;
<a name="l81"></a>    tf-&gt;x_offset    = </span><span class=cFE>0</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>;
<a name="l82"></a>    tf-&gt;y_offset    = </span><span class=cFE>0</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>;
<a name="l83"></a>    tf-&gt;z_offset    = </span><span class=cFE>0</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>;
<a name="l84"></a>    </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>PopUpForm</span><span class=cF7>(</span><span class=cF0>tf</span><span class=cF7>)</span><span class=cF0>)
<a name="l85"></a>    </span><span class=cF7>{</span><span class=cF0>
<a name="l86"></a>        </span><span class=cF5>MemSet</span><span class=cF0>(r, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cFE>16</span><span class=cF0> * </span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF7>)</span><span class=cF0>);
<a name="l87"></a>        r[</span><span class=cFE>0</span><span class=cF0>]    = tf-&gt;x_scale * </span><span class=cF3>GR_SCALE</span><span class=cF0>;
<a name="l88"></a>        r[</span><span class=cFE>5</span><span class=cF0>]    = tf-&gt;y_scale * </span><span class=cF3>GR_SCALE</span><span class=cF0>;
<a name="l89"></a>        r[</span><span class=cFE>10</span><span class=cF0>]   = tf-&gt;z_scale * </span><span class=cF3>GR_SCALE</span><span class=cF0>;
<a name="l90"></a>        r[</span><span class=cFE>15</span><span class=cF0>]   = </span><span class=cF3>GR_SCALE</span><span class=cF0>;
<a name="l91"></a>
<a name="l92"></a>        </span><span class=cF5>Mat4x4RotZ</span><span class=cF0>(r, tf-&gt;theta_z * </span><span class=cF3>pi</span><span class=cF0> / </span><span class=cFE>180</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>);
<a name="l93"></a>        </span><span class=cF5>Mat4x4RotY</span><span class=cF0>(r, tf-&gt;theta_y * </span><span class=cF3>pi</span><span class=cF0> / </span><span class=cFE>180</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>);
<a name="l94"></a>        </span><span class=cF5>Mat4x4RotX</span><span class=cF0>(r, tf-&gt;theta_x * </span><span class=cF3>pi</span><span class=cF0> / </span><span class=cFE>180</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>);
<a name="l95"></a>
<a name="l96"></a>        r[</span><span class=cFE>3</span><span class=cF0>]    = tf-&gt;x_offset * </span><span class=cF3>GR_SCALE</span><span class=cF0>;
<a name="l97"></a>        r[</span><span class=cFE>7</span><span class=cF0>]    = tf-&gt;y_offset * </span><span class=cF3>GR_SCALE</span><span class=cF0>;
<a name="l98"></a>        r[</span><span class=cFE>11</span><span class=cF0>]   = tf-&gt;z_offset * </span><span class=cF3>GR_SCALE</span><span class=cF0>;
<a name="l99"></a>
<a name="l100"></a>        </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l101"></a>    </span><span class=cF7>}</span><span class=cF0>
<a name="l102"></a>    </span><span class=cF1>else</span><span class=cF0>
<a name="l103"></a>        </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l104"></a>}
<a name="l105"></a>
<a name="l106"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>&quot;Graphics/Input&quot;</span><span class=cF0>
<a name="l107"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>PU_SPACING</span><span class=cF0>      </span><span class=cFE>10</span><span class=cF0>
<a name="l108"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>DrawIt</span><span class=cF0>(</span><span class=cF9>CTask</span><span class=cF0> *task, </span><span class=cF9>CDC</span><span class=cF0> *dc)
<a name="l109"></a>{
<a name="l110"></a>    </span><span class=cF9>I64</span><span class=cF0>   i, j, i1, j1;
<a name="l111"></a>    </span><span class=cF9>CDoc</span><span class=cF0> *doc = </span><span class=cF5>DocPut</span><span class=cF0>(task);
<a name="l112"></a>
<a name="l113"></a>    </span><span class=cF1>for</span><span class=cF0> (j = </span><span class=cFE>0</span><span class=cF0>; j &lt; </span><span class=cFE>17</span><span class=cF0>; j++)
<a name="l114"></a>        </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i &lt; </span><span class=cFE>17</span><span class=cF0>; i++)
<a name="l115"></a>        </span><span class=cF7>{</span><span class=cF0>
<a name="l116"></a>            </span><span class=cF1>if</span><span class=cF0> (j &lt; </span><span class=cFE>16</span><span class=cF0>)
<a name="l117"></a>                j1 = j;
<a name="l118"></a>            </span><span class=cF1>else</span><span class=cF0>
<a name="l119"></a>                j1 = </span><span class=cF3>TRANSPARENT</span><span class=cF0>;
<a name="l120"></a>            </span><span class=cF1>if</span><span class=cF0> (i &lt; </span><span class=cFE>16</span><span class=cF0>)
<a name="l121"></a>                i1 = i;
<a name="l122"></a>            </span><span class=cF1>else</span><span class=cF0>
<a name="l123"></a>                i1 = </span><span class=cF3>TRANSPARENT</span><span class=cF0>;
<a name="l124"></a>            dc-&gt;color = j1 + i1 &lt;&lt; </span><span class=cFE>16</span><span class=cF0> + </span><span class=cF3>ROPF_DITHER</span><span class=cF0>;
<a name="l125"></a>            </span><span class=cF5>GrRect</span><span class=cF0>(dc, i * </span><span class=cF3>PU_SPACING</span><span class=cF0>, j * </span><span class=cF3>PU_SPACING</span><span class=cF0> + </span><span class=cF5>FramePtr</span><span class=cF7>(</span><span class=cF6>&quot;DitherFrame&quot;</span><span class=cF0>, task</span><span class=cF7>)</span><span class=cF0>, </span><span class=cF3>PU_SPACING</span><span class=cF0>, </span><span class=cF3>PU_SPACING</span><span class=cF0>);
<a name="l126"></a>        </span><span class=cF7>}</span><span class=cF0>
<a name="l127"></a>    i = (</span><span class=cFE>17</span><span class=cF0> * </span><span class=cF3>PU_SPACING</span><span class=cF0> + </span><span class=cF3>FONT_WIDTH</span><span class=cF0> - </span><span class=cFE>1</span><span class=cF0>) / </span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
<a name="l128"></a>    </span><span class=cF1>if</span><span class=cF0> (doc-&gt;max_x &gt; i)
<a name="l129"></a>        i = doc-&gt;max_x;
<a name="l130"></a>    </span><span class=cF5>WinHorz</span><span class=cF0>(task-&gt;win_left, task-&gt;win_left + i, task);
<a name="l131"></a>    </span><span class=cF5>WinVert</span><span class=cF0>(task-&gt;win_top,  task-&gt;win_top + doc-&gt;max_y + </span><span class=cF7>(</span><span class=cFE>17</span><span class=cF0> * </span><span class=cF3>PU_SPACING</span><span class=cF0> + </span><span class=cF3>FONT_WIDTH</span><span class=cF0> - </span><span class=cFE>1</span><span class=cF7>)</span><span class=cF0> / </span><span class=cF3>FONT_WIDTH</span><span class=cF0>, task);
<a name="l132"></a>}
<a name="l133"></a>
<a name="l134"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>DitherColor2</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *header=</span><span class=cF3>NULL</span><span class=cF0>)
<a name="l135"></a>{
<a name="l136"></a>    </span><span class=cF9>I64</span><span class=cF0> message_code, arg1, arg2, res = -</span><span class=cFE>1</span><span class=cF0>, i, j;
<a name="l137"></a>
<a name="l138"></a>    </span><span class=cF5>DocClear</span><span class=cF0>;
<a name="l139"></a>    </span><span class=cF6>&quot;%s&quot;</span><span class=cF0>, header;
<a name="l140"></a>    </span><span class=cF5>DocRecalc</span><span class=cF0>(</span><span class=cF5>DocPut</span><span class=cF0>);
<a name="l141"></a>    </span><span class=cF5>FramePtrAdd</span><span class=cF0>(</span><span class=cF6>&quot;DitherFrame&quot;</span><span class=cF0>, </span><span class=cF7>(</span><span class=cF5>DocPut</span><span class=cF0>-&gt;max_y + </span><span class=cFE>1</span><span class=cF7>)</span><span class=cF0> * </span><span class=cF3>FONT_HEIGHT</span><span class=cF0>);
<a name="l142"></a>    </span><span class=cF5>SettingsPush</span><span class=cF0>; </span><span class=cF2>//See </span><a href="https://zeal-operating-system.github.io/ZealOS/System/TaskSettings.ZC.html#l3"><span class=cF4>SettingsPush</span></a><span class=cF0>
<a name="l143"></a>    </span><span class=cF5>Fs</span><span class=cF0>-&gt;draw_it = &amp;</span><span class=cF5>DrawIt</span><span class=cF0>;
<a name="l144"></a>    </span><span class=cF1>do</span><span class=cF0>
<a name="l145"></a>    </span><span class=cF7>{</span><span class=cF0>
<a name="l146"></a>        message_code = </span><span class=cF5>MessageGet</span><span class=cF0>(&amp;arg1, &amp;arg2, </span><span class=cFE>1</span><span class=cF0> &lt;&lt; </span><span class=cF3>MESSAGE_MS_L_DOWN</span><span class=cF0> | </span><span class=cFE>1</span><span class=cF0> &lt;&lt; </span><span class=cF3>MESSAGE_KEY_DOWN</span><span class=cF0>);
<a name="l147"></a>        </span><span class=cF1>if</span><span class=cF0> (message_code == </span><span class=cF3>MESSAGE_MS_L_DOWN</span><span class=cF0>)
<a name="l148"></a>        {
<a name="l149"></a>            message_code = </span><span class=cF5>MessageGet</span><span class=cF0>(&amp;arg1, &amp;arg2, </span><span class=cFE>1</span><span class=cF0> &lt;&lt; </span><span class=cF3>MESSAGE_MS_L_UP</span><span class=cF0>);
<a name="l150"></a>            i = arg1 / </span><span class=cF3>PU_SPACING</span><span class=cF0>;
<a name="l151"></a>            j = (arg2 - </span><span class=cF5>FramePtr</span><span class=cF7>(</span><span class=cF6>&quot;DitherFrame&quot;</span><span class=cF7>)</span><span class=cF0>) / </span><span class=cF3>PU_SPACING</span><span class=cF0>;
<a name="l152"></a>            </span><span class=cF1>if</span><span class=cF0> (arg1 &gt;= </span><span class=cFE>0</span><span class=cF0> &amp;&amp; arg2 &gt;= </span><span class=cFE>0</span><span class=cF0> &amp;&amp; </span><span class=cFE>0</span><span class=cF0> &lt;= j &lt; </span><span class=cFE>17</span><span class=cF0> &amp;&amp; </span><span class=cFE>0</span><span class=cF0> &lt;= i &lt; </span><span class=cFE>17</span><span class=cF0>)
<a name="l153"></a>            </span><span class=cF7>{</span><span class=cF0>
<a name="l154"></a>                </span><span class=cF1>if</span><span class=cF0> (j == </span><span class=cFE>16</span><span class=cF0>)
<a name="l155"></a>                    j = </span><span class=cF3>TRANSPARENT</span><span class=cF0>;
<a name="l156"></a>                </span><span class=cF1>if</span><span class=cF0> (i == </span><span class=cFE>16</span><span class=cF0>)
<a name="l157"></a>                    i = </span><span class=cF3>TRANSPARENT</span><span class=cF0>;
<a name="l158"></a>                res = j + i &lt;&lt; </span><span class=cFE>16</span><span class=cF0> + </span><span class=cF3>ROPF_DITHER</span><span class=cF0>;
<a name="l159"></a>                </span><span class=cF1>goto</span><span class=cF0> dc_done;
<a name="l160"></a>            </span><span class=cF7>}</span><span class=cF0>
<a name="l161"></a>        }
<a name="l162"></a>    </span><span class=cF7>}</span><span class=cF0>
<a name="l163"></a>    </span><span class=cF1>while</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>message_code == </span><span class=cF3>MESSAGE_KEY_DOWN</span><span class=cF0> &amp;&amp; (arg1 == </span><span class=cF3>CH_ESC</span><span class=cF0> || arg1 == </span><span class=cF3>CH_SHIFT_ESC</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>);
<a name="l164"></a>
<a name="l165"></a>    </span><span class=cF1>do</span><span class=cF0> </span><span class=cF5>MessageGet</span><span class=cF0>(&amp;arg1, &amp;arg2, </span><span class=cFE>1</span><span class=cF0> &lt;&lt; </span><span class=cF3>MESSAGE_KEY_UP</span><span class=cF0>);
<a name="l166"></a>    </span><span class=cF1>while</span><span class=cF0> (!arg1);
<a name="l167"></a>dc_done:
<a name="l168"></a>    </span><span class=cF5>SettingsPop</span><span class=cF0>;
<a name="l169"></a>    </span><span class=cF5>FramePtrDel</span><span class=cF0>(</span><span class=cF6>&quot;DitherFrame&quot;</span><span class=cF0>);
<a name="l170"></a>
<a name="l171"></a>    </span><span class=cF1>return</span><span class=cF0> res;
<a name="l172"></a>}
<a name="l173"></a>
<a name="l174"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>PopUpColorDither</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *header=</span><span class=cF3>NULL</span><span class=cF0>)
<a name="l175"></a>{</span><span class=cF2>//Chooser for 2 x 16 colors or transparent.</span><span class=cF0>
<a name="l176"></a>    </span><span class=cF1>U8</span><span class=cF0> buf[</span><span class=cF3>STR_LEN</span><span class=cF0>];
<a name="l177"></a>
<a name="l178"></a>    </span><span class=cF5>StrPrint</span><span class=cF0>(buf,</span><span class=cF6>&quot;DitherColor2(0x%X);&quot;</span><span class=cF0>, header);
<a name="l179"></a>
<a name="l180"></a>    </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>PopUp</span><span class=cF0>(buf, </span><span class=cF5>Fs</span><span class=cF0>);
<a name="l181"></a>}
</span></pre></body>
</html>