aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra')
-rw-r--r--linden/indra/newview/app_settings/settings.xml11
-rw-r--r--linden/indra/newview/llappviewer.cpp8
-rw-r--r--linden/indra/newview/llappviewerlinux.cpp2
-rw-r--r--linden/indra/newview/llfloaterjoystick.cpp16
-rw-r--r--linden/indra/newview/llfloaterjoystick.h1
-rw-r--r--linden/indra/newview/llviewerjoystick.cpp20
-rw-r--r--linden/indra/newview/llviewerjoystick.h2
-rw-r--r--linden/indra/newview/llviewerwindow.cpp2
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_joystick.xml3
9 files changed, 49 insertions, 16 deletions
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml
index 1f4e16b..6fd76ac 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -6122,6 +6122,17 @@
6122 <key>Value</key> 6122 <key>Value</key>
6123 <integer>0</integer> 6123 <integer>0</integer>
6124 </map> 6124 </map>
6125 <key>JoystickAutoEnable</key>
6126 <map>
6127 <key>Comment</key>
6128 <string>Enables the Joystick at startup if plugged in.</string>
6129 <key>Persist</key>
6130 <integer>1</integer>
6131 <key>Type</key>
6132 <string>Boolean</string>
6133 <key>Value</key>
6134 <integer>0</integer>
6135 </map>
6125 <key>JoystickAvatarEnabled</key> 6136 <key>JoystickAvatarEnabled</key>
6126 <map> 6137 <map>
6127 <key>Comment</key> 6138 <key>Comment</key>
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp
index 7d2dac8..0c643b9 100644
--- a/linden/indra/newview/llappviewer.cpp
+++ b/linden/indra/newview/llappviewer.cpp
@@ -873,8 +873,14 @@ bool LLAppViewer::init()
873 873
874 gSimLastTime = gRenderStartTime.getElapsedTimeF32(); 874 gSimLastTime = gRenderStartTime.getElapsedTimeF32();
875 gSimFrames = (F32)gFrameCount; 875 gSimFrames = (F32)gFrameCount;
876 876/*
877#if LL_DARWIN //on mac the mouse gets misdetected as joystick; don't autoenable
877 LLViewerJoystick::getInstance()->init(false); 878 LLViewerJoystick::getInstance()->init(false);
879#else
880 LLViewerJoystick::getInstance()->init(true);
881#endif
882*/
883 LLViewerJoystick::getInstance()->init();
878 884
879 return true; 885 return true;
880} 886}
diff --git a/linden/indra/newview/llappviewerlinux.cpp b/linden/indra/newview/llappviewerlinux.cpp
index 39c2692..bb6cf9f 100644
--- a/linden/indra/newview/llappviewerlinux.cpp
+++ b/linden/indra/newview/llappviewerlinux.cpp
@@ -462,7 +462,7 @@ gboolean viewer_app_api_HotplugJoystick(ViewerAppAPI *obj, gchar *dummy, gboolea
462 462
463 if (!joystick_inited) 463 if (!joystick_inited)
464 { 464 {
465 success = LLViewerJoystick::getInstance()->init(false); 465 success = LLViewerJoystick::getInstance()->init();
466 } 466 }
467 467
468 *success_rtn = g_new (gboolean, 1); 468 *success_rtn = g_new (gboolean, 1);
diff --git a/linden/indra/newview/llfloaterjoystick.cpp b/linden/indra/newview/llfloaterjoystick.cpp
index 05e0564..960eebb 100644
--- a/linden/indra/newview/llfloaterjoystick.cpp
+++ b/linden/indra/newview/llfloaterjoystick.cpp
@@ -59,7 +59,7 @@ void LLFloaterJoystick::draw()
59 bool joystick_inited = LLViewerJoystick::getInstance()->isJoystickInitialized(); 59 bool joystick_inited = LLViewerJoystick::getInstance()->isJoystickInitialized();
60 if (!joystick_inited) 60 if (!joystick_inited)
61 { 61 {
62 joystick_inited = LLViewerJoystick::getInstance()->init(false); 62 joystick_inited = LLViewerJoystick::getInstance()->init();
63 } 63 }
64 childSetEnabled("enable_joystick", joystick_inited); 64 childSetEnabled("enable_joystick", joystick_inited);
65 childSetEnabled("joystick_type", joystick_inited); 65 childSetEnabled("joystick_type", joystick_inited);
@@ -147,8 +147,21 @@ void LLFloaterJoystick::refresh()
147{ 147{
148 LLFloater::refresh(); 148 LLFloater::refresh();
149 149
150 bool joystick_inited = LLViewerJoystick::getInstance()->isJoystickInitialized();
151 if (!joystick_inited)
152 {
153 joystick_inited = LLViewerJoystick::getInstance()->init();
154 }
155
156 mJoystickAutoEnable = gSavedSettings.getBOOL("JoystickAutoEnable");
157 if (mJoystickAutoEnable && joystick_inited)
158 {
159 gSavedSettings.setBOOL("JoystickEnabled",true);
160 }
161
150 mJoystickEnabled = gSavedSettings.getBOOL("JoystickEnabled"); 162 mJoystickEnabled = gSavedSettings.getBOOL("JoystickEnabled");
151 163
164
152 mJoystickAxis[0] = gSavedSettings.getS32("JoystickAxis0"); 165 mJoystickAxis[0] = gSavedSettings.getS32("JoystickAxis0");
153 mJoystickAxis[1] = gSavedSettings.getS32("JoystickAxis1"); 166 mJoystickAxis[1] = gSavedSettings.getS32("JoystickAxis1");
154 mJoystickAxis[2] = gSavedSettings.getS32("JoystickAxis2"); 167 mJoystickAxis[2] = gSavedSettings.getS32("JoystickAxis2");
@@ -217,6 +230,7 @@ void LLFloaterJoystick::refresh()
217void LLFloaterJoystick::cancel() 230void LLFloaterJoystick::cancel()
218{ 231{
219 gSavedSettings.setBOOL("JoystickEnabled", mJoystickEnabled); 232 gSavedSettings.setBOOL("JoystickEnabled", mJoystickEnabled);
233 gSavedSettings.setBOOL("JoystickAutoEnable", mJoystickAutoEnable);
220 234
221 gSavedSettings.setS32("JoystickAxis0", mJoystickAxis[0]); 235 gSavedSettings.setS32("JoystickAxis0", mJoystickAxis[0]);
222 gSavedSettings.setS32("JoystickAxis1", mJoystickAxis[1]); 236 gSavedSettings.setS32("JoystickAxis1", mJoystickAxis[1]);
diff --git a/linden/indra/newview/llfloaterjoystick.h b/linden/indra/newview/llfloaterjoystick.h
index 3ce647e..7f6f34d 100644
--- a/linden/indra/newview/llfloaterjoystick.h
+++ b/linden/indra/newview/llfloaterjoystick.h
@@ -60,6 +60,7 @@ private:
60private: 60private:
61 // Device prefs 61 // Device prefs
62 bool mJoystickEnabled; 62 bool mJoystickEnabled;
63 bool mJoystickAutoEnable;
63 S32 mJoystickAxis[7]; 64 S32 mJoystickAxis[7];
64 bool m3DCursor; 65 bool m3DCursor;
65 bool mAutoLeveling; 66 bool mAutoLeveling;
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 {
diff --git a/linden/indra/newview/llviewerjoystick.h b/linden/indra/newview/llviewerjoystick.h
index 3718831..25a3e99 100644
--- a/linden/indra/newview/llviewerjoystick.h
+++ b/linden/indra/newview/llviewerjoystick.h
@@ -55,7 +55,7 @@ public:
55 LLViewerJoystick(); 55 LLViewerJoystick();
56 virtual ~LLViewerJoystick(); 56 virtual ~LLViewerJoystick();
57 57
58 bool init(bool autoenable); 58 bool init();
59 void updateStatus(); 59 void updateStatus();
60 void scanJoystick(); 60 void scanJoystick();
61 void moveObjects(bool reset = false); 61 void moveObjects(bool reset = false);
diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp
index f8953c0..c89e0c5 100644
--- a/linden/indra/newview/llviewerwindow.cpp
+++ b/linden/indra/newview/llviewerwindow.cpp
@@ -1166,7 +1166,7 @@ BOOL LLViewerWindow::handleDeviceChange(LLWindow *window)
1166 // give a chance to use a joystick after startup (hot-plugging) 1166 // give a chance to use a joystick after startup (hot-plugging)
1167 if (!LLViewerJoystick::getInstance()->isJoystickInitialized() ) 1167 if (!LLViewerJoystick::getInstance()->isJoystickInitialized() )
1168 { 1168 {
1169 LLViewerJoystick::getInstance()->init(true); 1169 LLViewerJoystick::getInstance()->init();
1170 return TRUE; 1170 return TRUE;
1171 } 1171 }
1172 return FALSE; 1172 return FALSE;
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_joystick.xml b/linden/indra/newview/skins/default/xui/en-us/floater_joystick.xml
index 88e364e..c7a97f0 100644
--- a/linden/indra/newview/skins/default/xui/en-us/floater_joystick.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_joystick.xml
@@ -3,8 +3,9 @@
3 name="Joystick" title="Joystick Configuration" width="550"> 3 name="Joystick" title="Joystick Configuration" width="550">
4 4
5 <check_box name="enable_joystick" bottom="-38" left="14" width="60" halign="left" border_drop_shadow_visible="true" control_name="JoystickEnabled">Enable Joystick:</check_box> 5 <check_box name="enable_joystick" bottom="-38" left="14" width="60" halign="left" border_drop_shadow_visible="true" control_name="JoystickEnabled">Enable Joystick:</check_box>
6
6 <text name="joystick_type" bottom="-32" left="120" width="380" halign="left"></text> 7 <text name="joystick_type" bottom="-32" left="120" width="380" halign="left"></text>
7 8 <check_box name="auto_enable_joystick" bottom="-38" left="310" width="60" halign="left" border_drop_shadow_visible="true" control_name="JoystickAutoEnable">Auto-Enable Joystick</check_box>
8 <spinner bottom="-48" left="20" width="140" label_width="100" control_name="JoystickAxis1" name="JoystickAxis1" label="X Axis Mapping" decimal_digits="0" increment="1" min_val="-1" max_val="5"/> 9 <spinner bottom="-48" left="20" width="140" label_width="100" control_name="JoystickAxis1" name="JoystickAxis1" label="X Axis Mapping" decimal_digits="0" increment="1" min_val="-1" max_val="5"/>
9 <spinner bottom="-48" left="190" width="140" label_width="100" control_name="JoystickAxis2" name="JoystickAxis2" label="Y Axis Mapping" decimal_digits="0" increment="1" min_val="-1" max_val="5"/> 10 <spinner bottom="-48" left="190" width="140" label_width="100" control_name="JoystickAxis2" name="JoystickAxis2" label="Y Axis Mapping" decimal_digits="0" increment="1" min_val="-1" max_val="5"/>
10 <spinner bottom="-48" left="360" width="140" label_width="100" control_name="JoystickAxis0" name="JoystickAxis0" label="Z Axis Mapping" decimal_digits="0" increment="1" min_val="-1" max_val="5"/> 11 <spinner bottom="-48" left="360" width="140" label_width="100" control_name="JoystickAxis0" name="JoystickAxis0" label="Z Axis Mapping" decimal_digits="0" increment="1" min_val="-1" max_val="5"/>