[Scummvm-cvs-logs] scummvm master -> 0d662c22a34547578fca52483f580db34b215cc0

dreammaster dreammaster at scummvm.org
Sat Sep 12 04:19:41 CEST 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
0d662c22a3 SHERLOCK: 3DO: Implement placement of portrait videos


Commit: 0d662c22a34547578fca52483f580db34b215cc0
    https://github.com/scummvm/scummvm/commit/0d662c22a34547578fca52483f580db34b215cc0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-09-11T22:19:10-04:00

Commit Message:
SHERLOCK: 3DO: Implement placement of portrait videos

Changed paths:
    engines/sherlock/scalpel/scalpel_talk.cpp
    engines/sherlock/scalpel/scalpel_talk.h



diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp
index 848502e..2d1a8a9 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 66b6f98..4d54273 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);






More information about the Scummvm-git-logs mailing list