ì©lµ{¦¡
UDrawBox
ì©lÀɡа_©l
#include "w_obj.h"
/*================================================================*/
void UDrawBox(int X1,int Y1,int X2,int Y2,int attr,int clear,int shadow,int type)
{ /* X2 ¬°³Ì¥~¤@¦æ,¦]®Ø¬°2byte,µe®É·|¥Ñ«e¤@¦æµe*/
int i,j;
char *l_u, *r_u, *l_d, *r_d, *h_line, *v_line;
switch(type)
{
case 1: /* 1 line box */
l_u = "¢z" ;
r_u = "¢{" ;
l_d = "¢|" ;
r_d = "¢}" ;
h_line = "¢w" ;
v_line = "¢x" ;
break;
case 2: /* 2 line box */
l_u = "ùÝ" ;
r_u = "ùß" ;
l_d = "ùã" ;
r_d = "ùå" ;
h_line = "ùù" ;
v_line = "ùø" ;
break;
case 3: /* thick line box */
l_u = "¢~" ;
r_u = "¢¡" ;
l_d = "¢¢" ;
r_d = "¢£" ;
h_line = "ùù" ;
v_line = "ùø" ;
break;
}
UShowS(X1 ,Y1,l_u,attr);
UShowS(X1 ,Y2,l_d,attr);
UShowS(X2-1,Y1,r_u,attr);
UShowS(X2-1,Y2,r_d,attr);
for (i=X1+2; i<X2-2; i+=2)
{ UShowS(i,Y1,h_line,attr);
UShowS(i,Y2,h_line,attr);
}
for (i=Y1+1; i<Y2; i++)
{ UShowS(X1 ,i,v_line,attr);
UShowS(X2-1,i,v_line,attr);
}
if (clear)
UScroll(0,X1+2,Y1+1,X2-2,Y2-1,clear);
if (shadow)
{
V_PTR v_ptr = video_base + (X1+1)*2 + Y2*160 + 1; /* bottom shadow */
for (i=0; i < X2-X1+1; i++)
{
*v_ptr = *v_ptr & 0x07;
v_ptr += 2;
}
v_ptr = video_base + (X2)*2 + Y1*160 + 1; /* right shadow */
for (i=0; i < Y2-Y1; i++)
{
*v_ptr = *v_ptr & 0x07;
v_ptr += 2;
*v_ptr = *v_ptr & 0x07;
v_ptr += 160 - 2;
}
}
}
ì©lÀɡе²§ô
Byron Wey¡@¡@Oct.21.1998