[Scummvm-cvs-logs] SF.net SVN: scummvm:[51757] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Thu Aug 5 16:41:00 CEST 2010


Revision: 51757
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51757&view=rev
Author:   lordhoto
Date:     2010-08-05 14:41:00 +0000 (Thu, 05 Aug 2010)

Log Message:
-----------
KYRA: Add support for subtitle options changes via GMM.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/detection.cpp
    scummvm/trunk/engines/kyra/kyra_hof.cpp
    scummvm/trunk/engines/kyra/kyra_lok.h
    scummvm/trunk/engines/kyra/kyra_mr.cpp
    scummvm/trunk/engines/kyra/kyra_v1.cpp
    scummvm/trunk/engines/kyra/kyra_v2.cpp
    scummvm/trunk/engines/kyra/kyra_v2.h
    scummvm/trunk/engines/kyra/text_hof.cpp
    scummvm/trunk/engines/kyra/text_lok.cpp
    scummvm/trunk/engines/kyra/text_mr.cpp
    scummvm/trunk/engines/kyra/timer_hof.cpp
    scummvm/trunk/engines/kyra/timer_lok.cpp

Modified: scummvm/trunk/engines/kyra/detection.cpp
===================================================================
--- scummvm/trunk/engines/kyra/detection.cpp	2010-08-05 14:40:22 UTC (rev 51756)
+++ scummvm/trunk/engines/kyra/detection.cpp	2010-08-05 14:41:00 UTC (rev 51757)
@@ -105,7 +105,8 @@
 	return
 		(f == kSupportsRTL) ||
 		(f == kSupportsLoadingDuringRuntime) ||
