From b2afb8800bb033a04bb3ecdf0363068d56648ef1 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:44:54 -0500 Subject: Second Life viewer sources 1.15.0.2 --- linden/indra/llwindow/llwindow.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'linden/indra/llwindow/llwindow.cpp') diff --git a/linden/indra/llwindow/llwindow.cpp b/linden/indra/llwindow/llwindow.cpp index 20fc84e..134e606 100644 --- a/linden/indra/llwindow/llwindow.cpp +++ b/linden/indra/llwindow/llwindow.cpp @@ -4,6 +4,7 @@ * * Copyright (c) 2001-2007, Linden Research, Inc. * + * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement @@ -232,6 +233,15 @@ LLWindow::LLWindow(BOOL fullscreen, U32 flags) mHideCursorPermanent(FALSE), mFlags(flags) { + for (U32 i = 0; i < 6; i++) + { + mJoyAxis[i] = 0; + } + + for (U32 i = 0; i < 16; i++) + { + mJoyButtonState[i] = 0; + } } // virtual @@ -249,6 +259,24 @@ void LLWindow::decBusyCount() } } +F32 LLWindow::getJoystickAxis(U32 axis) +{ + if (axis < 6) + { + return mJoyAxis[axis]; + } + return 0.f; +} + +U8 LLWindow::getJoystickButton(U32 button) +{ + if (button < 16) + { + return mJoyButtonState[button]; + } + return 0; +} + void LLWindow::setCallbacks(LLWindowCallbacks *callbacks) { mCallbacks = callbacks; -- cgit v1.1