4 #include "goomconfig.h"
6 #define DRAWMETHOD_NORMAL(adr,col) {*(adr) = (col);}
11 #define DRAWMETHOD_PLUS(_out,_backbuf,_col) \
13 movd_m2r (_backbuf, mm0); \
14 paddusb_m2r (_col, mm0); \
15 movd_r2m (mm0, _out); \
19 #define DRAWMETHOD_PLUS(_out,_backbuf,_col) \
22 unsigned char *bra = (unsigned char*)&(_backbuf);\
23 unsigned char *dra = (unsigned char*)&(_out);\
24 unsigned char *cra = (unsigned char*)&(_col);\
28 if (tra>255) tra=255;\
35 #define DRAWMETHOD_OR(adr,col) {*(adr)|=(col);}
38 #define DRAWMETHOD_DONE() {__asm__ __volatile__ ("emms");}
40 #define DRAWMETHOD_DONE() {}
44 #define DRAWMETHOD DRAWMETHOD_PLUS(*p,*p,col)
46 static void draw_line (
int *
data,
int x1,
int y1,
int x2,
int y2,
int col,
int screenx,
int screeny) {
47 int x,
y, dx, dy, yy, xx;
51 if ((y1 < 0) || (y2 < 0) || (x1 < 0) || (x2 < 0) || (y1 >= screeny) || (y2 >= screeny) || (x1 >= screenx) || (x2 >= screenx))
72 p = &(data[(screenx * y1) + x1]);
73 for (y = y1; y <= y2; y++) {
79 p = &(data[(screenx * y2) + x1]);
80 for (y = y2; y <= y1; y++) {
90 p = &(data[(screenx * y1) + x1]);
91 for (x = x1; x <=
x2; x++) {
98 p = &(data[(screenx * y1) + x2]);
99 for (x = x2; x <=
x1; x++) {
112 dx = ((dx << 16) / dy);
114 for (y = y1; y <= y2; y++) {
116 p = &(data[(screenx *
y) + xx]);
118 if (xx < (screenx - 1)) {
127 dy = ((dy << 16) / dx);
129 for (x = x1; x <=
x2; x++) {
131 p = &(data[(screenx * yy) + x]);
133 if (yy < (screeny - 1)) {
146 dx = ((dx << 16) / -dy);
148 for (y = y1; y >= y2; y--) {
150 p = &(data[(screenx *
y) + xx]);
152 if (xx < (screenx - 1)) {
161 dy = ((dy << 16) / dx);
163 for (x = x1; x <=
x2; x++) {
165 p = &(data[(screenx * yy) + x]);
167 if (yy < (screeny - 1)) {