TempleOSCDV5.00.ISO
This commit is contained in:
1 parent
122df6338e
commit
f6eacf7744
374 files changed
+11078
-11204
No files matched your search
@@ -9,12 +9,12 @@ U0 Main()
|
||||
while (!ScanChar) {
|
||||
DCDepthBufRst(dc);
|
||||
DCSymmetrySet(dc,Fs->pix_width/2,Fs->pix_height/2,
|
||||
ip.pos.x-Fs->pix_left-Fs->scroll_x,
|
||||
ip.pos.y-Fs->pix_top-Fs->scroll_y);
|
||||
ms.pos.x-Fs->pix_left-Fs->scroll_x,
|
||||
ms.pos.y-Fs->pix_top-Fs->scroll_y);
|
||||
dc->color=LTBLUE;
|
||||
GrLine(dc,Fs->pix_width/2,Fs->pix_height/2,
|
||||
ip.pos.x-Fs->pix_left-Fs->scroll_x,
|
||||
ip.pos.y-Fs->pix_top-Fs->scroll_y);
|
||||
ms.pos.x-Fs->pix_left-Fs->scroll_x,
|
||||
ms.pos.y-Fs->pix_top-Fs->scroll_y);
|
||||
|
||||
Mat4x4IdentEqu(dc->r);
|
||||
Mat4x4RotX(dc->r,ę);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
U0 BSplineDemo()
|
||||
{
|
||||
CDC *dc=DCAlias;
|
||||
I64 a1,a2,i=0,msg_code;
|
||||
I64 arg1,arg2,i=0,msg_code;
|
||||
CD3I32 c[MAX_PTS];
|
||||
|
||||
SettingsPush;
|
||||
@@ -13,14 +13,14 @@ U0 BSplineDemo()
|
||||
"Sel ctrl points with left mouse. Right when finished.\n";
|
||||
DCFill;
|
||||
do {
|
||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP+1<<MSG_IP_R_UP);
|
||||
if (msg_code==MSG_IP_L_UP) {
|
||||
c[i].x=a1; c[i].y=a2; c[i].z=0;
|
||||
msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP+1<<MSG_MS_R_UP);
|
||||
if (msg_code==MSG_MS_L_UP) {
|
||||
c[i].x=arg1; c[i].y=arg2; c[i].z=0;
|
||||
dc->color=GREEN;
|
||||
GrCircle(dc,a1,a2,10);
|
||||
GrCircle(dc,arg1,arg2,10);
|
||||
i++;
|
||||
}
|
||||
} while (i<MAX_PTS && msg_code!=MSG_IP_R_UP);
|
||||
} while (i<MAX_PTS && msg_code!=MSG_MS_R_UP);
|
||||
dc->color=RED;
|
||||
Gr2BSpline(dc,c,i,TRUE);
|
||||
dc->color=BLUE;
|
||||
|
||||
@@ -24,7 +24,7 @@ U0 Balloon()
|
||||
for (j=0;j<3;j++)
|
||||
*(text.vga_alias(I64)+0x1000+(i+k)*640/8+j)(U8 *)=a[i*3+j];
|
||||
|
||||
BusyWait(40000);
|
||||
Busy(40000);
|
||||
|
||||
for (i=0;i<20;i++)
|
||||
for (j=0;j<3;j++)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+12
-11
@@ -2,7 +2,7 @@
|
||||
|
||||
U0 Doodle()
|
||||
{
|
||||
I64 msg_code,i,x1,y1,x2,y2,a1,a2,color=BLACK;
|
||||
I64 msg_code,i,x1,y1,x2,y2,arg1,arg2,color=BLACK;
|
||||
CDC *dc=DCAlias;
|
||||
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
@@ -14,30 +14,31 @@ U0 Doodle()
|
||||
DocClear;
|
||||
DCFill;
|
||||
do {
|
||||
msg_code=GetMsg(&a1,&a2,1<<MSG_KEY_DOWN+1<<MSG_IP_L_DOWN+1<<MSG_IP_R_UP);
|
||||
msg_code=GetMsg(&arg1,&arg2,
|
||||
1<<MSG_KEY_DOWN+1<<MSG_MS_L_DOWN+1<<MSG_MS_R_UP);
|
||||
switch (msg_code) {
|
||||
case MSG_IP_R_UP:
|
||||
case MSG_MS_R_UP:
|
||||
i=PopUpColor;
|
||||
if (i>=0) color=i;
|
||||
break;
|
||||
case MSG_IP_L_DOWN:
|
||||
x1=a1; y1=a2;
|
||||
x2=a1; y2=a2;
|
||||
case MSG_MS_L_DOWN:
|
||||
x1=arg1; y1=arg2;
|
||||
x2=arg1; y2=arg2;
|
||||
dc->color=ROP_XOR+color^TRANSPARENT;
|
||||
dc->pen_width=7;
|
||||
while (msg_code!=MSG_IP_L_UP) {
|
||||
while (msg_code!=MSG_MS_L_UP) {
|
||||
GrLine3(dc,x1,y1,0,x2,y2,0);
|
||||
msg_code=GetMsg(&a1,&a2,
|
||||
1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
||||
msg_code=GetMsg(&arg1,&arg2,
|
||||
1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
|
||||
GrLine3(dc,x1,y1,0,x2,y2,0);
|
||||
x2=a1; y2=a2;
|
||||
x2=arg1; y2=arg2;
|
||||
}
|
||||
GrLine3(dc,x1,y1,0,x2,y2,0);
|
||||
break;
|
||||
case MSG_KEY_DOWN:
|
||||
break;
|
||||
}
|
||||
} while (msg_code!=MSG_KEY_DOWN || !a1);
|
||||
} while (msg_code!=MSG_KEY_DOWN || !arg1);
|
||||
GetMsg(,,1<<MSG_KEY_UP);
|
||||
DCFill;
|
||||
DCDel(dc);
|
||||
|
||||
Binary file not shown.
+16
-16
@@ -60,7 +60,7 @@ U0 FESave(Bool pmt)
|
||||
I64 i;
|
||||
for (i=0;i<256;i++) {
|
||||
DocPrint(doc,"0x%016X,",text.font[i]);
|
||||
if (Bt(chars_bmp_safe_dollar,i))
|
||||
if (Bt(char_bmp_safe_dollar,i))
|
||||
DocPrint(doc,"//%c",i);
|
||||
else if (i=='$$')
|
||||
DocPrint(doc,"//$$$$",i);
|
||||
@@ -74,7 +74,7 @@ U0 FESave(Bool pmt)
|
||||
|
||||
U0 FontEd()
|
||||
{
|
||||
I64 msg_code,a1,a2,k;
|
||||
I64 msg_code,arg1,arg2,k;
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
MenuPush(
|
||||
"File {"
|
||||
@@ -90,12 +90,12 @@ U0 FontEd()
|
||||
try {
|
||||
Fs->draw_it=&DrawIt;
|
||||
while (TRUE) {
|
||||
switch (msg_code=GetMsg(&a1,&a2,
|
||||
1<<MSG_KEY_DOWN|1<<MSG_IP_L_DOWN|1<<MSG_IP_R_DOWN|1<<MSG_IP_MOVE)) {
|
||||
switch (msg_code=GetMsg(&arg1,&arg2,
|
||||
1<<MSG_KEY_DOWN|1<<MSG_MS_L_DOWN|1<<MSG_MS_R_DOWN|1<<MSG_MS_MOVE)) {
|
||||
case MSG_KEY_DOWN:
|
||||
switch (a1) {
|
||||
switch (arg1) {
|
||||
case 0:
|
||||
switch (a2.u8[0]) {
|
||||
switch (arg2.u8[0]) {
|
||||
case SC_CURSOR_LEFT:
|
||||
cur_ch--;
|
||||
break;
|
||||
@@ -120,22 +120,22 @@ U0 FontEd()
|
||||
case CH_SHIFT_ESC:
|
||||
goto fe_done;
|
||||
default:
|
||||
cur_ch=a1;
|
||||
cur_ch=arg1;
|
||||
}
|
||||
break;
|
||||
case MSG_IP_L_DOWN:
|
||||
case MSG_IP_R_DOWN:
|
||||
if (0<=a1<FONT_WIDTH*16 && FONT_HEIGHT*2<=a2<FONT_HEIGHT*16) {
|
||||
cur_ch=(a2/FONT_HEIGHT-2)*16+a1/FONT_WIDTH;
|
||||
case MSG_MS_L_DOWN:
|
||||
case MSG_MS_R_DOWN:
|
||||
if (0<=arg1<FONT_WIDTH*16 && FONT_HEIGHT*2<=arg2<FONT_HEIGHT*16) {
|
||||
cur_ch=(arg2/FONT_HEIGHT-2)*16+arg1/FONT_WIDTH;
|
||||
break;
|
||||
} //fall through
|
||||
case MSG_IP_MOVE:
|
||||
k=((a2-BLOW_UP_CHAR_Y)/FONT_HEIGHT)*FONT_WIDTH+
|
||||
(a1-BLOW_UP_CHAR_X)/FONT_WIDTH;
|
||||
case MSG_MS_MOVE:
|
||||
k=((arg2-BLOW_UP_CHAR_Y)/FONT_HEIGHT)*FONT_WIDTH+
|
||||
(arg1-BLOW_UP_CHAR_X)/FONT_WIDTH;
|
||||
if (0<=k<FONT_WIDTH*FONT_HEIGHT) {
|
||||
if (ip.lb||msg_code==MSG_IP_L_DOWN)
|
||||
if (ms.lb||msg_code==MSG_MS_L_DOWN)
|
||||
Bts(&text.font[cur_ch],k);
|
||||
if (ip.rb||msg_code==MSG_IP_R_DOWN)
|
||||
if (ms.rb||msg_code==MSG_MS_R_DOWN)
|
||||
Btr(&text.font[cur_ch],k);
|
||||
}
|
||||
break;
|
||||
|
||||
+12
-12
@@ -1,6 +1,6 @@
|
||||
#define GRID 5
|
||||
|
||||
U0 DrawMyInputPtr(CDC *dc,I64 x,I64 y)
|
||||
U0 DrawMyMs(CDC *dc,I64 x,I64 y)
|
||||
{
|
||||
dc->pen_width=1;
|
||||
dc->flags&=~(DCF_TRANSFORMATION|DCF_SYMMETRY);
|
||||
@@ -10,21 +10,21 @@ U0 DrawMyInputPtr(CDC *dc,I64 x,I64 y)
|
||||
U0 GridDemo()
|
||||
{
|
||||
CGridGlbls old_grid;
|
||||
U0 (*old_draw_input_ptr)(CDC *dc,I64 x,I64 y); //Can't init this type of var.
|
||||
MemCpy(&old_grid,&ip_grid,sizeof(CGridGlbls));
|
||||
U0 (*old_draw_ms)(CDC *dc,I64 x,I64 y); //Can't init this type of var.
|
||||
MemCpy(&old_grid,&ms_grid,sizeof(CGridGlbls));
|
||||
GridInit;
|
||||
ip_grid.snap=TRUE; //You can set other $LK,"stuff",A="MN:CGridGlbls"$.
|
||||
ip_grid.x=GRID;
|
||||
ip_grid.y=GRID;
|
||||
old_draw_input_ptr=gr.fp_draw_input_ptr;
|
||||
gr.fp_draw_input_ptr=&DrawMyInputPtr;
|
||||
while (!ip.lb) {//Left button to exit.
|
||||
GrPlot(,ip.pos.x,ip.pos.y);
|
||||
ms_grid.snap=TRUE; //You can set other $LK,"stuff",A="MN:CGridGlbls"$.
|
||||
ms_grid.x=GRID;
|
||||
ms_grid.y=GRID;
|
||||
old_draw_ms=gr.fp_draw_ms;
|
||||
gr.fp_draw_ms=&DrawMyMs;
|
||||
while (!ms.lb) {//Left bttn to exit.
|
||||
GrPlot(,ms.pos.x,ms.pos.y);
|
||||
Yield;
|
||||
}
|
||||
DCFill;
|
||||
gr.fp_draw_input_ptr=old_draw_input_ptr;
|
||||
MemCpy(&ip_grid,&old_grid,sizeof(CGridGlbls));
|
||||
gr.fp_draw_ms=old_draw_ms;
|
||||
MemCpy(&ms_grid,&old_grid,sizeof(CGridGlbls));
|
||||
}
|
||||
|
||||
GridDemo;
|
||||
@@ -77,7 +77,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
U0 MySleep()
|
||||
{
|
||||
if (ScanChar)
|
||||
ThrowBreak;
|
||||
throw;
|
||||
Sleep(3);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
U0 InputPointer()
|
||||
{
|
||||
"Press left mouse button to exit.\n";
|
||||
while (!ip.lb) { //Left button to exit.
|
||||
GrPlot(,ip.pos.x,ip.pos.y);
|
||||
Refresh;
|
||||
}
|
||||
DCFill;
|
||||
}
|
||||
|
||||
InputPointer;
|
||||
+16
-16
@@ -135,7 +135,7 @@ U0 SetMenu()
|
||||
U0 Lattice()
|
||||
{
|
||||
Bool aim=FALSE;
|
||||
I64 a1,a2;
|
||||
I64 arg1,arg2;
|
||||
CDC *dc=DCAlias;
|
||||
DCDepthBufAlloc(dc);
|
||||
MenuPush(
|
||||
@@ -181,29 +181,29 @@ U0 Lattice()
|
||||
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:
|
||||
switch (GetMsg(&arg1,&arg2,1<<MSG_KEY_DOWN|1<<MSG_MS_L_DOWN|
|
||||
1<<MSG_MS_R_DOWN|1<<MSG_MS_R_UP|1<<MSG_MS_MOVE)) {
|
||||
case MSG_MS_L_DOWN:
|
||||
tt.first=TRUE;
|
||||
tt.x=a1;
|
||||
tt.y=a2;
|
||||
tt.x=arg1;
|
||||
tt.y=arg2;
|
||||
break;
|
||||
case MSG_IP_R_DOWN:
|
||||
case MSG_MS_R_DOWN:
|
||||
aim=TRUE;
|
||||
tt.é=Arg(a1-tt.x,a2-tt.y);
|
||||
tt.é=Arg(arg1-tt.x,arg2-tt.y);
|
||||
break;
|
||||
case MSG_IP_MOVE:
|
||||
case MSG_MS_MOVE:
|
||||
if (aim)
|
||||
tt.é=Arg(a1-tt.x,a2-tt.y);
|
||||
tt.é=Arg(arg1-tt.x,arg2-tt.y);
|
||||
break;
|
||||
case MSG_IP_R_UP:
|
||||
tt.é=Arg(a1-tt.x,a2-tt.y);
|
||||
case MSG_MS_R_UP:
|
||||
tt.é=Arg(arg1-tt.x,arg2-tt.y);
|
||||
aim=FALSE;
|
||||
break;
|
||||
case MSG_KEY_DOWN:
|
||||
switch (a1) {
|
||||
switch (arg1) {
|
||||
case 0:
|
||||
switch (a2.u8[0]) {
|
||||
switch (arg2.u8[0]) {
|
||||
case SC_CURSOR_LEFT:
|
||||
if (tt.dé_idx)
|
||||
tt.dé_idx--;
|
||||
@@ -222,11 +222,11 @@ U0 Lattice()
|
||||
}
|
||||
break;
|
||||
case '0'...'9':
|
||||
tt.z=a1-'0';
|
||||
tt.z=arg1-'0';
|
||||
SetMenu;
|
||||
break;
|
||||
case 'c':
|
||||
tt.middle=PopUpColor("Middle Color\n\n");
|
||||
tt.middle=PopUpColor("Mid Color\n\n");
|
||||
tt.edge =PopUpColor("Edge Color\n\n");
|
||||
break;
|
||||
case 'e':
|
||||
|
||||
+10
-10
@@ -48,7 +48,7 @@ start_over:
|
||||
|
||||
public U0 Life()
|
||||
{
|
||||
I64 msg_code,cnt,x1,y1,x2,y2,a1,a2;
|
||||
I64 msg_code,cnt,x1,y1,x2,y2,arg1,arg2;
|
||||
|
||||
dc[0]=DCNew(GR_WIDTH,GR_HEIGHT);
|
||||
dc[1]=DCNew(GR_WIDTH,GR_HEIGHT);
|
||||
@@ -66,28 +66,28 @@ public U0 Life()
|
||||
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(&arg1,&arg2,1<<MSG_KEY_DOWN+1<<MSG_MS_L_DOWN);
|
||||
switch (msg_code) {
|
||||
case MSG_IP_L_DOWN:
|
||||
x1=a1; y1=a2;
|
||||
x2=a1; y2=a2;
|
||||
case MSG_MS_L_DOWN:
|
||||
x1=arg1; y1=arg2;
|
||||
x2=arg1; y2=arg2;
|
||||
cnt=0;
|
||||
while (msg_code!=MSG_IP_L_UP) {
|
||||
while (msg_code!=MSG_MS_L_UP) {
|
||||
restart=TRUE;
|
||||
dc[cur_dc]->color=GREEN;
|
||||
dc[cur_dc]->pen_width=0.04*ip.speed;
|
||||
dc[cur_dc]->pen_width=0.04*ms.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(&arg1,&arg2,1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
|
||||
x1=x2; y1=y2;
|
||||
x2=a1; y2=a2;
|
||||
x2=arg1; y2=arg2;
|
||||
}
|
||||
GrLine3(dc[cur_dc],x1,y1,0,x2,y2,0);
|
||||
break;
|
||||
case MSG_KEY_DOWN:
|
||||
break;
|
||||
}
|
||||
} while (msg_code!=MSG_KEY_DOWN || !a1);
|
||||
} while (msg_code!=MSG_KEY_DOWN || !arg1);
|
||||
GetMsg(,,1<<MSG_KEY_UP);
|
||||
SettingsPop;
|
||||
DCFill;
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,11 @@
|
||||
U0 Mouse()
|
||||
{
|
||||
"Press left mouse bttn to exit.\n";
|
||||
while (!ms.lb) { //Left bttn to exit.
|
||||
GrPlot(,ms.pos.x,ms.pos.y);
|
||||
Refresh;
|
||||
}
|
||||
DCFill;
|
||||
}
|
||||
|
||||
Mouse;
|
||||
Binary file not shown.
Binary file not shown.
+21
-20
@@ -37,7 +37,7 @@ F64 F(Complex *x)
|
||||
CDiv(&n1,&num,&denom);
|
||||
|
||||
R2P(&m,&a,n1.x,n1.y);
|
||||
if (ip.rb)
|
||||
if (ms.rb)
|
||||
return ã+a;
|
||||
else
|
||||
return m;
|
||||
@@ -65,7 +65,7 @@ F64 MPDraw(CTask *task)
|
||||
|
||||
U0 Draw()
|
||||
{
|
||||
CSrvCmd *tmpm[MP_MAX_PROCESSORS];
|
||||
CJob *tmpm[MP_MAX_PROCESSORS];
|
||||
F64 y_total,old_y_total=MAX_F64;
|
||||
I64 i,w=Fs->pix_width,h=Fs->pix_height,cx=w/2,cy=h/2;
|
||||
CDC *dc=DCAlias;
|
||||
@@ -94,7 +94,7 @@ U0 Draw()
|
||||
|
||||
U0 PoleZeros()
|
||||
{
|
||||
I64 msg_code,a1,a2,p11,p22,cx,cy;
|
||||
I64 msg_code,arg1,arg2,p11,p22,cx,cy;
|
||||
Complex *tmpc=NULL;
|
||||
|
||||
PopUpOk(
|
||||
@@ -118,24 +118,25 @@ U0 PoleZeros()
|
||||
try {
|
||||
Draw;
|
||||
while (TRUE) {
|
||||
msg_code=GetMsg(&a1,&a2,1<<MSG_KEY_DOWN+1<<MSG_IP_L_DOWN+
|
||||
1<<MSG_IP_L_UP+1<<MSG_IP_R_DOWN+1<<MSG_IP_R_UP+1<<MSG_IP_MOVE);
|
||||
msg_code=GetMsg(&arg1,&arg2,1<<MSG_KEY_DOWN+1<<MSG_MS_L_DOWN+
|
||||
1<<MSG_MS_L_UP+1<<MSG_MS_R_DOWN+1<<MSG_MS_R_UP+1<<MSG_MS_MOVE);
|
||||
pz_msg:
|
||||
cx=Fs->pix_width/2;
|
||||
cy=Fs->pix_height/2;
|
||||
switch (msg_code) {
|
||||
case MSG_IP_L_DOWN:
|
||||
tmpc=PoleZeroFind(a1-cx,cy-a2);
|
||||
case MSG_MS_L_DOWN:
|
||||
tmpc=PoleZeroFind(arg1-cx,cy-arg2);
|
||||
break;
|
||||
case MSG_IP_MOVE:
|
||||
case MSG_MS_MOVE:
|
||||
if (tmpc) {
|
||||
p11=a1;p22=a2;
|
||||
p11=arg1;p22=arg2;
|
||||
//get to last mouse move
|
||||
while (msg_code=ScanMsg(&a1,&a2,1<<MSG_KEY_DOWN+1<<MSG_IP_L_DOWN+
|
||||
1<<MSG_IP_L_UP+1<<MSG_IP_R_DOWN+
|
||||
1<<MSG_IP_R_UP+1<<MSG_IP_MOVE))
|
||||
if (msg_code==MSG_IP_MOVE) {
|
||||
p11=a1;p22=a2;
|
||||
while (msg_code=ScanMsg(&arg1,&arg2,
|
||||
1<<MSG_KEY_DOWN+1<<MSG_MS_L_DOWN+
|
||||
1<<MSG_MS_L_UP+1<<MSG_MS_R_DOWN+
|
||||
1<<MSG_MS_R_UP+1<<MSG_MS_MOVE))
|
||||
if (msg_code==MSG_MS_MOVE) {
|
||||
p11=arg1;p22=arg2;
|
||||
} else
|
||||
goto pz_msg;
|
||||
|
||||
@@ -144,20 +145,20 @@ pz_msg:
|
||||
Draw;
|
||||
}
|
||||
break;
|
||||
case MSG_IP_L_UP:
|
||||
case MSG_MS_L_UP:
|
||||
if (tmpc) {
|
||||
tmpc->x=a1-cx;
|
||||
tmpc->y=cy-a2;
|
||||
tmpc->x=arg1-cx;
|
||||
tmpc->y=cy-arg2;
|
||||
tmpc=NULL;
|
||||
Draw;
|
||||
}
|
||||
break;
|
||||
case MSG_IP_R_DOWN:
|
||||
case MSG_IP_R_UP:
|
||||
case MSG_MS_R_DOWN:
|
||||
case MSG_MS_R_UP:
|
||||
Draw;
|
||||
break;
|
||||
case MSG_KEY_DOWN:
|
||||
if (a1==CH_SHIFT_ESC||a1==CH_ESC)
|
||||
if (arg1==CH_SHIFT_ESC||arg1==CH_ESC)
|
||||
goto pz_done;
|
||||
}
|
||||
Refresh;
|
||||
|
||||
@@ -1,24 +1,13 @@
|
||||
//See $LK,"::/Demo/Games/Stadium/StadiumGen.HC"$.
|
||||
|
||||
U0 ViewScrnCapture(U8 *filename)
|
||||
{
|
||||
CDC *dc=DCAlias(,Fs),
|
||||
*dc2=GRRead(filename);
|
||||
GrBlot(dc,0,0,dc2);
|
||||
DCDel(dc2);
|
||||
DCDel(dc);
|
||||
}
|
||||
|
||||
U0 Main()
|
||||
{
|
||||
"Capture scrn...\n";
|
||||
PressAKey;
|
||||
GRScrnCapture("~/DemoScrnShot");
|
||||
|
||||
GRScrnCaptureWrite("~/DemoScrnShot");
|
||||
"View captured scrn...\n";
|
||||
PressAKey;
|
||||
ViewScrnCapture("~/DemoScrnShot");
|
||||
|
||||
GRScrnCaptureRead("~/DemoScrnShot");
|
||||
PressAKey;
|
||||
DCFill;
|
||||
}
|
||||
|
||||
@@ -72,8 +72,8 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
Mat4x4Scale(dc->r,tt);
|
||||
DCMat4x4Set(dc,dc->r);
|
||||
|
||||
ls.x=-(ip.pos.x-task->pix_left-task->scroll_x-cx);
|
||||
ls.y=-(ip.pos.y-task->pix_top-task->scroll_y-cy);
|
||||
ls.x=-(ms.pos.x-task->pix_left-task->scroll_x-cx);
|
||||
ls.y=-(ms.pos.y-task->pix_top-task->scroll_y-cy);
|
||||
ls.z=GR_WIDTH/8;
|
||||
d=1<<16/D3I32Norm(&ls);
|
||||
ls.x*=d;
|
||||
|
||||
Binary file not shown.
@@ -75,7 +75,7 @@ CCtrl *SliderNew()
|
||||
{
|
||||
CCtrl *c=CAlloc(sizeof(CCtrl));
|
||||
c->win_task=Fs;
|
||||
c->flags=CTRLF_SHOW|CTRLF_CAPTURE_LEFT_IP;
|
||||
c->flags=CTRLF_SHOW|CTRLF_CAPTURE_LEFT_MS;
|
||||
c->type=CTRLT_GENERIC;
|
||||
c->state=&sld;
|
||||
MemSet(&sld,0,sizeof(CSliderState));
|
||||
|
||||
+13
-12
@@ -2,7 +2,7 @@
|
||||
|
||||
public U0 SpeedLineDemo()
|
||||
{
|
||||
I64 msg_code,cnt,x1,y1,x2,y2,a1,a2,color=BLACK;
|
||||
I64 msg_code,cnt,x1,y1,x2,y2,arg1,arg2,color=BLACK;
|
||||
CDC *dc=DCAlias;
|
||||
dc->color=color;
|
||||
|
||||
@@ -15,31 +15,32 @@ public U0 SpeedLineDemo()
|
||||
DocClear;
|
||||
DCFill;
|
||||
do {
|
||||
msg_code=GetMsg(&a1,&a2,1<<MSG_KEY_DOWN+1<<MSG_IP_L_DOWN+1<<MSG_IP_R_UP);
|
||||
msg_code=GetMsg(&arg1,&arg2,
|
||||
1<<MSG_KEY_DOWN+1<<MSG_MS_L_DOWN+1<<MSG_MS_R_UP);
|
||||
switch (msg_code) {
|
||||
case MSG_IP_R_UP:
|
||||
case MSG_MS_R_UP:
|
||||
color=PopUpColor;
|
||||
if (color>=0)
|
||||
dc->color=color;
|
||||
break;
|
||||
case MSG_IP_L_DOWN:
|
||||
x1=a1; y1=a2;
|
||||
x2=a1; y2=a2;
|
||||
case MSG_MS_L_DOWN:
|
||||
x1=arg1; y1=arg2;
|
||||
x2=arg1; y2=arg2;
|
||||
cnt=0;
|
||||
while (msg_code!=MSG_IP_L_UP) {
|
||||
dc->pen_width=0.04*ip.speed;
|
||||
while (msg_code!=MSG_MS_L_UP) {
|
||||
dc->pen_width=0.04*ms.speed;
|
||||
GrLine3(dc,x1,y1,0,x2,y2,0);
|
||||
msg_code=GetMsg(&a1,&a2,
|
||||
1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
||||
msg_code=GetMsg(&arg1,&arg2,
|
||||
1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
|
||||
x1=x2; y1=y2;
|
||||
x2=a1; y2=a2;
|
||||
x2=arg1; y2=arg2;
|
||||
}
|
||||
GrLine3(dc,x1,y1,0,x2,y2,0);
|
||||
break;
|
||||
case MSG_KEY_DOWN:
|
||||
break;
|
||||
}
|
||||
} while (msg_code!=MSG_KEY_DOWN || !a1);
|
||||
} while (msg_code!=MSG_KEY_DOWN || !arg1);
|
||||
GetMsg(,,1<<MSG_KEY_UP);
|
||||
DCFill;
|
||||
DCDel(dc);
|
||||
|
||||
+19
-19
@@ -5,7 +5,7 @@ If the line of symmetry is a point, symmetry is turned-off.
|
||||
|
||||
U0 SymmetryDemo()
|
||||
{
|
||||
I64 msg_code,x1,y1,x2,y2,a1,a2;
|
||||
I64 msg_code,x1,y1,x2,y2,arg1,arg2;
|
||||
CDC *dc=DCAlias;
|
||||
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
@@ -18,41 +18,41 @@ U0 SymmetryDemo()
|
||||
dc->flags|=DCF_SYMMETRY;
|
||||
DCSymmetrySet(dc,Fs->pix_width/2,0,Fs->pix_width/2,1);
|
||||
do {
|
||||
msg_code=GetMsg(&a1,&a2,
|
||||
1<<MSG_KEY_DOWN+1<<MSG_IP_L_DOWN+
|
||||
1<<MSG_IP_R_DOWN);
|
||||
msg_code=GetMsg(&arg1,&arg2,
|
||||
1<<MSG_KEY_DOWN+1<<MSG_MS_L_DOWN+
|
||||
1<<MSG_MS_R_DOWN);
|
||||
switch (msg_code) {
|
||||
case MSG_IP_R_DOWN:
|
||||
case MSG_MS_R_DOWN:
|
||||
dc->flags&=~DCF_SYMMETRY;
|
||||
dc->color=ROP_XOR+RED^TRANSPARENT;
|
||||
x1=a1; y1=a2;
|
||||
x2=a1; y2=a2;
|
||||
while (msg_code!=MSG_IP_R_UP) {
|
||||
x1=arg1; y1=arg2;
|
||||
x2=arg1; y2=arg2;
|
||||
while (msg_code!=MSG_MS_R_UP) {
|
||||
GrLine3(dc,x1,y1,0,x2,y2,0);
|
||||
msg_code=GetMsg(&a1,&a2,
|
||||
1<<MSG_IP_R_UP+1<<MSG_IP_MOVE);
|
||||
msg_code=GetMsg(&arg1,&arg2,
|
||||
1<<MSG_MS_R_UP+1<<MSG_MS_MOVE);
|
||||
GrLine3(dc,x1,y1,0,x2,y2,0);
|
||||
x2=a1; y2=a2;
|
||||
x2=arg1; y2=arg2;
|
||||
}
|
||||
GrLine3(dc,x1,y1,0,x2,y2,0);
|
||||
if (DCSymmetry3Set(dc,x1,y1,0,x2,y2,0,x2,y2,1))
|
||||
dc->flags|=DCF_SYMMETRY;
|
||||
break;
|
||||
case MSG_IP_L_DOWN:
|
||||
case MSG_MS_L_DOWN:
|
||||
dc->color=ROP_XOR+BLACK^TRANSPARENT;
|
||||
x1=a1; y1=a2;
|
||||
x2=a1; y2=a2;
|
||||
while (msg_code!=MSG_IP_L_UP) {
|
||||
x1=arg1; y1=arg2;
|
||||
x2=arg1; y2=arg2;
|
||||
while (msg_code!=MSG_MS_L_UP) {
|
||||
GrLine3(dc,x1,y1,0,x2,y2,0);
|
||||
msg_code=GetMsg(&a1,&a2,
|
||||
1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
||||
msg_code=GetMsg(&arg1,&arg2,
|
||||
1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
|
||||
GrLine3(dc,x1,y1,0,x2,y2,0);
|
||||
x2=a1; y2=a2;
|
||||
x2=arg1; y2=arg2;
|
||||
}
|
||||
GrLine3(dc,x1,y1,0,x2,y2,0);
|
||||
break;
|
||||
}
|
||||
} while (msg_code!=MSG_KEY_DOWN || (a1!=CH_ESC && a1!=CH_SHIFT_ESC));
|
||||
} while (msg_code!=MSG_KEY_DOWN || (arg1!=CH_ESC && arg1!=CH_SHIFT_ESC));
|
||||
GetMsg(,,1<<MSG_KEY_UP);
|
||||
DCFill;
|
||||
DCDel(dc);
|
||||
|
||||
Binary file not shown.
@@ -87,7 +87,7 @@ CCtrl *SliderNew()
|
||||
}
|
||||
c=ACAlloc(sizeof(CCtrl));
|
||||
c->win_task=sys_winmgr_task;
|
||||
c->flags=CTRLF_SHOW|CTRLF_CAPTURE_LEFT_IP;
|
||||
c->flags=CTRLF_SHOW|CTRLF_CAPTURE_LEFT_MS;
|
||||
c->type=CTRLT_GENERIC;
|
||||
c->state=ACAlloc(sizeof(CSliderState));
|
||||
c->draw_it=&DrawCtrlSlider;
|
||||
|
||||
Reference in new issue
Block a user