mirror of
https://github.com/libretro/FBNeo.git
synced 2024-11-23 00:49:57 +00:00
SDL/SDL2: add volume support
+ / - keyboard in game
This commit is contained in:
parent
7434efa6a8
commit
bf897ad31d
@ -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
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user