diff options
Diffstat (limited to 'common')
| -rw-r--r-- | common/scaler.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/common/scaler.cpp b/common/scaler.cpp index 8b53560afc..77ebdb951a 100644 --- a/common/scaler.cpp +++ b/common/scaler.cpp @@ -123,15 +123,16 @@ void Normal2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPit int width, int height) { uint8 *r; + assert(((int)dstPtr & 3) == 0); while (height--) { r = dstPtr; for (int i = 0; i < width; ++i, r += 4) { - uint16 color = *(((const uint16 *)srcPtr) + i); + uint32 color = *(((const uint16 *)srcPtr) + i); + + color |= color << 16; - *(uint16 *)(r + 0) = color; - *(uint16 *)(r + 2) = color; - *(uint16 *)(r + 0 + dstPitch) = color; - *(uint16 *)(r + 2 + dstPitch) = color; + *(uint32 *)(r) = color; + *(uint32 *)(r + dstPitch) = color; } srcPtr += srcPitch; dstPtr += dstPitch << 1; @@ -147,6 +148,7 @@ void Normal3x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPit const uint32 dstPitch2 = dstPitch * 2; const uint32 dstPitch3 = dstPitch * 3; + assert(((int)dstPtr & 3) == 0); while (height--) { r = dstPtr; for (int i = 0; i < width; ++i, r += 6) { |
