[Scummvm-cvs-logs] SF.net SVN: scummvm: [32028] scummvm/trunk/engines/kyra
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Sun May 11 19:50:13 CEST 2008
Revision: 32028
http://scummvm.svn.sourceforge.net/scummvm/?rev=32028&view=rev
Author: lordhoto
Date: 2008-05-11 10:50:13 -0700 (Sun, 11 May 2008)
Log Message:
-----------
Implemented helium mode support for Kyra3.
Modified Paths:
--------------
scummvm/trunk/engines/kyra/gui_mr.cpp
scummvm/trunk/engines/kyra/gui_mr.h
scummvm/trunk/engines/kyra/kyra_mr.cpp
scummvm/trunk/engines/kyra/kyra_mr.h
scummvm/trunk/engines/kyra/sound.h
scummvm/trunk/engines/kyra/sound_digital.cpp
scummvm/trunk/engines/kyra/staticres.cpp
Modified: scummvm/trunk/engines/kyra/gui_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui_mr.cpp 2008-05-11 17:20:23 UTC (rev 32027)
+++ scummvm/trunk/engines/kyra/gui_mr.cpp 2008-05-11 17:50:13 UTC (rev 32028)
@@ -1539,15 +1539,26 @@
return 0;
}
+int GUI_MR::toggleHeliumMode(Button *caller) {
+ updateMenuButton(caller);
+ _vm->_configHelium ^= 1;
+ if (_vm->_configHelium)
+ _audioOptions.item[3].itemId = 18;
+ else
+ _audioOptions.item[3].itemId = 17;
+ renewHighlight(_audioOptions);
+ return 0;
+}
+
int GUI_MR::audioOptions(Button *caller) {
updateMenuButton(caller);
restorePage1(_vm->_screenBuffer);
backUpPage1(_vm->_screenBuffer);
- //if (_configHelium)
- // _audioOptions.item[3].itemId = 18;
- //else
+ if (_vm->_configHelium)
+ _audioOptions.item[3].itemId = 18;
+ else
_audioOptions.item[3].itemId = 17;
initMenu(_audioOptions);
Modified: scummvm/trunk/engines/kyra/gui_mr.h
===================================================================
--- scummvm/trunk/engines/kyra/gui_mr.h 2008-05-11 17:20:23 UTC (rev 32027)
+++ scummvm/trunk/engines/kyra/gui_mr.h 2008-05-11 17:50:13 UTC (rev 32028)
@@ -79,6 +79,7 @@
int changeLanguage(Button *caller);
int toggleStudioSFX(Button *caller);
int toggleSkipSupport(Button *caller);
+ int toggleHeliumMode(Button *caller);
KyraEngine_MR *_vm;
Screen_MR *_screen;
Modified: scummvm/trunk/engines/kyra/kyra_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_mr.cpp 2008-05-11 17:20:23 UTC (rev 32027)
+++ scummvm/trunk/engines/kyra/kyra_mr.cpp 2008-05-11 17:50:13 UTC (rev 32028)
@@ -146,6 +146,7 @@
_chatAltFlag = false;
_albumChatActive = false;
memset(&_album, 0, sizeof(_album));
+ _configHelium = false;
}
KyraEngine_MR::~KyraEngine_MR() {
@@ -1515,6 +1516,7 @@
ConfMan.registerDefault("walkspeed", 5);
ConfMan.registerDefault("studio_audience", true);
ConfMan.registerDefault("skip_support", true);
+ ConfMan.registerDefault("helium_mode", false);
}
void KyraEngine_MR::writeSettings() {
@@ -1538,6 +1540,7 @@
ConfMan.setBool("studio_audience", _configStudio);
ConfMan.setBool("skip_support", _configSkip);
+ ConfMan.setBool("helium_mode", _configHelium);
KyraEngine::writeSettings();
}
@@ -1548,6 +1551,7 @@
_configStudio = ConfMan.getBool("studio_audience");
_configSkip = ConfMan.getBool("skip_support");
+ _configHelium = ConfMan.getBool("helium_mode");
}
} // end of namespace Kyra
Modified: scummvm/trunk/engines/kyra/kyra_mr.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_mr.h 2008-05-11 17:20:23 UTC (rev 32027)
+++ scummvm/trunk/engines/kyra/kyra_mr.h 2008-05-11 17:50:13 UTC (rev 32028)
@@ -55,6 +55,7 @@
GUI_v2 *gui_v2() const { return _gui; }
SoundDigital *soundDigital() { return _soundDigital; }
int language() const { return _lang; }
+ bool heliumMode() const { return _configHelium; }
int go();
@@ -66,6 +67,7 @@
// config
bool _configStudio;
bool _configSkip;
+ bool _configHelium;
void registerDefaultSettings();
void writeSettings();
Modified: scummvm/trunk/engines/kyra/sound.h
===================================================================
--- scummvm/trunk/engines/kyra/sound.h 2008-05-11 17:20:23 UTC (rev 32027)
+++ scummvm/trunk/engines/kyra/sound.h 2008-05-11 17:50:13 UTC (rev 32028)
@@ -491,6 +491,7 @@
// Digital Audio
class AUDStream;
+class KyraEngine_MR;
/**
* Digital audio output device.
@@ -499,7 +500,7 @@
*/
class SoundDigital {
public:
- SoundDigital(KyraEngine *vm, Audio::Mixer *mixer);
+ SoundDigital(KyraEngine_MR *vm, Audio::Mixer *mixer);
~SoundDigital();
bool init() { return true; }
@@ -548,7 +549,7 @@
*/
void beginFadeOut(int channel, int ticks);
private:
- KyraEngine *_vm;
+ KyraEngine_MR *_vm;
Audio::Mixer *_mixer;
struct Sound {
Modified: scummvm/trunk/engines/kyra/sound_digital.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_digital.cpp 2008-05-11 17:20:23 UTC (rev 32027)
+++ scummvm/trunk/engines/kyra/sound_digital.cpp 2008-05-11 17:50:13 UTC (rev 32028)
@@ -25,6 +25,7 @@
#include "kyra/sound.h"
#include "kyra/resource.h"
+#include "kyra/kyra_mr.h"
#include "sound/audiostream.h"
@@ -45,6 +46,7 @@
bool isStereo() const { return false; }
bool endOfData() const { return _endOfData; }
+ void setRate(int newRate) { _rate = newRate; }
int getRate() const { return _rate; }
void beginFadeIn(uint32 millis);
@@ -319,7 +321,7 @@
#pragma mark -
-SoundDigital::SoundDigital(KyraEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer), _sounds() {
+SoundDigital::SoundDigital(KyraEngine_MR *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer), _sounds() {
for (uint i = 0; i < ARRAYSIZE(_sounds); ++i)
_sounds[i].stream = 0;
}
@@ -384,6 +386,9 @@
if (volume > 255)
volume = 255;
volume = (volume * Audio::Mixer::kMaxChannelVolume) / 255;
+
+ if (type == Audio::Mixer::kSpeechSoundType && _vm->heliumMode())
+ use->stream->setRate(32765);
_mixer->playInputStream(type, &use->handle, use->stream, -1, volume);
Modified: scummvm/trunk/engines/kyra/staticres.cpp
===================================================================
--- scummvm/trunk/engines/kyra/staticres.cpp 2008-05-11 17:20:23 UTC (rev 32027)
+++ scummvm/trunk/engines/kyra/staticres.cpp 2008-05-11 17:50:13 UTC (rev 32028)
@@ -2596,6 +2596,7 @@
GUI_V2_MENU_ITEM(_audioOptions.item[1], 0, 0, 160, 47, 116, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 24, 8, 49, 0x0000);
GUI_V2_MENU_ITEM(_audioOptions.item[2], 0, 0, 160, 64, 116, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 39, 8, 66, 0x0000);
GUI_V2_MENU_ITEM(_audioOptions.item[3], 1, 0, 152, 81, 116, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 47, 8, 83, 0x0000);
+ _audioOptions.item[3].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::toggleHeliumMode);
GUI_V2_MENU_ITEM(_audioOptions.item[4], 1, 16, -1, 110, 92, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
_audioOptions.item[4].callback = clickQuitOptionsFunctor;
for (int i = 5; i < 7; ++i)
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