aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2015-09-11 22:19:10 -0400
committerPaul Gilbert2015-09-11 22:19:10 -0400
commit0d662c22a34547578fca52483f580db34b215cc0 (patch)
tree5714851d4d43c160ae22c85b671804e094b010c3
parent27e9aebbb1c83dbf0a2675116087b477284c4801 (diff)
downloadscummvm-rg350-0d662c22a34547578fca52483f580db34b215cc0.tar.gz
scummvm-rg350-0d662c22a34547578fca52483f580db34b215cc0.tar.bz2
scummvm-rg350-0d662c22a34547578fca52483f580db34b215cc0.zip
SHERLOCK: 3DO: Implement placement of portrait videos
-rw-r--r--engines/sherlock/scalpel/scalpel_talk.cpp35
-rw-r--r--engines/sherlock/scalpel/scalpel_talk.h5
2 files changed, 39 insertions, 1 deletions
diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp
index 848502e579..2d1a8a9775 100644
--- a/engines/sherlock/scalpel/scalpel_talk.cpp
+++ b/engines/sherlock/scalpel/scalpel_talk.cpp
@@ -639,7 +639,7 @@ bool ScalpelTalk::talk3DOMovieTrigger(int subIndex) {
warning("selector: %d", selector);
warning("subindex: %d", subIndex);
- bool result = vm.play3doMovie(movieFilename, Common::Point(5, 5), true);
+ bool result = vm.play3doMovie(movieFilename, get3doPortraitPosition(), true);
// Restore screen HACK
_vm->_screen->makeAllDirty();
@@ -647,6 +647,39 @@ bool ScalpelTalk::talk3DOMovieTrigger(int subIndex) {
return result;
}
+Common::Point ScalpelTalk::get3doPortraitPosition() const {
+ // TODO: This current method is only an assumption of how the original figured
+ // out where to place each character's portrait movie.
+ People &people = *_vm->_people;
+ Scene &scene = *_vm->_scene;
+ const int PORTRAIT_W = 100;
+ const int PORTRAIT_H = 76;
+
+ if (_speaker == -1)
+ return Common::Point();
+
+ // Get the position of the character
+ Common::Point pt;
+ if (_speaker == HOLMES) {
+ pt = Common::Point(people[HOLMES]._position.x / FIXED_INT_MULTIPLIER,
+ people[HOLMES]._position.y / FIXED_INT_MULTIPLIER);
+ } else {
+ int objNum = people.findSpeaker(_speaker);
+ if (objNum == -1)
+ return Common::Point();
+
+ pt = scene._bgShapes[objNum]._position;
+ }
+
+ // Adjust the top-left so the center of the portrait will be on the character,
+ // but ensure the portrait will be entirely on-screen
+ pt -= Common::Point(PORTRAIT_W / 2, PORTRAIT_H / 2);
+ pt.x = CLIP((int)pt.x, 20, SHERLOCK_SCREEN_WIDTH - 20 - PORTRAIT_W);
+ pt.y = CLIP((int)pt.y, 20, SHERLOCK_SCREEN_HEIGHT - 20 - PORTRAIT_H);
+
+ return pt;
+}
+
void ScalpelTalk::drawInterface() {
FixedText &fixedText = *_vm->_fixedText;
ScalpelScreen &screen = *(ScalpelScreen *)_vm->_screen;
diff --git a/engines/sherlock/scalpel/scalpel_talk.h b/engines/sherlock/scalpel/scalpel_talk.h
index 66b6f98351..4d54273f4a 100644
--- a/engines/sherlock/scalpel/scalpel_talk.h
+++ b/engines/sherlock/scalpel/scalpel_talk.h
@@ -39,6 +39,11 @@ class ScalpelTalk : public Talk {
private:
Common::Stack<SequenceEntry> _sequenceStack;
+ /**
+ * Get the center position for the current speaker, if any
+ */
+ Common::Point get3doPortraitPosition() const;
+
OpcodeReturn cmdSwitchSpeaker(const byte *&str);
OpcodeReturn cmdAssignPortraitLocation(const byte *&str);
OpcodeReturn cmdGotoScene(const byte *&str);