mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r10837) -Fix [FS#1102]: DrawLine didn't bound-check the first pixel that was drawn (frosch)
This commit is contained in:
parent
61b21547e8
commit
6771f5ca20
|
@ -56,7 +56,7 @@ void Blitter_32bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int
|
|||
stepx = 1;
|
||||
}
|
||||
|
||||
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) {
|
||||
|
|
|
@ -60,7 +60,7 @@ void Blitter_8bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int s
|
|||
stepx = 1;
|
||||
}
|
||||
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue