File size: 1,209 Bytes
806d4b5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
/*gr.dc is the persistent layer. You can access
it directly but two tasks accessing it simultaneously
with no DCAlias() will screw-up color and stuff.
*/
U0 SunMoon()
{
I64 i,x,y,radius;
AutoComplete; //AutoComplete Off
WinBorder; //No Border
WinMax; //Maximize window
DocClear; //Clear command-line text
Fs->text_attr=BLACK<<4+WHITE; //Current CTask is Fs segment register.
for (i=0;i<0x8000;i+=0x200) {
//Sun
x=0.2*GR_WIDTH; y=0.5*GR_HEIGHT; radius=120;
gr.dc->color=DKGRAY;
GrCircle(gr.dc,x,y,radius);
gr.dc->color=ROPF_DITHER+RED<<16+YELLOW;
GrFloodFill(gr.dc,x,y);
//Moon
x=0.8*GR_WIDTH-i/0x200; y=0.5*GR_HEIGHT; radius=75;
gr.dc->color=DKGRAY;
GrCircle(gr.dc,x,y,radius);
//<CTRL-ALT-a> for the "pi" character.
GrCircle(gr.dc,x+0.5*radius,y,1.2*radius,,pi-.31*pi,0.62*pi);
gr.dc->color=ROPF_PROBABILITY_DITHER+LTGRAY<<16+BLACK;
gr.dc->dither_probability_u16=i; //U16 can be [0,65535]
GrFloodFill(gr.dc,x+0.5*radius,y);
gr.dc->dither_probability_u16=2*i; //U16 can be [0,65535]
GrFloodFill(gr.dc,x-0.75*radius,y);
Refresh; //Typically 30 fps
DCFill;
}
Fs->text_attr=WHITE<<4+BLUE;
}
SunMoon;
|