You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 5, 2024. It is now read-only.
Added SoundContainer SoundOverlapMode, to determine how it'll respond to being told to play while playing
Used this to add HDFirearm FireEchoSound, which plays alongside the regular FireSound, but is set to restart when overlapping. Also made ActiveSound no longer not affected by global pitch, since that stuff was cleaned up before
Made gold dig guisound also restart when overlapping so it's not so out of control
Reorganized and cleaned up SoundContainer header and cpp a bit
Added lua bindings for SoundContainer SoundCycleMode, SoundOverlapMode and Restart. Changelog entries will come later to minimize merge conflicts.
m_ActiveSound.SetAffectedByGlobalPitch(false); //Active sound (i.e. weapon spinup) modifies its pitch, so it has to account for global pitch on its own.
181
-
} elseif (propName == "DeactivationSound")
185
+
} elseif (propName == "DeactivationSound") {
182
186
reader >> m_DeactivationSound;
183
-
elseif (propName == "EmptySound")
187
+
} elseif (propName == "EmptySound")
184
188
reader >> m_EmptySound;
185
189
elseif (propName == "ReloadStartSound")
186
190
reader >> m_ReloadStartSound;
@@ -256,6 +260,8 @@ int HDFirearm::Save(Writer &writer) const
/// Selects the next sounds of this SoundContainer to be played.
364
398
/// </summary>
@@ -383,17 +417,19 @@ namespace RTE {
383
417
protected:
384
418
385
419
static Entity::ClassInfo m_sClass; //!< ClassInfo for this class.
386
-
staticconst std::unordered_map<std::string, SoundCycleMode> c_CycleModeMap; //!< A map of strings to CycleModes to support string parsing for the CycleMode enum. Populated in the implementing cpp file.
420
+
staticconst std::unordered_map<std::string, SoundCycleMode> c_SoundCycleModeMap; //!< A map of strings to SoundCycleModes to support string parsing for the SoundCycleMode enum. Populated in the implementing cpp file.
421
+
staticconst std::unordered_map<std::string, SoundOverlapMode> c_SoundOverlapModeMap; //!< A map of strings to SoundOverlapModes to support string parsing for the SoundOverlapMode enum. Populated in the implementing cpp file.
387
422
388
423
std::vector<std::vector<SoundData>> m_SoundSets; //The vector of SoundSets in this SoundContainer, wherein a SoundSet is a vector containing one or more SoundData structs.
389
424
size_t m_SelectedSoundSet; //!< The selected SoundSet for this SoundContainer, used to determine what sounds will play when Play is called.
390
-
SoundCycleMode m_SoundSelectionCycleMode; //!< The sound cycle mode for this sound container, used to determine what will play next, each time play is called.
425
+
SoundCycleMode m_SoundSelectionCycleMode; //!< The SoundCycleMode for this SoundContainer, used to determine what will play next, each time play is called.
391
426
392
-
std::unordered_set<unsignedshort> m_PlayingChannels; //!< The channels this SoundContainer is currently using
427
+
std::unordered_set<unsignedshort> m_PlayingChannels; //!< The channels this SoundContainer is currently using.
428
+
SoundOverlapMode m_SoundOverlapMode; //!< The SoundOverlapMode for this SoundContainer, used to determine how it should handle overlapping play calls.
393
429
394
430
bool m_Immobile; //!< Whether this SoundContainer's sounds should be treated as immobile, i.e. not affected by 3D sound effects. Mostly used for GUI sounds and the like.
395
431
float m_AttenuationStartDistance; //!< The distance away from the AudioSystem listener to start attenuating this sound. Attenuation follows FMOD 3D Inverse roll-off model.
396
-
int m_Loops; //!< Number of loops (repeats) the SoundContainer's sounds should play when played. 0 means it plays once, -1 means it plays until stopped.
432
+
int m_Loops; //!< Number of loops (repeats) the SoundContainer's sounds should play when played. 0 means it plays once, -1 means it plays until stopped.
397
433
bool m_SoundPropertiesUpToDate = false; //!< Whether this SoundContainer's sounds' modes and properties are up to date. Used primarily to handle discrepancies that can occur when loading from ini if the line ordering isn't ideal.
398
434
399
435
int m_Priority; //!< The mixing priority of this SoundContainer's sounds. Higher values are more likely to be heard.
0 commit comments