Changeset 1174
 Timestamp:
 Oct 1, 2006, 2:23:30 PM (14 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

libcaca/trunk/cucul/triangle.c
r1173 r1174 106 106 107 107 /* Compute slopes and promote precision */ 108 sl21 = (y2 == y1) ? 0 : (x2  x1) * 0x1000 / (y2  y1);109 sl31 = (y3 == y1) ? 0 : (x3  x1) * 0x1000 / (y3  y1);110 sl32 = (y3 == y2) ? 0 : (x3  x2) * 0x1000 / (y3  y2);108 sl21 = (y2 == y1) ? 0 : (x2  x1) * 0x10000 / (y2  y1); 109 sl31 = (y3 == y1) ? 0 : (x3  x1) * 0x10000 / (y3  y1); 110 sl32 = (y3 == y2) ? 0 : (x3  x2) * 0x10000 / (y3  y2); 111 111 112 x1 *= 0x1000 ;113 x2 *= 0x1000 ;114 x3 *= 0x1000 ;112 x1 *= 0x10000; 113 x2 *= 0x10000; 114 x3 *= 0x10000; 115 115 116 116 ymin = y1 < 0 ? 0 : y1; … … 139 139 if(xa < xb) 140 140 { 141 xx1 = (xa + 0x800) / 0x1000 ;142 xx2 = (xb + 0x801) / 0x1000 ;141 xx1 = (xa + 0x800) / 0x10000; 142 xx2 = (xb + 0x801) / 0x10000; 143 143 } 144 144 else 145 145 { 146 xx1 = (xb + 0x800) / 0x1000 ;147 xx2 = (xa + 0x801) / 0x1000 ;146 xx1 = (xb + 0x800) / 0x10000; 147 xx2 = (xa + 0x801) / 0x10000; 148 148 } 149 149
Note: See TracChangeset
for help on using the changeset viewer.