]> git.lizzy.rs Git - irrlicht.git/blobdiff - source/Irrlicht/CTRTextureGouraudAdd2.cpp
Merging r6145 through r6171 from trunk to ogl-es branch
[irrlicht.git] / source / Irrlicht / CTRTextureGouraudAdd2.cpp
index 040c83def8c652a25fab14ecf4300ce98da775a1..340cef599312cb550046f7c98e93650e695674e2 100644 (file)
@@ -88,7 +88,7 @@ public:
 \r
 \r
 private:\r
-       void scanline_bilinear ();\r
+       void fragmentShader();\r
 };\r
 \r
 //! constructor\r
@@ -104,7 +104,7 @@ CTRTextureGouraudAdd2::CTRTextureGouraudAdd2(CBurningVideoDriver* driver)
 \r
 /*!\r
 */\r
-void CTRTextureGouraudAdd2::scanline_bilinear ()\r
+void CTRTextureGouraudAdd2::fragmentShader()\r
 {\r
        tVideoSample *dst;\r
 \r
@@ -144,7 +144,7 @@ void CTRTextureGouraudAdd2::scanline_bilinear ()
                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
@@ -203,7 +203,7 @@ void CTRTextureGouraudAdd2::scanline_bilinear ()
 #endif\r
 \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
@@ -280,9 +280,9 @@ void CTRTextureGouraudAdd2::drawTriangle(const s4DVertex* burning_restrict a, co
        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
        // find if the major edge is left or right aligned\r
        f32 temp[4];\r
@@ -403,7 +403,7 @@ void CTRTextureGouraudAdd2::drawTriangle(const s4DVertex* burning_restrict a, co
 #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
@@ -434,7 +434,7 @@ void CTRTextureGouraudAdd2::drawTriangle(const s4DVertex* burning_restrict a, co
 #endif\r
 \r
                        // render a scanline\r
-                       scanline_bilinear ();\r
+                       interlace_scanline fragmentShader();\r
 \r
                        scan.x[0] += scan.slopeX[0];\r
                        scan.x[1] += scan.slopeX[1];\r
@@ -563,7 +563,7 @@ void CTRTextureGouraudAdd2::drawTriangle(const s4DVertex* burning_restrict a, co
 #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
@@ -594,7 +594,7 @@ void CTRTextureGouraudAdd2::drawTriangle(const s4DVertex* burning_restrict a, co
 #endif\r
 \r
                        // render a scanline\r
-                       scanline_bilinear ();\r
+                       interlace_scanline fragmentShader();\r
 \r
                        scan.x[0] += scan.slopeX[0];\r
                        scan.x[1] += scan.slopeX[1];\r