diff options
author | otdav33 <odavies@dread.life> | 2018-05-29 12:38:58 -0400 |
---|---|---|
committer | SmallJoker <SmallJoker@users.noreply.github.com> | 2018-05-29 18:38:58 +0200 |
commit | 3f0720e721a2f4360fd0397a67ad57e0adc30f79 (patch) | |
tree | 95d6b360da58b208d3b724e093090c1fd9b172e7 /src | |
parent | 7f7678e4e30fdae3722c3f75d4dc6488364d853e (diff) | |
download | minetest-3f0720e721a2f4360fd0397a67ad57e0adc30f79.tar.gz minetest-3f0720e721a2f4360fd0397a67ad57e0adc30f79.tar.bz2 minetest-3f0720e721a2f4360fd0397a67ad57e0adc30f79.zip |
Add crossview support (#7361)
Diffstat (limited to 'src')
-rw-r--r-- | src/client/render/factory.cpp | 2 | ||||
-rw-r--r-- | src/client/render/sidebyside.cpp | 6 | ||||
-rw-r--r-- | src/client/render/sidebyside.h | 3 | ||||
-rw-r--r-- | src/settings_translation_file.cpp | 2 |
4 files changed, 8 insertions, 5 deletions
diff --git a/src/client/render/factory.cpp b/src/client/render/factory.cpp index 410ceaad7..3aabc5db9 100644 --- a/src/client/render/factory.cpp +++ b/src/client/render/factory.cpp @@ -41,5 +41,7 @@ RenderingCore *createRenderingCore(const std::string &stereo_mode, IrrlichtDevic return new RenderingCoreSideBySide(device, client, hud); if (stereo_mode == "topbottom") return new RenderingCoreSideBySide(device, client, hud, true); + if (stereo_mode == "crossview") + return new RenderingCoreSideBySide(device, client, hud, false, true); throw std::invalid_argument("Invalid rendering mode: " + stereo_mode); } diff --git a/src/client/render/sidebyside.cpp b/src/client/render/sidebyside.cpp index 9b1e06d4a..ed08810db 100644 --- a/src/client/render/sidebyside.cpp +++ b/src/client/render/sidebyside.cpp @@ -23,8 +23,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "client/hud.h" RenderingCoreSideBySide::RenderingCoreSideBySide( - IrrlichtDevice *_device, Client *_client, Hud *_hud, bool _horizontal) - : RenderingCoreStereo(_device, _client, _hud), horizontal(_horizontal) + IrrlichtDevice *_device, Client *_client, Hud *_hud, bool _horizontal, bool _flipped) + : RenderingCoreStereo(_device, _client, _hud), horizontal(_horizontal), flipped(_flipped) { } @@ -62,7 +62,7 @@ void RenderingCoreSideBySide::drawAll() void RenderingCoreSideBySide::useEye(bool _right) { driver->setRenderTarget(_right ? right : left, true, true, skycolor); - RenderingCoreStereo::useEye(_right); + RenderingCoreStereo::useEye(_right ^ flipped); } void RenderingCoreSideBySide::resetEye() diff --git a/src/client/render/sidebyside.h b/src/client/render/sidebyside.h index b5cf9d5db..f8ed256b3 100644 --- a/src/client/render/sidebyside.h +++ b/src/client/render/sidebyside.h @@ -27,6 +27,7 @@ protected: video::ITexture *left = nullptr; video::ITexture *right = nullptr; bool horizontal = false; + bool flipped = false; core::dimension2du image_size; v2s32 rpos; @@ -37,6 +38,6 @@ protected: public: RenderingCoreSideBySide(IrrlichtDevice *_device, Client *_client, Hud *_hud, - bool _horizontal = false); + bool _horizontal = false, bool _flipped = false); void drawAll() override; }; diff --git a/src/settings_translation_file.cpp b/src/settings_translation_file.cpp index ec0c0db6b..f94bfb3f2 100644 --- a/src/settings_translation_file.cpp +++ b/src/settings_translation_file.cpp @@ -286,7 +286,7 @@ fake_function() { 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"); - gettext("3D support.\nCurrently supported:\n- none: no 3d output.\n- anaglyph: cyan/magenta color 3d.\n- interlaced: odd/even line based polarisation screen support.\n- topbottom: split screen top/bottom.\n- sidebyside: split screen side by side.\n- pageflip: quadbuffer based 3d.\nNote that the interlaced mode requires shaders to be enabled."); + gettext("3D support.\nCurrently supported:\n- none: no 3d output.\n- anaglyph: cyan/magenta color 3d.\n- interlaced: odd/even line based polarisation screen support.\n- topbottom: split screen top/bottom.\n- sidebyside: split screen side by side.\n- crossview: cross-eyed 3d viewing.\n- pageflip: quadbuffer based 3d.\nNote that the interlaced mode requires shaders to be enabled."); gettext("Console height"); gettext("In-game chat console height, between 0.1 (10%) and 1.0 (100%)."); gettext("Console color"); |