spu_tri.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

boolean tri_draw (const float *v0, const float *v1, const float *v2, uint tx, uint ty)
 Draw triangle into tile at (tx, ty) (tile coords) The tile data should have already been fetched.


Function Documentation

boolean tri_draw ( const float *  v0,
const float *  v1,
const float *  v2,
uint  tx,
uint  ty 
)

Draw triangle into tile at (tx, ty) (tile coords) The tile data should have already been fetched.

Definition at line 900 of file spu_tri.c.

00906 {
00907    setup.tx = tx;
00908    setup.ty = ty;
00909 
00910    /* set clipping bounds to tile bounds */
00911    setup.cliprect_minx = tx * TILE_SIZE;
00912    setup.cliprect_miny = ty * TILE_SIZE;
00913    setup.cliprect_maxx = (tx + 1) * TILE_SIZE;
00914    setup.cliprect_maxy = (ty + 1) * TILE_SIZE;
00915 
00916    if (!setup_sort_vertices((struct vertex_header *) v0,
00917                             (struct vertex_header *) v1,
00918                             (struct vertex_header *) v2)) {
00919       return FALSE; /* totally clipped */
00920    }
00921 
00922    setup_tri_coefficients();
00923    setup_tri_edges();
00924 
00925    setup.span.y = 0;
00926    setup.span.y_flags = 0;
00927    setup.span.right[0] = 0;
00928    setup.span.right[1] = 0;
00929    /*   setup.span.z_mode = tri_z_mode( setup.ctx ); */
00930 
00931    /*   init_constant_attribs( setup ); */
00932       
00933    if (setup.oneoverarea < 0.0) {
00934       /* emaj on left:
00935        */
00936       subtriangle( &setup.emaj, &setup.ebot, setup.ebot.lines );
00937       subtriangle( &setup.emaj, &setup.etop, setup.etop.lines );
00938    }
00939    else {
00940       /* emaj on right:
00941        */
00942       subtriangle( &setup.ebot, &setup.emaj, setup.ebot.lines );
00943       subtriangle( &setup.etop, &setup.emaj, setup.etop.lines );
00944    }


Generated on Tue Sep 29 06:25:33 2009 for Gallium3D by  doxygen 1.5.4