Make Sound::getBuffer return a reference

because the pointer now cannot be null
This commit is contained in:
kimci86 2023-08-06 17:41:23 +02:00 committed by Chris Thrasher
parent 9cbcd56eb8
commit 635c8c9290
2 changed files with 4 additions and 4 deletions

View File

@ -164,10 +164,10 @@ public:
////////////////////////////////////////////////////////////
/// \brief Get the audio buffer attached to the sound
///
/// \return Sound buffer attached to the sound (can be a null pointer)
/// \return Sound buffer attached to the sound
///
////////////////////////////////////////////////////////////
const SoundBuffer* getBuffer() const;
const SoundBuffer& getBuffer() const;
////////////////////////////////////////////////////////////
/// \brief Tell whether or not the sound is in loop mode

View File

@ -110,9 +110,9 @@ void Sound::setPlayingOffset(Time timeOffset)
////////////////////////////////////////////////////////////
const SoundBuffer* Sound::getBuffer() const
const SoundBuffer& Sound::getBuffer() const
{
return m_buffer;
return *m_buffer;
}