@@ -5385,13 +5385,12 @@ static void SW_RASTER_TRIANGLE_SPAN(const sw_vertex_t *start, const sw_vertex_t
53855385 int xEnd = (int )end -> position [0 ];
53865386 if (xStart == xEnd ) return ;
53875387
5388- // Intercept the span bounds to ensure we don't write before the framebuffer.
5388+ // Intercept the span bounds to ensure to not write before the framebuffer
53895389 int xLoopStart = (xStart >= 0 )? xStart : 0 ;
53905390 int xLoopEnd = (xEnd <= RLSW .colorBuffer -> width )? xEnd : RLSW .colorBuffer -> width ;
5391- // Nothing to draw.
5392- if (xLoopStart >= xLoopEnd ) return ;
5391+ if (xLoopStart >= xLoopEnd ) return ; // Nothing to draw
53935392
5394- // Get the current row and skip if outside the framebuffer.
5393+ // Get the current row and skip if outside the framebuffer
53955394 // Maybe this check is better suited elsewhere?
53965395 int y = (int )start -> position [1 ];
53975396 if (y < 0 || y >= RLSW .colorBuffer -> height ) return ;
@@ -5416,12 +5415,12 @@ static void SW_RASTER_TRIANGLE_SPAN(const sw_vertex_t *start, const sw_vertex_t
54165415#endif
54175416
54185417 // Compute the subpixel distance to traverse before the first pixel
5419- // Also step further into them to move away from the colorbuffer edge.
5418+ // Also step further into them to move away from the colorbuffer edge
54205419 float xSubstep = 1.0f - sw_fract (start -> position [0 ]);
54215420 float dxStart = (float )(xLoopStart - xStart );
54225421 float xOffset = xSubstep + dxStart ;
54235422
5424- // Initializing the interpolation starting values.
5423+ // Initializing the interpolation starting values
54255424 float w = start -> position [3 ] + dWdx * xOffset ;
54265425 float color [4 ] = {
54275426 start -> color [0 ] + dCdx [0 ]* xOffset ,
@@ -5747,11 +5746,11 @@ static void SW_RASTER_QUAD(const sw_vertex_t *a, const sw_vertex_t *b,
57475746 uint8_t * dPixels = RLSW .depthBuffer -> pixels ;
57485747#endif
57495748
5750- // Calculate the distance the in-bounds boundary is from the quad's edges, only on the left and top.
5749+ // Calculate the distance the in-bounds boundary is from the quad's edges, only on the left and top
57515750 float dxMin = (float )(xLoopMin - xMin );
57525751 float dyMin = (float )(yLoopMin - yMin );
57535752
5754- // Correct our start by how far we clipped outside the framebuffer.
5753+ // Correct our start by how far it's clipped outside the framebuffer
57555754 cRow [0 ] += dCdx [0 ]* dxMin + dCdy [0 ]* dyMin ;
57565755 cRow [1 ] += dCdx [1 ]* dxMin + dCdy [1 ]* dyMin ;
57575756 cRow [2 ] += dCdx [2 ]* dxMin + dCdy [2 ]* dyMin ;
@@ -5770,7 +5769,7 @@ static void SW_RASTER_QUAD(const sw_vertex_t *a, const sw_vertex_t *b,
57705769 uint8_t * cPtr = cPixels + baseOffset * SW_FRAMEBUFFER_COLOR_SIZE ;
57715770 #ifdef SW_ENABLE_DEPTH_TEST
57725771 uint8_t * dPtr = dPixels + baseOffset * SW_FRAMEBUFFER_DEPTH_SIZE ;
5773- // Copy the cursors so we increment them ourselves without destroying the offset maths.
5772+ // Copy the cursors without destroying the offset maths
57745773 float z = zRow ;
57755774 #endif
57765775 #ifdef SW_ENABLE_TEXTURE
@@ -5823,7 +5822,7 @@ static void SW_RASTER_QUAD(const sw_vertex_t *a, const sw_vertex_t *b,
58235822 #ifdef SW_ENABLE_DEPTH_TEST
58245823 discard :
58255824 #endif
5826- // We move one pixel over without touching the original "start offset"
5825+ // Move one pixel over without touching the original "start offset"
58275826 color [0 ] += dCdx [0 ];
58285827 color [1 ] += dCdx [1 ];
58295828 color [2 ] += dCdx [2 ];
@@ -5846,9 +5845,9 @@ static void SW_RASTER_QUAD(const sw_vertex_t *a, const sw_vertex_t *b,
58465845 cPtr += SW_FRAMEBUFFER_COLOR_SIZE ;
58475846 }
58485847
5849- // The for loop is clamped to the right side of the screen.
5850- // However, these cursor start vars are still on the left.
5851- // That's fine. We just need to advance to the next row.
5848+ // The for loop is clamped to the right side of the screen
5849+ // However, these cursor start vars are still on the left
5850+ // That's fine, advancing to the next row
58525851 cRow [0 ] += dCdy [0 ];
58535852 cRow [1 ] += dCdy [1 ];
58545853 cRow [2 ] += dCdy [2 ];
0 commit comments