108 |
if (!sound_enabled) |
if (!sound_enabled) |
109 |
return; |
return; |
110 |
if (Mix_Chunk *ch = cache_sound(name)) { |
if (Mix_Chunk *ch = cache_sound(name)) { |
111 |
Mix_PlayChannel(-1, ch, 0); |
int channel = Mix_PlayChannel(-1, ch, 0); |
112 |
|
int soundvol = int(options::SoundVolume * MIX_MAX_VOLUME); |
113 |
|
Mix_Volume(channel, Max(0, Min(soundvol, MIX_MAX_VOLUME))); |
114 |
} |
} |
115 |
} |
} |
116 |
|
|
146 |
current_music = Mix_LoadMUS(fname.c_str()); |
current_music = Mix_LoadMUS(fname.c_str()); |
147 |
if (current_music) { |
if (current_music) { |
148 |
Mix_PlayMusic(current_music,-1); |
Mix_PlayMusic(current_music,-1); |
149 |
|
UpdateVolume(); |
150 |
current_music_name = name; |
current_music_name = name; |
151 |
} |
} |
152 |
else |
else |