mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-28 08:16:31 +00:00
923b700822
Add CAtapiWriteCmd for AHCIAtapiBlksWrite. Remove AHCIAtapiSeek and AHCIAtapiFormat.
187 lines
24 KiB
HTML
Executable file
187 lines
24 KiB
HTML
Executable file
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
|
|
<meta name="generator" content="ZealOS V0.16">
|
|
<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=cF0>#</span><span class=cF1>define</span><span class=cF0> LASER_TEMP_MAX </span><span class=cFE>30</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>
|
|
<a name="l2"></a>#</span><span class=cF1>define</span><span class=cF0> LASER_THRESHOLD_TEMP </span><span class=cFE>10</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>
|
|
<a name="l3"></a>#</span><span class=cF1>define</span><span class=cF0> MASS_TEMP_MAX </span><span class=cFE>5</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>
|
|
<a name="l4"></a>
|
|
<a name="l5"></a></span><span class=cF1>class</span><span class=cF0> CtrlPanelState
|
|
<a name="l6"></a>{
|
|
<a name="l7"></a> </span><span class=cF9>I64</span><span class=cF0> shot_radius, fuse_time;
|
|
<a name="l8"></a> </span><span class=cF1>F64</span><span class=cF0> laser_temperature;
|
|
<a name="l9"></a> </span><span class=cF1>Bool</span><span class=cF0> spacewalk;
|
|
<a name="l10"></a>
|
|
<a name="l11"></a>} ctrl_panel;
|
|
<a name="l12"></a>
|
|
<a name="l13"></a>#</span><span class=cF1>define</span><span class=cF0> CTRL_PANEL_SPACING </span><span class=cFE>33</span><span class=cF0>
|
|
<a name="l14"></a>#</span><span class=cF1>define</span><span class=cF0> CTRL_PANEL_RANGE </span><span class=cFE>30</span><span class=cF0>
|
|
<a name="l15"></a>#</span><span class=cF1>define</span><span class=cF0> CTRL_PANEL_BORDER </span><span class=cFE>2</span><span class=cF0>
|
|
<a name="l16"></a>#</span><span class=cF1>define</span><span class=cF0> CTRL_PANEL_BTTN_SIZE </span><span class=cFE>12</span><span class=cF0>
|
|
<a name="l17"></a>
|
|
<a name="l18"></a>#</span><span class=cF1>define</span><span class=cF0> TMP_Y (+</span><span class=cFE>2</span><span class=cF0>)
|
|
<a name="l19"></a>
|
|
<a name="l20"></a></span><span class=cF1>U0</span><span class=cF0> DrawCtrlPanelCtrl(</span><span class=cF9>CDC</span><span class=cF0> *dc, </span><span class=cF9>CCtrl</span><span class=cF0> *c)
|
|
<a name="l21"></a>{
|
|
<a name="l22"></a> CtrlPanelState *s = c->state;
|
|
<a name="l23"></a> </span><span class=cF1>F64</span><span class=cF0> d, d_range;
|
|
<a name="l24"></a>
|
|
<a name="l25"></a> dc->color = </span><span class=cF3>LTRED</span><span class=cF0>;
|
|
<a name="l26"></a> </span><span class=cF5>GrRect</span><span class=cF0>(dc, c->left, c->top, CTRL_PANEL_SPACING * </span><span class=cFE>3</span><span class=cF0> + </span><span class=cFE>2</span><span class=cF0>,
|
|
<a name="l27"></a> CTRL_PANEL_SPACING * </span><span class=cFE>2</span><span class=cF0> + CTRL_PANEL_RANGE + CTRL_PANEL_BTTN_SIZE);
|
|
<a name="l28"></a> dc->color = </span><span class=cF3>DKGRAY</span><span class=cF0>;
|
|
<a name="l29"></a> </span><span class=cF5>GrRect</span><span class=cF0>(dc, c->left + CTRL_PANEL_BORDER, c->top + CTRL_PANEL_BORDER,
|
|
<a name="l30"></a> CTRL_PANEL_SPACING * </span><span class=cFE>3</span><span class=cF0> + </span><span class=cFE>2</span><span class=cF0> - </span><span class=cFE>2</span><span class=cF0> * CTRL_PANEL_BORDER,
|
|
<a name="l31"></a> CTRL_PANEL_SPACING * </span><span class=cFE>2</span><span class=cF0> + CTRL_PANEL_RANGE + CTRL_PANEL_BTTN_SIZE
|
|
<a name="l32"></a> -</span><span class=cFE>2</span><span class=cF0> * CTRL_PANEL_BORDER);
|
|
<a name="l33"></a> dc->color = </span><span class=cF3>BLACK</span><span class=cF0>;
|
|
<a name="l34"></a> </span><span class=cF5>GrLine</span><span class=cF0>(dc, c->left + CTRL_PANEL_SPACING, </span><span class=cF7>(</span><span class=cF0>c->top + CTRL_PANEL_BTTN_SIZE</span><span class=cF7>)</span><span class=cF0> +
|
|
<a name="l35"></a> CTRL_PANEL_SPACING, c->left + CTRL_PANEL_SPACING,
|
|
<a name="l36"></a> </span><span class=cF7>(</span><span class=cF0>c->top + CTRL_PANEL_BTTN_SIZE</span><span class=cF7>)</span><span class=cF0> + CTRL_PANEL_SPACING+CTRL_PANEL_RANGE-</span><span class=cFE>1</span><span class=cF0>);
|
|
<a name="l37"></a> </span><span class=cF5>GrLine</span><span class=cF0>(dc, c->left + </span><span class=cFE>2</span><span class=cF0> * CTRL_PANEL_SPACING + </span><span class=cFE>1</span><span class=cF0>, </span><span class=cF7>(</span><span class=cF0>c->top + CTRL_PANEL_BTTN_SIZE</span><span class=cF7>)</span><span class=cF0> +
|
|
<a name="l38"></a> CTRL_PANEL_SPACING, c->left + </span><span class=cFE>2</span><span class=cF0> * CTRL_PANEL_SPACING + </span><span class=cFE>1</span><span class=cF0>,
|
|
<a name="l39"></a> </span><span class=cF7>(</span><span class=cF0>c->top + CTRL_PANEL_BTTN_SIZE</span><span class=cF7>)</span><span class=cF0> + CTRL_PANEL_SPACING + CTRL_PANEL_RANGE - </span><span class=cFE>1</span><span class=cF0>);
|
|
<a name="l40"></a>
|
|
<a name="l41"></a> dc->color = </span><span class=cF3>BLACK</span><span class=cF0>;
|
|
<a name="l42"></a> </span><span class=cF5>GrRect</span><span class=cF0>(dc, </span><span class=cF7>(</span><span class=cF0>c->left + c->right + </span><span class=cFE>1</span><span class=cF7>)</span><span class=cF0> / </span><span class=cFE>2</span><span class=cF0> - </span><span class=cFE>9</span><span class=cF0> * </span><span class=cF3>FONT_WIDTH</span><span class=cF0> / </span><span class=cFE>2</span><span class=cF0> - </span><span class=cFE>3</span><span class=cF0>,
|
|
<a name="l43"></a> c->top + CTRL_PANEL_BORDER + </span><span class=cF7>(</span><span class=cF0>CTRL_PANEL_SPACING - </span><span class=cF3>FONT_HEIGHT</span><span class=cF7>)</span><span class=cF0> / </span><span class=cFE>2</span><span class=cF0>,
|
|
<a name="l44"></a> </span><span class=cFE>9</span><span class=cF0> * </span><span class=cF3>FONT_WIDTH</span><span class=cF0> + </span><span class=cFE>6</span><span class=cF0>, </span><span class=cF3>FONT_HEIGHT</span><span class=cF0> + </span><span class=cFE>6</span><span class=cF0>);
|
|
<a name="l45"></a>
|
|
<a name="l46"></a> </span><span class=cF1>if</span><span class=cF0> (s->spacewalk)
|
|
<a name="l47"></a> dc->color =</span><span class=cF3>YELLOW</span><span class=cF0>;
|
|
<a name="l48"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l49"></a> dc->color = </span><span class=cF3>DKGRAY</span><span class=cF0>;
|
|
<a name="l50"></a> </span><span class=cF5>GrRect</span><span class=cF0>(dc, </span><span class=cF7>(</span><span class=cF0>c->left + c->right + </span><span class=cFE>1</span><span class=cF7>)</span><span class=cF0> / </span><span class=cFE>2</span><span class=cF0> - </span><span class=cFE>9</span><span class=cF0> * </span><span class=cF3>FONT_WIDTH</span><span class=cF0> / </span><span class=cFE>2</span><span class=cF0> - </span><span class=cFE>2</span><span class=cF0>,
|
|
<a name="l51"></a> c->top + CTRL_PANEL_BORDER + </span><span class=cFE>1</span><span class=cF0> + </span><span class=cF7>(</span><span class=cF0>CTRL_PANEL_SPACING - </span><span class=cF3>FONT_HEIGHT</span><span class=cF7>)</span><span class=cF0> / </span><span class=cFE>2</span><span class=cF0>,
|
|
<a name="l52"></a> </span><span class=cFE>9</span><span class=cF0> * </span><span class=cF3>FONT_WIDTH</span><span class=cF0> + </span><span class=cFE>4</span><span class=cF0>, </span><span class=cF3>FONT_HEIGHT</span><span class=cF0> + </span><span class=cFE>4</span><span class=cF0>);
|
|
<a name="l53"></a>
|
|
<a name="l54"></a> dc->color = </span><span class=cF3>RED</span><span class=cF0>;
|
|
<a name="l55"></a> </span><span class=cF5>GrPrint</span><span class=cF0>(dc, </span><span class=cF7>(</span><span class=cF0>c->left + c->right + </span><span class=cFE>1</span><span class=cF7>)</span><span class=cF0> / </span><span class=cFE>2</span><span class=cF0> - </span><span class=cFE>9</span><span class=cF0> * </span><span class=cF3>FONT_WIDTH</span><span class=cF0> / </span><span class=cFE>2</span><span class=cF0>,
|
|
<a name="l56"></a> c->top + CTRL_PANEL_BORDER + </span><span class=cFE>3</span><span class=cF0> +
|
|
<a name="l57"></a> </span><span class=cF7>(</span><span class=cF0>CTRL_PANEL_SPACING - </span><span class=cF3>FONT_HEIGHT</span><span class=cF7>)</span><span class=cF0> / </span><span class=cFE>2</span><span class=cF0>, </span><span class=cF6>"SpaceWalk"</span><span class=cF0>);
|
|
<a name="l58"></a> </span><span class=cF5>GrPrint</span><span class=cF0>(dc, c->left + CTRL_PANEL_SPACING - </span><span class=cFE>4</span><span class=cF0> * </span><span class=cF3>FONT_WIDTH</span><span class=cF0> / </span><span class=cFE>2</span><span class=cF0>,
|
|
<a name="l59"></a> </span><span class=cF7>(</span><span class=cF0>c->top + CTRL_PANEL_BTTN_SIZE</span><span class=cF7>)</span><span class=cF0> +
|
|
<a name="l60"></a> CTRL_PANEL_SPACING - </span><span class=cF3>FONT_HEIGHT</span><span class=cF0> - </span><span class=cFE>2</span><span class=cF0>, </span><span class=cF6>"Size"</span><span class=cF0>);
|
|
<a name="l61"></a> </span><span class=cF5>GrPrint</span><span class=cF0>(dc, c->left + </span><span class=cFE>2</span><span class=cF0> * CTRL_PANEL_SPACING + </span><span class=cFE>1</span><span class=cF0> - </span><span class=cFE>4</span><span class=cF0> * </span><span class=cF3>FONT_WIDTH</span><span class=cF0> / </span><span class=cFE>2</span><span class=cF0>,
|
|
<a name="l62"></a> </span><span class=cF7>(</span><span class=cF0>c->top + CTRL_PANEL_BTTN_SIZE</span><span class=cF7>)</span><span class=cF0> +
|
|
<a name="l63"></a> CTRL_PANEL_SPACING - </span><span class=cF3>FONT_HEIGHT</span><span class=cF0> - </span><span class=cFE>2</span><span class=cF0>, </span><span class=cF6>"Fuse"</span><span class=cF0>);
|
|
<a name="l64"></a> dc->color = </span><span class=cF3>LTRED</span><span class=cF0>;
|
|
<a name="l65"></a> </span><span class=cF5>GrPrint</span><span class=cF0>(dc, c->left + CTRL_PANEL_SPACING - </span><span class=cF3>FONT_WIDTH</span><span class=cF0> / </span><span class=cFE>2</span><span class=cF0>,
|
|
<a name="l66"></a> </span><span class=cF7>(</span><span class=cF0>c->top + CTRL_PANEL_BTTN_SIZE</span><span class=cF7>)</span><span class=cF0> + CTRL_PANEL_SPACING + CTRL_PANEL_RANGE + </span><span class=cFE>3</span><span class=cF0>,
|
|
<a name="l67"></a> </span><span class=cF6>"%d"</span><span class=cF0>, s->shot_radius * </span><span class=cFE>10</span><span class=cF0> / CTRL_PANEL_RANGE);
|
|
<a name="l68"></a> </span><span class=cF5>GrPrint</span><span class=cF0>(dc, c->left + </span><span class=cFE>2</span><span class=cF0> * CTRL_PANEL_SPACING + </span><span class=cFE>1</span><span class=cF0> - </span><span class=cF3>FONT_WIDTH</span><span class=cF0> / </span><span class=cFE>2</span><span class=cF0>,
|
|
<a name="l69"></a> </span><span class=cF7>(</span><span class=cF0>c->top + CTRL_PANEL_BTTN_SIZE</span><span class=cF7>)</span><span class=cF0> + CTRL_PANEL_SPACING + CTRL_PANEL_RANGE + </span><span class=cFE>3</span><span class=cF0>,
|
|
<a name="l70"></a> </span><span class=cF6>"%d"</span><span class=cF0>, s->fuse_time * </span><span class=cFE>10</span><span class=cF0> / CTRL_PANEL_RANGE);
|
|
<a name="l71"></a> </span><span class=cF5>GrRect</span><span class=cF0>(dc, c->left + CTRL_PANEL_SPACING - </span><span class=cFE>3</span><span class=cF0>,
|
|
<a name="l72"></a> </span><span class=cF7>(</span><span class=cF0>c->top + CTRL_PANEL_BTTN_SIZE</span><span class=cF7>)</span><span class=cF0> + CTRL_PANEL_SPACING +
|
|
<a name="l73"></a> CTRL_PANEL_RANGE - </span><span class=cFE>1</span><span class=cF0> - s->shot_radius - </span><span class=cFE>2</span><span class=cF0> , </span><span class=cFE>7</span><span class=cF0>, </span><span class=cFE>5</span><span class=cF0>);
|
|
<a name="l74"></a> </span><span class=cF5>GrRect</span><span class=cF0>(dc, c->left + </span><span class=cFE>2</span><span class=cF0> * CTRL_PANEL_SPACING + </span><span class=cFE>1</span><span class=cF0> - </span><span class=cFE>3</span><span class=cF0>,
|
|
<a name="l75"></a> </span><span class=cF7>(</span><span class=cF0>c->top + CTRL_PANEL_BTTN_SIZE</span><span class=cF7>)</span><span class=cF0> + CTRL_PANEL_SPACING +
|
|
<a name="l76"></a> CTRL_PANEL_RANGE - </span><span class=cFE>1</span><span class=cF0> - s->fuse_time - </span><span class=cFE>2</span><span class=cF0>, </span><span class=cFE>7</span><span class=cF0>, </span><span class=cFE>5</span><span class=cF0>);
|
|
<a name="l77"></a> dc->color = </span><span class=cF3>YELLOW</span><span class=cF0>;
|
|
<a name="l78"></a> </span><span class=cF5>GrRect</span><span class=cF0>(dc, c->left + CTRL_PANEL_SPACING - </span><span class=cFE>2</span><span class=cF0>,
|
|
<a name="l79"></a> </span><span class=cF7>(</span><span class=cF0>c->top + CTRL_PANEL_BTTN_SIZE</span><span class=cF7>)</span><span class=cF0> + CTRL_PANEL_SPACING +
|
|
<a name="l80"></a> CTRL_PANEL_RANGE - </span><span class=cFE>1</span><span class=cF0> - s->shot_radius - </span><span class=cFE>1</span><span class=cF0> , </span><span class=cFE>5</span><span class=cF0>, </span><span class=cFE>3</span><span class=cF0>);
|
|
<a name="l81"></a> </span><span class=cF5>GrRect</span><span class=cF0>(dc, c->left + </span><span class=cFE>2</span><span class=cF0> * CTRL_PANEL_SPACING + </span><span class=cFE>1</span><span class=cF0> - </span><span class=cFE>2</span><span class=cF0>,
|
|
<a name="l82"></a> </span><span class=cF7>(</span><span class=cF0>c->top + CTRL_PANEL_BTTN_SIZE</span><span class=cF7>)</span><span class=cF0> + CTRL_PANEL_SPACING +
|
|
<a name="l83"></a> CTRL_PANEL_RANGE - </span><span class=cFE>1</span><span class=cF0> - s->fuse_time - </span><span class=cFE>1</span><span class=cF0>, </span><span class=cFE>5</span><span class=cF0>, </span><span class=cFE>3</span><span class=cF0>);
|
|
<a name="l84"></a>
|
|
<a name="l85"></a> d_range = c->right - c->left - </span><span class=cFE>5</span><span class=cF0> - </span><span class=cFE>5</span><span class=cF0>;
|
|
<a name="l86"></a> d = s->laser_temperature * d_range / LASER_TEMP_MAX;
|
|
<a name="l87"></a> dc->color = </span><span class=cF3>BLACK</span><span class=cF0>;
|
|
<a name="l88"></a> </span><span class=cF5>GrRect</span><span class=cF0>(dc, c->left + </span><span class=cFE>5</span><span class=cF0> - </span><span class=cFE>1</span><span class=cF0>, c->bottom + TMP_Y - </span><span class=cFE>2</span><span class=cF0>, d_range + </span><span class=cFE>2</span><span class=cF0>, </span><span class=cFE>2</span><span class=cF0> + </span><span class=cFE>1</span><span class=cF0> + </span><span class=cFE>1</span><span class=cF0>);
|
|
<a name="l89"></a> </span><span class=cF1>if</span><span class=cF0> (d > </span><span class=cFE>1</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>)
|
|
<a name="l90"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l91"></a> dc->color = </span><span class=cF3>GREEN</span><span class=cF0>;
|
|
<a name="l92"></a> </span><span class=cF5>GrRect</span><span class=cF0>(dc, c->left + </span><span class=cFE>5</span><span class=cF0>, c->bottom + TMP_Y - </span><span class=cFE>1</span><span class=cF0>, </span><span class=cF5>Min</span><span class=cF7>(</span><span class=cF0>d, d_range / </span><span class=cFE>3</span><span class=cF7>)</span><span class=cF0>, </span><span class=cFE>2</span><span class=cF0>);
|
|
<a name="l93"></a> </span><span class=cF1>if</span><span class=cF0> (d >= d_range / </span><span class=cFE>3</span><span class=cF0>)
|
|
<a name="l94"></a> {
|
|
<a name="l95"></a> dc->color = </span><span class=cF3>YELLOW</span><span class=cF0>;
|
|
<a name="l96"></a> </span><span class=cF5>GrRect</span><span class=cF0>(dc, c->left + </span><span class=cFE>5</span><span class=cF0> + d_range / </span><span class=cFE>3</span><span class=cF0>, c->bottom + TMP_Y - </span><span class=cFE>1</span><span class=cF0>, </span><span class=cF5>Min</span><span class=cF7>(</span><span class=cF0>d, </span><span class=cFE>2</span><span class=cF0> * d_range/</span><span class=cFE>3</span><span class=cF7>)</span><span class=cF0>-d_range / </span><span class=cFE>3</span><span class=cF0>, </span><span class=cFE>2</span><span class=cF0>);
|
|
<a name="l97"></a> </span><span class=cF1>if</span><span class=cF0> (d >= </span><span class=cFE>2</span><span class=cF0> * d_range / </span><span class=cFE>3</span><span class=cF0>)
|
|
<a name="l98"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l99"></a> dc->color = </span><span class=cF3>RED</span><span class=cF0>;
|
|
<a name="l100"></a> </span><span class=cF5>GrRect</span><span class=cF0>(dc, c->left + </span><span class=cFE>5</span><span class=cF0> + </span><span class=cFE>2</span><span class=cF0> * d_range / </span><span class=cFE>3</span><span class=cF0>, c->bottom + TMP_Y - </span><span class=cFE>1</span><span class=cF0>, d - </span><span class=cFE>2</span><span class=cF0> * d_range / </span><span class=cFE>3</span><span class=cF0>, </span><span class=cFE>2</span><span class=cF0>);
|
|
<a name="l101"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l102"></a> }
|
|
<a name="l103"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l104"></a>}
|
|
<a name="l105"></a>
|
|
<a name="l106"></a></span><span class=cF1>U0</span><span class=cF0> UpdateDerivedCtrlPanelCtrl(</span><span class=cF9>CCtrl</span><span class=cF0> *c)
|
|
<a name="l107"></a>{
|
|
<a name="l108"></a> CtrlPanelState *s = c->state;
|
|
<a name="l109"></a>
|
|
<a name="l110"></a> c->left = c->win_task->pix_width - (CTRL_PANEL_SPACING * </span><span class=cFE>3</span><span class=cF0> + </span><span class=cFE>2</span><span class=cF0>);
|
|
<a name="l111"></a> c->right = c->left + CTRL_PANEL_SPACING * </span><span class=cFE>3</span><span class=cF0> + </span><span class=cFE>2</span><span class=cF0>;
|
|
<a name="l112"></a> c->top = c->win_task->pix_height - (CTRL_PANEL_SPACING * </span><span class=cFE>2</span><span class=cF0> + CTRL_PANEL_RANGE + CTRL_PANEL_BTTN_SIZE);
|
|
<a name="l113"></a> c->bottom = c->top + CTRL_PANEL_SPACING * </span><span class=cFE>2</span><span class=cF0> + CTRL_PANEL_RANGE;
|
|
<a name="l114"></a>
|
|
<a name="l115"></a> s->shot_radius = </span><span class=cF5>ClampI64</span><span class=cF0>(s->shot_radius, </span><span class=cFE>0</span><span class=cF0>, CTRL_PANEL_RANGE - </span><span class=cFE>1</span><span class=cF0>);
|
|
<a name="l116"></a> s->fuse_time = </span><span class=cF5>ClampI64</span><span class=cF0>(s->fuse_time, </span><span class=cFE>0</span><span class=cF0>, CTRL_PANEL_RANGE - </span><span class=cFE>1</span><span class=cF0>);
|
|
<a name="l117"></a>}
|
|
<a name="l118"></a>
|
|
<a name="l119"></a></span><span class=cF1>U0</span><span class=cF0> LeftClickCtrlPanel(</span><span class=cF9>CCtrl</span><span class=cF0> *c, </span><span class=cF9>I64</span><span class=cF0> x, </span><span class=cF9>I64</span><span class=cF0> y, </span><span class=cF1>Bool</span><span class=cF0>)
|
|
<a name="l120"></a>{
|
|
<a name="l121"></a> CtrlPanelState *s = c->state;
|
|
<a name="l122"></a>
|
|
<a name="l123"></a> </span><span class=cF1>if</span><span class=cF0> (y < c->top + CTRL_PANEL_BORDER + </span><span class=cF7>(</span><span class=cF0>CTRL_PANEL_SPACING - </span><span class=cF3>FONT_HEIGHT</span><span class=cF7>)</span><span class=cF0> / </span><span class=cFE>2</span><span class=cF0> + </span><span class=cF3>FONT_HEIGHT</span><span class=cF0> + </span><span class=cFE>6</span><span class=cF0>)
|
|
<a name="l124"></a> s->spacewalk = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l125"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l126"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l127"></a> </span><span class=cF1>if</span><span class=cF0> (x < </span><span class=cF7>(</span><span class=cF0>c->right + c->left</span><span class=cF7>)</span><span class=cF0> / </span><span class=cFE>2</span><span class=cF0>)
|
|
<a name="l128"></a> s->shot_radius = CTRL_PANEL_RANGE - </span><span class=cFE>1</span><span class=cF0> - (y - </span><span class=cF7>(</span><span class=cF0>c->top + CTRL_PANEL_SPACING + CTRL_PANEL_BTTN_SIZE</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l129"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l130"></a> s->fuse_time = CTRL_PANEL_RANGE - </span><span class=cFE>1</span><span class=cF0> - (y - </span><span class=cF7>(</span><span class=cF0>c->top + CTRL_PANEL_SPACING + CTRL_PANEL_BTTN_SIZE</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l131"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l132"></a> </span><span class=cF1>if</span><span class=cF0> (c->update_derived_vals)
|
|
<a name="l133"></a> (*c->update_derived_vals)(c);
|
|
<a name="l134"></a>}
|
|
<a name="l135"></a>
|
|
<a name="l136"></a></span><span class=cF9>CCtrl</span><span class=cF0> *CtrlPanelNew()
|
|
<a name="l137"></a>{
|
|
<a name="l138"></a> </span><span class=cF9>CCtrl</span><span class=cF0> *c = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CCtrl</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l139"></a>
|
|
<a name="l140"></a> </span><span class=cF5>MemSet</span><span class=cF0>(&ctrl_panel, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>ctrl_panel</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l141"></a> c->win_task = </span><span class=cF5>Fs</span><span class=cF0>;
|
|
<a name="l142"></a> c->flags = </span><span class=cF3>CTRLF_SHOW</span><span class=cF0> | </span><span class=cF3>CTRLF_CAPTURE_LEFT_MS</span><span class=cF0>;
|
|
<a name="l143"></a> c->type = </span><span class=cF3>CTRLT_GENERIC</span><span class=cF0>;
|
|
<a name="l144"></a> c->state = &ctrl_panel;
|
|
<a name="l145"></a> c->draw_it = &DrawCtrlPanelCtrl;
|
|
<a name="l146"></a> c->left_click = &LeftClickCtrlPanel;
|
|
<a name="l147"></a> c->update_derived_vals = &UpdateDerivedCtrlPanelCtrl;
|
|
<a name="l148"></a> </span><span class=cF5>QueueInsert</span><span class=cF0>(c, </span><span class=cF5>Fs</span><span class=cF0>->last_ctrl);
|
|
<a name="l149"></a> </span><span class=cF5>TaskDerivedValsUpdate</span><span class=cF0>;
|
|
<a name="l150"></a>
|
|
<a name="l151"></a> </span><span class=cF1>return</span><span class=cF0> c;
|
|
<a name="l152"></a>}
|
|
<a name="l153"></a>
|
|
<a name="l154"></a></span><span class=cF1>U0</span><span class=cF0> CtrlPanelDel(</span><span class=cF9>CCtrl</span><span class=cF0> *c)
|
|
<a name="l155"></a>{
|
|
<a name="l156"></a> </span><span class=cF5>QueueRemove</span><span class=cF0>(c);
|
|
<a name="l157"></a> </span><span class=cF5>Free</span><span class=cF0>(c);
|
|
<a name="l158"></a>}
|
|
</span></pre></body>
|
|
</html>
|