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

Commit 3b42813

Browse files
committed
Code review comment fixes
1 parent b3f120b commit 3b42813

File tree

6 files changed

+19
-25
lines changed

6 files changed

+19
-25
lines changed

Entities/SoundContainer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ namespace RTE {
5353
/// <param name="soundFilePath">The path to a sound to add to the first SoundSet of this SoundContainer.</param>
5454
/// <param name="immobile">Whether this SoundContainer's sounds will be treated as immobile, i.e. they won't be affected by 3D sound manipulation.</param>
5555
/// <param name="affectedByGlobalPitch">Whether this SoundContainer's sounds' frequency will be affected by the global pitch.</param>
56-
/// <returns>An error return value signaing success or any particular failure. Anything below 0 is an error signal.</returns>
56+
/// <returns>An error return value signaling success or any particular failure. Anything below 0 is an error signal.</returns>
5757
int Create(const std::string &soundFilePath, bool immobile = false, bool affectedByGlobalPitch = true) { m_TopLevelSoundSet.AddSound(soundFilePath, true); SetImmobile(immobile); SetAffectedByGlobalPitch(affectedByGlobalPitch); return 0; }
5858
#pragma endregion
5959

@@ -210,7 +210,7 @@ namespace RTE {
210210
/// Gets the position at which this SoundContainer's sound will be played. Note that its individual sounds can be offset from this.
211211
/// </summary>
212212
/// <returns>The position of this SoundContainer.</returns>
213-
const Vector &GetPosition() const { return m_Pos; }
213+
const Vector & GetPosition() const { return m_Pos; }
214214

215215
/// <summary>
216216
/// Sets the position of the SoundContainer's sounds while they're playing.

Entities/SoundSet.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@ namespace RTE {
182182
if (!hasAnySounds && includeSubSoundSets) {
183183
for (const SoundSet &subSoundSet : m_SubSoundSets) {
184184
hasAnySounds = subSoundSet.HasAnySounds();
185-
if (hasAnySounds) { break; }
185+
if (hasAnySounds) {
186+
break;
187+
}
186188
}
187189
}
188190
return hasAnySounds;

Entities/SoundSet.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ namespace RTE {
3333
ContentFile SoundFile;
3434
FMOD::Sound *SoundObject;
3535
Vector Offset = Vector();
36-
float MinimumAudibleDistance = 0;
37-
float AttenuationStartDistance = -1;
36+
float MinimumAudibleDistance = 0.0F;
37+
float AttenuationStartDistance = -1.0F;
3838
};
3939

4040
#pragma region Creation
@@ -66,7 +66,7 @@ namespace RTE {
6666
#pragma region INI Handling
6767
/// <summary>
6868
/// Handles reading a SoundData from INI, loading it in as a ContentFile and into FMOD, and reading any of its subproperties.
69-
/// /////////Does not add the created SoundData to a this SoundSet.
69+
/// Does not add the created SoundData to a this SoundSet.
7070
/// </summary>
7171
/// <param name="reader">A Reader lined up to the value of the property to be read.</param>
7272
/// <returns>SoundData for the newly read sound.</returns>
@@ -153,14 +153,14 @@ namespace RTE {
153153
void SetSoundSelectionCycleMode(SoundSelectionCycleMode newSoundSelectionCycleMode) { m_SoundSelectionCycleMode = newSoundSelectionCycleMode; }
154154

155155
/// <summary>
156-
/// Filles the passed in vector with the flattened SoundData in the SoundSet, optionally only getting currently selected SoundData.
156+
/// Fills the passed in vector with the flattened SoundData in the SoundSet, optionally only getting currently selected SoundData.
157157
/// </summary>
158158
/// <param name="flattenedSoundData">A reference vector of SoundData references to be filled with this SoundSet's flattened SoundData.</param>
159159
/// <param name="onlyGetSelectedSoundData">Whether to only get SoundData that is currently selected, or to get all SoundData in this SoundSet.</param>
160160
void GetFlattenedSoundData(std::vector<SoundData *> &flattenedSoundData, bool onlyGetSelectedSoundData);
161161

162162
/// <summary>
163-
/// Filles the passed in vector with the flattened SoundData in the SoundSet, optionally only getting currently selected SoundData.
163+
/// Fills the passed in vector with the flattened SoundData in the SoundSet, optionally only getting currently selected SoundData.
164164
/// </summary>
165165
/// <param name="flattenedSoundData">A reference vector of SoundData references to be filled with this SoundSet's flattened SoundData.</param>
166166
/// <param name="onlyGetSelectedSoundData">Whether to only get SoundData that is currently selected, or to get all SoundData in this SoundSet.</param>

Managers/AudioMan.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ namespace RTE {
1717
m_CurrentActivityHumanPlayerPositions.clear();
1818
m_SoundChannelMinimumAudibleDistances.clear();
1919

20-
m_MusicVolume = 1.0;
21-
m_SoundsVolume = 1.0;
22-
m_GlobalPitch = 1.0;
20+
m_MusicVolume = 1.0F;
21+
m_SoundsVolume = 1.0F;
22+
m_GlobalPitch = 1.0F;
2323

2424
m_MusicPath.clear();
2525
m_MusicPlayList.clear();

Managers/AudioMan.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
namespace RTE {
1616

1717
/// <summary>
18-
/// The singleton manager of the WAV sound effects and OGG music playback.
18+
/// The singleton manager of sound effect and music playback.
1919
/// </summary>
2020
class AudioMan : public Singleton<AudioMan> {
2121
friend class SoundContainer;
@@ -161,7 +161,7 @@ namespace RTE {
161161
/// <param name="pitch">New global pitch, limited to 8 octaves up or down (i.e. 0.125 - 8). Defaults to 1.</param>
162162
/// <param name="includeImmobileSounds">Whether to include immobile sounds (normally used for GUI and so on) in global pitch modification. Defaults to false.</param>
163163
/// <param name="includeMusic">Whether to include the music in global pitch modification. Defaults to false.</param>
164-
void SetGlobalPitch(float pitch = 1.0, bool includeImmobileSounds = false, bool includeMusic = false);
164+
void SetGlobalPitch(float pitch = 1.0F, bool includeImmobileSounds = false, bool includeMusic = false);
165165
#pragma endregion
166166

167167
#pragma region Music Getters and Setters
@@ -181,7 +181,7 @@ namespace RTE {
181181
/// Sets the music to a specific volume. Does not affect sounds.
182182
/// </summary>
183183
/// <param name="volume">The desired volume scalar. 0.0-1.0.</param>
184-
void SetMusicVolume(float volume = 1.0) { m_MusicVolume = std::clamp(volume, 0.0F, 1.0F); if (m_AudioEnabled) { m_MusicChannelGroup->setVolume(m_MusicVolume); } }
184+
void SetMusicVolume(float volume = 1.0F) { m_MusicVolume = std::clamp(volume, 0.0F, 1.0F); if (m_AudioEnabled) { m_MusicChannelGroup->setVolume(m_MusicVolume); } }
185185

186186
/// <summary>
187187
/// Sets the music to a specific volume, but it will only last until a new song is played. Useful for fading etc.
@@ -243,7 +243,7 @@ namespace RTE {
243243
/// <param name="filePath">The path to the music file to play.</param>
244244
/// <param name="loops">The number of times to loop the song. 0 means play once. -1 means play infinitely until stopped.</param>
245245
/// <param name="volumeOverrideIfNotMuted">The volume override for music for this song only, if volume is not muted. < 0 means no override.</param>
246-
void PlayMusic(const char *filePath, int loops = -1, float volumeOverrideIfNotMuted = -1.0);
246+
void PlayMusic(const char *filePath, int loops = -1, float volumeOverrideIfNotMuted = -1.0F);
247247

248248
/// <summary>
249249
/// Plays the next music stream in the queue, if any is queued.
@@ -350,7 +350,7 @@ namespace RTE {
350350
/// <param name="loops">LoopsOrSilence counter or, if state is silence, the length of the silence.</param>
351351
/// <param name="position">Music playback position.</param>
352352
/// <param name="pitch">Pitch value.</param>
353-
void RegisterMusicEvent(int player, NetworkMusicState state, const char *filepath, int loopsOrSilence = 0, float position = 0, float pitch = 1);
353+
void RegisterMusicEvent(int player, NetworkMusicState state, const char *filepath, int loopsOrSilence = 0, float position = 0, float pitch = 1.0F);
354354

355355
/// <summary>
356356
/// Fills the list with sound events happened for the specified network player.

System/ContentFile.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,6 @@ namespace RTE {
140140
/// <param name="asyncLoading">Whether to enable FMOD asynchronous loading or not. Should be disabled for loading audio files with Lua AddSound.
141141
/// <returns>Pointer to the FSOUND_SAMPLE loaded from disk.</returns>
142142
FMOD::Sound * GetAsSound(bool abortGameForInvalidSound = true, bool asyncLoading = true);
143-
144-
/// <summary>
145-
/// Loads and transfers the data represented by this ContentFile object as an FMOD FSOUND_SAMPLE. Ownership of the FSOUND_SAMPLE is NOT transferred!
146-
/// </summary>
147-
/// <param name="abortGameForInvalidSound">Whether to abort the game if the sound couldn't be added, or just show a console error</param>
148-
/// <param name="asyncLoading">Whether to enable FMOD asynchronous loading or not. Should be disabled for loading audio files with Lua AddSound.
149-
/// <returns>Pointer to the FSOUND_SAMPLE loaded from disk.</returns>
150-
FMOD::Sound * LoadAndReleaseSound(bool abortGameForInvalidSound, bool asyncLoading);
151143
#pragma endregion
152144

153145
#pragma region Class Info
@@ -198,7 +190,7 @@ namespace RTE {
198190
/// <param name="abortGameForInvalidSound">Whether to abort the game if the sound couldn't be added, or just show a console error. Default true.</param>
199191
/// <param name="asyncLoading">Whether to enable FMOD asynchronous loading or not. Should be disabled for loading audio files with Lua AddSound.
200192
/// <returns>Pointer to the FSOUND_SAMPLE loaded from disk.</returns>
201-
FMOD::Sound * LoadAndReleaseSample(bool abortGameForInvalidSound = true, bool asyncLoading = true);
193+
FMOD::Sound * LoadAndReleaseSound(bool abortGameForInvalidSound = true, bool asyncLoading = true);
202194
#pragma endregion
203195

204196
/// <summary>

0 commit comments

Comments
 (0)