Search
lxdream.org :: lxdream/src/pvr2/rendsort.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/rendsort.c
changeset 635:76c63aac3590
prev561:533f6b478071
next645:a7392098299c
author nkeynes
date Thu Feb 14 13:54:11 2008 +0000 (13 years ago)
branchlxdream-render
permissions -rw-r--r--
last change Commit render work in progress. Main changes:
* Preliminary OSMesa support
* Move the generic gl code out to pvr2/
* Implement scene data structure + reader
* Remove the 1/z adjustments
file annotate diff log raw
1.1 --- a/src/pvr2/rendsort.c Tue Jan 01 05:08:38 2008 +0000
1.2 +++ b/src/pvr2/rendsort.c Thu Feb 14 13:54:11 2008 +0000
1.3 @@ -72,9 +72,9 @@
1.4 triangle[i].maxx = MAX3(triangle[i].vertexes[0][0],triangle[i].vertexes[1][0],triangle[i].vertexes[2][0]);
1.5 triangle[i].miny = MIN3(triangle[i].vertexes[0][1],triangle[i].vertexes[1][1],triangle[i].vertexes[2][1]);
1.6 triangle[i].maxy = MAX3(triangle[i].vertexes[0][1],triangle[i].vertexes[1][1],triangle[i].vertexes[2][1]);
1.7 - float az = 1/triangle[i].vertexes[0][2];
1.8 - float bz = 1/triangle[i].vertexes[1][2];
1.9 - float cz = 1/triangle[i].vertexes[2][2];
1.10 + float az = triangle[i].vertexes[0][2];
1.11 + float bz = triangle[i].vertexes[1][2];
1.12 + float cz = triangle[i].vertexes[2][2];
1.13 triangle[i].minz = MIN3(az,bz,cz);
1.14 triangle[i].maxz = MAX3(az,bz,cz);
1.15 }
1.16 @@ -198,9 +198,9 @@
1.17 {
1.18 const struct render_triangle *tri1 = a;
1.19 const struct render_triangle *tri2 = b;
1.20 - if( tri1->minz < tri2->minz ) {
1.21 - return 1; // No these _aren't_ back to front...
1.22 - } else if( tri1->minz > tri2->minz ) {
1.23 + if( tri1->minz > tri2->minz ) {
1.24 + return 1;
1.25 + } else if( tri1->minz < tri2->minz ) {
1.26 return -1;
1.27 } else {
1.28 return 0;
.