summaryrefslogtreecommitdiffstats
path: root/game/client/game.cc
diff options
context:
space:
mode:
authoruntodesu <kirill@untode.su>2025-03-27 13:28:09 +0500
committeruntodesu <kirill@untode.su>2025-03-27 13:28:09 +0500
commit60cb5a829b54732176936e21511aa5372ae46fab (patch)
treea2d671ea8d19607042e3177ec0bb50d69f6f85a8 /game/client/game.cc
parentb2d4a09a5621e214636593641d9799b2b1cdcf72 (diff)
downloadvoxelius-60cb5a829b54732176936e21511aa5372ae46fab.tar.bz2
voxelius-60cb5a829b54732176936e21511aa5372ae46fab.zip
Allow game to not die when sound is not available
Diffstat (limited to 'game/client/game.cc')
-rw-r--r--game/client/game.cc22
1 files changed, 15 insertions, 7 deletions
diff --git a/game/client/game.cc b/game/client/game.cc
index af6fba6..c1d3fa8 100644
--- a/game/client/game.cc
+++ b/game/client/game.cc
@@ -342,7 +342,9 @@ void client_game::init(void)
globals::gui_scale = 0U;
globals::gui_screen = GUI_MAIN_MENU;
- sound::init();
+ if(globals::sound_ctx) {
+ sound::init();
+ }
client_receive::init();
@@ -356,7 +358,9 @@ void client_game::init_late(void)
{
toggles::init_late();
- sound::init_late();
+ if(globals::sound_ctx) {
+ sound::init_late();
+ }
language::init_late();
@@ -418,7 +422,9 @@ void client_game::deinit(void)
session::deinit();
- sound::deinit();
+ if(globals::sound_ctx) {
+ sound::deinit();
+ }
hotbar::deinit();
main_menu::deinit();
@@ -506,9 +512,13 @@ void client_game::update(void)
else globals::dimension->entities.emplace_or_replace<GravityComponent>(globals::player);
}
- sound::update();
+ if(globals::sound_ctx) {
+ sound::update();
- listener::update();
+ listener::update();
+
+ SoundEmitterComponent::update();
+ }
interpolation::update();
@@ -516,8 +526,6 @@ void client_game::update(void)
camera::update();
- SoundEmitterComponent::update();
-
voxel_anims::update();
chunk_mesher::update();