diff options
author | Louis Pearson <desttinghimgame@gmail.com> | 2017-04-25 06:11:51 -0500 |
---|---|---|
committer | Zeno- <kde.psych@gmail.com> | 2017-04-25 21:11:51 +1000 |
commit | db17225a976e20c6628afe70dd6b230673287b4d (patch) | |
tree | 67aa28779d86ad6e995171218ae9578159ebc652 | |
parent | a7e131f53e211ffbe38d34d23b33e13cc401f013 (diff) | |
download | minetest-db17225a976e20c6628afe70dd6b230673287b4d.tar.gz minetest-db17225a976e20c6628afe70dd6b230673287b4d.tar.bz2 minetest-db17225a976e20c6628afe70dd6b230673287b4d.zip |
Footsteps without view bobbing (#5645)
* Remove redundant view_bobbing setting
Also fixes bug where disabling view_bobbing disables footstep sounds.
* Removes redundant view_bobbing setting
Setting view_bobbing amount to 0 is now the only way to
turn view_bobbing on and off. Also fixed a bug where footstep
sounds would not play when view_bobbing was disabled.
39 files changed, 39 insertions, 52 deletions
diff --git a/builtin/settingtypes.txt b/builtin/settingtypes.txt index 5dc48c00e..29a96ab8e 100644 --- a/builtin/settingtypes.txt +++ b/builtin/settingtypes.txt @@ -492,10 +492,7 @@ cloud_height (Cloud height) int 120 # Values larger than 26 will start to produce sharp cutoffs at cloud area corners. cloud_radius (Cloud radius) int 12 -# Enables view bobbing when walking. -view_bobbing (Enable view bobbing) bool true - -# Multiplier for view bobbing. +# Enable view bobbing and amount of view bobbing. # For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double. view_bobbing_amount (View bobbing factor) float 1.0 diff --git a/minetest.conf.example b/minetest.conf.example index bdd6fd7f4..ecbadb556 100644 --- a/minetest.conf.example +++ b/minetest.conf.example @@ -569,11 +569,7 @@ # type: int # cloud_radius = 12 -# Enables view bobbing when walking. -# type: bool -# view_bobbing = true - -# Multiplier for view bobbing. +# Enable view bobbing and amount of view bobbing. # For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double. # type: float # view_bobbing_amount = 1.0 @@ -1815,4 +1811,3 @@ # Print the engine's profiling data in regular intervals (in seconds). 0 = disable. Useful for developers. # type: int # profiler_print_interval = 0 - diff --git a/po/be/minetest.po b/po/be/minetest.po index 2466caea7..95a39697f 100644 --- a/po/be/minetest.po +++ b/po/be/minetest.po @@ -3670,7 +3670,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" "Множнік калыхання пры праглядзе.\n" diff --git a/po/ca/minetest.po b/po/ca/minetest.po index eaf350f89..32b247ffc 100644 --- a/po/ca/minetest.po +++ b/po/ca/minetest.po @@ -3465,7 +3465,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" diff --git a/po/cs/minetest.po b/po/cs/minetest.po index c7d1720f0..917bc652b 100644 --- a/po/cs/minetest.po +++ b/po/cs/minetest.po @@ -3383,7 +3383,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" diff --git a/po/da/minetest.po b/po/da/minetest.po index b1aa649ba..c2bbd1477 100644 --- a/po/da/minetest.po +++ b/po/da/minetest.po @@ -3663,7 +3663,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" diff --git a/po/de/minetest.po b/po/de/minetest.po index a81fd0d56..ac51254cc 100644 --- a/po/de/minetest.po +++ b/po/de/minetest.po @@ -3746,7 +3746,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" "Faktor für Auf- und Abbewegung (grafischer Effekt).\n" diff --git a/po/eo/minetest.po b/po/eo/minetest.po index adf29a0b6..71dd16892 100644 --- a/po/eo/minetest.po +++ b/po/eo/minetest.po @@ -3387,7 +3387,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" diff --git a/po/es/minetest.po b/po/es/minetest.po index 72438dc26..6cd0e184e 100644 --- a/po/es/minetest.po +++ b/po/es/minetest.po @@ -3526,7 +3526,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" diff --git a/po/et/minetest.po b/po/et/minetest.po index 94c9c7207..3cde4052b 100644 --- a/po/et/minetest.po +++ b/po/et/minetest.po @@ -3403,7 +3403,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" diff --git a/po/fr/minetest.po b/po/fr/minetest.po index f3aec72a6..9d1c0331a 100644 --- a/po/fr/minetest.po +++ b/po/fr/minetest.po @@ -3709,7 +3709,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" "Facteur de mouvement de bras.\n" diff --git a/po/he/minetest.po b/po/he/minetest.po index 2e5367a9d..1b88f9111 100644 --- a/po/he/minetest.po +++ b/po/he/minetest.po @@ -3301,7 +3301,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" diff --git a/po/hu/minetest.po b/po/hu/minetest.po index a461b6a6b..b5824cc6b 100644 --- a/po/hu/minetest.po +++ b/po/hu/minetest.po @@ -3615,7 +3615,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" diff --git a/po/id/minetest.po b/po/id/minetest.po index 20464ab7a..4a3a24c48 100644 --- a/po/id/minetest.po +++ b/po/id/minetest.po @@ -3580,7 +3580,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" diff --git a/po/it/minetest.po b/po/it/minetest.po index b41f38cab..df5a7d0da 100644 --- a/po/it/minetest.po +++ b/po/it/minetest.po @@ -3720,7 +3720,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" "Moltiplicatore per l'ondeggiamento visivo.\n" diff --git a/po/ja/minetest.po b/po/ja/minetest.po index f26036749..32e01a81b 100644 --- a/po/ja/minetest.po +++ b/po/ja/minetest.po @@ -3535,7 +3535,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" diff --git a/po/jbo/minetest.po b/po/jbo/minetest.po index 12ac80a39..749d53c35 100644 --- a/po/jbo/minetest.po +++ b/po/jbo/minetest.po @@ -3348,7 +3348,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" diff --git a/po/ko/minetest.po b/po/ko/minetest.po index 9bee4ee70..34bc7ddec 100644 --- a/po/ko/minetest.po +++ b/po/ko/minetest.po @@ -3507,7 +3507,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" "화면 흔들림 멀티플라이어\n" diff --git a/po/ky/minetest.po b/po/ky/minetest.po index 72c729f8d..52704f78d 100644 --- a/po/ky/minetest.po +++ b/po/ky/minetest.po @@ -3403,7 +3403,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" diff --git a/po/lt/minetest.po b/po/lt/minetest.po index 7556e0309..c00c0df84 100644 --- a/po/lt/minetest.po +++ b/po/lt/minetest.po @@ -3383,7 +3383,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" diff --git a/po/minetest.pot b/po/minetest.pot index 46a74b448..1dddd0a71 100644 --- a/po/minetest.pot +++ b/po/minetest.pot @@ -2279,7 +2279,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" diff --git a/po/ms/minetest.po b/po/ms/minetest.po index 97f7a75f3..e53039522 100644 --- a/po/ms/minetest.po +++ b/po/ms/minetest.po @@ -2481,7 +2481,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" diff --git a/po/nb/minetest.po b/po/nb/minetest.po index 28bcb3f90..d3a8bdc67 100644 --- a/po/nb/minetest.po +++ b/po/nb/minetest.po @@ -3314,7 +3314,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" diff --git a/po/nl/minetest.po b/po/nl/minetest.po index 68e3e7b6d..be29ac829 100644 --- a/po/nl/minetest.po +++ b/po/nl/minetest.po @@ -3719,7 +3719,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" "Vermenigvuldigingsfactor van loopbeweging.\n" diff --git a/po/pl/minetest.po b/po/pl/minetest.po index 8af82c0d6..0bf0ea84f 100644 --- a/po/pl/minetest.po +++ b/po/pl/minetest.po @@ -3674,7 +3674,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" diff --git a/po/pt/minetest.po b/po/pt/minetest.po index cef144845..992d0d608 100644 --- a/po/pt/minetest.po +++ b/po/pt/minetest.po @@ -3509,7 +3509,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" diff --git a/po/pt_BR/minetest.po b/po/pt_BR/minetest.po index 76d473a96..648b13a1c 100644 --- a/po/pt_BR/minetest.po +++ b/po/pt_BR/minetest.po @@ -3711,7 +3711,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" "Multiplicador para sacudir a exibição.\n" diff --git a/po/ro/minetest.po b/po/ro/minetest.po index a9efb035f..4b0a724ea 100644 --- a/po/ro/minetest.po +++ b/po/ro/minetest.po @@ -3429,7 +3429,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" diff --git a/po/ru/minetest.po b/po/ru/minetest.po index 4406ec5a0..c3f2465a3 100644 --- a/po/ru/minetest.po +++ b/po/ru/minetest.po @@ -3628,7 +3628,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" diff --git a/po/sr_Cyrl/minetest.po b/po/sr_Cyrl/minetest.po index 0a0078f23..2d8739639 100644 --- a/po/sr_Cyrl/minetest.po +++ b/po/sr_Cyrl/minetest.po @@ -3359,7 +3359,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" diff --git a/po/sw/minetest.po b/po/sw/minetest.po index abf0da24d..b33e622aa 100644 --- a/po/sw/minetest.po +++ b/po/sw/minetest.po @@ -3644,7 +3644,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" "Mengi kwa ajili ya Mwoneko kando.\n" diff --git a/po/tr/minetest.po b/po/tr/minetest.po index 707ce11d9..5db7287d4 100644 --- a/po/tr/minetest.po +++ b/po/tr/minetest.po @@ -3477,7 +3477,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" diff --git a/po/uk/minetest.po b/po/uk/minetest.po index 0035c792f..5271f4a5d 100644 --- a/po/uk/minetest.po +++ b/po/uk/minetest.po @@ -3350,7 +3350,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" diff --git a/po/zh_CN/minetest.po b/po/zh_CN/minetest.po index 410d98082..0503513e9 100644 --- a/po/zh_CN/minetest.po +++ b/po/zh_CN/minetest.po @@ -3421,7 +3421,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" diff --git a/po/zh_TW/minetest.po b/po/zh_TW/minetest.po index 7718ae462..55716950d 100644 --- a/po/zh_TW/minetest.po +++ b/po/zh_TW/minetest.po @@ -3608,7 +3608,7 @@ msgstr "" #: src/settings_translation_file.cpp msgid "" -"Multiplier for view bobbing.\n" +"Enable view bobbing and amount of view bobbing.\n" "For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double." msgstr "" "視野晃動的倍數。\n" diff --git a/src/camera.cpp b/src/camera.cpp index 7e83dadeb..b119bbfbb 100644 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -102,7 +102,6 @@ Camera::Camera(scene::ISceneManager* smgr, MapDrawControl& draw_control, m_cache_view_bobbing_amount = g_settings->getFloat("view_bobbing_amount"); m_cache_fov = g_settings->getFloat("fov"); m_cache_zoom_fov = g_settings->getFloat("zoom_fov"); - m_cache_view_bobbing = g_settings->getBool("view_bobbing"); m_nametags.clear(); } @@ -280,8 +279,8 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 busytime, v3f rel_cam_target = v3f(0,0,1); v3f rel_cam_up = v3f(0,1,0); - if (m_view_bobbing_anim != 0 && m_camera_mode < CAMERA_MODE_THIRD) - { + if (m_cache_view_bobbing_amount != 0.0f && m_view_bobbing_anim != 0.0f && + m_camera_mode < CAMERA_MODE_THIRD) { f32 bobfrac = my_modf(m_view_bobbing_anim * 2); f32 bobdir = (m_view_bobbing_anim < 0.5) ? 1.0 : -1.0; @@ -467,9 +466,7 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 busytime, const bool swimming = (movement_XZ || player->swimming_vertical) && player->in_liquid; const bool climbing = movement_Y && player->is_climbing; if ((walking || swimming || climbing) && - m_cache_view_bobbing && - (!g_settings->getBool("free_move") || !m_client->checkLocalPrivilege("fly"))) - { + (!g_settings->getBool("free_move") || !m_client->checkLocalPrivilege("fly"))) { // Start animation m_view_bobbing_state = 1; m_view_bobbing_speed = MYMIN(speed.getLength(), 70); diff --git a/src/camera.h b/src/camera.h index f57efdf10..e4c1d0b25 100644 --- a/src/camera.h +++ b/src/camera.h @@ -231,7 +231,6 @@ private: f32 m_cache_view_bobbing_amount; f32 m_cache_fov; f32 m_cache_zoom_fov; - bool m_cache_view_bobbing; std::list<Nametag *> m_nametags; }; diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 573b5e2d8..d45e386cf 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -171,7 +171,6 @@ void set_default_settings(Settings *settings) // Effects settings->setDefault("directional_colored_fog", "true"); - settings->setDefault("view_bobbing", "true"); settings->setDefault("inventory_items_animations", "false"); settings->setDefault("mip_map", "false"); settings->setDefault("anisotropic_filter", "false"); diff --git a/src/settings_translation_file.cpp b/src/settings_translation_file.cpp index d34665181..47601135d 100644 --- a/src/settings_translation_file.cpp +++ b/src/settings_translation_file.cpp @@ -242,7 +242,7 @@ fake_function() { gettext("Enable view bobbing"); gettext("Enables view bobbing when walking."); gettext("View bobbing factor"); - gettext("Multiplier for view bobbing.\nFor example: 0 for no view bobbing; 1.0 for normal; 2.0 for double."); + gettext("Enable view bobbing and amount of view bobbing.\nFor example: 0 for no view bobbing; 1.0 for normal; 2.0 for double."); gettext("Fall bobbing factor"); gettext("Multiplier for fall bobbing.\nFor example: 0 for no view bobbing; 1.0 for normal; 2.0 for double."); gettext("3D mode"); |