void intern drawbox( BUFFER *bptr, SAREA area, const char *box, ATTR attr, bool fill ) /************************************************************************************/ { uisize row; bpixel( bptr, area.row, area.col, attr, BOX_CHAR( box, TOP_LEFT ) ); if( area.width > 2 ) bfill( bptr, area.row, area.col + 1, attr, BOX_CHAR( box, TOP_LINE ), area.width - 2 ); bpixel( bptr, area.row, area.col + area.width - 1, attr, BOX_CHAR( box, TOP_RIGHT ) ); for( row = area.row + 1; row < area.row + area.height - 1; ++row ) { bpixel( bptr, row, area.col, attr, BOX_CHAR( box, LEFT_LINE ) ); if( fill && area.width > 2 ) { bfill( bptr, row, area.col + 1, attr, ' ', area.width - 2 ); } bpixel( bptr, row, area.col + area.width - 1, attr, BOX_CHAR( box, RIGHT_LINE ) ); } bpixel( bptr, row, area.col, attr, BOX_CHAR( box, BOTTOM_LEFT ) ); if( area.width > 2 ) bfill( bptr, row, area.col + 1, attr, BOX_CHAR( box, BOTTOM_LINE ), area.width - 2 ); bpixel( bptr, row, area.col + area.width - 1, attr, BOX_CHAR( box, BOTTOM_RIGHT ) ); physupdate( &area ); }
void intern drawbox( BUFFER *bptr, SAREA area, char *box, ATTR attr, int fill ) /************************************/ { register ORD row; bpixel( bptr, area.row, area.col, attr, box[ 0 ] ); bfill( bptr, area.row, area.col + 1, attr, box[ 4 ], area.width - 2 ); bpixel( bptr, area.row, area.col + area.width - 1, attr, box[ 1 ] ); for( row = area.row + 1 ; row < area.row + area.height - 1 ; ++row ) { bpixel( bptr, row, area.col, attr, box[ 7 ] ); if( fill ) { bfill( bptr, row, area.col + 1, attr, ' ', area.width - 2 ); } bpixel( bptr, row, area.col + area.width - 1, attr, box[ 5 ] ); } bpixel( bptr, row, area.col, attr, box[ 3 ] ); bfill( bptr, row, area.col + 1, attr, box[ 6 ], area.width - 2 ); bpixel( bptr, row, area.col + area.width - 1, attr, box[ 2 ] ); physupdate( &area ); }