Use sound volumes and fullscreen settings.
This commit is contained in:
parent
d71bee6b11
commit
343c534159
|
@ -66,6 +66,11 @@ void initSDL(void)
|
||||||
|
|
||||||
windowFlags = 0;
|
windowFlags = 0;
|
||||||
|
|
||||||
|
if (app.config.fullscreen)
|
||||||
|
{
|
||||||
|
windowFlags |= SDL_WINDOW_FULLSCREEN;
|
||||||
|
}
|
||||||
|
|
||||||
if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO|SDL_INIT_JOYSTICK) < 0)
|
if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO|SDL_INIT_JOYSTICK) < 0)
|
||||||
{
|
{
|
||||||
printf("Couldn't initialize SDL: %s\n", SDL_GetError());
|
printf("Couldn't initialize SDL: %s\n", SDL_GetError());
|
||||||
|
@ -78,7 +83,10 @@ void initSDL(void)
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
Mix_AllocateChannels(CH_MAX * 3);
|
Mix_AllocateChannels(64);
|
||||||
|
|
||||||
|
Mix_Volume(-1, app.config.soundVolume * (MIX_MAX_VOLUME / 10));
|
||||||
|
Mix_VolumeMusic(app.config.musicVolume * (MIX_MAX_VOLUME / 10));
|
||||||
|
|
||||||
app.window = SDL_CreateWindow("Blob Wars : Attrition", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, app.winWidth, app.winHeight, windowFlags);
|
app.window = SDL_CreateWindow("Blob Wars : Attrition", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, app.winWidth, app.winHeight, windowFlags);
|
||||||
|
|
||||||
|
@ -180,8 +188,8 @@ static void initDefaultConfig(void)
|
||||||
app.config.hudInventory = 1;
|
app.config.hudInventory = 1;
|
||||||
app.config.blood = 1;
|
app.config.blood = 1;
|
||||||
|
|
||||||
app.config.musicVolume = 80;
|
app.config.musicVolume = 8;
|
||||||
app.config.soundVolume = 100;
|
app.config.soundVolume = 10;
|
||||||
|
|
||||||
app.config.keyControls[CONTROL_LEFT] = SDL_SCANCODE_A;
|
app.config.keyControls[CONTROL_LEFT] = SDL_SCANCODE_A;
|
||||||
app.config.keyControls[CONTROL_RIGHT] = SDL_SCANCODE_D;
|
app.config.keyControls[CONTROL_RIGHT] = SDL_SCANCODE_D;
|
||||||
|
|
Loading…
Reference in New Issue