/* * bar — залитый прямоугольник (left,top)-(right,bottom) включительно * ТЕКУЩИМ стилем заливки (setfillstyle), без рамки — как в Turbo-C. */ #include "../_bgi.h" void bar(int left, int top, int right, int bottom) { int y, t; if (right < left) { t = left; left = right; right = t; } if (bottom < top) { t = top; top = bottom; bottom = t; } _bgi_begin(); if (_bgi_fill_pattern == EMPTY_FILL) { _gfx_rectfill256(left, top, right - left + 1, bottom - top + 1, _bgi_bg); return; } else if (_bgi_fill_pattern == SOLID_FILL || _bgi_fill_pattern == USER_FILL || _bgi_fill_pattern > CLOSE_DOT_FILL) { _gfx_rectfill256(left, top, right - left + 1, bottom - top + 1, _bgi_fill_color); return; } else { for (y = top; y <= bottom; y++) _bgi_fill_span(left, right, y); } _bgi_end(); }