summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2008-04-17 02:56:14 +0000
committerSteven Bennetts <steve@lindenlab.com>2008-04-17 02:56:14 +0000
commita3f3ab7e113e44309461b26399d627814f0ce4f9 (patch)
tree695b2a41f8d31330634ef59e7d6ece526242fd86
parentd85247e63e5ff0b488211b62429a4895b48dee27 (diff)
QAR-449 Viewer 1.20 RC 1
merge Branch_1-20-Viewer -r 84432 : 84760 -> release
-rw-r--r--doc/contributions.txt4
-rw-r--r--doc/releasenotes-where.txt5
-rw-r--r--indra/llcharacter/lljoint.cpp9
-rw-r--r--indra/llcommon/lldarray.h3
-rw-r--r--indra/llui/llcombobox.cpp2
-rw-r--r--indra/llui/lllineeditor.h2
-rw-r--r--indra/llui/llscrolllistctrl.cpp29
-rw-r--r--indra/llwindow/llwindowwin32.cpp59
-rw-r--r--indra/newview/app_settings/cmd_line.xml16
-rw-r--r--indra/newview/app_settings/settings.xml60
-rw-r--r--indra/newview/llappviewer.cpp99
-rw-r--r--indra/newview/llappviewermacosx.cpp32
-rw-r--r--indra/newview/llcommandlineparser.cpp14
-rw-r--r--indra/newview/llcommandlineparser.h169
-rw-r--r--indra/newview/llfloaterjoystick.cpp77
-rw-r--r--indra/newview/llfloaterworldmap.cpp351
-rw-r--r--indra/newview/llfloaterworldmap.h14
-rw-r--r--indra/newview/llhudmanager.cpp7
-rw-r--r--indra/newview/llhudmanager.h2
-rw-r--r--indra/newview/llpanellogin.cpp9
-rw-r--r--indra/newview/llprogressview.cpp6
-rw-r--r--indra/newview/llstartup.cpp2
-rw-r--r--indra/newview/lltexturecache.cpp4
-rw-r--r--indra/newview/lltracker.cpp2
-rw-r--r--indra/newview/llviewercontrol.cpp2
-rw-r--r--indra/newview/llviewerjoystick.cpp179
-rw-r--r--indra/newview/llviewerjoystick.h16
-rw-r--r--indra/newview/llviewermenu.cpp24
-rw-r--r--indra/newview/llviewerwindow.cpp6
-rw-r--r--indra/newview/llvoavatar.cpp2
-rw-r--r--indra/newview/pipeline.cpp2
31 files changed, 714 insertions, 494 deletions
diff --git a/doc/contributions.txt b/doc/contributions.txt
index ae4f65b8c8..cd30c0c7a1 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -41,6 +41,10 @@ Alissa Sabre
VWR-3290
VWR-4010
VWR-3410
+ VWR-6386
+ VWR-6384
+ VWR-6385
+ VWR-5929
Angus Boyd
VWR-592
Argent Stonecutter
diff --git a/doc/releasenotes-where.txt b/doc/releasenotes-where.txt
new file mode 100644
index 0000000000..89125d224e
--- /dev/null
+++ b/doc/releasenotes-where.txt
@@ -0,0 +1,5 @@
+For full release notes, see:
+ indra/newview/releasenotes.txt
+
+This is the same asset sourced by the viewer for displaying release notes.
+
diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp
index 00ec8e5068..1f3e39daa3 100644
--- a/indra/llcharacter/lljoint.cpp
+++ b/indra/llcharacter/lljoint.cpp
@@ -189,11 +189,12 @@ void LLJoint::removeChild(LLJoint* joint)
child_list_t::iterator iter = std::find(mChildren.begin(), mChildren.end(), joint);
if (iter != mChildren.end())
{
- this->mChildren.erase(iter);
+ mChildren.erase(iter);
+
+ joint->mXform.setParent(NULL);
+ joint->mParent = NULL;
+ joint->touch();
}
- joint->mXform.setParent(NULL);
- joint->mParent = NULL;
- joint->touch();
}
diff --git a/indra/llcommon/lldarray.h b/indra/llcommon/lldarray.h
index 3b46706d42..c7268b8dab 100644
--- a/indra/llcommon/lldarray.h
+++ b/indra/llcommon/lldarray.h
@@ -119,11 +119,12 @@ inline S32 LLDynamicArray<Type,BlockSize>::removeObj(const Type& obj)
typename std::vector<Type>::iterator iter = std::find(this->begin(), this->end(), obj);
if (iter != this->end())
{
+ S32 res = iter - this->begin();
typename std::vector<Type>::iterator last = this->end();
--last;
*iter = *last;
this->pop_back();
- return iter - this->begin();
+ return res;
}
return FAIL;
}
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp
index 0e8239cabd..3dd99a4636 100644
--- a/indra/llui/llcombobox.cpp
+++ b/indra/llui/llcombobox.cpp
@@ -749,7 +749,7 @@ BOOL LLComboBox::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_
tool_tip = getToolTip();
if (tool_tip.empty())
{
- tool_tip = getValue().asString();
+ tool_tip = getSelectedItemLabel();
}
}
diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h
index 687e98e377..f5d7ecd4c4 100644
--- a/indra/llui/lllineeditor.h
+++ b/indra/llui/lllineeditor.h
@@ -305,7 +305,7 @@ protected:
private:
// Utility on top of LLUI::getUIImage, looks up a named image in a given XML node and returns it if possible
// or returns a given default image if anything in the process fails.
- static LLPointer<LLUIImage> LLLineEditor::parseImage(LLString name, LLXMLNodePtr from, LLPointer<LLUIImage> def);
+ static LLPointer<LLUIImage> parseImage(LLString name, LLXMLNodePtr from, LLPointer<LLUIImage> def);
// Global instance used as default for member instance below.
static LLPointer<LLUIImage> sImage;
// Instances that by default point to the statics but can be overidden in XML.
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index 87929b10b4..eb244a6f82 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -69,37 +69,26 @@ struct SortScrollListItem
bool operator()(const LLScrollListItem* i1, const LLScrollListItem* i2)
{
- if ( mSortOrders.empty() ) return true;
-
- const LLScrollListCell *cell1 = NULL;
- const LLScrollListCell *cell2 = NULL;
-
- sort_order_t::const_reverse_iterator end_it = mSortOrders.rend();
- sort_order_t::const_reverse_iterator it;
+ if ( mSortOrders.empty() )
+ return i1 < i2;
// sort over all columns in order specified by mSortOrders
S32 sort_result = 0;
- for (it = mSortOrders.rbegin(); it != end_it; ++it)
+ for (sort_order_t::const_reverse_iterator it = mSortOrders.rbegin();
+ it != mSortOrders.rend(); ++it)
{
S32 col_idx = it->first;
BOOL sort_ascending = it->second;
- cell1 = i1->getColumn(col_idx);
- cell2 = i2->getColumn(col_idx);
- // ascending or descending sort for this column?
- S32 order = 1;
- if (!sort_ascending)
- {
- order = -1;
- }
-
+ const LLScrollListCell *cell1 = i1->getColumn(col_idx);
+ const LLScrollListCell *cell2 = i2->getColumn(col_idx);
+ S32 order = sort_ascending ? 1 : -1; // ascending or descending sort for this column?
if (cell1 && cell2)
{
- sort_result = (order * LLString::compareDict(cell1->getValue().asString(), cell2->getValue().asString()));
+ sort_result = order * LLString::compareDict(cell1->getValue().asString(), cell2->getValue().asString());
if (sort_result != 0)
{
- // we have a sort order!
- break;
+ break; // we have a sort order!
}
}
}
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 61daacb567..bbc452fe5e 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -383,8 +383,6 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width,
allowLanguageTextInput(mPreeditor, FALSE);
WNDCLASS wc;
- DWORD dw_ex_style;
- DWORD dw_style;
RECT window_rect;
// Set the window title
@@ -578,49 +576,7 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width,
OSMessageBox(error, "Error", OSMB_OK);
}
}
-
- //-----------------------------------------------------------------------
- // Resize window to account for borders
- //-----------------------------------------------------------------------
- if (mFullscreen)
- {
- dw_ex_style = WS_EX_APPWINDOW;
- dw_style = WS_POPUP;
-
- // Move window borders out not to cover window contents
- AdjustWindowRectEx(&window_rect, dw_style, FALSE, dw_ex_style);
- }
- else
- {
- // Window with an edge
- dw_ex_style = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
- dw_style = WS_OVERLAPPEDWINDOW;
- }
-
- //-----------------------------------------------------------------------
- // Create the window
- // Microsoft help indicates that GL windows must be created with
- // WS_CLIPSIBLINGS and WS_CLIPCHILDREN, but not CS_PARENTDC
- //-----------------------------------------------------------------------
- mWindowHandle = CreateWindowEx(dw_ex_style,
- mWindowClassName,
- mWindowTitle,
- WS_CLIPSIBLINGS | WS_CLIPCHILDREN | dw_style,
- x, // x pos
- y, // y pos
- window_rect.right - window_rect.left, // width
- window_rect.bottom - window_rect.top, // height
- NULL,
- NULL,
- mhInstance,
- NULL);
-
- if (!mWindowHandle)
- {
- OSMessageBox("Window creation error", "Error", OSMB_OK);
- return;
- }
-
+
// TODO: add this after resolving _WIN32_WINNT issue
// if (!fullscreen)
// {
@@ -632,14 +588,7 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width,
// TrackMouseEvent( &track_mouse_event );
// }
-
-
- S32 pfdflags = PFD_DRAW_TO_WINDOW | PFD_DOUBLEBUFFER;
- if (use_gl)
- {
- pfdflags |= PFD_SUPPORT_OPENGL;
- }
-
+
//-----------------------------------------------------------------------
// Create GL drawing context
//-----------------------------------------------------------------------
@@ -1398,6 +1347,10 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
SetWindowLong(mWindowHandle, GWL_USERDATA, (U32)this);
show();
+ //make sure multi sampling is disabled by default
+ glDisable(GL_MULTISAMPLE_ARB);
+
+
// ok to post quit messages now
mPostQuit = TRUE;
return TRUE;
diff --git a/indra/newview/app_settings/cmd_line.xml b/indra/newview/app_settings/cmd_line.xml
index 43c3d85679..3e6fa21cc6 100644
--- a/indra/newview/app_settings/cmd_line.xml
+++ b/indra/newview/app_settings/cmd_line.xml
@@ -169,10 +169,9 @@
<key>setdefault</key>
<map>
<key>desc</key>
- <string>
- "specify the value of a particular\n
- configuration variable which can be\n
- overridden by settings.xml\n"
+ <string> specify the value of a particular
+ configuration variable which can be
+ overridden by settings.xml
</string>
<key>count</key>
<integer>2</integer>
@@ -182,10 +181,9 @@
<key>set</key>
<map>
<key>desc</key>
- <string>
- "specify the value of a particular\n
- configuration variable that\n
- overrides all other settings\n"
+ <string> specify the value of a particular
+ configuration variable that
+ overrides all other settings
</string>
<key>count</key>
<integer>2</integer>
@@ -239,8 +237,6 @@
<map>
<key>desc</key>
<string>Allow multple viewers.</string>
- <key>count</key>
- <integer>1</integer>
<key>map-to</key>
<string>AllowMultipleViewers</string>
</map>
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 2754b27234..1c421b343a 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -74,7 +74,7 @@
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
- <integer>1</integer>
+ <integer>0</integer>
</map>
<key>AnimateTextures</key>
<map>
@@ -2829,12 +2829,56 @@
<key>Comment</key>
<string>Whether or not a joystick has been detected and initiailized.</string>
<key>Persist</key>
- <integer>1</integer>
+ <integer>0</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string></string>
</map>
+ <key>JoystickEnabled</key>
+ <map>
+ <key>Comment</key>
+ <string>Enables Joystick Input.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <string>0</string>
+ </map>
+ <key>JoystickFlycamEnabled</key>
+ <map>
+ <key>Comment</key>
+ <string>Enables the Joystick to control the flycam.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <string>1</string>
+ </map>
+ <key>JoystickAvatarEnabled</key>
+ <map>
+ <key>Comment</key>
+ <string>Enables the Joystick to control Avatar movmement.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <string>1</string>
+ </map>
+ <key>JoystickBuildEnabled</key>
+ <map>
+ <key>Comment</key>
+ <string>Enables the Joystick to move edited objects.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <string>1</string>
+ </map>
<key>JoystickAxis0</key>
<map>
<key>Comment</key>
@@ -2844,7 +2888,7 @@
<key>Type</key>
<string>S32</string>
<key>Value</key>
- <integer>0</integer>
+ <integer>1</integer>
</map>
<key>JoystickAxis1</key>
<map>
@@ -2855,7 +2899,7 @@
<key>Type</key>
<string>S32</string>
<key>Value</key>
- <integer>2</integer>
+ <integer>0</integer>
</map>
<key>JoystickAxis2</key>
<map>
@@ -2866,7 +2910,7 @@
<key>Type</key>
<string>S32</string>
<key>Value</key>
- <integer>1</integer>
+ <integer>2</integer>
</map>
<key>JoystickAxis3</key>
<map>
@@ -2877,7 +2921,7 @@
<key>Type</key>
<string>S32</string>
<key>Value</key>
- <integer>5</integer>
+ <integer>4</integer>
</map>
<key>JoystickAxis4</key>
<map>
@@ -2888,7 +2932,7 @@
<key>Type</key>
<string>S32</string>
<key>Value</key>
- <integer>4</integer>
+ <integer>3</integer>
</map>
<key>JoystickAxis5</key>
<map>
@@ -2899,7 +2943,7 @@
<key>Type</key>
<string>S32</string>
<key>Value</key>
- <integer>3</integer>
+ <integer>5</integer>
</map>
<key>JoystickAxis6</key>
<map>
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index b360d9a8e5..1550b6dc23 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -407,7 +407,7 @@ static void settings_to_globals()
static void settings_modify()
{
LLRenderTarget::sUseFBO = gSavedSettings.getBOOL("RenderUseFBO");
- LLVOAvatar::sUseImpostors = gSavedSettings.getBOOL("RenderUseImpostors");
+ LLVOAvatar::sUseImpostors = FALSE; //gSavedSettings.getBOOL("RenderUseImpostors");
LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor");
LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //sqaure lod factor to get exponential range of [1,4]
@@ -526,6 +526,7 @@ bool send_url_to_other_instance(const std::string& url)
window_class[255] = 0;
// Use the class instead of the window name.
HWND other_window = FindWindow(window_class, NULL);
+
if (other_window != NULL)
{
lldebugs << "Found other window with the name '" << gWindowTitle << "'" << llendl;
@@ -860,7 +861,7 @@ bool LLAppViewer::init()
gSimLastTime = gRenderStartTime.getElapsedTimeF32();
gSimFrames = (F32)gFrameCount;
- LLViewerJoystick::getInstance()->init();
+ LLViewerJoystick::getInstance()->init(false);
if (LLViewerJoystick::getInstance()->isLikeSpaceNavigator())
{
if (gSavedSettings.getString("JoystickInitialized") != "SpaceNavigator")
@@ -1118,6 +1119,8 @@ bool LLAppViewer::cleanup()
// Note: this is where gWorldMap used to be deleted.
// Note: this is where gHUDManager used to be deleted.
+ LLHUDManager::getInstance()->shutdownClass();
+
delete gAssetStorage;
gAssetStorage = NULL;
@@ -1482,6 +1485,7 @@ bool LLAppViewer::initConfiguration()
#ifndef LL_RELEASE_FOR_DOWNLOAD
gSavedSettings.setBOOL("ShowConsoleWindow", TRUE);
+ gSavedSettings.setBOOL("AllowMultipleViewers", TRUE);
#endif
#if LL_WINDOWS
@@ -1562,6 +1566,18 @@ bool LLAppViewer::initConfiguration()
<< llendl;
llinfos << "Command line usage:\n" << clp << llendl;
+
+ std::ostringstream msg;
+ msg << "Second Life found an error parsing the command line. \n"
+ << "Please see: http://wiki.secondlife.com/wiki/Client_parameters \n"
+ << "Error: " << clp.getErrorMessage();
+
+ OSMessageBox(
+ msg.str().c_str(),
+ NULL,
+ OSMB_OK);
+
+ return false;
}
// If we have specified crash on startup, might as well do it now.
@@ -1600,7 +1616,15 @@ bool LLAppViewer::initConfiguration()
if(clp.hasOption("help"))
{
- llinfos << "Command line usage:\n" << clp << llendl;
+ std::ostringstream msg;
+ msg << "Command line usage:\n" << clp;
+ llinfos << msg.str() << llendl;
+
+ OSMessageBox(
+ msg.str().c_str(),
+ NULL,
+ OSMB_OK);
+
return false;
}
@@ -1811,32 +1835,34 @@ bool LLAppViewer::initConfiguration()
#endif
LLString::truncate(gWindowTitle, 255);
+ //RN: if we received a URL, hand it off to the existing instance
+ // don't call anotherInstanceRunning() when doing URL handoff, as
+ // it relies on checking a marker file which will not work when running
+ // out of different directories
+ std::string slurl;
+ if (!LLStartUp::sSLURLCommand.empty())
+ {
+ slurl = LLStartUp::sSLURLCommand;
+ }
+ else if (LLURLSimString::parse())
+ {
+ slurl = LLURLSimString::getURL();
+ }
+ if (!slurl.empty())
+ {
+ if (send_url_to_other_instance(slurl))
+ {
+ // successfully handed off URL to existing instance, exit
+ return false;
+ }
+ }
+
if (!gSavedSettings.getBOOL("AllowMultipleViewers"))
{
//
// Check for another instance of the app running
//
- //RN: if we received a URL, hand it off to the existing instance
- // don't call anotherInstanceRunning() when doing URL handoff, as
- // it relies on checking a marker file which will not work when running
- // out of different directories
- std::string slurl;
- if (!LLStartUp::sSLURLCommand.empty())
- {
- slurl = LLStartUp::sSLURLCommand;
- }
- else if (LLURLSimString::parse())
- {
- slurl = LLURLSimString::getURL();
- }
- if (!slurl.empty())
- {
- if (send_url_to_other_instance(slurl))
- {
- // successfully handed off URL to existing instance, exit
- return false;
- }
- }
+
mSecondInstance = anotherInstanceRunning();
@@ -2761,7 +2787,25 @@ const std::string& LLAppViewer::getHelperURI() const
void LLAppViewer::addLoginURI(const std::string& uri)
{
+ // *NOTE:Mani - login uri trumps the --grid (gGridChoice) setting.
+ // Update gGridChoice to reflect the loginURI setting.
gLoginURIs.push_back(uri);
+
+ const std::string& top_uri = getLoginURIs()[0];
+ int i = 0;
+ for(; i < GRID_INFO_COUNT; ++i)
+ {
+ if(top_uri == gGridInfo[i].mLoginURI)
+ {
+ gGridChoice = (EGridInfo)i;
+ break;
+ }
+ }
+
+ if(GRID_INFO_COUNT == i)
+ {
+ gGridChoice = GRID_INFO_OTHER;
+ }
}
void LLAppViewer::setHelperURI(const std::string& uri)
@@ -2908,7 +2952,10 @@ void LLAppViewer::saveNameCache()
bool LLAppViewer::isInProductionGrid()
{
- return (GRID_INFO_AGNI == gGridChoice);
+ // *NOTE:Mani This used to compare GRID_INFO_AGNI to gGridChoice,
+ // but it seems that loginURI trumps that.
+ const std::string& loginURI = getLoginURIs()[0];
+ return (loginURI == gGridInfo[GRID_INFO_AGNI].mLoginURI);
}
@@ -3257,7 +3304,7 @@ void LLAppViewer::idle()
}
stop_glerror();
- if (LLViewerJoystick::sOverrideCamera)
+ if (LLViewerJoystick::getInstance()->getOverrideCamera())
{
LLViewerJoystick::getInstance()->moveFlycam();
}
diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp
index a748545a3b..28314cb0ae 100644
--- a/indra/newview/llappviewermacosx.cpp
+++ b/indra/newview/llappviewermacosx.cpp
@@ -115,10 +115,35 @@ bool LLAppViewerMacOSX::init()
return LLAppViewer::init();
}
+// MacOSX may add and addition command line arguement for the process serial number.
+// The option takes a form like '-psn_0_12345'. The following method should be able to recognize
+// and either ignore or return a pair of values for the option.
+// look for this method to be added to the parser in parseAndStoreResults.
+std::pair<std::string, std::string> parse_psn(const std::string& s)
+{
+ if (s.find("-psn_") == 0)
+ {
+ // *FIX:Mani Not sure that the value makes sense.
+ // fix it once the actual -psn_XXX syntax is known.
+ return std::make_pair("psn", s.substr(5));
+ }
+ else
+ {
+ return std::make_pair(std::string(), std::string());
+ }
+}
+
bool LLAppViewerMacOSX::initParseCommandLine(LLCommandLineParser& clp)
{
+ // The next two lines add the support for parsing the mac -psn_XXX arg.
+ clp.addOptionDesc("psn", NULL, 1, "MacOSX process serial number");
+ clp.setCustomParser(parse_psn);
+
// First parse the command line, not often used on the mac.
- clp.parseCommandLine(gArgC, gArgV);
+ if(clp.parseCommandLine(gArgC, gArgV) == false)
+ {
+ return false;
+ }
// Now read in the args from arguments txt.
// Succesive calls to clp.parse... will NOT override earlier
@@ -131,7 +156,10 @@ bool LLAppViewerMacOSX::initParseCommandLine(LLCommandLineParser& clp)
return false;
}
- clp.parseCommandLineFile(ifs);
+ if(clp.parseCommandLineFile(ifs) == false)
+ {
+ return false;
+ }
// Get the user's preferred language string based on the Mac OS localization mechanism.
// To add a new localization:
diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp
index 2f99ca1247..a6e002a04d 100644
--- a/indra/newview/llcommandlineparser.cpp
+++ b/indra/newview/llcommandlineparser.cpp
@@ -261,7 +261,7 @@ void LLCommandLineParser::addOptionDesc(const LLString& option_name,
}
}
-bool parseAndStoreResults(po::command_line_parser& clp)
+bool LLCommandLineParser::parseAndStoreResults(po::command_line_parser& clp)
{
try
{
@@ -269,24 +269,32 @@ bool parseAndStoreResults(po::command_line_parser& clp)
clp.positional(gPositionalOptions);
clp.style(po::command_line_style::default_style
| po::command_line_style::allow_long_disguise);
+ if(mExtraParser)
+ {
+ clp.extra_parser(mExtraParser);
+ }
+
po::basic_parsed_options<char> opts = clp.run();
po::store(opts, gVariableMap);
}
catch(po::error& e)
{
llwarns << "Caught Error:" << e.what() << llendl;
+ mErrorMsg = e.what();
return false;
}
catch(LLCLPError& e)
{
llwarns << "Caught Error:" << e.what() << llendl;
+ mErrorMsg = e.what();
return false;
}
catch(LLCLPLastOption&)
{
// Continue without parsing.
- llwarns << "Found tokens past last option. Ignoring." << llendl;
-
+ std::string msg = "Found tokens past last option. Ignoring.";
+ llwarns << msg << llendl;
+ mErrorMsg = msg;
// boost::po will have stored a mal-formed option.
// All such options will be removed below.
for(po::variables_map::iterator i = gVariableMap.begin(); i != gVariableMap.end();)
diff --git a/indra/newview/llcommandlineparser.h b/indra/newview/llcommandlineparser.h
index 6cc40ee8b4..6fe418a631 100644
--- a/indra/newview/llcommandlineparser.h
+++ b/indra/newview/llcommandlineparser.h
@@ -27,13 +27,26 @@
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
-*/
+ */
#ifndef LL_LLCOMMANDLINEPARSER_H
#define LL_LLCOMMANDLINEPARSER_H
#include <boost/function/function1.hpp>
+// *NOTE:Mani The following is a forward decl of
+// boost::program_options::command_line_parser
+// "yay" c++!
+namespace boost
+{
+ namespace program_options
+ {
+ template <class charT> class basic_command_line_parser;
+ typedef basic_command_line_parser<char> command_line_parser;
+ }
+}
+
+
/**
* @class LLCommandLineParser
* @brief Handle defining and parsing the command line.
@@ -41,63 +54,85 @@
class LLCommandLineParser
{
public:
- typedef std::vector< std::string > token_vector_t;
-
- /**
- * @brief Add a value-less option to the command line description.
- * @param option_name The long name of the cmd-line option.
- * @param description The text description of the option usage.
- */
- void addOptionDesc(
- const LLString& option_name,
- boost::function1<void, const token_vector_t&> notify_callback = 0,
- unsigned int num_tokens = 0,
- const LLString& description = LLString::null,
- const LLString& short_name = LLString::null,
- bool composing = false,
- bool positional = false,
- bool last_option = false);
-
-
- /**
- * @brief Parse the command line given by argc/argv.
- */
+ typedef std::vector< std::string > token_vector_t;
+
+ /**
+ * @brief Add a value-less option to the command line description.
+ * @param option_name The long name of the cmd-line option.
+ * @param description The text description of the option usage.
+ */
+ void addOptionDesc(
+ const LLString& option_name,
+ boost::function1<void, const token_vector_t&> notify_callback = 0,
+ unsigned int num_tokens = 0,
+ const LLString& description = LLString::null,
+ const LLString& short_name = LLString::null,
+ bool composing = false,
+ bool positional = false,
+ bool last_option = false);
+
+ /**
+ * @brief Parse the command line given by argc/argv.
+ */
bool parseCommandLine(int argc, char **argv);
-
- /**
- * @brief Parse the command line contained by the given file.
- */
- bool parseCommandLineString(const std::string& str);
-
- /**
- * @brief Parse the command line contained by the given file.
- */
- bool parseCommandLineFile(const std::basic_istream< char >& file);
-
- /**
- * @brief Call callbacks associated with option descriptions.
- *
- * Use this to handle the results of parsing.
- */
- void notify();
-
- /** @brief Print a description of the configured options.
- *
- * Use this to print a description of options to the
- * given ostream. Useful for displaying usage info.
- */
- std::ostream& printOptionsDesc(std::ostream& os) const;
-
- /** @brief Manual option setting accessors.
- *
- * Use these to retrieve get the values set for an option.
- * getOption will return an empty value if the option isn't
- * set.
- */
- bool hasOption(const std::string& name) const;
- const token_vector_t& getOption(const std::string& name) const;
-
- void printOptions() const;
+
+ /**
+ * @brief Parse the command line contained by the given file.
+ */
+ bool parseCommandLineString(const std::string& str);
+
+ /**
+ * @brief Parse the command line contained by the given file.
+ */
+ bool parseCommandLineFile(const std::basic_istream< char >& file);
+
+ /**
+ * @brief Call callbacks associated with option descriptions.
+ *
+ * Use this to handle the results of parsing.
+ */
+ void notify();
+
+ /** @brief Print a description of the configured options.
+ *
+ * Use this to print a description of options to the
+ * given ostream. Useful for displaying usage info.
+ */
+ std::ostream& printOptionsDesc(std::ostream& os) const;
+
+ /** @brief Manual option setting accessors.
+ *
+ * Use these to retrieve get the values set for an option.
+ * getOption will return an empty value if the option isn't
+ * set.
+ */
+ bool hasOption(const std::string& name) const;
+ const token_vector_t& getOption(const std::string& name) const;
+
+ /** @brief Print the list of configured options.
+ */
+ void printOptions() const;
+
+ /** @bried Get the error message, if it exists.
+ */
+ const std::string& getErrorMessage() const { return mErrorMsg; }
+
+ /** @brief Add a custom parser func to the parser.
+ *
+ * Use this method to add a custom parser for parsing values
+ * the the simple parser may not handle.
+ * it will be applied to each parameter before the
+ * default parser gets a chance.
+ * The parser_func takes an input string, and should return a
+ * name/value pair as the result.
+ */
+ typedef boost::function1<std::pair<std::string, std::string>, const std::string&> parser_func;
+ void setCustomParser(parser_func f) { mExtraParser = f; }
+
+private:
+ bool parseAndStoreResults(boost::program_options::command_line_parser& clp);
+ std::string mErrorMsg;
+ parser_func mExtraParser;
};
inline std::ostream& operator<<(std::ostream& out, const LLCommandLineParser& clp)
@@ -116,16 +151,16 @@ class LLControlGroup;
class LLControlGroupCLP : public LLCommandLineParser
{
public:
- /**
- * @brief Configure the command line parser according the given config file.
- *
- * @param config_filename The name of the XML based LLSD config file.
- * @param clp A reference to the command line parser object to configure.
- *
- * *FIX:Mani Specify config file format.
- */
- void configure(const LLString& config_filename,
- LLControlGroup* controlGroup);
+ /**
+ * @brief Configure the command line parser according the given config file.
+ *
+ * @param config_filename The name of the XML based LLSD config file.
+ * @param clp A reference to the command line parser object to configure.
+ *
+ * *FIX:Mani Specify config file format.
+ */
+ void configure(const LLString& config_filename,
+ LLControlGroup* controlGroup);
};
#endif // LL_LLCOMMANDLINEPARSER_H
diff --git a/indra/newview/llfloaterjoystick.cpp b/indra/newview/llfloaterjoystick.cpp
index 44abdd3cde..040ca8013e 100644
--- a/indra/newview/llfloaterjoystick.cpp
+++ b/indra/newview/llfloaterjoystick.cpp
@@ -54,6 +54,13 @@ LLFloaterJoystick::LLFloaterJoystick(const LLSD& data)
void LLFloaterJoystick::draw()
{
+ bool joystick_inited = LLViewerJoystick::getInstance()->isJoystickInitialized();
+ childSetEnabled("enable_joystick", joystick_inited);
+ childSetEnabled("joystick_type", joystick_inited);
+ std::string desc = LLViewerJoystick::getInstance()->getDescription();
+ if (desc.empty()) desc = getUIString("NoDevice");
+ childSetText("joystick_type", desc);
+
LLViewerJoystick* joystick(LLViewerJoystick::getInstance());
for (U32 i = 0; i < 6; i++)
{
@@ -261,73 +268,5 @@ void LLFloaterJoystick::onClickRestoreSNDefaults(void *joy_panel)
void LLFloaterJoystick::setSNDefaults()
{
-#if LL_DARWIN
-#define kPlatformScale 20.f
-#else
-#define kPlatformScale 1.f
-#endif
-
- //gViewerWindow->alertXml("CacheWillClear");
- llinfos << "restoring SpaceNavigator defaults..." << llendl;
-
- gSavedSettings.setS32("JoystickAxis1", 0); // x (slide)
- gSavedSettings.setS32("JoystickAxis2", 2); // y (up)
- gSavedSettings.setS32("JoystickAxis0", 1); // z (at)
- gSavedSettings.setS32("JoystickAxis4", 3); // roll
- gSavedSettings.setS32("JoystickAxis5", 5); // yaw
- gSavedSettings.setS32("JoystickAxis3", 4); // pitch
- gSavedSettings.setS32("JoystickAxis6", -1);
-
-#if LL_DARWIN
- // The SpaceNavigator doesn't act as a 3D cursor on OS X.
- gSavedSettings.setBOOL("Cursor3D", false);
-#else
- gSavedSettings.setBOOL("Cursor3D", true);
-#endif
- gSavedSettings.setBOOL("AutoLeveling", true);
- gSavedSettings.setBOOL("ZoomDirect", false);
-
- gSavedSettings.setF32("AvatarAxisScale0", 1.f);
- gSavedSettings.setF32("AvatarAxisScale1", 1.f);
- gSavedSettings.setF32("AvatarAxisScale2", 1.f);
- gSavedSettings.setF32("AvatarAxisScale4", .1f * kPlatformScale);
- gSavedSettings.setF32("AvatarAxisScale5", .1f * kPlatformScale);
- gSavedSettings.setF32("AvatarAxisScale3", 0.f * kPlatformScale);
- gSavedSettings.setF32("BuildAxisScale1", .3f * kPlatformScale);
- gSavedSettings.setF32("BuildAxisScale2", .3f * kPlatformScale);
- gSavedSettings.setF32("BuildAxisScale0", .3f * kPlatformScale);
- gSavedSettings.setF32("BuildAxisScale4", .3f * kPlatformScale);
- gSavedSettings.setF32("BuildAxisScale5", .3f * kPlatformScale);
- gSavedSettings.setF32("BuildAxisScale3", .3f * kPlatformScale);
- gSavedSettings.setF32("FlycamAxisScale1", 2.f * kPlatformScale);
- gSavedSettings.setF32("FlycamAxisScale2", 2.f * kPlatformScale);
- gSavedSettings.setF32("FlycamAxisScale0", 2.1f * kPlatformScale);
- gSavedSettings.setF32("FlycamAxisScale4", .1f * kPlatformScale);
- gSavedSettings.setF32("FlycamAxisScale5", .15f * kPlatformScale);
- gSavedSettings.setF32("FlycamAxisScale3", 0.f * kPlatformScale);
- gSavedSettings.setF32("FlycamAxisScale6", 0.f * kPlatformScale);
-
- gSavedSettings.setF32("AvatarAxisDeadZone0", .1f);
- gSavedSettings.setF32("AvatarAxisDeadZone1", .1f);
- gSavedSettings.setF32("AvatarAxisDeadZone2", .1f);
- gSavedSettings.setF32("AvatarAxisDeadZone3", 1.f);
- gSavedSettings.setF32("AvatarAxisDeadZone4", .02f);
- gSavedSettings.setF32("AvatarAxisDeadZone5", .01f);
- gSavedSettings.setF32("BuildAxisDeadZone0", .01f);
- gSavedSettings.setF32("BuildAxisDeadZone1", .01f);
- gSavedSettings.setF32("BuildAxisDeadZone2", .01f);
- gSavedSettings.setF32("BuildAxisDeadZone3", .01f);
- gSavedSettings.setF32("BuildAxisDeadZone4", .01f);
- gSavedSettings.setF32("BuildAxisDeadZone5", .01f);
- gSavedSettings.setF32("FlycamAxisDeadZone0", .01f);
- gSavedSettings.setF32("FlycamAxisDeadZone1", .01f);
- gSavedSettings.setF32("FlycamAxisDeadZone2", .01f);
- gSavedSettings.setF32("FlycamAxisDeadZone3", .01f);
- gSavedSettings.setF32("FlycamAxisDeadZone4", .01f);
- gSavedSettings.setF32("FlycamAxisDeadZone5", .01f);
- gSavedSettings.setF32("FlycamAxisDeadZone6", 1.f);
-
- gSavedSettings.setF32("AvatarFeathering", 6.f);
- gSavedSettings.setF32("BuildFeathering", 12.f);
- gSavedSettings.setF32("FlycamFeathering", 5.f);
+ LLViewerJoystick::getInstance()->setSNDefaults();
}
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index 3a4a3f3e1b..848d01d5ac 100644
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -128,14 +128,14 @@ public:
virtual void changed(U32 mask);
};
-//void LLMapFriendObserver::changed(U32 mask)
-//{
-// // if there's a change we're interested in.
-// if((mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE | LLFriendObserver::POWERS)) != 0)
-// {
-// gFloaterWorldMap->friendsChanged();
-// }
-//}
+void LLMapFriendObserver::changed(U32 mask)
+{
+ // if there's a change we're interested in.
+ if((mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE | LLFriendObserver::POWERS)) != 0)
+ {
+ gFloaterWorldMap->friendsChanged();
+ }
+}
//---------------------------------------------------------------------------
// Statics
@@ -201,15 +201,15 @@ BOOL LLFloaterWorldMap::postBuild()
//
//onCommitBackground((void*)this, false);
- //childSetCommitCallback("friend combo", onAvatarComboCommit, this);
+ childSetCommitCallback("friend combo", onAvatarComboCommit, this);
- //LLComboBox *avatar_combo = getChild<LLComboBox>( "friend combo");
- //if (avatar_combo)
- //{
- // avatar_combo->selectFirstItem();
- // avatar_combo->setPrearrangeCallback( onAvatarComboPrearrange );
- // avatar_combo->setTextEntryCallback( onComboTextEntry );
- //}
+ LLComboBox *avatar_combo = getChild<LLComboBox>("friend combo");
+ if (avatar_combo)
+ {
+ avatar_combo->selectFirstItem();
+ avatar_combo->setPrearrangeCallback( onAvatarComboPrearrange );
+ avatar_combo->setTextEntryCallback( onComboTextEntry );
+ }
childSetAction("DoSearch", onLocationCommit, this);
@@ -322,7 +322,7 @@ void LLFloaterWorldMap::show(void*, BOOL center_on_target)
gFloaterWorldMap->childSetFocus("location", TRUE);
gFocusMgr.triggerFocusFlash();
-// gFloaterWorldMap->buildAvatarIDList();
+ gFloaterWorldMap->buildAvatarIDList();
gFloaterWorldMap->buildLandmarkIDLists();
// If nothing is being tracked, set flag so the user position will be found
@@ -439,14 +439,14 @@ void LLFloaterWorldMap::draw()
updateLocation();
LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus();
- //if (LLTracker::TRACKING_AVATAR == tracking_status)
- //{
- // childSetColor("avatar_icon", gTrackColor);
- //}
- //else
- //{
- // childSetColor("avatar_icon", gDisabledTrackColor);
- //}
+ if (LLTracker::TRACKING_AVATAR == tracking_status)
+ {
+ childSetColor("avatar_icon", gTrackColor);
+ }
+ else
+ {
+ childSetColor("avatar_icon", gDisabledTrackColor);
+ }
if (LLTracker::TRACKING_LANDMARK == tracking_status)
{
@@ -509,27 +509,38 @@ void LLFloaterWorldMap::draw()
LLFloater::draw();
}
-//
-////-------------------------------------------------------------------------
-//// Internal utility functions
-////-------------------------------------------------------------------------
-//
-//
+
+//-------------------------------------------------------------------------
+// Internal utility functions
+//-------------------------------------------------------------------------
+
+
void LLFloaterWorldMap::trackAvatar( const LLUUID& avatar_id, const LLString& name )
{
- // *HACK: Adjust Z values automatically for liaisons & gods so
- // they swoop down when they click on the map. Requested
- // convenience.
- if(gAgent.isGodlike())
+ LLCtrlSelectionInterface *iface = childGetSelectionInterface("friend combo");
+ if (!iface) return;
+
+ buildAvatarIDList();
+ if(iface->setCurrentByID(avatar_id) || gAgent.isGodlike())
{
- childSetValue("spin z", LLSD(200.f));
+ // *HACK: Adjust Z values automatically for liaisons & gods so
+ // they swoop down when they click on the map. Requested
+ // convenience.
+ if(gAgent.isGodlike())
+ {
+ childSetValue("spin z", LLSD(200.f));
+ }
+ // Don't re-request info if we already have it or we won't have it in time to teleport
+ if (mTrackedStatus != LLTracker::TRACKING_AVATAR || name != mTrackedAvatarName)
+ {
+ mTrackedStatus = LLTracker::TRACKING_AVATAR;
+ mTrackedAvatarName = name;
+ LLTracker::trackAvatar(avatar_id, name);
+ }
}
- // Don't re-request info if we already have it or we won't have it in time to teleport
- if (mTrackedStatus != LLTracker::TRACKING_AVATAR || name != mTrackedAvatarName)
+ else
{
- mTrackedStatus = LLTracker::TRACKING_AVATAR;
- mTrackedAvatarName = name;
- LLTracker::trackAvatar(avatar_id, name);
+ LLTracker::stopTracking(NULL);
}
setDefaultBtn("Teleport");
}
@@ -782,68 +793,68 @@ void LLFloaterWorldMap::inventoryChanged()
}
}
-//void LLFloaterWorldMap::observeFriends()
-//{
-// if(!mFriendObserver)
-// {
-// mFriendObserver = new LLMapFriendObserver;
-// LLAvatarTracker::instance().addObserver(mFriendObserver);
-// friendsChanged();
-// }
-//}
-
-//void LLFloaterWorldMap::friendsChanged()
-//{
-// LLAvatarTracker& t = LLAvatarTracker::instance();
-// const LLUUID& avatar_id = t.getAvatarID();
-// buildAvatarIDList();
-// if(avatar_id.notNull())
-// {
-// LLCtrlSelectionInterface *iface = childGetSelectionInterface("friend combo");
-// if(!iface || !iface->setCurrentByID(avatar_id) ||
-// !t.getBuddyInfo(avatar_id)->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION) || gAgent.isGodlike())
-// {
-// LLTracker::stopTracking(NULL);
-// }
-// }
-//}
-//
-//// No longer really builds a list. Instead, just updates mAvatarCombo.
-//void LLFloaterWorldMap::buildAvatarIDList()
-//{
-// LLCtrlListInterface *list = childGetListInterface("friend combo");
-// if (!list) return;
-//
-// // Delete all but the "None" entry
-// S32 list_size = list->getItemCount();
-// while (list_size > 1)
-// {
-// list->selectNthItem(1);
-// list->operateOnSelection(LLCtrlListInterface::OP_DELETE);
-// --list_size;
-// }
-//
-// LLSD default_column;
-// default_column["name"] = "friend name";
-// default_column["label"] = "Friend Name";
-// default_column["width"] = 500;
-// list->addColumn(default_column);
-//
-// // Get all of the calling cards for avatar that are currently online
-// LLCollectMappableBuddies collector;
-// LLAvatarTracker::instance().applyFunctor(collector);
-// LLCollectMappableBuddies::buddy_map_t::iterator it;
-// LLCollectMappableBuddies::buddy_map_t::iterator end;
-// it = collector.mMappable.begin();
-// end = collector.mMappable.end();
-// for( ; it != end; ++it)
-// {
-// list->addSimpleElement((*it).first, ADD_BOTTOM, (*it).second);
-// }
-//
-// list->setCurrentByID( LLAvatarTracker::instance().getAvatarID() );
-// list->selectFirstItem();
-//}
+void LLFloaterWorldMap::observeFriends()
+{
+ if(!mFriendObserver)
+ {
+ mFriendObserver = new LLMapFriendObserver;
+ LLAvatarTracker::instance().addObserver(mFriendObserver);
+ friendsChanged();
+ }
+}
+
+void LLFloaterWorldMap::friendsChanged()
+{
+ LLAvatarTracker& t = LLAvatarTracker::instance();
+ const LLUUID& avatar_id = t.getAvatarID();
+ buildAvatarIDList();
+ if(avatar_id.notNull())
+ {
+ LLCtrlSelectionInterface *iface = childGetSelectionInterface("friend combo");
+ if(!iface || !iface->setCurrentByID(avatar_id) ||
+ !t.getBuddyInfo(avatar_id)->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION) || gAgent.isGodlike())
+ {
+ LLTracker::stopTracking(NULL);
+ }
+ }
+}
+
+// No longer really builds a list. Instead, just updates mAvatarCombo.
+void LLFloaterWorldMap::buildAvatarIDList()
+{
+ LLCtrlListInterface *list = childGetListInterface("friend combo");
+ if (!list) return;
+
+ // Delete all but the "None" entry
+ S32 list_size = list->getItemCount();
+ while (list_size > 1)
+ {
+ list->selectNthItem(1);
+ list->operateOnSelection(LLCtrlListInterface::OP_DELETE);
+ --list_size;
+ }
+
+ LLSD default_column;
+ default_column["name"] = "friend name";
+ default_column["label"] = "Friend Name";
+ default_column["width"] = 500;
+ list->addColumn(default_column);
+
+ // Get all of the calling cards for avatar that are currently online
+ LLCollectMappableBuddies collector;
+ LLAvatarTracker::instance().applyFunctor(collector);
+ LLCollectMappableBuddies::buddy_map_t::iterator it;
+ LLCollectMappableBuddies::buddy_map_t::iterator end;
+ it = collector.mMappable.begin();
+ end = collector.mMappable.end();
+ for( ; it != end; ++it)
+ {
+ list->addSimpleElement((*it).first, ADD_BOTTOM, (*it).second);
+ }
+
+ list->setCurrentByID( LLAvatarTracker::instance().getAvatarID() );
+ list->selectFirstItem();
+}
void LLFloaterWorldMap::buildLandmarkIDLists()
@@ -949,19 +960,19 @@ void LLFloaterWorldMap::clearLandmarkSelection(BOOL clear_ui)
}
}
-//
-//void LLFloaterWorldMap::clearAvatarSelection(BOOL clear_ui)
-//{
-// if (clear_ui || !childHasKeyboardFocus("friend combo"))
-// {
-// mTrackedStatus = LLTracker::TRACKING_NOTHING;
-// LLCtrlListInterface *list = childGetListInterface("friend combo");
-// if (list)
-// {
-// list->selectByValue( "None" );
-// }
-// }
-//}
+
+void LLFloaterWorldMap::clearAvatarSelection(BOOL clear_ui)
+{
+ if (clear_ui || !childHasKeyboardFocus("friend combo"))
+ {
+ mTrackedStatus = LLTracker::TRACKING_NOTHING;
+ LLCtrlListInterface *list = childGetListInterface("friend combo");
+ if (list)
+ {
+ list->selectByValue( "None" );
+ }
+ }
+}
// Adjust the maximally zoomed out limit of the zoom slider so you
@@ -1128,60 +1139,60 @@ void LLFloaterWorldMap::onLandmarkComboCommit( LLUICtrl* ctrl, void* userdata )
self->mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING );
}
-//// static
-//void LLFloaterWorldMap::onAvatarComboPrearrange( LLUICtrl* ctrl, void* userdata )
-//{
-// LLFloaterWorldMap* self = gFloaterWorldMap;
-// if( !self || self->mIsClosing )
-// {
-// return;
-// }
-//
-// LLCtrlListInterface *list = self->childGetListInterface("friend combo");
-// if (!list) return;
-//
-// LLUUID current_choice;
-//
-// if( LLAvatarTracker::instance().haveTrackingInfo() )
-// {
-// current_choice = LLAvatarTracker::instance().getAvatarID();
-// }
-//
-// self->buildAvatarIDList();
-//
-// if( !list->setCurrentByID( current_choice ) || current_choice.isNull() )
-// {
-// LLTracker::stopTracking(NULL);
-// }
-//}
-//
-//
-//// static
-//void LLFloaterWorldMap::onAvatarComboCommit( LLUICtrl* ctrl, void* userdata )
-//{
-// LLFloaterWorldMap* self = gFloaterWorldMap;
-// if( !self || self->mIsClosing )
-// {
-// return;
-// }
-//
-// LLCtrlListInterface *list = gFloaterWorldMap->childGetListInterface("friend combo");
-// if (!list) return;
-//
-// const LLUUID& new_avatar_id = list->getCurrentID();
-// if (new_avatar_id.notNull())
-// {
-// LLString name;
-// LLComboBox* combo = gFloaterWorldMap->getChild<LLComboBox>("friend combo");
-// if (combo) name = combo->getSimple();
-// self->trackAvatar(new_avatar_id, name);
-// onShowTargetBtn(self);
-// }
-// else
-// { // Reset to user postion if nothing is tracked
-// self->mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING );
-// }
-//}
+// static
+void LLFloaterWorldMap::onAvatarComboPrearrange( LLUICtrl* ctrl, void* userdata )
+{
+ LLFloaterWorldMap* self = gFloaterWorldMap;
+ if( !self || self->mIsClosing )
+ {
+ return;
+ }
+
+ LLCtrlListInterface *list = self->childGetListInterface("friend combo");
+ if (!list) return;
+
+ LLUUID current_choice;
+
+ if( LLAvatarTracker::instance().haveTrackingInfo() )
+ {
+ current_choice = LLAvatarTracker::instance().getAvatarID();
+ }
+
+ self->buildAvatarIDList();
+
+ if( !list->setCurrentByID( current_choice ) || current_choice.isNull() )
+ {
+ LLTracker::stopTracking(NULL);
+ }
+}
+
+
+// static
+void LLFloaterWorldMap::onAvatarComboCommit( LLUICtrl* ctrl, void* userdata )
+{
+ LLFloaterWorldMap* self = gFloaterWorldMap;
+ if( !self || self->mIsClosing )
+ {
+ return;
+ }
+
+ LLCtrlListInterface *list = gFloaterWorldMap->childGetListInterface("friend combo");
+ if (!list) return;
+
+ const LLUUID& new_avatar_id = list->getCurrentID();
+ if (new_avatar_id.notNull())
+ {
+ LLString name;
+ LLComboBox* combo = gFloaterWorldMap->getChild<LLComboBox>("friend combo");
+ if (combo) name = combo->getSimple();
+ self->trackAvatar(new_avatar_id, name);
+ onShowTargetBtn(self);
+ }
+ else
+ { // Reset to user postion if nothing is tracked
+ self->mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING );
+ }
+}
//static
void LLFloaterWorldMap::onLocationFocusChanged( LLFocusableElement* focus, void* userdata )
diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h
index 78bc95c48f..3cf12a9eb7 100644
--- a/indra/newview/llfloaterworldmap.h
+++ b/indra/newview/llfloaterworldmap.h
@@ -80,9 +80,9 @@ public:
void observeInventory(LLInventoryModel* inventory);
void inventoryChanged();
- //// Calls for dealing with changes in friendship
- //void observeFriends();
- //void friendsChanged();
+ // Calls for dealing with changes in friendship
+ void observeFriends();
+ void friendsChanged();
// tracking methods
void trackAvatar( const LLUUID& avatar_id, const LLString& name );
@@ -98,7 +98,7 @@ public:
F32 getDistanceToDestination(const LLVector3d& pos_global, F32 z_attenuation = 0.5f) const;
void clearLocationSelection(BOOL clear_ui = FALSE);
- //void clearAvatarSelection(BOOL clear_ui = FALSE);
+ void clearAvatarSelection(BOOL clear_ui = FALSE);
void clearLandmarkSelection(BOOL clear_ui = FALSE);
// Adjust the maximally zoomed out limit of the zoom slider so you can
@@ -119,8 +119,8 @@ protected:
static void onLandmarkComboPrearrange( LLUICtrl* ctrl, void* data );
static void onLandmarkComboCommit( LLUICtrl* ctrl, void* data );
- //static void onAvatarComboPrearrange( LLUICtrl* ctrl, void* data );
- //static void onAvatarComboCommit( LLUICtrl* ctrl, void* data );
+ static void onAvatarComboPrearrange( LLUICtrl* ctrl, void* data );
+ static void onAvatarComboCommit( LLUICtrl* ctrl, void* data );
static void onCommitBackground(void* data, bool from_click);
@@ -148,7 +148,7 @@ protected:
void teleportToLandmark();
void setLandmarkVisited();
- //void buildAvatarIDList();
+ void buildAvatarIDList();
void flyToAvatar();
void teleportToAvatar();
diff --git a/indra/newview/llhudmanager.cpp b/indra/newview/llhudmanager.cpp
index a936118ccf..02e8c84fb2 100644
--- a/indra/newview/llhudmanager.cpp
+++ b/indra/newview/llhudmanager.cpp
@@ -58,7 +58,6 @@ LLHUDManager::LLHUDManager()
LLHUDManager::~LLHUDManager()
{
- mHUDEffects.reset();
}
@@ -108,6 +107,12 @@ void LLHUDManager::sendEffects()
}
}
+//static
+void LLHUDManager::shutdownClass()
+{
+ getInstance()->mHUDEffects.reset();
+}
+
void LLHUDManager::cleanupEffects()
{
S32 i = 0;
diff --git a/indra/newview/llhudmanager.h b/indra/newview/llhudmanager.h
index c77dc1bfe5..9df8c4a160 100644
--- a/indra/newview/llhudmanager.h
+++ b/indra/newview/llhudmanager.h
@@ -56,6 +56,8 @@ public:
void sendEffects();
void cleanupEffects();
+ static void shutdownClass();
+
static void processViewerEffect(LLMessageSystem *mesgsys, void **user_data);
static LLColor4 sParentColor;
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 5fa49e0e8b..b6805f42fa 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -947,6 +947,15 @@ void LLPanelLogin::loadLoginPage()
grid = gGridInfo[grid_index].mLabel;
}
+ if(gGridChoice != (EGridInfo)grid_index)
+ {
+ LLAppViewer::instance()->resetURIs();
+ gGridChoice = (EGridInfo)grid_index;
+ gViewerWindow->setMenuBackgroundColor(false,
+ !LLAppViewer::instance()->isInProductionGrid());
+ gLoginMenuBarView->setBackgroundColor(gMenuBarView->getBackgroundColor());
+ }
+
char* curl_grid = curl_escape(grid.c_str(), 0);
oStr << "&grid=" << curl_grid;
curl_free(curl_grid);
diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp
index 76da53ea7b..15795d57cd 100644
--- a/indra/newview/llprogressview.cpp
+++ b/indra/newview/llprogressview.cpp
@@ -107,9 +107,10 @@ BOOL LLProgressView::handleMouseDown(S32 x, S32 y, MASK mask)
if ( mOutlineRect.pointInRect( x, y ) )
{
mMouseDownInActiveArea = TRUE;
+ return TRUE;
};
- return TRUE;
+ return LLPanel::handleMouseDown(x, y, mask);
}
BOOL LLProgressView::handleMouseUp(S32 x, S32 y, MASK mask)
@@ -134,10 +135,11 @@ BOOL LLProgressView::handleMouseUp(S32 x, S32 y, MASK mask)
LLWeb::loadURLExternal( url_to_open );
};
};
+ return TRUE;
};
};
- return TRUE;
+ return LLPanel::handleMouseUp(x, y, mask);
}
BOOL LLProgressView::handleHover(S32 x, S32 y, MASK mask)
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index f918403320..6cd4d90e5f 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -2262,7 +2262,7 @@ BOOL idle_startup()
if(gFloaterWorldMap)
{
gFloaterWorldMap->observeInventory(&gInventory);
- //gFloaterWorldMap->observeFriends();
+ gFloaterWorldMap->observeFriends();
}
gViewerWindow->showCursor();
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp
index 474d81b77f..6aba05a788 100644
--- a/indra/newview/lltexturecache.cpp
+++ b/indra/newview/lltexturecache.cpp
@@ -1056,9 +1056,9 @@ struct lru_data
typedef const lru_data* lru_data_ptr;
bool operator()(const lru_data_ptr& a, const lru_data_ptr& b) const
{
- if (!(a->time < b->time))
+ if (a->time > b->time)
return true;
- else if (!(b->time < a->time))
+ else if (b->time > a->time)
return false;
else
return a->index < b->index;
diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp
index 1c328612bc..40ae4e49a6 100644
--- a/indra/newview/lltracker.cpp
+++ b/indra/newview/lltracker.cpp
@@ -603,7 +603,7 @@ void LLTracker::stopTrackingAvatar(BOOL clear_ui)
}
purgeBeaconText();
- //gFloaterWorldMap->clearAvatarSelection(clear_ui);
+ gFloaterWorldMap->clearAvatarSelection(clear_ui);
mTrackingStatus = TRACKING_NOTHING;
}
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index d40073b3e7..69e611fd99 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -353,7 +353,7 @@ static bool handleRenderUseFBOChanged(const LLSD& newvalue)
static bool handleRenderUseImpostorsChanged(const LLSD& newvalue)
{
- LLVOAvatar::sUseImpostors = newvalue.asBoolean();
+ LLVOAvatar::sUseImpostors = FALSE; //newvalue.asBoolean();
return true;
}
diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp
index cd4eddb5e1..c109ca10a0 100644
--- a/indra/newview/llviewerjoystick.cpp
+++ b/indra/newview/llviewerjoystick.cpp
@@ -58,7 +58,6 @@
// flycam translations in build mode should be reduced
const F32 BUILDMODE_FLYCAM_T_SCALE = 3.f;
-bool LLViewerJoystick::sOverrideCamera = false;
F32 LLViewerJoystick::sLastDelta[] = {0,0,0,0,0,0,0};
F32 LLViewerJoystick::sDelta[] = {0,0,0,0,0,0,0};
@@ -71,9 +70,42 @@ F32 LLViewerJoystick::sDelta[] = {0,0,0,0,0,0,0};
#define MAX_JOYSTICK_INPUT_VALUE MAX_SPACENAVIGATOR_INPUT
// -----------------------------------------------------------------------------
+void LLViewerJoystick::updateEnabled(bool autoenable)
+{
+ if (mDriverState == JDS_UNINITIALIZED)
+ {
+ gSavedSettings.setBOOL("JoystickEnabled", FALSE );
+ }
+ else
+ {
+ if (isLikeSpaceNavigator() && autoenable)
+ {
+ gSavedSettings.setBOOL("JoystickEnabled", TRUE );
+ }
+ }
+ if (!gSavedSettings.getBOOL("JoystickEnabled"))
+ {
+ mOverrideCamera = FALSE;
+ }
+}
+
+void LLViewerJoystick::setOverrideCamera(bool val)
+{
+ if (!gSavedSettings.getBOOL("JoystickEnabled"))
+ {
+ mOverrideCamera = FALSE;
+ }
+ else
+ {
+ mOverrideCamera = val;
+ }
+}
+
+// -----------------------------------------------------------------------------
#if LIB_NDOF
NDOF_HotPlugResult LLViewerJoystick::HotPlugAddCallback(NDOF_Device *dev)
{
+ NDOF_HotPlugResult res = NDOF_DISCARD_HOTPLUGGED;
LLViewerJoystick* joystick(LLViewerJoystick::getInstance());
if (joystick->mDriverState == JDS_UNINITIALIZED)
{
@@ -81,9 +113,10 @@ NDOF_HotPlugResult LLViewerJoystick::HotPlugAddCallback(NDOF_Device *dev)
ndof_dump(dev);
joystick->mNdofDev = dev;
joystick->mDriverState = JDS_INITIALIZED;
- return NDOF_KEEP_HOTPLUGGED;
+ res = NDOF_KEEP_HOTPLUGGED;
}
- return NDOF_DISCARD_HOTPLUGGED;
+ joystick->updateEnabled(true);
+ return res;
}
#endif
@@ -99,6 +132,7 @@ void LLViewerJoystick::HotPlugRemovalCallback(NDOF_Device *dev)
ndof_dump(dev);
joystick->mDriverState = JDS_UNINITIALIZED;
}
+ joystick->updateEnabled(true);
}
#endif
@@ -107,7 +141,8 @@ LLViewerJoystick::LLViewerJoystick()
: mDriverState(JDS_UNINITIALIZED),
mNdofDev(NULL),
mResetFlag(false),
- mCameraUpdated(true)
+ mCameraUpdated(true),
+ mOverrideCamera(false)
{
for (int i = 0; i < 6; i++)
{
@@ -130,7 +165,7 @@ LLViewerJoystick::~LLViewerJoystick()
}
// -----------------------------------------------------------------------------
-void LLViewerJoystick::init()
+void LLViewerJoystick::init(bool autoenable)
{
#if LIB_NDOF
static bool libinit = false;
@@ -138,6 +173,7 @@ void LLViewerJoystick::init()
if (libinit == false)
{
+ // Note: The HotPlug callbacks are not actually getting called on Windows
if (ndof_libinit(HotPlugAddCallback,
HotPlugRemovalCallback,
NULL))
@@ -192,7 +228,8 @@ void LLViewerJoystick::init()
mDriverState = JDS_UNINITIALIZED;
}
}
-
+ updateEnabled(autoenable);
+
llinfos << "ndof: mDriverState=" << mDriverState << "; mNdofDev="
<< mNdofDev << "; libinit=" << libinit << llendl;
#endif
@@ -338,7 +375,8 @@ void LLViewerJoystick::moveObjects(bool reset)
{
static bool toggle_send_to_sim = false;
- if (!gFocusMgr.getAppHasFocus() || mDriverState != JDS_INITIALIZED)
+ if (!gFocusMgr.getAppHasFocus() || mDriverState != JDS_INITIALIZED
+ || !gSavedSettings.getBOOL("JoystickEnabled") || !gSavedSettings.getBOOL("JoystickBuildEnabled"))
{
return;
}
@@ -453,7 +491,8 @@ void LLViewerJoystick::moveObjects(bool reset)
// -----------------------------------------------------------------------------
void LLViewerJoystick::moveAvatar(bool reset)
{
- if (!gFocusMgr.getAppHasFocus() || mDriverState != JDS_INITIALIZED)
+ if (!gFocusMgr.getAppHasFocus() || mDriverState != JDS_INITIALIZED
+ || !gSavedSettings.getBOOL("JoystickEnabled") || !gSavedSettings.getBOOL("JoystickAvatarEnabled"))
{
return;
}
@@ -657,7 +696,8 @@ void LLViewerJoystick::moveFlycam(bool reset)
static LLVector3 sFlycamPosition;
static F32 sFlycamZoom;
- if (!gFocusMgr.getAppHasFocus() || mDriverState != JDS_INITIALIZED)
+ if (!gFocusMgr.getAppHasFocus() || mDriverState != JDS_INITIALIZED
+ || !gSavedSettings.getBOOL("JoystickEnabled") || !gSavedSettings.getBOOL("JoystickFlycamEnabled"))
{
return;
}
@@ -799,9 +839,35 @@ void LLViewerJoystick::moveFlycam(bool reset)
}
// -----------------------------------------------------------------------------
+bool LLViewerJoystick::toggleFlycam()
+{
+ if (!gSavedSettings.getBOOL("JoystickEnabled") || !gSavedSettings.getBOOL("JoystickFlycamEnabled"))
+ {
+ return false;
+ }
+ mOverrideCamera = !mOverrideCamera;
+ if (mOverrideCamera)
+ {
+ moveFlycam(true);
+ }
+ else if (!LLToolMgr::getInstance()->inBuildMode())
+ {
+ moveAvatar(true);
+ }
+ else
+ {
+ // we are in build mode, exiting from the flycam mode: since we are
+ // going to keep the flycam POV for the main camera until the avatar
+ // moves, we need to track this situation.
+ setCameraNeedsUpdate(false);
+ setNeedsReset(true);
+ }
+ return true;
+}
+
void LLViewerJoystick::scanJoystick()
{
- if (mDriverState != JDS_INITIALIZED)
+ if (mDriverState != JDS_INITIALIZED || !gSavedSettings.getBOOL("JoystickEnabled"))
{
return;
}
@@ -809,7 +875,7 @@ void LLViewerJoystick::scanJoystick()
#if LL_WINDOWS
// On windows, the flycam is updated syncronously with a timer, so there is
// no need to update the status of the joystick here.
- if (!sOverrideCamera)
+ if (!mOverrideCamera)
#endif
updateStatus();
@@ -819,8 +885,7 @@ void LLViewerJoystick::scanJoystick()
{
if (mBtn[0] != toggle_flycam)
{
- handle_toggle_flycam();
- toggle_flycam = 1;
+ toggle_flycam = toggleFlycam() ? 1 : 0;
}
}
else
@@ -828,13 +893,25 @@ void LLViewerJoystick::scanJoystick()
toggle_flycam = 0;
}
- if (!sOverrideCamera && !LLToolMgr::getInstance()->inBuildMode())
+ if (!mOverrideCamera && !LLToolMgr::getInstance()->inBuildMode())
{
moveAvatar();
}
}
// -----------------------------------------------------------------------------
+std::string LLViewerJoystick::getDescription()
+{
+ std::string res;
+#if LIB_NDOF
+ if (mDriverState == JDS_INITIALIZED && mNdofDev)
+ {
+ res = ll_safe_string(mNdofDev->product);
+ }
+#endif
+ return res;
+}
+
bool LLViewerJoystick::isLikeSpaceNavigator() const
{
#if LIB_NDOF
@@ -847,3 +924,77 @@ bool LLViewerJoystick::isLikeSpaceNavigator() const
return false;
#endif
}
+
+// -----------------------------------------------------------------------------
+void LLViewerJoystick::setSNDefaults()
+{
+#if LL_DARWIN
+#define kPlatformScale 20.f
+#else
+#define kPlatformScale 1.f
+#endif
+
+ //gViewerWindow->alertXml("CacheWillClear");
+ llinfos << "restoring SpaceNavigator defaults..." << llendl;
+
+ gSavedSettings.setS32("JoystickAxis0", 1); // z (at)
+ gSavedSettings.setS32("JoystickAxis1", 0); // x (slide)
+ gSavedSettings.setS32("JoystickAxis2", 2); // y (up)
+ gSavedSettings.setS32("JoystickAxis3", 4); // pitch
+ gSavedSettings.setS32("JoystickAxis4", 3); // roll
+ gSavedSettings.setS32("JoystickAxis5", 5); // yaw
+ gSavedSettings.setS32("JoystickAxis6", -1);
+
+#if LL_DARWIN
+ // The SpaceNavigator doesn't act as a 3D cursor on OS X.
+ gSavedSettings.setBOOL("Cursor3D", false);
+#else
+ gSavedSettings.setBOOL("Cursor3D", true);
+#endif
+ gSavedSettings.setBOOL("AutoLeveling", true);
+ gSavedSettings.setBOOL("ZoomDirect", false);
+
+ gSavedSettings.setF32("AvatarAxisScale0", 1.f);
+ gSavedSettings.setF32("AvatarAxisScale1", 1.f);
+ gSavedSettings.setF32("AvatarAxisScale2", 1.f);
+ gSavedSettings.setF32("AvatarAxisScale4", .1f * kPlatformScale);
+ gSavedSettings.setF32("AvatarAxisScale5", .1f * kPlatformScale);
+ gSavedSettings.setF32("AvatarAxisScale3", 0.f * kPlatformScale);
+ gSavedSettings.setF32("BuildAxisScale1", .3f * kPlatformScale);
+ gSavedSettings.setF32("BuildAxisScale2", .3f * kPlatformScale);
+ gSavedSettings.setF32("BuildAxisScale0", .3f * kPlatformScale);
+ gSavedSettings.setF32("BuildAxisScale4", .3f * kPlatformScale);
+ gSavedSettings.setF32("BuildAxisScale5", .3f * kPlatformScale);
+ gSavedSettings.setF32("BuildAxisScale3", .3f * kPlatformScale);
+ gSavedSettings.setF32("FlycamAxisScale1", 2.f * kPlatformScale);
+ gSavedSettings.setF32("FlycamAxisScale2", 2.f * kPlatformScale);
+ gSavedSettings.setF32("FlycamAxisScale0", 2.1f * kPlatformScale);
+ gSavedSettings.setF32("FlycamAxisScale4", .1f * kPlatformScale);
+ gSavedSettings.setF32("FlycamAxisScale5", .15f * kPlatformScale);
+ gSavedSettings.setF32("FlycamAxisScale3", 0.f * kPlatformScale);
+ gSavedSettings.setF32("FlycamAxisScale6", 0.f * kPlatformScale);
+
+ gSavedSettings.setF32("AvatarAxisDeadZone0", .1f);
+ gSavedSettings.setF32("AvatarAxisDeadZone1", .1f);
+ gSavedSettings.setF32("AvatarAxisDeadZone2", .1f);
+ gSavedSettings.setF32("AvatarAxisDeadZone3", 1.f);
+ gSavedSettings.setF32("AvatarAxisDeadZone4", .02f);
+ gSavedSettings.setF32("AvatarAxisDeadZone5", .01f);
+ gSavedSettings.setF32("BuildAxisDeadZone0", .01f);
+ gSavedSettings.setF32("BuildAxisDeadZone1", .01f);
+ gSavedSettings.setF32("BuildAxisDeadZone2", .01f);
+ gSavedSettings.setF32("BuildAxisDeadZone3", .01f);
+ gSavedSettings.setF32("BuildAxisDeadZone4", .01f);
+ gSavedSettings.setF32("BuildAxisDeadZone5", .01f);
+ gSavedSettings.setF32("FlycamAxisDeadZone0", .01f);
+ gSavedSettings.setF32("FlycamAxisDeadZone1", .01f);
+ gSavedSettings.setF32("FlycamAxisDeadZone2", .01f);
+ gSavedSettings.setF32("FlycamAxisDeadZone3", .01f);
+ gSavedSettings.setF32("FlycamAxisDeadZone4", .01f);
+ gSavedSettings.setF32("FlycamAxisDeadZone5", .01f);
+ gSavedSettings.setF32("FlycamAxisDeadZone6", 1.f);
+
+ gSavedSettings.setF32("AvatarFeathering", 6.f);
+ gSavedSettings.setF32("BuildFeathering", 12.f);
+ gSavedSettings.setF32("FlycamFeathering", 5.f);
+}
diff --git a/indra/newview/llviewerjoystick.h b/indra/newview/llviewerjoystick.h
index 47acf17f17..625debb923 100644
--- a/indra/newview/llviewerjoystick.h
+++ b/indra/newview/llviewerjoystick.h
@@ -53,9 +53,10 @@ typedef enum e_joystick_driver_state
class LLViewerJoystick : public LLSingleton<LLViewerJoystick>
{
public:
- static bool sOverrideCamera;
+ LLViewerJoystick();
+ virtual ~LLViewerJoystick();
- void init();
+ void init(bool autoenable);
void updateStatus();
void scanJoystick();
void moveObjects(bool reset = false);
@@ -68,11 +69,14 @@ public:
void setNeedsReset(bool reset = true) { mResetFlag = reset; }
void setCameraNeedsUpdate(bool b) { mCameraUpdated = b; }
bool getCameraNeedsUpdate() const { return mCameraUpdated; }
-
- LLViewerJoystick();
- virtual ~LLViewerJoystick();
+ bool getOverrideCamera() { return mOverrideCamera; }
+ void setOverrideCamera(bool val);
+ bool toggleFlycam();
+ void setSNDefaults();
+ std::string getDescription();
protected:
+ void updateEnabled(bool autoenable);
void terminate();
void agentSlide(F32 inc);
void agentPush(F32 inc);
@@ -93,6 +97,8 @@ private:
bool mResetFlag;
F32 mPerfScale;
bool mCameraUpdated;
+ bool mOverrideCamera;
+
static F32 sLastDelta[7];
static F32 sDelta[7];
};
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index ac361fa80b..3a09af3fce 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -1825,7 +1825,7 @@ bool toggle_build_mode()
}
else
{
- if (LLViewerJoystick::sOverrideCamera)
+ if (LLViewerJoystick::getInstance()->getOverrideCamera())
{
handle_toggle_flycam();
}
@@ -1870,7 +1870,7 @@ class LLViewCheckJoystickFlycam : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
- bool new_val = LLViewerJoystick::sOverrideCamera;
+ bool new_val = LLViewerJoystick::getInstance()->getOverrideCamera();
gMenuHolder->findControl(userdata["control"].asString())->setValue(new_val);
return true;
}
@@ -1878,23 +1878,7 @@ class LLViewCheckJoystickFlycam : public view_listener_t
void handle_toggle_flycam()
{
- LLViewerJoystick::sOverrideCamera = !LLViewerJoystick::sOverrideCamera;
- if (LLViewerJoystick::sOverrideCamera)
- {
- LLViewerJoystick::getInstance()->moveFlycam(true);
- }
- else if (!LLToolMgr::getInstance()->inBuildMode())
- {
- LLViewerJoystick::getInstance()->moveAvatar(true);
- }
- else
- {
- // we are in build mode, exiting from the flycam mode: since we are
- // going to keep the flycam POV for the main camera until the avatar
- // moves, we need to track this situation.
- LLViewerJoystick::getInstance()->setCameraNeedsUpdate(false);
- LLViewerJoystick::getInstance()->setNeedsReset(true);
- }
+ LLViewerJoystick::getInstance()->toggleFlycam();
}
class LLObjectBuild : public view_listener_t
@@ -3382,7 +3366,7 @@ void reset_view_final( BOOL proceed, void* )
gAgent.changeCameraToDefault();
- if (LLViewerJoystick::sOverrideCamera)
+ if (LLViewerJoystick::getInstance()->getOverrideCamera())
{
handle_toggle_flycam();
}
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 52b10a2fd9..21b827cc0f 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -517,7 +517,7 @@ public:
ypos += y_inc;
}
- if (LLViewerJoystick::sOverrideCamera)
+ if (LLViewerJoystick::getInstance()->getOverrideCamera())
{
addText(xpos + 200, ypos, llformat("Flycam"));
ypos += y_inc;
@@ -1468,7 +1468,7 @@ void LLViewerWindow::handleDataCopy(LLWindow *window, S32 data_type, void *data)
BOOL LLViewerWindow::handleTimerEvent(LLWindow *window)
{
- if (LLViewerJoystick::sOverrideCamera)
+ if (LLViewerJoystick::getInstance()->getOverrideCamera())
{
LLViewerJoystick::getInstance()->updateStatus();
return TRUE;
@@ -1481,7 +1481,7 @@ BOOL LLViewerWindow::handleDeviceChange(LLWindow *window)
// give a chance to use a joystick after startup (hot-plugging)
if (!LLViewerJoystick::getInstance()->isJoystickInitialized() )
{
- LLViewerJoystick::getInstance()->init();
+ LLViewerJoystick::getInstance()->init(true);
return TRUE;
}
return FALSE;
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 99a87ba025..f3384c4a7e 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -284,7 +284,7 @@ BOOL LLVOAvatar::sShowFootPlane = FALSE;
BOOL LLVOAvatar::sShowCollisionVolumes = FALSE;
BOOL LLVOAvatar::sVisibleInFirstPerson = FALSE;
F32 LLVOAvatar::sLODFactor = 1.f;
-BOOL LLVOAvatar::sUseImpostors = TRUE;
+BOOL LLVOAvatar::sUseImpostors = FALSE;
BOOL LLVOAvatar::sJointDebug = FALSE;
S32 LLVOAvatar::sCurJoint = 0;
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 74576492a2..4e679d28d5 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -3165,7 +3165,7 @@ void LLPipeline::calcNearbyLights(LLCamera& camera)
// begin() == the closest light and rbegin() == the farthest light
const S32 MAX_LOCAL_LIGHTS = 6;
// LLVector3 cam_pos = gAgent.getCameraPositionAgent();
- LLVector3 cam_pos = LLViewerJoystick::sOverrideCamera ?
+ LLVector3 cam_pos = LLViewerJoystick::getInstance()->getOverrideCamera() ?
camera.getOrigin() :
gAgent.getPositionAgent();