diff options
author | Brian <[email protected]> | 2007-07-10 14:36:10 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-07-10 14:36:10 -0600 |
commit | 6aa9c8ebc19ffa4425669862caeb99b22c079090 (patch) | |
tree | 83c2a64019c8d8cb7fa423d4f671bef3b10dd03e /src | |
parent | 1deafdb1dec24c2920ab92098f1433273b2ccbdd (diff) |
remove unneeded casts, added comments
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/pipe/draw/draw_cull.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mesa/pipe/draw/draw_cull.c b/src/mesa/pipe/draw/draw_cull.c index e7343cfd765..b6c578b3c94 100644 --- a/src/mesa/pipe/draw/draw_cull.c +++ b/src/mesa/pipe/draw/draw_cull.c @@ -64,19 +64,19 @@ static void cull_tri( struct prim_stage *stage, struct prim_header *header ) { /* Window coords: */ - GLfloat *v0 = (GLfloat *)&(header->v[0]->data[0]); - GLfloat *v1 = (GLfloat *)&(header->v[1]->data[0]); - GLfloat *v2 = (GLfloat *)&(header->v[2]->data[0]); + const GLfloat *v0 = header->v[0]->data[0]; + const GLfloat *v1 = header->v[1]->data[0]; + const GLfloat *v2 = header->v[2]->data[0]; + /* edge vectors e = v0 - v2, f = v1 - v2 */ GLfloat ex = v0[0] - v2[0]; GLfloat ey = v0[1] - v2[1]; GLfloat fx = v1[0] - v2[0]; GLfloat fy = v1[1] - v2[1]; + /* det = cross(e,f).z */ header->det = ex * fy - ey * fx; - _mesa_printf("%s %f\n", __FUNCTION__, header->det ); - if (header->det != 0) { /* non-zero area */ GLuint mode = (header->det < 0) ? PIPE_WINDING_CW : PIPE_WINDING_CCW; |