src/blitter/32bpp_base.cpp
branchNewGRF_ports
changeset 6870 ca3fd1fbe311
parent 6800 6c09e1e86fcb
child 6872 1c4a4a609f85
equal deleted inserted replaced
6869:76282d3b748d 6870:ca3fd1fbe311
    54 		stepx = -1;
    54 		stepx = -1;
    55 	} else {
    55 	} else {
    56 		stepx = 1;
    56 		stepx = 1;
    57 	}
    57 	}
    58 
    58 
    59 	if (x > 0 && y > 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
    59 	if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
    60 	if (dx > dy) {
    60 	if (dx > dy) {
    61 		frac = dy - (dx / 2);
    61 		frac = dy - (dx / 2);
    62 		while (x != x2) {
    62 		while (x != x2) {
    63 			if (frac >= 0) {
    63 			if (frac >= 0) {
    64 				y += stepy;
    64 				y += stepy;
    65 				frac -= dx;
    65 				frac -= dx;
    66 			}
    66 			}
    67 			x += stepx;
    67 			x += stepx;
    68 			frac += dy;
    68 			frac += dy;
    69 			if (x > 0 && y > 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
    69 			if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
    70 		}
    70 		}
    71 	} else {
    71 	} else {
    72 		frac = dx - (dy / 2);
    72 		frac = dx - (dy / 2);
    73 		while (y != y2) {
    73 		while (y != y2) {
    74 			if (frac >= 0) {
    74 			if (frac >= 0) {
    75 				x += stepx;
    75 				x += stepx;
    76 				frac -= dy;
    76 				frac -= dy;
    77 			}
    77 			}
    78 			y += stepy;
    78 			y += stepy;
    79 			frac += dx;
    79 			frac += dx;
    80 			if (x > 0 && y > 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
    80 			if (x >= 0 && y >= 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
    81 		}
    81 		}
    82 	}
    82 	}
    83 }
    83 }
    84 
    84 
    85 void Blitter_32bppBase::CopyFromBuffer(void *video, const void *src, int width, int height)
    85 void Blitter_32bppBase::CopyFromBuffer(void *video, const void *src, int width, int height)