Properly change volume
This commit is contained in:
@@ -202,6 +202,9 @@ bool init(void *userData) {
|
||||
ECS_COMPONENT_DEFINE(ECS, SoundState);
|
||||
ecs_singleton_set(ECS, SoundState, {});
|
||||
SoundState *sounds = ecs_singleton_get_mut(ECS, SoundState);
|
||||
sounds->masterVolume = 0.5f;
|
||||
sounds->musicVolume = 0.5f;
|
||||
sounds->soundVolume = 0.5f;
|
||||
soundsLoad(sounds, SOUND_WOOD_PUNCH, 0.1f, "assets/sounds/wood hit 17.wav");
|
||||
}
|
||||
setScreen(game, SCREEN_MAIN_MENU);
|
||||
@@ -392,6 +395,8 @@ void update(float dt, void *userData) {
|
||||
} else {
|
||||
game->options = getDefaultOptions();
|
||||
}
|
||||
SoundState *sounds = ecs_singleton_get_mut(ECS, SoundState);
|
||||
soundsApplyVolume(sounds, opts.master, opts.music, opts.sound);
|
||||
optsLoaded = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user