aboutsummaryrefslogtreecommitdiff
path: root/engines/neverhood
diff options
context:
space:
mode:
authorJohannes Schickel2013-08-03 02:40:51 +0200
committerJohannes Schickel2013-08-03 04:02:51 +0200
commit2c629803a2d5706093e6ee14b5604817a08b35c4 (patch)
tree9fb1eb515acfebe3899459c4ed857984b5d6a029 /engines/neverhood
parent0c0f99eb96e9c7d13ae1430604a1d7569ec776cc (diff)
downloadscummvm-rg350-2c629803a2d5706093e6ee14b5604817a08b35c4.tar.gz
scummvm-rg350-2c629803a2d5706093e6ee14b5604817a08b35c4.tar.bz2
scummvm-rg350-2c629803a2d5706093e6ee14b5604817a08b35c4.zip
NEVERHOOD: Take advantage of Surface::getPixels.
Diffstat (limited to 'engines/neverhood')
-rw-r--r--engines/neverhood/mouse.cpp2
-rw-r--r--engines/neverhood/resource.cpp6
-rw-r--r--engines/neverhood/screen.cpp6
3 files changed, 7 insertions, 7 deletions
diff --git a/engines/neverhood/mouse.cpp b/engines/neverhood/mouse.cpp
index 0d7ebb59dc..f11a3f99ea 100644
--- a/engines/neverhood/mouse.cpp
+++ b/engines/neverhood/mouse.cpp
@@ -183,7 +183,7 @@ void Mouse::updateCursor() {
_drawOffset = _mouseCursorResource.getRect();
_surface->drawMouseCursorResource(_mouseCursorResource, _frameNum / 2);
Graphics::Surface *cursorSurface = _surface->getSurface();
- CursorMan.replaceCursor((const byte*)cursorSurface->getBasePtr(0, 0),
+ CursorMan.replaceCursor((const byte*)cursorSurface->getPixels(),
cursorSurface->w, cursorSurface->h, -_drawOffset.x, -_drawOffset.y, 0);
}
diff --git a/engines/neverhood/resource.cpp b/engines/neverhood/resource.cpp
index 745f567ead..a1a517f251 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->getBasePtr(0, 0);
+ byte *dest = (byte*)destSurface->getPixels();
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->getBasePtr(0, 0);
+ byte *dest = (byte*)destSurface->getPixels();
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->getBasePtr(0, 0);
+ byte *dest = (byte*)destSurface->getPixels();
for (int16 yc = 0; yc < 32; yc++) {
memcpy(dest, source, 32);
source += sourcePitch;
diff --git a/engines/neverhood/screen.cpp b/engines/neverhood/screen.cpp
index 17fb79ab0d..4c8dd9add0 100644
--- a/engines/neverhood/screen.cpp
+++ b/engines/neverhood/screen.cpp
@@ -54,7 +54,7 @@ void Screen::update() {
if (_fullRefresh) {
// NOTE When playing a fullscreen/doubled Smacker video usually a full screen refresh is needed
- _vm->_system->copyRectToScreen((const byte*)_backScreen->getBasePtr(0, 0), _backScreen->pitch, 0, 0, 640, 480);
+ _vm->_system->copyRectToScreen((const byte*)_backScreen->getPixels(), _backScreen->pitch, 0, 0, 640, 480);
_fullRefresh = false;
return;
}
@@ -174,7 +174,7 @@ void Screen::updatePalette() {
}
void Screen::clear() {
- memset(_backScreen->getBasePtr(0, 0), 0, _backScreen->pitch * _backScreen->h);
+ memset(_backScreen->getPixels(), 0, _backScreen->pitch * _backScreen->h);
_fullRefresh = true;
clearRenderQueue();
}
@@ -257,7 +257,7 @@ void Screen::drawSurface3(const Graphics::Surface *surface, int16 x, int16 y, ND
void Screen::drawDoubleSurface2(const Graphics::Surface *surface, NDrawRect &drawRect) {
- const byte *source = (const byte*)surface->getBasePtr(0, 0);
+ const byte *source = (const byte*)surface->getPixels();
byte *dest = (byte*)_backScreen->getBasePtr(drawRect.x, drawRect.y);
for (int16 yc = 0; yc < surface->h; yc++) {