1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00

[iOS] add setting to honor mute switch

This commit is contained in:
Andrey Filipenkov
2025-03-13 12:10:00 +03:00
parent f7305fd1c2
commit 0435d8f49c
5 changed files with 101 additions and 64 deletions

View File

@ -212,6 +212,11 @@ ScreenHandler::ScreenHandler()
else
SDL_SetHint(SDL_HINT_ORIENTATIONS, "LandscapeLeft LandscapeRight");
#ifdef VCMI_IOS
if(!settings["general"]["ignoreMuteSwitch"].Bool())
SDL_SetHint(SDL_HINT_AUDIO_CATEGORY, "AVAudioSessionCategoryAmbient");
#endif
if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_GAMECONTROLLER))
{
logGlobal->error("Something was wrong: %s", SDL_GetError());