filename | src/pvr2/tacore.c |
changeset | 801:92b518a2e915 |
prev | 753:1fe39c3a9bbc |
next | 931:430048ea8b71 |
next | 953:f4a156508ad1 |
author | nkeynes |
date | Thu Aug 07 23:32:34 2008 +0000 (15 years ago) |
permissions | -rw-r--r-- |
last change | Unroll first iteration of the bounding loop in ta_commit_polygon - more to remove the compiler warnings than for performance really. |
file | annotate | diff | log | raw |
1.1 --- a/src/pvr2/tacore.c Sun Jul 20 11:36:48 2008 +00001.2 +++ b/src/pvr2/tacore.c Thu Aug 07 23:32:34 2008 +00001.3 @@ -525,22 +525,24 @@1.4 * as the overall polygon.1.5 */1.7 - for( i=0; i<ta_status.vertex_count-2; i++ ) {1.8 + triangle_bound[0].x1 = MIN3(tx[0],tx[1],tx[2]);1.9 + triangle_bound[0].x2 = MAX3(tx[0],tx[1],tx[2]);1.10 + triangle_bound[0].y1 = MIN3(ty[0],ty[1],ty[2]);1.11 + triangle_bound[0].y2 = MAX3(ty[0],ty[1],ty[2]);1.12 + polygon_bound.x1 = triangle_bound[0].x1;1.13 + polygon_bound.y1 = triangle_bound[0].y1;1.14 + polygon_bound.x2 = triangle_bound[0].x2;1.15 + polygon_bound.y2 = triangle_bound[0].y2;1.16 +1.17 + for( i=1; i<ta_status.vertex_count-2; i++ ) {1.18 triangle_bound[i].x1 = MIN3(tx[i],tx[i+1],tx[i+2]);1.19 triangle_bound[i].x2 = MAX3(tx[i],tx[i+1],tx[i+2]);1.20 triangle_bound[i].y1 = MIN3(ty[i],ty[i+1],ty[i+2]);1.21 triangle_bound[i].y2 = MAX3(ty[i],ty[i+1],ty[i+2]);1.22 - if( i == 0 ) {1.23 - polygon_bound.x1 = triangle_bound[0].x1;1.24 - polygon_bound.y1 = triangle_bound[0].y1;1.25 - polygon_bound.x2 = triangle_bound[0].x2;1.26 - polygon_bound.y2 = triangle_bound[0].y2;1.27 - } else {1.28 - polygon_bound.x1 = MIN(polygon_bound.x1, triangle_bound[i].x1);1.29 - polygon_bound.x2 = MAX(polygon_bound.x2, triangle_bound[i].x2);1.30 - polygon_bound.y1 = MIN(polygon_bound.y1, triangle_bound[i].y1);1.31 - polygon_bound.y2 = MAX(polygon_bound.y2, triangle_bound[i].y2);1.32 - }1.33 + polygon_bound.x1 = MIN(polygon_bound.x1, triangle_bound[i].x1);1.34 + polygon_bound.x2 = MAX(polygon_bound.x2, triangle_bound[i].x2);1.35 + polygon_bound.y1 = MIN(polygon_bound.y1, triangle_bound[i].y1);1.36 + polygon_bound.y2 = MAX(polygon_bound.y2, triangle_bound[i].y2);1.37 }1.39 /* Clamp the polygon bounds to the frustum */
.