diff --git a/README-SDL.md b/README-SDL.md index f25715770..a86a7bb97 100644 --- a/README-SDL.md +++ b/README-SDL.md @@ -97,6 +97,7 @@ The above will give you a nicely scalend game screen and the menu for launching 'F11' - show FPS counter 'F6' - Screenshot 'ALT-ENTER' - Switch window/fullscreen +'+'/'-' - Volume controls ## SDL2 in menu controls diff --git a/src/burner/sdl/run.cpp b/src/burner/sdl/run.cpp index 75e477bcd..6c785f505 100644 --- a/src/burner/sdl/run.cpp +++ b/src/burner/sdl/run.cpp @@ -475,7 +475,22 @@ int RunMessageLoop() bscreenshot = 1; } break; - + case SDLK_KP_MINUS: // volumme - + nAudVolume -= 500; + if (nAudVolume < 0) { + nAudVolume = 0; + } + if (AudSoundSetVolume() == 0) { + } + break; + case SDLK_KP_PLUS: // volume -+ + nAudVolume += 500; + if (nAudVolume > 10000) { + nAudVolume = 10000; + } + if (AudSoundSetVolume() == 0) { + } + break; default: break; } diff --git a/src/intf/audio/sdl/aud_sdl.cpp b/src/intf/audio/sdl/aud_sdl.cpp index ea25adde7..5c0063fb3 100644 --- a/src/intf/audio/sdl/aud_sdl.cpp +++ b/src/intf/audio/sdl/aud_sdl.cpp @@ -216,6 +216,9 @@ static int SDLSoundStop() static int SDLSoundSetVolume() { + nSDLVolume = int(SDL_MIX_MAXVOLUME * nAudVolume / 10000); + if (nSDLVolume > SDL_MIX_MAXVOLUME) nSDLVolume=SDL_MIX_MAXVOLUME; + if (nSDLVolume < 0) nSDLVolume=0; return 1; }