aboutsummaryrefslogtreecommitdiff
path: root/graphics/decoders/bmp.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2013-08-03 02:14:51 +0200
committerJohannes Schickel2013-08-03 04:02:49 +0200
commitdbef9fef3b65cfd74a25ecb8767e1ba396f5b3b1 (patch)
tree8adba23b7b98b364ee400678f0b6290b1750f57b /graphics/decoders/bmp.cpp
parent6fce92b0ea2fce78c375ade0bc6c2ac4231b96bd (diff)
downloadscummvm-rg350-dbef9fef3b65cfd74a25ecb8767e1ba396f5b3b1.tar.gz
scummvm-rg350-dbef9fef3b65cfd74a25ecb8767e1ba396f5b3b1.tar.bz2
scummvm-rg350-dbef9fef3b65cfd74a25ecb8767e1ba396f5b3b1.zip
GRAPHICS: Prefer getBasePtr over direct Surface::pixels access.
Diffstat (limited to 'graphics/decoders/bmp.cpp')
-rw-r--r--graphics/decoders/bmp.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/graphics/decoders/bmp.cpp b/graphics/decoders/bmp.cpp
index bcfd0abbda..51e43075a5 100644
--- a/graphics/decoders/bmp.cpp
+++ b/graphics/decoders/bmp.cpp
@@ -130,14 +130,14 @@ bool BitmapDecoder::loadStream(Common::SeekableReadStream &stream) {
const int extraDataLength = (srcPitch % 4) ? 4 - (srcPitch % 4) : 0;
if (bitsPerPixel == 8) {
- byte *dst = (byte *)_surface->pixels;
+ byte *dst = (byte *)_surface->getBasePtr(0, 0);
for (int32 i = 0; i < height; i++) {
stream.read(dst + (height - i - 1) * width, width);
stream.skip(extraDataLength);
}
} else if (bitsPerPixel == 24) {
- byte *dst = (byte *)_surface->pixels + (height - 1) * _surface->pitch;
+ byte *dst = (byte *)_surface->getBasePtr(0, height - 1);
for (int32 i = 0; i < height; i++) {
for (uint32 j = 0; j < width; j++) {
@@ -154,7 +154,7 @@ bool BitmapDecoder::loadStream(Common::SeekableReadStream &stream) {
dst -= _surface->pitch * 2;
}
} else { // 32 bpp
- byte *dst = (byte *)_surface->pixels + (height - 1) * _surface->pitch;
+ byte *dst = (byte *)_surface->getBasePtr(0, height - 1);
for (int32 i = 0; i < height; i++) {
for (uint32 j = 0; j < width; j++) {