Changeset - r26913:e7b3d514fe34
[Not reviewed]
master
0 1 0
Tyler Trahan - 16 months ago 2023-02-26 19:23:31
tyler@tylertrahan.com
Revert 92c7551: Line drawing algorithm fix broke other cases (#10497)

This reverts commit 92c755161d6a467d33477bd0041fc720d7d9ba41.
1 file changed with 10 insertions and 12 deletions:
0 comments (0 inline, 0 general)
src/blitter/common.hpp
Show inline comments
 
@@ -109,6 +109,11 @@ void Blitter::DrawLineGeneric(int x1, in
 
		}
 

	
 
		while (x1 != x2) {
 
			if (dash_count < dash) {
 
				for (int y = y_low; y != y_high; y += stepy) {
 
					if (y >= 0 && y < screen_height) set_pixel(x1, y);
 
				}
 
			}
 
			if (frac_low >= 0) {
 
				y_low += stepy;
 
				frac_low -= dx;
 
@@ -117,12 +122,6 @@ void Blitter::DrawLineGeneric(int x1, in
 
				y_high += stepy;
 
				frac_high -= dx;
 
			}
 
			if (dash_count < dash) {
 
				for (int y = y_low; y != y_high; y += stepy) {
 
					if (y >= 0 && y < screen_height) set_pixel(x1, y);
 
				}
 
			}
 

	
 
			x1++;
 
			frac_low += dy;
 
			frac_high += dy;
 
@@ -172,6 +171,11 @@ void Blitter::DrawLineGeneric(int x1, in
 
		}
 

	
 
		while (y1 != y2) {
 
			if (dash_count < dash) {
 
				for (int x = x_low; x != x_high; x += stepx) {
 
					if (x >= 0 && x < screen_width) set_pixel(x, y1);
 
				}
 
			}
 
			if (frac_low >= 0) {
 
				x_low += stepx;
 
				frac_low -= dy;
 
@@ -180,12 +184,6 @@ void Blitter::DrawLineGeneric(int x1, in
 
				x_high += stepx;
 
				frac_high -= dy;
 
			}
 
			if (dash_count < dash) {
 
				for (int x = x_low; x != x_high; x += stepx) {
 
					if (x >= 0 && x < screen_width) set_pixel(x, y1);
 
				}
 
			}
 

	
 
			y1++;
 
			frac_low += dx;
 
			frac_high += dx;
0 comments (0 inline, 0 general)