aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/map.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2015-04-24 01:35:51 -0500
committerPaul Gilbert2015-04-24 01:35:51 -0500
commita5edfcc3f5e59a8bb68b6bcbc8d7b6ce72ec633a (patch)
treeb0f2f054a35eb68f8248f32f0b58b4dddde25eb6 /engines/sherlock/map.cpp
parentecaa4c26c953524bdf34fa55cfdf6c55af129bc4 (diff)
downloadscummvm-rg350-a5edfcc3f5e59a8bb68b6bcbc8d7b6ce72ec633a.tar.gz
scummvm-rg350-a5edfcc3f5e59a8bb68b6bcbc8d7b6ce72ec633a.tar.bz2
scummvm-rg350-a5edfcc3f5e59a8bb68b6bcbc8d7b6ce72ec633a.zip
SHERLOCK: Fix restoring background as player icon moves on map
Diffstat (limited to 'engines/sherlock/map.cpp')
-rw-r--r--engines/sherlock/map.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/engines/sherlock/map.cpp b/engines/sherlock/map.cpp
index 6e9982eb62..c3a5ba7b17 100644
--- a/engines/sherlock/map.cpp
+++ b/engines/sherlock/map.cpp
@@ -286,7 +286,7 @@ void Map::setupSprites() {
_shapes = new ImageFile("mapicon.vgs");
_iconShapes = new ImageFile("overicon.vgs");
-
+ _iconSave.create((*_shapes)[4]._width, (*_shapes)[4]._height);
Person &p = people[AL];
p._description = " ";
p._type = CHARACTER;
@@ -317,6 +317,7 @@ void Map::freeSprites() {
delete _mapCursors;
delete _shapes;
delete _iconShapes;
+ _iconSave.free();
}
/**
@@ -523,9 +524,11 @@ void Map::saveIcon(ImageFrame *src, const Common::Point &pt) {
return;
}
- _iconSave.create(size.x, size.y);
+ assert(size.x <= _iconSave.w && size.y <= _iconSave.h);
_iconSave.blitFrom(screen._backBuffer1, Common::Point(0, 0),
Common::Rect(pos.x, pos.y, pos.x + size.x, pos.y + size.y));
+ _savedPos = pos;
+ _savedSize = size;
}
/**
@@ -536,7 +539,7 @@ void Map::restoreIcon() {
if (_savedPos.x >= 0 && _savedPos.y >= 0 && _savedPos.x <= SHERLOCK_SCREEN_WIDTH
&& _savedPos.y < SHERLOCK_SCREEN_HEIGHT)
- screen._backBuffer1.blitFrom(_iconSave, _savedPos);
+ screen._backBuffer1.blitFrom(_iconSave, _savedPos, Common::Rect(0, 0, _savedSize.x, _savedSize.y));
}
/**