summaryrefslogtreecommitdiff
path: root/src/client/render
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/render')
-rw-r--r--src/client/render/factory.cpp2
-rw-r--r--src/client/render/sidebyside.cpp6
-rw-r--r--src/client/render/sidebyside.h3
3 files changed, 7 insertions, 4 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;
};