summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowwin32.cpp
diff options
context:
space:
mode:
authorJosh Bell <josh@lindenlab.com>2007-03-31 01:41:19 +0000
committerJosh Bell <josh@lindenlab.com>2007-03-31 01:41:19 +0000
commitea8fb7238e6f12383ee4bc081475fa6235637581 (patch)
treef384da93c884353bef55cf887f6c86f2081db271 /indra/llwindow/llwindowwin32.cpp
parentffc6680d956069625fc1fe5da133bdf7922cea83 (diff)
svn merge -r 59364:59813 svn+ssh://svn.lindenlab.com/svn/linden/branches/maintenance --> release
Diffstat (limited to 'indra/llwindow/llwindowwin32.cpp')
-rw-r--r--indra/llwindow/llwindowwin32.cpp86
1 files changed, 2 insertions, 84 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index b8123096e6..697b8f2175 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -744,8 +744,6 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width,
}
SetTimer( mWindowHandle, 0, 1000 / 30, NULL ); // 30 fps timer
- mJoyStickState = 0;
- mJoyButtonState = 0;
}
@@ -2803,89 +2801,9 @@ void LLWindowWin32::updateJoystick( )
mJoyAxis[4] = js.lRy/1000.f;
mJoyAxis[5] = js.lRz/1000.f;
- if (js.lX <= -500)
+ for (U32 i = 0; i < 16; i++)
{
- if (!(mJoyStickState & 0x1))
- {
- gKeyboard->handleTranslatedKeyDown(KEY_PAD_LEFT, 0);
- mJoyStickState |= 0x1;
- }
- }
- else
- {
- if (mJoyStickState & 0x1)
- {
- gKeyboard->handleTranslatedKeyUp(KEY_PAD_LEFT, 0);
- mJoyStickState &= ~0x1;
- }
- }
- if (js.lX >= 500)
- {
- if (!(mJoyStickState & 0x2))
- {
- gKeyboard->handleTranslatedKeyDown(KEY_PAD_RIGHT, 0);
- mJoyStickState |= 0x2;
- }
- }
- else
- {
- if (mJoyStickState & 0x2)
- {
- gKeyboard->handleTranslatedKeyUp(KEY_PAD_RIGHT, 0);
- mJoyStickState &= ~0x2;
- }
- }
- if (js.lY <= -500)
- {
- if (!(mJoyStickState & 0x4))
- {
- gKeyboard->handleTranslatedKeyDown(KEY_PAD_UP, 0);
- mJoyStickState |= 0x4;
- }
- }
- else
- {
- if (mJoyStickState & 0x4)
- {
- gKeyboard->handleTranslatedKeyUp(KEY_PAD_UP, 0);
- mJoyStickState &= ~0x4;
- }
- }
- if (js.lY >= 500)
- {
- if (!(mJoyStickState & 0x8))
- {
- gKeyboard->handleTranslatedKeyDown(KEY_PAD_DOWN, 0);
- mJoyStickState |= 0x8;
- }
- }
- else
- {
- if (mJoyStickState & 0x8)
- {
- gKeyboard->handleTranslatedKeyUp(KEY_PAD_DOWN, 0);
- mJoyStickState &= ~0x8;
- }
- }
-
- for( int i = 0; i < 15; i++ )
- {
- if ( js.rgbButtons[i] & 0x80 )
- {
- if (!(mJoyButtonState & (1<<i)))
- {
- gKeyboard->handleTranslatedKeyDown(KEY_BUTTON1+i, 0);
- mJoyButtonState |= (1<<i);
- }
- }
- else
- {
- if (mJoyButtonState & (1<<i))
- {
- gKeyboard->handleTranslatedKeyUp(KEY_BUTTON1+i, 0);
- mJoyButtonState &= ~(1<<i);
- }
- }
+ mJoyButtonState[i] = js.rgbButtons[i];
}
}