summaryrefslogtreecommitdiff
path: root/src/blitter
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-09-26 14:17:26 +0000
committerrubidium <rubidium@openttd.org>2007-09-26 14:17:26 +0000
commit2239809bdcd5cc65d5d7e4c28abb72a74952f14c (patch)
tree1b4aa4ae1c2c0b08792558bdadded15ce9f88499 /src/blitter
parentca7cab0253f131e460089f801f9c05ca3bb93174 (diff)
downloadopenttd-2239809bdcd5cc65d5d7e4c28abb72a74952f14c.tar.xz
(svn r11169) -Fix [FS#1255]: obiwan in Blitter::Drawline(), which caused it to clip too much at screen/viewport borders. Patch by frosch.
Diffstat (limited to 'src/blitter')
-rw-r--r--src/blitter/32bpp_base.cpp6
-rw-r--r--src/blitter/8bpp_base.cpp6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/blitter/32bpp_base.cpp b/src/blitter/32bpp_base.cpp
index 378873ec0..f09259927 100644
--- a/src/blitter/32bpp_base.cpp
+++ b/src/blitter/32bpp_base.cpp
@@ -56,7 +56,7 @@ void Blitter_32bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int
stepx = 1;
}
- if (x > 0 && y > 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
+ if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
if (dx > dy) {
frac = dy - (dx / 2);
while (x != x2) {
@@ -66,7 +66,7 @@ void Blitter_32bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int
}
x += stepx;
frac += dy;
- if (x > 0 && y > 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
+ if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
}
} else {
frac = dx - (dy / 2);
@@ -77,7 +77,7 @@ void Blitter_32bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int
}
y += stepy;
frac += dx;
- if (x > 0 && y > 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
+ if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
}
}
}
diff --git a/src/blitter/8bpp_base.cpp b/src/blitter/8bpp_base.cpp
index a931df624..269170cb2 100644
--- a/src/blitter/8bpp_base.cpp
+++ b/src/blitter/8bpp_base.cpp
@@ -60,7 +60,7 @@ void Blitter_8bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int s
stepx = 1;
}
- if (x > 0 && y > 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
+ if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
if (dx > dy) {
frac = dy - (dx / 2);
while (x != x2) {
@@ -70,7 +70,7 @@ void Blitter_8bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int s
}
x += stepx;
frac += dy;
- if (x > 0 && y > 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
+ if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
}
} else {
frac = dx - (dy / 2);
@@ -81,7 +81,7 @@ void Blitter_8bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int s
}
y += stepy;
frac += dx;
- if (x > 0 && y > 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
+ if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
}
}
}