TempleOSCD_150216.ISO
This commit is contained in:
1 parent
64f679eeb9
commit
401601816c
531 files changed
+23341
-22071
No files matched your search
@@ -12,12 +12,12 @@ U0 Balloon()
|
||||
|
||||
CLI
|
||||
|
||||
OutU8(VGA_SC_INDEX,VGA_MAP_MASK);
|
||||
OutU8(VGA_SC_DATA,0xF);
|
||||
OutU8(VGAP_INDEX,VGAR_MAP_MASK);
|
||||
OutU8(VGAP_DATA,0xF);
|
||||
MemSetI64(0xA0000,0,640*480/64);
|
||||
|
||||
OutU8(VGA_SC_INDEX,VGA_MAP_MASK);
|
||||
OutU8(VGA_SC_DATA,RED+GREEN+8);
|
||||
OutU8(VGAP_INDEX,VGAR_MAP_MASK);
|
||||
OutU8(VGAP_DATA,RED+GREEN+8);
|
||||
for (k=100;k<150;k++) {
|
||||
|
||||
for (i=0;i<20;i++)
|
||||
|
||||
Binary file not shown.
@@ -13,11 +13,11 @@ U0 Main()
|
||||
{
|
||||
"Capture screen...\n";
|
||||
PressAKey;
|
||||
GRACaptureScreen("HOME/ScreenShot");
|
||||
GRACaptureScreen("::/Home/ScreenShot");
|
||||
|
||||
"View captured screen...\n";
|
||||
PressAKey;
|
||||
ViewScreenCapture("HOME/ScreenShot");
|
||||
ViewScreenCapture("::/Home/ScreenShot");
|
||||
|
||||
PressAKey;
|
||||
DCFill;
|
||||
|
||||
Binary file not shown.
@@ -9,7 +9,7 @@ U0 Doodle()
|
||||
Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS-WIF_SELF_BORDER;
|
||||
|
||||
WinMax;
|
||||
WordStat;
|
||||
AutoComplete;
|
||||
|
||||
DCFill;
|
||||
DocClear;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -8,7 +8,7 @@ You can load it with:
|
||||
If you want to change the system font permanently,
|
||||
save to a file with this font editor program
|
||||
and cut and paste the code into $LK,"::/Kernel/Font8x8.CPP"$.
|
||||
You will need to recompile Kernel by calling $LK,"MakeOSPrtBootInstall",A="MN:MakeOSPrtBootInstall"$().
|
||||
You will need to recompile Kernel by calling $LK,"MakeOSDrvBootInstall",A="MN:MakeOSDrvBootInstall"$().
|
||||
|
||||
See $LK,"::/Demo/ExtendedChars.CPP"$ and $LK,"::/Demo/ScreenCodes.CPP"$.
|
||||
*/
|
||||
@@ -37,7 +37,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
k=0;
|
||||
for (i=0;i<FONT_HEIGHT;i++)
|
||||
for (j=0;j<FONT_WIDTH;j++) {
|
||||
if (Bt(&text.font[FONT_HEIGHT*cur_ch],k++))
|
||||
if (Bt(&text.font[cur_ch],k++))
|
||||
dc->color=YELLOW;
|
||||
else
|
||||
dc->color=BLUE;
|
||||
@@ -54,7 +54,7 @@ U0 FESave(Bool pmt)
|
||||
I64 i,j,k=0;
|
||||
for (i=0;i<256;i++) {
|
||||
for (j=0;j<FONT_HEIGHT;j++)
|
||||
DocPrint(doc,"0x%02X,",text.font[k++]);
|
||||
DocPrint(doc,"0x%02X,",text.font(U8 *)[k++]);
|
||||
if (Bt(chars_bitmap_safe_dollar,i))
|
||||
DocPrint(doc,"//%c",i);
|
||||
else if (i=='$$')
|
||||
@@ -77,7 +77,7 @@ U0 FontEd()
|
||||
" Abort(,CH_SHIFT_ESC);"
|
||||
" Exit(,CH_ESC);"
|
||||
"}");
|
||||
WordStat;
|
||||
AutoComplete;
|
||||
DocClear;
|
||||
DocCursor;
|
||||
Fs->win_inhibit|=WIG_DBL_CLICK;
|
||||
@@ -129,9 +129,9 @@ U0 FontEd()
|
||||
(a1-BLOW_UP_CHAR_X)/FONT_WIDTH;
|
||||
if (0<=k<FONT_WIDTH*FONT_HEIGHT) {
|
||||
if (ip.lb||msg_code==MSG_IP_L_DOWN)
|
||||
Bts(&text.font[FONT_HEIGHT*cur_ch],k);
|
||||
Bts(&text.font[cur_ch],k);
|
||||
if (ip.rb||msg_code==MSG_IP_R_DOWN)
|
||||
Btr(&text.font[FONT_HEIGHT*cur_ch],k);
|
||||
Btr(&text.font[cur_ch],k);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,266 @@
|
||||
#define TURTLE_SIZE 4
|
||||
#define TURTLE_SPEED_STEP 2
|
||||
|
||||
#define ANGLES 35
|
||||
F64 angles[ANGLES]={
|
||||
-2*ã/1,-2*ã/2,-2*ã/3,-2*ã/4,-2*ã/5,
|
||||
-2*ã/6,-2*ã/8,-2*ã/9,-2*ã/10,
|
||||
-2*ã/12,-2*ã/15,-2*ã/18,-2*ã/20,
|
||||
-2*ã/24,-2*ã/30,-2*ã/36,-2*ã/40,
|
||||
0,
|
||||
2*ã/40,2*ã/36,2*ã/30,2*ã/24,
|
||||
2*ã/20,2*ã/18,2*ã/15,2*ã/12,
|
||||
2*ã/10,2*ã/9,2*ã/8,2*ã/6,
|
||||
2*ã/5,2*ã/4,2*ã/3,2*ã/2,2*ã/1
|
||||
};
|
||||
|
||||
class Turtle
|
||||
{
|
||||
F64 x,y,z,speed,é,w;
|
||||
I64 dé_index;
|
||||
CColorROPU16 edge,middle;
|
||||
Bool ends,first;
|
||||
} tt;
|
||||
|
||||
U0 TurtlePlot(CDC *dc,Turtle *t,CColorROPU16 edge,CColorROPU16 middle)
|
||||
{
|
||||
F64 w=t->w/2.0-1;
|
||||
if (w<0) w=0;
|
||||
dc->color=middle;
|
||||
GrLine3(dc,t->x+w*Cos(t->é+ã/2),t->y+w*Sin(t->é+ã/2),t->z,
|
||||
t->x+w*Cos(t->é-ã/2),t->y+w*Sin(t->é-ã/2),t->z);
|
||||
w=t->w/2.0;
|
||||
dc->color=edge;
|
||||
GrPlot3(dc,t->x+w*Cos(t->é+ã/2),t->y+w*Sin(t->é+ã/2),t->z);
|
||||
GrPlot3(dc,t->x+w*Cos(t->é-ã/2),t->y+w*Sin(t->é-ã/2),t->z);
|
||||
}
|
||||
|
||||
U0 TurtleMicroMove(Turtle *t,F64 dt)
|
||||
{
|
||||
t->x+=dt*t->speed*Cos(t->é);
|
||||
t->y+=dt*t->speed*Sin(t->é);
|
||||
t->é=Wrap(t->é+dt*angles[t->dé_index]);
|
||||
}
|
||||
|
||||
U0 TurtleEnd(CDC *dc,Turtle *t,CColorROPU16 edge,CColorROPU16 middle,F64 é)
|
||||
{
|
||||
F64 r,x,y2;
|
||||
Turtle t2;
|
||||
if (r=t->w) {
|
||||
MemCpy(&t2,t,sizeof(Turtle)); //Save
|
||||
x=0;
|
||||
while (TRUE) {
|
||||
t->x+=1/r*Cos(é);
|
||||
t->y+=1/r*Sin(é);
|
||||
x+=1/r;
|
||||
y2=r*r-4*x*x;
|
||||
if (y2>=0) {
|
||||
t->w=Sqrt(y2);
|
||||
TurtlePlot(dc,t,edge,middle);
|
||||
} else
|
||||
break;
|
||||
}
|
||||
MemCpy(t,&t2,sizeof(Turtle));
|
||||
}
|
||||
}
|
||||
|
||||
U0 TurtleMove(CDC *dc,Turtle *t,CColorROPU16 edge,CColorROPU16 middle)
|
||||
{
|
||||
I64 i,l=16*AbsI64(t->w+1)*AbsI64(t->speed+1);
|
||||
|
||||
if (t->ends && t->first)
|
||||
TurtleEnd(dc,t,edge,middle,t->é+ã);
|
||||
t->first=FALSE;
|
||||
|
||||
for (i=0;i<l;i++) {
|
||||
TurtleMicroMove(t,1.0/l);
|
||||
TurtlePlot(dc,t,edge,middle);
|
||||
}
|
||||
if (t->ends)
|
||||
TurtleEnd(dc,t,edge,middle,t->é);
|
||||
}
|
||||
|
||||
U0 TurtleInit(Turtle *t)
|
||||
{
|
||||
MemSet(t,0,sizeof(Turtle));
|
||||
t->x=Fs->pix_width>>1;
|
||||
t->y=Fs->pix_height>>1;
|
||||
t->z=5;
|
||||
t->edge=BLACK;
|
||||
t->middle=YELLOW;
|
||||
t->dé_index=ANGLES/2;
|
||||
t->first=TRUE;
|
||||
t->ends=TRUE;
|
||||
}
|
||||
|
||||
U0 DrawIt(CTask *,CDC *dc)
|
||||
{
|
||||
Turtle t2;
|
||||
MemCpy(&t2,&tt,sizeof(Turtle));
|
||||
GrPrint(dc,0,0,"Layer:%f Speed:%f é:%5.1f dé:%5.1f Width:%f",
|
||||
tt.z,tt.speed,tt.é*180/ã,angles[tt.dé_index]*180/ã,tt.w);
|
||||
|
||||
TurtleMove(dc,&t2,RED,LTRED);
|
||||
dc->color=LTRED;
|
||||
GrLine(dc,t2.x+TURTLE_SIZE*Cos(t2.é+ã/2),t2.y+TURTLE_SIZE*Sin(t2.é+ã/2),
|
||||
t2.x+TURTLE_SIZE*Cos(t2.é-ã/2),t2.y+TURTLE_SIZE*Sin(t2.é-ã/2));
|
||||
GrLine(dc,t2.x+TURTLE_SIZE*Cos(t2.é+ã/2),t2.y+TURTLE_SIZE*Sin(t2.é+ã/2),
|
||||
t2.x+TURTLE_SIZE*Cos(t2.é), t2.y+TURTLE_SIZE*Sin(t2.é));
|
||||
GrLine(dc,t2.x+TURTLE_SIZE*Cos(t2.é-ã/2),t2.y+TURTLE_SIZE*Sin(t2.é-ã/2),
|
||||
t2.x+TURTLE_SIZE*Cos(t2.é), t2.y+TURTLE_SIZE*Sin(t2.é));
|
||||
}
|
||||
|
||||
U0 SetMenu()
|
||||
{
|
||||
I64 i;
|
||||
U8 buf[64];
|
||||
CMenuEntry *tempse;
|
||||
for (i=0;i<=9;i++) {
|
||||
StrPrint(buf,"Settings/Layer%d",i);
|
||||
if (tempse=MenuEntryFind(Fs->cur_menu,buf)) {
|
||||
if (i==tt.z)
|
||||
tempse->checked=TRUE;
|
||||
else
|
||||
tempse->checked=FALSE;
|
||||
}
|
||||
}
|
||||
if (tempse=MenuEntryFind(Fs->cur_menu,"Settings/Ends")) {
|
||||
if (tt.ends)
|
||||
tempse->checked=TRUE;
|
||||
else
|
||||
tempse->checked=FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
U0 Lattice()
|
||||
{
|
||||
Bool aim=FALSE;
|
||||
I64 a1,a2;
|
||||
CDC *dc=DCAlias;
|
||||
DCAllocDepthBuf(dc);
|
||||
MenuPush(
|
||||
"File {"
|
||||
" Abort(,CH_SHIFT_ESC);"
|
||||
" Exit(,CH_ESC);"
|
||||
"}"
|
||||
"Play {"
|
||||
" Restart(,'\n');"
|
||||
" Step(,CH_SPACE);"
|
||||
" Accelerator(,,SC_CURSOR_UP);"
|
||||
" Break(,,SC_CURSOR_DOWN);"
|
||||
" Left(,,SC_CURSOR_LEFT);"
|
||||
" Right(,,SC_CURSOR_RIGHT);"
|
||||
"}"
|
||||
"Settings {"
|
||||
" Color(,'c');"
|
||||
" Wider(,'+');"
|
||||
" Narrower(,'-');"
|
||||
" Ends(,'e');"
|
||||
" Layer0(,'0');"
|
||||
" Layer1(,'1');"
|
||||
" Layer2(,'2');"
|
||||
" Layer3(,'3');"
|
||||
" Layer4(,'4');"
|
||||
" Layer5(,'5');"
|
||||
" Layer6(,'6');"
|
||||
" Layer7(,'7');"
|
||||
" Layer8(,'8');"
|
||||
" Layer9(,'9');"
|
||||
"}"
|
||||
);
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
Preempt(OFF);
|
||||
WinMax;
|
||||
AutoComplete;
|
||||
WinBorder;
|
||||
DocClear;
|
||||
DocCursor;
|
||||
TurtleInit(&tt);
|
||||
SetMenu;
|
||||
Fs->win_inhibit=WIG_TASK_DFT-WIF_FOCUS_TASK_MENU-WIF_SELF_FOCUS-WIF_SELF_GRAB_SCROLL;
|
||||
Fs->draw_it=&DrawIt;
|
||||
try {
|
||||
while (TRUE) {
|
||||
switch (GetMsg(&a1,&a2,1<<MSG_KEY_DOWN|1<<MSG_IP_L_DOWN|
|
||||
1<<MSG_IP_R_DOWN|1<<MSG_IP_R_UP|1<<MSG_IP_MOVE)) {
|
||||
case MSG_IP_L_DOWN:
|
||||
tt.first=TRUE;
|
||||
tt.x=a1;
|
||||
tt.y=a2;
|
||||
break;
|
||||
case MSG_IP_R_DOWN:
|
||||
aim=TRUE;
|
||||
tt.é=Arg(a1-tt.x,a2-tt.y);
|
||||
break;
|
||||
case MSG_IP_MOVE:
|
||||
if (aim)
|
||||
tt.é=Arg(a1-tt.x,a2-tt.y);
|
||||
break;
|
||||
case MSG_IP_R_UP:
|
||||
tt.é=Arg(a1-tt.x,a2-tt.y);
|
||||
aim=FALSE;
|
||||
break;
|
||||
case MSG_KEY_DOWN:
|
||||
switch (a1) {
|
||||
case 0:
|
||||
switch (a2.u8[0]) {
|
||||
case SC_CURSOR_LEFT:
|
||||
if (tt.dé_index)
|
||||
tt.dé_index--;
|
||||
break;
|
||||
case SC_CURSOR_RIGHT:
|
||||
if (tt.dé_index<ANGLES-1)
|
||||
tt.dé_index++;
|
||||
break;
|
||||
case SC_CURSOR_UP:
|
||||
tt.speed+=TURTLE_SPEED_STEP;
|
||||
break;
|
||||
case SC_CURSOR_DOWN:
|
||||
if (tt.speed>=TURTLE_SPEED_STEP)
|
||||
tt.speed-=TURTLE_SPEED_STEP;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case '0'...'9':
|
||||
tt.z=a1-'0';
|
||||
SetMenu;
|
||||
break;
|
||||
case 'c':
|
||||
tt.middle=PopUpColor("Middle Color\n\n");
|
||||
tt.edge =PopUpColor("Edge Color\n\n");
|
||||
break;
|
||||
case 'e':
|
||||
tt.ends=!tt.ends;
|
||||
break;
|
||||
case '+':
|
||||
tt.w++;
|
||||
break;
|
||||
case '-':
|
||||
if (tt.w)
|
||||
tt.w--;
|
||||
break;
|
||||
case '\n':
|
||||
DCFill(dc);
|
||||
TurtleInit(&tt);
|
||||
SetMenu;
|
||||
break;
|
||||
case CH_ESC:
|
||||
case CH_SHIFT_ESC:
|
||||
goto lt_done;
|
||||
case CH_SPACE:
|
||||
TurtleMove(dc,&tt,tt.edge,tt.middle);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
lt_done:
|
||||
GetMsg(,,1<<MSG_KEY_UP);
|
||||
} catch
|
||||
PutExcept;
|
||||
SettingsPop;
|
||||
DCFill(dc);
|
||||
DCDel(dc);
|
||||
MenuPop;
|
||||
}
|
||||
|
||||
Lattice;
|
||||
@@ -1,3 +1,5 @@
|
||||
//Conway's Game of Life
|
||||
|
||||
CDC *dc[2]; //dbl buf
|
||||
I64 cur_dc,;
|
||||
Bool restart;
|
||||
@@ -59,13 +61,11 @@ public U0 Life()
|
||||
DocClear;
|
||||
|
||||
Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs);
|
||||
WordStat;
|
||||
AutoComplete;
|
||||
Fs->draw_it=&DrawIt;
|
||||
Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS-WIF_SELF_BORDER;
|
||||
|
||||
do {
|
||||
msg_code=GetMsg(&a1,&a2,
|
||||
1<<MSG_KEY_DOWN+1<<MSG_IP_L_DOWN);
|
||||
msg_code=GetMsg(&a1,&a2,1<<MSG_KEY_DOWN+1<<MSG_IP_L_DOWN);
|
||||
switch (msg_code) {
|
||||
case MSG_IP_L_DOWN:
|
||||
x1=a1; y1=a2;
|
||||
@@ -77,8 +77,7 @@ public U0 Life()
|
||||
dc[cur_dc]->pen_width=0.04*ip.speed;
|
||||
GrLine3(dc[cur_dc],x1,y1,0,x2,y2,0);
|
||||
restart=TRUE;
|
||||
msg_code=GetMsg(&a1,&a2,
|
||||
1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
||||
x1=x2; y1=y2;
|
||||
x2=a1; y2=a2;
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -8,19 +8,19 @@ F64 scale;
|
||||
Complex *PoleZeroFind(I64 x,I64 y)
|
||||
{
|
||||
I64 i;
|
||||
F64 d,best_d=MAX_F64;
|
||||
F64 dd,best_dd=MAX_F64;
|
||||
Complex *result=NULL;
|
||||
for (i=0;i<NUM_POLES;i++) {
|
||||
d=Sqr(poles[i].x-x)+Sqr(poles[i].y-y);
|
||||
if (d<best_d) {
|
||||
best_d=d;
|
||||
dd=Sqr(poles[i].x-x)+Sqr(poles[i].y-y);
|
||||
if (dd<best_dd) {
|
||||
best_dd=dd;
|
||||
result=&poles[i];
|
||||
}
|
||||
}
|
||||
for (i=0;i<NUM_ZEROS;i++) {
|
||||
d=Sqr(zeros[i].x-x)+Sqr(zeros[i].y-y);
|
||||
if (d<best_d) {
|
||||
best_d=d;
|
||||
dd=Sqr(zeros[i].x-x)+Sqr(zeros[i].y-y);
|
||||
if (dd<best_dd) {
|
||||
best_dd=dd;
|
||||
result=&zeros[i];
|
||||
}
|
||||
}
|
||||
@@ -109,7 +109,7 @@ U0 PoleZeros()
|
||||
SetVGAPaletteColor(15,0xFF0000); //White is red
|
||||
|
||||
WinMax;
|
||||
WordStat;
|
||||
AutoComplete;
|
||||
WinBorder;
|
||||
|
||||
DCFill;
|
||||
|
||||
@@ -59,7 +59,7 @@ U0 PredatorPrey()
|
||||
WinMax;
|
||||
WinBorder;
|
||||
WinMgrSync;
|
||||
WordStat;
|
||||
AutoComplete;
|
||||
|
||||
dc->color=BLACK;
|
||||
GrLine(dc,OX,0,OX,GR_HEIGHT-FONT_HEIGHT-1);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -89,7 +89,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
è = i*ã/2/RINGS;
|
||||
è2=(i+1)*ã/2/RINGS+SLOP;
|
||||
for (j=0;j<FACES;j++) {
|
||||
é = j*2*ã/FACES;
|
||||
é =j*2*ã/FACES;
|
||||
é2=(j+1)*2*ã/FACES+SLOP;
|
||||
|
||||
//Upper half
|
||||
@@ -162,7 +162,7 @@ U0 Main()
|
||||
DocClear;
|
||||
WinMax;
|
||||
WinBorder;
|
||||
WordStat;
|
||||
AutoComplete;
|
||||
Fs->draw_it=&DrawIt;
|
||||
try {
|
||||
"\n\nMove mouse to change light source.\n\n";
|
||||
|
||||
@@ -16,7 +16,7 @@ class CSliderState
|
||||
I64 right_pos;
|
||||
} sld;
|
||||
|
||||
U0 DrawSliderCtrl(CDC *dc,CCtrl *c)
|
||||
U0 DrawCtrlSlider(CDC *dc,CCtrl *c)
|
||||
{
|
||||
CSliderState *s=c->state;
|
||||
|
||||
@@ -44,7 +44,7 @@ U0 DrawSliderCtrl(CDC *dc,CCtrl *c)
|
||||
GrRect(dc,c->left+2*SLIDER_SPACING+1-2,c->top+SLIDER_SPACING+SLIDER_RANGE-1-s->right_pos-1,5,3);
|
||||
}
|
||||
|
||||
U0 UpdateDerivedSliderCtrl(CCtrl *c)
|
||||
U0 UpdateDerivedCtrlSlider(CCtrl *c)
|
||||
{
|
||||
CSliderState *s=c->state;
|
||||
c->left=c->win_task->pix_width/2-(SLIDER_SPACING*3+2)/2;
|
||||
@@ -75,9 +75,9 @@ CCtrl *SliderNew()
|
||||
c->type=CTRLT_GENERIC;
|
||||
c->state=&sld;
|
||||
MemSet(&sld,0,sizeof(CSliderState));
|
||||
c->draw_it=&DrawSliderCtrl;
|
||||
c->draw_it=&DrawCtrlSlider;
|
||||
c->left_click=&LeftClickSlider;
|
||||
c->update_derived_vals=&UpdateDerivedSliderCtrl;
|
||||
c->update_derived_vals=&UpdateDerivedCtrlSlider;
|
||||
old_preempt=Preempt(OFF);
|
||||
QueIns(c,Fs->last_ctrl);
|
||||
TaskDerivedValsUpdate;
|
||||
@@ -11,7 +11,7 @@ public U0 SpeedLineDemo()
|
||||
|
||||
WinMax;
|
||||
WinBorder;
|
||||
WordStat;
|
||||
AutoComplete;
|
||||
DCFill;
|
||||
DocClear;
|
||||
do {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,38 @@
|
||||
//Normally, you make sprites with <CTRL-r>.
|
||||
//This shows how to build a sprite by hand.
|
||||
//See $MA-X+PU,"::/Apps/GrModels",LM="Cd(\"::/Apps/GrModels\");Dir;View;\n"$.
|
||||
|
||||
class MySprite
|
||||
{ // See $LK,"Sprite Elem Types",A="MN:SPT_LINE"$
|
||||
CSpriteColor color;
|
||||
CSpritePtPt line1;
|
||||
CSpritePtPt line2;
|
||||
CSpritePtPt line3;
|
||||
CSpritePt fill;
|
||||
CSpriteBase end;
|
||||
};
|
||||
|
||||
|
||||
U0 SpriteRawDemo()
|
||||
{
|
||||
MySprite s;
|
||||
|
||||
MemSet(&s,0,sizeof(s));
|
||||
s.color.type=SPT_COLOR;
|
||||
s.color.color=GREEN;
|
||||
s.line1.type=SPT_LINE;
|
||||
s.line1.x2=100; s.line1.y2=50;
|
||||
s.line2.type=SPT_LINE;
|
||||
s.line2.x2=50; s.line2.y2=100;
|
||||
s.line3.type=SPT_LINE;
|
||||
s.line3.x1=100; s.line3.y1=50;
|
||||
s.line3.x2=50; s.line3.y2=100;
|
||||
s.fill.type=SPT_FLOOD_FILL;
|
||||
s.fill.x1=20; s.fill.y1=20;
|
||||
s.end.type=SPT_END;
|
||||
|
||||
Sprite(&s);
|
||||
"%h13c",'\n';
|
||||
}
|
||||
|
||||
SpriteRawDemo;
|
||||
@@ -10,8 +10,8 @@ U0 SunMoon()
|
||||
WinMax; //Maximize window
|
||||
DocClear; //Clear command-line text
|
||||
WinBorder; //No Border
|
||||
WordStat; //WordStat Off
|
||||
Fs->text_attr=BLACK<<+WHITE; //Current $LK,"CTask",A="MN:CTask"$ is Fs segment register.
|
||||
AutoComplete; //AutoComplete Off
|
||||
Fs->text_attr=BLACK<<4+WHITE; //Current $LK,"CTask",A="MN:CTask"$ is Fs segment register.
|
||||
|
||||
for (i=0;i<0x8000;i+=0x200) {
|
||||
//Sun
|
||||
@@ -33,7 +33,7 @@ U0 SunMoon()
|
||||
gr.dc->dither_probability_u16=2*i; //U16 can be [0,65535]
|
||||
GrFloodFill(gr.dc,x-0.75*radius,y);
|
||||
|
||||
WinMgrSync; //Typically 60 fps or 16.6mS
|
||||
WinMgrSync; //Typically 30 fps or 33S
|
||||
DCFill;
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
@@ -5,7 +5,7 @@ This is an advanced demo that shows
|
||||
that you can place ctrls on the
|
||||
wall paper.
|
||||
|
||||
See $LK,"::/Demo/Graphics/SliderCtrl.CPP"$
|
||||
See $LK,"::/Demo/Graphics/Slider.CPP"$
|
||||
and $LK,"::/Demo/Graphics/WallPaperFish.CPP"$
|
||||
before messing with this program.
|
||||
|
||||
@@ -22,7 +22,7 @@ class CSliderState
|
||||
I64 right_pos;
|
||||
};
|
||||
|
||||
U0 DrawSliderCtrl(CDC *dc,CCtrl *c)
|
||||
U0 DrawCtrlSlider(CDC *dc,CCtrl *c)
|
||||
{
|
||||
CSliderState *s=c->state;
|
||||
|
||||
@@ -50,7 +50,7 @@ U0 DrawSliderCtrl(CDC *dc,CCtrl *c)
|
||||
GrRect(dc,c->left+2*SLIDER_SPACING+1-2,c->top+SLIDER_SPACING+SLIDER_RANGE-1-s->right_pos-1,5,3);
|
||||
}
|
||||
|
||||
U0 UpdateDerivedSliderCtrl(CCtrl *c)
|
||||
U0 UpdateDerivedCtrlSlider(CCtrl *c)
|
||||
{
|
||||
CSliderState *s=c->state;
|
||||
c->left=c->win_task->pix_width/2-(SLIDER_SPACING*3+2)/2;
|
||||
@@ -86,9 +86,9 @@ CCtrl *SliderNew()
|
||||
c->flags=CTRLF_SHOW|CTRLF_CAPTURE_LEFT_IP;
|
||||
c->type=CTRLT_GENERIC;
|
||||
c->state=ACAlloc(sizeof(CSliderState));
|
||||
c->draw_it=&DrawSliderCtrl;
|
||||
c->draw_it=&DrawCtrlSlider;
|
||||
c->left_click=&LeftClickSlider;
|
||||
c->update_derived_vals=&UpdateDerivedSliderCtrl;
|
||||
c->update_derived_vals=&UpdateDerivedCtrlSlider;
|
||||
old_preempt=Preempt(OFF);
|
||||
QueIns(c,sys_winmgr_task->last_ctrl);
|
||||
TaskDerivedValsUpdate;
|
||||
|
||||
Binary file not shown.
Reference in new issue
Block a user