diff options
author | Gregory Montoir | 2008-11-30 11:24:39 +0000 |
---|---|---|
committer | Gregory Montoir | 2008-11-30 11:24:39 +0000 |
commit | 2811ebf905be48d9007d5265e022da6a1f705693 (patch) | |
tree | a5be45b0099792da3937a55060f2b9b69b7aa65c | |
parent | 7f69d3e9a2b0e4c8d1563063c2f5521cf1af039b (diff) | |
download | scummvm-rg350-2811ebf905be48d9007d5265e022da6a1f705693.tar.gz scummvm-rg350-2811ebf905be48d9007d5265e022da6a1f705693.tar.bz2 scummvm-rg350-2811ebf905be48d9007d5265e022da6a1f705693.zip |
enabled subtitles
svn-id: r35187
-rw-r--r-- | engines/tucker/resource.cpp | 2 | ||||
-rw-r--r-- | engines/tucker/sequences.cpp | 2 | ||||
-rw-r--r-- | engines/tucker/tucker.cpp | 24 | ||||
-rw-r--r-- | engines/tucker/tucker.h | 8 |
4 files changed, 21 insertions, 15 deletions
diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp index ca903a7e21..9cc17982ef 100644 --- a/engines/tucker/resource.cpp +++ b/engines/tucker/resource.cpp @@ -268,7 +268,7 @@ void TuckerEngine::loadCursor() { 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(); } diff --git a/engines/tucker/sequences.cpp b/engines/tucker/sequences.cpp index a1523c7aa0..0ef0bab018 100644 --- a/engines/tucker/sequences.cpp +++ b/engines/tucker/sequences.cpp @@ -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; diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp index 6d5740ff2f..55d2e0d089 100644 --- a/engines/tucker/tucker.cpp +++ b/engines/tucker/tucker.cpp @@ -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 @@ bool TuckerEngine::hasFeature(EngineFeature f) const { Common::Error TuckerEngine::go() { handleIntroSequence(); - if (!_isDemo && !shouldQuit()) { + if (!_gameVer.isDemo && !shouldQuit()) { mainLoop(); } return Common::kNoError; @@ -135,7 +138,7 @@ void TuckerEngine::restart() { _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 @@ void TuckerEngine::mainLoop() { } 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 @@ void TuckerEngine::mainLoop() { _displaySpeechText = true; // kDefaultCharSpeechSoundCounter = 70; } + ConfMan.setBool("subtitles", _displaySpeechText); } } if (_inputKeys[kInputKeyHelp]) { @@ -1892,7 +1896,7 @@ void TuckerEngine::drawInfoString() { 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 @@ void TuckerEngine::drawSpeechText(int xStart, int y, const uint8 *dataPtr, int n 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 @@ void TuckerEngine::drawSpeechText(int xStart, int y, const uint8 *dataPtr, int n 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; } diff --git a/engines/tucker/tucker.h b/engines/tucker/tucker.h index 5dde36fb21..b26e8b20b4 100644 --- a/engines/tucker/tucker.h +++ b/engines/tucker/tucker.h @@ -558,11 +558,13 @@ protected: 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; |