aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorMax Horn2009-07-30 17:52:44 +0000
committerMax Horn2009-07-30 17:52:44 +0000
commit25d83581dcca46357bd00db35103fbd86b1ec588 (patch)
treec981edfd32ba744e94f3f76329f33821a6193490 /engines/scumm
parent31f7f45609b7261ae5184c6f94425e1d36af47ec (diff)
downloadscummvm-rg350-25d83581dcca46357bd00db35103fbd86b1ec588.tar.gz
scummvm-rg350-25d83581dcca46357bd00db35103fbd86b1ec588.tar.bz2
scummvm-rg350-25d83581dcca46357bd00db35103fbd86b1ec588.zip
minor cleanup to scale2x, to avoid confusing the compiler about potential pointer aliasing (only the tip of the iceberg, of course... ;)
svn-id: r42938
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/gfx.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 5961ec4013..18cba0ab4a 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -758,18 +758,18 @@ void ditherHerc(byte *src, byte *hercbuf, int srcPitch, int *x, int *y, int *wid
}
void scale2x(byte *dst, int dstPitch, const byte *src, int srcPitch, int w, int h) {
- byte *dstL1 = dst;
- byte *dstL2 = dst + dstPitch;
+ uint16 *dstL1 = (uint16 *)dst;
+ uint16 *dstL2 = (uint16 *)(dst + dstPitch);
- int dstAdd = dstPitch * 2 - w * 2;
- int srcAdd = srcPitch - w;
+ const int dstAdd = dstPitch - w;
+ const int srcAdd = srcPitch - w;
while (h--) {
- for (int x = 0; x < w; ++x, dstL1 += 2, dstL2 += 2) {
+ for (int x = 0; x < w; ++x) {
uint16 col = *src++;
col |= col << 8;
- *(uint16*)(dstL1) = col;
- *(uint16*)(dstL2) = col;
+ *dstL1++ = col;
+ *dstL2++ = col;
}
dstL1 += dstAdd; dstL2 += dstAdd;
src += srcAdd;