File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -94,6 +94,15 @@ void AudioPlayer::setMusicVolume(float volume)
9494 ma_sound_set_volume (&m_music, volume);
9595}
9696
97+ void AudioPlayer::unloadMusic ()
98+ {
99+ if (m_music_loaded)
100+ {
101+ ma_sound_uninit (&m_music);
102+ m_music_loaded = false ;
103+ }
104+ }
105+
97106// -------------------------------------
98107// SFX
99108// -------------------------------------
@@ -134,15 +143,6 @@ void AudioPlayer::setSfxVolume(float volume)
134143 ma_sound_set_volume (&m_sfx, volume);
135144}
136145
137- void AudioPlayer::unloadMusic ()
138- {
139- if (m_music_loaded)
140- {
141- ma_sound_uninit (&m_music);
142- m_music_loaded = false ;
143- }
144- }
145-
146146void AudioPlayer::unloadSfx ()
147147{
148148 if (m_sfx_loaded)
Original file line number Diff line number Diff line change 33static std::string str_repeat (const std::string& s, size_t n)
44{
55 std::string out;
6- out.reserve (s.size () * std::max ( 0UL , n));
6+ out.reserve (s.size () * std::max< size_t >( 0 , n));
77 for (size_t i = 0 ; i < n; ++i)
88 out += s;
99 return out;
@@ -21,8 +21,8 @@ static std::string rpad(const std::string& s, size_t width)
2121static std::string centre_in (const std::string& s, size_t width)
2222{
2323 size_t total_pad = width - s.size ();
24- size_t pad_l = std::max ( 0UL , total_pad / 2 );
25- size_t pad_r = std::max ( 0UL , total_pad - pad_l);
24+ size_t pad_l = std::max< size_t >( 0 , total_pad / 2 );
25+ size_t pad_r = std::max< size_t >( 0 , total_pad - pad_l);
2626 return std::string (pad_l, ' ' ) + s + std::string (pad_r, ' ' );
2727}
2828
You can’t perform that action at this time.
0 commit comments