diff options
author | Nicola Mettifogo | 2008-02-06 13:57:44 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2008-02-06 13:57:44 +0000 |
commit | 715e33d63d62dc02dd37c7db9bfb92d5cb323b0c (patch) | |
tree | da8be6212a479932865b89a222e419342a639f65 /engines/parallaction/graphics.h | |
parent | 782563f7492fd65cbc81b3f1bbc13cddd3c04480 (diff) | |
download | scummvm-rg350-715e33d63d62dc02dd37c7db9bfb92d5cb323b0c.tar.gz scummvm-rg350-715e33d63d62dc02dd37c7db9bfb92d5cb323b0c.tar.bz2 scummvm-rg350-715e33d63d62dc02dd37c7db9bfb92d5cb323b0c.zip |
Correctly implemented little-endian masks in BRA.
svn-id: r30807
Diffstat (limited to 'engines/parallaction/graphics.h')
-rw-r--r-- | engines/parallaction/graphics.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h index ce4cca0d1a..3eb8f88a01 100644 --- a/engines/parallaction/graphics.h +++ b/engines/parallaction/graphics.h @@ -27,6 +27,7 @@ #define PARALLACTION_GRAPHICS_H #include "common/rect.h" +#include "common/hash-str.h" #include "common/stream.h" #include "graphics/surface.h" @@ -174,9 +175,10 @@ struct MaskBuffer { uint16 h; uint size; byte *data; + bool bigEndian; public: - MaskBuffer() : w(0), internalWidth(0), h(0), size(0), data(0) { + MaskBuffer() : w(0), internalWidth(0), h(0), size(0), data(0), bigEndian(true) { } void create(uint16 width, uint16 height) { @@ -198,8 +200,13 @@ public: inline byte getValue(uint16 x, uint16 y) { byte m = data[(x >> 2) + y * internalWidth]; - uint n = (x & 3) << 1; - return ((3 << n) & m) >> n; + uint n; + if (bigEndian) { + n = (x & 3) << 1; + } else { + n = (3 - (x & 3)) << 1; + } + return (m >> n) & 3; } }; |