Add an option to force preloading. This only preloads sounds

that are loaded in advance, which excludes sample music
and some announcers.

Disable "sound volume".  That's not what that variable is for; setting
it to higher values will result in clipping on a lot of hardware, causing
people to report it as a "bug" (which it's not).  Setting it to lower values
results in lower quality sound.  To do this correctly, we'd need to add
an interface for accessing the real hardware mixer volume, which I
don't really want to do right now ...
This commit is contained in:
Glenn Maynard
2003-03-31 21:21:23 +00:00
parent ea5a77e47e
commit 0ae6236f7c
5 changed files with 30 additions and 8 deletions
+15 -6
View File
@@ -25,11 +25,18 @@
enum {
SO_MASTER_VOLUME,
// SO_MASTER_VOLUME,
SO_PRELOAD_SOUND,
NUM_SOUND_OPTIONS_LINES
};
OptionRow g_SoundOptionsLines[NUM_SOUND_OPTIONS_LINES] = {
OptionRow( "Master\nVolume", "MUTE","20%","40%","60%","80%","100%" ),
/* Err. This shouldn't be here. m_fSoundVolume is not the master volume,
* it's the internal attenuation before mixing; we don't have control over
* the master volume. m_fSoundVolume was never intended to be changed by
* users, except to troubleshoot clipping; that's why I didn't put it in
* the options to begin with. */
// OptionRow( "Master\nVolume", "MUTE","20%","40%","60%","80%","100%" ),
OptionRow( "Preload\nSounds", "NO","YES" ),
};
ScreenSoundOptions::ScreenSoundOptions() :
@@ -52,14 +59,16 @@ void ScreenSoundOptions::Input( const DeviceInput& DeviceI, const InputEventType
void ScreenSoundOptions::ImportOptions()
{
float fVolPercent = PREFSMAN->m_fSoundVolume;
m_iSelectedOption[0][SO_MASTER_VOLUME] = (int)(fVolPercent*5);
// m_iSelectedOption[0][SO_MASTER_VOLUME] = (int)(PREFSMAN->m_fSoundVolume*5);
m_iSelectedOption[0][SO_PRELOAD_SOUND] = PREFSMAN->m_bSoundPreloadAll;
}
void ScreenSoundOptions::ExportOptions()
{
float fVolPercent = m_iSelectedOption[0][SO_MASTER_VOLUME] / 5.f;
SOUNDMAN->SetPrefs(fVolPercent);
PREFSMAN->m_fSoundVolume = fVolPercent;
// float fVolPercent = m_iSelectedOption[0][SO_MASTER_VOLUME] / 5.f;
// SOUNDMAN->SetPrefs(fVolPercent);
// PREFSMAN->m_fSoundVolume = fVolPercent;
PREFSMAN->m_bSoundPreloadAll = !!m_iSelectedOption[0][SO_PRELOAD_SOUND];
}
void ScreenSoundOptions::GoToPrevState()