12 #define OFFSET 2048.0f
15 #define START_OFFSET 2047.5625f
18 #define END_OFFSET 2048.5625f
20 #define DRAW_POINT_NREG 4
21 #define DRAW_POINT_REGLIST \
22 ((u64)GIF_REG_PRIM) << 0 | \
23 ((u64)GIF_REG_RGBAQ) << 4 | \
24 ((u64)GIF_REG_XYZ2) << 8 | \
25 ((u64)GIF_REG_NOP) << 12
57 #define DRAW_LINE_NREG 4
58 #define DRAW_LINE_REGLIST \
59 ((u64)GIF_REG_PRIM) << 0 | \
60 ((u64)GIF_REG_RGBAQ) << 4 | \
61 ((u64)GIF_REG_XYZ2) << 8 | \
62 ((u64)GIF_REG_XYZ2) << 12
82 #define DRAW_TRIANGLE_OUT_NREG 6
83 #define DRAW_TRIANGLE_OUT_REGLIST \
84 ((u64)GIF_REG_PRIM) << 0 | \
85 ((u64)GIF_REG_RGBAQ) << 4 | \
86 ((u64)GIF_REG_XYZ2) << 8 | \
87 ((u64)GIF_REG_XYZ2) << 12 | \
88 ((u64)GIF_REG_XYZ2) << 16 | \
89 ((u64)GIF_REG_XYZ2) << 20
117 #define DRAW_TRIANGLE_NREG 6
118 #define DRAW_TRIANGLE_REGLIST \
119 ((u64)GIF_REG_PRIM) << 0 | \
120 ((u64)GIF_REG_RGBAQ) << 4 | \
121 ((u64)GIF_REG_XYZ2) << 8 | \
122 ((u64)GIF_REG_XYZ2) << 12 | \
123 ((u64)GIF_REG_XYZ2) << 16 | \
124 ((u64)GIF_REG_NOP) << 20
148 #define DRAW_RECT_OUT_NREG 8
149 #define DRAW_RECT_OUT_REGLIST \
150 ((u64)GIF_REG_PRIM) << 0 | \
151 ((u64)GIF_REG_RGBAQ) << 4 | \
152 ((u64)GIF_REG_XYZ2) << 8 | \
153 ((u64)GIF_REG_XYZ2) << 12 | \
154 ((u64)GIF_REG_XYZ2) << 16 | \
155 ((u64)GIF_REG_XYZ2) << 20 | \
156 ((u64)GIF_REG_XYZ2) << 24 | \
157 ((u64)GIF_REG_NOP) << 28
190 #define DRAW_SPRITE_NREG 4
191 #define DRAW_SPRITE_REGLIST \
192 ((u64)GIF_REG_PRIM) << 0 | \
193 ((u64)GIF_REG_RGBAQ) << 4 | \
194 ((u64)GIF_REG_XYZ2) << 8 | \
195 ((u64)GIF_REG_XYZ2) << 12
215 #define DRAW_SPRITE_TEX_NREG 6
216 #define DRAW_SPRITE_TEX_REGLIST \
217 ((u64)GIF_REG_PRIM) << 0 | \
218 ((u64)GIF_REG_RGBAQ) << 4 | \
219 ((u64)GIF_REG_UV) << 8 | \
220 ((u64)GIF_REG_XYZ2) << 12 | \
221 ((u64)GIF_REG_UV) << 16 | \
222 ((u64)GIF_REG_XYZ2) << 20
263 PACK_GIFTAG(q,
GIF_SET_PRIM(
PRIM_SPRITE,0,0,0,
blending,0,0,
context,0),
GIF_REG_PRIM);
309 float __uf0 = rect->
t0.
u;
325 PACK_GIFTAG(q,
GIF_SET_PRIM(
PRIM_SPRITE,0,
DRAW_ENABLE,0,
blending,0,
PRIM_MAP_UV,
context,0),
GIF_REG_PRIM);
354 __uf0 = rect->
t0.
u + (strip - 1.5f);
388 PACK_GIFTAG(q,
GIF_SET_PRIM(
PRIM_LINE_STRIP,0,0,0,
blending,0,0,
context,0),
GIF_REG_PRIM);
400 for( ; angle_start <= angle_end; angle_start++)
402 __arc_radians = angle_start * 0.017453293f;
403 __xi1 = (int)((cosf(__arc_radians) * radius) * 16.0f);
404 __yi1 = (int)((sinf(__arc_radians) * radius) * 16.0f);
443 PACK_GIFTAG(q,
GIF_SET_PRIM(
PRIM_TRIANGLE_FAN,0,0,0,
blending,0,0,
context,0),
GIF_REG_PRIM);
457 for( ; angle_start <= angle_end; angle_start++)
459 __arc_radians = 0.017453293f * angle_start;
460 __xi1 = (int)((cosf(__arc_radians) * radius) * 16.0f);
461 __yi1 = (int)((sinf(__arc_radians) * radius) * 16.0f);
492 float corner_size = 15.0f;
494 int width = rect->
v1.
x - rect->
v0.
x;
495 int height = rect->
v1.
y - rect->
v0.
y;
497 center_width = width - (int)(2.0f*corner_size);
498 center_height = height - (int)(2.0f*corner_size);
502 rect_center.
v0.
z = rect->
v0.
z;
503 rect_side.
v0.
z = rect->
v0.
z;
506 rect_center.
v0.
x = rect->
v0.
x + corner_size;
507 rect_center.
v0.
y = rect->
v0.
y + corner_size;
508 rect_center.
v1.
x = rect_center.
v0.
x + (float)center_width;
509 rect_center.
v1.
y = rect_center.
v0.
y + (float)center_height;
515 rect_side.
v0.
x = rect_center.
v0.
x;
516 rect_side.
v0.
y = rect_center.
v0.
y - corner_size;
517 rect_side.
v1.
x = rect_center.
v1.
x;
518 rect_side.
v1.
y = rect_center.
v0.
y - 1.0f;
523 rect_side.
v0.
x = rect_center.
v1.
x + 1.0f;
524 rect_side.
v0.
y = rect_center.
v0.
y;
525 rect_side.
v1.
x = rect_center.
v1.
x + corner_size;
526 rect_side.
v1.
y = rect_center.
v1.
y;
531 rect_side.
v0.
x = rect_center.
v0.
x;
532 rect_side.
v0.
y = rect_center.
v1.
y + 1.0f;
533 rect_side.
v1.
x = rect_center.
v1.
x;
534 rect_side.
v1.
y = rect_center.
v1.
y + corner_size;
539 rect_side.
v0.
x = rect_center.
v0.
x - corner_size;
540 rect_side.
v0.
y = rect_center.
v0.
y;
541 rect_side.
v1.
x = rect_center.
v0.
x - 1.0f;
542 rect_side.
v1.
y = rect_center.
v1.
y;
548 point_corner.
v0.
x = rect_center.
v1.
x + 1.0f;
549 point_corner.
v0.
y = rect_center.
v0.
y;
555 point_corner.
v0.
x = rect_center.
v1.
x + 1.0f;
556 point_corner.
v0.
y = rect_center.
v1.
y + 1.0f;
562 point_corner.
v0.
x = rect_center.
v0.
x;
563 point_corner.
v0.
y = rect_center.
v1.
y + 1.0f;
569 point_corner.
v0.
x = rect_center.
v0.
x;
570 point_corner.
v0.
y = rect_center.
v0.
y;
589 float corner_size = 15.0f;
591 int width = rect->
v1.
x - rect->
v0.
x;
592 int height = rect->
v1.
y - rect->
v0.
y;
594 center_width = width - (int)(2.0f*corner_size);
595 center_height = height - (int)(2.0f*corner_size);
599 rect_center.
v0.
z = rect->
v0.
z;
600 line_side.
v0.
z = rect->
v0.
z;
603 rect_center.
v0.
x = rect->
v0.
x + corner_size;
604 rect_center.
v0.
y = rect->
v0.
y + corner_size;
605 rect_center.
v1.
x = rect_center.
v0.
x + (float)center_width;
606 rect_center.
v1.
y = rect_center.
v0.
y + (float)center_height;
612 line_side.
v0.
x = rect_center.
v0.
x;
613 line_side.
v0.
y = rect_center.
v0.
y - corner_size + 1.0f;
614 line_side.
v1.
x = rect_center.
v1.
x;
615 line_side.
v1.
y = rect_center.
v0.
y - corner_size;
620 line_side.
v0.
x = rect_center.
v1.
x + corner_size;
621 line_side.
v0.
y = rect_center.
v0.
y;
622 line_side.
v1.
x = rect_center.
v1.
x + corner_size - 1.0f;
623 line_side.
v1.
y = rect_center.
v1.
y;
628 line_side.
v0.
x = rect_center.
v0.
x;
629 line_side.
v0.
y = rect_center.
v1.
y + corner_size + 1.0f;
630 line_side.
v1.
x = rect_center.
v1.
x;
631 line_side.
v1.
y = rect_center.
v1.
y + corner_size;
636 line_side.
v0.
x = rect_center.
v0.
x - corner_size;
637 line_side.
v0.
y = rect_center.
v0.
y;
638 line_side.
v1.
x = rect_center.
v0.
x - corner_size - 1.0f;
639 line_side.
v1.
y = rect_center.
v1.
y;
645 point_corner.
v0.
x = rect_center.
v1.
x;
646 point_corner.
v0.
y = rect_center.
v0.
y;
652 point_corner.
v0.
x = rect_center.
v1.
x;
653 point_corner.
v0.
y = rect_center.
v1.
y;
659 point_corner.
v0.
x = rect_center.
v0.
x;
660 point_corner.
v0.
y = rect_center.
v1.
y;
666 point_corner.
v0.
x = rect_center.
v0.
x;
667 point_corner.
v0.
y = rect_center.
v0.
y;
qword_t * draw_line(qword_t *q, int context, line_t *line)
#define DRAW_RECT_OUT_NREG
qword_t * draw_rect_textured(qword_t *q, int context, texrect_t *rect)
qword_t * draw_rect_filled(qword_t *q, int context, rect_t *rect)
#define DRAW_RECT_OUT_REGLIST
qword_t * draw_arc_filled(qword_t *q, int context, point_t *center, float radius, float angle_start, float angle_end)
#define DRAW_LINE_REGLIST
qword_t * draw_round_rect_outline(qword_t *q, int context, rect_t *rect)
qword_t * draw_triangle_outline(qword_t *q, int context, triangle_t *triangle)
qword_t * draw_point(qword_t *q, int context, point_t *point)
#define DRAW_TRIANGLE_REGLIST
#define DRAW_TRIANGLE_NREG
#define DRAW_SPRITE_TEX_NREG
qword_t * draw_triangle_filled(qword_t *q, int context, triangle_t *triangle)
#define DRAW_TRIANGLE_OUT_NREG
qword_t * draw_arc_outline(qword_t *q, int context, point_t *center, float radius, float angle_start, float angle_end)
qword_t * draw_rect_outline(qword_t *q, int context, rect_t *rect)
qword_t * draw_rect_filled_strips(qword_t *q, int context, rect_t *rect)
qword_t * draw_round_rect_filled(qword_t *q, int context, rect_t *rect)
void draw_enable_blending()
#define DRAW_POINT_REGLIST
#define DRAW_TRIANGLE_OUT_REGLIST
#define DRAW_SPRITE_TEX_REGLIST
void draw_disable_blending()
#define DRAW_SPRITE_REGLIST
qword_t * draw_rect_textured_strips(qword_t *q, int context, texrect_t *rect)
#define PRIM_TRIANGLE_FAN