SHERLOCK: Fixes to scene loading

This commit is contained in:
Paul Gilbert
2015-03-25 08:16:59 -04:00
parent 03a969bd0f
commit fc7f8024be
3 changed files with 23 additions and 13 deletions
+4 -4
View File
@@ -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);
+7 -1
View File
@@ -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);
+12 -8
View File
@@ -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);
}
}
/**