]> git.lizzy.rs Git - irrlicht.git/blobdiff - source/Irrlicht/CTRTextureGouraudAddNoZ2.cpp
Merging r6145 through r6171 from trunk to ogl-es branch
[irrlicht.git] / source / Irrlicht / CTRTextureGouraudAddNoZ2.cpp
index 4a619530a5b705ece8d8d27e9a90cad402c58c54..0a880debdf102b95a7f88b2002b1121883ce75d0 100644 (file)
@@ -143,7 +143,7 @@ void CTRTextureGouraudAddNoZ2::fragmentShader()
                return;\r
 \r
        // slopes\r
-       const f32 invDeltaX = reciprocal_zero2( line.x[1] - line.x[0] );\r
+       const f32 invDeltaX = fill_step_x( line.x[1] - line.x[0] );\r
 \r
 #ifdef IPOL_Z\r
        slopeZ = (line.z[1] - line.z[0]) * invDeltaX;\r
@@ -200,7 +200,7 @@ void CTRTextureGouraudAddNoZ2::fragmentShader()
        tFixPoint r2, g2, b2;\r
 #endif\r
 \r
-       for ( s32 i = 0; i <= dx; ++i )\r
+       for ( s32 i = 0; i <= dx; i += SOFTWARE_DRIVER_2_STEP_X)\r
        {\r
 #ifdef CMP_Z\r
                if ( line.z[0] < z[i] )\r
@@ -275,9 +275,9 @@ void CTRTextureGouraudAddNoZ2::drawTriangle(const s4DVertex* burning_restrict a,
        const f32 ba = b->Pos.y - a->Pos.y;\r
        const f32 cb = c->Pos.y - b->Pos.y;\r
        // calculate delta y of the edges\r
-       scan.invDeltaY[0] = reciprocal_zero( ca );\r
-       scan.invDeltaY[1] = reciprocal_zero( ba );\r
-       scan.invDeltaY[2] = reciprocal_zero( cb );\r
+       scan.invDeltaY[0] = fill_step_y( ca );\r
+       scan.invDeltaY[1] = fill_step_y( ba );\r
+       scan.invDeltaY[2] = fill_step_y( cb );\r
 \r
        if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] ) )\r
                return;\r
@@ -401,7 +401,7 @@ void CTRTextureGouraudAddNoZ2::drawTriangle(const s4DVertex* burning_restrict a,
 #endif\r
 \r
                // rasterize the edge scanlines\r
-               for( line.y = yStart; line.y <= yEnd; ++line.y)\r
+               for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y)\r
                {\r
                        line.x[scan.left] = scan.x[0];\r
                        line.x[scan.right] = scan.x[1];\r
@@ -432,7 +432,7 @@ void CTRTextureGouraudAddNoZ2::drawTriangle(const s4DVertex* burning_restrict a,
 #endif\r
 \r
                        // render a scanline\r
-                       fragmentShader();\r
+                       interlace_scanline fragmentShader();\r
 \r
                        scan.x[0] += scan.slopeX[0];\r
                        scan.x[1] += scan.slopeX[1];\r
@@ -526,7 +526,6 @@ void CTRTextureGouraudAddNoZ2::drawTriangle(const s4DVertex* burning_restrict a,
                yEnd = fill_convention_right( c->Pos.y );\r
 \r
 #ifdef SUBTEXEL\r
-\r
                subPixel = ( (f32) yStart ) - b->Pos.y;\r
 \r
                // correct to pixel center\r
@@ -561,7 +560,7 @@ void CTRTextureGouraudAddNoZ2::drawTriangle(const s4DVertex* burning_restrict a,
 #endif\r
 \r
                // rasterize the edge scanlines\r
-               for( line.y = yStart; line.y <= yEnd; ++line.y)\r
+               for( line.y = yStart; line.y <= yEnd; line.y += SOFTWARE_DRIVER_2_STEP_Y)\r
                {\r
                        line.x[scan.left] = scan.x[0];\r
                        line.x[scan.right] = scan.x[1];\r
@@ -592,7 +591,7 @@ void CTRTextureGouraudAddNoZ2::drawTriangle(const s4DVertex* burning_restrict a,
 #endif\r
 \r
                        // render a scanline\r
-                       fragmentShader( );\r
+                       interlace_scanline fragmentShader();\r
 \r
                        scan.x[0] += scan.slopeX[0];\r
                        scan.x[1] += scan.slopeX[1];\r