42 PACK_GIFTAG(q,GIF_SET_TAG(1,0,0,0,
GIF_FLG_REGLIST,DRAW_POINT_NREG),DRAW_POINT_REGLIST);
45 q->dw[0] = GIF_SET_PRIM(
PRIM_POINT,0,0,0,blending,0,0,context,0);
46 q->dw[1] = point->color.rgbaq;
49 q->dw[0] = GIF_SET_XYZ(ftoi4(point->v0.x + OFFSET),ftoi4(point->v0.y + OFFSET),point->v0.z);
67 PACK_GIFTAG(q,GIF_SET_TAG(1,0,0,0,
GIF_FLG_REGLIST,DRAW_LINE_NREG),DRAW_LINE_REGLIST);
70 q->dw[0] = GIF_SET_PRIM(PRIM_LINE,0,0,0,blending,0,0,context,0);
71 q->dw[1] = line->color.rgbaq;
74 q->dw[0] = GIF_SET_XYZ(ftoi4(line->v0.x + START_OFFSET),ftoi4(line->v0.y + START_OFFSET),line->v0.z);
75 q->dw[1] = GIF_SET_XYZ(ftoi4(line->v1.x + END_OFFSET),ftoi4(line->v1.y + END_OFFSET),line->v0.z);
94 int __xi0 = ftoi4(triangle->v0.x + OFFSET);
95 int __yi0 = ftoi4(triangle->v0.y + OFFSET);
97 PACK_GIFTAG(q,GIF_SET_TAG(1,0,0,0,
GIF_FLG_REGLIST,DRAW_TRIANGLE_OUT_NREG),DRAW_TRIANGLE_OUT_REGLIST);
100 q->dw[0] = GIF_SET_PRIM(PRIM_LINE_STRIP,0,0,0,blending,0,0,context,0);
101 q->dw[1] = triangle->color.rgbaq;
104 q->dw[0] = GIF_SET_XYZ(__xi0,__yi0,triangle->v0.z);
105 q->dw[1] = GIF_SET_XYZ(ftoi4(triangle->v1.x + OFFSET),ftoi4(triangle->v1.y + OFFSET),triangle->v0.z);
108 q->dw[0] = GIF_SET_XYZ(ftoi4(triangle->v2.x + OFFSET),ftoi4(triangle->v2.y + OFFSET),triangle->v0.z);
109 q->dw[1] = GIF_SET_XYZ(__xi0,__yi0,triangle->v0.z);
129 PACK_GIFTAG(q,GIF_SET_TAG(1,0,0,0,
GIF_FLG_REGLIST,DRAW_TRIANGLE_NREG),DRAW_TRIANGLE_REGLIST);
132 q->dw[0] = GIF_SET_PRIM(PRIM_TRIANGLE,0,0,0,blending,0,0,context,0);
133 q->dw[1] = triangle->color.rgbaq;
136 q->dw[0] = GIF_SET_XYZ(ftoi4(triangle->v0.x + OFFSET),ftoi4(triangle->v0.y + OFFSET),triangle->v0.z);
137 q->dw[1] = GIF_SET_XYZ(ftoi4(triangle->v1.x + OFFSET ),ftoi4(triangle->v1.y + OFFSET),triangle->v0.z);
140 q->dw[0] = GIF_SET_XYZ(ftoi4(triangle->v2.x + OFFSET),ftoi4(triangle->v2.y + OFFSET),triangle->v0.z);
162 int __xi0 = ftoi4(rect->v0.x + START_OFFSET);
163 int __yi0 = ftoi4(rect->v0.y + START_OFFSET);
164 int __xi1 = ftoi4(rect->v1.x + END_OFFSET);
165 int __yi1 = ftoi4(rect->v1.y + END_OFFSET);
167 PACK_GIFTAG(q,GIF_SET_TAG(1,0,0,0,
GIF_FLG_REGLIST,DRAW_RECT_OUT_NREG),DRAW_RECT_OUT_REGLIST);
170 q->dw[0] = GIF_SET_PRIM(PRIM_LINE_STRIP,0,0,0,blending,0,0,context,0);
171 q->dw[1] = rect->color.rgbaq;
174 q->dw[0] = GIF_SET_XYZ(__xi0,__yi0,rect->v0.z);
175 q->dw[1] = GIF_SET_XYZ(__xi1,__yi0,rect->v0.z);
178 q->dw[0] = GIF_SET_XYZ(__xi1,__yi1,rect->v0.z);
179 q->dw[1] = GIF_SET_XYZ(__xi0,__yi1,rect->v0.z);
182 q->dw[0] = GIF_SET_XYZ(__xi0,__yi0,rect->v0.z);
200 PACK_GIFTAG(q,GIF_SET_TAG(1,0,0,0,
GIF_FLG_REGLIST,DRAW_SPRITE_NREG),DRAW_SPRITE_REGLIST);
203 q->dw[0] = GIF_SET_PRIM(PRIM_SPRITE,0,0,0,blending,0,0,context,0);
204 q->dw[1] = rect->color.rgbaq;
207 q->dw[0] = GIF_SET_XYZ(ftoi4(rect->v0.x + START_OFFSET),ftoi4(rect->v0.y + START_OFFSET),rect->v0.z);
208 q->dw[1] = GIF_SET_XYZ(ftoi4(rect->v1.x + END_OFFSET),ftoi4(rect->v1.y + END_OFFSET),rect->v0.z);
228 PACK_GIFTAG(q,GIF_SET_TAG(1,0,0,0,
GIF_FLG_REGLIST,DRAW_SPRITE_TEX_NREG),DRAW_SPRITE_TEX_REGLIST);
232 q->dw[0] = GIF_SET_PRIM(PRIM_SPRITE,0,DRAW_ENABLE,0,blending,0,PRIM_MAP_UV,context,0);
233 q->dw[1] = rect->color.rgbaq;
236 q->dw[0] = GIF_SET_UV(ftoi4(rect->t0.u),ftoi4(rect->t0.v));
237 q->dw[1] = GIF_SET_XYZ(ftoi4(rect->v0.x + START_OFFSET),ftoi4(rect->v0.y + START_OFFSET),rect->v0.z);
240 q->dw[0] = GIF_SET_UV(ftoi4(rect->t1.u),ftoi4(rect->t1.v));
241 q->dw[1] = GIF_SET_XYZ(ftoi4(rect->v1.x + END_OFFSET),ftoi4(rect->v1.y + END_OFFSET),rect->v0.z);
253 int __xi0 = ftoi4(rect->v0.x);
254 int __yi0 = ftoi4(rect->v0.y + START_OFFSET);
256 int __xi1 = ftoi4(rect->v1.x);
257 int __yi1 = ftoi4(rect->v1.y + END_OFFSET);
263 PACK_GIFTAG(q,GIF_SET_PRIM(PRIM_SPRITE,0,0,0,blending,0,0,context,0),
GIF_REG_PRIM);
277 q->dw[0] = GIF_SET_XYZ(__xi0 + ftoi4(START_OFFSET),__yi0,rect->v0.z);
288 q->dw[1] = GIF_SET_XYZ(__xi0 + ftoi4(END_OFFSET),__yi1,rect->v0.z);
309 float __uf0 = rect->t0.u;
310 int __vi0 = ftoi4(rect->t0.v);
311 int __vi1 = ftoi4(rect->t1.v);
314 int __xi0 = ftoi4(rect->v0.x);
315 int __yi0 = ftoi4(rect->v0.y + START_OFFSET);
317 int __xi1 = ftoi4(rect->v1.x);
318 int __yi1 = ftoi4(rect->v1.y + END_OFFSET);
325 PACK_GIFTAG(q,GIF_SET_PRIM(PRIM_SPRITE,0,DRAW_ENABLE,0,blending,0,PRIM_MAP_UV,context,0),
GIF_REG_PRIM);
338 q->dw[0] = GIF_SET_UV(ftoi4(__uf0),__vi0);
339 q->dw[1] = GIF_SET_XYZ(__xi0 + ftoi4(START_OFFSET),__yi0,rect->v0.z);
354 __uf0 = rect->t0.u + (strip - 1.5f);
356 q->dw[0] = GIF_SET_UV(ftoi4(__uf0),__vi1);
357 q->dw[1] = GIF_SET_XYZ(__xi0 + ftoi4(END_OFFSET),__yi1,rect->v0.z);
364 PACK_GIFTAG(giftag,GIF_SET_TAG(q-giftag-1,0,0,0,
GIF_FLG_REGLIST,2),DRAW_UV_REGLIST);
378 int __xi0 = ftoi4(center->v0.x + OFFSET);
379 int __yi0 = ftoi4(center->v0.y + OFFSET);
385 PACK_GIFTAG(q,GIF_SET_PRIM(PRIM_LINE_STRIP,0,0,0,blending,0,0,context,0),
GIF_REG_PRIM);
397 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);
405 *dw++ = GIF_SET_XYZ(__xi0 + __xi1,__yi0 + __yi1,center->v0.z);
433 int __xi0 = ftoi4(center->v0.x + OFFSET);
434 int __yi0 = ftoi4(center->v0.y + OFFSET);
440 PACK_GIFTAG(q,GIF_SET_PRIM(PRIM_TRIANGLE_FAN,0,0,0,blending,0,0,context,0),
GIF_REG_PRIM);
452 *dw++ = GIF_SET_XYZ(__xi0,__yi0,center->v0.z);
454 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);
462 *dw++ = GIF_SET_XYZ(__xi0 + __xi1,__yi0 + __yi1,center->v0.z);
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);
500 rect_center.color = rect->color;
501 rect_side.color = rect->color;
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;
550 point_corner.color = rect->color;
552 q =
draw_arc_filled(q,context,&point_corner,corner_size,270.0f,360.0f);
555 point_corner.v0.x = rect_center.v1.x + 1.0f;
556 point_corner.v0.y = rect_center.v1.y + 1.0f;
557 point_corner.color = rect->color;
562 point_corner.v0.x = rect_center.v0.x;
563 point_corner.v0.y = rect_center.v1.y + 1.0f;
564 point_corner.color = rect->color;
569 point_corner.v0.x = rect_center.v0.x;
570 point_corner.v0.y = rect_center.v0.y;
571 point_corner.color = rect->color;
573 q =
draw_arc_filled(q,context,&point_corner,corner_size,180.0f,270.0f);
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);
597 rect_center.color = rect->color;
598 line_side.color = rect->color;
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;
647 point_corner.color = rect->color;
652 point_corner.v0.x = rect_center.v1.x;
653 point_corner.v0.y = rect_center.v1.y;
654 point_corner.color = rect->color;
659 point_corner.v0.x = rect_center.v0.x;
660 point_corner.v0.y = rect_center.v1.y;
661 point_corner.color = rect->color;
666 point_corner.v0.x = rect_center.v0.x;
667 point_corner.v0.y = rect_center.v0.y;
668 point_corner.color = rect->color;