1 static __inline__ int IS_INF_OR_NAN(float x)
11 static void simple_textured_triangle(float **v1)
35 if (v1[0][1] <= v2[0][1]) {
42 vMid[4][0] ? ((vMid[4][0] * (float)2048) +
43 0.5F) : ((vMid[4][0] * (float)2048) - 0.5F);
44 eMaj.dx = (vMax_fx - vMin_fx) * (1.0F / (float)2048);
45 eMaj.dy = (vMax_fy - vMin_fy) * (1.0F / (float)2048);
46 eTop.dx = (vMax_fx - vMid_fx) * (1.0F / (float)2048);
47 eBot.dy = (vMid_fy - vMin_fy) * (1.0F / (float)2048);
48 float area = eMaj.dx * eBot.dy - eBot.dx * eMaj.dy;
49 if (IS_INF_OR_NAN(area))
51 oneOverArea = 1.0F / area;
53 int scan_from_left_to_right;
54 float eMaj_ds = (vMax[4][0] - vMin[4][0]);
56 float stepx = oneOverArea * (eMaj_ds * eBot.dy - eMaj.dy * eBot_ds);
57 int step = (stepx >= 0.0F) ? stepx : (stepx * (float)2048) - 0.5F;
60 for (subTriangle = 0; subTriangle <= 1; subTriangle++) {
63 if (subTriangle == 0) {
64 if (scan_from_left_to_right) {
66 lines = eRight->lines;
71 if (scan_from_left_to_right) {
74 fxRightEdge = eRight->fsx;
84 end = fxRightEdge - x;
85 if (end > 0 && y >= 0) {
88 for (i = 0; i < end; i++) {
102 return simple_textured_triangle;