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

Commit a269eeb

Browse files
committed
PR review fixes - added missing comments in sound container header, added/modified lambda function comments
Renamed ReadSoundSet to ReadSoundOrSoundSet
1 parent ee99a37 commit a269eeb

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

Entities/SoundContainer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ namespace RTE {
5858

5959
int SoundContainer::ReadProperty(std::string propName, Reader &reader) {
6060
if (propName == "AddSound" || propName == "AddSoundSet") {
61-
return ReadSoundSet(propName, reader);
61+
return ReadSoundOrSoundSet(propName, reader);
6262
} else if (propName == "CycleMode") {
6363
std::string cycleModeString = reader.ReadPropValue();
6464
if (c_CycleModeMap.find(cycleModeString) != c_CycleModeMap.end()) {
@@ -87,7 +87,7 @@ namespace RTE {
8787

8888
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
8989

90-
int SoundContainer::ReadSoundSet(std::string propName, Reader &reader) {
90+
int SoundContainer::ReadSoundOrSoundSet(const std::string &propName, Reader &reader) {
9191
vector<SoundData> soundSet;
9292
if (propName == "AddSound") {
9393
soundSet.push_back(ReadSound(reader));

Entities/SoundContainer.h

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,17 @@ namespace RTE {
1717
ENTITYALLOCATION(SoundContainer)
1818
CLASSINFOGETTERS
1919

20+
/// <summary>
21+
/// How the SoundContainer should choose the next SoundSet to play when SelectNextSoundSet is called
22+
/// </summary>
2023
enum SoundCycleMode {
2124
MODE_RANDOM = 0,
2225
MODE_FORWARDS = 1
2326
};
2427

28+
/// <summary>
29+
/// Self-contained struct defining an individual sound in a SoundSet
30+
/// </summary>
2531
struct SoundData {
2632
ContentFile SoundFile;
2733
FMOD::Sound *SoundObject;
@@ -142,18 +148,18 @@ namespace RTE {
142148
virtual int ReadProperty(std::string propName, Reader &reader);
143149

144150
/// <summary>
145-
///
151+
/// Handles reading a SoundSet from INI. If the Reader is trying to read a line adding a sound, it'll call ReadSound and add the resulting sound to a new SoundSet.
146152
/// </summary>
147-
/// <param name="propName"></param>
148-
/// <param name="reader"></param>
149-
/// <returns></returns>
150-
int ReadSoundSet(std::string propName, Reader &reader);
153+
/// <param name="propName">The name of the property to be read.</param>
154+
/// <param name="reader">A Reader lined up to the value of the property to be read.</param>
155+
/// <returns>An error return value signaling whether the property was successfully read or not. 0 means it was succesful, any nonzero value means it failed.</returns>
156+
int ReadSoundOrSoundSet(const std::string &propName, Reader &reader);
151157

152158
/// <summary>
153-
///
159+
/// Handles reading a SoundData from INI, loading it in as a ContentFile and into FMOD, and reading any of its subproperties. Does not add the created SoundData to a SoundContainer.
154160
/// </summary>
155-
/// <param name="reader"></param>
156-
/// <returns></returns>
161+
/// <param name="reader">A Reader lined up to the value of the property to be read.</param>
162+
/// <returns>SoundData for the newly read sound.</returns>
157163
SoundData ReadSound(Reader &reader);
158164

159165
/// <summary>

0 commit comments

Comments
 (0)