summaryrefslogtreecommitdiff
path: root/src/gfx.cpp
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-05-14 15:20:50 +0000
committertruelight <truelight@openttd.org>2007-05-14 15:20:50 +0000
commitd7b4fb80d0e14ca3f8d56cda920e7f0d4e81419d (patch)
tree8b4e24cad04a15b76b5449bbb993f8b8fa1dccca /src/gfx.cpp
parent62fe9c2e420238ba4db54f8cf56afc25b1167051 (diff)
downloadopenttd-d7b4fb80d0e14ca3f8d56cda920e7f0d4e81419d.tar.xz
(svn r9835) -Codechange: use Pixel typedef instead of byte where ever possible
Diffstat (limited to 'src/gfx.cpp')
-rw-r--r--src/gfx.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp
index fa7fc671f..a37343720 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -64,12 +64,12 @@ static byte _dirty_blocks[DIRTY_BYTES_PER_LINE * MAX_SCREEN_HEIGHT / 8];
void memcpy_pitch(void *dst, void *src, int w, int h, int srcpitch, int dstpitch)
{
- byte *dstp = (byte*)dst;
- byte *srcp = (byte*)src;
+ Pixel *dstp = (Pixel *)dst;
+ Pixel *srcp = (Pixel *)src;
assert(h >= 0);
for (; h != 0; --h) {
- memcpy(dstp, srcp, w);
+ memcpy(dstp, srcp, w * sizeof(Pixel));
dstp += dstpitch;
srcp += srcpitch;
}
@@ -110,7 +110,7 @@ void GfxScroll(int left, int top, int width, int height, int xo, int yo)
}
for (ht = height; ht > 0; --ht) {
- memcpy(dst, src, width);
+ memcpy(dst, src, width * sizeof(Pixel));
src -= p;
dst -= p;
}
@@ -136,7 +136,7 @@ void GfxScroll(int left, int top, int width, int height, int xo, int yo)
/* the y-displacement may be 0 therefore we have to use memmove,
* because source and destination may overlap */
for (ht = height; ht > 0; --ht) {
- memmove(dst, src, width);
+ memmove(dst, src, width * sizeof(Pixel));
src += p;
dst += p;
}
@@ -175,7 +175,7 @@ void GfxFillRect(int left, int top, int right, int bottom, int color)
if (!HASBIT(color, PALETTE_MODIFIER_GREYOUT)) {
if (!HASBIT(color, USE_COLORTABLE)) {
do {
- memset(dst, color, right);
+ memset(dst, color, right * sizeof(Pixel));
dst += dpi->pitch;
} while (--bottom);
} else {