[Scummvm-cvs-logs] SF.net SVN: scummvm:[35187] scummvm/trunk/engines/tucker

cyx at users.sourceforge.net cyx at users.sourceforge.net
Sun Nov 30 12:24:39 CET 2008


Revision: 35187
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35187&view=rev
Author:   cyx
Date:     2008-11-30 11:24:39 +0000 (Sun, 30 Nov 2008)

Log Message:
-----------
enabled subtitles

Modified Paths:
--------------
    scummvm/trunk/engines/tucker/resource.cpp
    scummvm/trunk/engines/tucker/sequences.cpp
    scummvm/trunk/engines/tucker/tucker.cpp
    scummvm/trunk/engines/tucker/tucker.h

Modified: scummvm/trunk/engines/tucker/resource.cpp
===================================================================
--- scummvm/trunk/engines/tucker/resource.cpp	2008-11-30 11:05:37 UTC (rev 35186)
+++ scummvm/trunk/engines/tucker/resource.cpp	2008-11-30 11:24:39 UTC (rev 35187)
@@ -268,7 +268,7 @@
 void TuckerEngine::loadCharset() {
 	strcpy(_fileToLoad, "charset.pcx");
 	loadImage(_loadTempBuf, 0);
-	Graphics::setCharset((_lang == Common::FR_FRA) ? kCharsetTypeFrench : kCharsetTypeEnglish);
+	Graphics::setCharset((_gameVer.lang == Common::FR_FRA) ? kCharsetTypeFrench : kCharsetTypeEnglish);
 	loadCharsetHelper();
 }
 

Modified: scummvm/trunk/engines/tucker/sequences.cpp
===================================================================
--- scummvm/trunk/engines/tucker/sequences.cpp	2008-11-30 11:05:37 UTC (rev 35186)
+++ scummvm/trunk/engines/tucker/sequences.cpp	2008-11-30 11:24:39 UTC (rev 35187)
@@ -34,7 +34,7 @@
 namespace Tucker {
 
 void TuckerEngine::handleIntroSequence() {
-	const int firstSequence = _isDemo ? kFirstAnimationSequenceDemo : kFirstAnimationSequenceGame;
+	const int firstSequence = _gameVer.isDemo ? kFirstAnimationSequenceDemo : kFirstAnimationSequenceGame;
 	_player = new AnimationSequencePlayer(_system, _mixer, _eventMan, firstSequence);
 	_player->mainLoop();
 	delete _player;

Modified: scummvm/trunk/engines/tucker/tucker.cpp
===================================================================
--- scummvm/trunk/engines/tucker/tucker.cpp	2008-11-30 11:05:37 UTC (rev 35186)
+++ scummvm/trunk/engines/tucker/tucker.cpp	2008-11-30 11:24:39 UTC (rev 35187)
@@ -35,7 +35,10 @@
 namespace Tucker {
 
 TuckerEngine::TuckerEngine(OSystem *system, Common::Language language, bool isDemo)
-	: Engine(system), _lang(language), _isDemo(isDemo) {
+	: Engine(system) {
+	_gameVer.lang = language;
+	_gameVer.isDemo = isDemo;
+	_gameVer.hasSubtitles = (language != Common::FR_FRA); // only a few subtitles are translated to french
 }
 
 TuckerEngine::~TuckerEngine() {
@@ -60,7 +63,7 @@
 
 Common::Error TuckerEngine::go() {
 	handleIntroSequence();
-	if (!_isDemo && !shouldQuit()) {
+	if (!_gameVer.isDemo && !shouldQuit()) {
 		mainLoop();
 	}
 	return Common::kNoError;
@@ -135,7 +138,7 @@
 	_gamePaused = _gamePaused2 = false;
 	_gameDebug = false;
 	_displayGameHints = false;
-	_displaySpeechText = false;
+	_displaySpeechText = _gameVer.hasSubtitles ? ConfMan.getBool("subtitles") : false;
 	memset(_flagsTable, 0, sizeof(_flagsTable));
 
 	_gameHintsIndex = 0;
@@ -545,7 +548,7 @@
 		}
 		if (_inputKeys[kInputKeyToggleTextSpeech]) {
 			_inputKeys[kInputKeyToggleTextSpeech] = false;
-			if (_lang != Common::FR_FRA) { // only a few subtitles are translated to french
+			if (_gameVer.hasSubtitles) {
 				if (_displaySpeechText) {
 					_displaySpeechText = false;
 //					kDefaultCharSpeechSoundCounter = 1;
@@ -553,6 +556,7 @@
 					_displaySpeechText = true;
 //					kDefaultCharSpeechSoundCounter = 70;
 				}
+				ConfMan.setBool("subtitles", _displaySpeechText);
 			}
 		}
 		if (_inputKeys[kInputKeyHelp]) {
@@ -1892,7 +1896,7 @@
 	if (_actionRequiresTwoObjects) {
 		verbPreposition = (_actionVerb == 5) ? 12 : 11;
 		verbPrepositionWidth = getStringWidth(verbPreposition, infoStrBuf) + 4;
-		if (_lang == Common::FR_FRA) {
+		if (_gameVer.lang == Common::FR_FRA) {
 			if ((_actionObj2Num > 0 || _actionObj2Type > 0) && verbPreposition > 0) {
 				infoStringWidth = 0;
 				verbWidth = 0;
@@ -3708,15 +3712,15 @@
 	int x = (xStart - _scrollOffset) * 2;
 	int offset = (_scrollOffset + 320 - xStart) * 2;
 	if (_conversationOptionsCount > 0) {
-		x = 319;
+		x = 304;
 	} else {
 		if (x > offset) {
 			x = offset;
 		}
 		if (x > 180) {
-			x = 220;
+			x = 180;
 		} else if (x < 150) {
-			x = 220;
+			x = 150;
 		}
 	}
 	int count = 0;
@@ -3740,14 +3744,14 @@
 		int dstOffset = xStart - lines[i].w / 2;
 		if (dstOffset < _scrollOffset) {
 			dstOffset = _scrollOffset;
-		} else if (lines[i].w > _scrollOffset + 320) {
+		} else if (dstOffset > _scrollOffset + 320 - lines[i].w) {
 			dstOffset = _scrollOffset + 320 - lines[i].w;
 		}
 		uint8 *dst;
 		if (_conversationOptionsCount) {
 			dstOffset = xStart + _scrollOffset;
 			dst = (i * 10 + y) * 640 + _locationBackgroundGfxBuf + dstOffset;
-			_panelItemWidth = count; // ?
+			_panelItemWidth = count;
 		} else {
 			dst = (y - (count - i) * 10) * 640 + _locationBackgroundGfxBuf + dstOffset;
 		}

Modified: scummvm/trunk/engines/tucker/tucker.h
===================================================================
--- scummvm/trunk/engines/tucker/tucker.h	2008-11-30 11:05:37 UTC (rev 35186)
+++ scummvm/trunk/engines/tucker/tucker.h	2008-11-30 11:24:39 UTC (rev 35187)
@@ -558,11 +558,13 @@
 	void loadSound(Audio::Mixer::SoundType type, int num, int volume, bool loop, Audio::SoundHandle *handle);
 	void loadActionsTable();
 
-
 	Common::RandomSource _rnd;
-	Common::Language _lang;
-	bool _isDemo;
 	AnimationSequencePlayer *_player;
+	struct {
+		Common::Language lang;
+		bool isDemo;
+		bool hasSubtitles;
+	} _gameVer;
 
 	bool _quitGame;
 	bool _fastMode;


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