From 9255bd73deab77b3a2b8b9ba85d4e245b1248e2d Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 26 Jun 2013 17:38:20 +0200 Subject: [PATCH] Move snowballs compass, see #43 --HG-- branch : multipass-stereo --- code/snowballs2/client/src/compass.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/code/snowballs2/client/src/compass.cpp b/code/snowballs2/client/src/compass.cpp index 11d7ddefa..b915cdb52 100644 --- a/code/snowballs2/client/src/compass.cpp +++ b/code/snowballs2/client/src/compass.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include "mouse_listener.h" #include "camera.h" @@ -94,6 +95,13 @@ void updateCompass () { float x = CompassPosX; float y = CompassPosY; + if (StereoHMD) + { + float xshift, yshift; + StereoHMD->getInterface2DShift(xshift, yshift, 4.0f); + x += xshift; + y += yshift; + } float radius = CompassRadius; // tri @@ -109,7 +117,8 @@ void updateCompass () quad.V2.set ( radius, radius, 0); quad.V3.set (-radius, radius, 0); - Driver->setMatrixMode2D43 (); + if (StereoHMD) Driver->setMatrixMode2D11(); + else Driver->setMatrixMode2D43(); CMatrix mtx; @@ -152,7 +161,7 @@ void updateCompass () Driver->setModelMatrix (mtx); Driver->drawQuad (quad, CompassMaterial); - x *= 3.0/4.0f; + if (!StereoHMD) x *= 3.0/4.0f; // Print position TextContext->setHotSpot(UTextContext::MiddleTop);