52636a5d6e
Графика вынесена из libc/ в новую библиотеку libbgi/:
- common/ — mode-agnostic математика и состояние (один исходник,
.rel попадает в оба driver-архива);
- bgi256/ + bgi16/ — mode-specific leaf'ы (raw-плот/чтение/спаны);
- include/ — graphics.h + gfx.h; _bgi.h — внутренний заголовок.
Собираются lib/bgi256.lib (и bgi16.lib в Фазе 2); выбор режима
линковкой через sprinter-cc --gfx 256|16. libc/ теперь без графики.
tests/bgi_img — тест спрайтов getimage/putimage/imagesize (5 операций
COPY/XOR/OR/AND/NOT + XOR-round-trip + self-check imagesize).
Проверен автотестом в MAME.
Примечание: make size-check пока красный (gfx_dbuf/gfx_demo выросли
после реорга) — закрыть по завершении миграции libbgi.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
28 lines
1.1 KiB
C
28 lines
1.1 KiB
C
/*
|
|
* 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);
|
|
}
|
|
}
|
|
}
|