35 lines
875 B
Plaintext
35 lines
875 B
Plaintext
void DrawIt()
|
|
{
|
|
ClearWindowText;
|
|
}
|
|
|
|
void BSpline()
|
|
{
|
|
GrBitMap *b=GrNew(grbase);
|
|
I8 p1,p2,i=0,cmd;
|
|
U4 old_update_window=Fs->update_window;
|
|
U4 old_ip_double=Bts(&Fs->crt_flags,CRTf_NO_DOUBLE_CLICK);
|
|
U4 old_inhibit=ip_inhibit_win_operations;
|
|
P3I4 c[64];
|
|
ip_inhibit_win_operations=TRUE;
|
|
Fs->update_window=&DrawIt;
|
|
GrClear;
|
|
do {
|
|
cmd=GetMsg(&p1,&p2,1<<MSG_IP_L_UP+1<<MSG_IP_R_UP);
|
|
if (cmd==MSG_IP_L_UP) {
|
|
c[i].x=p1; c[i].y=p2; c[i].z=0;
|
|
b->color=GR_GREEN^GR_WHITE;
|
|
GrCircle(b,p1,p2,10);
|
|
i++;
|
|
}
|
|
} while (cmd!=MSG_IP_R_UP);
|
|
b->color=GR_RED^GR_WHITE;
|
|
Gr2BSpline(b,c,i,TRUE);
|
|
b->color=GR_BLUE^GR_WHITE;
|
|
Gr3BSpline(b,c,i,TRUE);
|
|
AssignBit(&Fs->crt_flags,CRTf_NO_DOUBLE_CLICK,old_ip_double);
|
|
Fs->update_window=old_update_window;
|
|
ip_inhibit_win_operations=old_inhibit;
|
|
}
|
|
|
|
BSpline; |