From 82b96d33ad4f6ca623aa84df3e14a95e5cc2a091 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 3 Aug 2013 00:00:35 +0200 Subject: NEVERHOOD: Prefer getBasePtr over direct Surface::pixels access. --- engines/neverhood/resource.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/neverhood/resource.cpp') diff --git a/engines/neverhood/resource.cpp b/engines/neverhood/resource.cpp index 5f7aea86f4..745f567ead 100644 --- a/engines/neverhood/resource.cpp +++ b/engines/neverhood/resource.cpp @@ -39,7 +39,7 @@ SpriteResource::~SpriteResource() { void SpriteResource::draw(Graphics::Surface *destSurface, bool flipX, bool flipY) { if (_pixels) { - byte *dest = (byte*)destSurface->pixels; + byte *dest = (byte*)destSurface->getBasePtr(0, 0); const int destPitch = destSurface->pitch; if (_rle) unpackSpriteRle(_pixels, _dimensions.width, _dimensions.height, dest, destPitch, flipX, flipY); @@ -116,7 +116,7 @@ AnimResource::~AnimResource() { void AnimResource::draw(uint frameIndex, Graphics::Surface *destSurface, bool flipX, bool flipY) { const AnimFrameInfo frameInfo = _frames[frameIndex]; - byte *dest = (byte*)destSurface->pixels; + byte *dest = (byte*)destSurface->getBasePtr(0, 0); const int destPitch = destSurface->pitch; _currSpriteData = _spriteData + frameInfo.spriteDataOffs; _width = frameInfo.drawOffset.width; @@ -298,7 +298,7 @@ void MouseCursorResource::draw(int frameNum, Graphics::Surface *destSurface) { const int sourcePitch = (_cursorSprite.getDimensions().width + 3) & 0xFFFC; // 4 byte alignment const int destPitch = destSurface->pitch; const byte *source = _cursorSprite.getPixels() + _cursorNum * (sourcePitch * 32) + frameNum * 32; - byte *dest = (byte*)destSurface->pixels; + byte *dest = (byte*)destSurface->getBasePtr(0, 0); for (int16 yc = 0; yc < 32; yc++) { memcpy(dest, source, 32); source += sourcePitch; -- cgit v1.2.3