ZealOS/docs/Apps/ToTheFront/TTFDraw.CC.html
2021-08-17 02:47:37 -04:00

269 lines
28 KiB
HTML
Executable file

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
<meta name="generator" content="ZealOS V1.00">
<style type="text/css">
body {background-color:#fef1f0;}
.cF0{color:#000000;background-color:#fef1f0;}
.cF1{color:#0148a4;background-color:#fef1f0;}
.cF2{color:#3b7901;background-color:#fef1f0;}
.cF3{color:#057c7e;background-color:#fef1f0;}
.cF4{color:#bb2020;background-color:#fef1f0;}
.cF5{color:#9e42ae;background-color:#fef1f0;}
.cF6{color:#b57901;background-color:#fef1f0;}
.cF7{color:#b2b6af;background-color:#fef1f0;}
.cF8{color:#555753;background-color:#fef1f0;}
.cF9{color:#678fbb;background-color:#fef1f0;}
.cFA{color:#82bc49;background-color:#fef1f0;}
.cFB{color:#0097a2;background-color:#fef1f0;}
.cFC{color:#e26a6a;background-color:#fef1f0;}
.cFD{color:#c671bc;background-color:#fef1f0;}
.cFE{color:#c7ab00;background-color:#fef1f0;}
.cFF{color:#fef1f0;background-color:#fef1f0;}
</style>
</head>
<body>
<pre style="font-family:monospace;font-size:12pt">
<a name="l1"></a><span class=cFA>
<a name="l2"></a>&lt;1&gt;/* Graphics Not Rendered in HTML */</span><span class=cF0>
<a name="l3"></a>
<a name="l4"></a></span><span class=cF1>U0</span><span class=cF0> UnitDraw(</span><span class=cF9>CDC</span><span class=cF0> *dc, Unit *tmpu, </span><span class=cF9>I64</span><span class=cF0> x, </span><span class=cF9>I64</span><span class=cF0> y, </span><span class=cF1>F64</span><span class=cF0> f)
<a name="l5"></a>{
<a name="l6"></a> x += x0;
<a name="l7"></a> y += y0;
<a name="l8"></a> </span><span class=cF1>if</span><span class=cF0> (tmpu-&gt;infantry)
<a name="l9"></a> </span><span class=cF5>Sprite3</span><span class=cF0>(dc, x, y, </span><span class=cFE>0</span><span class=cF0>, tmpu-&gt;img);
<a name="l10"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l11"></a> </span><span class=cF5>Sprite3ZB</span><span class=cF0>(dc, x, y, </span><span class=cFE>0</span><span class=cF0>, tmpu-&gt;img, f);
<a name="l12"></a> </span><span class=cF1>if</span><span class=cF0> (phase &amp; ~</span><span class=cFE>1</span><span class=cF0> == PHASE_INDIRECT &amp;&amp; tmpu-&gt;indirect_fire &amp;&amp; !tmpu-&gt;fired &amp;&amp; tmpu-&gt;player == cur_player)
<a name="l13"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l14"></a> dc-&gt;thick = </span><span class=cFE>2</span><span class=cF0>;
<a name="l15"></a> </span><span class=cF1>if</span><span class=cF0> (cur_player)
<a name="l16"></a> dc-&gt;color = </span><span class=cF3>PURPLE</span><span class=cF0>;
<a name="l17"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l18"></a> dc-&gt;color = </span><span class=cF3>CYAN</span><span class=cF0>;
<a name="l19"></a> </span><span class=cF5>GrCircle3</span><span class=cF0>(dc, x, y, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cFE>20</span><span class=cF0> * </span><span class=cF5>Saw</span><span class=cF7>(</span><span class=cFE>4</span><span class=cF0> * </span><span class=cF5>tS</span><span class=cF0>, </span><span class=cFE>2</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF7>)</span><span class=cF0>);
<a name="l20"></a> </span><span class=cF5>GrCircle3</span><span class=cF0>(dc, x, y, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cFE>20</span><span class=cF0> * </span><span class=cF5>Saw</span><span class=cF7>(</span><span class=cFE>4</span><span class=cF0> * </span><span class=cF5>tS</span><span class=cF0> + </span><span class=cFE>1</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>, </span><span class=cFE>2</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF7>)</span><span class=cF0>);
<a name="l21"></a> dc-&gt;thick = </span><span class=cFE>1</span><span class=cF0>;
<a name="l22"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l23"></a>}
<a name="l24"></a>
<a name="l25"></a></span><span class=cF1>U0</span><span class=cF0> UnitsDraw(</span><span class=cF9>CDC</span><span class=cF0> *dc)
<a name="l26"></a>{
<a name="l27"></a> </span><span class=cF9>I64</span><span class=cF0> i, j;
<a name="l28"></a> </span><span class=cF1>F64</span><span class=cF0> x, y;
<a name="l29"></a> Unit *tmpu;
<a name="l30"></a>
<a name="l31"></a> </span><span class=cF1>for</span><span class=cF0> (j = </span><span class=cFE>0</span><span class=cF0>; j &lt; </span><span class=cFE>2</span><span class=cF0>; j++)
<a name="l32"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l33"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i &lt; UNITS_NUM; i++)
<a name="l34"></a> {
<a name="l35"></a> tmpu = &amp;units[j][i];
<a name="l36"></a> </span><span class=cF1>if</span><span class=cF0> (tmpu == target_unit)
<a name="l37"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l38"></a> </span><span class=cF1>if</span><span class=cF0> (target_hit)
<a name="l39"></a> dc-&gt;color = </span><span class=cF3>RED</span><span class=cF0>;
<a name="l40"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l41"></a> dc-&gt;color = </span><span class=cF3>GREEN</span><span class=cF0>;
<a name="l42"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l43"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l44"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l45"></a> </span><span class=cF1>if</span><span class=cF0> (j)
<a name="l46"></a> dc-&gt;color = </span><span class=cF3>LTPURPLE</span><span class=cF0>;
<a name="l47"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l48"></a> dc-&gt;color = </span><span class=cF3>LTCYAN</span><span class=cF0>;
<a name="l49"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l50"></a> </span><span class=cF1>if</span><span class=cF0> (tmpu-&gt;life &gt; </span><span class=cFE>0</span><span class=cF0> &amp;&amp; </span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;tmpu-&gt;vis[view_player], </span><span class=cFE>0</span><span class=cF7>)</span><span class=cF0> &amp;&amp; tmpu != moving_unit)
<a name="l51"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l52"></a> RowCol2XY(&amp;x, &amp;y, tmpu-&gt;row, tmpu-&gt;col);
<a name="l53"></a> </span><span class=cF1>if</span><span class=cF0> ( phase &amp; ~</span><span class=cFE>1</span><span class=cF0> == PHASE_MOVE &amp;&amp; tmpu-&gt;remaining_movement ||
<a name="l54"></a> </span><span class=cF7>(</span><span class=cF0>phase &amp; ~</span><span class=cFE>1</span><span class=cF0> == PHASE_INDIRECT &amp;&amp; tmpu-&gt;indirect_fire || phase &amp; ~</span><span class=cFE>1</span><span class=cF0> == PHASE_DIRECT &amp;&amp;
<a name="l55"></a> !tmpu-&gt;indirect_fire</span><span class=cF7>)</span><span class=cF0> &amp;&amp;
<a name="l56"></a> !tmpu-&gt;fired || </span><span class=cF5>Blink</span><span class=cF7>(</span><span class=cFE>5</span><span class=cF7>)</span><span class=cF0>)
<a name="l57"></a> UnitDraw(dc, tmpu, x, y, tmpu-&gt;facing * </span><span class=cFE>60</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0> * </span><span class=cF3>pi</span><span class=cF0> / </span><span class=cFE>180</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>);
<a name="l58"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l59"></a> }
<a name="l60"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l61"></a>}
<a name="l62"></a>
<a name="l63"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>DrawIt</span><span class=cF0>(</span><span class=cF9>CTask</span><span class=cF0> *task, </span><span class=cF9>CDC</span><span class=cF0> *dc)
<a name="l64"></a>{
<a name="l65"></a> </span><span class=cF1>F64</span><span class=cF0> x, y;
<a name="l66"></a> </span><span class=cF9>I64</span><span class=cF0> i, j, r, c;
<a name="l67"></a> </span><span class=cF1>U8</span><span class=cF0> buf[</span><span class=cF3>STR_LEN</span><span class=cF0>];
<a name="l68"></a> IndirectOrders *tmpi;
<a name="l69"></a>
<a name="l70"></a> </span><span class=cF2>//Erase text beneath.</span><span class=cF0>
<a name="l71"></a> dc-&gt;color = </span><span class=cF3>WHITE</span><span class=cF0>;
<a name="l72"></a> </span><span class=cF5>GrRect</span><span class=cF0>(dc, -task-&gt;scroll_x, -task-&gt;scroll_y, dc-&gt;width, dc-&gt;height);
<a name="l73"></a>
<a name="l74"></a> map_dc-&gt;flags |= </span><span class=cF3>DCF_NO_TRANSPARENTS</span><span class=cF0>;
<a name="l75"></a> </span><span class=cF5>GrBlot</span><span class=cF0>(dc, x0, y0, map_dc);
<a name="l76"></a>
<a name="l77"></a> i = </span><span class=cFB>mouse</span><span class=cF0>.pos.x - task-&gt;pix_left - task-&gt;scroll_x;
<a name="l78"></a> j = </span><span class=cFB>mouse</span><span class=cF0>.pos.y - task-&gt;pix_top - task-&gt;scroll_y;
<a name="l79"></a> </span><span class=cF1>if</span><span class=cF0> (CursorInWin</span><span class=cF7>(</span><span class=cF0>task, i, j</span><span class=cF7>)</span><span class=cF0>)
<a name="l80"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l81"></a> i -= x0;
<a name="l82"></a> j -= y0;
<a name="l83"></a> CursorUpdate(task, i, j);
<a name="l84"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l85"></a> RowCol2XY(&amp;x, &amp;y, cursor_row, cursor_col);
<a name="l86"></a>
<a name="l87"></a> </span><span class=cF2>//Roads require multiple cursor fills</span><span class=cF0>
<a name="l88"></a> dc-&gt;color = </span><span class=cF3>YELLOW</span><span class=cF0>;
<a name="l89"></a> c=terrain[cursor_row][cursor_col];
<a name="l90"></a> </span><span class=cF1>for</span><span class=cF0> (i=-</span><span class=cF7>(</span><span class=cF0>HEX_SIDE + DCOS</span><span class=cF7>)</span><span class=cF0> / </span><span class=cFE>2</span><span class=cF0>;i &lt;= </span><span class=cF7>(</span><span class=cF0>HEX_SIDE + DCOS</span><span class=cF7>)</span><span class=cF0> / </span><span class=cFE>2</span><span class=cF0>; i++)
<a name="l91"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l92"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>GrPeek</span><span class=cF7>(</span><span class=cF0>dc, x + i + x0, y + y0</span><span class=cF7>)</span><span class=cF0> == c)
<a name="l93"></a> </span><span class=cF5>GrFloodFill</span><span class=cF0>(dc, x + i + x0, y + y0);
<a name="l94"></a> </span><span class=cF1>for</span><span class=cF0> (j = -HEX_SIDE / </span><span class=cFE>2</span><span class=cF0>; j &lt;= HEX_SIDE / </span><span class=cFE>2</span><span class=cF0>; j++)
<a name="l95"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>GrPeek</span><span class=cF7>(</span><span class=cF0>dc, x + j + x0, y + i + y0</span><span class=cF7>)</span><span class=cF0> == c)
<a name="l96"></a> </span><span class=cF5>GrFloodFill</span><span class=cF0>(dc, x + j + x0, y + i + y0);
<a name="l97"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l98"></a>
<a name="l99"></a> UnitsDraw(dc);
<a name="l100"></a> </span><span class=cF1>if</span><span class=cF0> (firing)
<a name="l101"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l102"></a> dc-&gt;color = </span><span class=cF3>BLACK</span><span class=cF0>;
<a name="l103"></a> </span><span class=cF5>GrCircle</span><span class=cF0>(dc, fire_x + x0, fire_y + y0, </span><span class=cFE>2</span><span class=cF0>);
<a name="l104"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l105"></a> </span><span class=cF1>if</span><span class=cF0> (indirect_explosion)
<a name="l106"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l107"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i &lt; </span><span class=cFE>7</span><span class=cF0>; i++)
<a name="l108"></a> {
<a name="l109"></a> </span><span class=cF1>if</span><span class=cF0> (indirect_row &amp; </span><span class=cFE>1</span><span class=cF0>)
<a name="l110"></a> c = indirect_col + col_offsets_odd[i];
<a name="l111"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l112"></a> c = indirect_col + col_offsets_even[i];
<a name="l113"></a> r = indirect_row + row_offsets[i];
<a name="l114"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFE>0</span><span class=cF0> &lt;= r &lt; map_rows &amp;&amp; </span><span class=cFE>0</span><span class=cF0> &lt;= c &lt; map_cols)
<a name="l115"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l116"></a> RowCol2XY(&amp;x, &amp;y, r, c);
<a name="l117"></a> </span><span class=cF1>for</span><span class=cF0> (j = </span><span class=cFE>0</span><span class=cF0>; j &lt; </span><span class=cFE>10</span><span class=cF0>; j++)
<a name="l118"></a> {
<a name="l119"></a> </span><span class=cF1>if</span><span class=cF0> (j &amp; </span><span class=cFE>1</span><span class=cF0>)
<a name="l120"></a> dc-&gt;color = </span><span class=cF3>LTRED</span><span class=cF0>;
<a name="l121"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l122"></a> dc-&gt;color = </span><span class=cF3>YELLOW</span><span class=cF0>;
<a name="l123"></a> </span><span class=cF5>GrCircle</span><span class=cF0>(dc, x + </span><span class=cF5>RandU16</span><span class=cF0> % HEX_SIDE - HEX_SIDE / </span><span class=cFE>2</span><span class=cF0> + x0,
<a name="l124"></a> y + </span><span class=cF5>RandU16</span><span class=cF0> % HEX_SIDE - HEX_SIDE / </span><span class=cFE>2</span><span class=cF0> + y0, </span><span class=cFE>2</span><span class=cF0>);
<a name="l125"></a> }
<a name="l126"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l127"></a> }
<a name="l128"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l129"></a> </span><span class=cF1>if</span><span class=cF0> (moving_unit &amp;&amp; moving_unit-&gt;vis[view_player])
<a name="l130"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l131"></a> dc-&gt;color = </span><span class=cF3>YELLOW</span><span class=cF0>;
<a name="l132"></a> UnitDraw(dc, moving_unit, move_x, move_y, move_facing);
<a name="l133"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l134"></a> </span><span class=cF5>ProgressBarsReset</span><span class=cF0>;
<a name="l135"></a> </span><span class=cF1>if</span><span class=cF0> (moving_unit)
<a name="l136"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l137"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.pos.y &lt; </span><span class=cF3>GR_HEIGHT</span><span class=cF0> / </span><span class=cFE>2</span><span class=cF0>)
<a name="l138"></a> {
<a name="l139"></a> </span><span class=cFB>progress4_max</span><span class=cF0> = moving_unit-&gt;movement;
<a name="l140"></a> </span><span class=cFB>progress4</span><span class=cF0> = moving_unit-&gt;remaining_movement;
<a name="l141"></a> }
<a name="l142"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l143"></a> {
<a name="l144"></a> </span><span class=cFB>progress1_max</span><span class=cF0> = moving_unit-&gt;movement;
<a name="l145"></a> </span><span class=cFB>progress1</span><span class=cF0> = moving_unit-&gt;remaining_movement;
<a name="l146"></a> }
<a name="l147"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l148"></a> </span><span class=cF1>if</span><span class=cF0> (fire_radius)
<a name="l149"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l150"></a> dc-&gt;color = </span><span class=cF3>YELLOW</span><span class=cF0>;
<a name="l151"></a> </span><span class=cF5>GrCircle</span><span class=cF0>(dc, fire_radius_x + x0, fire_radius_y + y0, fire_radius - </span><span class=cFE>1</span><span class=cF0>);
<a name="l152"></a> </span><span class=cF5>GrCircle</span><span class=cF0>(dc, fire_radius_x + x0, fire_radius_y + y0, fire_radius + </span><span class=cFE>1</span><span class=cF0>);
<a name="l153"></a> dc-&gt;color = </span><span class=cF3>RED</span><span class=cF0>;
<a name="l154"></a> </span><span class=cF5>GrCircle</span><span class=cF0>(dc, fire_radius_x + x0, fire_radius_y + y0, fire_radius);
<a name="l155"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l156"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Blink</span><span class=cF7>(</span><span class=cFE>10</span><span class=cF7>)</span><span class=cF0>)
<a name="l157"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l158"></a> tmpi = indirect_head.next;
<a name="l159"></a> </span><span class=cF1>while</span><span class=cF0> (tmpi != &amp;indirect_head)
<a name="l160"></a> {
<a name="l161"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;attacker-&gt;player == view_player)
<a name="l162"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l163"></a> RowCol2XY(&amp;x, &amp;y, tmpi-&gt;row, tmpi-&gt;col);
<a name="l164"></a> </span><span class=cF5>Sprite3</span><span class=cF0>(dc, x + x0, y + y0, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cFA>&lt;1&gt;</span><span class=cF0>);
<a name="l165"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l166"></a> tmpi = tmpi-&gt;next;
<a name="l167"></a> }
<a name="l168"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l169"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>kbd</span><span class=cF0>.down_bitmap, </span><span class=cF3>SC_SHIFT</span><span class=cF7>)</span><span class=cF0>)
<a name="l170"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l171"></a> </span><span class=cF1>if</span><span class=cF0> (show_vis_row != cursor_row || show_vis_col != cursor_col)
<a name="l172"></a> {
<a name="l173"></a> show_vis_row = cursor_row;
<a name="l174"></a> show_vis_col = cursor_col;
<a name="l175"></a> VisRecalcMap(show_vis_row, show_vis_col);
<a name="l176"></a> }
<a name="l177"></a>
<a name="l178"></a> dc-&gt;color = </span><span class=cF3>LTGRAY</span><span class=cF0>;
<a name="l179"></a> </span><span class=cF1>for</span><span class=cF0> (j = </span><span class=cFE>0</span><span class=cF0>; j &lt; map_rows; j++)
<a name="l180"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i &lt; map_cols; i++)
<a name="l181"></a> </span><span class=cF1>if</span><span class=cF0> (!vis_map[j][i])
<a name="l182"></a> {
<a name="l183"></a> RowCol2XY(&amp;x, &amp;y, j, i);
<a name="l184"></a> </span><span class=cF5>GrLine</span><span class=cF0>(dc, x - </span><span class=cFE>6</span><span class=cF0> + x0, y - </span><span class=cFE>6</span><span class=cF0> + y0, x + </span><span class=cFE>6</span><span class=cF0> + x0, y + </span><span class=cFE>6</span><span class=cF0> + y0);
<a name="l185"></a> </span><span class=cF5>GrLine</span><span class=cF0>(dc, x + </span><span class=cFE>6</span><span class=cF0> + x0, y - </span><span class=cFE>6</span><span class=cF0> + y0, x - </span><span class=cFE>6</span><span class=cF0> + x0, y + </span><span class=cFE>6</span><span class=cF0> + y0);
<a name="l186"></a> </span><span class=cF5>GrLine</span><span class=cF0>(dc, x + x0, y - </span><span class=cFE>6</span><span class=cF0> + y0, x + x0, y + </span><span class=cFE>6</span><span class=cF0> + y0);
<a name="l187"></a> </span><span class=cF5>GrLine</span><span class=cF0>(dc, x + </span><span class=cFE>6</span><span class=cF0> + x0, y + y0, x - </span><span class=cFE>6</span><span class=cF0> + x0, y + y0);
<a name="l188"></a> }
<a name="l189"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l190"></a> </span><span class=cF1>if</span><span class=cF0> (i = </span><span class=cF5>StrLen</span><span class=cF7>(</span><span class=cF0>message_buf</span><span class=cF7>)</span><span class=cF0> * </span><span class=cF3>FONT_WIDTH</span><span class=cF0>)
<a name="l191"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l192"></a> dc-&gt;color = </span><span class=cF3>BLACK</span><span class=cF0>;
<a name="l193"></a> </span><span class=cF5>GrRect</span><span class=cF0>(dc, </span><span class=cF7>(</span><span class=cF0>task-&gt;pix_width - i</span><span class=cF7>)</span><span class=cF0> &gt;&gt; </span><span class=cFE>1</span><span class=cF0> - </span><span class=cFE>10</span><span class=cF0> - task-&gt;scroll_x,
<a name="l194"></a> </span><span class=cF7>(</span><span class=cF0>task-&gt;pix_height - </span><span class=cF3>FONT_HEIGHT</span><span class=cF7>)</span><span class=cF0> &gt;&gt; </span><span class=cFE>1</span><span class=cF0> - </span><span class=cFE>10</span><span class=cF0> - task-&gt;scroll_y,
<a name="l195"></a> i + </span><span class=cFE>20</span><span class=cF0>, </span><span class=cF3>FONT_HEIGHT</span><span class=cF0> + </span><span class=cFE>20</span><span class=cF0>);
<a name="l196"></a>
<a name="l197"></a> dc-&gt;color = </span><span class=cF3>YELLOW</span><span class=cF0>;
<a name="l198"></a> </span><span class=cF5>GrRect</span><span class=cF0>(dc, </span><span class=cF7>(</span><span class=cF0>task-&gt;pix_width-i</span><span class=cF7>)</span><span class=cF0> &gt;&gt; </span><span class=cFE>1</span><span class=cF0> - </span><span class=cFE>7</span><span class=cF0> - task-&gt;scroll_x,
<a name="l199"></a> </span><span class=cF7>(</span><span class=cF0>task-&gt;pix_height-</span><span class=cF3>FONT_HEIGHT</span><span class=cF7>)</span><span class=cF0> &gt;&gt; </span><span class=cFE>1</span><span class=cF0> - </span><span class=cFE>7</span><span class=cF0> - task-&gt;scroll_y,
<a name="l200"></a> i + </span><span class=cFE>14</span><span class=cF0>, </span><span class=cF3>FONT_HEIGHT</span><span class=cF0> + </span><span class=cFE>14</span><span class=cF0>);
<a name="l201"></a>
<a name="l202"></a> dc-&gt;color = </span><span class=cF3>RED</span><span class=cF0>;
<a name="l203"></a> </span><span class=cF5>GrPrint</span><span class=cF0>(dc, </span><span class=cF7>(</span><span class=cF0>task-&gt;pix_width - i</span><span class=cF7>)</span><span class=cF0> &gt;&gt; </span><span class=cFE>1</span><span class=cF0> - task-&gt;scroll_x,
<a name="l204"></a> </span><span class=cF7>(</span><span class=cF0>task-&gt;pix_height - </span><span class=cF3>FONT_HEIGHT</span><span class=cF7>)</span><span class=cF0> &gt;&gt; </span><span class=cFE>1</span><span class=cF0> - task-&gt;scroll_y,
<a name="l205"></a> message_buf);
<a name="l206"></a> </span><span class=cF1>if</span><span class=cF0> (message_off_timeout)
<a name="l207"></a> {
<a name="l208"></a> </span><span class=cF1>if</span><span class=cF0> (message_off_timeout - </span><span class=cFB>counts</span><span class=cF0>.jiffies &lt; </span><span class=cFE>3</span><span class=cF0> * </span><span class=cF3>JIFFY_FREQ</span><span class=cF0> / </span><span class=cFE>2</span><span class=cF0> * animation_delay)
<a name="l209"></a> </span><span class=cF5>Sound</span><span class=cF0>;
<a name="l210"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>counts</span><span class=cF0>.jiffies &gt; message_off_timeout)
<a name="l211"></a> *message_buf = </span><span class=cFE>0</span><span class=cF0>;
<a name="l212"></a> }
<a name="l213"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l214"></a>
<a name="l215"></a> dc-&gt;color = </span><span class=cF3>WHITE</span><span class=cF0>;
<a name="l216"></a> </span><span class=cF5>GrRect</span><span class=cF0>(dc, -task-&gt;scroll_x, -task-&gt;scroll_y, </span><span class=cF7>(</span><span class=cFE>13</span><span class=cF0> + </span><span class=cFE>7</span><span class=cF0> + </span><span class=cFE>10</span><span class=cF0> + </span><span class=cFE>10</span><span class=cF7>)</span><span class=cF0> * </span><span class=cF3>FONT_WIDTH</span><span class=cF0>, </span><span class=cF3>FONT_HEIGHT</span><span class=cF0>);
<a name="l217"></a>
<a name="l218"></a> </span><span class=cF1>if</span><span class=cF0> (phase&amp;~</span><span class=cFE>1</span><span class=cF0> == PHASE_INDIRECT)
<a name="l219"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf, </span><span class=cF6>&quot;Turn:%2d Artillery&quot;</span><span class=cF0>, turn);
<a name="l220"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (phase &amp; ~</span><span class=cFE>1</span><span class=cF0> == PHASE_MOVE)
<a name="l221"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf, </span><span class=cF6>&quot;Turn:%2d Move&quot;</span><span class=cF0>, turn);
<a name="l222"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l223"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf, </span><span class=cF6>&quot;Turn:%2d Fire&quot;</span><span class=cF0>, turn);
<a name="l224"></a> dc-&gt;color = </span><span class=cF3>BLACK</span><span class=cF0>;
<a name="l225"></a> </span><span class=cF5>GrPrint</span><span class=cF0>(dc, -task-&gt;scroll_x, -task-&gt;scroll_y, buf);
<a name="l226"></a>
<a name="l227"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf, </span><span class=cF6>&quot;%3d Units&quot;</span><span class=cF0>, alive_count[</span><span class=cFE>0</span><span class=cF0>]);
<a name="l228"></a> </span><span class=cF1>if</span><span class=cF0> (cur_player || </span><span class=cF5>Blink</span><span class=cF0>)
<a name="l229"></a> dc-&gt;color = </span><span class=cF3>CYAN</span><span class=cF0>;
<a name="l230"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l231"></a> dc-&gt;color = </span><span class=cF3>LTCYAN</span><span class=cF0>;
<a name="l232"></a> </span><span class=cF5>GrPrint</span><span class=cF0>(dc, -task-&gt;scroll_x + </span><span class=cF7>(</span><span class=cFE>13</span><span class=cF0> + </span><span class=cFE>7</span><span class=cF7>)</span><span class=cF0> * </span><span class=cF3>FONT_WIDTH</span><span class=cF0>, -task-&gt;scroll_y, buf);
<a name="l233"></a>
<a name="l234"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf, </span><span class=cF6>&quot;%3d Units&quot;</span><span class=cF0>, alive_count[</span><span class=cFE>1</span><span class=cF0>]);
<a name="l235"></a> </span><span class=cF1>if</span><span class=cF0> (!cur_player || </span><span class=cF5>Blink</span><span class=cF0>)
<a name="l236"></a> dc-&gt;color = </span><span class=cF3>PURPLE</span><span class=cF0>;
<a name="l237"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l238"></a> dc-&gt;color = </span><span class=cF3>LTPURPLE</span><span class=cF0>;
<a name="l239"></a> </span><span class=cF5>GrPrint</span><span class=cF0>(dc, -task-&gt;scroll_x + </span><span class=cF7>(</span><span class=cFE>13</span><span class=cF0> + </span><span class=cFE>7</span><span class=cF0> + </span><span class=cFE>10</span><span class=cF7>)</span><span class=cF0> * </span><span class=cF3>FONT_WIDTH</span><span class=cF0>, -task-&gt;scroll_y, buf);
<a name="l240"></a>}
</span></pre></body>
</html>