Code: Select all
POLY_F4 pf4;
void DrawSolidTri(short x1, short y1, short x2, short y2, short x3, short y3, int r, int g, int b, int ot)
{
// draw a solid triangle and fill it with rgb colour
// EG: DrawSolidTri(200,0, 170,30, 230,30, 255,0,255, 0);
// check the Psy-Q documentation for the coordinates!
SetPolyF3(&pf3); // initialise the primitive
setRGB0(&pf3, r, g, b); // set the fill colour (RGB)
setXY3(&pf3, x1,y1, x2,y2, x3,y3); // draw 3 lines (3 sets of x/y co-ords)
DrawPrim(&pf3); // copy shape to frame buffer
//DrawPrim(&pf3); // copy shape to frame buffer
GsSortPoly(&pf3, &WorldOrderingTable1[CurrentBuffer], ot); // put the polygon into the order table
}
void DrawTransTri(short x1, short y1, short x2, short y2, short x3, short y3, int r, int g, int b, int ot)
{
// draw a transparent triangle
// the transparency 'colour' is calculated from the fgnd & bgns pixels.
// EG: DrawTransTri(50,0, 70,60, 130,60, 255,0,255, 0);
SetPolyF3(&pf3); // initialize primitive
setRGB0(&pf3, r, g, b); // set the foreground fill colour
setSemiTrans(&pf3, 1); // semi-transparency; 0=off; 1=on
setXY3(&pf3, x1,y1, x2,y2, x3,y3); // draw 4 lines (4 sets of x/y co-ords)
//DrawPrim(&pf3); // copy shape to frame buffer
GsSortPoly(&pf3, &WorldOrderingTable1[CurrentBuffer], ot); // put the polygon into the order table
}