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.
Changed SoundContainer::GetSounds to return a pointer to m_Sounds and GetPlayingChannels to return a pointer to m_PlayingChannels, to avoid copying stuff. Made it so Soundcontainers can have multiple hashes (one for each sound) and added methods to get vectors of selected sound hashes and selected sound objects
Added a limit to the number of playing channels a SoundContainer can have (defined in constants), for sanity and to support multiplayer
Fixed various types not being unsigned, added various safety checks, etc.
voidAddPlayingChannel(unsignedshortint channel) { m_PlayingChannels.insert(channel); RTEAssert(m_PlayingChannels.size() <= c_MaxPlayingSoundsPerContainer, "Tried to play more than " + std::to_string(c_MaxPlayingSoundsPerContainer) + " sounds in SoundContainer " + GetPresetName()); }
151
157
152
158
/// <summary>
153
159
/// Removes a channel index from the SoundContainer's collection of playing channels.
154
160
/// </summary>
155
161
/// <param name="channel">The channel index to remove.</param>
static Entity::ClassInfo m_sClass; //!< ClassInfo for this class.
259
259
260
260
std::vector<std::pair<ContentFile, FMOD::Sound *>> m_Sounds; // All the FMOD Sound objects in this SoundContainer, paired with their appropriate ContentFile. The sound objects within are owned by the ContentFile static maps
261
+
std::vector<size_t> m_SelectedSounds; //!< Vector of the indices of all selected sounds
261
262
262
-
//TODO change this to be a list/vector of sounds
263
-
int m_CurrentSound; //!< Sound group index of the current (or last played if nothing is being played) sound being played
264
-
std::unordered_set<shortint> m_PlayingChannels; //!< The channels this SoundContainer is currently using
263
+
std::unordered_set<unsignedshortint> m_PlayingChannels; //!< The channels this SoundContainer is currently using
265
264
266
265
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
267
266
int m_Priority; //!< The mixing priority of this SoundContainer's sounds. Higher values are more likely to be heard
268
267
bool m_AffectedByGlobalPitch; //!< Whether this SoundContainer's sounds should be able to be altered by global pitch changes
269
268
270
-
size_t m_Hash; //!< Sound file hash for network transmission.
271
-
272
269
private:
273
270
/// <summary>
274
271
/// Clears all the member variables of this SoundContainer, effectively resetting the members of this abstraction level only.
0 commit comments