[Scummvm-cvs-logs] SF.net SVN: scummvm: [29427] scummvm/trunk/engines/saga

sev at users.sourceforge.net sev at users.sourceforge.net
Tue Nov 6 00:40:31 CET 2007


Revision: 29427
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29427&view=rev
Author:   sev
Date:     2007-11-05 15:40:30 -0800 (Mon, 05 Nov 2007)

Log Message:
-----------
Several subtitles-related IHNM fixes. Still not perfect.

Modified Paths:
--------------
    scummvm/trunk/engines/saga/actor.cpp
    scummvm/trunk/engines/saga/scene.h

Modified: scummvm/trunk/engines/saga/actor.cpp
===================================================================
--- scummvm/trunk/engines/saga/actor.cpp	2007-11-05 21:07:36 UTC (rev 29426)
+++ scummvm/trunk/engines/saga/actor.cpp	2007-11-05 23:40:30 UTC (rev 29427)
@@ -826,9 +826,16 @@
 			width = _activeSpeech.speechBox.width();
 			height = _vm->_font->getHeight(kKnownFontScript, _activeSpeech.strings[0], width - 2, _activeSpeech.getFontFlags(0)) + 1;
 
-			if (height > 40 && width < _vm->getDisplayWidth() - 100) {
-				width = _vm->getDisplayWidth() - 100;
-				height = _vm->_font->getHeight(kKnownFontScript, _activeSpeech.strings[0], width - 2, _activeSpeech.getFontFlags(0)) + 1;
+			if (_vm->getGameType() == GType_IHNM) {
+				if (height > _vm->_scene->getHeight(true) / 2 && width < _vm->getDisplayWidth() - 20) {
+					width = _vm->getDisplayWidth() - 20;
+					height = _vm->_font->getHeight(kKnownFontScript, _activeSpeech.strings[0], width - 2, _activeSpeech.getFontFlags(0)) + 1;
+				}
+			} else if (_vm->getGameType() == GType_ITE) {
+				if (height > 40 && width < _vm->getDisplayWidth() - 100) {
+					width = _vm->getDisplayWidth() - 100;
+					height = _vm->_font->getHeight(kKnownFontScript, _activeSpeech.strings[0], width - 2, _activeSpeech.getFontFlags(0)) + 1;
+				}
 			}
 
 			_activeSpeech.speechBox.setWidth(width);
@@ -844,8 +851,8 @@
 				}
 
 				height2 = actor->_screenPosition.y - 50;
-				if (height2 > _vm->_scene->getHeight())
-					_activeSpeech.speechBox.top = _activeSpeech.drawRect.top = _vm->_scene->getHeight() - 1 - height - 10;
+				if (height2 > _vm->_scene->getHeight(true))
+					_activeSpeech.speechBox.top = _activeSpeech.drawRect.top = _vm->_scene->getHeight(true) - 1 - height - 10;
 				else
 					_activeSpeech.speechBox.top = _activeSpeech.drawRect.top = MAX(10, (height2 - height) / 2);
 			} else {
@@ -1095,8 +1102,12 @@
 			calcScreenPosition(actor);
 
 			textPoint.x = clamp(10, actor->_screenPosition.x - width / 2, _vm->getDisplayWidth() - 10 - width);
-			textPoint.y = clamp(10, actor->_screenPosition.y - 58, _vm->_scene->getHeight() - 10 - height);
 
+			if (_vm->getGameType() == GType_ITE)
+				textPoint.y = clamp(10, actor->_screenPosition.y - 58, _vm->_scene->getHeight(true) - 10 - height);
+			else if (_vm->getGameType() == GType_IHNM)
+				textPoint.y = 10; // clamp(10, actor->_screenPosition.y - 160, _vm->_scene->getHeight(true) - 10 - height);
+
 			_vm->_font->textDraw(kKnownFontScript, backBuffer, outputString, textPoint,
 				_activeSpeech.speechColor[i], _activeSpeech.outlineColor[i], _activeSpeech.getFontFlags(i));
 		}
@@ -1130,8 +1141,12 @@
 	_activeSpeech.slowModeCharIndex = 0;
 
 	dist = MIN(actor->_screenPosition.x - 10, _vm->getDisplayWidth() - 10 - actor->_screenPosition.x);
-	dist = clamp(60, dist, 150);
 
+	if (_vm->getGameType() == GType_ITE)
+		dist = clamp(60, dist, 150);
+	else
+		dist = clamp(120, dist, 300);
+
 	_activeSpeech.speechBox.left = actor->_screenPosition.x - dist;
 	_activeSpeech.speechBox.right = actor->_screenPosition.x + dist;
 

Modified: scummvm/trunk/engines/saga/scene.h
===================================================================
--- scummvm/trunk/engines/saga/scene.h	2007-11-05 21:07:36 UTC (rev 29426)
+++ scummvm/trunk/engines/saga/scene.h	2007-11-05 23:40:30 UTC (rev 29427)
@@ -334,8 +334,8 @@
 
 	void drawTextList(Surface *ds);
 
-	int getHeight() const {
-		if (_vm->getGameType() == GType_IHNM && _vm->_scene->currentChapterNumber() == 8)
+	int getHeight(bool speech = false) const {
+		if (_vm->getGameType() == GType_IHNM && _vm->_scene->currentChapterNumber() == 8 && !speech)
 			return _vm->getDisplayInfo().logicalHeight;
 		else
 			return _vm->getDisplayInfo().sceneHeight;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list