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:
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* bar3d — трёхмерный брусок: передняя грань залита текущим стилем
|
||||
* заливки, рёбра — текущим цветом рисования. depth — глубина (вправо-
|
||||
* вверх), topflag != 0 рисует верхнюю грань.
|
||||
*/
|
||||
#include "_bgi.h"
|
||||
|
||||
void bar3d(int left, int top, int right, int bottom, int depth, int topflag)
|
||||
{
|
||||
int t;
|
||||
|
||||
if (right < left) { t = left; left = right; right = t; }
|
||||
if (bottom < top) { t = top; top = bottom; bottom = t; }
|
||||
|
||||
bar(left, top, right, bottom); /* передняя грань — заливка */
|
||||
rectangle(left, top, right, bottom); /* рамка переда — тек. цвет */
|
||||
|
||||
if (depth != 0) {
|
||||
line(right, top, right + depth, top - depth);
|
||||
line(right, bottom, right + depth, bottom - depth);
|
||||
line(right + depth, top - depth, right + depth, bottom - depth);
|
||||
if (topflag) {
|
||||
line(left, top, left + depth, top - depth);
|
||||
line(left + depth, top - depth, right + depth, top - depth);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user