Changeset - r22151:340fa20ac2f5
[Not reviewed]
master
0 1 0
frosch - 9 years ago 2015-06-28 16:54:25
frosch@openttd.org
(svn r27324) -Fix: Remove corner-case optimisation for line drawing, which failed for dashed lines. (noticed by adf88)
1 file changed with 3 insertions and 14 deletions:
0 comments (0 inline, 0 general)
src/gfx.cpp
Show inline comments
 
@@ -175,20 +175,9 @@ static inline void GfxDoDrawLine(void *v
 

	
 
	assert(width > 0);
 

	
 
	if (y2 == y) {
 
		/* Special case: horizontal line. */
 
		blitter->DrawLine(video,
 
				Clamp(x, 0, screen_width), y,
 
				Clamp(x2, 0, screen_width), y2,
 
				screen_width, screen_height, colour, width, dash);
 
		return;
 
	}
 
	if (x2 == x) {
 
		/* Special case: vertical line. */
 
		blitter->DrawLine(video,
 
				x, Clamp(y, 0, screen_height),
 
				x2, Clamp(y2, 0, screen_height),
 
				screen_width, screen_height, colour, width, dash);
 
	if (y2 == y || x2 == x) {
 
		/* Special case: horizontal/vertical line. All checks already done in GfxPreprocessLine. */
 
		blitter->DrawLine(video, x, y, x2, y2, screen_width, screen_height, colour, width, dash);
 
		return;
 
	}
 

	
0 comments (0 inline, 0 general)