diff options
author | Max Horn | 2003-06-22 17:29:55 +0000 |
---|---|---|
committer | Max Horn | 2003-06-22 17:29:55 +0000 |
commit | 31bdf9f45001bb3d9aeb15ed714e3a4c898ff45d (patch) | |
tree | 4b8513f724ebcc00fdf1100f6e0430fb7a7ec415 /common | |
parent | 73f2ea0b94db86f1f6d6f4de29b145248c0e5527 (diff) | |
download | scummvm-rg350-31bdf9f45001bb3d9aeb15ed714e3a4c898ff45d.tar.gz scummvm-rg350-31bdf9f45001bb3d9aeb15ed714e3a4c898ff45d.tar.bz2 scummvm-rg350-31bdf9f45001bb3d9aeb15ed714e3a4c898ff45d.zip |
undoing this optimization: despite my initial sureness about this being correct - I was wrong :-) just plug in 0xFFFFFFFF to see it (roughly spoken, we can loose the uppermost bits if we shift after the addition instead of before it)
svn-id: r8627
Diffstat (limited to 'common')
-rw-r--r-- | common/scaler.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/common/scaler.cpp b/common/scaler.cpp index fcf88c6b94..1252a61866 100644 --- a/common/scaler.cpp +++ b/common/scaler.cpp @@ -96,17 +96,17 @@ static inline int GetResult(uint32 A, uint32 B, uint32 C, uint32 D) { } static inline uint32 INTERPOLATE(uint32 A, uint32 B) { - if (A != B) { - return (((A & colorMask) + (B & colorMask)) >> 1) + (A & B & lowPixelMask); + if (A != B) { + return (((A & colorMask) >> 1) + ((B & colorMask) >> 1) + (A & B & lowPixelMask)); } else return A; } static inline uint32 Q_INTERPOLATE(uint32 A, uint32 B, uint32 C, uint32 D) { - register uint32 x = ((A & qcolorMask) + (B & qcolorMask) + (C & qcolorMask) + (D & qcolorMask))>>2; - register uint32 y = (A & qlowpixelMask) + (B & qlowpixelMask) + (C & qlowpixelMask) + (D & qlowpixelMask); + register uint32 x = ((A & qcolorMask) >> 2) + ((B & qcolorMask) >> 2) + ((C & qcolorMask) >> 2) + ((D & qcolorMask) >> 2); + register uint32 y = ((A & qlowpixelMask) + (B & qlowpixelMask) + (C & qlowpixelMask) + (D & qlowpixelMask)) >> 2; - y = (y >> 2) & qlowpixelMask; + y &= qlowpixelMask; return x + y; } |