summaryrefslogtreecommitdiff
path: root/src/blitter/8bpp_base.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-06-18 18:45:12 +0000
committerpeter1138 <peter1138@openttd.org>2007-06-18 18:45:12 +0000
commit704a67ff0ba72314230e2c4b4fb9cab2654edd9d (patch)
treed94c7db55a9657361ab8c1de68448e9e70965bab /src/blitter/8bpp_base.cpp
parent82e79b847e6c0c19010f0bf8f7bc462cdcd9ebc3 (diff)
downloadopenttd-704a67ff0ba72314230e2c4b4fb9cab2654edd9d.tar.xz
(svn r10201) -Codechange: Replace Blitter::SetHorizontalLine with Blitter::DrawRect, as the former was only used by the rectangle drawing code anyway. This lets us draw rectangles in one go.
Diffstat (limited to 'src/blitter/8bpp_base.cpp')
-rw-r--r--src/blitter/8bpp_base.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/blitter/8bpp_base.cpp b/src/blitter/8bpp_base.cpp
index 48ff3d547..486d7a190 100644
--- a/src/blitter/8bpp_base.cpp
+++ b/src/blitter/8bpp_base.cpp
@@ -28,9 +28,12 @@ void Blitter_8bppBase::SetPixelIfEmpty(void *video, int x, int y, uint8 color)
if (*dst == 0) *dst = color;
}
-void Blitter_8bppBase::SetHorizontalLine(void *video, int width, uint8 color)
+void Blitter_8bppBase::DrawRect(void *video, int width, int height, uint8 color)
{
- memset(video, color, width);
+ do {
+ memset(video, color, width);
+ video = (uint8 *)video + _screen.pitch;
+ } while (--height);
}
void Blitter_8bppBase::CopyFromBuffer(void *video, const void *src, int width, int height, int src_pitch)