summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
authorJosh Bell <josh@lindenlab.com>2007-03-21 19:36:11 +0000
committerJosh Bell <josh@lindenlab.com>2007-03-21 19:36:11 +0000
commitc93c38e047836e31dd34e33391a997d883777ae1 (patch)
treeccb52c02f9a3bfeb76254e128abc250e7fd5a962 /indra/llwindow
parentfceae96eb171be0396512e251aab311d4e3ef9cc (diff)
svn merge -r 59178:59364 svn+ssh://svn.lindenlab.com/svn/linden/branches/maintenance --> release
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/llwindow.cpp13
-rw-r--r--indra/llwindow/llwindow.h4
-rw-r--r--indra/llwindow/llwindowwin32.cpp7
3 files changed, 23 insertions, 1 deletions
diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index d5e1e77053..ccc100a861 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -213,6 +213,10 @@ LLWindow::LLWindow(BOOL fullscreen, U32 flags)
mHideCursorPermanent(FALSE),
mFlags(flags)
{
+ for (U32 i = 0; i < 6; i++)
+ {
+ mJoyAxis[i] = 0;
+ }
}
// virtual
@@ -230,6 +234,15 @@ void LLWindow::decBusyCount()
}
}
+F32 LLWindow::getJoystickAxis(U32 axis)
+{
+ if (axis < 6)
+ {
+ return mJoyAxis[axis];
+ }
+ return 0.f;
+}
+
void LLWindow::setCallbacks(LLWindowCallbacks *callbacks)
{
mCallbacks = callbacks;
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h
index bbe530c906..f19178d7f5 100644
--- a/indra/llwindow/llwindow.h
+++ b/indra/llwindow/llwindow.h
@@ -181,7 +181,8 @@ public:
virtual F32 getNativeAspectRatio() = 0;
virtual F32 getPixelAspectRatio() = 0;
virtual void setNativeAspectRatio(F32 aspect) = 0;
-
+
+ F32 getJoystickAxis(U32 axis);
void setCallbacks(LLWindowCallbacks *callbacks);
virtual void beforeDialog() {}; // prepare to put up an OS dialog (if special measures are required, such as in fullscreen mode)
@@ -219,6 +220,7 @@ protected:
ESwapMethod mSwapMethod;
BOOL mHideCursorPermanent;
U32 mFlags;
+ F32 mJoyAxis[6];
friend class LLWindowManager;
};
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 4efa173fc4..b8123096e6 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -2796,6 +2796,13 @@ void LLWindowWin32::updateJoystick( )
if( FAILED( hr = g_pJoystick->GetDeviceState( sizeof(DIJOYSTATE), &js ) ) )
return; // The device should have been acquired during the Poll()
+ mJoyAxis[0] = js.lX/1000.f;
+ mJoyAxis[1] = js.lY/1000.f;
+ mJoyAxis[2] = js.lZ/1000.f;
+ mJoyAxis[3] = js.lRx/1000.f;
+ mJoyAxis[4] = js.lRy/1000.f;
+ mJoyAxis[5] = js.lRz/1000.f;
+
if (js.lX <= -500)
{
if (!(mJoyStickState & 0x1))