@@ -863,46 +863,17 @@ Game::Game() :
863863 m_chat_log_buf(g_logger),
864864 m_game_ui(new GameUI())
865865{
866- g_settings->registerChangedCallback (" chat_log_level" ,
867- &settingChangedCallback, this );
868- g_settings->registerChangedCallback (" doubletap_jump" ,
869- &settingChangedCallback, this );
870- g_settings->registerChangedCallback (" toggle_sneak_key" ,
871- &settingChangedCallback, this );
872- g_settings->registerChangedCallback (" toggle_aux1_key" ,
873- &settingChangedCallback, this );
874- g_settings->registerChangedCallback (" enable_joysticks" ,
875- &settingChangedCallback, this );
876- g_settings->registerChangedCallback (" enable_fog" ,
877- &settingChangedCallback, this );
878- g_settings->registerChangedCallback (" mouse_sensitivity" ,
879- &settingChangedCallback, this );
880- g_settings->registerChangedCallback (" joystick_frustum_sensitivity" ,
881- &settingChangedCallback, this );
882- g_settings->registerChangedCallback (" repeat_place_time" ,
883- &settingChangedCallback, this );
884- g_settings->registerChangedCallback (" repeat_dig_time" ,
885- &settingChangedCallback, this );
886- g_settings->registerChangedCallback (" noclip" ,
887- &settingChangedCallback, this );
888- g_settings->registerChangedCallback (" free_move" ,
889- &settingChangedCallback, this );
890- g_settings->registerChangedCallback (" fog_start" ,
891- &settingChangedCallback, this );
892- g_settings->registerChangedCallback (" cinematic" ,
893- &settingChangedCallback, this );
894- g_settings->registerChangedCallback (" cinematic_camera_smoothing" ,
895- &settingChangedCallback, this );
896- g_settings->registerChangedCallback (" camera_smoothing" ,
897- &settingChangedCallback, this );
898- g_settings->registerChangedCallback (" invert_mouse" ,
899- &settingChangedCallback, this );
900- g_settings->registerChangedCallback (" enable_hotbar_mouse_wheel" ,
901- &settingChangedCallback, this );
902- g_settings->registerChangedCallback (" invert_hotbar_mouse_wheel" ,
903- &settingChangedCallback, this );
904- g_settings->registerChangedCallback (" pause_on_lost_focus" ,
905- &settingChangedCallback, this );
866+ clearTextureNameCache ();
867+
868+ const char *settings[] = {
869+ " chat_log_level" , " doubletap_jump" , " toggle_sneak_key" , " toggle_aux1_key" ,
870+ " enable_joysticks" , " enable_fog" , " mouse_sensitivity" , " joystick_frustum_sensitivity" ,
871+ " repeat_place_time" , " repeat_dig_time" , " noclip" , " free_move" , " fog_start" ,
872+ " cinematic" , " cinematic_camera_smoothing" , " camera_smoothing" , " invert_mouse" ,
873+ " enable_hotbar_mouse_wheel" , " invert_hotbar_mouse_wheel" , " pause_on_lost_focus" ,
874+ };
875+ for (auto s : settings)
876+ g_settings->registerChangedCallback (s, &settingChangedCallback, this );
906877
907878 readSettings ();
908879}
@@ -4254,11 +4225,6 @@ void the_game(volatile std::sig_atomic_t *kill,
42544225{
42554226 Game game;
42564227
4257- /* Make a copy of the server address because if a local singleplayer server
4258- * is created then this is updated and we don't want to change the value
4259- * passed to us by the calling function
4260- */
4261-
42624228 try {
42634229
42644230 if (game.startup (kill, input, rendering_engine, start_data,
0 commit comments