Search
lxdream.org :: lxdream :: r801:92b518a2e915
lxdream 0.9.1
released Jun 29
Download Now
changeset801:92b518a2e915
parent800:0d1be79c9b33
child802:d894188b503d
authornkeynes
dateThu Aug 07 23:32:34 2008 +0000 (15 years ago)
Unroll first iteration of the bounding loop in ta_commit_polygon - more to
remove the compiler warnings than for performance really.
src/pvr2/tacore.c
1.1 --- a/src/pvr2/tacore.c Mon Aug 04 06:00:11 2008 +0000
1.2 +++ b/src/pvr2/tacore.c Thu Aug 07 23:32:34 2008 +0000
1.3 @@ -525,22 +525,24 @@
1.4 * as the overall polygon.
1.5 */
1.6
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.38
1.39 /* Clamp the polygon bounds to the frustum */
.