aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerjoystick.cpp
diff options
context:
space:
mode:
authorArmin Weatherwax2010-07-05 19:15:29 +0200
committerMcCabe Maxsted2010-07-09 13:06:23 -0700
commit25272eefcc875e86597dd9c856e1af40d68ab1e0 (patch)
treeef513758cc7a13296ecf40249adab442a3b941b4 /linden/indra/newview/llviewerjoystick.cpp
parentHenri Beauchamp: fix tooltips not disappearing (diff)
downloadmeta-impy-25272eefcc875e86597dd9c856e1af40d68ab1e0.zip
meta-impy-25272eefcc875e86597dd9c856e1af40d68ab1e0.tar.gz
meta-impy-25272eefcc875e86597dd9c856e1af40d68ab1e0.tar.bz2
meta-impy-25272eefcc875e86597dd9c856e1af40d68ab1e0.tar.xz
revamp autoenable joystick
Diffstat (limited to 'linden/indra/newview/llviewerjoystick.cpp')
-rw-r--r--linden/indra/newview/llviewerjoystick.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/linden/indra/newview/llviewerjoystick.cpp b/linden/indra/newview/llviewerjoystick.cpp
index 617ef13..4e509c7 100644
--- a/linden/indra/newview/llviewerjoystick.cpp
+++ b/linden/indra/newview/llviewerjoystick.cpp
@@ -82,7 +82,7 @@ void LLViewerJoystick::updateEnabled(bool autoenable)
82 } 82 }
83 else 83 else
84 { 84 {
85 if (isLikeSpaceNavigator() && autoenable) 85 if (autoenable)
86 { 86 {
87 gSavedSettings.setBOOL("JoystickEnabled", TRUE ); 87 gSavedSettings.setBOOL("JoystickEnabled", TRUE );
88 } 88 }
@@ -175,11 +175,13 @@ LLViewerJoystick::~LLViewerJoystick()
175} 175}
176 176
177// ----------------------------------------------------------------------------- 177// -----------------------------------------------------------------------------
178bool LLViewerJoystick::init(bool autoenable) 178bool LLViewerJoystick::init()
179{ 179{
180 180
181 static bool libinit = false; 181 static bool libinit = false;
182#if LIB_NDOF 182#if LIB_NDOF
183 bool autoenable = gSavedSettings.getBOOL("JoystickAutoEnable");
184
183 mDriverState = JDS_INITIALIZING; 185 mDriverState = JDS_INITIALIZING;
184 186
185 if (libinit == false) 187 if (libinit == false)
@@ -240,12 +242,7 @@ bool LLViewerJoystick::init(bool autoenable)
240 } 242 }
241 } 243 }
242 244
243 // Autoenable the joystick for recognized devices if nothing was connected previously 245
244 if (!autoenable)
245 {
246 autoenable = gSavedSettings.getString("JoystickInitialized").empty() ? true : false;
247 }
248 updateEnabled(autoenable);
249 246
250 if (mDriverState == JDS_INITIALIZED) 247 if (mDriverState == JDS_INITIALIZED)
251 { 248 {
@@ -265,8 +262,11 @@ bool LLViewerJoystick::init(bool autoenable)
265 // It's not a Space Navigator 262 // It's not a Space Navigator
266 gSavedSettings.setString("JoystickInitialized", "UnknownDevice"); 263 gSavedSettings.setString("JoystickInitialized", "UnknownDevice");
267 } 264 }
268 265 // Autoenable the joystick for recognized devices if nothing was connected previously
269 gSavedSettings.setBOOL("JoystickEnabled", TRUE ); 266 if (autoenable)
267 {
268 updateEnabled(autoenable);
269 }
270 } 270 }
271 else 271 else
272 { 272 {