changeset 7432:f4b6ca5ab56e draft

(svn r10837) -Fix [FS#1102]: DrawLine didn't bound-check the first pixel that was drawn (frosch)
author truelight <truelight@openttd.org>
date Fri, 10 Aug 2007 13:11:53 +0000
parents fef6fd396d03
children dd74c3c5a036
files src/blitter/32bpp_base.cpp src/blitter/8bpp_base.cpp
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/blitter/32bpp_base.cpp
+++ b/src/blitter/32bpp_base.cpp
@@ -56,7 +56,7 @@
 		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) {
--- a/src/blitter/8bpp_base.cpp
+++ b/src/blitter/8bpp_base.cpp
@@ -60,7 +60,7 @@
 		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) {