libc: BGI Фаза 2b — заливки (setfillstyle/bar/bar3d/fillpoly/fillellipse)

setfillstyle/getfillsettings + 10 стандартных 8×8 паттернов Borland.
bar теперь честно учитывает стиль заливки; bar3d (3D-брусок), fillpoly
(scanline min/max по строкам через брезенхэмовский проход рёбер),
fillellipse (полуширина строки через целочисленный _bgi_isqrt — без
32-бит). Общий _bgi_fill_span (SOLID/EMPTY/паттерн) с клипом, поверх
raw-hline в одной W3-скобке. Проверено в MAME (tests/bgitest): solid/
hatch бары, bar3d со slash, синий fillellipse, xhatch-треугольник.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-08 15:58:06 +03:00
parent 5a48f7fafb
commit ecb419efda
17 changed files with 350 additions and 47 deletions
+11 -8
View File
@@ -1,15 +1,18 @@
/*
* bar — залитый прямоугольник (left,top)-(right,bottom) включительно.
*
* В Turbo-C цвет/паттерн заливки задаётся setfillstyle; пока (Фаза 1)
* заливаем текущим цветом рисования сплошняком.
* bar — залитый прямоугольник (left,top)-(right,bottom) включительно
* ТЕКУЩИМ стилем заливки (setfillstyle), без рамки — как в Turbo-C.
*/
#include "_bgi.h"
void bar(int left, int top, int right, int bottom)
{
int w = right - left + 1;
int h = bottom - top + 1;
if (w <= 0 || h <= 0) return;
_bgi_fillrect(left, top, w, h, _bgi_fg);
int y, t;
if (right < left) { t = left; left = right; right = t; }
if (bottom < top) { t = top; top = bottom; bottom = t; }
_bgi_begin();
for (y = top; y <= bottom; y++)
_bgi_fill_span(left, right, y);
_bgi_end();
}