-		(f == kSupportsSavingDuringRuntime);
+		(f == kSupportsSavingDuringRuntime) ||
+		(f == kSupportsSubtitleOptions);
 }
 
 bool KyraMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {

Modified: scummvm/trunk/engines/kyra/kyra_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_hof.cpp	2010-08-05 14:40:22 UTC (rev 51756)
+++ scummvm/trunk/engines/kyra/kyra_hof.cpp	2010-08-05 14:41:00 UTC (rev 51757)
@@ -679,7 +679,7 @@
 	restorePage3();
 	drawAnimObjects();
 
-	if (textEnabled() && _chatText) {
+	if (_chatTextEnabled && _chatText) {
 		int pageBackUp = _screen->_curPage;
 		_screen->_curPage = 2;
 		objectChatPrintText(_chatText, _chatObject);
@@ -1996,9 +1996,10 @@
 }
 
 void KyraEngine_HoF::readSettings() {
+	KyraEngine_v2::readSettings();
+
 	int talkspeed = ConfMan.getInt("talkspeed");
 	_configTextspeed = (talkspeed*95)/255 + 2;
-	KyraEngine_v1::readSettings();
 }
 
 } // End of namespace Kyra

Modified: scummvm/trunk/engines/kyra/kyra_lok.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_lok.h	2010-08-05 14:40:22 UTC (rev 51756)
+++ scummvm/trunk/engines/kyra/kyra_lok.h	2010-08-05 14:41:00 UTC (rev 51757)
@@ -319,7 +319,7 @@
 	// chat
 	// -> process
 	void characterSays(int vocFile, const char *chatStr, int8 charNum, int8 chatDuration);
-	void waitForChatToFinish(int vocFile, int16 chatDuration, const char *str, uint8 charNum);
+	void waitForChatToFinish(int vocFile, int16 chatDuration, const char *str, uint8 charNum, const bool printText);
 
 	// -> initialization
 	int initCharacterChat(int8 charNum);

Modified: scummvm/trunk/engines/kyra/kyra_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_mr.cpp	2010-08-05 14:40:22 UTC (rev 51756)
+++ scummvm/trunk/engines/kyra/kyra_mr.cpp	2010-08-05 14:41:00 UTC (rev 51757)
@@ -1127,7 +1127,7 @@
 
 	restorePage3();
 	drawAnimObjects();
-	if (textEnabled() && _chatText) {
+	if (_chatTextEnabled && _chatText) {
 		int curPage = _screen->_curPage;
 		_screen->_curPage = 2;
 		objectChatPrintText(_chatText, _chatObject);
@@ -1490,7 +1490,7 @@
 }
 
 void KyraEngine_MR::readSettings() {
-	KyraEngine_v1::readSettings();
+	KyraEngine_v2::readSettings();
 
 	_configStudio = ConfMan.getBool("studio_audience");
 	_configSkip = ConfMan.getBool("skip_support");

Modified: scummvm/trunk/engines/kyra/kyra_v1.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v1.cpp	2010-08-05 14:40:22 UTC (rev 51756)
+++ scummvm/trunk/engines/kyra/kyra_v1.cpp	2010-08-05 14:41:00 UTC (rev 51757)
@@ -625,6 +625,10 @@
 void KyraEngine_v1::syncSoundSettings() {
 	Engine::syncSoundSettings();
 
+	// We need to use this here to allow the subtitle options to be changed
+	// through the GMM's options dialog.
+	readSettings();
+
 	if (_sound)
 		_sound->updateVolumeSettings();
 }

Modified: scummvm/trunk/engines/kyra/kyra_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.cpp	2010-08-05 14:40:22 UTC (rev 51756)
+++ scummvm/trunk/engines/kyra/kyra_v2.cpp	2010-08-05 14:41:00 UTC (rev 51757)
@@ -63,6 +63,7 @@
 	_chatVocLow = -1;
 	_chatText = 0;
 	_chatObject = -1;
+	_chatTextEnabled = false;
 
 	memset(_hiddenItems, -1, sizeof(_hiddenItems));
 

Modified: scummvm/trunk/engines/kyra/kyra_v2.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.h	2010-08-05 14:40:22 UTC (rev 51756)
+++ scummvm/trunk/engines/kyra/kyra_v2.h	2010-08-05 14:41:00 UTC (rev 51757)
@@ -350,6 +350,7 @@
 	int _chatObject;
 	uint32 _chatEndTime;
 	int _chatVocHigh, _chatVocLow;
+	bool _chatTextEnabled;
 
 	EMCData _chatScriptData;
 	EMCState _chatScriptState;

Modified: scummvm/trunk/engines/kyra/text_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/text_hof.cpp	2010-08-05 14:40:22 UTC (rev 51756)
+++ scummvm/trunk/engines/kyra/text_hof.cpp	2010-08-05 14:41:00 UTC (rev 51757)
@@ -255,7 +255,8 @@
 
 	_screen->hideMouse();
 
-	if (textEnabled()) {
+	_chatTextEnabled = textEnabled();
+	if (_chatTextEnabled) {
 		objectChatPrintText(str, object);
 		_chatEndTime = _system->getMillis() + chatCalcDuration(str) * _tickLength;
 	} else {

Modified: scummvm/trunk/engines/kyra/text_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/text_lok.cpp	2010-08-05 14:40:22 UTC (rev 51756)
+++ scummvm/trunk/engines/kyra/text_lok.cpp	2010-08-05 14:41:00 UTC (rev 51757)
@@ -32,10 +32,9 @@
 
 namespace Kyra {
 
-void KyraEngine_LoK::waitForChatToFinish(int vocFile, int16 chatDuration, const char *chatStr, uint8 charNum) {
+void KyraEngine_LoK::waitForChatToFinish(int vocFile, int16 chatDuration, const char *chatStr, uint8 charNum, const bool printText) {
 	bool hasUpdatedNPCs = false;
 	bool runLoop = true;
-	bool drawText = textEnabled();
 	uint8 currPage;
 
 	uint32 timeToEnd = strlen(chatStr) * 8 * _tickLength + _system->getMillis();
@@ -92,7 +91,7 @@
 		_animator->preserveAnyChangedBackgrounds();
 		_animator->prepDrawAllObjects();
 
-		if (drawText) {
+		if (printText) {
 			currPage = _screen->_curPage;
 			_screen->_curPage = 2;
 			_text->printCharacterText(chatStr, charNum, _characterList[charNum].x1);
@@ -102,7 +101,7 @@
 		_animator->copyChangedObjectsForward(0);
 		updateTextFade();
 
-		if (((chatDuration < (int16)(_system->getMillis() - timeAtStart)) && chatDuration != -1 && drawText) || (!drawText && !snd_voiceIsPlaying()))
+		if (((chatDuration < (int16)(_system->getMillis() - timeAtStart)) && chatDuration != -1 && printText) || (!printText && !snd_voiceIsPlaying()))
 			break;
 
 		uint32 nextTime = loopStart + _tickLength;
@@ -293,7 +292,9 @@
 	_text->_talkMessageY = yPos;
 	_text->_talkMessageH = lineNum * 10;
 
-	if (textEnabled()) {
+	const bool printText = textEnabled();
+
+	if (printText) {
 		_animator->restoreAllObjectBackgrounds();
 
 		_screen->copyRegion(12, _text->_talkMessageY, 12, 136, 296, _text->_talkMessageH, 2, 2);
@@ -310,9 +311,9 @@
 
 	if (!speechEnabled())
 		vocFile = -1;
-	waitForChatToFinish(vocFile, chatTicks, chatStr, charNum);
+	waitForChatToFinish(vocFile, chatTicks, chatStr, charNum, printText);
 
-	if (textEnabled()) {
+	if (printText) {
 		_animator->restoreAllObjectBackgrounds();
 
 		_screen->copyRegion(12, 136, 12, _text->_talkMessageY, 296, _text->_talkMessageH, 2, 2);

Modified: scummvm/trunk/engines/kyra/text_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/text_mr.cpp	2010-08-05 14:40:22 UTC (rev 51756)
+++ scummvm/trunk/engines/kyra/text_mr.cpp	2010-08-05 14:41:00 UTC (rev 51757)
@@ -265,7 +265,8 @@
 
 	_screen->hideMouse();
 
-	if (textEnabled()) {
+	_chatTextEnabled = textEnabled();
+	if (_chatTextEnabled) {
 		objectChatPrintText(str, object);
 		_chatEndTime = _system->getMillis() + chatCalcDuration(str) * _tickLength;
 	} else {

Modified: scummvm/trunk/engines/kyra/timer_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/timer_hof.cpp	2010-08-05 14:40:22 UTC (rev 51756)
+++ scummvm/trunk/engines/kyra/timer_hof.cpp	2010-08-05 14:41:00 UTC (rev 51757)
@@ -97,6 +97,9 @@
 }
 
 void KyraEngine_HoF::setWalkspeed(uint8 newSpeed) {
+	if (!_timer)
+		return;
+
 	if (newSpeed < 5)
 		newSpeed = 3;
 	else

Modified: scummvm/trunk/engines/kyra/timer_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/timer_lok.cpp	2010-08-05 14:40:22 UTC (rev 51756)
+++ scummvm/trunk/engines/kyra/timer_lok.cpp	2010-08-05 14:41:00 UTC (rev 51757)
@@ -188,6 +188,9 @@
 }
 
 void KyraEngine_LoK::setWalkspeed(uint8 newSpeed) {
+	if (!_timer)
+		return;
+
 	static const uint8 speeds[] = { 11, 9, 6, 5, 3 };
 
 	assert(newSpeed < ARRAYSIZE(speeds));


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