[Scummvm-cvs-logs] SF.net SVN: scummvm:[41733] scummvm/trunk/engines/kyra
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Sun Jun 21 22:10:46 CEST 2009
Revision: 41733
http://scummvm.svn.sourceforge.net/scummvm/?rev=41733&view=rev
Author: lordhoto
Date: 2009-06-21 20:10:45 +0000 (Sun, 21 Jun 2009)
Log Message:
-----------
Cleanup.
Modified Paths:
--------------
scummvm/trunk/engines/kyra/gui_hof.cpp
scummvm/trunk/engines/kyra/gui_lol.cpp
scummvm/trunk/engines/kyra/gui_mr.cpp
scummvm/trunk/engines/kyra/kyra_v1.cpp
scummvm/trunk/engines/kyra/kyra_v1.h
scummvm/trunk/engines/kyra/lol.h
scummvm/trunk/engines/kyra/script_lol.cpp
scummvm/trunk/engines/kyra/sound_lol.cpp
scummvm/trunk/engines/kyra/text_lok.cpp
Modified: scummvm/trunk/engines/kyra/gui_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui_hof.cpp 2009-06-21 19:49:20 UTC (rev 41732)
+++ scummvm/trunk/engines/kyra/gui_hof.cpp 2009-06-21 20:10:45 UTC (rev 41733)
@@ -855,8 +855,7 @@
position = _vm->_configTextspeed;
}
- position = MAX(2, position);
- position = MIN(97, position);
+ position = CLIP(position, 2, 97);
_screen->drawShape(0, shape, x+position, y, 0, 0);
}
Modified: scummvm/trunk/engines/kyra/gui_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui_lol.cpp 2009-06-21 19:49:20 UTC (rev 41732)
+++ scummvm/trunk/engines/kyra/gui_lol.cpp 2009-06-21 20:10:45 UTC (rev 41733)
@@ -2690,7 +2690,7 @@
_screen->drawShape(0, _vm->_gameShapes[87], tX + oldVolume, button->y, 0, 0x10);
// Temporary HACK
- const int volumeDrawX = _vm->convertValueFromMixer(_vm->convertValueToMixer(newVolume));
+ const int volumeDrawX = _vm->convertVolumeFromMixer(_vm->convertVolumeToMixer(newVolume));
_screen->drawShape(0, _vm->_gameShapes[86], tX + volumeDrawX, button->y, 0, 0x10);
_screen->updateScreen();
Modified: scummvm/trunk/engines/kyra/gui_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui_mr.cpp 2009-06-21 19:49:20 UTC (rev 41732)
+++ scummvm/trunk/engines/kyra/gui_mr.cpp 2009-06-21 20:10:45 UTC (rev 41733)
@@ -1620,8 +1620,7 @@
int position = _vm->getVolume(KyraEngine_v1::kVolumeEntry(slider));
- position = MAX(2, position);
- position = MIN(97, position);
+ position = CLIP(position, 2, 97);
_screen->drawShape(0, shape, x+position, y, 0, 0);
}
Modified: scummvm/trunk/engines/kyra/kyra_v1.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v1.cpp 2009-06-21 19:49:20 UTC (rev 41732)
+++ scummvm/trunk/engines/kyra/kyra_v1.cpp 2009-06-21 20:10:45 UTC (rev 41733)
@@ -594,27 +594,27 @@
return !_flags.isTalkie || (_configVoice == 0 || _configVoice == 2);
}
-int KyraEngine_v1::convertValueToMixer(int value) {
+int KyraEngine_v1::convertVolumeToMixer(int value) {
value -= 2;
return (value * Audio::Mixer::kMaxMixerVolume) / 95;
}
-int KyraEngine_v1::convertValueFromMixer(int value) {
+int KyraEngine_v1::convertVolumeFromMixer(int value) {
return (value * 95) / Audio::Mixer::kMaxMixerVolume + 2;
}
void KyraEngine_v1::setVolume(kVolumeEntry vol, uint8 value) {
switch (vol) {
case kVolumeMusic:
- ConfMan.setInt("music_volume", convertValueToMixer(value));
+ ConfMan.setInt("music_volume", convertVolumeToMixer(value));
break;
case kVolumeSfx:
- ConfMan.setInt("sfx_volume", convertValueToMixer(value));
+ ConfMan.setInt("sfx_volume", convertVolumeToMixer(value));
break;
case kVolumeSpeech:
- ConfMan.setInt("speech_volume", convertValueToMixer(value));
+ ConfMan.setInt("speech_volume", convertVolumeToMixer(value));
break;
}
@@ -629,16 +629,16 @@
uint8 KyraEngine_v1::getVolume(kVolumeEntry vol) {
switch (vol) {
case kVolumeMusic:
- return convertValueFromMixer(ConfMan.getInt("music_volume"));
+ return convertVolumeFromMixer(ConfMan.getInt("music_volume"));
break;
case kVolumeSfx:
- return convertValueFromMixer(ConfMan.getInt("sfx_volume"));
+ return convertVolumeFromMixer(ConfMan.getInt("sfx_volume"));
break;
case kVolumeSpeech:
if (speechEnabled())
- return convertValueFromMixer(ConfMan.getInt("speech_volume"));
+ return convertVolumeFromMixer(ConfMan.getInt("speech_volume"));
else
return 2;
break;
Modified: scummvm/trunk/engines/kyra/kyra_v1.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v1.h 2009-06-21 19:49:20 UTC (rev 41732)
+++ scummvm/trunk/engines/kyra/kyra_v1.h 2009-06-21 20:10:45 UTC (rev 41733)
@@ -289,8 +289,8 @@
const int8 *_trackMap;
int _trackMapSize;
- virtual int convertValueToMixer(int value);
- virtual int convertValueFromMixer(int value);
+ virtual int convertVolumeToMixer(int value);
+ virtual int convertVolumeFromMixer(int value);
// pathfinder
virtual int findWay(int x, int y, int toX, int toY, int *moveTable, int moveTableSize);
Modified: scummvm/trunk/engines/kyra/lol.h
===================================================================
--- scummvm/trunk/engines/kyra/lol.h 2009-06-21 19:49:20 UTC (rev 41732)
+++ scummvm/trunk/engines/kyra/lol.h 2009-06-21 20:10:45 UTC (rev 41733)
@@ -446,8 +446,8 @@
int _timer3Para;
// sound
- int convertValueToMixer(int value);
- int convertValueFromMixer(int value);
+ int convertVolumeToMixer(int value);
+ int convertVolumeFromMixer(int value);
void loadTalkFile(int index);
void snd_playVoiceFile(int track) {}
Modified: scummvm/trunk/engines/kyra/script_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_lol.cpp 2009-06-21 19:49:20 UTC (rev 41732)
+++ scummvm/trunk/engines/kyra/script_lol.cpp 2009-06-21 20:10:45 UTC (rev 41733)
@@ -663,7 +663,7 @@
case 12:
return _drainMagic;
case 13:
- return getVolume(kVolumeSpeech);
+ return getVolume(kVolumeSpeech) - 2;
default:
break;
}
Modified: scummvm/trunk/engines/kyra/sound_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_lol.cpp 2009-06-21 19:49:20 UTC (rev 41732)
+++ scummvm/trunk/engines/kyra/sound_lol.cpp 2009-06-21 20:10:45 UTC (rev 41733)
@@ -304,12 +304,12 @@
return snd_playTrack(-1);
}
-int LoLEngine::convertValueToMixer(int value) {
+int LoLEngine::convertVolumeToMixer(int value) {
value -= 2;
return (value * Audio::Mixer::kMaxMixerVolume) / 100;
}
-int LoLEngine::convertValueFromMixer(int value) {
+int LoLEngine::convertVolumeFromMixer(int value) {
return (value * 100) / Audio::Mixer::kMaxMixerVolume + 2;
}
Modified: scummvm/trunk/engines/kyra/text_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/text_lok.cpp 2009-06-21 19:49:20 UTC (rev 41732)
+++ scummvm/trunk/engines/kyra/text_lok.cpp 2009-06-21 20:10:45 UTC (rev 41733)
@@ -44,7 +44,7 @@
uint32 timeToEnd = strlen(chatStr) * 8 * _tickLength + _system->getMillis();
- if (_configVoice == 0 && chatDuration != -1) {
+ if (textEnabled() && !speechEnabled() && chatDuration != -1) {
switch (_configTextspeed) {
case 0:
chatDuration *= 2;
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