Skip to content

Commit 5d23b28

Browse files
committed
fix windows build
1 parent 3dd1a08 commit 5d23b28

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/audio_player.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff 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-
146146
void AudioPlayer::unloadSfx()
147147
{
148148
if (m_sfx_loaded)

src/game.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
static 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)
2121
static 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

0 commit comments

Comments
 (0)