Rename "Ambient" to "Map Sound"

This commit is contained in:
def 2014-10-23 15:53:23 +02:00
parent 9b6f679008
commit f8f8f0613e
5 changed files with 14 additions and 14 deletions

View file

@ -68,7 +68,7 @@ MACRO_CONFIG_INT(SndEnable, snd_enable, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "S
MACRO_CONFIG_INT(SndMusic, snd_enable_music, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Play background music")
MACRO_CONFIG_INT(SndVolume, snd_volume, 100, 0, 100, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Sound volume")
MACRO_CONFIG_INT(SndDevice, snd_device, -1, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "(deprecated) Sound device to use")
MACRO_CONFIG_INT(SndAmbientVolume, snd_ambient_volume, 70, 0, 100, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Ambient sound volume")
MACRO_CONFIG_INT(SndMapSoundVolume, snd_ambient_volume, 70, 0, 100, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Map Sound sound volume")
MACRO_CONFIG_INT(SndNonactiveMute, snd_nonactive_mute, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "")
MACRO_CONFIG_INT(SndGame, snd_game, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Enable game sounds")

View file

@ -118,7 +118,7 @@ void CMapSounds::OnRender()
int Flags = 0;
if(pSource->m_pSource->m_Loop) Flags |= ISound::FLAG_LOOP;
pSource->m_Voice = m_pClient->m_pSounds->PlaySampleAt(CSounds::CHN_AMBIENT, m_aSounds[pSource->m_Sound], 1.0f, vec2(fx2f(pSource->m_pSource->m_Position.x), fx2f(pSource->m_pSource->m_Position.y)), Flags);
pSource->m_Voice = m_pClient->m_pSounds->PlaySampleAt(CSounds::CHN_MAPSOUND, m_aSounds[pSource->m_Sound], 1.0f, vec2(fx2f(pSource->m_pSource->m_Position.x), fx2f(pSource->m_pSource->m_Position.y)), Flags);
Sound()->SetVoiceMaxDistance(pSource->m_Voice, pSource->m_pSource->m_FalloffDistance);
Sound()->SetVoiceTimeOffset(pSource->m_Voice, offset);
}
@ -216,4 +216,4 @@ void CMapSounds::OnStateChange(int NewState, int OldState)
{
if(NewState < IClient::STATE_ONLINE)
Clear();
}
}

View file

@ -1068,8 +1068,8 @@ void CMenus::RenderSettingsSound(CUIRect MainView)
MainView.HSplitTop(20.0f, &Button, &MainView);
Button.VSplitLeft(190.0f, &Label, &Button);
Button.HMargin(2.0f, &Button);
UI()->DoLabelScaled(&Label, Localize("Ambient volume"), 14.0f, -1);
g_Config.m_SndAmbientVolume = (int)(DoScrollbarH(&g_Config.m_SndAmbientVolume, &Button, g_Config.m_SndAmbientVolume/100.0f)*100.0f);
UI()->DoLabelScaled(&Label, Localize("Map Sound volume"), 14.0f, -1);
g_Config.m_SndMapSoundVolume = (int)(DoScrollbarH(&g_Config.m_SndMapSoundVolume, &Button, g_Config.m_SndMapSoundVolume/100.0f)*100.0f);
MainView.HSplitTop(20.0f, 0, &MainView);
}
}

View file

@ -64,13 +64,13 @@ int CSounds::GetSampleId(int SetId)
void CSounds::OnInit()
{
// setup sound channels
m_AmbientVolume = g_Config.m_SndAmbientVolume/100.0f;
m_MapSoundVolume = g_Config.m_SndMapSoundVolume/100.0f;
Sound()->SetChannel(CSounds::CHN_GUI, 1.0f, 0.0f);
Sound()->SetChannel(CSounds::CHN_MUSIC, 1.0f, 0.0f);
Sound()->SetChannel(CSounds::CHN_WORLD, 0.9f, 1.0f);
Sound()->SetChannel(CSounds::CHN_GLOBAL, 1.0f, 0.0f);
Sound()->SetChannel(CSounds::CHN_AMBIENT, m_AmbientVolume, 1.0f);
Sound()->SetChannel(CSounds::CHN_MAPSOUND, m_MapSoundVolume, 1.0f);
Sound()->SetListenerPos(0.0f, 0.0f);
@ -123,11 +123,11 @@ void CSounds::OnRender()
Sound()->SetListenerPos(m_pClient->m_pCamera->m_Center.x, m_pClient->m_pCamera->m_Center.y);
// update volume
float NewAmbientVol = g_Config.m_SndAmbientVolume/100.0f;
if(NewAmbientVol != m_AmbientVolume)
float NewMapSoundVol = g_Config.m_SndMapSoundVolume/100.0f;
if(NewMapSoundVol != m_MapSoundVolume)
{
m_AmbientVolume = NewAmbientVol;
Sound()->SetChannel(CSounds::CHN_AMBIENT, m_AmbientVolume, 1.0f);
m_MapSoundVolume = NewMapSoundVol;
Sound()->SetChannel(CSounds::CHN_MAPSOUND, m_MapSoundVolume, 1.0f);
}
// play sound from queue
@ -236,4 +236,4 @@ ISound::CVoiceHandle CSounds::PlaySampleAt(int Chn, int SampleId, float Vol, vec
Flags |= ISound::FLAG_LOOP;
return Sound()->PlayAt(Chn, SampleId, Flags, Pos.x, Pos.y);
}
}

View file

@ -23,7 +23,7 @@ class CSounds : public CComponent
int GetSampleId(int SetId);
float m_AmbientVolume;
float m_MapSoundVolume;
public:
// sound channels
@ -33,7 +33,7 @@ public:
CHN_MUSIC,
CHN_WORLD,
CHN_GLOBAL,
CHN_AMBIENT,
CHN_MAPSOUND,
};
virtual void OnInit();