diff options
author | Max Horn | 2004-08-08 15:45:58 +0000 |
---|---|---|
committer | Max Horn | 2004-08-08 15:45:58 +0000 |
commit | 5564f36b0e762164d1e6fda5e804723266f8e9ae (patch) | |
tree | 7319927812d53d1795c8d1b89764000b04e6ce8c /common/scaler.cpp | |
parent | 87756c9f46fab0b97e54858c89be68ce0c49d03b (diff) | |
download | scummvm-rg350-5564f36b0e762164d1e6fda5e804723266f8e9ae.tar.gz scummvm-rg350-5564f36b0e762164d1e6fda5e804723266f8e9ae.tar.bz2 scummvm-rg350-5564f36b0e762164d1e6fda5e804723266f8e9ae.zip |
Slightly optimiized Normal2x
svn-id: r14519
Diffstat (limited to 'common/scaler.cpp')
-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) { |