Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 5559baa

Browse files
committed
Renamed various sound constants, moved some to SettingsMan temporarily for easy tweaking.
1 parent 7c647bd commit 5559baa

File tree

4 files changed

+41
-4
lines changed

4 files changed

+41
-4
lines changed

Managers/NetworkClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ namespace RTE
678678
std::unordered_set<SoundContainer *> alreadyHandledSoundContainers;
679679

680680
for (unsigned short serverSoundChannelIndex : sndDataPtr->Channels) {
681-
if (serverSoundChannelIndex < c_MaxAudioChannels && (sndDataPtr->State == AudioMan::SOUND_PLAY || m_ServerSounds.find(serverSoundChannelIndex) != m_ServerSounds.end())) {
681+
if (serverSoundChannelIndex < c_MaxVirtualChannels && (sndDataPtr->State == AudioMan::SOUND_PLAY || m_ServerSounds.find(serverSoundChannelIndex) != m_ServerSounds.end())) {
682682
SoundContainer *soundContainerToHandle = (m_ServerSounds.find(serverSoundChannelIndex) == m_ServerSounds.end()) ? NULL : m_ServerSounds.at(serverSoundChannelIndex);
683683
if (alreadyHandledSoundContainers.find(soundContainerToHandle) == alreadyHandledSoundContainers.end()) {
684684
switch (sndDataPtr->State) {

Managers/SettingsMan.cpp

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ void SettingsMan::Clear()
5656
m_ForceNonOverlayedWindowGfxDriver = false;
5757
m_AllowSavingToBase = false;
5858
m_RecommendedMOIDCount = 240;
59-
m_SoundPanningEffectStrength = 0.5;
59+
m_SoundPanningEffectStrength = 0.6;
60+
//////////////////////////////////////////////////
61+
//TODO These need to be removed when our soundscape is sorted out. They're only here temporarily to allow for easier tweaking by pawnis.
62+
m_ListenerZOffset = 0;
63+
m_MinimumDistanceForPanning = 50;
64+
//////////////////////////////////////////////////
6065
m_NetworkServerName = "";
6166
m_PlayerNetworkName = "";
6267

@@ -236,6 +241,13 @@ int SettingsMan::ReadProperty(std::string propName, Reader &reader)
236241
reader >> m_RecommendedMOIDCount;
237242
else if (propName == "SoundPanningEffectStrength")
238243
reader >> m_SoundPanningEffectStrength;
244+
//////////////////////////////////////////////////
245+
//TODO These need to be removed when our soundscape is sorted out. They're only here temporarily to allow for easier tweaking by pawnis.
246+
else if (propName == "ListenerZOffset")
247+
reader >> m_ListenerZOffset;
248+
else if (propName == "MinimumDistanceForPanning")
249+
reader >> m_MinimumDistanceForPanning;
250+
//////////////////////////////////////////////////
239251
else if (propName == "PlayerNetworkName")
240252
reader >> m_PlayerNetworkName;
241253
else if (propName == "NetworkServerName")
@@ -408,6 +420,15 @@ int SettingsMan::Save(Writer &writer) const
408420
writer << m_RecommendedMOIDCount;
409421
writer.NewProperty("SoundPanningEffectStrength");
410422
writer << m_SoundPanningEffectStrength;
423+
424+
//////////////////////////////////////////////////
425+
//TODO These need to be removed when our soundscape is sorted out. They're only here temporarily to allow for easier tweaking by pawnis.
426+
writer.NewProperty("ListenerZOffset");
427+
writer << m_ListenerZOffset;
428+
writer.NewProperty("MinimumDistanceForPanning");
429+
writer << m_MinimumDistanceForPanning;
430+
//////////////////////////////////////////////////
431+
411432
writer.NewProperty("PlayerNetworkName");
412433
if (m_PlayerNetworkName == "")
413434
writer << "Dummy";

Managers/SettingsMan.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,13 @@ class SettingsMan:
415415
float SoundPanningEffectStrength() const { return m_SoundPanningEffectStrength; }
416416

417417

418+
//////////////////////////////////////////////////
419+
//TODO These need to be removed when our soundscape is sorted out. They're only here temporarily to allow for easier tweaking by pawnis.
420+
float c_ListenerZOffset() const { return m_ListenerZOffset; }
421+
float c_MinimumDistanceForPanning() const { return m_MinimumDistanceForPanning; }
422+
//////////////////////////////////////////////////
423+
424+
418425
//////////////////////////////////////////////////////////////////////////////////////////
419426
// Method: ForceSoftwareGfxDriver
420427
//////////////////////////////////////////////////////////////////////////////////////////
@@ -603,6 +610,11 @@ class SettingsMan:
603610
bool m_PrintDebugInfo;
604611
// The strength of the sound panning effect, 0 (no panning) - 1 (full panning)
605612
float m_SoundPanningEffectStrength;
613+
//////////////////////////////////////////////////
614+
//TODO These need to be removed when our soundscape is sorted out. They're only here temporarily to allow for easier tweaking by pawnis.
615+
float m_ListenerZOffset;
616+
float m_MinimumDistanceForPanning;
617+
//////////////////////////////////////////////////
606618
//Whether CC uses additional Draws during MO's PreTravel and PostTravel to
607619
//update MO layer this frame with more precision(true), or it just uses data from the last frame with less precision(false)
608620
bool m_PreciseCollisions;

System/Constants.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,12 @@ namespace RTE {
3737
static constexpr unsigned short c_MaxSoftwareChannels = 128;
3838
static constexpr unsigned short c_MaxVirtualChannels = 1024;
3939
static constexpr unsigned short c_MaxPlayingSoundsPerContainer = 64;
40-
static constexpr short c_ListenerZOffset = 0; //!< The Z offset for Audio listeners. Can be used to lessen harsh panning if panning effect strength is at max.
41-
static constexpr short c_DefaultAttenuationStartDistance = 100; //!< The default start distance for attenuating sounds. Individual sounds can have different values for this.
40+
/* TODO These have been temporarily replaced with variables in settingsman to allow for easy tweaking. This needs to be undone once our soundscape is sorted out.
41+
static constexpr unsigned short c_ListenerZOffset = 50; //!< The Z offset for Audio listeners. Can be used to lessen harsh panning if panning effect strength is at max.
42+
static constexpr unsigned short c_MinimumDistanceForPanning = 50; //!< The minimum distance before which sound panning should not occur. Not relevant for immobile sounds or in splitscreen.
43+
*/
44+
static constexpr unsigned short c_DefaultAttenuationStartDistance = 100; //!< The default start distance for attenuating sounds. Individual sounds can have different values for this.
45+
static constexpr unsigned short c_SoundMaxAudibleDistance = 100000; //!< The maximum distance at which any sound can possibly be heard, after which point it will have 0 volume. Arbitrary default suggested by FMOD.
4246
#pragma endregion
4347

4448
#pragma region Network Constants

0 commit comments

Comments
 (0)