]> git.lizzy.rs Git - irrlicht.git/blobdiff - source/Irrlicht/CBurningShader_Raster_Reference.cpp
Merging r6145 through r6171 from trunk to ogl-es branch
[irrlicht.git] / source / Irrlicht / CBurningShader_Raster_Reference.cpp
index 3d9dacc6a09443cec591b1dd4415f2d2c6a9b2c0..45858a07210ea647b38904814f7081725e408b15 100644 (file)
@@ -698,7 +698,7 @@ REALINLINE void CBurningShader_Raster_Reference::scanline2()
                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
        const f32 subPixel = ( (f32) pShader.xStart ) - line.x[0];\r
 \r
        // store slopes in endpoint, and correct first pixel\r
@@ -722,8 +722,8 @@ REALINLINE void CBurningShader_Raster_Reference::scanline2()
        }\r
 \r
        SOFTWARE_DRIVER_2_CLIPCHECK_REF;\r
-       pShader.dst = (tVideoSample*) ( (u8*) RenderTarget->getData() + ( line.y * RenderTarget->getPitch() ) + ( pShader.xStart << VIDEO_SAMPLE_GRANULARITY ) );\r
-       pShader.z = (fp24*) ( (u8*) DepthBuffer->lock() + ( line.y * DepthBuffer->getPitch() ) + ( pShader.xStart << VIDEO_SAMPLE_GRANULARITY ) );\r
+       pShader.dst = (tVideoSample*) ( (u8*) RenderTarget->getData() + ( line.y * RenderTarget->getPitch() ) + ( pShader.xStart << SOFTWARE_DRIVER_2_RENDERTARGET_GRANULARITY) );\r
+       pShader.z = (fp24*) ( (u8*) DepthBuffer->lock() + ( line.y * DepthBuffer->getPitch() ) + ( pShader.xStart << SOFTWARE_DRIVER_2_RENDERTARGET_GRANULARITY) );\r
 \r
        for ( pShader.i = 0; pShader.i <= pShader.dx; ++pShader.i )\r
        {\r
@@ -764,10 +764,10 @@ REALINLINE void CBurningShader_Raster_Reference::scanline ()
                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
        // search z-buffer for first not occulled pixel\r
-       pShader.z = (fp24*) ( (u8*) DepthBuffer->lock() + ( line.y * DepthBuffer->getPitch() ) + ( pShader.xStart << VIDEO_SAMPLE_GRANULARITY ) );\r
+       pShader.z = (fp24*) ( (u8*) DepthBuffer->lock() + ( line.y * DepthBuffer->getPitch() ) + ( pShader.xStart << SOFTWARE_DRIVER_2_RENDERTARGET_GRANULARITY) );\r
 \r
        // subTexel\r
        const f32 subPixel = ( (f32) pShader.xStart ) - line.x[0];\r
@@ -807,7 +807,7 @@ REALINLINE void CBurningShader_Raster_Reference::scanline ()
        line.w[0] = a;\r
        line.w[1] = b;\r
 \r
-       pShader.dst = (tVideoSample*) ( (u8*) RenderTarget->getData() + ( line.y * RenderTarget->getPitch() ) + ( pShader.xStart << VIDEO_SAMPLE_GRANULARITY ) );\r
+       pShader.dst = (tVideoSample*) ( (u8*) RenderTarget->getData() + ( line.y * RenderTarget->getPitch() ) + ( pShader.xStart << SOFTWARE_DRIVER_2_RENDERTARGET_GRANULARITY) );\r
 \r
        a = (f32) pShader.i + subPixel;\r
 \r
@@ -863,9 +863,9 @@ void CBurningShader_Raster_Reference::drawTriangle(const s4DVertex* burning_rest
 \r
 \r
        // calculate delta y of the edges\r
-       scan.invDeltaY[0] = reciprocal_zero2( c->Pos.y - a->Pos.y );\r
-       scan.invDeltaY[1] = reciprocal_zero2( b->Pos.y - a->Pos.y );\r
-       scan.invDeltaY[2] = reciprocal_zero2( c->Pos.y - b->Pos.y );\r
+       scan.invDeltaY[0] = fill_step_y( c->Pos.y - a->Pos.y );\r
+       scan.invDeltaY[1] = fill_step_y( b->Pos.y - a->Pos.y );\r
+       scan.invDeltaY[2] = fill_step_y( c->Pos.y - b->Pos.y );\r
 \r
        if ( F32_LOWER_EQUAL_0 ( scan.invDeltaY[0] )  )\r
                return;\r
@@ -959,7 +959,7 @@ void CBurningShader_Raster_Reference::drawTriangle(const s4DVertex* burning_rest
                }\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.w[scan.left] = scan.w[0];\r
@@ -1076,7 +1076,7 @@ void CBurningShader_Raster_Reference::drawTriangle(const s4DVertex* burning_rest
                }\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.w[scan.left] = scan.w[0];\r