aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2015-03-25 08:16:59 -0400
committerPaul Gilbert2015-03-25 08:16:59 -0400
commitfc7f8024beb4e3a0ee2b6def649ca1a3e91fa899 (patch)
treed8c35479d3cd0421be57172b8e3edc8b2667bcd1 /engines
parent03a969bd0f696f9a7fa0dc56c47c2b05d28a5a47 (diff)
downloadscummvm-rg350-fc7f8024beb4e3a0ee2b6def649ca1a3e91fa899.tar.gz
scummvm-rg350-fc7f8024beb4e3a0ee2b6def649ca1a3e91fa899.tar.bz2
scummvm-rg350-fc7f8024beb4e3a0ee2b6def649ca1a3e91fa899.zip
SHERLOCK: Fixes to scene loading
Diffstat (limited to 'engines')
-rw-r--r--engines/sherlock/objects.cpp8
-rw-r--r--engines/sherlock/scene.cpp8
-rw-r--r--engines/sherlock/screen.cpp20
3 files changed, 23 insertions, 13 deletions
diff --git a/engines/sherlock/objects.cpp b/engines/sherlock/objects.cpp
index e0a24c5b7d..cdd397f23c 100644
--- a/engines/sherlock/objects.cpp
+++ b/engines/sherlock/objects.cpp
@@ -381,10 +381,10 @@ void UseType::synchronize(Common::SeekableReadStream &s) {
_names[idx] = Common::String(buffer);
}
- _useFlag = s.readUint16LE();
- _dFlag[0] = s.readUint16LE();
- _lFlag[0] = s.readUint16LE();
- _lFlag[1] = s.readUint16LE();
+ _useFlag = s.readSint16LE();
+ _dFlag[0] = s.readSint16LE();
+ _lFlag[0] = s.readSint16LE();
+ _lFlag[1] = s.readSint16LE();
s.read(buffer, 12);
_target = Common::String(buffer);
diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp
index c5cba1b5cd..1b7a1a9cd2 100644
--- a/engines/sherlock/scene.cpp
+++ b/engines/sherlock/scene.cpp
@@ -601,7 +601,13 @@ void Scene::transitionToScene() {
} else {
// It's canimation information
cAnimNum = _hsavedFs - 101;
+ }
+
+ // Reset positioning for next load
+ _hsavedPos = Common::Point(-1, -1);
+ _hsavedFs = -1;
+ if (cAnimNum != -1) {
// Prevent Holmes from being drawn
people[PLAYER]._position = Common::Point(0, 0);
}
@@ -1166,7 +1172,7 @@ void Scene::doBgAnim() {
else if (people[AL]._type == REMOVE)
screen._backBuffer.blitFrom(screen._backBuffer2, pt, bounds);
- for (uint idx = 0; _bgShapes.size(); ++idx) {
+ for (uint idx = 0; idx < _bgShapes.size(); ++idx) {
Object &o = _bgShapes[idx];
if (o._type == ACTIVE_BG_SHAPE || o._type == HIDE_SHAPE || o._type == REMOVE)
screen.restoreBackground(bounds);
diff --git a/engines/sherlock/screen.cpp b/engines/sherlock/screen.cpp
index e0eab428a8..7c222f3e24 100644
--- a/engines/sherlock/screen.cpp
+++ b/engines/sherlock/screen.cpp
@@ -246,11 +246,13 @@ void Screen::verticalTransition() {
* Copies a section of the second back buffer into the main back buffer
*/
void Screen::restoreBackground(const Common::Rect &r) {
- Common::Rect tempRect = r;
- tempRect.clip(Common::Rect(0, 0, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCENE_HEIGHT));
+ if (r.width() > 0 && r.height() > 0) {
+ Common::Rect tempRect = r;
+ tempRect.clip(Common::Rect(0, 0, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCENE_HEIGHT));
- if (tempRect.isValidRect())
- _backBuffer.blitFrom(_backBuffer2, Common::Point(tempRect.left, tempRect.top), tempRect);
+ if (tempRect.isValidRect())
+ _backBuffer.blitFrom(_backBuffer2, Common::Point(tempRect.left, tempRect.top), tempRect);
+ }
}
/**
@@ -264,11 +266,13 @@ void Screen::slamArea(int16 xp, int16 yp, int16 w, int16 h) {
* Copies a given area to the screen
*/
void Screen::slamRect(const Common::Rect &r) {
- Common::Rect tempRect = r;
- tempRect.clip(Common::Rect(0, 0, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT));
+ if (r.width() && r.height() > 0) {
+ Common::Rect tempRect = r;
+ tempRect.clip(Common::Rect(0, 0, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT));
- if (tempRect.isValidRect())
- blitFrom(_backBuffer, Common::Point(tempRect.left, tempRect.top), tempRect);
+ if (tempRect.isValidRect())
+ blitFrom(_backBuffer, Common::Point(tempRect.left, tempRect.top), tempRect);
+ }
}
/**