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

2086 lines
215 KiB
Plaintext
Raw Normal View History

2024-03-24 21:24:44 +00:00
<!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&quot;</span><span class=cF0>
<a name="l2"></a>
<a name="l3"></a></span><span class=cF5>Option</span><span class=cF0>(</span><span class=cF3>OPTf_WARN_HEADER_MISMATCH</span><span class=cF0>,</span><span class=cF3>OFF</span><span class=cF0>);
<a name="l4"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>GrPlot0</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *dc=</span><span class=cFB>gr</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)
<a name="l5"></a>{</span><span class=cF2>//2D. No clipping or transformation or thick.</span><span class=cF0>
<a name="l6"></a> </span><span class=cF1>U8</span><span class=cF0> *dst;
<a name="l7"></a> </span><span class=cF9>I32</span><span class=cF0> *db;
<a name="l8"></a> </span><span class=cF9>I64</span><span class=cF0> d,dist;
<a name="l9"></a> </span><span class=cF9>CColorROPU32</span><span class=cF0> c,color=dc-&gt;color,bkcolor=dc-&gt;bkcolor;
<a name="l10"></a>
<a name="l11"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_LOCATE_NEAREST</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l12"></a> dist=</span><span class=cF5>DistSqrI64</span><span class=cF0>(x,y,dc-&gt;cur_x,dc-&gt;cur_y);
<a name="l13"></a> </span><span class=cF1>if</span><span class=cF0> (dist&lt;=dc-&gt;nearest_dist)
<a name="l14"></a> dc-&gt;nearest_dist=dist;
<a name="l15"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l16"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_RECORD_EXTENTS</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l17"></a> </span><span class=cF1>if</span><span class=cF0> (x&lt;dc-&gt;min_x) dc-&gt;min_x=x;
<a name="l18"></a> </span><span class=cF1>if</span><span class=cF0> (x&gt;dc-&gt;max_x) dc-&gt;max_x=x;
<a name="l19"></a> </span><span class=cF1>if</span><span class=cF0> (y&lt;dc-&gt;min_y) dc-&gt;min_y=y;
<a name="l20"></a> </span><span class=cF1>if</span><span class=cF0> (y&gt;dc-&gt;max_y) dc-&gt;max_y=y;
<a name="l21"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l22"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_DONT_DRAW</span><span class=cF0>)
<a name="l23"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l24"></a> d=dc-&gt;width_internal*y+x;
<a name="l25"></a> </span><span class=cF1>if</span><span class=cF0> (db=dc-&gt;depth_buf) </span><span class=cF7>{</span><span class=cF0>
<a name="l26"></a> db+=d;
<a name="l27"></a> </span><span class=cF1>if</span><span class=cF0> (0&lt;=dc-&gt;db_z&lt;=*db)
<a name="l28"></a> *db=dc-&gt;db_z;
<a name="l29"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l30"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l31"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l32"></a> </span><span class=cF1>if</span><span class=cF0> (color.c1.rop&amp;</span><span class=cF7>(</span><span class=cF3>ROPBF_DITHER</span><span class=cF0>|</span><span class=cF3>ROPBF_PROBABILITY_DITHER</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l33"></a> </span><span class=cF1>if</span><span class=cF0> (color.c1.rop&amp;</span><span class=cF3>ROPBF_PROBABILITY_DITHER</span><span class=cF0>) {
<a name="l34"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>RandU16</span><span class=cF0>&lt;dc-&gt;dither_probability_u16) </span><span class=cF7>{</span><span class=cF0>
<a name="l35"></a> color.c1.rop=color.c0.rop;
<a name="l36"></a> color.c0=color.c1;
<a name="l37"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l38"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l39"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>x^y</span><span class=cF7>)</span><span class=cF0>&amp;1) </span><span class=cF7>{</span><span class=cF0>
<a name="l40"></a> color.c1.rop=color.c0.rop;
<a name="l41"></a> color.c0=color.c1;
<a name="l42"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l43"></a> }
<a name="l44"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l45"></a> dst=dc-&gt;body+d;
<a name="l46"></a> </span><span class=cF1>switch</span><span class=cF0> [color.c0.rop] </span><span class=cF7>{</span><span class=cF0>
<a name="l47"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_EQU</span><span class=cF0>:
<a name="l48"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_MONO</span><span class=cF0>:
<a name="l49"></a> *dst=color.c0.color;
<a name="l50"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l51"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_COLLISION</span><span class=cF0>:
<a name="l52"></a> c=*dst;
<a name="l53"></a> </span><span class=cF1>if</span><span class=cF0> (c!=</span><span class=cF3>TRANSPARENT</span><span class=cF0> &amp;&amp; c!=bkcolor.c0.color)
<a name="l54"></a> dc-&gt;collision_cnt++;
<a name="l55"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l56"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_XOR</span><span class=cF0>:
<a name="l57"></a> *dst^=color.c0.color;
<a name="l58"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l59"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l60"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l61"></a>}
<a name="l62"></a></span><span class=cF5>Option</span><span class=cF0>(</span><span class=cF3>OPTf_WARN_HEADER_MISMATCH</span><span class=cF0>,</span><span class=cF3>ON</span><span class=cF0>);
<a name="l63"></a>
<a name="l64"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>GrPeek0</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *dc=</span><span class=cFB>gr</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)
<a name="l65"></a>{</span><span class=cF2>//2D. No clipping or transformation.</span><span class=cF0>
<a name="l66"></a> </span><span class=cF1>return</span><span class=cF0> dc-&gt;body[dc-&gt;width_internal*y+x];
<a name="l67"></a>}
<a name="l68"></a>
<a name="l69"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>&quot;Graphics;Graphics/Device Contexts&quot;</span><span class=cF0>
<a name="l70"></a>
<a name="l71"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>GrBlot</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *dc=</span><span class=cFB>gr</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>CDC</span><span class=cF0> *img)
<a name="l72"></a>{</span><span class=cF2>//2D. Clipping but not transformation..</span><span class=cF0>
<a name="l73"></a> </span><span class=cF9>I64</span><span class=cF0> i,j,k,k1,kk,kk1,w1,h1,w2,h2,dist,
<a name="l74"></a> leading_pixels,leading_pixel_mask,whole_I64s,
<a name="l75"></a> trailing_pixels,trailing_pixel_mask,
<a name="l76"></a> </span><span class=cF1>reg</span><span class=cF0> bit_shift,win_z_buf_line_inc,win_z_buf_line_dec,win_z_num,
<a name="l77"></a> color_mask;
<a name="l78"></a> </span><span class=cF1>U8</span><span class=cF0> </span><span class=cF1>reg</span><span class=cF0> *dst,*src;
<a name="l79"></a> </span><span class=cF9>I32</span><span class=cF0> *db;
<a name="l80"></a> </span><span class=cF9>U16</span><span class=cF0> </span><span class=cF1>reg</span><span class=cF0> *win_z_buf_ptr;
<a name="l81"></a> </span><span class=cF9>CColorROPU32</span><span class=cF0> color,c,old_color;
<a name="l82"></a> </span><span class=cF9>CTask</span><span class=cF0> *win_task;
<a name="l83"></a>
<a name="l84"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l85"></a> win_task=dc-&gt;win_task;
<a name="l86"></a> x+=win_task-&gt;scroll_x;
<a name="l87"></a> y+=win_task-&gt;scroll_y;
<a name="l88"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l89"></a> </span><span class=cF1>if</span><span class=cF0> (x&lt;0)
<a name="l90"></a> w1=-x;
<a name="l91"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l92"></a> w1=0;
<a name="l93"></a> </span><span class=cF1>if</span><span class=cF0> (y&lt;0)
<a name="l94"></a> h1=-y;
<a name="l95"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l96"></a> h1=0;
<a name="l97"></a> w2=img-&gt;width;
<a name="l98"></a> h2=img-&gt;height;
<a name="l99"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l100"></a> x+=win_task-&gt;pix_left;
<a name="l101"></a> y+=win_task-&gt;pix_top;
<a name="l102"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l103"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_LOCATE_NEAREST</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l104"></a> dist=</span><span class=cF5>DistSqrI64</span><span class=cF0>(x+img-&gt;width&gt;&gt;1,y+img-&gt;height&gt;&gt;1,dc-&gt;cur_x,dc-&gt;cur_y);
<a name="l105"></a> </span><span class=cF1>if</span><span class=cF0> (dist&lt;=dc-&gt;nearest_dist)
<a name="l106"></a> dc-&gt;nearest_dist=dist;
<a name="l107"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l108"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l109"></a> </span><span class=cF1>if</span><span class=cF0> (x+w1&lt;0) w1=-x;
<a name="l110"></a> </span><span class=cF1>if</span><span class=cF0> (x+w2&gt;win_task-&gt;pix_right+1)
<a name="l111"></a> w2=win_task-&gt;pix_right+1-x;
<a name="l112"></a>
<a name="l113"></a> </span><span class=cF1>if</span><span class=cF0> (y+h1&lt;0) h1=-y;
<a name="l114"></a> </span><span class=cF1>if</span><span class=cF0> (y+h2&gt;win_task-&gt;pix_bottom+1)
<a name="l115"></a> h2=win_task-&gt;pix_bottom+1-y;
<a name="l116"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l117"></a> </span><span class=cF1>if</span><span class=cF0> (x+w2&gt;dc-&gt;width)
<a name="l118"></a> w2=dc-&gt;width-x;
<a name="l119"></a> </span><span class=cF1>if</span><span class=cF0> (y+h2&gt;dc-&gt;height)
<a name="l120"></a> h2=dc-&gt;height-y;
<a name="l121"></a> </span><span class=cF1>if</span><span class=cF0> (w1&lt;w2&lt;=img-&gt;width &amp;&amp; h1&lt;h2&lt;=img-&gt;height) </span><span class=cF7>{</span><span class=cF0>
<a name="l122"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_RECORD_EXTENTS</span><span class=cF0>) {
<a name="l123"></a> </span><span class=cF1>if</span><span class=cF0> (x+w1&lt;dc-&gt;min_x) dc-&gt;min_x=x+w1;
<a name="l124"></a> </span><span class=cF1>if</span><span class=cF0> (x+w2-1&gt;dc-&gt;max_x) dc-&gt;max_x=x+w2-1;
<a name="l125"></a> </span><span class=cF1>if</span><span class=cF0> (y+h1&lt;dc-&gt;min_y) dc-&gt;min_y=y+h1;
<a name="l126"></a> </span><span class=cF1>if</span><span class=cF0> (y+h2-1&gt;dc-&gt;max_y) dc-&gt;max_y=y+h2-1;
<a name="l127"></a> }
<a name="l128"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_DONT_DRAW</span><span class=cF0>)
<a name="l129"></a> </span><span class=cF1>return</span><span class=cF0> 1;
<a name="l130"></a> old_color=dc-&gt;color;
<a name="l131"></a> db=dc-&gt;depth_buf;
<a name="l132"></a> dc-&gt;depth_buf=</span><span class=cF3>NULL</span><span class=cF0>;
<a name="l133"></a> dc-&gt;color&amp;=~</span><span class=cF3>ROPF_DITHER</span><span class=cF0>;
<a name="l134"></a> color=dc-&gt;color;
<a name="l135"></a> leading_pixels=-(w1+x)&amp;7;
<a name="l136"></a> leading_pixel_mask=</span><span class=cFB>gr</span><span class=cF0>.to_8_bits[0xFF&gt;&gt;leading_pixels];
<a name="l137"></a> bit_shift=-x&amp;7;
<a name="l138"></a> whole_I64s=(w2-w1-leading_pixels)&gt;&gt;3;
<a name="l139"></a> </span><span class=cF1>if</span><span class=cF0> (whole_I64s&lt;0) whole_I64s=0;
<a name="l140"></a> trailing_pixels=(x+w2)&amp;7;
<a name="l141"></a> trailing_pixel_mask=</span><span class=cFB>gr</span><span class=cF0>.to_8_bits[0xFF&lt;&lt;trailing_pixels&amp;0xFF];
<a name="l142"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels+trailing_pixels&gt;w2-w1) {
<a name="l143"></a> leading_pixel_mask|=trailing_pixel_mask;
<a name="l144"></a> trailing_pixels=0;
<a name="l145"></a> }
<a name="l146"></a> </span><span class=cF1>switch</span><span class=cF0> (color.c0.rop) {
<a name="l147"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_COLLISION</span><span class=cF0>: </span><span class=cF2>//TODO: Might want to check win_z_buf</span><span class=cF0>
<a name="l148"></a> color =dc-&gt;bkcolor.c0.color;
<a name="l149"></a> k=h1*img-&gt;width_internal;
<a name="l150"></a> k1=(h1+y)*dc-&gt;width_internal+x;
<a name="l151"></a> </span><span class=cF1>for</span><span class=cF0> (j=h2-h1;j;j--) </span><span class=cF7>{</span><span class=cF0>
<a name="l152"></a> </span><span class=cF1>for</span><span class=cF0> (i=w1;i&lt;w2;i++) {
<a name="l153"></a> c=dc-&gt;body[k1+i];
<a name="l154"></a> </span><span class=cF1>if</span><span class=cF0> (c!=</span><span class=cF3>TRANSPARENT</span><span class=cF0>&amp;&amp;c!=color&amp;&amp;img-&gt;body[k+i]!=</span><span class=cF3>TRANSPARENT</span><span class=cF0>)
<a name="l155"></a> dc-&gt;collision_cnt++;
<a name="l156"></a> }
<a name="l157"></a> k+=img-&gt;width_internal;
<a name="l158"></a> k1+=dc-&gt;width_internal;
<a name="l159"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l160"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l161"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_MONO</span><span class=cF0>:
<a name="l162"></a> color_mask=</span><span class=cFB>gr</span><span class=cF0>.to_8_colors[color.c0.color];
<a name="l163"></a> </span><span class=cF1>if</span><span class=cF0> (img-&gt;flags&amp;</span><span class=cF3>DCF_NO_TRANSPARENTS</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l164"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF7>)</span><span class=cF0> || dc-&gt;flags&amp;</span><span class=cF3>DCF_ON_TOP</span><span class=cF0>)
<a name="l165"></a> win_z_buf_ptr=</span><span class=cF3>NULL</span><span class=cF0>;
<a name="l166"></a> </span><span class=cF1>else</span><span class=cF0> {
<a name="l167"></a> win_z_num=win_task-&gt;win_z_num;
<a name="l168"></a> win_z_buf_ptr=</span><span class=cFB>gr</span><span class=cF0>.win_z_buf(</span><span class=cF1>U8</span><span class=cF0> *)+(</span><span class=cF7>(</span><span class=cF0>h1+y</span><span class=cF7>)</span><span class=cF0>/</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>*</span><span class=cF3>TEXT_COLS</span><span class=cF0>+
<a name="l169"></a> </span><span class=cF7>(</span><span class=cF0>w1+x</span><span class=cF7>)</span><span class=cF0>/</span><span class=cF3>FONT_WIDTH</span><span class=cF0>)*</span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>U16</span><span class=cF0>);
<a name="l170"></a> win_z_buf_line_dec=whole_I64s;
<a name="l171"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels)
<a name="l172"></a> win_z_buf_line_dec++;
<a name="l173"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels)
<a name="l174"></a> win_z_buf_line_dec++;
<a name="l175"></a> win_z_buf_line_dec*=</span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>U16</span><span class=cF0>);
<a name="l176"></a> win_z_buf_line_inc=</span><span class=cF3>TEXT_COLS</span><span class=cF0>*</span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>U16</span><span class=cF0>)-win_z_buf_line_dec;
<a name="l177"></a> }
<a name="l178"></a> kk = h1 *img -&gt;width_internal+w1;
<a name="l179"></a> kk1=(h1+y)*dc-&gt;width_internal+x+w1;
<a name="l180"></a> kk =(kk-bit_shift)&amp;~7+bit_shift;
<a name="l181"></a> bit_shift*=8;
<a name="l182"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_buf_ptr)
<a name="l183"></a> </span><span class=cF1>for</span><span class=cF0> (j=h1;j&lt;h2;j++) {
<a name="l184"></a> src=img-&gt;body+kk&amp;~7;
<a name="l185"></a> dst=dc-&gt;body+kk1&amp;~7;
<a name="l186"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels) </span><span class=cF7>{</span><span class=cF0>
<a name="l187"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++) {
<a name="l188"></a> </span><span class=cF1>if</span><span class=cF0> (bit_shift)
<a name="l189"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l190"></a> (*src</span><span class=cF7>(</span><span class=cF9>U64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++&gt;&gt;bit_shift|
<a name="l191"></a> *src</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>&lt;&lt;</span><span class=cF7>(</span><span class=cF0>64-bit_shift</span><span class=cF7>)</span><span class=cF0>)&amp;
<a name="l192"></a> ~leading_pixel_mask&amp;color_mask;
<a name="l193"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l194"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l195"></a> *src(</span><span class=cF9>I64</span><span class=cF0> *)++&amp;~leading_pixel_mask&amp;color_mask;
<a name="l196"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l197"></a> src(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l198"></a> dst(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l199"></a> }
<a name="l200"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l201"></a> </span><span class=cF1>if</span><span class=cF0> (bit_shift)
<a name="l202"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;whole_I64s;i++)
<a name="l203"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++)
<a name="l204"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=(*src</span><span class=cF7>(</span><span class=cF9>U64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++&gt;&gt;bit_shift|
<a name="l205"></a> *src</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>&lt;&lt;</span><span class=cF7>(</span><span class=cF0>64-bit_shift</span><span class=cF7>)</span><span class=cF0>)&amp;color_mask;
<a name="l206"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l207"></a> src(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l208"></a> dst(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l209"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l210"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l211"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;whole_I64s;i++)
<a name="l212"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++)
<a name="l213"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=*src(</span><span class=cF9>I64</span><span class=cF0> *)++&amp;color_mask;
<a name="l214"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l215"></a> src(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l216"></a> dst(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l217"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l218"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels &amp;&amp; win_z_num&gt;=*win_z_buf_ptr++) </span><span class=cF7>{</span><span class=cF0>
<a name="l219"></a> </span><span class=cF1>if</span><span class=cF0> (bit_shift)
<a name="l220"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l221"></a> (*src</span><span class=cF7>(</span><span class=cF9>U64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++&gt;&gt;bit_shift|
<a name="l222"></a> *src</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>&lt;&lt;</span><span class=cF7>(</span><span class=cF0>64-bit_shift</span><span class=cF7>)</span><span class=cF0>)&amp;
<a name="l223"></a> ~trailing_pixel_mask&amp;color_mask;
<a name="l224"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l225"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l226"></a> *src(</span><span class=cF9>I64</span><span class=cF0> *)++&amp;~trailing_pixel_mask&amp;color_mask;
<a name="l227"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l228"></a> kk +=img-&gt;width_internal;
<a name="l229"></a> kk1+=dc-&gt;width_internal;
<a name="l230"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>j+y</span><span class=cF7>)</span><span class=cF0>&amp;7==7)
<a name="l231"></a> win_z_buf_ptr(</span><span class=cF1>U8</span><span class=cF0> *)+=win_z_buf_line_inc;
<a name="l232"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l233"></a> win_z_buf_ptr(</span><span class=cF1>U8</span><span class=cF0> *)-=win_z_buf_line_dec;
<a name="l234"></a> }
<a name="l235"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l236"></a> </span><span class=cF1>for</span><span class=cF0> (j=h2-h1;j;j--) {
<a name="l237"></a> src=img-&gt;body+kk&amp;~7;
<a name="l238"></a> dst=dc-&gt;body+kk1&amp;~7;
<a name="l239"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels) </span><span class=cF7>{</span><span class=cF0>
<a name="l240"></a> </span><span class=cF1>if</span><span class=cF0> (bit_shift)
<a name="l241"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l242"></a> (*src</span><span class=cF7>(</span><span class=cF9>U64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++&gt;&gt;bit_shift|
<a name="l243"></a> *src</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>&lt;&lt;</span><span class=cF7>(</span><span class=cF0>64-bit_shift</span><span class=cF7>)</span><span class=cF0>)&amp;
<a name="l244"></a> ~leading_pixel_mask&amp;color_mask;
<a name="l245"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l246"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l247"></a> *src(</span><span class=cF9>I64</span><span class=cF0> *)++&amp;~leading_pixel_mask&amp;color_mask;
<a name="l248"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l249"></a> </span><span class=cF1>if</span><span class=cF0> (bit_shift)
<a name="l250"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;whole_I64s;i++)
<a name="l251"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=(*src</span><span class=cF7>(</span><span class=cF9>U64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++&gt;&gt;bit_shift|
<a name="l252"></a> *src</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>&lt;&lt;</span><span class=cF7>(</span><span class=cF0>64-bit_shift</span><span class=cF7>)</span><span class=cF0>)&amp;color_mask;
<a name="l253"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l254"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;whole_I64s;i++)
<a name="l255"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=*src(</span><span class=cF9>I64</span><span class=cF0> *)++&amp;color_mask;
<a name="l256"></a>
<a name="l257"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels) </span><span class=cF7>{</span><span class=cF0>
<a name="l258"></a> </span><span class=cF1>if</span><span class=cF0> (bit_shift)
<a name="l259"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l260"></a> (*src</span><span class=cF7>(</span><span class=cF9>U64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++&gt;&gt;bit_shift|
<a name="l261"></a> *src</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>&lt;&lt;</span><span class=cF7>(</span><span class=cF0>64-bit_shift</span><span class=cF7>)</span><span class=cF0>)&amp;
<a name="l262"></a> ~trailing_pixel_mask&amp;color_mask;
<a name="l263"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l264"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l265"></a> *src(</span><span class=cF9>I64</span><span class=cF0> *)++&amp;~trailing_pixel_mask&amp;color_mask;
<a name="l266"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l267"></a> kk +=img-&gt;width_internal;
<a name="l268"></a> kk1+=dc-&gt;width_internal;
<a name="l269"></a> }
<a name="l270"></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="l271"></a> k=h1*img-&gt;width_internal;
<a name="l272"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF7>)</span><span class=cF0> || dc-&gt;flags&amp;</span><span class=cF3>DCF_ON_TOP</span><span class=cF0>) {
<a name="l273"></a> </span><span class=cF1>for</span><span class=cF0> (j=h1;j&lt;h2;j++) </span><span class=cF7>{</span><span class=cF0>
<a name="l274"></a> </span><span class=cF1>for</span><span class=cF0> (i=w1;i&lt;w2;i++)
<a name="l275"></a> </span><span class=cF1>if</span><span class=cF0> (img-&gt;body[k+i])
<a name="l276"></a> </span><span class=cF5>GrPlot0</span><span class=cF0>(dc,x+i,y+j);
<a name="l277"></a> k+=img-&gt;width_internal;
<a name="l278"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l279"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l280"></a> win_z_num =win_task-&gt;win_z_num;
<a name="l281"></a> win_z_buf_ptr =</span><span class=cFB>gr</span><span class=cF0>.win_z_buf(</span><span class=cF1>U8</span><span class=cF0> *)+
<a name="l282"></a> (</span><span class=cF7>(</span><span class=cF0>h1+y</span><span class=cF7>)</span><span class=cF0>/</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>*</span><span class=cF3>TEXT_COLS</span><span class=cF0>+</span><span class=cF7>(</span><span class=cF0>w1+x</span><span class=cF7>)</span><span class=cF0>/</span><span class=cF3>FONT_WIDTH</span><span class=cF0>)*</span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>U16</span><span class=cF0>);
<a name="l283"></a> win_z_buf_line_dec=whole_I64s;
<a name="l284"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels)
<a name="l285"></a> win_z_buf_line_dec++;
<a name="l286"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels)
<a name="l287"></a> win_z_buf_line_dec++;
<a name="l288"></a> win_z_buf_line_dec*=</span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>U16</span><span class=cF0>);
<a name="l289"></a> win_z_buf_line_inc=</span><span class=cF3>TEXT_COLS</span><span class=cF0>*</span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>U16</span><span class=cF0>)-win_z_buf_line_dec;
<a name="l290"></a> </span><span class=cF1>for</span><span class=cF0> (j=h1;j&lt;h2;j++) </span><span class=cF7>{</span><span class=cF0>
<a name="l291"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++)
<a name="l292"></a> color_mask=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l293"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l294"></a> color_mask=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l295"></a> </span><span class=cF1>for</span><span class=cF0> (i=w1;i&lt;w2;) {
<a name="l296"></a> </span><span class=cF1>if</span><span class=cF0> (color_mask)
<a name="l297"></a> </span><span class=cF1>if</span><span class=cF0> (img-&gt;body[k+i])
<a name="l298"></a> </span><span class=cF5>GrPlot0</span><span class=cF0>(dc,x+i,y+j);
<a name="l299"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>(++i+x) &amp;7</span><span class=cF7>)</span><span class=cF0> &amp;&amp; i&lt;w2) </span><span class=cF7>{</span><span class=cF0>
<a name="l300"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++)
<a name="l301"></a> color_mask=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l302"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l303"></a> color_mask=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l304"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l305"></a> }
<a name="l306"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>j+y</span><span class=cF7>)</span><span class=cF0>&amp;7==7)
<a name="l307"></a> win_z_buf_ptr(</span><span class=cF1>U8</span><span class=cF0> *)+=win_z_buf_line_inc;
<a name="l308"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l309"></a> win_z_buf_ptr(</span><span class=cF1>U8</span><span class=cF0> *)-=win_z_buf_line_dec;
<a name="l310"></a> k+=img-&gt;width_internal;
<a name="l311"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l312"></a> }
<a name="l313"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l314"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l315"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_EQU</span><span class=cF0>:
<a name="l316"></a> </span><span class=cF1>if</span><span class=cF0> (img-&gt;flags&amp;</span><span class=cF3>DCF_NO_TRANSPARENTS</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l317"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF7>)</span><span class=cF0> || dc-&gt;flags&amp;</span><span class=cF3>DCF_ON_TOP</span><span class=cF0>)
<a name="l318"></a> win_z_buf_ptr=</span><span class=cF3>NULL</span><span class=cF0>;
<a name="l319"></a> </span><span class=cF1>else</span><span class=cF0> {
<a name="l320"></a> win_z_num=win_task-&gt;win_z_num;
<a name="l321"></a> win_z_buf_ptr=</span><span class=cFB>gr</span><span class=cF0>.win_z_buf(</span><span class=cF1>U8</span><span class=cF0> *)+
<a name="l322"></a> (</span><span class=cF7>(</span><span class=cF0>h1+y</span><span class=cF7>)</span><span class=cF0>/</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>*</span><span class=cF3>TEXT_COLS</span><span class=cF0>+</span><span class=cF7>(</span><span class=cF0>w1+x</span><span class=cF7>)</span><span class=cF0>/</span><span class=cF3>FONT_WIDTH</span><span class=cF0>)*</span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>U16</span><span class=cF0>);
<a name="l323"></a> win_z_buf_line_dec=whole_I64s;
<a name="l324"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels)
<a name="l325"></a> win_z_buf_line_dec++;
<a name="l326"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels)
<a name="l327"></a> win_z_buf_line_dec++;
<a name="l328"></a> win_z_buf_line_dec*=</span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>U16</span><span class=cF0>);
<a name="l329"></a> win_z_buf_line_inc=</span><span class=cF3>TEXT_COLS</span><span class=cF0>*</span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>U16</span><span class=cF0>)-win_z_buf_line_dec;
<a name="l330"></a> }
<a name="l331"></a> kk = h1 *img -&gt;width_internal+w1;
<a name="l332"></a> kk1=(h1+y)*dc-&gt;width_internal+x+w1;
<a name="l333"></a> kk =(kk-bit_shift)&amp;~7+bit_shift;
<a name="l334"></a> bit_shift*=8;
<a name="l335"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_buf_ptr)
<a name="l336"></a> </span><span class=cF1>for</span><span class=cF0> (j=h1;j&lt;h2;j++) {
<a name="l337"></a> src=img-&gt;body+kk&amp;~7;
<a name="l338"></a> dst=dc-&gt;body+kk1&amp;~7;
<a name="l339"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels) </span><span class=cF7>{</span><span class=cF0>
<a name="l340"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++) {
<a name="l341"></a> </span><span class=cF1>if</span><span class=cF0> (bit_shift)
<a name="l342"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l343"></a> (*src</span><span class=cF7>(</span><span class=cF9>U64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++&gt;&gt;bit_shift|
<a name="l344"></a> *src</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>&lt;&lt;</span><span class=cF7>(</span><span class=cF0>64-bit_shift</span><span class=cF7>)</span><span class=cF0>)&amp;~leading_pixel_mask;
<a name="l345"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l346"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l347"></a> *src(</span><span class=cF9>I64</span><span class=cF0> *)++&amp;~leading_pixel_mask;
<a name="l348"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l349"></a> src(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l350"></a> dst(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l351"></a> }
<a name="l352"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l353"></a> </span><span class=cF1>if</span><span class=cF0> (bit_shift)
<a name="l354"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;whole_I64s;i++)
<a name="l355"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++)
<a name="l356"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=*src(</span><span class=cF9>U64</span><span class=cF0> *)++&gt;&gt;bit_shift|
<a name="l357"></a> *src(</span><span class=cF9>I64</span><span class=cF0> *)&lt;&lt;(64-bit_shift);
<a name="l358"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l359"></a> src(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l360"></a> dst(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l361"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l362"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l363"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;whole_I64s;i++)
<a name="l364"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++)
<a name="l365"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=*src(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l366"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l367"></a> src(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l368"></a> dst(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l369"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l370"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels &amp;&amp; win_z_num&gt;=*win_z_buf_ptr++) </span><span class=cF7>{</span><span class=cF0>
<a name="l371"></a> </span><span class=cF1>if</span><span class=cF0> (bit_shift)
<a name="l372"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l373"></a> (*src</span><span class=cF7>(</span><span class=cF9>U64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++&gt;&gt;bit_shift|
<a name="l374"></a> *src</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>&lt;&lt;</span><span class=cF7>(</span><span class=cF0>64-bit_shift</span><span class=cF7>)</span><span class=cF0>)&amp;~trailing_pixel_mask;
<a name="l375"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l376"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l377"></a> *src(</span><span class=cF9>I64</span><span class=cF0> *)++&amp;~trailing_pixel_mask;
<a name="l378"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l379"></a> kk +=img-&gt;width_internal;
<a name="l380"></a> kk1+=dc-&gt;width_internal;
<a name="l381"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>j+y</span><span class=cF7>)</span><span class=cF0>&amp;7==7)
<a name="l382"></a> win_z_buf_ptr(</span><span class=cF1>U8</span><span class=cF0> *)+=win_z_buf_line_inc;
<a name="l383"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l384"></a> win_z_buf_ptr(</span><span class=cF1>U8</span><span class=cF0> *)-=win_z_buf_line_dec;
<a name="l385"></a> }
<a name="l386"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l387"></a> </span><span class=cF1>for</span><span class=cF0> (j=h2-h1;j;j--) {
<a name="l388"></a> src=img-&gt;body+kk&amp;~7;
<a name="l389"></a> dst=dc-&gt;body+kk1&amp;~7;
<a name="l390"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels) </span><span class=cF7>{</span><span class=cF0>
<a name="l391"></a> </span><span class=cF1>if</span><span class=cF0> (bit_shift)
<a name="l392"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l393"></a> (*src</span><span class=cF7>(</span><span class=cF9>U64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++&gt;&gt;bit_shift|
<a name="l394"></a> *src</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>&lt;&lt;</span><span class=cF7>(</span><span class=cF0>64-bit_shift</span><span class=cF7>)</span><span class=cF0>)&amp;~leading_pixel_mask;
<a name="l395"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l396"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l397"></a> *src(</span><span class=cF9>I64</span><span class=cF0> *)++&amp;~leading_pixel_mask;
<a name="l398"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l399"></a> </span><span class=cF1>if</span><span class=cF0> (bit_shift)
<a name="l400"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;whole_I64s;i++)
<a name="l401"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=*src(</span><span class=cF9>U64</span><span class=cF0> *)++&gt;&gt;bit_shift|
<a name="l402"></a> *src(</span><span class=cF9>I64</span><span class=cF0> *)&lt;&lt;(64-bit_shift);
<a name="l403"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l404"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;whole_I64s;i++)
<a name="l405"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=*src(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l406"></a>
<a name="l407"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels) </span><span class=cF7>{</span><span class=cF0>
<a name="l408"></a> </span><span class=cF1>if</span><span class=cF0> (bit_shift)
<a name="l409"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l410"></a> (*src</span><span class=cF7>(</span><span class=cF9>U64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++&gt;&gt;bit_shift|
<a name="l411"></a> *src</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>&lt;&lt;</span><span class=cF7>(</span><span class=cF0>64-bit_shift</span><span class=cF7>)</span><span class=cF0>)&amp;~trailing_pixel_mask;
<a name="l412"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l413"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l414"></a> *src(</span><span class=cF9>I64</span><span class=cF0> *)++&amp;~trailing_pixel_mask;
<a name="l415"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l416"></a> kk +=img-&gt;width_internal;
<a name="l417"></a> kk1+=dc-&gt;width_internal;
<a name="l418"></a> }
<a name="l419"></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="l420"></a>here1a:
<a name="l421"></a> k=h1*img-&gt;width_internal;
<a name="l422"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF7>)</span><span class=cF0> || dc-&gt;flags&amp;</span><span class=cF3>DCF_ON_TOP</span><span class=cF0>) {
<a name="l423"></a> </span><span class=cF1>for</span><span class=cF0> (j=h1;j&lt;h2;j++) </span><span class=cF7>{</span><span class=cF0>
<a name="l424"></a> </span><span class=cF1>for</span><span class=cF0> (i=w1;i&lt;w2;i++) {
<a name="l425"></a> c=img-&gt;body[k+i];
<a name="l426"></a> </span><span class=cF1>if</span><span class=cF0> (c!=</span><span class=cF3>TRANSPARENT</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l427"></a> dc-&gt;color.c0.color=c;
<a name="l428"></a> </span><span class=cF5>GrPlot0</span><span class=cF0>(dc,x+i,y+j);
<a name="l429"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l430"></a> }
<a name="l431"></a> k+=img-&gt;width_internal;
<a name="l432"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l433"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l434"></a> win_z_num =win_task-&gt;win_z_num;
<a name="l435"></a> win_z_buf_ptr =</span><span class=cFB>gr</span><span class=cF0>.win_z_buf(</span><span class=cF1>U8</span><span class=cF0> *)+
<a name="l436"></a> (</span><span class=cF7>(</span><span class=cF0>h1+y</span><span class=cF7>)</span><span class=cF0>/</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>*</span><span class=cF3>TEXT_COLS</span><span class=cF0>+</span><span class=cF7>(</span><span class=cF0>w1+x</span><span class=cF7>)</span><span class=cF0>/</span><span class=cF3>FONT_WIDTH</span><span class=cF0>)*</span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>U16</span><span class=cF0>);
<a name="l437"></a> win_z_buf_line_dec=whole_I64s;
<a name="l438"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels)
<a name="l439"></a> win_z_buf_line_dec++;
<a name="l440"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels)
<a name="l441"></a> win_z_buf_line_dec++;
<a name="l442"></a> win_z_buf_line_dec*=</span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>U16</span><span class=cF0>);
<a name="l443"></a> win_z_buf_line_inc=</span><span class=cF3>TEXT_COLS</span><span class=cF0>*</span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>U16</span><span class=cF0>)-win_z_buf_line_dec;
<a name="l444"></a> </span><span class=cF1>for</span><span class=cF0> (j=h1;j&lt;h2;j++) </span><span class=cF7>{</span><span class=cF0>
<a name="l445"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++)
<a name="l446"></a> color_mask=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l447"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l448"></a> color_mask=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l449"></a> </span><span class=cF1>for</span><span class=cF0> (i=w1;i&lt;w2;) {
<a name="l450"></a> </span><span class=cF1>if</span><span class=cF0> (color_mask) </span><span class=cF7>{</span><span class=cF0>
<a name="l451"></a> c=img-&gt;body[k+i];
<a name="l452"></a> </span><span class=cF1>if</span><span class=cF0> (c!=</span><span class=cF3>TRANSPARENT</span><span class=cF0>) {
<a name="l453"></a> dc-&gt;color.c0.color=c;
<a name="l454"></a> </span><span class=cF5>GrPlot0</span><span class=cF0>(dc,x+i,y+j);
<a name="l455"></a> }
<a name="l456"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l457"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>(++i+x) &amp;7</span><span class=cF7>)</span><span class=cF0> &amp;&amp; i&lt;w2) </span><span class=cF7>{</span><span class=cF0>
<a name="l458"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++)
<a name="l459"></a> color_mask=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l460"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l461"></a> color_mask=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l462"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l463"></a> }
<a name="l464"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>j+y</span><span class=cF7>)</span><span class=cF0>&amp;7==7)
<a name="l465"></a> win_z_buf_ptr(</span><span class=cF1>U8</span><span class=cF0> *)+=win_z_buf_line_inc;
<a name="l466"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l467"></a> win_z_buf_ptr(</span><span class=cF1>U8</span><span class=cF0> *)-=win_z_buf_line_dec;
<a name="l468"></a> k+=img-&gt;width_internal;
<a name="l469"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l470"></a> }
<a name="l471"></a> dc-&gt;color=color;
<a name="l472"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l473"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l474"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_XOR</span><span class=cF0>:
<a name="l475"></a> </span><span class=cF1>if</span><span class=cF0> (img-&gt;flags&amp;</span><span class=cF3>DCF_NO_TRANSPARENTS</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l476"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF7>)</span><span class=cF0> || dc-&gt;flags&amp;</span><span class=cF3>DCF_ON_TOP</span><span class=cF0>)
<a name="l477"></a> win_z_buf_ptr=</span><span class=cF3>NULL</span><span class=cF0>;
<a name="l478"></a> </span><span class=cF1>else</span><span class=cF0> {
<a name="l479"></a> win_z_num=win_task-&gt;win_z_num;
<a name="l480"></a> win_z_buf_ptr=</span><span class=cFB>gr</span><span class=cF0>.win_z_buf(</span><span class=cF1>U8</span><span class=cF0> *)+
<a name="l481"></a> (</span><span class=cF7>(</span><span class=cF0>h1+y</span><span class=cF7>)</span><span class=cF0>/</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>*</span><span class=cF3>TEXT_COLS</span><span class=cF0>+</span><span class=cF7>(</span><span class=cF0>w1+x</span><span class=cF7>)</span><span class=cF0>/</span><span class=cF3>FONT_WIDTH</span><span class=cF0>)*</span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>U16</span><span class=cF0>);
<a name="l482"></a> win_z_buf_line_dec=whole_I64s;
<a name="l483"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels)
<a name="l484"></a> win_z_buf_line_dec++;
<a name="l485"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels)
<a name="l486"></a> win_z_buf_line_dec++;
<a name="l487"></a> win_z_buf_line_dec*=</span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>U16</span><span class=cF0>);
<a name="l488"></a> win_z_buf_line_inc=</span><span class=cF3>TEXT_COLS</span><span class=cF0>*</span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>U16</span><span class=cF0>)-win_z_buf_line_dec;
<a name="l489"></a> }
<a name="l490"></a> kk = h1 *img -&gt;width_internal +w1;
<a name="l491"></a> kk1=(h1+y)*dc-&gt;width_internal+x+w1;
<a name="l492"></a> kk =(kk-bit_shift)&amp;~7+bit_shift;
<a name="l493"></a> bit_shift*=8;
<a name="l494"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_buf_ptr)
<a name="l495"></a> </span><span class=cF1>for</span><span class=cF0> (j=h1;j&lt;h2;j++) {
<a name="l496"></a> src=img-&gt;body+kk&amp;~7;
<a name="l497"></a> dst=dc-&gt;body+kk1&amp;~7;
<a name="l498"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels) </span><span class=cF7>{</span><span class=cF0>
<a name="l499"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++) {
<a name="l500"></a> </span><span class=cF1>if</span><span class=cF0> (bit_shift)
<a name="l501"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l502"></a> (*dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>^</span><span class=cF7>(</span><span class=cF0>*src(</span><span class=cF9>U64</span><span class=cF0> *)++&gt;&gt;bit_shift|
<a name="l503"></a> *src(</span><span class=cF9>I64</span><span class=cF0> *)&lt;&lt;(64-bit_shift)</span><span class=cF7>)</span><span class=cF0>)&amp;~leading_pixel_mask;
<a name="l504"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l505"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l506"></a> (*dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>^*src</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++)&amp;~leading_pixel_mask;
<a name="l507"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l508"></a> src(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l509"></a> dst(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l510"></a> }
<a name="l511"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l512"></a> </span><span class=cF1>if</span><span class=cF0> (bit_shift)
<a name="l513"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;whole_I64s;i++)
<a name="l514"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++)
<a name="l515"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++^=*src(</span><span class=cF9>U64</span><span class=cF0> *)++&gt;&gt;bit_shift|
<a name="l516"></a> *src(</span><span class=cF9>I64</span><span class=cF0> *)&lt;&lt;(64-bit_shift);
<a name="l517"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l518"></a> src(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l519"></a> dst(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l520"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l521"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l522"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;whole_I64s;i++)
<a name="l523"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++)
<a name="l524"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++^=*src(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l525"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l526"></a> src(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l527"></a> dst(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l528"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l529"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels &amp;&amp; win_z_num&gt;=*win_z_buf_ptr++) </span><span class=cF7>{</span><span class=cF0>
<a name="l530"></a> </span><span class=cF1>if</span><span class=cF0> (bit_shift)
<a name="l531"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l532"></a> (*dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>^</span><span class=cF7>(</span><span class=cF0>*src(</span><span class=cF9>U64</span><span class=cF0> *)++&gt;&gt;bit_shift|
<a name="l533"></a> *src(</span><span class=cF9>I64</span><span class=cF0> *)&lt;&lt;(64-bit_shift)</span><span class=cF7>)</span><span class=cF0>)&amp;~trailing_pixel_mask;
<a name="l534"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l535"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l536"></a> (*dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>^*src</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++)&amp;~trailing_pixel_mask;
<a name="l537"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l538"></a> kk +=img-&gt;width_internal;
<a name="l539"></a> kk1+=dc-&gt;width_internal;
<a name="l540"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>j+y</span><span class=cF7>)</span><span class=cF0>&amp;7==7)
<a name="l541"></a> win_z_buf_ptr(</span><span class=cF1>U8</span><span class=cF0> *)+=win_z_buf_line_inc;
<a name="l542"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l543"></a> win_z_buf_ptr(</span><span class=cF1>U8</span><span class=cF0> *)-=win_z_buf_line_dec;
<a name="l544"></a> }
<a name="l545"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l546"></a> </span><span class=cF1>for</span><span class=cF0> (j=h2-h1;j;j--) {
<a name="l547"></a> src=img-&gt;body+kk&amp;~7;
<a name="l548"></a> dst=dc-&gt;body+kk1&amp;~7;
<a name="l549"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels) </span><span class=cF7>{</span><span class=cF0>
<a name="l550"></a> </span><span class=cF1>if</span><span class=cF0> (bit_shift)
<a name="l551"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l552"></a> (*dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>^</span><span class=cF7>(</span><span class=cF0>*src(</span><span class=cF9>U64</span><span class=cF0> *)++&gt;&gt;bit_shift|
<a name="l553"></a> *src(</span><span class=cF9>I64</span><span class=cF0> *)&lt;&lt;(64-bit_shift)</span><span class=cF7>)</span><span class=cF0>)&amp;~leading_pixel_mask;
<a name="l554"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l555"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l556"></a> (*dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>^*src</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++)&amp;~leading_pixel_mask;
<a name="l557"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l558"></a> </span><span class=cF1>if</span><span class=cF0> (bit_shift)
<a name="l559"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;whole_I64s;i++)
<a name="l560"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++^=*src(</span><span class=cF9>U64</span><span class=cF0> *)++&gt;&gt;bit_shift|
<a name="l561"></a> *src(</span><span class=cF9>I64</span><span class=cF0> *)&lt;&lt;(64-bit_shift);
<a name="l562"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l563"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;whole_I64s;i++)
<a name="l564"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++^=*src(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l565"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels) </span><span class=cF7>{</span><span class=cF0>
<a name="l566"></a> </span><span class=cF1>if</span><span class=cF0> (bit_shift)
<a name="l567"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l568"></a> (*dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>^</span><span class=cF7>(</span><span class=cF0>*src(</span><span class=cF9>U64</span><span class=cF0> *)++&gt;&gt;bit_shift|
<a name="l569"></a> *src(</span><span class=cF9>I64</span><span class=cF0> *)&lt;&lt;(64-bit_shift)</span><span class=cF7>)</span><span class=cF0>)&amp;~trailing_pixel_mask;
<a name="l570"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l571"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l572"></a> (*dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>^*src</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++)&amp;~trailing_pixel_mask;
<a name="l573"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l574"></a> kk +=img-&gt;width_internal;
<a name="l575"></a> kk1+=dc-&gt;width_internal;
<a name="l576"></a> }
<a name="l577"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l578"></a> </span><span class=cF1>goto</span><span class=cF0> here1a;
<a name="l579"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l580"></a> }
<a name="l581"></a> dc-&gt;depth_buf=db;
<a name="l582"></a> dc-&gt;color=old_color;
<a name="l583"></a> </span><span class=cF1>return</span><span class=cF0> 1;
<a name="l584"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l585"></a> </span><span class=cF1>return</span><span class=cF0> 0;
<a name="l586"></a>}
<a name="l587"></a>
<a name="l588"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>&quot;Graphics/Device Contexts&quot;</span><span class=cF0>
<a name="l589"></a>
<a name="l590"></a></span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>GrBitMap4ToBitMap8</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *dst,</span><span class=cF1>U8</span><span class=cF0> *src,</span><span class=cF9>I64</span><span class=cF0> src_size,</span><span class=cF9>I64</span><span class=cF0> bkcolor)
<a name="l591"></a>{
<a name="l592"></a> </span><span class=cF9>I64</span><span class=cF0> c,k,i=src_size*2,i1=i&gt;&gt;3;
<a name="l593"></a> </span><span class=cF1>for</span><span class=cF0> (k=0;k&lt;i;k++) </span><span class=cF7>{</span><span class=cF0>
<a name="l594"></a> c=0;
<a name="l595"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>src ,k</span><span class=cF7>)</span><span class=cF0>) c|=1;
<a name="l596"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>src+i1 ,k</span><span class=cF7>)</span><span class=cF0>) c|=2;
<a name="l597"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>src+i1*2,k</span><span class=cF7>)</span><span class=cF0>) c|=4;
<a name="l598"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>src+i1*3,k</span><span class=cF7>)</span><span class=cF0>) c|=8;
<a name="l599"></a> </span><span class=cF1>if</span><span class=cF0> (c==bkcolor) c=</span><span class=cF3>TRANSPARENT</span><span class=cF0>;
<a name="l600"></a> *dst++=c;
<a name="l601"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l602"></a> </span><span class=cF1>return</span><span class=cF0> dst;
<a name="l603"></a>}
<a name="l604"></a>
<a name="l605"></a></span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>GrBitMap1ToBitMap8</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *dst,</span><span class=cF1>U8</span><span class=cF0> *src,</span><span class=cF9>I64</span><span class=cF0> src_size,</span><span class=cF9>I64</span><span class=cF0> bkcolor)
<a name="l606"></a>{
<a name="l607"></a> </span><span class=cF9>I64</span><span class=cF0> c,k,i=src_size*8;
<a name="l608"></a> </span><span class=cF1>for</span><span class=cF0> (k=0;k&lt;i;k++) </span><span class=cF7>{</span><span class=cF0>
<a name="l609"></a> c=0;
<a name="l610"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>src,k</span><span class=cF7>)</span><span class=cF0>) c=</span><span class=cF3>COLOR_MONO</span><span class=cF0>;
<a name="l611"></a> </span><span class=cF1>if</span><span class=cF0> (c==bkcolor) c=</span><span class=cF3>TRANSPARENT</span><span class=cF0>;
<a name="l612"></a> *dst++=c;
<a name="l613"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l614"></a> </span><span class=cF1>return</span><span class=cF0> dst;
<a name="l615"></a>}
<a name="l616"></a>
<a name="l617"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>CDC</span><span class=cF0> *</span><span class=cF5>DCExt</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *dc=</span><span class=cFB>gr</span><span class=cF0>.dc,</span><span class=cF9>I64</span><span class=cF0> x1,</span><span class=cF9>I64</span><span class=cF0> y1,</span><span class=cF9>I64</span><span class=cF0> x2,</span><span class=cF9>I64</span><span class=cF0> y2,
<a name="l618"></a> </span><span class=cF9>CTask</span><span class=cF0> *task=</span><span class=cF3>NULL</span><span class=cF0>)
<a name="l619"></a>{</span><span class=cF2>//Extract new device context rect from device context.</span><span class=cF0>
<a name="l620"></a> </span><span class=cF9>CDC</span><span class=cF0> *res;
<a name="l621"></a> </span><span class=cF9>CTask</span><span class=cF0> *win_task;
<a name="l622"></a> </span><span class=cF1>if</span><span class=cF0> (x1&gt;x2) </span><span class=cF5>SwapI64</span><span class=cF0>(&amp;x1,&amp;x2);
<a name="l623"></a> </span><span class=cF1>if</span><span class=cF0> (y1&gt;y2) </span><span class=cF5>SwapI64</span><span class=cF0>(&amp;y1,&amp;y2);
<a name="l624"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l625"></a> win_task=dc-&gt;win_task;
<a name="l626"></a> x1+=win_task-&gt;pix_left+win_task-&gt;scroll_x;
<a name="l627"></a> y1+=win_task-&gt;pix_top +win_task-&gt;scroll_y;
<a name="l628"></a> x2+=win_task-&gt;pix_left+win_task-&gt;scroll_x;
<a name="l629"></a> y2+=win_task-&gt;pix_top +win_task-&gt;scroll_y;
<a name="l630"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l631"></a> res=</span><span class=cF5>DCNew</span><span class=cF0>(x2-x1+1,y2-y1+1,task);
<a name="l632"></a> </span><span class=cF5>DCFill</span><span class=cF0>(res);
<a name="l633"></a> </span><span class=cF5>GrBlot</span><span class=cF0>(res,-x1,-y1,dc);
<a name="l634"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l635"></a>}
<a name="l636"></a>
<a name="l637"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>CDC</span><span class=cF0> *</span><span class=cF5>DCDiff</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *base,</span><span class=cF9>CDC</span><span class=cF0> *update)
<a name="l638"></a>{</span><span class=cF2>//Trim to win of what has chged.</span><span class=cF0>
<a name="l639"></a> </span><span class=cF9>I64</span><span class=cF0> i,x1=0,y1=0,x2=update-&gt;width-1,y2=update-&gt;height-1; </span><span class=cF2>//inclusive</span><span class=cF0>
<a name="l640"></a> </span><span class=cF9>U32</span><span class=cF0> *ptr_base,*ptr_update;
<a name="l641"></a> </span><span class=cF9>CDC</span><span class=cF0> *res;
<a name="l642"></a> ptr_base =base-&gt;body;
<a name="l643"></a> ptr_update=update-&gt;body;
<a name="l644"></a> </span><span class=cF1>while</span><span class=cF0> (y1&lt;=y2) </span><span class=cF7>{</span><span class=cF0>
<a name="l645"></a> i=update-&gt;width&gt;&gt;2;
<a name="l646"></a> </span><span class=cF1>while</span><span class=cF0> (i--)
<a name="l647"></a> </span><span class=cF1>if</span><span class=cF0> (*ptr_base++!=*ptr_update++)
<a name="l648"></a> </span><span class=cF1>goto</span><span class=cF0> df_y2;
<a name="l649"></a> i=update-&gt;width&amp;3;
<a name="l650"></a> </span><span class=cF1>while</span><span class=cF0> (i--)
<a name="l651"></a> </span><span class=cF1>if</span><span class=cF0> (*ptr_base</span><span class=cF7>(</span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++!=*ptr_update</span><span class=cF7>(</span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++)
<a name="l652"></a> </span><span class=cF1>goto</span><span class=cF0> df_y2;
<a name="l653"></a> y1++;
<a name="l654"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l655"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l656"></a>df_y2:
<a name="l657"></a> ptr_base =base-&gt;body +base-&gt;width_internal *base-&gt;height;
<a name="l658"></a> ptr_update=update-&gt;body+update-&gt;width_internal*update-&gt;height;
<a name="l659"></a> </span><span class=cF1>while</span><span class=cF0> (y1&lt;y2) </span><span class=cF7>{</span><span class=cF0>
<a name="l660"></a> i=update-&gt;width&gt;&gt;2;
<a name="l661"></a> </span><span class=cF1>while</span><span class=cF0> (i--)
<a name="l662"></a> </span><span class=cF1>if</span><span class=cF0> (*--ptr_base!=*--ptr_update)
<a name="l663"></a> </span><span class=cF1>goto</span><span class=cF0> df_x1;
<a name="l664"></a> i=update-&gt;width&amp;3;
<a name="l665"></a> </span><span class=cF1>while</span><span class=cF0> (i--)
<a name="l666"></a> </span><span class=cF1>if</span><span class=cF0> (*--ptr_base</span><span class=cF7>(</span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>!=*--ptr_update</span><span class=cF7>(</span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>)
<a name="l667"></a> </span><span class=cF1>goto</span><span class=cF0> df_x1;
<a name="l668"></a> y2--;
<a name="l669"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l670"></a>df_x1:
<a name="l671"></a> </span><span class=cF1>while</span><span class=cF0> (x1&lt;x2) </span><span class=cF7>{</span><span class=cF0>
<a name="l672"></a> </span><span class=cF1>for</span><span class=cF0> (i=y1;i&lt;=y2;i++)
<a name="l673"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>GrPeek0</span><span class=cF7>(</span><span class=cF0>base,x1,i</span><span class=cF7>)</span><span class=cF0>!=</span><span class=cF5>GrPeek0</span><span class=cF7>(</span><span class=cF0>update,x1,i</span><span class=cF7>)</span><span class=cF0>)
<a name="l674"></a> </span><span class=cF1>goto</span><span class=cF0> df_x2;
<a name="l675"></a> x1++;
<a name="l676"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l677"></a>df_x2:
<a name="l678"></a> </span><span class=cF1>while</span><span class=cF0> (x1&lt;x2) </span><span class=cF7>{</span><span class=cF0>
<a name="l679"></a> </span><span class=cF1>for</span><span class=cF0> (i=y1;i&lt;=y2;i++)
<a name="l680"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>GrPeek0</span><span class=cF7>(</span><span class=cF0>base,x2,i</span><span class=cF7>)</span><span class=cF0>!=</span><span class=cF5>GrPeek0</span><span class=cF7>(</span><span class=cF0>update,x2,i</span><span class=cF7>)</span><span class=cF0>)
<a name="l681"></a> </span><span class=cF1>goto</span><span class=cF0> df_done;
<a name="l682"></a> x2--;
<a name="l683"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l684"></a>df_done:
<a name="l685"></a> res=</span><span class=cF5>DCExt</span><span class=cF0>(update,x1,y1,x2,y2);
<a name="l686"></a> res-&gt;x0=x1;
<a name="l687"></a> res-&gt;y0=y1;
<a name="l688"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l689"></a>}
<a name="l690"></a>
<a name="l691"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>&quot;Graphics/Char;Char/Graphics&quot;</span><span class=cF0>
<a name="l692"></a>
<a name="l693"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>GrPutChar</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *dc=</span><span class=cFB>gr</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=cF1>U8</span><span class=cF0> ch)
<a name="l694"></a>{</span><span class=cF2>//2D. Clipping but not transformation.</span><span class=cF0>
<a name="l695"></a> </span><span class=cF1>U8</span><span class=cF0> </span><span class=cF1>reg</span><span class=cF0> *src,</span><span class=cF1>reg</span><span class=cF0> *dst,*font_ptr;
<a name="l696"></a> </span><span class=cF9>I64</span><span class=cF0> i,m,leading_pixels,trailing_pixels,leading_pixel_mask,trailing_pixel_mask,
<a name="l697"></a> j,k1,kk1,w1,h1,w2,h2,</span><span class=cF1>reg</span><span class=cF0> bit_shift,</span><span class=cF1>reg</span><span class=cF0> color_mask,dist;
<a name="l698"></a> </span><span class=cF9>CColorROPU32</span><span class=cF0> color,c;
<a name="l699"></a> </span><span class=cF9>CTask</span><span class=cF0> *win_task;
<a name="l700"></a>
<a name="l701"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l702"></a> win_task=dc-&gt;win_task;
<a name="l703"></a> x+=win_task-&gt;scroll_x;
<a name="l704"></a> y+=win_task-&gt;scroll_y;
<a name="l705"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l706"></a>
<a name="l707"></a> </span><span class=cF1>if</span><span class=cF0> (x&lt;0)
<a name="l708"></a> w1=-x;
<a name="l709"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l710"></a> w1=0;
<a name="l711"></a> </span><span class=cF1>if</span><span class=cF0> (y&lt;0)
<a name="l712"></a> h1=-y;
<a name="l713"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l714"></a> h1=0;
<a name="l715"></a> w2=</span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
<a name="l716"></a> h2=</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
<a name="l717"></a>
<a name="l718"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l719"></a> x+=win_task-&gt;pix_left;
<a name="l720"></a> y+=win_task-&gt;pix_top;
<a name="l721"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l722"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_LOCATE_NEAREST</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l723"></a> dist=</span><span class=cF5>DistSqrI64</span><span class=cF0>(x+w2&gt;&gt;1,y+h2&gt;&gt;1,dc-&gt;cur_x,dc-&gt;cur_y);
<a name="l724"></a> </span><span class=cF1>if</span><span class=cF0> (dist&lt;=dc-&gt;nearest_dist)
<a name="l725"></a> dc-&gt;nearest_dist=dist;
<a name="l726"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l727"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l728"></a> </span><span class=cF1>if</span><span class=cF0> (x+w1&lt;0) w1=-x;
<a name="l729"></a> </span><span class=cF1>if</span><span class=cF0> (x+w2&gt;win_task-&gt;pix_right+1)
<a name="l730"></a> w2=win_task-&gt;pix_right+1-x;
<a name="l731"></a>
<a name="l732"></a> </span><span class=cF1>if</span><span class=cF0> (y+h1&lt;0) h1=-y;
<a name="l733"></a> </span><span class=cF1>if</span><span class=cF0> (y+h2&gt;win_task-&gt;pix_bottom+1)
<a name="l734"></a> h2=win_task-&gt;pix_bottom+1-y;
<a name="l735"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l736"></a> </span><span class=cF1>if</span><span class=cF0> (x+w2&gt;dc-&gt;width)
<a name="l737"></a> w2=dc-&gt;width-x;
<a name="l738"></a> </span><span class=cF1>if</span><span class=cF0> (y+h2&gt;dc-&gt;height)
<a name="l739"></a> h2=dc-&gt;height-y;
<a name="l740"></a> </span><span class=cF1>if</span><span class=cF0> (w1&lt;w2&lt;=</span><span class=cF3>FONT_WIDTH</span><span class=cF0> &amp;&amp; h1&lt;h2&lt;=</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l741"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_RECORD_EXTENTS</span><span class=cF0>) {
<a name="l742"></a> </span><span class=cF1>if</span><span class=cF0> (x+w1 &lt;dc-&gt;min_x) dc-&gt;min_x=x+w1;
<a name="l743"></a> </span><span class=cF1>if</span><span class=cF0> (x+w2-1&gt;dc-&gt;max_x) dc-&gt;max_x=x+w2-1;
<a name="l744"></a> </span><span class=cF1>if</span><span class=cF0> (y+h1 &lt;dc-&gt;min_y) dc-&gt;min_y=y+h1;
<a name="l745"></a> </span><span class=cF1>if</span><span class=cF0> (y+h2-1&gt;dc-&gt;max_y) dc-&gt;max_y=y+h2-1;
<a name="l746"></a> }
<a name="l747"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_DONT_DRAW</span><span class=cF0>)
<a name="l748"></a> </span><span class=cF1>return</span><span class=cF0> 1;
<a name="l749"></a> color=dc-&gt;color;
<a name="l750"></a> leading_pixels=-(w1+x)&amp;7;
<a name="l751"></a> </span><span class=cF1>if</span><span class=cF0> (!leading_pixels) leading_pixels=8;
<a name="l752"></a> leading_pixel_mask=</span><span class=cFB>gr</span><span class=cF0>.to_8_bits[0xFF&gt;&gt;leading_pixels];
<a name="l753"></a> bit_shift=-x&amp;7;
<a name="l754"></a> trailing_pixels=(x+w2)&amp;7;
<a name="l755"></a> trailing_pixel_mask=</span><span class=cFB>gr</span><span class=cF0>.to_8_bits[0xFF&lt;&lt;trailing_pixels&amp;0xFF];
<a name="l756"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels+trailing_pixels&gt;w2-w1) {
<a name="l757"></a> leading_pixel_mask|=trailing_pixel_mask;
<a name="l758"></a> trailing_pixels=0;
<a name="l759"></a> }
<a name="l760"></a> font_ptr=&amp;</span><span class=cFB>text</span><span class=cF0>.font(</span><span class=cF1>U8</span><span class=cF0> *)[</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>*ch+h1];
<a name="l761"></a> </span><span class=cF1>if</span><span class=cF0> (color.c0.rop==</span><span class=cF3>ROPB_COLLISION</span><span class=cF0>) {
<a name="l762"></a> m=w1&amp;(</span><span class=cF3>FONT_WIDTH</span><span class=cF0>-1);
<a name="l763"></a>#</span><span class=cF1>assert</span><span class=cF0> </span><span class=cF3>FONT_WIDTH</span><span class=cF0>==8
<a name="l764"></a> color =dc-&gt;bkcolor.c0.color;
<a name="l765"></a> </span><span class=cF1>for</span><span class=cF0> (i=w1;i&lt;w2;i++,m++) </span><span class=cF7>{</span><span class=cF0>
<a name="l766"></a> k1=(h1+y)*dc-&gt;width_internal+x;
<a name="l767"></a> src=font_ptr;
<a name="l768"></a> </span><span class=cF1>for</span><span class=cF0> (j=h2-h1;j;j--) {
<a name="l769"></a> c=dc-&gt;body[k1+i];
<a name="l770"></a> </span><span class=cF1>if</span><span class=cF0> (c!=</span><span class=cF3>TRANSPARENT</span><span class=cF0> &amp;&amp; c!=color &amp;&amp; </span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>src,m</span><span class=cF7>)</span><span class=cF0>)
<a name="l771"></a> dc-&gt;collision_cnt++;
<a name="l772"></a> k1+=dc-&gt;width_internal;
<a name="l773"></a> src++;
<a name="l774"></a> }
<a name="l775"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l776"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l777"></a> color_mask=</span><span class=cFB>gr</span><span class=cF0>.to_8_colors[color.c0.color];
<a name="l778"></a> k1=x+w1;
<a name="l779"></a> kk1=(h1+y)*dc-&gt;width_internal+k1;
<a name="l780"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF7>)</span><span class=cF0> || dc-&gt;flags&amp;</span><span class=cF3>DCF_ON_TOP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l781"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels) {
<a name="l782"></a> dst=dc-&gt;body+kk1&amp;~7;
<a name="l783"></a> src=font_ptr;
<a name="l784"></a> </span><span class=cF1>if</span><span class=cF0> (bit_shift)
<a name="l785"></a> src--;
<a name="l786"></a> </span><span class=cF1>switch</span><span class=cF0> [color.c0.rop] </span><span class=cF7>{</span><span class=cF0>
<a name="l787"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_EQU</span><span class=cF0>:
<a name="l788"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_MONO</span><span class=cF0>:
<a name="l789"></a> </span><span class=cF1>for</span><span class=cF0> (j=h2-h1;j;j--) {
<a name="l790"></a> m=</span><span class=cFB>gr</span><span class=cF0>.to_8_bits[*src(</span><span class=cF9>U16</span><span class=cF0> *)&gt;&gt;bit_shift&amp;0xFF];
<a name="l791"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l792"></a> (color_mask&amp;m|*dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>&amp;~m)&amp;~leading_pixel_mask;
<a name="l793"></a> src++;
<a name="l794"></a> dst+=dc-&gt;width_internal;
<a name="l795"></a> }
<a name="l796"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l797"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_XOR</span><span class=cF0>:
<a name="l798"></a> </span><span class=cF1>if</span><span class=cF0> (color_mask) {
<a name="l799"></a> </span><span class=cF1>for</span><span class=cF0> (j=h2-h1;j;j--) </span><span class=cF7>{</span><span class=cF0>
<a name="l800"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l801"></a> (*dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>^</span><span class=cFB>gr</span><span class=cF0>.to_8_bits[*src</span><span class=cF7>(</span><span class=cF9>U16</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>&gt;&gt;bit_shift&amp;0xFF])&amp;
<a name="l802"></a> ~leading_pixel_mask;
<a name="l803"></a> src++;
<a name="l804"></a> dst+=dc-&gt;width_internal;
<a name="l805"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l806"></a> }
<a name="l807"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l808"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l809"></a> kk1+=8;
<a name="l810"></a> }
<a name="l811"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels) {
<a name="l812"></a> dst=dc-&gt;body+kk1&amp;~7;
<a name="l813"></a> src=font_ptr+1;
<a name="l814"></a> </span><span class=cF1>if</span><span class=cF0> (bit_shift)
<a name="l815"></a> src--;
<a name="l816"></a> </span><span class=cF1>switch</span><span class=cF0> [color.c0.rop] </span><span class=cF7>{</span><span class=cF0>
<a name="l817"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_EQU</span><span class=cF0>:
<a name="l818"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_MONO</span><span class=cF0>:
<a name="l819"></a> </span><span class=cF1>for</span><span class=cF0> (j=h2-h1;j;j--) {
<a name="l820"></a> m=</span><span class=cFB>gr</span><span class=cF0>.to_8_bits[*src(</span><span class=cF9>U16</span><span class=cF0> *)&gt;&gt;bit_shift&amp;0xFF];
<a name="l821"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l822"></a> (color_mask&amp;m|*dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>&amp;~m)&amp;~trailing_pixel_mask;
<a name="l823"></a> src++;
<a name="l824"></a> dst+=dc-&gt;width_internal;
<a name="l825"></a> }
<a name="l826"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l827"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_XOR</span><span class=cF0>:
<a name="l828"></a> </span><span class=cF1>if</span><span class=cF0> (color_mask)
<a name="l829"></a> </span><span class=cF1>for</span><span class=cF0> (j=h2-h1;j;j--) {
<a name="l830"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l831"></a> (*dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>^</span><span class=cFB>gr</span><span class=cF0>.to_8_bits[*src</span><span class=cF7>(</span><span class=cF9>U16</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>&gt;&gt;bit_shift&amp;0xFF])&amp;
<a name="l832"></a> ~trailing_pixel_mask;
<a name="l833"></a> src++;
<a name="l834"></a> dst+=dc-&gt;width_internal;
<a name="l835"></a> }
<a name="l836"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l837"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l838"></a> }
<a name="l839"></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="l840"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels) {
<a name="l841"></a> dst=dc-&gt;body+kk1&amp;~7;
<a name="l842"></a> src=font_ptr;
<a name="l843"></a> </span><span class=cF1>if</span><span class=cF0> (bit_shift)
<a name="l844"></a> src--;
<a name="l845"></a> </span><span class=cF1>switch</span><span class=cF0> [color.c0.rop] </span><span class=cF7>{</span><span class=cF0>
<a name="l846"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_EQU</span><span class=cF0>:
<a name="l847"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_MONO</span><span class=cF0>:
<a name="l848"></a> </span><span class=cF1>for</span><span class=cF0> (j=h1;j&lt;h2;j++) {
<a name="l849"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>IsPixCovered0</span><span class=cF7>(</span><span class=cF0>win_task,k1,y+j</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l850"></a> m=</span><span class=cFB>gr</span><span class=cF0>.to_8_bits[*src(</span><span class=cF9>U16</span><span class=cF0> *)&gt;&gt;bit_shift&amp;0xFF];
<a name="l851"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l852"></a> (color_mask&amp;m|*dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>&amp;~m)&amp;~leading_pixel_mask;
<a name="l853"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l854"></a> src++;
<a name="l855"></a> dst+=dc-&gt;width_internal;
<a name="l856"></a> }
<a name="l857"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l858"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_XOR</span><span class=cF0>:
<a name="l859"></a> </span><span class=cF1>if</span><span class=cF0> (color_mask)
<a name="l860"></a> </span><span class=cF1>for</span><span class=cF0> (j=h1;j&lt;h2;j++) {
<a name="l861"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>IsPixCovered0</span><span class=cF7>(</span><span class=cF0>win_task,k1,y+j</span><span class=cF7>)</span><span class=cF0>)
<a name="l862"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l863"></a> (*dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>^</span><span class=cFB>gr</span><span class=cF0>.to_8_bits
<a name="l864"></a> [*src</span><span class=cF7>(</span><span class=cF9>U16</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>&gt;&gt;bit_shift&amp;0xFF])&amp;
<a name="l865"></a> ~leading_pixel_mask;
<a name="l866"></a> src++;
<a name="l867"></a> dst+=dc-&gt;width_internal;
<a name="l868"></a> }
<a name="l869"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l870"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l871"></a> k1+=8;
<a name="l872"></a> kk1+=8;
<a name="l873"></a> }
<a name="l874"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels) {
<a name="l875"></a> dst=dc-&gt;body+kk1&amp;~7;
<a name="l876"></a> src=font_ptr+1;
<a name="l877"></a> </span><span class=cF1>if</span><span class=cF0> (bit_shift)
<a name="l878"></a> src--;
<a name="l879"></a> </span><span class=cF1>switch</span><span class=cF0> [color.c0.rop] </span><span class=cF7>{</span><span class=cF0>
<a name="l880"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_EQU</span><span class=cF0>:
<a name="l881"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_MONO</span><span class=cF0>:
<a name="l882"></a> </span><span class=cF1>for</span><span class=cF0> (j=h1;j&lt;h2;j++) {
<a name="l883"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>IsPixCovered0</span><span class=cF7>(</span><span class=cF0>win_task,k1,y+j</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l884"></a> m=</span><span class=cFB>gr</span><span class=cF0>.to_8_bits[*src(</span><span class=cF9>U16</span><span class=cF0> *)&gt;&gt;bit_shift&amp;0xFF];
<a name="l885"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l886"></a> (color_mask&amp;m|*dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>&amp;~m)&amp;~trailing_pixel_mask;
<a name="l887"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l888"></a> src++;
<a name="l889"></a> dst+=dc-&gt;width_internal;
<a name="l890"></a> }
<a name="l891"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l892"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_XOR</span><span class=cF0>:
<a name="l893"></a> </span><span class=cF1>if</span><span class=cF0> (color_mask)
<a name="l894"></a> </span><span class=cF1>for</span><span class=cF0> (j=h1;j&lt;h2;j++) {
<a name="l895"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>IsPixCovered0</span><span class=cF7>(</span><span class=cF0>win_task,k1,y+j</span><span class=cF7>)</span><span class=cF0>)
<a name="l896"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l897"></a> (*dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>^</span><span class=cFB>gr</span><span class=cF0>.to_8_bits
<a name="l898"></a> [*src</span><span class=cF7>(</span><span class=cF9>U16</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>&gt;&gt;bit_shift&amp;0xFF])&amp;
<a name="l899"></a> ~trailing_pixel_mask;
<a name="l900"></a> src++;
<a name="l901"></a> dst+=dc-&gt;width_internal;
<a name="l902"></a> }
<a name="l903"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l904"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l905"></a> }
<a name="l906"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l907"></a> }
<a name="l908"></a> </span><span class=cF1>return</span><span class=cF0> 1;
<a name="l909"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l910"></a> </span><span class=cF1>return</span><span class=cF0> 0;
<a name="l911"></a>}
<a name="l912"></a>
<a name="l913"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>GrPutS</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *dc=</span><span class=cFB>gr</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=cF1>U8</span><span class=cF0> *_s)
<a name="l914"></a>{</span><span class=cF2>//Use </span><a href="/Wb/Adam/Gr/GrBitMap.HC.HTML#l989"><span class=cF4>GrPrint</span></a><span class=cF2>()</span><span class=cF0>
<a name="l915"></a> </span><span class=cF9>I64</span><span class=cF0> x0,sx=0,sy=0,res;
<a name="l916"></a> </span><span class=cF1>if</span><span class=cF0> (!_s) </span><span class=cF1>return</span><span class=cF0> 0;
<a name="l917"></a> x0=x;
<a name="l918"></a> res=0;
<a name="l919"></a> </span><span class=cF1>while</span><span class=cF0> (*_s) </span><span class=cF7>{</span><span class=cF0>
<a name="l920"></a> </span><span class=cF1>if</span><span class=cF0> (*_s==</span><span class=cF6>'\n'</span><span class=cF0>) {
<a name="l921"></a> x=x0;
<a name="l922"></a> y+=</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
<a name="l923"></a> _s++;
<a name="l924"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (*_s==</span><span class=cF6>'\t'</span><span class=cF0>) {
<a name="l925"></a> x=x0+</span><span class=cF5>CeilU64</span><span class=cF0>(x-x0+</span><span class=cF3>FONT_WIDTH</span><span class=cF0>,8*</span><span class=cF3>FONT_WIDTH</span><span class=cF0>);
<a name="l926"></a> _s++;
<a name="l927"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (*_s</span><span class=cF7>(</span><span class=cF9>U32</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>==</span><span class=cF6>'$SY,'</span><span class=cF0>) {
<a name="l928"></a> </span><span class=cF1>if</span><span class=cF0> (_s[4]==</span><span class=cF6>'-'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l929"></a> _s++;
<a name="l930"></a> sy=</span><span class=cF6>'0'</span><span class=cF0>-_s[4];
<a name="l931"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l932"></a> sy=_s[4]-</span><span class=cF6>'0'</span><span class=cF0>;
<a name="l933"></a> _s+=6;
<a name="l934"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (*_s</span><span class=cF7>(</span><span class=cF9>U32</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>==</span><span class=cF6>'$SX,'</span><span class=cF0>) {
<a name="l935"></a> </span><span class=cF1>if</span><span class=cF0> (_s[4]==</span><span class=cF6>'-'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l936"></a> _s++;
<a name="l937"></a> sx=</span><span class=cF6>'0'</span><span class=cF0>-_s[4];
<a name="l938"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l939"></a> sx=_s[4]-</span><span class=cF6>'0'</span><span class=cF0>;
<a name="l940"></a> _s+=6;
<a name="l941"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l942"></a> res+=</span><span class=cF5>GrPutChar</span><span class=cF0>(dc,x+sx,y+sy,*_s);
<a name="l943"></a> x+=</span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
<a name="l944"></a> _s++;
<a name="l945"></a> }
<a name="l946"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l947"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l948"></a>}
<a name="l949"></a>
<a name="l950"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>GrVPutS</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *dc=</span><span class=cFB>gr</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=cF1>U8</span><span class=cF0> *_s)
<a name="l951"></a>{</span><span class=cF2>//Vertical Text. Use </span><a href="/Wb/Adam/Gr/GrBitMap.HC.HTML#l998"><span class=cF4>GrVPrint</span></a><span class=cF2>()</span><span class=cF0>
<a name="l952"></a> </span><span class=cF9>I64</span><span class=cF0> y0,sx=0,sy=0,res;
<a name="l953"></a> </span><span class=cF1>U8</span><span class=cF0> buf[2];
<a name="l954"></a> </span><span class=cF1>if</span><span class=cF0> (!_s) </span><span class=cF1>return</span><span class=cF0> 0;
<a name="l955"></a> y0=y;
<a name="l956"></a> res=0;
<a name="l957"></a> buf[1]=0;
<a name="l958"></a> </span><span class=cF1>while</span><span class=cF0> (*_s) </span><span class=cF7>{</span><span class=cF0>
<a name="l959"></a> </span><span class=cF1>if</span><span class=cF0> (*_s==</span><span class=cF6>'\n'</span><span class=cF0>) {
<a name="l960"></a> y=y0;
<a name="l961"></a> x+=</span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
<a name="l962"></a> _s++;
<a name="l963"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (*_s==</span><span class=cF6>'\t'</span><span class=cF0>) {
<a name="l964"></a> y=y0+</span><span class=cF5>CeilU64</span><span class=cF0>(y-y0+</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>,8*</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>);
<a name="l965"></a> _s++;
<a name="l966"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (*_s</span><span class=cF7>(</span><span class=cF9>U32</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>==</span><span class=cF6>'$SY,'</span><span class=cF0>) {
<a name="l967"></a> </span><span class=cF1>if</span><span class=cF0> (_s[4]==</span><span class=cF6>'-'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l968"></a> _s++;
<a name="l969"></a> sx=</span><span class=cF6>'0'</span><span class=cF0>-_s[4];
<a name="l970"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l971"></a> sx=_s[4]-</span><span class=cF6>'0'</span><span class=cF0>;
<a name="l972"></a> _s+=6;
<a name="l973"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (*_s</span><span class=cF7>(</span><span class=cF9>U32</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>==</span><span class=cF6>'$SX,'</span><span class=cF0>) {
<a name="l974"></a> </span><span class=cF1>if</span><span class=cF0> (_s[4]==</span><span class=cF6>'-'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l975"></a> _s++;
<a name="l976"></a> sy=</span><span class=cF6>'0'</span><span class=cF0>-_s[4];
<a name="l977"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l978"></a> sy=_s[4]-</span><span class=cF6>'0'</span><span class=cF0>;
<a name="l979"></a> _s+=6;
<a name="l980"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l981"></a> *buf=*_s++;
<a name="l982"></a> res+=</span><span class=cF5>GrPutS</span><span class=cF0>(dc,x,y,buf);
<a name="l983"></a> y+=</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
<a name="l984"></a> }
<a name="l985"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l986"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l987"></a>}
<a name="l988"></a>
<a name="l989"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>GrPrint</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *dc=</span><span class=cFB>gr</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=cF1>U8</span><span class=cF0> *fmt,...)
<a name="l990"></a>{</span><span class=cF2>//2D. Clipping but not transformation.</span><span class=cF0>
<a name="l991"></a> </span><span class=cF9>I64</span><span class=cF0> res;
<a name="l992"></a> </span><span class=cF1>U8</span><span class=cF0> *buf=</span><span class=cF5>StrPrintJoin</span><span class=cF0>(</span><span class=cF3>NULL</span><span class=cF0>,fmt,argc,argv);
<a name="l993"></a> res=</span><span class=cF5>GrPutS</span><span class=cF0>(dc,x,y,buf);
<a name="l994"></a> </span><span class=cF5>Free</span><span class=cF0>(buf);
<a name="l995"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l996"></a>}
<a name="l997"></a>
<a name="l998"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>GrVPrint</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *dc=</span><span class=cFB>gr</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=cF1>U8</span><span class=cF0> *fmt,...)
<a name="l999"></a>{</span><span class=cF2>//2D. Vertical text. Clipping but not transformation.</span><span class=cF0>
<a name="l1000"></a> </span><span class=cF9>I64</span><span class=cF0> res;
<a name="l1001"></a> </span><span class=cF1>U8</span><span class=cF0> *buf=</span><span class=cF5>StrPrintJoin</span><span class=cF0>(</span><span class=cF3>NULL</span><span class=cF0>,fmt,argc,argv);
<a name="l1002"></a> res=</span><span class=cF5>GrVPutS</span><span class=cF0>(dc,x,y,buf);
<a name="l1003"></a> </span><span class=cF5>Free</span><span class=cF0>(buf);
<a name="l1004"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l1005"></a>}
<a name="l1006"></a>
<a name="l1007"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>&quot;Graphics&quot;</span><span class=cF0>
<a name="l1008"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>GrRect</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *dc=</span><span class=cFB>gr</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> w,</span><span class=cF9>I64</span><span class=cF0> h)
<a name="l1009"></a>{</span><span class=cF2>//2D. Width Height. Clipping but not transformation.</span><span class=cF0>
<a name="l1010"></a></span><span class=cF2>//Returns cnt of pixs changed.</span><span class=cF0>
<a name="l1011"></a> </span><span class=cF9>I64</span><span class=cF0> i,res=0,j,k1,kk1,w1,h1,w2,h2,dist,
<a name="l1012"></a> leading_pixels,original_leading_pixels,whole_I64s,
<a name="l1013"></a> trailing_pixels,leading_pixel_mask,trailing_pixel_mask,
<a name="l1014"></a> win_z_buf_line_inc,win_z_buf_line_dec,win_z_num,color_mask;
<a name="l1015"></a> </span><span class=cF1>U8</span><span class=cF0> </span><span class=cF1>reg</span><span class=cF0> *dst;
<a name="l1016"></a> </span><span class=cF9>U16</span><span class=cF0> </span><span class=cF1>reg</span><span class=cF0> *win_z_buf_ptr;
<a name="l1017"></a> </span><span class=cF9>CColorROPU32</span><span class=cF0> color,c,dither_colors;
<a name="l1018"></a> </span><span class=cF1>Bool</span><span class=cF0> dither,probability_dither;
<a name="l1019"></a> </span><span class=cF9>CTask</span><span class=cF0> *win_task;
<a name="l1020"></a>
<a name="l1021"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1022"></a> win_task=dc-&gt;win_task;
<a name="l1023"></a> x+=win_task-&gt;scroll_x;
<a name="l1024"></a> y+=win_task-&gt;scroll_y;
<a name="l1025"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1026"></a>
<a name="l1027"></a> </span><span class=cF1>if</span><span class=cF0> (x&lt;0)
<a name="l1028"></a> w1=-x;
<a name="l1029"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1030"></a> w1=0;
<a name="l1031"></a> </span><span class=cF1>if</span><span class=cF0> (y&lt;0)
<a name="l1032"></a> h1=-y;
<a name="l1033"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1034"></a> h1=0;
<a name="l1035"></a> w2=w;
<a name="l1036"></a> h2=h;
<a name="l1037"></a>
<a name="l1038"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1039"></a> x+=win_task-&gt;pix_left;
<a name="l1040"></a> y+=win_task-&gt;pix_top;
<a name="l1041"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1042"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_LOCATE_NEAREST</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF2>//TODO:Untested</span><span class=cF0>
<a name="l1043"></a> </span><span class=cF1>if</span><span class=cF0> (x&lt;=dc-&gt;cur_x&lt;=x+w &amp;&amp; y&lt;=dc-&gt;cur_y&lt;=y+h)
<a name="l1044"></a> dist=0;
<a name="l1045"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1046"></a> dist=</span><span class=cF5>DistSqrI64</span><span class=cF0>(x+w&gt;&gt;1,y+h&gt;&gt;1,dc-&gt;cur_x,dc-&gt;cur_y);
<a name="l1047"></a> </span><span class=cF1>if</span><span class=cF0> (dist&lt;=dc-&gt;nearest_dist)
<a name="l1048"></a> dc-&gt;nearest_dist=dist;
<a name="l1049"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1050"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1051"></a> </span><span class=cF1>if</span><span class=cF0> (x+w1&lt;0) w1=-x;
<a name="l1052"></a> </span><span class=cF1>if</span><span class=cF0> (x+w2&gt;win_task-&gt;pix_right+1)
<a name="l1053"></a> w2=win_task-&gt;pix_right+1-x;
<a name="l1054"></a>
<a name="l1055"></a> </span><span class=cF1>if</span><span class=cF0> (y+h1&lt;0) h1=-y;
<a name="l1056"></a> </span><span class=cF1>if</span><span class=cF0> (y+h2&gt;win_task-&gt;pix_bottom+1)
<a name="l1057"></a> h2=win_task-&gt;pix_bottom+1-y;
<a name="l1058"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1059"></a> </span><span class=cF1>if</span><span class=cF0> (x+w2&gt;dc-&gt;width)
<a name="l1060"></a> w2=dc-&gt;width-x;
<a name="l1061"></a> </span><span class=cF1>if</span><span class=cF0> (y+h2&gt;dc-&gt;height)
<a name="l1062"></a> h2=dc-&gt;height-y;
<a name="l1063"></a> </span><span class=cF1>if</span><span class=cF0> (w1&lt;w2&lt;=w &amp;&amp; h1&lt;h2&lt;=h) </span><span class=cF7>{</span><span class=cF0>
<a name="l1064"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_RECORD_EXTENTS</span><span class=cF0>) {
<a name="l1065"></a> </span><span class=cF1>if</span><span class=cF0> (x+w1 &lt;dc-&gt;min_x) dc-&gt;min_x=x+w1;
<a name="l1066"></a> </span><span class=cF1>if</span><span class=cF0> (x+w2-1&gt;dc-&gt;max_x) dc-&gt;max_x=x+w2-1;
<a name="l1067"></a> </span><span class=cF1>if</span><span class=cF0> (y+h1 &lt;dc-&gt;min_y) dc-&gt;min_y=y+h1;
<a name="l1068"></a> </span><span class=cF1>if</span><span class=cF0> (y+h2-1&gt;dc-&gt;max_y) dc-&gt;max_y=y+h2-1;
<a name="l1069"></a> }
<a name="l1070"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_DONT_DRAW</span><span class=cF0>)
<a name="l1071"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l1072"></a> color=dc-&gt;color;
<a name="l1073"></a> </span><span class=cF1>if</span><span class=cF0> (color.c1.rop&amp;</span><span class=cF7>(</span><span class=cF3>ROPBF_DITHER</span><span class=cF0>|</span><span class=cF3>ROPBF_PROBABILITY_DITHER</span><span class=cF7>)</span><span class=cF0>) {
<a name="l1074"></a> dither=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l1075"></a> </span><span class=cF1>if</span><span class=cF0> (color.c1.rop&amp;</span><span class=cF3>ROPBF_PROBABILITY_DITHER</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1076"></a> probability_dither=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l1077"></a> color.c1.rop=color.c0.rop;
<a name="l1078"></a> dither_colors=color;
<a name="l1079"></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="l1080"></a> probability_dither=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l1081"></a> color.c1.rop=color.c0.rop;
<a name="l1082"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1083"></a> } </span><span class=cF1>else</span><span class=cF0>
<a name="l1084"></a> dither=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l1085"></a> original_leading_pixels=leading_pixels=-(w1+x)&amp;7;
<a name="l1086"></a> leading_pixel_mask=</span><span class=cFB>gr</span><span class=cF0>.to_8_bits[0xFF&gt;&gt;leading_pixels];
<a name="l1087"></a> whole_I64s=(w2-w1-leading_pixels)&gt;&gt;3;
<a name="l1088"></a> </span><span class=cF1>if</span><span class=cF0> (whole_I64s&lt;0) whole_I64s=0;
<a name="l1089"></a> trailing_pixels=(x+w2)&amp;7;
<a name="l1090"></a> trailing_pixel_mask=</span><span class=cFB>gr</span><span class=cF0>.to_8_bits[0xFF&lt;&lt;trailing_pixels&amp;0xFF];
<a name="l1091"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels+trailing_pixels&gt;w2-w1) {
<a name="l1092"></a> leading_pixel_mask|=trailing_pixel_mask;
<a name="l1093"></a> leading_pixels=w2-w1; </span><span class=cF2>//Correct so it's right for res.</span><span class=cF0>
<a name="l1094"></a> trailing_pixels=0;
<a name="l1095"></a> }
<a name="l1096"></a> </span><span class=cF1>if</span><span class=cF0> (color.c0.rop==</span><span class=cF3>ROPB_COLLISION</span><span class=cF0>) {</span><span class=cF2>//TODO: Might want to check win_z_buf</span><span class=cF0>
<a name="l1097"></a> color =dc-&gt;bkcolor.c0.color;
<a name="l1098"></a> k1=(h1+y)*dc-&gt;width_internal+x;
<a name="l1099"></a> res=-dc-&gt;collision_cnt;
<a name="l1100"></a> </span><span class=cF1>for</span><span class=cF0> (j=h2-h1;j;j--) </span><span class=cF7>{</span><span class=cF0>
<a name="l1101"></a> </span><span class=cF1>for</span><span class=cF0> (i=w1;i&lt;w2;i++) {
<a name="l1102"></a> c=dc-&gt;body[k1+i];
<a name="l1103"></a> </span><span class=cF1>if</span><span class=cF0> (c!=</span><span class=cF3>TRANSPARENT</span><span class=cF0> &amp;&amp; c!=color)
<a name="l1104"></a> dc-&gt;collision_cnt++;
<a name="l1105"></a> }
<a name="l1106"></a> k1+=dc-&gt;width_internal;
<a name="l1107"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1108"></a> res+=dc-&gt;collision_cnt;
<a name="l1109"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l1110"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF7>)</span><span class=cF0> || dc-&gt;flags&amp;</span><span class=cF3>DCF_ON_TOP</span><span class=cF0>)
<a name="l1111"></a> win_z_buf_ptr=</span><span class=cF3>NULL</span><span class=cF0>;
<a name="l1112"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l1113"></a> win_z_num=win_task-&gt;win_z_num;
<a name="l1114"></a> win_z_buf_ptr=</span><span class=cFB>gr</span><span class=cF0>.win_z_buf(</span><span class=cF1>U8</span><span class=cF0> *)+(</span><span class=cF7>(</span><span class=cF0>h1+y</span><span class=cF7>)</span><span class=cF0>/</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>*</span><span class=cF3>TEXT_COLS</span><span class=cF0>+
<a name="l1115"></a> </span><span class=cF7>(</span><span class=cF0>w1+x</span><span class=cF7>)</span><span class=cF0>/</span><span class=cF3>FONT_WIDTH</span><span class=cF0>)*</span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>U16</span><span class=cF0>);
<a name="l1116"></a> win_z_buf_line_dec=whole_I64s;
<a name="l1117"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels)
<a name="l1118"></a> win_z_buf_line_dec++;
<a name="l1119"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels)
<a name="l1120"></a> win_z_buf_line_dec++;
<a name="l1121"></a> win_z_buf_line_dec*=</span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>U16</span><span class=cF0>);
<a name="l1122"></a> win_z_buf_line_inc=</span><span class=cF3>TEXT_COLS</span><span class=cF0>*</span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>U16</span><span class=cF0>)-win_z_buf_line_dec;
<a name="l1123"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1124"></a> kk1=(h1+y)*dc-&gt;width_internal+x+w1;
<a name="l1125"></a> </span><span class=cF1>if</span><span class=cF0> (dither) </span><span class=cF7>{</span><span class=cF0>
<a name="l1126"></a> </span><span class=cF1>if</span><span class=cF0> (probability_dither) {
<a name="l1127"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>RandU16</span><span class=cF0>&lt;dc-&gt;dither_probability_u16)
<a name="l1128"></a> color.c0=dither_colors.c1;
<a name="l1129"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1130"></a> color.c0=dither_colors.c0;
<a name="l1131"></a> </span><span class=cF1>switch</span><span class=cF0> [color.c0.rop] </span><span class=cF7>{</span><span class=cF0>
<a name="l1132"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_EQU</span><span class=cF0>:
<a name="l1133"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_MONO</span><span class=cF0>:
<a name="l1134"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_buf_ptr) {
<a name="l1135"></a> res=0;
<a name="l1136"></a> </span><span class=cF1>for</span><span class=cF0> (j=h1;j&lt;h2;j++) </span><span class=cF7>{</span><span class=cF0>
<a name="l1137"></a> color_mask=</span><span class=cFB>gr</span><span class=cF0>.to_8_colors[color.c0.color];
<a name="l1138"></a> dst=dc-&gt;body+kk1&amp;~7;
<a name="l1139"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels) {
<a name="l1140"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++) </span><span class=cF7>{</span><span class=cF0>
<a name="l1141"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l1142"></a> color_mask&amp;~leading_pixel_mask;
<a name="l1143"></a> res+=leading_pixels;
<a name="l1144"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1145"></a> dst(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l1146"></a> }
<a name="l1147"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;whole_I64s;i++,dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++)
<a name="l1148"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++) {
<a name="l1149"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=color_mask;
<a name="l1150"></a> res+=8;
<a name="l1151"></a> }
<a name="l1152"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels &amp;&amp; win_z_num&gt;=*win_z_buf_ptr++) {
<a name="l1153"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l1154"></a> color_mask&amp;~trailing_pixel_mask;
<a name="l1155"></a> res+=trailing_pixels;
<a name="l1156"></a> }
<a name="l1157"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>j+y</span><span class=cF7>)</span><span class=cF0>&amp;7==7)
<a name="l1158"></a> win_z_buf_ptr(</span><span class=cF1>U8</span><span class=cF0> *)+=win_z_buf_line_inc;
<a name="l1159"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1160"></a> win_z_buf_ptr(</span><span class=cF1>U8</span><span class=cF0> *)-=win_z_buf_line_dec;
<a name="l1161"></a> kk1+=dc-&gt;width_internal;
<a name="l1162"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>RandU16</span><span class=cF0>&lt;dc-&gt;dither_probability_u16)
<a name="l1163"></a> color.c0=dither_colors.c1;
<a name="l1164"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1165"></a> color.c0=dither_colors.c0;
<a name="l1166"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1167"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l1168"></a> </span><span class=cF1>for</span><span class=cF0> (j=h2-h1;j;j--) </span><span class=cF7>{</span><span class=cF0>
<a name="l1169"></a> color_mask=</span><span class=cFB>gr</span><span class=cF0>.to_8_colors[color.c0.color];
<a name="l1170"></a> dst=dc-&gt;body+kk1&amp;~7;
<a name="l1171"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels)
<a name="l1172"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l1173"></a> color_mask&amp;~leading_pixel_mask;
<a name="l1174"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;whole_I64s;i++,dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++)
<a name="l1175"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=color_mask;
<a name="l1176"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels)
<a name="l1177"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l1178"></a> color_mask&amp;~trailing_pixel_mask;
<a name="l1179"></a> kk1+=dc-&gt;width_internal;
<a name="l1180"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>RandU16</span><span class=cF0>&lt;dc-&gt;dither_probability_u16)
<a name="l1181"></a> color.c0=dither_colors.c1;
<a name="l1182"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1183"></a> color.c0=dither_colors.c0;
<a name="l1184"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1185"></a> res=(h2-h1)*(w2-w1);
<a name="l1186"></a> }
<a name="l1187"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1188"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_XOR</span><span class=cF0>:
<a name="l1189"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_buf_ptr) {
<a name="l1190"></a> res=0;
<a name="l1191"></a> </span><span class=cF1>for</span><span class=cF0> (j=h1;j&lt;h2;j++) </span><span class=cF7>{</span><span class=cF0>
<a name="l1192"></a> color_mask=</span><span class=cFB>gr</span><span class=cF0>.to_8_colors[color.c0.color];
<a name="l1193"></a> dst=dc-&gt;body+kk1&amp;~7;
<a name="l1194"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels) {
<a name="l1195"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++) </span><span class=cF7>{</span><span class=cF0>
<a name="l1196"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l1197"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)^color_mask&amp;~leading_pixel_mask;
<a name="l1198"></a> res+=leading_pixels;
<a name="l1199"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1200"></a> dst(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l1201"></a> }
<a name="l1202"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;whole_I64s;i++,dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++)
<a name="l1203"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++) {
<a name="l1204"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)^=color_mask;
<a name="l1205"></a> res+=8;
<a name="l1206"></a> }
<a name="l1207"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels &amp;&amp; win_z_num&gt;=*win_z_buf_ptr++) {
<a name="l1208"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l1209"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)^color_mask&amp;~trailing_pixel_mask;
<a name="l1210"></a> res+=trailing_pixels;
<a name="l1211"></a> }
<a name="l1212"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>j+y</span><span class=cF7>)</span><span class=cF0>&amp;7==7)
<a name="l1213"></a> win_z_buf_ptr(</span><span class=cF1>U8</span><span class=cF0> *)+=win_z_buf_line_inc;
<a name="l1214"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1215"></a> win_z_buf_ptr(</span><span class=cF1>U8</span><span class=cF0> *)-=win_z_buf_line_dec;
<a name="l1216"></a> kk1+=dc-&gt;width_internal;
<a name="l1217"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>RandU16</span><span class=cF0>&lt;dc-&gt;dither_probability_u16)
<a name="l1218"></a> color.c0=dither_colors.c1;
<a name="l1219"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1220"></a> color.c0=dither_colors.c0;
<a name="l1221"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1222"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l1223"></a> </span><span class=cF1>for</span><span class=cF0> (j=h2-h1;j;j--) </span><span class=cF7>{</span><span class=cF0>
<a name="l1224"></a> color_mask=</span><span class=cFB>gr</span><span class=cF0>.to_8_colors[color.c0.color];
<a name="l1225"></a> dst=dc-&gt;body+kk1&amp;~7;
<a name="l1226"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels)
<a name="l1227"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l1228"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)^color_mask&amp;~leading_pixel_mask;
<a name="l1229"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;whole_I64s;i++,dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++)
<a name="l1230"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)^=color_mask;
<a name="l1231"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels)
<a name="l1232"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l1233"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)^color_mask&amp;~trailing_pixel_mask;
<a name="l1234"></a> kk1+=dc-&gt;width_internal;
<a name="l1235"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>RandU16</span><span class=cF0>&lt;dc-&gt;dither_probability_u16)
<a name="l1236"></a> color.c0=dither_colors.c1;
<a name="l1237"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1238"></a> color.c0=dither_colors.c0;
<a name="l1239"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1240"></a> res=(h2-h1)*(w2-w1);
<a name="l1241"></a> }
<a name="l1242"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1243"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1244"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l1245"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>(x+w1-original_leading_pixels)^(y+h1)</span><span class=cF7>)</span><span class=cF0>&amp;1)
<a name="l1246"></a> </span><span class=cF5>SwapU16</span><span class=cF0>(&amp;color.c0,&amp;color.c1);
<a name="l1247"></a> </span><span class=cF1>switch</span><span class=cF0> [color.c0.rop] </span><span class=cF7>{</span><span class=cF0>
<a name="l1248"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_EQU</span><span class=cF0>:
<a name="l1249"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_MONO</span><span class=cF0>:
<a name="l1250"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_buf_ptr) {
<a name="l1251"></a> res=0;
<a name="l1252"></a> </span><span class=cF1>for</span><span class=cF0> (j=h1;j&lt;h2;j++) </span><span class=cF7>{</span><span class=cF0>
<a name="l1253"></a> color_mask=</span><span class=cFB>gr</span><span class=cF0>.to_8_bits[0x55]&amp;</span><span class=cFB>gr</span><span class=cF0>.to_8_colors[color.c0.color]|
<a name="l1254"></a> </span><span class=cFB>gr</span><span class=cF0>.to_8_bits[0xAA]&amp;</span><span class=cFB>gr</span><span class=cF0>.to_8_colors[color.c1.color];
<a name="l1255"></a> dst=dc-&gt;body+kk1&amp;~7;
<a name="l1256"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels) {
<a name="l1257"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++) </span><span class=cF7>{</span><span class=cF0>
<a name="l1258"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l1259"></a> color_mask&amp;~leading_pixel_mask;
<a name="l1260"></a> res+=leading_pixels;
<a name="l1261"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1262"></a> dst(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l1263"></a> }
<a name="l1264"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;whole_I64s;i++,dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++)
<a name="l1265"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++) {
<a name="l1266"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=color_mask;
<a name="l1267"></a> res+=8;
<a name="l1268"></a> }
<a name="l1269"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels &amp;&amp; win_z_num&gt;=*win_z_buf_ptr++) {
<a name="l1270"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l1271"></a> color_mask&amp;~trailing_pixel_mask;
<a name="l1272"></a> res+=trailing_pixels;
<a name="l1273"></a> }
<a name="l1274"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>j+y</span><span class=cF7>)</span><span class=cF0>&amp;7==7)
<a name="l1275"></a> win_z_buf_ptr(</span><span class=cF1>U8</span><span class=cF0> *)+=win_z_buf_line_inc;
<a name="l1276"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1277"></a> win_z_buf_ptr(</span><span class=cF1>U8</span><span class=cF0> *)-=win_z_buf_line_dec;
<a name="l1278"></a> kk1+=dc-&gt;width_internal;
<a name="l1279"></a> </span><span class=cF5>SwapU16</span><span class=cF0>(&amp;color.c0,&amp;color.c1);
<a name="l1280"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1281"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l1282"></a> </span><span class=cF1>for</span><span class=cF0> (j=h2-h1;j;j--) </span><span class=cF7>{</span><span class=cF0>
<a name="l1283"></a> color_mask=</span><span class=cFB>gr</span><span class=cF0>.to_8_bits[0x55]&amp;</span><span class=cFB>gr</span><span class=cF0>.to_8_colors[color.c0.color]|
<a name="l1284"></a> </span><span class=cFB>gr</span><span class=cF0>.to_8_bits[0xAA]&amp;</span><span class=cFB>gr</span><span class=cF0>.to_8_colors[color.c1.color];
<a name="l1285"></a> dst=dc-&gt;body+kk1&amp;~7;
<a name="l1286"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels)
<a name="l1287"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l1288"></a> color_mask&amp;~leading_pixel_mask;
<a name="l1289"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;whole_I64s;i++,dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++)
<a name="l1290"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=color_mask;
<a name="l1291"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels)
<a name="l1292"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l1293"></a> color_mask&amp;~trailing_pixel_mask;
<a name="l1294"></a> kk1+=dc-&gt;width_internal;
<a name="l1295"></a> </span><span class=cF5>SwapU16</span><span class=cF0>(&amp;color.c0,&amp;color.c1);
<a name="l1296"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1297"></a> res=(h2-h1)*(w2-w1);
<a name="l1298"></a> }
<a name="l1299"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1300"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_XOR</span><span class=cF0>:
<a name="l1301"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_buf_ptr) {
<a name="l1302"></a> res=0;
<a name="l1303"></a> </span><span class=cF1>for</span><span class=cF0> (j=h1;j&lt;h2;j++) </span><span class=cF7>{</span><span class=cF0>
<a name="l1304"></a> color_mask=</span><span class=cFB>gr</span><span class=cF0>.to_8_bits[0x55]&amp;</span><span class=cFB>gr</span><span class=cF0>.to_8_colors[color.c0.color]|
<a name="l1305"></a> </span><span class=cFB>gr</span><span class=cF0>.to_8_bits[0xAA]&amp;</span><span class=cFB>gr</span><span class=cF0>.to_8_colors[color.c1.color];
<a name="l1306"></a> dst=dc-&gt;body+kk1&amp;~7;
<a name="l1307"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels) {
<a name="l1308"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++) </span><span class=cF7>{</span><span class=cF0>
<a name="l1309"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l1310"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)^color_mask&amp;~leading_pixel_mask;
<a name="l1311"></a> res+=leading_pixels;
<a name="l1312"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1313"></a> dst(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l1314"></a> }
<a name="l1315"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;whole_I64s;i++,dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++)
<a name="l1316"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++) {
<a name="l1317"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)^=color_mask;
<a name="l1318"></a> res+=8;
<a name="l1319"></a> }
<a name="l1320"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels &amp;&amp; win_z_num&gt;=*win_z_buf_ptr++) {
<a name="l1321"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l1322"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)^color_mask&amp;~trailing_pixel_mask;
<a name="l1323"></a> res+=trailing_pixels;
<a name="l1324"></a> }
<a name="l1325"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>j+y</span><span class=cF7>)</span><span class=cF0>&amp;7==7)
<a name="l1326"></a> win_z_buf_ptr(</span><span class=cF1>U8</span><span class=cF0> *)+=win_z_buf_line_inc;
<a name="l1327"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1328"></a> win_z_buf_ptr(</span><span class=cF1>U8</span><span class=cF0> *)-=win_z_buf_line_dec;
<a name="l1329"></a> kk1+=dc-&gt;width_internal;
<a name="l1330"></a> </span><span class=cF5>SwapU16</span><span class=cF0>(&amp;color.c0,&amp;color.c1);
<a name="l1331"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1332"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l1333"></a> </span><span class=cF1>for</span><span class=cF0> (j=h2-h1;j;j--) </span><span class=cF7>{</span><span class=cF0>
<a name="l1334"></a> color_mask=</span><span class=cFB>gr</span><span class=cF0>.to_8_bits[0x55]&amp;</span><span class=cFB>gr</span><span class=cF0>.to_8_colors[color.c0.color]|
<a name="l1335"></a> </span><span class=cFB>gr</span><span class=cF0>.to_8_bits[0xAA]&amp;</span><span class=cFB>gr</span><span class=cF0>.to_8_colors[color.c1.color];
<a name="l1336"></a> dst=dc-&gt;body+kk1&amp;~7;
<a name="l1337"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels)
<a name="l1338"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l1339"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)^color_mask&amp;~leading_pixel_mask;
<a name="l1340"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;whole_I64s;i++,dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++)
<a name="l1341"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)^=color_mask;
<a name="l1342"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels)
<a name="l1343"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l1344"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)^color_mask&amp;~trailing_pixel_mask;
<a name="l1345"></a> kk1+=dc-&gt;width_internal;
<a name="l1346"></a> </span><span class=cF5>SwapU16</span><span class=cF0>(&amp;color.c0,&amp;color.c1);
<a name="l1347"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1348"></a> res=(h2-h1)*(w2-w1);
<a name="l1349"></a> }
<a name="l1350"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1351"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1352"></a> }
<a name="l1353"></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="l1354"></a> color_mask=</span><span class=cFB>gr</span><span class=cF0>.to_8_colors[color.c0.color];
<a name="l1355"></a> </span><span class=cF1>switch</span><span class=cF0> [color.c0.rop] {
<a name="l1356"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_EQU</span><span class=cF0>:
<a name="l1357"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_MONO</span><span class=cF0>:
<a name="l1358"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_buf_ptr) </span><span class=cF7>{</span><span class=cF0>
<a name="l1359"></a> res=0;
<a name="l1360"></a> </span><span class=cF1>for</span><span class=cF0> (j=h1;j&lt;h2;j++) {
<a name="l1361"></a> dst=dc-&gt;body+kk1&amp;~7;
<a name="l1362"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels) </span><span class=cF7>{</span><span class=cF0>
<a name="l1363"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++) {
<a name="l1364"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l1365"></a> color_mask&amp;~leading_pixel_mask;
<a name="l1366"></a> res+=leading_pixels;
<a name="l1367"></a> }
<a name="l1368"></a> dst(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l1369"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1370"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;whole_I64s;i++,dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++)
<a name="l1371"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++) </span><span class=cF7>{</span><span class=cF0>
<a name="l1372"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=color_mask;
<a name="l1373"></a> res+=8;
<a name="l1374"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1375"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels &amp;&amp; win_z_num&gt;=*win_z_buf_ptr++) </span><span class=cF7>{</span><span class=cF0>
<a name="l1376"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l1377"></a> color_mask&amp;~trailing_pixel_mask;
<a name="l1378"></a> res+=trailing_pixels;
<a name="l1379"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1380"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>j+y</span><span class=cF7>)</span><span class=cF0>&amp;7==7)
<a name="l1381"></a> win_z_buf_ptr(</span><span class=cF1>U8</span><span class=cF0> *)+=win_z_buf_line_inc;
<a name="l1382"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1383"></a> win_z_buf_ptr(</span><span class=cF1>U8</span><span class=cF0> *)-=win_z_buf_line_dec;
<a name="l1384"></a> kk1+=dc-&gt;width_internal;
<a name="l1385"></a> }
<a name="l1386"></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="l1387"></a> </span><span class=cF1>for</span><span class=cF0> (j=h2-h1;j;j--) {
<a name="l1388"></a> dst(</span><span class=cF9>I64</span><span class=cF0> *)=dc-&gt;body+kk1&amp;~7;
<a name="l1389"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels)
<a name="l1390"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l1391"></a> color_mask&amp;~leading_pixel_mask;
<a name="l1392"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;whole_I64s;i++,dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++)
<a name="l1393"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=color_mask;
<a name="l1394"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels)
<a name="l1395"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l1396"></a> color_mask&amp;~trailing_pixel_mask;
<a name="l1397"></a> kk1+=dc-&gt;width_internal;
<a name="l1398"></a> }
<a name="l1399"></a> res=(h2-h1)*(w2-w1);
<a name="l1400"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1401"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1402"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_XOR</span><span class=cF0>:
<a name="l1403"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_buf_ptr) </span><span class=cF7>{</span><span class=cF0>
<a name="l1404"></a> res=0;
<a name="l1405"></a> </span><span class=cF1>for</span><span class=cF0> (j=h1;j&lt;h2;j++) {
<a name="l1406"></a> dst=dc-&gt;body+kk1&amp;~7;
<a name="l1407"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels) </span><span class=cF7>{</span><span class=cF0>
<a name="l1408"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++) {
<a name="l1409"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l1410"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)^color_mask&amp;~leading_pixel_mask;
<a name="l1411"></a> res+=leading_pixels;
<a name="l1412"></a> }
<a name="l1413"></a> dst(</span><span class=cF9>I64</span><span class=cF0> *)++;
<a name="l1414"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1415"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;whole_I64s;i++,dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++)
<a name="l1416"></a> </span><span class=cF1>if</span><span class=cF0> (win_z_num&gt;=*win_z_buf_ptr++) </span><span class=cF7>{</span><span class=cF0>
<a name="l1417"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)^=color_mask;
<a name="l1418"></a> res+=8;
<a name="l1419"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1420"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels &amp;&amp; win_z_num&gt;=*win_z_buf_ptr++) </span><span class=cF7>{</span><span class=cF0>
<a name="l1421"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l1422"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)^color_mask&amp;~trailing_pixel_mask;
<a name="l1423"></a> res+=trailing_pixels;
<a name="l1424"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1425"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>j+y</span><span class=cF7>)</span><span class=cF0>&amp;7==7)
<a name="l1426"></a> win_z_buf_ptr(</span><span class=cF1>U8</span><span class=cF0> *)+=win_z_buf_line_inc;
<a name="l1427"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1428"></a> win_z_buf_ptr(</span><span class=cF1>U8</span><span class=cF0> *)-=win_z_buf_line_dec;
<a name="l1429"></a> kk1+=dc-&gt;width_internal;
<a name="l1430"></a> }
<a name="l1431"></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="l1432"></a> </span><span class=cF1>for</span><span class=cF0> (j=h2-h1;j;j--) {
<a name="l1433"></a> dst=dc-&gt;body+kk1&amp;~7;
<a name="l1434"></a> </span><span class=cF1>if</span><span class=cF0> (leading_pixels)
<a name="l1435"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)++=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;leading_pixel_mask|
<a name="l1436"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)^color_mask&amp;~leading_pixel_mask;
<a name="l1437"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;whole_I64s;i++,dst</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>++)
<a name="l1438"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)^=color_mask;
<a name="l1439"></a> </span><span class=cF1>if</span><span class=cF0> (trailing_pixels)
<a name="l1440"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)=*dst(</span><span class=cF9>I64</span><span class=cF0> *)&amp;trailing_pixel_mask|
<a name="l1441"></a> *dst(</span><span class=cF9>I64</span><span class=cF0> *)^color_mask&amp;~trailing_pixel_mask;
<a name="l1442"></a> kk1+=dc-&gt;width_internal;
<a name="l1443"></a> }
<a name="l1444"></a> res=(h2-h1)*(w2-w1);
<a name="l1445"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1446"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1447"></a> }
<a name="l1448"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1449"></a> }
<a name="l1450"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1451"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l1452"></a>}
<a name="l1453"></a>
<a name="l1454"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>GrRayLenMinus</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)
<a name="l1455"></a>{
<a name="l1456"></a></span><span class=cF2>//Returns cnt of pixs changed</span><span class=cF0>
<a name="l1457"></a> </span><span class=cF9>I64</span><span class=cF0> res=0,c,x3,y3,d;
<a name="l1458"></a> </span><span class=cF1>U8</span><span class=cF0> *dst,*dst2;
<a name="l1459"></a> </span><span class=cF1>Bool</span><span class=cF0> not_color=</span><span class=cF5>ToBool</span><span class=cF0>(dc-&gt;flags&amp;</span><span class=cF3>DCF_FILL_NOT_COLOR</span><span class=cF0>);
<a name="l1460"></a> </span><span class=cF9>CTask</span><span class=cF0> *win_task;
<a name="l1461"></a>
<a name="l1462"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1463"></a> win_task=dc-&gt;win_task;
<a name="l1464"></a> x+=win_task-&gt;scroll_x;
<a name="l1465"></a> y+=win_task-&gt;scroll_y;
<a name="l1466"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1467"></a> x3=x;
<a name="l1468"></a> y3=y;
<a name="l1469"></a> </span><span class=cF1>if</span><span class=cF0> (x3&lt;0 || y3&lt;0)
<a name="l1470"></a> </span><span class=cF1>goto</span><span class=cF0> gr_done;
<a name="l1471"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1472"></a> x3+=win_task-&gt;pix_left;
<a name="l1473"></a> y3+=win_task-&gt;pix_top;
<a name="l1474"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>0&lt;=x3&lt;=win_task-&gt;pix_right</span><span class=cF7>)</span><span class=cF0> || !</span><span class=cF7>(</span><span class=cF0>0&lt;=y3&lt;=win_task-&gt;pix_bottom</span><span class=cF7>)</span><span class=cF0> ||
<a name="l1475"></a> !</span><span class=cF7>(</span><span class=cF0>dc-&gt;flags&amp;</span><span class=cF3>DCF_ON_TOP</span><span class=cF7>)</span><span class=cF0> &amp;&amp; </span><span class=cF5>IsPixCovered0</span><span class=cF7>(</span><span class=cF0>win_task,x3,y3</span><span class=cF7>)</span><span class=cF0>)
<a name="l1476"></a> </span><span class=cF1>goto</span><span class=cF0> gr_done;
<a name="l1477"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1478"></a> </span><span class=cF1>if</span><span class=cF0> (x3&gt;=dc-&gt;width || y3&gt;=dc-&gt;height)
<a name="l1479"></a> </span><span class=cF1>goto</span><span class=cF0> gr_done;
<a name="l1480"></a>
<a name="l1481"></a> d=y3*dc-&gt;width_internal;
<a name="l1482"></a> dst2=dc-&gt;body+d;
<a name="l1483"></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="l1484"></a> x3=x;
<a name="l1485"></a> </span><span class=cF1>if</span><span class=cF0> (x3&amp;</span><span class=cF7>(</span><span class=cF3>FONT_WIDTH</span><span class=cF0>-1</span><span class=cF7>)</span><span class=cF0>==</span><span class=cF3>FONT_WIDTH</span><span class=cF0>-1) {
<a name="l1486"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1487"></a> </span><span class=cF1>if</span><span class=cF0> (x3&lt;0) </span><span class=cF1>break</span><span class=cF0>;
<a name="l1488"></a> x3+=win_task-&gt;pix_left;
<a name="l1489"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>0&lt;=x3&lt;=win_task-&gt;pix_right</span><span class=cF7>)</span><span class=cF0> || x3&gt;=dc-&gt;width ||
<a name="l1490"></a> !</span><span class=cF7>(</span><span class=cF0>dc-&gt;flags&amp;</span><span class=cF3>DCF_ON_TOP</span><span class=cF7>)</span><span class=cF0> &amp;&amp; </span><span class=cF5>IsPixCovered0</span><span class=cF7>(</span><span class=cF0>win_task,x3,y3</span><span class=cF7>)</span><span class=cF0>)
<a name="l1491"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1492"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l1493"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>0&lt;=x3&lt;dc-&gt;width</span><span class=cF7>)</span><span class=cF0>)
<a name="l1494"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1495"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>)
<a name="l1496"></a> x3+=win_task-&gt;pix_left;
<a name="l1497"></a> dst=dst2+x3;
<a name="l1498"></a> c=*dst;
<a name="l1499"></a> </span><span class=cF1>if</span><span class=cF0> (not_color) {
<a name="l1500"></a> </span><span class=cF1>if</span><span class=cF0> (c!=dc-&gt;color2) </span><span class=cF7>{</span><span class=cF0>
<a name="l1501"></a> res++;
<a name="l1502"></a> x--;
<a name="l1503"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l1504"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1505"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l1506"></a> </span><span class=cF1>if</span><span class=cF0> (c==dc-&gt;color2) </span><span class=cF7>{</span><span class=cF0>
<a name="l1507"></a> res++;
<a name="l1508"></a> x--;
<a name="l1509"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l1510"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1511"></a> }
<a name="l1512"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1513"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l1514"></a>gr_done:
<a name="l1515"></a> </span><span class=cF1>return</span><span class=cF0> 0;
<a name="l1516"></a>}
<a name="l1517"></a>
<a name="l1518"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>GrRayLen</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *dc,</span><span class=cF9>I64</span><span class=cF0> *x1,</span><span class=cF9>I64</span><span class=cF0> y,</span><span class=cF9>I64</span><span class=cF0> z=0,</span><span class=cF9>I32</span><span class=cF0> *db=</span><span class=cF3>NULL</span><span class=cF0>)
<a name="l1519"></a>{
<a name="l1520"></a></span><span class=cF2>//Returns cnt of pixs changed</span><span class=cF0>
<a name="l1521"></a> </span><span class=cF9>I64</span><span class=cF0> res=0,d,x=*x1,x2,x3,y3,dist;
<a name="l1522"></a> </span><span class=cF1>Bool</span><span class=cF0> plot,dither,probability_dither,
<a name="l1523"></a> not_color=</span><span class=cF5>ToBool</span><span class=cF0>(dc-&gt;flags&amp;</span><span class=cF3>DCF_FILL_NOT_COLOR</span><span class=cF0>);
<a name="l1524"></a> </span><span class=cF1>U8</span><span class=cF0> *dst,*dst2;
<a name="l1525"></a> </span><span class=cF9>CColorROPU32</span><span class=cF0> c,c2,color=dc-&gt;color,bkcolor=dc-&gt;bkcolor;
<a name="l1526"></a> </span><span class=cF9>I32</span><span class=cF0> *db2;
<a name="l1527"></a> </span><span class=cF9>CTask</span><span class=cF0> *win_task;
<a name="l1528"></a>
<a name="l1529"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1530"></a> win_task=dc-&gt;win_task;
<a name="l1531"></a> x+=win_task-&gt;scroll_x;
<a name="l1532"></a> y+=win_task-&gt;scroll_y;
<a name="l1533"></a> z+=win_task-&gt;scroll_z;
<a name="l1534"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1535"></a> x2=x;
<a name="l1536"></a> x3=x;
<a name="l1537"></a> y3=y;
<a name="l1538"></a> </span><span class=cF1>if</span><span class=cF0> (x3&lt;0 || y3&lt;0)
<a name="l1539"></a> </span><span class=cF1>goto</span><span class=cF0> gr_done;
<a name="l1540"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1541"></a> x3+=win_task-&gt;pix_left;
<a name="l1542"></a> y3+=win_task-&gt;pix_top;
<a name="l1543"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>0&lt;=x3&lt;=win_task-&gt;pix_right</span><span class=cF7>)</span><span class=cF0> || !</span><span class=cF7>(</span><span class=cF0>0&lt;=y3&lt;=win_task-&gt;pix_bottom</span><span class=cF7>)</span><span class=cF0> ||
<a name="l1544"></a> !</span><span class=cF7>(</span><span class=cF0>dc-&gt;flags&amp;</span><span class=cF3>DCF_ON_TOP</span><span class=cF7>)</span><span class=cF0> &amp;&amp; </span><span class=cF5>IsPixCovered0</span><span class=cF7>(</span><span class=cF0>win_task,x3,y3</span><span class=cF7>)</span><span class=cF0>)
<a name="l1545"></a> </span><span class=cF1>goto</span><span class=cF0> gr_done;
<a name="l1546"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1547"></a> </span><span class=cF1>if</span><span class=cF0> (x3&gt;=dc-&gt;width || y3&gt;=dc-&gt;height)
<a name="l1548"></a> </span><span class=cF1>goto</span><span class=cF0> gr_done;
<a name="l1549"></a>
<a name="l1550"></a> d=dc-&gt;width_internal*y3;
<a name="l1551"></a> </span><span class=cF1>if</span><span class=cF0> (db) db+=d;
<a name="l1552"></a>
<a name="l1553"></a> color=dc-&gt;color;
<a name="l1554"></a> </span><span class=cF1>if</span><span class=cF0> (color.c1.rop&amp;</span><span class=cF7>(</span><span class=cF3>ROPBF_DITHER</span><span class=cF0>|</span><span class=cF3>ROPBF_PROBABILITY_DITHER</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1555"></a> dither=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l1556"></a> </span><span class=cF1>if</span><span class=cF0> (color.c1.rop&amp;</span><span class=cF3>ROPBF_PROBABILITY_DITHER</span><span class=cF0>) {
<a name="l1557"></a> probability_dither=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l1558"></a> color.c1.rop=color.c0.rop;
<a name="l1559"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l1560"></a> probability_dither=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l1561"></a> color.c1.rop=color.c0.rop;
<a name="l1562"></a> }
<a name="l1563"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l1564"></a> dither=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l1565"></a> dst2=dc-&gt;body+d;
<a name="l1566"></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="l1567"></a> x3=x;
<a name="l1568"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>x3&amp;(</span><span class=cF3>FONT_WIDTH</span><span class=cF0>-1)</span><span class=cF7>)</span><span class=cF0>) {
<a name="l1569"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1570"></a> </span><span class=cF1>if</span><span class=cF0> (x3&lt;0) </span><span class=cF1>break</span><span class=cF0>;
<a name="l1571"></a> x3+=win_task-&gt;pix_left;
<a name="l1572"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>0&lt;=x3&lt;=win_task-&gt;pix_right</span><span class=cF7>)</span><span class=cF0> || x3&gt;=dc-&gt;width ||
<a name="l1573"></a> !</span><span class=cF7>(</span><span class=cF0>dc-&gt;flags&amp;</span><span class=cF3>DCF_ON_TOP</span><span class=cF7>)</span><span class=cF0> &amp;&amp; </span><span class=cF5>IsPixCovered0</span><span class=cF7>(</span><span class=cF0>win_task,x3,y3</span><span class=cF7>)</span><span class=cF0>)
<a name="l1574"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1575"></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="l1576"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>0&lt;=x3&lt;dc-&gt;width</span><span class=cF7>)</span><span class=cF0>)
<a name="l1577"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1578"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1579"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>)
<a name="l1580"></a> x3+=win_task-&gt;pix_left;
<a name="l1581"></a>
<a name="l1582"></a> dst=dst2+x3;
<a name="l1583"></a>
<a name="l1584"></a> c=*dst;
<a name="l1585"></a> </span><span class=cF1>if</span><span class=cF0> (db) {
<a name="l1586"></a> db2=db+x3;
<a name="l1587"></a> </span><span class=cF1>if</span><span class=cF0> (0&lt;=z&lt;=*db2) </span><span class=cF7>{</span><span class=cF0>
<a name="l1588"></a> *db2=z;
<a name="l1589"></a> plot=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l1590"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l1591"></a> plot=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l1592"></a> } </span><span class=cF1>else</span><span class=cF0>
<a name="l1593"></a> plot=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l1594"></a>
<a name="l1595"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>not_color &amp;&amp; c!=dc-&gt;color2 ||
<a name="l1596"></a> !not_color &amp;&amp; c==dc-&gt;color2</span><span class=cF7>)</span><span class=cF0> &amp;&amp; plot) {
<a name="l1597"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_LOCATE_NEAREST</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1598"></a> dist=</span><span class=cF5>DistSqrI64</span><span class=cF0>(x3,y3,dc-&gt;cur_x,dc-&gt;cur_y);
<a name="l1599"></a> </span><span class=cF1>if</span><span class=cF0> (dist&lt;=dc-&gt;nearest_dist)
<a name="l1600"></a> dc-&gt;nearest_dist=dist;
<a name="l1601"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1602"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_RECORD_EXTENTS</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1603"></a> </span><span class=cF1>if</span><span class=cF0> (x3&lt;dc-&gt;min_x) dc-&gt;min_x=x3;
<a name="l1604"></a> </span><span class=cF1>if</span><span class=cF0> (x3&gt;dc-&gt;max_x) dc-&gt;max_x=x3;
<a name="l1605"></a> </span><span class=cF1>if</span><span class=cF0> (y3&lt;dc-&gt;min_y) dc-&gt;min_y=y3;
<a name="l1606"></a> </span><span class=cF1>if</span><span class=cF0> (y3&gt;dc-&gt;max_y) dc-&gt;max_y=y3;
<a name="l1607"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1608"></a> dst=dst2+x3;
<a name="l1609"></a>
<a name="l1610"></a> c=color.c0.color;
<a name="l1611"></a> </span><span class=cF1>if</span><span class=cF0> (dither) </span><span class=cF7>{</span><span class=cF0>
<a name="l1612"></a> </span><span class=cF1>if</span><span class=cF0> (probability_dither) {
<a name="l1613"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>RandU16</span><span class=cF0>&lt;dc-&gt;dither_probability_u16)
<a name="l1614"></a> c=color.c1.color;
<a name="l1615"></a> } </span><span class=cF1>else</span><span class=cF0>
<a name="l1616"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>x3^y3</span><span class=cF7>)</span><span class=cF0>&amp;1)
<a name="l1617"></a> c=color.c1.color;
<a name="l1618"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1619"></a> </span><span class=cF1>switch</span><span class=cF0> [color.c0.rop] </span><span class=cF7>{</span><span class=cF0>
<a name="l1620"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_EQU</span><span class=cF0>:
<a name="l1621"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_MONO</span><span class=cF0>:
<a name="l1622"></a> *dst=c;
<a name="l1623"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1624"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_COLLISION</span><span class=cF0>:
<a name="l1625"></a> c2=*dst;
<a name="l1626"></a> </span><span class=cF1>if</span><span class=cF0> (c2!=</span><span class=cF3>TRANSPARENT</span><span class=cF0> &amp;&amp; c2!=bkcolor.c0.color)
<a name="l1627"></a> dc-&gt;collision_cnt++;
<a name="l1628"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1629"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_XOR</span><span class=cF0>:
<a name="l1630"></a> *dst^=c;
<a name="l1631"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1632"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1633"></a> res++;
<a name="l1634"></a> x++;
<a name="l1635"></a> } </span><span class=cF1>else</span><span class=cF0>
<a name="l1636"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1637"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1638"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>)
<a name="l1639"></a> *x1=x-1-win_task-&gt;scroll_x;
<a name="l1640"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1641"></a> *x1=x-1;
<a name="l1642"></a> x=x2-1;
<a name="l1643"></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="l1644"></a> x3=x;
<a name="l1645"></a> </span><span class=cF1>if</span><span class=cF0> (x3&amp;</span><span class=cF7>(</span><span class=cF3>FONT_WIDTH</span><span class=cF0>-1</span><span class=cF7>)</span><span class=cF0>==</span><span class=cF3>FONT_WIDTH</span><span class=cF0>-1) {
<a name="l1646"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1647"></a> </span><span class=cF1>if</span><span class=cF0> (x3&lt;0) </span><span class=cF1>break</span><span class=cF0>;
<a name="l1648"></a> x3+=win_task-&gt;pix_left;
<a name="l1649"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>0&lt;=x3&lt;=win_task-&gt;pix_right</span><span class=cF7>)</span><span class=cF0> || x3&gt;=dc-&gt;width ||
<a name="l1650"></a> !</span><span class=cF7>(</span><span class=cF0>dc-&gt;flags&amp;</span><span class=cF3>DCF_ON_TOP</span><span class=cF7>)</span><span class=cF0> &amp;&amp; </span><span class=cF5>IsPixCovered0</span><span class=cF7>(</span><span class=cF0>win_task,x3,y3</span><span class=cF7>)</span><span class=cF0>)
<a name="l1651"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1652"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l1653"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>0&lt;=x3&lt;dc-&gt;width</span><span class=cF7>)</span><span class=cF0>)
<a name="l1654"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1655"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>)
<a name="l1656"></a> x3+=win_task-&gt;pix_left;
<a name="l1657"></a>
<a name="l1658"></a> dst=dst2+x3;
<a name="l1659"></a> c=*dst;
<a name="l1660"></a> </span><span class=cF1>if</span><span class=cF0> (db) {
<a name="l1661"></a> db2=db+x3;
<a name="l1662"></a> </span><span class=cF1>if</span><span class=cF0> (0&lt;=z&lt;=*db2) </span><span class=cF7>{</span><span class=cF0>
<a name="l1663"></a> *db2=z;
<a name="l1664"></a> plot=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l1665"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l1666"></a> plot=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l1667"></a> } </span><span class=cF1>else</span><span class=cF0>
<a name="l1668"></a> plot=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l1669"></a>
<a name="l1670"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>not_color &amp;&amp; c!=dc-&gt;color2 ||
<a name="l1671"></a> !not_color &amp;&amp; c==dc-&gt;color2</span><span class=cF7>)</span><span class=cF0> &amp;&amp; plot) {
<a name="l1672"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_LOCATE_NEAREST</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1673"></a> dist=</span><span class=cF5>DistSqrI64</span><span class=cF0>(x3,y3,dc-&gt;cur_x,dc-&gt;cur_y);
<a name="l1674"></a> </span><span class=cF1>if</span><span class=cF0> (dist&lt;=dc-&gt;nearest_dist)
<a name="l1675"></a> dc-&gt;nearest_dist=dist;
<a name="l1676"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1677"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_RECORD_EXTENTS</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1678"></a> </span><span class=cF1>if</span><span class=cF0> (x3&lt;dc-&gt;min_x) dc-&gt;min_x=x3;
<a name="l1679"></a> </span><span class=cF1>if</span><span class=cF0> (x3&gt;dc-&gt;max_x) dc-&gt;max_x=x3;
<a name="l1680"></a> </span><span class=cF1>if</span><span class=cF0> (y3&lt;dc-&gt;min_y) dc-&gt;min_y=y3;
<a name="l1681"></a> </span><span class=cF1>if</span><span class=cF0> (y3&gt;dc-&gt;max_y) dc-&gt;max_y=y3;
<a name="l1682"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1683"></a> dst=dst2+x3;
<a name="l1684"></a>
<a name="l1685"></a> c=color.c0.color;
<a name="l1686"></a> </span><span class=cF1>if</span><span class=cF0> (dither) </span><span class=cF7>{</span><span class=cF0>
<a name="l1687"></a> </span><span class=cF1>if</span><span class=cF0> (probability_dither) {
<a name="l1688"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>RandU16</span><span class=cF0>&lt;dc-&gt;dither_probability_u16)
<a name="l1689"></a> c=color.c1.color;
<a name="l1690"></a> } </span><span class=cF1>else</span><span class=cF0>
<a name="l1691"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>x3^y3</span><span class=cF7>)</span><span class=cF0>&amp;1)
<a name="l1692"></a> c=color.c1.color;
<a name="l1693"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1694"></a> </span><span class=cF1>switch</span><span class=cF0> [color.c0.rop] </span><span class=cF7>{</span><span class=cF0>
<a name="l1695"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_EQU</span><span class=cF0>:
<a name="l1696"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_MONO</span><span class=cF0>:
<a name="l1697"></a> *dst=c;
<a name="l1698"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1699"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_COLLISION</span><span class=cF0>:
<a name="l1700"></a> c2=*dst;
<a name="l1701"></a> </span><span class=cF1>if</span><span class=cF0> (c2!=</span><span class=cF3>TRANSPARENT</span><span class=cF0> &amp;&amp; c2!=bkcolor.c0.color)
<a name="l1702"></a> dc-&gt;collision_cnt++;
<a name="l1703"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1704"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_XOR</span><span class=cF0>:
<a name="l1705"></a> *dst^=c;
<a name="l1706"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1707"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1708"></a> res++;
<a name="l1709"></a> x--;
<a name="l1710"></a> } </span><span class=cF1>else</span><span class=cF0>
<a name="l1711"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1712"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1713"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l1714"></a>gr_done:
<a name="l1715"></a> </span><span class=cF1>return</span><span class=cF0> 0;
<a name="l1716"></a>}
<a name="l1717"></a>
<a name="l1718"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>GrHLine</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *dc=</span><span class=cFB>gr</span><span class=cF0>.dc,</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> y,</span><span class=cF9>I64</span><span class=cF0> z1=0,</span><span class=cF9>I64</span><span class=cF0> z2=0)
<a name="l1719"></a>{</span><span class=cF2>//3D. No transformation or thick.</span><span class=cF0>
<a name="l1720"></a></span><span class=cF2>//Returns cnt of pixs changed</span><span class=cF0>
<a name="l1721"></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="l1722"></a> </span><span class=cF9>I64</span><span class=cF0> dist,dx,dz,z,res=0,i,j,d;
<a name="l1723"></a> </span><span class=cF1>U8</span><span class=cF0> *dst;
<a name="l1724"></a> </span><span class=cF9>CColorROPU32</span><span class=cF0> c,c2,color=dc-&gt;color,bkcolor=dc-&gt;bkcolor,dither_colors;
<a name="l1725"></a> </span><span class=cF9>I32</span><span class=cF0> *db;
<a name="l1726"></a> </span><span class=cF1>Bool</span><span class=cF0> plot=</span><span class=cF3>TRUE</span><span class=cF0>,char_clear,dither,probability_dither;
<a name="l1727"></a> </span><span class=cF9>CTask</span><span class=cF0> *win_task;
<a name="l1728"></a>
<a name="l1729"></a> </span><span class=cF1>if</span><span class=cF0> (!dc-&gt;depth_buf) </span><span class=cF7>{</span><span class=cF0>
<a name="l1730"></a> </span><span class=cF1>if</span><span class=cF0> (x2&lt;x1) </span><span class=cF5>SwapI64</span><span class=cF0>(&amp;x1,&amp;x2);
<a name="l1731"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>GrRect</span><span class=cF0>(dc,x1,y,x2-x1+1,1);
<a name="l1732"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1733"></a>
<a name="l1734"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1735"></a> win_task=dc-&gt;win_task;
<a name="l1736"></a> x1+=win_task-&gt;scroll_x;
<a name="l1737"></a> x2+=win_task-&gt;scroll_x;
<a name="l1738"></a> y +=win_task-&gt;scroll_y;
<a name="l1739"></a> z1+=win_task-&gt;scroll_z;
<a name="l1740"></a> z2+=win_task-&gt;scroll_z;
<a name="l1741"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1742"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_RECORD_EXTENTS</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1743"></a> </span><span class=cF1>if</span><span class=cF0> (x1&lt;dc-&gt;min_x) dc-&gt;min_x=x1;
<a name="l1744"></a> </span><span class=cF1>if</span><span class=cF0> (x1&gt;dc-&gt;max_x) dc-&gt;max_x=x1;
<a name="l1745"></a> </span><span class=cF1>if</span><span class=cF0> (x2&lt;dc-&gt;min_x) dc-&gt;min_x=x2;
<a name="l1746"></a> </span><span class=cF1>if</span><span class=cF0> (x2&gt;dc-&gt;max_x) dc-&gt;max_x=x2;
<a name="l1747"></a> </span><span class=cF1>if</span><span class=cF0> (y&lt;dc-&gt;min_y) dc-&gt;min_y=y;
<a name="l1748"></a> </span><span class=cF1>if</span><span class=cF0> (y&gt;dc-&gt;max_y) dc-&gt;max_y=y;
<a name="l1749"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1750"></a> </span><span class=cF1>if</span><span class=cF0> (y&lt;0) </span><span class=cF1>goto</span><span class=cF0> gr_done;
<a name="l1751"></a> </span><span class=cF1>if</span><span class=cF0> (x2&lt;x1) </span><span class=cF7>{</span><span class=cF0>
<a name="l1752"></a> </span><span class=cF5>SwapI64</span><span class=cF0>(&amp;x1,&amp;x2);
<a name="l1753"></a> </span><span class=cF5>SwapI64</span><span class=cF0>(&amp;z1,&amp;z2);
<a name="l1754"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1755"></a> </span><span class=cF1>if</span><span class=cF0> (x2&lt;0)
<a name="l1756"></a> </span><span class=cF1>goto</span><span class=cF0> gr_done;
<a name="l1757"></a> </span><span class=cF1>if</span><span class=cF0> (x1&lt;0) </span><span class=cF7>{</span><span class=cF0>
<a name="l1758"></a> i=-x1;
<a name="l1759"></a> x1=0;
<a name="l1760"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l1761"></a> i=0;
<a name="l1762"></a> j=0;
<a name="l1763"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1764"></a> x1+=win_task-&gt;pix_left;
<a name="l1765"></a> x2+=win_task-&gt;pix_left;
<a name="l1766"></a> </span><span class=cF1>if</span><span class=cF0> (x1&gt;win_task-&gt;pix_right)
<a name="l1767"></a> </span><span class=cF1>goto</span><span class=cF0> gr_done;
<a name="l1768"></a> </span><span class=cF1>if</span><span class=cF0> (x2&gt;win_task-&gt;pix_right) {
<a name="l1769"></a> j=x2-win_task-&gt;pix_right;
<a name="l1770"></a> x2=win_task-&gt;pix_right;
<a name="l1771"></a> }
<a name="l1772"></a> y+=win_task-&gt;pix_top;
<a name="l1773"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>0&lt;=y&lt;=win_task-&gt;pix_bottom</span><span class=cF7>)</span><span class=cF0> || x2&lt;0)
<a name="l1774"></a> </span><span class=cF1>goto</span><span class=cF0> gr_done;
<a name="l1775"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1776"></a> </span><span class=cF1>if</span><span class=cF0> (x1&gt;=dc-&gt;width || y&gt;=dc-&gt;height)
<a name="l1777"></a> </span><span class=cF1>goto</span><span class=cF0> gr_done;
<a name="l1778"></a> dx=x2+j-(x1-i);
<a name="l1779"></a> d=dc-&gt;width_internal*y+x1;
<a name="l1780"></a> </span><span class=cF1>if</span><span class=cF0> (db=dc-&gt;depth_buf) </span><span class=cF7>{</span><span class=cF0>
<a name="l1781"></a> db+=d;
<a name="l1782"></a> </span><span class=cF1>if</span><span class=cF0> (dx)
<a name="l1783"></a> dz=(z2-z1)&lt;&lt;32/dx;
<a name="l1784"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1785"></a> dz=0;
<a name="l1786"></a> z=z1&lt;&lt;32;
<a name="l1787"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1788"></a> </span><span class=cF1>if</span><span class=cF0> (i)
<a name="l1789"></a> z+=i*dz;
<a name="l1790"></a> </span><span class=cF1>if</span><span class=cF0> (x2&gt;=dc-&gt;width)
<a name="l1791"></a> x2=dc-&gt;width-1;
<a name="l1792"></a>
<a name="l1793"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_LOCATE_NEAREST</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1794"></a> </span><span class=cF1>if</span><span class=cF0> (x1&lt;=dc-&gt;cur_x&lt;=x2)
<a name="l1795"></a> dist=0;
<a name="l1796"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;cur_x&lt;x1)
<a name="l1797"></a> dist=</span><span class=cF5>SqrI64</span><span class=cF0>(x1-dc-&gt;cur_x);
<a name="l1798"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1799"></a> dist=</span><span class=cF5>SqrI64</span><span class=cF0>(dc-&gt;cur_x-x2);
<a name="l1800"></a> dist+=</span><span class=cF5>SqrI64</span><span class=cF0>(y-dc-&gt;cur_y);
<a name="l1801"></a> </span><span class=cF1>if</span><span class=cF0> (dist&lt;=dc-&gt;nearest_dist)
<a name="l1802"></a> dc-&gt;nearest_dist=dist;
<a name="l1803"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1804"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_DONT_DRAW</span><span class=cF0>)
<a name="l1805"></a> </span><span class=cF1>goto</span><span class=cF0> gr_done;
<a name="l1806"></a>
<a name="l1807"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF7>)</span><span class=cF0> ||
<a name="l1808"></a> win_task-&gt;next_task==</span><span class=cFB>sys_winmgr_task</span><span class=cF0> ||
<a name="l1809"></a> dc-&gt;flags&amp;</span><span class=cF3>DCF_ON_TOP</span><span class=cF0> || !</span><span class=cF5>IsPixCovered0</span><span class=cF7>(</span><span class=cF0>win_task,x1,y</span><span class=cF7>)</span><span class=cF0>)
<a name="l1810"></a> char_clear=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l1811"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1812"></a> char_clear=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l1813"></a> </span><span class=cF1>if</span><span class=cF0> (color.c1.rop&amp;</span><span class=cF7>(</span><span class=cF3>ROPBF_DITHER</span><span class=cF0>|</span><span class=cF3>ROPBF_PROBABILITY_DITHER</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1814"></a> dither=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l1815"></a> </span><span class=cF1>if</span><span class=cF0> (color.c1.rop&amp;</span><span class=cF3>ROPBF_PROBABILITY_DITHER</span><span class=cF0>) {
<a name="l1816"></a> probability_dither=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l1817"></a> color.c1.rop=color.c0.rop;
<a name="l1818"></a> dither_colors=color;
<a name="l1819"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>RandU16</span><span class=cF0>&lt;dc-&gt;dither_probability_u16)
<a name="l1820"></a> color.c0=dither_colors.c1;
<a name="l1821"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1822"></a> color.c0=dither_colors.c0;
<a name="l1823"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l1824"></a> probability_dither=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l1825"></a> color.c1.rop=color.c0.rop;
<a name="l1826"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>x1^y</span><span class=cF7>)</span><span class=cF0>&amp;1)
<a name="l1827"></a> </span><span class=cF5>SwapU16</span><span class=cF0>(&amp;color.c0,&amp;color.c1);
<a name="l1828"></a> }
<a name="l1829"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l1830"></a> dither=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l1831"></a> </span><span class=cF1>while</span><span class=cF0> (x1&lt;=x2) </span><span class=cF7>{</span><span class=cF0>
<a name="l1832"></a> </span><span class=cF1>if</span><span class=cF0> (char_clear) {
<a name="l1833"></a> </span><span class=cF1>if</span><span class=cF0> (db) </span><span class=cF7>{</span><span class=cF0>
<a name="l1834"></a> </span><span class=cF1>if</span><span class=cF0> (0&lt;=z.i32[1]&lt;=*db) {
<a name="l1835"></a> *db=z.i32[1];
<a name="l1836"></a> plot=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l1837"></a> } </span><span class=cF1>else</span><span class=cF0>
<a name="l1838"></a> plot=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l1839"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1840"></a> </span><span class=cF1>if</span><span class=cF0> (plot) </span><span class=cF7>{</span><span class=cF0>
<a name="l1841"></a> dst=dc-&gt;body+d;
<a name="l1842"></a> c=color.c0.color;
<a name="l1843"></a> </span><span class=cF1>switch</span><span class=cF0> [color.c0.rop] {
<a name="l1844"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_EQU</span><span class=cF0>:
<a name="l1845"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_MONO</span><span class=cF0>:
<a name="l1846"></a> *dst=c;
<a name="l1847"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1848"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_COLLISION</span><span class=cF0>:
<a name="l1849"></a> c2=*dst;
<a name="l1850"></a> </span><span class=cF1>if</span><span class=cF0> (c2!=</span><span class=cF3>TRANSPARENT</span><span class=cF0> &amp;&amp; c2!=bkcolor.c0.color)
<a name="l1851"></a> dc-&gt;collision_cnt++;
<a name="l1852"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1853"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_XOR</span><span class=cF0>:
<a name="l1854"></a> *dst^=c;
<a name="l1855"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l1856"></a> }
<a name="l1857"></a> res++;
<a name="l1858"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1859"></a> }
<a name="l1860"></a> </span><span class=cF1>if</span><span class=cF0> (dither) {
<a name="l1861"></a> </span><span class=cF1>if</span><span class=cF0> (probability_dither) </span><span class=cF7>{</span><span class=cF0>
<a name="l1862"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>RandU16</span><span class=cF0>&lt;dc-&gt;dither_probability_u16)
<a name="l1863"></a> color.c0=dither_colors.c1;
<a name="l1864"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1865"></a> color.c0=dither_colors.c0;
<a name="l1866"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l1867"></a> </span><span class=cF5>SwapU16</span><span class=cF0>(&amp;color.c0,&amp;color.c1);
<a name="l1868"></a> }
<a name="l1869"></a> d++;
<a name="l1870"></a> x1++;
<a name="l1871"></a> </span><span class=cF1>if</span><span class=cF0> (db)
<a name="l1872"></a> db++;
<a name="l1873"></a> z+=dz;
<a name="l1874"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>x1&amp;(</span><span class=cF3>FONT_WIDTH</span><span class=cF0>-1)</span><span class=cF7>)</span><span class=cF0> &amp;&amp; x1&lt;=x2) {
<a name="l1875"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF7>)</span><span class=cF0>||
<a name="l1876"></a> win_task-&gt;next_task==</span><span class=cFB>sys_winmgr_task</span><span class=cF0> ||
<a name="l1877"></a> dc-&gt;flags&amp;</span><span class=cF3>DCF_ON_TOP</span><span class=cF0> || !</span><span class=cF5>IsPixCovered0</span><span class=cF7>(</span><span class=cF0>win_task,x1,y</span><span class=cF7>)</span><span class=cF0>)
<a name="l1878"></a> char_clear=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l1879"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1880"></a> char_clear=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l1881"></a> }
<a name="l1882"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1883"></a>gr_done:
<a name="l1884"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l1885"></a>}
<a name="l1886"></a>
<a name="l1887"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>GrVLine</span><span class=cF0>(</span><span class=cF9>CDC</span><span class=cF0> *dc=</span><span class=cFB>gr</span><span class=cF0>.dc,</span><span class=cF9>I64</span><span class=cF0> x,</span><span class=cF9>I64</span><span class=cF0> y1,</span><span class=cF9>I64</span><span class=cF0> y2,</span><span class=cF9>I64</span><span class=cF0> z1=0,</span><span class=cF9>I64</span><span class=cF0> z2=0)
<a name="l1888"></a>{</span><span class=cF2>//3D. No transformation or thick.</span><span class=cF0>
<a name="l1889"></a></span><span class=cF2>//Returns cnt of pixs changed</span><span class=cF0>
<a name="l1890"></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="l1891"></a> </span><span class=cF9>I64</span><span class=cF0> dist,dy,dz,z,res=0,i,j,d;
<a name="l1892"></a> </span><span class=cF1>U8</span><span class=cF0> *dst;
<a name="l1893"></a> </span><span class=cF9>CColorROPU32</span><span class=cF0> c,c2,color=dc-&gt;color,bkcolor=dc-&gt;bkcolor,dither_colors;
<a name="l1894"></a> </span><span class=cF9>I32</span><span class=cF0> *db;
<a name="l1895"></a> </span><span class=cF1>Bool</span><span class=cF0> plot=</span><span class=cF3>TRUE</span><span class=cF0>,char_clear,dither,probability_dither;
<a name="l1896"></a> </span><span class=cF9>CTask</span><span class=cF0> *win_task;
<a name="l1897"></a>
<a name="l1898"></a> </span><span class=cF1>if</span><span class=cF0> (!dc-&gt;depth_buf) </span><span class=cF7>{</span><span class=cF0>
<a name="l1899"></a> </span><span class=cF1>if</span><span class=cF0> (y2&lt;y1) </span><span class=cF5>SwapI64</span><span class=cF0>(&amp;y1,&amp;y2);
<a name="l1900"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>GrRect</span><span class=cF0>(dc,x,y1,1,y2-y1+1);
<a name="l1901"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1902"></a>
<a name="l1903"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1904"></a> win_task=dc-&gt;win_task;
<a name="l1905"></a> x +=win_task-&gt;scroll_x;
<a name="l1906"></a> y1+=win_task-&gt;scroll_y;
<a name="l1907"></a> y2+=win_task-&gt;scroll_y;
<a name="l1908"></a> z1+=win_task-&gt;scroll_z;
<a name="l1909"></a> z2+=win_task-&gt;scroll_z;
<a name="l1910"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1911"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_RECORD_EXTENTS</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1912"></a> </span><span class=cF1>if</span><span class=cF0> (x&lt;dc-&gt;min_x) dc-&gt;min_x=x;
<a name="l1913"></a> </span><span class=cF1>if</span><span class=cF0> (x&gt;dc-&gt;max_x) dc-&gt;max_x=x;
<a name="l1914"></a> </span><span class=cF1>if</span><span class=cF0> (y1&lt;dc-&gt;min_y) dc-&gt;min_y=y1;
<a name="l1915"></a> </span><span class=cF1>if</span><span class=cF0> (y1&gt;dc-&gt;max_y) dc-&gt;max_y=y1;
<a name="l1916"></a> </span><span class=cF1>if</span><span class=cF0> (y2&lt;dc-&gt;min_y) dc-&gt;min_y=y2;
<a name="l1917"></a> </span><span class=cF1>if</span><span class=cF0> (y2&gt;dc-&gt;max_y) dc-&gt;max_y=y2;
<a name="l1918"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1919"></a> </span><span class=cF1>if</span><span class=cF0> (x&lt;0) </span><span class=cF1>goto</span><span class=cF0> gr_done;
<a name="l1920"></a> </span><span class=cF1>if</span><span class=cF0> (y2&lt;y1) </span><span class=cF7>{</span><span class=cF0>
<a name="l1921"></a> </span><span class=cF5>SwapI64</span><span class=cF0>(&amp;y1,&amp;y2);
<a name="l1922"></a> </span><span class=cF5>SwapI64</span><span class=cF0>(&amp;z1,&amp;z2);
<a name="l1923"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1924"></a> </span><span class=cF1>if</span><span class=cF0> (y2&lt;0)
<a name="l1925"></a> </span><span class=cF1>goto</span><span class=cF0> gr_done;
<a name="l1926"></a> </span><span class=cF1>if</span><span class=cF0> (y1&lt;0) </span><span class=cF7>{</span><span class=cF0>
<a name="l1927"></a> i=-y1;
<a name="l1928"></a> y1=0;
<a name="l1929"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l1930"></a> i=0;
<a name="l1931"></a> j=0;
<a name="l1932"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1933"></a> y1+=win_task-&gt;pix_top;
<a name="l1934"></a> y2+=win_task-&gt;pix_top;
<a name="l1935"></a> </span><span class=cF1>if</span><span class=cF0> (y1&gt;win_task-&gt;pix_bottom)
<a name="l1936"></a> </span><span class=cF1>goto</span><span class=cF0> gr_done;
<a name="l1937"></a> </span><span class=cF1>if</span><span class=cF0> (y2&gt;win_task-&gt;pix_bottom) {
<a name="l1938"></a> j=y2-win_task-&gt;pix_bottom;
<a name="l1939"></a> y2=win_task-&gt;pix_bottom;
<a name="l1940"></a> }
<a name="l1941"></a> x+=win_task-&gt;pix_left;
<a name="l1942"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>0&lt;=x&lt;=win_task-&gt;pix_right</span><span class=cF7>)</span><span class=cF0> || y2&lt;0)
<a name="l1943"></a> </span><span class=cF1>goto</span><span class=cF0> gr_done;
<a name="l1944"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1945"></a> </span><span class=cF1>if</span><span class=cF0> (y1&gt;=dc-&gt;height || x&gt;=dc-&gt;width)
<a name="l1946"></a> </span><span class=cF1>goto</span><span class=cF0> gr_done;
<a name="l1947"></a> dy=y2+j-(y1-i);
<a name="l1948"></a> d=dc-&gt;width_internal*y1+x;
<a name="l1949"></a> </span><span class=cF1>if</span><span class=cF0> (db=dc-&gt;depth_buf) </span><span class=cF7>{</span><span class=cF0>
<a name="l1950"></a> db+=d;
<a name="l1951"></a> </span><span class=cF1>if</span><span class=cF0> (dy)
<a name="l1952"></a> dz=(z2-z1)&lt;&lt;32/dy;
<a name="l1953"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1954"></a> dz=0;
<a name="l1955"></a> z=z1&lt;&lt;32;
<a name="l1956"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1957"></a> </span><span class=cF1>if</span><span class=cF0> (i)
<a name="l1958"></a> z+=i*dz;
<a name="l1959"></a> </span><span class=cF1>if</span><span class=cF0> (y2&gt;=dc-&gt;height)
<a name="l1960"></a> y2=dc-&gt;height-1;
<a name="l1961"></a>
<a name="l1962"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_LOCATE_NEAREST</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1963"></a> </span><span class=cF1>if</span><span class=cF0> (y1&lt;=dc-&gt;cur_y&lt;=y2)
<a name="l1964"></a> dist=0;
<a name="l1965"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;cur_y&lt;y1)
<a name="l1966"></a> dist=</span><span class=cF5>SqrI64</span><span class=cF0>(y1-dc-&gt;cur_y);
<a name="l1967"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1968"></a> dist=</span><span class=cF5>SqrI64</span><span class=cF0>(dc-&gt;cur_y-y2);
<a name="l1969"></a> dist+=</span><span class=cF5>SqrI64</span><span class=cF0>(x-dc-&gt;cur_x);
<a name="l1970"></a> </span><span class=cF1>if</span><span class=cF0> (dist&lt;=dc-&gt;nearest_dist)
<a name="l1971"></a> dc-&gt;nearest_dist=dist;
<a name="l1972"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l1973"></a> </span><span class=cF1>if</span><span class=cF0> (dc-&gt;flags &amp; </span><span class=cF3>DCF_DONT_DRAW</span><span class=cF0>)
<a name="l1974"></a> </span><span class=cF1>goto</span><span class=cF0> gr_done;
<a name="l1975"></a>
<a name="l1976"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF7>)</span><span class=cF0> ||
<a name="l1977"></a> win_task-&gt;next_task==</span><span class=cFB>sys_winmgr_task</span><span class=cF0> ||
<a name="l1978"></a> dc-&gt;flags&amp;</span><span class=cF3>DCF_ON_TOP</span><span class=cF0> || !</span><span class=cF5>IsPixCovered0</span><span class=cF7>(</span><span class=cF0>win_task,x,y1</span><span class=cF7>)</span><span class=cF0>)
<a name="l1979"></a> char_clear=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l1980"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1981"></a> char_clear=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l1982"></a> </span><span class=cF1>if</span><span class=cF0> (color.c1.rop&amp;</span><span class=cF7>(</span><span class=cF3>ROPBF_DITHER</span><span class=cF0>|</span><span class=cF3>ROPBF_PROBABILITY_DITHER</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l1983"></a> dither=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l1984"></a> </span><span class=cF1>if</span><span class=cF0> (color.c1.rop&amp;</span><span class=cF3>ROPBF_PROBABILITY_DITHER</span><span class=cF0>) {
<a name="l1985"></a> probability_dither=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l1986"></a> color.c1.rop=color.c0.rop;
<a name="l1987"></a> dither_colors=color;
<a name="l1988"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>RandU16</span><span class=cF0>&lt;dc-&gt;dither_probability_u16)
<a name="l1989"></a> color.c0=dither_colors.c1;
<a name="l1990"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l1991"></a> color.c0=dither_colors.c0;
<a name="l1992"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l1993"></a> probability_dither=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l1994"></a> color.c1.rop=color.c0.rop;
<a name="l1995"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>x^y1</span><span class=cF7>)</span><span class=cF0>&amp;1)
<a name="l1996"></a> </span><span class=cF5>SwapU16</span><span class=cF0>(&amp;color.c0,&amp;color.c1);
<a name="l1997"></a> }
<a name="l1998"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l1999"></a> dither=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l2000"></a> </span><span class=cF1>while</span><span class=cF0> (y1&lt;=y2) </span><span class=cF7>{</span><span class=cF0>
<a name="l2001"></a> </span><span class=cF1>if</span><span class=cF0> (char_clear) {
<a name="l2002"></a> </span><span class=cF1>if</span><span class=cF0> (db) </span><span class=cF7>{</span><span class=cF0>
<a name="l2003"></a> </span><span class=cF1>if</span><span class=cF0> (0&lt;=z.i32[1]&lt;=*db) {
<a name="l2004"></a> *db=z.i32[1];
<a name="l2005"></a> plot=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l2006"></a> } </span><span class=cF1>else</span><span class=cF0>
<a name="l2007"></a> plot=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l2008"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l2009"></a> </span><span class=cF1>if</span><span class=cF0> (plot) </span><span class=cF7>{</span><span class=cF0>
<a name="l2010"></a> dst=dc-&gt;body+d;
<a name="l2011"></a> c=color.c0.color;
<a name="l2012"></a> </span><span class=cF1>switch</span><span class=cF0> [color.c0.rop] {
<a name="l2013"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_EQU</span><span class=cF0>:
<a name="l2014"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_MONO</span><span class=cF0>:
<a name="l2015"></a> *dst=c;
<a name="l2016"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l2017"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_COLLISION</span><span class=cF0>:
<a name="l2018"></a> c2=*dst;
<a name="l2019"></a> </span><span class=cF1>if</span><span class=cF0> (c2!=</span><span class=cF3>TRANSPARENT</span><span class=cF0> &amp;&amp; c2!=bkcolor.c0.color)
<a name="l2020"></a> dc-&gt;collision_cnt++;
<a name="l2021"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l2022"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>ROPB_XOR</span><span class=cF0>:
<a name="l2023"></a> *dst^=c;
<a name="l2024"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l2025"></a> }
<a name="l2026"></a> res++;
<a name="l2027"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l2028"></a> }
<a name="l2029"></a> </span><span class=cF1>if</span><span class=cF0> (dither) {
<a name="l2030"></a> </span><span class=cF1>if</span><span class=cF0> (probability_dither) </span><span class=cF7>{</span><span class=cF0>
<a name="l2031"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>RandU16</span><span class=cF0>&lt;dc-&gt;dither_probability_u16)
<a name="l2032"></a> color.c0=dither_colors.c1;
<a name="l2033"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l2034"></a> color.c0=dither_colors.c0;
<a name="l2035"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l2036"></a> </span><span class=cF5>SwapU16</span><span class=cF0>(&amp;color.c0,&amp;color.c1);
<a name="l2037"></a> }
<a name="l2038"></a> d+=dc-&gt;width_internal;
<a name="l2039"></a> y1++;
<a name="l2040"></a> </span><span class=cF1>if</span><span class=cF0> (db)
<a name="l2041"></a> db+=dc-&gt;width_internal;
<a name="l2042"></a> z+=dz;
<a name="l2043"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>y1&amp;(</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>-1)</span><span class=cF7>)</span><span class=cF0> &amp;&amp; y1&lt;=y2) {
<a name="l2044"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>dc-&gt;flags &amp; </span><span class=cF3>DCF_SCRN_BITMAP</span><span class=cF7>)</span><span class=cF0>||
<a name="l2045"></a> win_task-&gt;next_task==</span><span class=cFB>sys_winmgr_task</span><span class=cF0> ||
<a name="l2046"></a> dc-&gt;flags&amp;</span><span class=cF3>DCF_ON_TOP</span><span class=cF0> || !</span><span class=cF5>IsPixCovered0</span><span class=cF7>(</span><span class=cF0>win_task,x,y1</span><span class=cF7>)</span><span class=cF0>)
<a name="l2047"></a> char_clear=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l2048"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l2049"></a> char_clear=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l2050"></a> }
<a name="l2051"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l2052"></a>gr_done:
<a name="l2053"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l2054"></a>}
</span></pre></body>
</html>