diff options
author | Johannes Schickel | 2006-05-21 16:06:29 +0000 |
---|---|---|
committer | Johannes Schickel | 2006-05-21 16:06:29 +0000 |
commit | 344cc2f475c22df613b097fe9fb969cf373e32ca (patch) | |
tree | e6f3cea03e568548fb566d570ff502d7509c3187 | |
parent | ef6645c5ba9d87e888516df457e4d72cf9b0a2cf (diff) | |
download | scummvm-rg350-344cc2f475c22df613b097fe9fb969cf373e32ca.tar.gz scummvm-rg350-344cc2f475c22df613b097fe9fb969cf373e32ca.tar.bz2 scummvm-rg350-344cc2f475c22df613b097fe9fb969cf373e32ca.zip |
- allows kyra3 to exit again
- implements language selection for kyra3
svn-id: r22559
-rw-r--r-- | engines/kyra/kyra.h | 6 | ||||
-rw-r--r-- | engines/kyra/kyra3.cpp | 44 | ||||
-rw-r--r-- | engines/kyra/sound_digital.cpp | 4 |
3 files changed, 46 insertions, 8 deletions
diff --git a/engines/kyra/kyra.h b/engines/kyra/kyra.h index cf30b20c3a..c3de128354 100644 --- a/engines/kyra/kyra.h +++ b/engines/kyra/kyra.h @@ -1024,7 +1024,7 @@ public: SoundDigital *soundDigital() { return _soundDigital; } - int setupGameFlags() { _game = GI_KYRA3; return 0; } + int setupGameFlags(); int go(); @@ -1034,6 +1034,8 @@ private: SoundDigital *_soundDigital; + int _lang; + // sound specific private: void playMenuAudioFile(); @@ -1045,7 +1047,7 @@ private: private: static const char *_mainMenuStrings[]; int handleMainMenu(WSAMovieV3 *logo); - void drawMainMenu(const char * const *strings, int unk1); + void drawMainMenu(const char * const *strings); void drawMainBox(int x, int y, int w, int h, int fill); void gui_printString(const char *string, int x, int y, int col1, int col2, int flags, ...); diff --git a/engines/kyra/kyra3.cpp b/engines/kyra/kyra3.cpp index 7edf601153..024f244782 100644 --- a/engines/kyra/kyra3.cpp +++ b/engines/kyra/kyra3.cpp @@ -27,6 +27,7 @@ #include "kyra/text.h" #include "common/system.h" +#include "common/config-manager.h" namespace Kyra { KyraEngine_v3::KyraEngine_v3(OSystem *system) : KyraEngine(system) { @@ -39,6 +40,35 @@ KyraEngine_v3::~KyraEngine_v3() { delete _soundDigital; } +int KyraEngine_v3::setupGameFlags() { + _game = GI_KYRA3; + _lang = 0; + Common::Language lang = Common::parseLanguage(ConfMan.get("language")); + + switch (lang) { + case Common::EN_ANY: + case Common::EN_USA: + case Common::EN_GRB: + _lang = 0; + break; + + case Common::FR_FRA: + _lang = 1; + break; + + case Common::DE_DEU: + _lang = 2; + break; + + default: + warning("unsupported language, switching back to English"); + _lang = 0; + break; + } + + return 0; +} + Movie *KyraEngine_v3::createWSAMovie() { return new WSAMovieV3(this); } @@ -159,7 +189,7 @@ int KyraEngine_v3::handleMainMenu(WSAMovieV3 *logo) { memset(colorMap, 0, sizeof(colorMap)); _screen->setTextColorMap(colorMap); - const char * const *strings = &_mainMenuStrings[/*_lang*4*/0]; + const char * const *strings = &_mainMenuStrings[_lang << 2]; Screen::FontId oldFont = _screen->setFont(Screen::FID_8_FNT); int charWidthBackUp = _screen->_charWidth; @@ -177,9 +207,10 @@ int KyraEngine_v3::handleMainMenu(WSAMovieV3 *logo) { int curFrame = 29, frameAdd = 1; uint32 nextRun = 0; - drawMainMenu(strings, 0xFFFF); + drawMainMenu(strings); + _system->warpMouse(300, 180); - while (command == -1) { + while (command == -1 && !_quitFlag) { // yes 2 * _tickLength here not 3 * like in the first draw nextRun = _system->getMillis() + 2 * _tickLength; logo->displayFrame(curFrame); @@ -204,6 +235,9 @@ int KyraEngine_v3::handleMainMenu(WSAMovieV3 *logo) { } } + if (_quitFlag) + command = -1; + _screen->copyBlockToPage(_screen->_curPage, _screen->_curDim->sx, _screen->_curDim->sy, _screen->_curDim->w, _screen->_curDim->h, _screen->getPagePtr(3)); _screen->_charWidth = charWidthBackUp; _screen->setFont(oldFont); @@ -217,8 +251,8 @@ int KyraEngine_v3::handleMainMenu(WSAMovieV3 *logo) { return command; } -void KyraEngine_v3::drawMainMenu(const char * const *strings, int unk1) { - debugC(9, kDebugLevelMain, "KyraEngine::playMenuAudioFile(%p, %d)", (const void*)strings, unk1); +void KyraEngine_v3::drawMainMenu(const char * const *strings) { + debugC(9, kDebugLevelMain, "KyraEngine::playMenuAudioFile(%p)", (const void*)strings); static const uint16 menuTable[] = { 0x01, 0x04, 0x0C, 0x04, 0x00, 0x80, 0xFF, 0x00, 0x01, 0x02, 0x03 }; int top = _screen->_curDim->sy; diff --git a/engines/kyra/sound_digital.cpp b/engines/kyra/sound_digital.cpp index a9dae3c610..1db2e45d86 100644 --- a/engines/kyra/sound_digital.cpp +++ b/engines/kyra/sound_digital.cpp @@ -284,7 +284,9 @@ int AUDStream::readChunk(int16 *buffer, const int maxSamples) { #pragma mark - -SoundDigital::SoundDigital(KyraEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer), _sounds() {} +SoundDigital::SoundDigital(KyraEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer), _sounds() { + memset(_sounds, 0, sizeof(_sounds)); +} SoundDigital::~SoundDigital() { for (int i = 0; i < SOUND_STREAMS; ++i) { |