From 409a401ebb59fcf28ba25aaeab44ca8d00960c84 Mon Sep 17 00:00:00 2001 From: Kadah_Coba Date: Mon, 5 Dec 2011 14:56:33 -0800 Subject: VWR-17587: Added "Fly/Land on holding up/down" option under Move preferences --- indra/newview/skins/default/xui/en/panel_preferences_move.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/indra/newview/skins/default/xui/en/panel_preferences_move.xml b/indra/newview/skins/default/xui/en/panel_preferences_move.xml index d9067b41c7..198fcf9355 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_move.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_move.xml @@ -129,6 +129,16 @@ name="tap_tap_hold_to_run" width="237" top_pad="0"/> + Date: Mon, 4 Jun 2012 11:23:38 -0400 Subject: STORM-1838 Add "Request Teleport" option to the menu when right-clicking on avatars in the Nearby list --- doc/contributions.txt | 1 + indra/llmessage/message_prehash.cpp | 1 + indra/llmessage/message_prehash.h | 1 + indra/newview/llavataractions.cpp | 13 ++++++ indra/newview/llavataractions.h | 5 +++ indra/newview/llpanelpeoplemenus.cpp | 1 + indra/newview/llviewermessage.cpp | 48 ++++++++++++++++++++++ .../skins/default/xui/en/menu_people_nearby.xml | 7 ++++ .../newview/skins/default/xui/en/notifications.xml | 23 +++++++++++ 9 files changed, 100 insertions(+) diff --git a/doc/contributions.txt b/doc/contributions.txt index 04edfb4bea..cc5fb53b57 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -629,6 +629,7 @@ Jonathan Yap STORM-1809 STORM-1793 STORM-1810 + STORM-1838 Kadah Coba STORM-1060 Jondan Lundquist diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp index e71fb96540..64fb6a78a2 100644 --- a/indra/llmessage/message_prehash.cpp +++ b/indra/llmessage/message_prehash.cpp @@ -1379,3 +1379,4 @@ char const* const _PREHASH_ProductSKU = LLMessageStringTable::getInstance()->get char const* const _PREHASH_SeeAVs = LLMessageStringTable::getInstance()->getString("SeeAVs"); char const* const _PREHASH_AnyAVSounds = LLMessageStringTable::getInstance()->getString("AnyAVSounds"); char const* const _PREHASH_GroupAVSounds = LLMessageStringTable::getInstance()->getString("GroupAVSounds"); +char const* const _PREHASH_RequestTeleport = LLMessageStringTable::getInstance()->getString("RequestTeleport"); diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h index dd2c2dbd64..4da1fa7a95 100644 --- a/indra/llmessage/message_prehash.h +++ b/indra/llmessage/message_prehash.h @@ -1379,4 +1379,5 @@ extern char const* const _PREHASH_ProductSKU; extern char const* const _PREHASH_SeeAVs; extern char const* const _PREHASH_AnyAVSounds; extern char const* const _PREHASH_GroupAVSounds; +extern char const* const _PREHASH_RequestTeleport; #endif diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index f618af9536..8df30da68a 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -71,6 +71,7 @@ #include "llcallingcard.h" #include "llslurl.h" // IDEVO #include "llsidepanelinventory.h" +#include "llavatarname.h" // static void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::string& name) @@ -395,6 +396,18 @@ void LLAvatarActions::pay(const LLUUID& id) } } +// static +void LLAvatarActions::requestTeleport(const LLUUID& id) +{ + LLMessageSystem* msg = gMessageSystem; + + msg->newMessageFast(_PREHASH_RequestTeleport); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, id); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + gAgent.sendReliableMessage(); +} + // static void LLAvatarActions::kick(const LLUUID& id) { diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index 748b7cb3d1..1eee9ea81f 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -108,6 +108,11 @@ public: */ static void pay(const LLUUID& id); + /** + * Request teleport from other avatar + */ + static void requestTeleport(const LLUUID& id); + /** * Share items with the avatar. */ diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index f12c4de2f7..c703ae8768 100644 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -67,6 +67,7 @@ LLContextMenu* NearbyMenu::createMenu() registrar.add("Avatar.Share", boost::bind(&LLAvatarActions::share, id)); registrar.add("Avatar.Pay", boost::bind(&LLAvatarActions::pay, id)); registrar.add("Avatar.BlockUnblock", boost::bind(&LLAvatarActions::toggleBlock, id)); + registrar.add("Avatar.RequestTeleport", boost::bind(&LLAvatarActions::requestTeleport, id)); enable_registrar.add("Avatar.EnableItem", boost::bind(&NearbyMenu::enableContextMenuItem, this, _2)); enable_registrar.add("Avatar.CheckItem", boost::bind(&NearbyMenu::checkContextMenuItem, this, _2)); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 854e2bea52..f4f7148340 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1992,6 +1992,54 @@ bool lure_callback(const LLSD& notification, const LLSD& response) } static LLNotificationFunctorRegistration lure_callback_reg("TeleportOffered", lure_callback); +bool teleport_requested_callback(const LLSD& notification, const LLSD& response) +{ + LLUUID from_id = notification["payload"]["from_id"].asUUID(); + std::string from_name; + gCacheName->getFullName(from_id, from_name); + + if(from_id.isNull() || (LLMuteList::getInstance()->isMuted(from_id) && !LLMuteList::getInstance()->isLinden(from_name))) + { + return false; + } + + S32 option = 0; + if (response.isInteger()) + { + option = response.asInteger(); + } + else + { + option = LLNotificationsUtil::getSelectedOption(notification, response); + } + + switch(option) + { + // Yes + case 0: + { + LLAvatarActions::offerTeleport(from_id); + } + break; + + // No + case 1: + default: + break; + + // Block + case 2: + { + LLMute mute(from_id, from_name, LLMute::AGENT); + LLPanelBlockedList::showPanelAndSelect(mute.mID); + } + break; + } + return false; +} + +static LLNotificationFunctorRegistration teleport_requested_callback_reg("TeleportRequested", teleport_requested_callback); + bool goto_url_callback(const LLSD& notification, const LLSD& response) { std::string url = notification["payload"]["url"].asString(); diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby.xml b/indra/newview/skins/default/xui/en/menu_people_nearby.xml index d2e35e4cc0..cff383cab1 100644 --- a/indra/newview/skins/default/xui/en/menu_people_nearby.xml +++ b/indra/newview/skins/default/xui/en/menu_people_nearby.xml @@ -70,6 +70,13 @@ + + + + +[NAME] is requesting to be teleported your to your location. + +Will you permit this? + confirm +
+
+ + Date: Mon, 11 Mar 2013 10:16:22 -0400 Subject: Bug fixing and prep-work for IME support (along with refactored text input in general). --- indra/llwindow/llkeyboardmacosx.cpp | 4 ++-- indra/llwindow/llwindowmacosx-objc.h | 8 ++++++++ indra/llwindow/llwindowmacosx-objc.mm | 9 ++++++++- indra/llwindow/llwindowmacosx.cpp | 25 +++++++++++++++++++++++++ indra/llwindow/llwindowmacosx.h | 1 + indra/newview/SecondLife.nib | Bin 7403 -> 7403 bytes indra/newview/SecondLife.xib | 14 +++++++------- 7 files changed, 51 insertions(+), 10 deletions(-) diff --git a/indra/llwindow/llkeyboardmacosx.cpp b/indra/llwindow/llkeyboardmacosx.cpp index d4c8214461..274e92c225 100644 --- a/indra/llwindow/llkeyboardmacosx.cpp +++ b/indra/llwindow/llkeyboardmacosx.cpp @@ -213,7 +213,7 @@ MASK LLKeyboardMacOSX::updateModifiers(const U32 mask) out_mask |= MASK_SHIFT; } - if(mask & MAC_CTRL_KEY || mask & MAC_CMD_KEY) + if(mask & (MAC_CTRL_KEY | MAC_CMD_KEY)) { out_mask |= MASK_CONTROL; } @@ -267,7 +267,7 @@ MASK LLKeyboardMacOSX::currentMask(BOOL for_mouse_event) if (mask & MAC_SHIFT_KEY) result |= MASK_SHIFT; if (mask & MAC_CTRL_KEY) result |= MASK_CONTROL; - if (mask & MAC_ALT_KEY) result |= MASK_ALT; + if (mask & MAC_ALT_KEY) result |= MASK_ALT; // For keyboard events, consider Command equivalent to Control if (!for_mouse_event) diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index 6793666927..62c5b8298f 100644 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -78,6 +78,7 @@ void removeGLView(GLViewRef view); // This is largely for easier interop between Obj-C and C++ (at least in the viewer's case due to the BOOL vs. BOOL conflict) void callKeyUp(unsigned short key, unsigned int mask); void callKeyDown(unsigned short key, unsigned int mask); +void callResetKeys(); void callUnicodeCallback(wchar_t character, unsigned int mask); void callRightMouseDown(float *pos, unsigned int mask); void callRightMouseUp(float *pos, unsigned int mask); @@ -104,6 +105,13 @@ void callHandleDragExited(std::string url); void callHandleDragUpdated(std::string url); void callHandleDragDropped(std::string url); +// LLPreeditor C bindings. +std::basic_string getPreeditString(); +void getPreeditSelectionRange(int *position, int *length); +void getPreeditMarkedRange(int *position, int *length); +void handleUnicodeCharacter(wchar_t c); +void updatePreeditor(unsigned short *str); + NSWindowRef getMainAppWindow(); GLViewRef getGLView(); diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index b288671219..e4e12f4b5c 100644 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -332,7 +332,14 @@ NSWindowRef getMainAppWindow() return winRef; } -unsigned int getModifiers() +/* +GLViewRef getGLView() { + return [(LLAppDelegate*)[[NSApplication sharedApplication] delegate] glview]; +} +*/ + +unsigned int getModifiers() +{ return [NSEvent modifierFlags]; } diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 24f73c5631..2f6c2101ef 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -211,6 +211,11 @@ void callKeyDown(unsigned short key, unsigned int mask) gKeyboard->handleKeyDown(key, mask); } +void callResetKeys() +{ + gKeyboard->resetKeys(); +} + void callUnicodeCallback(wchar_t character, unsigned int mask) { gWindowImplementation->getCallbacks()->handleUnicodeChar(character, mask); @@ -370,6 +375,26 @@ void callQuitHandler() } } +std::basic_string getPreeditString() +{ + return gWindowImplementation->getPreeditor()->getPreeditString(); +} + +void getPreeditSelectionRange(int *position, int *length) +{ + gWindowImplementation->getPreeditor()->getSelectionRange(position, length); +} + +void getPreeditMarkedRange(int *position, int *length) +{ + gWindowImplementation->getPreeditor()->getPreeditRange(position, length); +} + +void handleUnicodeCharacter(wchar_t c) +{ + gWindowImplementation->getPreeditor()->handleUnicodeCharHere(c); +} + void LLWindowMacOSX::updateMouseDeltas(float* deltas) { if (mCursorDecoupled) diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h index 14d6e70fb3..de0340cf74 100644 --- a/indra/llwindow/llwindowmacosx.h +++ b/indra/llwindow/llwindowmacosx.h @@ -120,6 +120,7 @@ public: void* getWindow() { return mWindow; } LLWindowCallbacks* getCallbacks() { return mCallbacks; } + LLPreeditor* getPreeditor() { return mPreeditor; } void updateMouseDeltas(float* deltas); void getMouseDeltas(float* delta); diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib index 09173cd26f..ff218a21c8 100644 Binary files a/indra/newview/SecondLife.nib and b/indra/newview/SecondLife.nib differ diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib index cb91eeaea2..86e8d81ebc 100644 --- a/indra/newview/SecondLife.xib +++ b/indra/newview/SecondLife.xib @@ -2,10 +2,10 @@ 1060 - 12C60 + 12D76 3084 - 1187.34 - 625.00 + 1187.37 + 626.00 com.apple.InterfaceBuilder.CocoaPlugin 3084 @@ -318,7 +318,7 @@ 15 2 - {{196, 240}, {1024, 768}} + {{196, 240}, {1024, 600}} 74974208 Second Life LLNSWindow @@ -328,13 +328,13 @@ 256 - {1024, 768} + {1024, 600} _NS:20 - {{0, 0}, {1920, 1200}} + {{0, 0}, {2560, 1440}} {10000000000000, 10000000000000} Second Life 128 @@ -775,7 +775,7 @@ - 864 + 888 -- cgit v1.2.3 From 1c6c9baf1aa49bc2405ae0e12d1685ca42086051 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham)" Date: Mon, 11 Mar 2013 09:44:04 -0700 Subject: Fix linux md5sums and line-endings in autobuild.xml --- autobuild.xml | 5408 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 2704 insertions(+), 2704 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index d7cba5d6b3..51e52f5a2c 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1,2704 +1,2704 @@ - - - - installables - - GLOD - - license - GLOD - license_file - LICENSES/glod.txt - name - GLOD - platforms - - darwin - - archive - - hash - b2fe1c860613a68e74d4384be418ffee - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-glod/rev/232684/arch/Darwin/installer/glod-1.0pre4-darwin-20110610.tar.bz2 - - name - darwin - - linux - - archive - - hash - c0c64dae149d0892343e2ff300fd06b9 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-glod/rev/232684/arch/Linux/installer/glod-1.0pre4-linux-20110611.tar.bz2 - - name - linux - - windows - - archive - - hash - 842208365f5b108dac4c7c733b99da9c - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-glod/rev/232684/arch/CYGWIN/installer/glod-1.0pre4-windows-20110610.tar.bz2 - - name - windows - - - - SDL - - license - lgpl - license_file - LICENSES/SDL.txt - name - SDL - platforms - - linux - - archive - - hash - 69ae3b1c9cdb0ebc0d0e1ac8413e3eb7 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/SDL-1.2.14-linux-20110309.tar.bz2 - - name - linux - - - - apr_suite - - license - apache - license_file - LICENSES/apr_suite.txt - name - apr_suite - platforms - - darwin - - archive - - hash - 2dfcd809e747f714b3fe0bf82a175812 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/259951/arch/Darwin/installer/apr_suite-1.4.5-darwin-20120618.tar.bz2 - - name - darwin - - linux - - archive - - hash - f38c966a430012dc157fdc104f23a59b - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/259951/arch/Linux/installer/apr_suite-1.4.5-linux-20120618.tar.bz2 - - name - linux - - windows - - archive - - hash - 4a9d040582342699c58c886c5ccd2caf - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/259951/arch/CYGWIN/installer/apr_suite-1.4.5-windows-20120618.tar.bz2 - - name - windows - - - - ares - - license - c-ares - license_file - LICENSES/c-ares.txt - name - ares - platforms - - darwin - - archive - - hash - 4dd93da518dc00319cadac43dce2676b - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ares/rev/239515/arch/Darwin/installer/ares-1.7.5-darwin-20110825.tar.bz2 - - name - darwin - - linux - - archive - - hash - c223c0df8ebdab02a5bd785c21459875 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ares/rev/239515/arch/Linux/installer/ares-1.7.5-linux-20110825.tar.bz2 - - name - linux - - windows - - archive - - hash - a0a002359e44a9c68f897b45217abf7e - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ares/rev/239515/arch/CYGWIN/installer/ares-1.7.5-windows-20110825.tar.bz2 - - name - windows - - - - boost - - license - boost - license_file - LICENSES/boost.txt - name - boost - platforms - - darwin - - archive - - hash - ac37d0038c91b0672fa31a02731f0eac - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-boost/rev/268347/arch/Darwin/installer/boost-1.52.0-darwin-20121218.tar.bz2 - - name - darwin - - linux - - archive - - hash - 146ed8a8c2ef8ab3f0a6c4f214fc5c22 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-boost/rev/268347/arch/Linux/installer/boost-1.52.0-linux-20121218.tar.bz2 - - name - linux - - windows - - archive - - hash - 3ea60f17d986b7e8a3351298734bdca4 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-boost/rev/268347/arch/CYGWIN/installer/boost-1.52.0-windows-20121218.tar.bz2 - - name - windows - - - - colladadom - - license - scea - license_file - LICENSES/collada.txt - name - colladadom - platforms - - darwin - - archive - - hash - 480b27a0cb39a4adfcdeabef895de3e1 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-colladadom/rev/227230/arch/Darwin/installer/colladadom-2.2-darwin-20110420.tar.bz2 - - name - darwin - - linux - - archive - - hash - be7321370b69b6d66938b82a9230a067 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-colladadom/rev/233450/arch/Linux/installer/colladadom-2.2-linux-20110621.tar.bz2 - - name - linux - - windows - - archive - - hash - a9f548eb6f9aaf292508a8b09c7f2f73 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-colladadom/rev/226584/arch/CYGWIN/installer/colladadom-2.2-windows-20110413.tar.bz2 - - name - windows - - - - curl - - license - curl - license_file - LICENSES/curl.txt - name - curl - platforms - - darwin - - archive - - hash - 6f6b4fc6268e7935e82e694ed3f5912a - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-curl/rev/249347/arch/Darwin/installer/curl-7.24.0-darwin-20120213.tar.bz2 - - name - darwin - - linux - - archive - - hash - 384e6d46f2f4228117cda7eea396df06 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-curl/rev/263749/arch/Linux/installer/curl-7.24.0-linux-20120820.tar.bz2 - - name - linux - - windows - - archive - - hash - 56c72a3b4d6faab81a4d66a630a67c83 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-curl/rev/249347/arch/CYGWIN/installer/curl-7.24.0-windows-20120213.tar.bz2 - - name - windows - - - - db - - license - bsd - license_file - LICENSES/db.txt - name - db - platforms - - linux - - archive - - hash - 8f57c413e0786681cbcb9ed2fb8a6d37 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/db-5.1.25-linux-20110309.tar.bz2 - - name - linux - - - - dbusglib - - license - AFL2.1 - license_file - LICENSES/dbus-glib.txt - name - dbusglib - platforms - - linux - - archive - - hash - 94b058b9a81114dc4567bd78e4335425 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/dbus_glib-0.76-linux-20110310.tar.bz2 - - name - linux - - - - dictionaries - - license - various open - license_file - LICENSES/dictionaries.txt - name - dictionaries - platforms - - darwin - - archive - - hash - 06a6c49eb1873e95623d3d2d07aee903 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-dictionaries/rev/259873/arch/Darwin/installer/dictionaries-1-darwin-20120616.tar.bz2 - - name - darwin - - linux - - archive - - hash - 4f0ca21d27e0cd0b002149062b0a4b25 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-dictionaries/rev/259873/arch/Linux/installer/dictionaries-1-linux-20120616.tar.bz2 - - name - linux - - windows - - archive - - hash - 7520d75f6af325328322201c888191d4 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-dictionaries/rev/259873/arch/CYGWIN/installer/dictionaries-1-windows-20120616.tar.bz2 - - name - windows - - - - elfio - - license - lgpl - license_file - LICENSES/elfio.txt - name - elfio - platforms - - linux - - archive - - hash - 031e6315a5c0829c9b9a2ec18aeb7ae3 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-elfio/rev/222074/arch/Linux/installer/elfio-1.0.3-linux-20110225.tar.bz2 - - name - linux - - - - expat - - license - mit - license_file - LICENSES/expat.txt - name - expat - platforms - - darwin - - archive - - hash - 180e03d0be1f1acfc3244e78742d7bef - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-expat/rev/221695/arch/Darwin/installer/expat-2.0.1-darwin-20110218.tar.bz2 - - name - darwin - - linux - - archive - - hash - 9bd79781b58e556ab1c36084ec4a1c0c - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-expat/rev/221695/arch/Linux/installer/expat-2.0.1-linux-20110219.tar.bz2 - - name - linux - - windows - - archive - - hash - e72db1bda49b205ebdf4945d4ed2b8f8 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/expat-2.0.1-windows-20110215.tar.bz2 - - name - windows - - - - fmod - - license - fmod - license_file - LICENSES/fmod.txt - name - fmod - platforms - - darwin - - archive - - hash - 61ead113e6479452e6b690c84b4e9d30 - url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmod-private/rev/221852/arch/Darwin/installer/fmod-3.75-darwin-20110222.tar.bz2 - - name - darwin - - linux - - archive - - hash - 0c61d643db54d2e5999be8254569d8b3 - url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmod-private/rev/221852/arch/Linux/installer/fmod-3.75-linux-20110223.tar.bz2 - - name - linux - - windows - - archive - - hash - d9a9a6ad86895353bcd63374a4c1a91d - url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmod-private/rev/221852/arch/CYGWIN/installer/fmod-3.75-windows-20110222.tar.bz2 - - name - windows - - - - fontconfig - - license - mit - license_file - LICENSES/fontconfig.txt - name - fontconfig - platforms - - linux - - archive - - hash - d8b08b657247566bde5fd853c7622478 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/fontconfig-2.8.0-linux-20110311.tar.bz2 - - name - linux - - - - freeglut - - license - mit - license_file - LICENSES/freeglut.txt - name - freeglut - platforms - - windows - - archive - - hash - 825d5a9bafcc5bfe28dc4c1c4f87c576 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-freeglut/rev/221064/arch/CYGWIN/installer/freeglut-2.6.0-windows-20110214.tar.bz2 - - name - windows - - - - freetype - - license - freetype - license_file - LICENSES/freetype.txt - name - freetype - platforms - - darwin - - archive - - hash - c0eacb6348e032fbc69cfdc4bd215ee4 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/freetype-2.4.4-darwin-20110307.tar.bz2 - - name - darwin - - linux - - archive - - hash - 9f8a9dc39fd7c3da0fb3533782d1fddf - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-freetype/rev/226814/arch/Linux/installer/freetype-2.3.9-linux-20110418.tar.bz2 - - name - linux - - windows - - archive - - hash - 271349827b939406162ce42e42cd18e0 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/freetype-2.4.4-windows-20110218.tar.bz2 - - name - windows - - - - glext - - license - glext - license_file - LICENSES/glext.txt - name - glext - platforms - - linux - - archive - - hash - 5de58ca0fe19abf68b25956762ee0d29 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/glext-68-windows-20110406.tar.bz2 - - name - linux - - windows - - archive - - hash - 5de58ca0fe19abf68b25956762ee0d29 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/glext-68-windows-20110406.tar.bz2 - - name - windows - - - - glh_linear - - license - glh_linear - license_file - LICENSES/glh_linear.txt - name - glh_linear - platforms - - darwin - - archive - - hash - 366f940f2634b0e05954646927620bfd - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/glh_linear-darwin-20101004.tar.bz2 - - name - darwin - - linux - - archive - - hash - 26f2df1f0b0fa01e94e0253e322f3583 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/glh_linear-linux-20101001.tar.bz2 - - name - linux - - windows - - archive - - hash - 57f8be28bbaa2505ae3b59deb2c77cdf - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/glh_linear-windows-20101011.tar.bz2 - - name - windows - - - - glui - - license - lgpl - license_file - LICENSES/glui.txt - name - glui - platforms - - darwin - - archive - - hash - bd2f84ef8bd308570e2e532a371dc2ef - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/glui-2.36-darwin-20110309.tar.bz2 - - name - darwin - - windows - - archive - - hash - e006635a741420a15f40bbdac13bd8d7 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/glui-2.36-windows-20110214.tar.bz2 - - name - windows - - - - google_breakpad - - license - bsd - license_file - LICENSES/google_breakpad.txt - name - google_breakpad - platforms - - darwin - - archive - - hash - 21babc394dbf8572830f2e85adec7b9f - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/google_breakpad-0.0.0-rev599-darwin-20110202.tar.bz2 - - name - darwin - - linux - - archive - - hash - 204b02a9480c411232255798839431a2 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/google_breakpad-0.0.0-rev599-linux-20110311.tar.bz2 - - name - linux - - windows - - archive - - hash - 627c51136e14e64c5d39933f3abd3bdf - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/google_breakpad-0.0.0-rev599-windows-20110218.tar.bz2 - - name - windows - - - - googlemock - - license - bsd - license_file - LICENSES/googlemock.txt - name - googlemock - platforms - - darwin - - archive - - hash - 886ee428f058005ab7f90f61784ec9d9 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/googlemock-1.1.0-darwin-20101004.tar.bz2 - - name - darwin - - linux - - archive - - hash - 782ca04e56d8eab755adcae297cafa7c - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/googlemock-1.1.0-linux-20101001.tar.bz2 - - name - linux - - windows - - archive - - hash - 212701468920519f3989677cea9ca4f1 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/gmock-1.5.0-windows-20110224.tar.bz2 - - name - windows - - - - gstreamer - - license - lgpl - license_file - LICENSES/gstreamer.txt - name - gstreamer - platforms - - linux - - archive - - hash - ddbc0a64ad788107877fee777403592c - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/gstreamer-linux-20101013.tar.bz2 - - name - linux - - - - gtk-atk-pango-glib - - license - lgpl - license_file - LICENSES/gtk-atk-pango-glib.txt - name - gtk-atk-pango-glib - platforms - - linux - - archive - - hash - 03694ade27f53199229c03cbbda89214 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/gtk-atk-pango-glib-linux-20101001.tar.bz2 - - name - linux - - windows - - archive - - hash - c257d718abdde8cfe8a0af26175161a7 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/gtk-atk-pango-glib-windows-20101001a.tar.bz2 - - name - windows - - - - havok-source - - license - havok-ares - license_file - LICENSES/havok.txt - name - havok-source - platforms - - darwin - - archive - - hash - e6feee3b452c2f70ce8558e30d6bc10a - url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/lindenlab_3p-havok-source/rev/268409/arch/Darwin/installer/havok_source-2012.1-darwin-20121219.tar.bz2 - - name - darwin - - linux - - archive - - hash - 0c0d2058ba48446e274d6595d1d8063e - url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/lindenlab_3p-havok-source/rev/268409/arch/Linux/installer/havok_source-2012.1-linux-20121219.tar.bz2 - - name - linux - - windows - - archive - - hash - 88391b6e08d473506d406ca6f3e88cfb - url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/lindenlab_3p-havok-source/rev/268409/arch/CYGWIN/installer/havok_source-2012.1-windows-20121219.tar.bz2 - - name - windows - - - - jpeglib - - license - jpeglib - license_file - LICENSES/jpeglib.txt - name - jpeglib - platforms - - darwin - - archive - - hash - 71bd6efbf508e1f2e7d98a6195a93e9e - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/jpeglib-8c-darwin-20110228.tar.bz2 - - name - darwin - - linux - - archive - - hash - dcca1db348831cdb7c6b26dc4076c597 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-jpeglib/rev/224895/arch/Linux/installer/jpeglib-8c-linux-20110323.tar.bz2 - - name - linux - - windows - - archive - - hash - a202ec58cef9097c94acfa958ed6da8d - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/jpeglib-8c-windows-20110217.tar.bz2 - - name - windows - - - - jsoncpp - - license - jsoncpp - license_file - LICENSES/jsoncpp.txt - name - jsoncpp - platforms - - darwin - - archive - - hash - de8b96120c274e052abb4f692861be46 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/jsoncpp-0.5.0-darwin-20110131.tar.bz2 - - name - darwin - - linux - - archive - - hash - 840cd9455638c0ea52c613cfddd07d5b - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/jsoncpp-0.5.0-linux-20110315.tar.bz2 - - name - linux - - windows - - archive - - hash - afff2018e6a887c281b072eecdd9343e - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/jsoncpp-0.5.0-windows-20110208.tar.bz2 - - name - windows - - - - kdu - - license - kdu - license_file - LICENSES/kdu.txt - name - kdu - platforms - - darwin - - archive - - hash - a5b2dff0d97b643227a58473e5c57906 - url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-kdu-private/rev/256978/arch/Darwin/installer/kdu-7.0.0-darwin-20120515.tar.bz2 - - name - darwin - - linux - - archive - - hash - fbf8a4f78dff986d7c16b3a0437e033e - url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-kdu-private/rev/223538/arch/Linux/installer/kdu-6.4.1-linux-20110311.tar.bz2 - - name - linux - - windows - - archive - - hash - 6d80d35524e1c0c32d3385014d02d48c - url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-kdu-private/rev/256978/arch/CYGWIN/installer/kdu-7.0.0-windows-20120515.tar.bz2 - - name - windows - - - - libhunspell - - license - libhunspell - license_file - LICENSES/hunspell.txt - name - libhunspell - platforms - - darwin - - archive - - hash - 6f5db0ef258df6e5c93c843ec559db6d - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-hunspell/rev/259874/arch/Darwin/installer/libhunspell-1.3.2-darwin-20120616.tar.bz2 - - name - darwin - - linux - - archive - - hash - 0c432d2626aea2e91a56335879c92965 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-hunspell/rev/259874/arch/Linux/installer/libhunspell-1.3.2-linux-20120616.tar.bz2 - - name - linux - - windows - - archive - - hash - 6a140e5620826aa5e587b4157f57b389 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-hunspell/rev/259874/arch/CYGWIN/installer/libhunspell-1.3.2-windows-20120616.tar.bz2 - - name - windows - - - - libpng - - license - libpng - license_file - LICENSES/libpng.txt - name - libpng - platforms - - darwin - - archive - - hash - 6fe1adf12d98bce9111f60ee762007b9 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/libpng-1.5.1-darwin-20110222.tar.bz2 - - name - darwin - - linux - - archive - - hash - 0681ab7e1988dfdbdad7dd9edb7760ee - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/libpng-1.5.1-linux-20110223.tar.bz2 - - name - linux - - windows - - archive - - hash - f194ba857ca8dd86483a3ef24535d0db - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-libpng/rev/226532/arch/CYGWIN/installer/libpng-1.5.1-windows-20110413.tar.bz2 - - name - windows - - - - libuuid - - license - lgpl - license_file - LICENSES/libuuid.txt - name - libuuid - platforms - - linux - - archive - - hash - 873e8e99d29711df2efa30646dca1795 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/uuid-1.6.2-linux-20110315.tar.bz2 - - name - linux - - - - libxml - - license - mit - license_file - LICENSES/libxml.txt - name - libxml - platforms - - linux - - archive - - hash - 6414642528f42dac1cd9a012c99cd748 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/libxml-2.6.24-linux-20101013.tar.bz2 - - name - linux - - - - llphysicsextensions_source - - license - TEMPORARY - license_file - LICENSES/llphysicsextensions.txt - name - llphysicsextensions_source - platforms - - darwin - - archive - - hash - 0578fa67ef9906c6aaa326f51db2669f - hash_algorithm - md5 - url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions-source/rev/263415/arch/Darwin/installer/llphysicsextensions_source-0.3-darwin-20120814.tar.bz2 - - name - darwin - - linux - - archive - - hash - b706fdeed4ce2182d434043dc33d9d1d - url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions-source/rev/263415/arch/Linux/installer/llphysicsextensions_source-0.3-linux-20120814.tar.bz2 - - name - linux - - windows - - archive - - hash - 0cebd359ea732a7db363d88f9886a1ef - url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions-source/rev/263415/arch/CYGWIN/installer/llphysicsextensions_source-0.3-windows-20120814.tar.bz2 - - name - windows - - - version - 0.2 - - llphysicsextensions_stub - - license - TEMPORARY - license_file - LICENSES/llphysicsextensions.txt - name - llphysicsextensions_stub - platforms - - darwin - - archive - - hash - 3ae798d4dfb54a1d806ee5f8b31f7626 - hash_algorithm - md5 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llphysicsextensions-stub/rev/263415/arch/Darwin/installer/llphysicsextensions_stub-0.3-darwin-20120814.tar.bz2 - - name - darwin - - linux - - archive - - hash - aa8a2f25e8629cf5e6a96cc0eb93de8e - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llphysicsextensions-stub/rev/263415/arch/Linux/installer/llphysicsextensions_stub-0.3-linux-20120814.tar.bz2 - - name - linux - - windows - - archive - - hash - 3ea4cee6a8dd4c89fbfd3ad6abd703c2 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llphysicsextensions-stub/rev/263415/arch/CYGWIN/installer/llphysicsextensions_stub-0.3-windows-20120814.tar.bz2 - - name - windows - - - version - 0.2 - - llqtwebkit - - license - lgpl - license_file - LICENSES/llqtwebkit.txt - name - llqtwebkit - platforms - - darwin - - archive - - hash - 4a98d727561cd1f4ac5ee02907411df1 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/250147/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20120228.tar.bz2 - - name - darwin - - linux - - archive - - hash - f50e5f0cc880c55b3f0f7e67dc8f7221 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/250147/arch/Linux/installer/llqtwebkit-4.7.1-linux-20120228.tar.bz2 - - name - linux - - windows - - archive - - hash - 5e3cd6af397e853a963a6de40d440ff4 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/250147/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20120228.tar.bz2 - - name - windows - - - - mesa - - license - mesa - license_file - LICENSES/mesa.txt - name - mesa - platforms - - linux - - archive - - hash - 1f600840463c7327ea17486821425750 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/mesa-7.0-linux-20100930.tar.bz2 - - name - linux - - - - ndofdev - - license - linden - license_file - LICENSES/libndofdev.txt - name - ndofdev - platforms - - darwin - - archive - - hash - 674d37d2ba76a2df7f18c47bf50b5d03 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/libndofdev-0.1-darwin-20110308.tar.bz2 - - name - darwin - - linux - - archive - - hash - 9bf7a96c1d2fadb180fda91740c945c6 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-libndofdev-linux/rev/233137/arch/Linux/installer/libndofdev-0.3-linux-20110617.tar.bz2 - - name - linux - - windows - - archive - - hash - 3a4bec9562ed6ac53e85abcb1afc5fc0 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/libndofdev-0.1-windows-20110223.tar.bz2 - - name - windows - - - - nvapi - - license - NVAPI - license_file - LICENSES/NVAPI_SDK_License_Agreement.pdf - name - nvapi - platforms - - windows - - archive - - hash - baf519d36dffe4e4a59471450e391d01 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-nvapi/rev/267102/arch/CYGWIN/installer/nvapi-304-windows-20121116.tar.bz2 - - name - windows - - - - ogg-vorbis - - license - ogg-vorbis - license_file - LICENSES/ogg-vorbis.txt - name - ogg-vorbis - platforms - - darwin - - archive - - hash - e849bc2b779fb7cc5e81aeb021a542c0 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ogvorbis/rev/229529/arch/Darwin/installer/ogg_vorbis-1.2.2-1.3.2-darwin-20110510.tar.bz2 - - name - darwin - - linux - - archive - - hash - 71eaa462eb0bf8842277a3436483a354 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ogvorbis/rev/229529/arch/Linux/installer/ogg_vorbis-1.2.2-1.3.2-linux-20110511.tar.bz2 - - name - linux - - windows - - archive - - hash - 291dbba89dd8162b76f2c2d82e908c6f - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ogvorbis/rev/229529/arch/CYGWIN/installer/ogg_vorbis-1.2.2-1.3.2-windows-20110510.tar.bz2 - - name - windows - - - - openSSL - - license - openSSL - license_file - LICENSES/openssl.txt - name - openSSL - platforms - - darwin - - archive - - hash - 38ea083fe1204ee106b4d44d9811af19 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-openssl/rev/249044/arch/Darwin/installer/openssl-1.0.0g-darwin-20120207.tar.bz2 - - name - darwin - - linux - - archive - - hash - 774c7f0a0312bee3054757a623e227bc - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-openssl/rev/249044/arch/Linux/installer/openssl-1.0.0g-linux-20120207.tar.bz2 - - name - linux - - windows - - archive - - hash - ed6cbaf9860a03bc99ac301277f1452a - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-openssl/rev/249044/arch/CYGWIN/installer/openssl-1.0.0g-windows-20120207.tar.bz2 - - name - windows - - - - openal_soft - - license - lgpl - license_file - LICENSES/OPENAL.txt - name - openal_soft - platforms - - linux - - archive - - hash - 7dc5191a3d95074a6ed3bd53f57420e5 - hash_algorithm - md5 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openal-3ad86a1c-linux-20110114.tar.bz2 - - name - linux - - windows - - archive - - hash - 04df406f3e5d04cf176660bdac66c3a1 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openal-1.12.854-1.1.0-windows-20110301.tar.bz2 - - name - windows - - - version - 3ad86a1c - - openjpeg - - license - openjpeg - license_file - LICENSES/openjpeg.txt - name - openjpeg - platforms - - darwin - - archive - - hash - 4be51c7cca7d84831e30b63279df7ae5 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openjpeg-1.4-darwin-20110302.tar.bz2 - - name - darwin - - linux - - archive - - hash - fb2382014c79e0049746e4e29bd834f9 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openjpeg-1.4-linux-20110314.tar.bz2 - - name - linux - - windows - - archive - - hash - ca5765af55f798724d601720afdf6953 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openjpeg-1.4-windows-20110302.tar.bz2 - - name - windows - - - - pcre - - license - bsd - license_file - LICENSES/pcre-license.txt - name - pcre - platforms - - darwin - - archive - - hash - a8e74694a0f4248228c13c845ed0a6f8 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-pcre/rev/228822/arch/Darwin/installer/pcre-7.6-darwin-20110504.tar.bz2 - - name - darwin - - linux - - archive - - hash - bb0abe962b3b8208ed2dab0424aab33d - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-pcre/rev/228822/arch/Linux/installer/pcre-7.6-linux-20110504.tar.bz2 - - name - linux - - - - quicktime - - license - quicktime - license_file - LICENSES/quicktime.txt - name - quicktime - platforms - - windows - - archive - - hash - 52e49ab6937b09882389da0dbaec17f5 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/quicktime-7.3-windows-20110127.tar.bz2 - - name - windows - - - - slvoice - - license - vivox - license_file - LICENSES/slvoice.txt - name - slvoice - platforms - - darwin - - archive - - hash - 24e735ae005f3ce7a21a09cc02cece17 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-slvoice/rev/231678/arch/Darwin/installer/slvoice-3.2.0002.10426-darwin-20110601.tar.bz2 - - name - darwin - - linux - - archive - - hash - 8a0bc982367d6fdc20a28b391cd40566 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-slvoice/rev/231678/arch/Linux/installer/slvoice-3.2.0002.10426-linux-20110601.tar.bz2 - - name - linux - - windows - - archive - - hash - 1e821cc7d25eabad013b7f3db260dd6b - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-slvoice/rev/231678/arch/CYGWIN/installer/slvoice-3.2.0002.10426-windows-20110601.tar.bz2 - - name - windows - - - - tcmalloc - - license - bsd - license_file - LICENSES/google-perftools.txt - name - tcmalloc - platforms - - linux - - archive - - hash - 8aedfdcf670348c18a9991ae1b384a61 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-perftools/rev/262672/arch/Linux/installer/gperftools-2.0-linux-20120727.tar.bz2 - - name - linux - - windows - - archive - - hash - f62841804acb91e1309603a84f3f0ce8 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-perftools/rev/262672/arch/CYGWIN/installer/gperftools-2.0-windows-20120727.tar.bz2 - - name - windows - - - - tut - - license - bsd - license_file - LICENSES/tut.txt - name - tut - platforms - - common - - archive - - hash - 5c6d3e606f027e78f056cb77b20f228e - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/tut-2008-11-30-common-20101001.tar.bz2 - - name - common - - - - xmlrpc-epi - - license - xmlrpc-epi - license_file - LICENSES/xmlrpc-epi.txt - name - xmlrpc-epi - platforms - - darwin - - archive - - hash - a3e0fb4b4a51b01690a99747a1cca531 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/xmlrpc_epi-0.54.1-darwin-20110307.tar.bz2 - - name - darwin - - linux - - archive - - hash - 174ab797440157956eda7061dae37564 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/xmlrpc_epi-0.54.1-linux-20110314.tar.bz2 - - name - linux - - windows - - archive - - hash - 5181d1a8f2516928ac064d72acf164a4 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/xmlrpc_epi-0.54.1-windows-20110224.tar.bz2 - - name - windows - - - - zlib - - license - zlib - license_file - LICENSES/zlib.txt - name - zlib - platforms - - darwin - - archive - - hash - 49b8de20f3bb43537f51311894a72de1 - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/zlib-1.2.5-darwin-20110211.tar.bz2 - - name - darwin - - linux - - archive - - hash - 7b4cf3aa2c04937d0a20761516587896 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-zlib/rev/223739/arch/Linux/installer/zlib-1.2.5-linux-20110314.tar.bz2 - - name - linux - - windows - - archive - - hash - 5852192646681817fc3c3a8c95e91c1e - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-zlib/rev/220983/arch/CYGWIN/installer/zlib-1.2.5-windows-20110211.tar.bz2 - - name - windows - - - - - package_description - - description - Spell checking dictionaries - license - various open - name - dictionaries - platforms - - common - - configurations - - Debug - - build - - - configure - - command - cmake - options - - -DCMAKE_BUILD_TYPE:STRING=Debug - -DWORD_SIZE:STRING=32 - -DROOT_PROJECT_NAME:STRING=SecondLife - -DINSTALL_PROPRIETARY=TRUE - - - name - Debug - - DebugOS - - configure - - arguments - - ../indra - - command - cmake - options - - -DCMAKE_BUILD_TYPE:STRING=Debug - -DWORD_SIZE:STRING=32 - -DROOT_PROJECT_NAME:STRING=SecondLife - -DINSTALL_PROPRIETARY=FALSE - - - name - DebugOS - - RelWithDebInfo - - build - - - configure - - command - cmake - options - - -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo - -DWORD_SIZE:STRING=32 - -DROOT_PROJECT_NAME:STRING=SecondLife - -DINSTALL_PROPRIETARY=TRUE - - - name - RelWithDebInfo - - RelWithDebInfoOS - - configure - - arguments - - ../indra - - command - cmake - options - - -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo - -DWORD_SIZE:STRING=32 - -DROOT_PROJECT_NAME:STRING=SecondLife - -DINSTALL_PROPRIETARY=FALSE - - - name - RelWithDebInfoOS - - Release - - build - - - configure - - command - cmake - options - - -DCMAKE_BUILD_TYPE:STRING=Release - -DWORD_SIZE:STRING=32 - -DROOT_PROJECT_NAME:STRING=SecondLife - -DINSTALL_PROPRIETARY=TRUE - - - name - Release - - ReleaseOS - - configure - - arguments - - ../indra - - command - cmake - options - - -DCMAKE_BUILD_TYPE:STRING=Release - -DWORD_SIZE:STRING=32 - -DROOT_PROJECT_NAME:STRING=SecondLife - -DINSTALL_PROPRIETARY=FALSE - - - name - ReleaseOS - - - name - common - - darwin - - build_directory - build-darwin-i386 - configurations - - Debug - - build - - command - xcodebuild - filters - - setenv - - options - - -configuration Debug - -project SecondLife.xcodeproj - - - configure - - arguments - - ../indra - - options - - -G - 'Xcode' - - - name - Debug - - DebugOS - - build - - command - xcodebuild - options - - -configuration Debug - -project SecondLife.xcodeproj - - - configure - - options - - -G - 'Xcode' - - - name - DebugOS - - RelWithDebInfo - - build - - command - xcodebuild - filters - - setenv - - options - - -configuration RelWithDebInfo - -project SecondLife.xcodeproj - - - configure - - arguments - - ../indra - - options - - -G - 'Xcode' - - - default - True - name - RelWithDebInfo - - RelWithDebInfoOS - - build - - command - xcodebuild - options - - -configuration RelWithDebInfo - -project SecondLife.xcodeproj - - - configure - - options - - -G - 'Xcode' - - - name - RelWithDebInfoOS - - Release - - build - - command - xcodebuild - filters - - setenv - - options - - -configuration Release - -project SecondLife.xcodeproj - -DENABLE_SIGNING:BOOL=YES - -DSIGNING_IDENTITY:STRING="Developer ID Application: Linden Research, Inc." - - - configure - - arguments - - ../indra - - options - - -G - 'Xcode' - - - name - Release - - ReleaseOS - - build - - command - xcodebuild - options - - -configuration Release - -project SecondLife.xcodeproj - -DENABLE_SIGNING:BOOL=YES - -DSIGNING_IDENTITY:STRING="Developer ID Application: Linden Research, Inc." - - - configure - - options - - -G - 'Xcode' - - - name - ReleaseOS - - - name - darwin - - linux - - build_directory - build-linux-i686 - configurations - - Debug - - build - - command - make - options - - -j 12 - - - configure - - arguments - - ../indra - - options - - -G - 'Unix Makefiles' - - - name - Debug - - DebugOS - - build - - command - make - options - - -j 2 - - - configure - - options - - -G - 'Unix Makefiles' - - - name - DebugOS - - RelWithDebInfo - - build - - command - make - options - - -j 12 - - - configure - - arguments - - ../indra - - options - - -G - 'Unix Makefiles' - - - default - True - name - RelWithDebInfo - - RelWithDebInfoOS - - build - - command - make - options - - -j 2 - - - configure - - options - - -G - 'Unix Makefiles' - - - name - RelWithDebInfoOS - - Release - - build - - command - make - options - - -j 12 - - - configure - - arguments - - ../indra - - options - - -G - 'Unix Makefiles' - - - name - Release - - ReleaseOS - - build - - command - make - options - - -j 2 - - - configure - - options - - -G - 'Unix Makefiles' - - - name - ReleaseOS - - default - - build - - - name - default - - - name - linux - - windows - - build_directory - build-vc100 - configurations - - Debug - - build - - arguments - - SecondLife.sln - - command - BuildConsole - options - - /build - "/cfg=Debug|Win32" - - - configure - - arguments - - ..\indra - && - ..\indra\tools\vstool\VSTool.exe - --solution - SecondLife.sln - --config - Debug - --startup - secondlife-bin - - options - - -G - "Visual Studio 10" - - - name - Debug - - DebugOS - - build - - arguments - - SecondLife.sln - - command - msbuild.exe - options - - /p:Configuration=Debug - /p:Platform=Win32 - /t:Build - /p:useenv=true - /verbosity:minimal - /toolsversion:4.0 - /p:"VCBuildAdditionalOptions= /incremental" - - - configure - - arguments - - ..\indra - && - ..\indra\tools\vstool\VSTool.exe - --solution - SecondLife.sln - --config - Debug - --startup - secondlife-bin - - options - - -G - "Visual Studio 10" - -DUNATTENDED:BOOL=ON - -DUSE_KDU=FALSE - -DFMOD=FALSE - - - name - DebugOS - - RelWithDebInfo - - build - - arguments - - SecondLife.sln - - command - BuildConsole - options - - /build - "/cfg=RelWithDebInfo|Win32" - - - configure - - arguments - - ..\indra - && - ..\indra\tools\vstool\VSTool.exe - --solution - SecondLife.sln - --config - RelWithDebInfo - --startup - secondlife-bin - - options - - -G - "Visual Studio 10" - - - default - True - name - RelWithDebInfo - - RelWithDebInfoOS - - build - - arguments - - SecondLife.sln - - command - msbuild.exe - options - - /p:Configuration=RelWithDebInfo - /p:Platform=Win32 - /t:Build - /p:useenv=true - /verbosity:minimal - /toolsversion:4.0 - /p:"VCBuildAdditionalOptions= /incremental" - - - configure - - arguments - - ..\indra - && - ..\indra\tools\vstool\VSTool.exe - --solution - SecondLife.sln - --config - RelWithDebInfo - --startup - secondlife-bin - - options - - -G - "Visual Studio 10" - -DUNATTENDED:BOOL=ON - -DINSTALL_PROPRIETARY=FALSE - -DUSE_KDU=FALSE - -DFMOD=FALSE - - - name - RelWithDebInfoOS - - Release - - build - - arguments - - SecondLife.sln - - command - BuildConsole - options - - /build - "/cfg=Release|Win32" - "/CL_ADD=/m:1" - - - configure - - arguments - - ..\indra - && - ..\indra\tools\vstool\VSTool.exe - --solution - SecondLife.sln - --config - Release - --startup - secondlife-bin - - options - - -G - "Visual Studio 10" - - - name - Release - - ReleaseOS - - build - - arguments - - SecondLife.sln - - command - msbuild.exe - options - - /p:Configuration=Release - /p:Platform=Win32 - /t:Build - /p:useenv=true - /verbosity:minimal - /toolsversion:4.0 - /p:"VCBuildAdditionalOptions= /incremental" - - - configure - - arguments - - ..\indra - && - ..\indra\tools\vstool\VSTool.exe - --solution - SecondLife.sln - --config - Release - --startup - secondlife-bin - - options - - -G - "Visual Studio 10" - -DUNATTENDED:BOOL=ON - -DINSTALL_PROPRIETARY=FALSE - -DUSE_KDU=FALSE - -DFMOD=FALSE - - - name - ReleaseOS - - - name - windows - - - version - 1.0 - - type - autobuild - version - 1.2 - - + + + + installables + + GLOD + + license + GLOD + license_file + LICENSES/glod.txt + name + GLOD + platforms + + darwin + + archive + + hash + b2fe1c860613a68e74d4384be418ffee + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-glod/rev/232684/arch/Darwin/installer/glod-1.0pre4-darwin-20110610.tar.bz2 + + name + darwin + + linux + + archive + + hash + c0c64dae149d0892343e2ff300fd06b9 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-glod/rev/232684/arch/Linux/installer/glod-1.0pre4-linux-20110611.tar.bz2 + + name + linux + + windows + + archive + + hash + 842208365f5b108dac4c7c733b99da9c + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-glod/rev/232684/arch/CYGWIN/installer/glod-1.0pre4-windows-20110610.tar.bz2 + + name + windows + + + + SDL + + license + lgpl + license_file + LICENSES/SDL.txt + name + SDL + platforms + + linux + + archive + + hash + 69ae3b1c9cdb0ebc0d0e1ac8413e3eb7 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/SDL-1.2.14-linux-20110309.tar.bz2 + + name + linux + + + + apr_suite + + license + apache + license_file + LICENSES/apr_suite.txt + name + apr_suite + platforms + + darwin + + archive + + hash + 2dfcd809e747f714b3fe0bf82a175812 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/259951/arch/Darwin/installer/apr_suite-1.4.5-darwin-20120618.tar.bz2 + + name + darwin + + linux + + archive + + hash + f38c966a430012dc157fdc104f23a59b + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/259951/arch/Linux/installer/apr_suite-1.4.5-linux-20120618.tar.bz2 + + name + linux + + windows + + archive + + hash + 4a9d040582342699c58c886c5ccd2caf + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/259951/arch/CYGWIN/installer/apr_suite-1.4.5-windows-20120618.tar.bz2 + + name + windows + + + + ares + + license + c-ares + license_file + LICENSES/c-ares.txt + name + ares + platforms + + darwin + + archive + + hash + 4dd93da518dc00319cadac43dce2676b + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ares/rev/239515/arch/Darwin/installer/ares-1.7.5-darwin-20110825.tar.bz2 + + name + darwin + + linux + + archive + + hash + c223c0df8ebdab02a5bd785c21459875 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ares/rev/239515/arch/Linux/installer/ares-1.7.5-linux-20110825.tar.bz2 + + name + linux + + windows + + archive + + hash + a0a002359e44a9c68f897b45217abf7e + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ares/rev/239515/arch/CYGWIN/installer/ares-1.7.5-windows-20110825.tar.bz2 + + name + windows + + + + boost + + license + boost + license_file + LICENSES/boost.txt + name + boost + platforms + + darwin + + archive + + hash + ac37d0038c91b0672fa31a02731f0eac + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-boost/rev/268347/arch/Darwin/installer/boost-1.52.0-darwin-20121218.tar.bz2 + + name + darwin + + linux + + archive + + hash + 146ed8a8c2ef8ab3f0a6c4f214fc5c22 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-boost/rev/268347/arch/Linux/installer/boost-1.52.0-linux-20121218.tar.bz2 + + name + linux + + windows + + archive + + hash + 3ea60f17d986b7e8a3351298734bdca4 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-boost/rev/268347/arch/CYGWIN/installer/boost-1.52.0-windows-20121218.tar.bz2 + + name + windows + + + + colladadom + + license + scea + license_file + LICENSES/collada.txt + name + colladadom + platforms + + darwin + + archive + + hash + 480b27a0cb39a4adfcdeabef895de3e1 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-colladadom/rev/227230/arch/Darwin/installer/colladadom-2.2-darwin-20110420.tar.bz2 + + name + darwin + + linux + + archive + + hash + be7321370b69b6d66938b82a9230a067 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-colladadom/rev/233450/arch/Linux/installer/colladadom-2.2-linux-20110621.tar.bz2 + + name + linux + + windows + + archive + + hash + a9f548eb6f9aaf292508a8b09c7f2f73 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-colladadom/rev/226584/arch/CYGWIN/installer/colladadom-2.2-windows-20110413.tar.bz2 + + name + windows + + + + curl + + license + curl + license_file + LICENSES/curl.txt + name + curl + platforms + + darwin + + archive + + hash + 6f6b4fc6268e7935e82e694ed3f5912a + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-curl/rev/249347/arch/Darwin/installer/curl-7.24.0-darwin-20120213.tar.bz2 + + name + darwin + + linux + + archive + + hash + 384e6d46f2f4228117cda7eea396df06 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-curl/rev/263749/arch/Linux/installer/curl-7.24.0-linux-20120820.tar.bz2 + + name + linux + + windows + + archive + + hash + 56c72a3b4d6faab81a4d66a630a67c83 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-curl/rev/249347/arch/CYGWIN/installer/curl-7.24.0-windows-20120213.tar.bz2 + + name + windows + + + + db + + license + bsd + license_file + LICENSES/db.txt + name + db + platforms + + linux + + archive + + hash + 8f57c413e0786681cbcb9ed2fb8a6d37 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/db-5.1.25-linux-20110309.tar.bz2 + + name + linux + + + + dbusglib + + license + AFL2.1 + license_file + LICENSES/dbus-glib.txt + name + dbusglib + platforms + + linux + + archive + + hash + 94b058b9a81114dc4567bd78e4335425 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/dbus_glib-0.76-linux-20110310.tar.bz2 + + name + linux + + + + dictionaries + + license + various open + license_file + LICENSES/dictionaries.txt + name + dictionaries + platforms + + darwin + + archive + + hash + 06a6c49eb1873e95623d3d2d07aee903 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-dictionaries/rev/259873/arch/Darwin/installer/dictionaries-1-darwin-20120616.tar.bz2 + + name + darwin + + linux + + archive + + hash + 4f0ca21d27e0cd0b002149062b0a4b25 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-dictionaries/rev/259873/arch/Linux/installer/dictionaries-1-linux-20120616.tar.bz2 + + name + linux + + windows + + archive + + hash + 7520d75f6af325328322201c888191d4 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-dictionaries/rev/259873/arch/CYGWIN/installer/dictionaries-1-windows-20120616.tar.bz2 + + name + windows + + + + elfio + + license + lgpl + license_file + LICENSES/elfio.txt + name + elfio + platforms + + linux + + archive + + hash + 031e6315a5c0829c9b9a2ec18aeb7ae3 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-elfio/rev/222074/arch/Linux/installer/elfio-1.0.3-linux-20110225.tar.bz2 + + name + linux + + + + expat + + license + mit + license_file + LICENSES/expat.txt + name + expat + platforms + + darwin + + archive + + hash + 180e03d0be1f1acfc3244e78742d7bef + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-expat/rev/221695/arch/Darwin/installer/expat-2.0.1-darwin-20110218.tar.bz2 + + name + darwin + + linux + + archive + + hash + 9bd79781b58e556ab1c36084ec4a1c0c + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-expat/rev/221695/arch/Linux/installer/expat-2.0.1-linux-20110219.tar.bz2 + + name + linux + + windows + + archive + + hash + e72db1bda49b205ebdf4945d4ed2b8f8 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/expat-2.0.1-windows-20110215.tar.bz2 + + name + windows + + + + fmod + + license + fmod + license_file + LICENSES/fmod.txt + name + fmod + platforms + + darwin + + archive + + hash + 61ead113e6479452e6b690c84b4e9d30 + url + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmod-private/rev/221852/arch/Darwin/installer/fmod-3.75-darwin-20110222.tar.bz2 + + name + darwin + + linux + + archive + + hash + 0c61d643db54d2e5999be8254569d8b3 + url + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmod-private/rev/221852/arch/Linux/installer/fmod-3.75-linux-20110223.tar.bz2 + + name + linux + + windows + + archive + + hash + d9a9a6ad86895353bcd63374a4c1a91d + url + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmod-private/rev/221852/arch/CYGWIN/installer/fmod-3.75-windows-20110222.tar.bz2 + + name + windows + + + + fontconfig + + license + mit + license_file + LICENSES/fontconfig.txt + name + fontconfig + platforms + + linux + + archive + + hash + d8b08b657247566bde5fd853c7622478 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/fontconfig-2.8.0-linux-20110311.tar.bz2 + + name + linux + + + + freeglut + + license + mit + license_file + LICENSES/freeglut.txt + name + freeglut + platforms + + windows + + archive + + hash + 825d5a9bafcc5bfe28dc4c1c4f87c576 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-freeglut/rev/221064/arch/CYGWIN/installer/freeglut-2.6.0-windows-20110214.tar.bz2 + + name + windows + + + + freetype + + license + freetype + license_file + LICENSES/freetype.txt + name + freetype + platforms + + darwin + + archive + + hash + c0eacb6348e032fbc69cfdc4bd215ee4 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/freetype-2.4.4-darwin-20110307.tar.bz2 + + name + darwin + + linux + + archive + + hash + 9f8a9dc39fd7c3da0fb3533782d1fddf + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-freetype/rev/226814/arch/Linux/installer/freetype-2.3.9-linux-20110418.tar.bz2 + + name + linux + + windows + + archive + + hash + 271349827b939406162ce42e42cd18e0 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/freetype-2.4.4-windows-20110218.tar.bz2 + + name + windows + + + + glext + + license + glext + license_file + LICENSES/glext.txt + name + glext + platforms + + linux + + archive + + hash + 5de58ca0fe19abf68b25956762ee0d29 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/glext-68-windows-20110406.tar.bz2 + + name + linux + + windows + + archive + + hash + 5de58ca0fe19abf68b25956762ee0d29 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/glext-68-windows-20110406.tar.bz2 + + name + windows + + + + glh_linear + + license + glh_linear + license_file + LICENSES/glh_linear.txt + name + glh_linear + platforms + + darwin + + archive + + hash + 366f940f2634b0e05954646927620bfd + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/glh_linear-darwin-20101004.tar.bz2 + + name + darwin + + linux + + archive + + hash + 26f2df1f0b0fa01e94e0253e322f3583 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/glh_linear-linux-20101001.tar.bz2 + + name + linux + + windows + + archive + + hash + 57f8be28bbaa2505ae3b59deb2c77cdf + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/glh_linear-windows-20101011.tar.bz2 + + name + windows + + + + glui + + license + lgpl + license_file + LICENSES/glui.txt + name + glui + platforms + + darwin + + archive + + hash + bd2f84ef8bd308570e2e532a371dc2ef + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/glui-2.36-darwin-20110309.tar.bz2 + + name + darwin + + windows + + archive + + hash + e006635a741420a15f40bbdac13bd8d7 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/glui-2.36-windows-20110214.tar.bz2 + + name + windows + + + + google_breakpad + + license + bsd + license_file + LICENSES/google_breakpad.txt + name + google_breakpad + platforms + + darwin + + archive + + hash + 21babc394dbf8572830f2e85adec7b9f + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/google_breakpad-0.0.0-rev599-darwin-20110202.tar.bz2 + + name + darwin + + linux + + archive + + hash + 204b02a9480c411232255798839431a2 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/google_breakpad-0.0.0-rev599-linux-20110311.tar.bz2 + + name + linux + + windows + + archive + + hash + 627c51136e14e64c5d39933f3abd3bdf + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/google_breakpad-0.0.0-rev599-windows-20110218.tar.bz2 + + name + windows + + + + googlemock + + license + bsd + license_file + LICENSES/googlemock.txt + name + googlemock + platforms + + darwin + + archive + + hash + 886ee428f058005ab7f90f61784ec9d9 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/googlemock-1.1.0-darwin-20101004.tar.bz2 + + name + darwin + + linux + + archive + + hash + 782ca04e56d8eab755adcae297cafa7c + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/googlemock-1.1.0-linux-20101001.tar.bz2 + + name + linux + + windows + + archive + + hash + 212701468920519f3989677cea9ca4f1 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/gmock-1.5.0-windows-20110224.tar.bz2 + + name + windows + + + + gstreamer + + license + lgpl + license_file + LICENSES/gstreamer.txt + name + gstreamer + platforms + + linux + + archive + + hash + ddbc0a64ad788107877fee777403592c + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/gstreamer-linux-20101013.tar.bz2 + + name + linux + + + + gtk-atk-pango-glib + + license + lgpl + license_file + LICENSES/gtk-atk-pango-glib.txt + name + gtk-atk-pango-glib + platforms + + linux + + archive + + hash + 03694ade27f53199229c03cbbda89214 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/gtk-atk-pango-glib-linux-20101001.tar.bz2 + + name + linux + + windows + + archive + + hash + c257d718abdde8cfe8a0af26175161a7 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/gtk-atk-pango-glib-windows-20101001a.tar.bz2 + + name + windows + + + + havok-source + + license + havok-ares + license_file + LICENSES/havok.txt + name + havok-source + platforms + + darwin + + archive + + hash + e6feee3b452c2f70ce8558e30d6bc10a + url + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/lindenlab_3p-havok-source/rev/268409/arch/Darwin/installer/havok_source-2012.1-darwin-20121219.tar.bz2 + + name + darwin + + linux + + archive + + hash + 0c0d2058ba48446e274d6595d1d8063e + url + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/lindenlab_3p-havok-source/rev/268409/arch/Linux/installer/havok_source-2012.1-linux-20121219.tar.bz2 + + name + linux + + windows + + archive + + hash + 88391b6e08d473506d406ca6f3e88cfb + url + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/lindenlab_3p-havok-source/rev/268409/arch/CYGWIN/installer/havok_source-2012.1-windows-20121219.tar.bz2 + + name + windows + + + + jpeglib + + license + jpeglib + license_file + LICENSES/jpeglib.txt + name + jpeglib + platforms + + darwin + + archive + + hash + 71bd6efbf508e1f2e7d98a6195a93e9e + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/jpeglib-8c-darwin-20110228.tar.bz2 + + name + darwin + + linux + + archive + + hash + dcca1db348831cdb7c6b26dc4076c597 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-jpeglib/rev/224895/arch/Linux/installer/jpeglib-8c-linux-20110323.tar.bz2 + + name + linux + + windows + + archive + + hash + a202ec58cef9097c94acfa958ed6da8d + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/jpeglib-8c-windows-20110217.tar.bz2 + + name + windows + + + + jsoncpp + + license + jsoncpp + license_file + LICENSES/jsoncpp.txt + name + jsoncpp + platforms + + darwin + + archive + + hash + de8b96120c274e052abb4f692861be46 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/jsoncpp-0.5.0-darwin-20110131.tar.bz2 + + name + darwin + + linux + + archive + + hash + 840cd9455638c0ea52c613cfddd07d5b + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/jsoncpp-0.5.0-linux-20110315.tar.bz2 + + name + linux + + windows + + archive + + hash + afff2018e6a887c281b072eecdd9343e + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/jsoncpp-0.5.0-windows-20110208.tar.bz2 + + name + windows + + + + kdu + + license + kdu + license_file + LICENSES/kdu.txt + name + kdu + platforms + + darwin + + archive + + hash + a5b2dff0d97b643227a58473e5c57906 + url + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-kdu-private/rev/256978/arch/Darwin/installer/kdu-7.0.0-darwin-20120515.tar.bz2 + + name + darwin + + linux + + archive + + hash + fbf8a4f78dff986d7c16b3a0437e033e + url + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-kdu-private/rev/223538/arch/Linux/installer/kdu-6.4.1-linux-20110311.tar.bz2 + + name + linux + + windows + + archive + + hash + 6d80d35524e1c0c32d3385014d02d48c + url + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-kdu-private/rev/256978/arch/CYGWIN/installer/kdu-7.0.0-windows-20120515.tar.bz2 + + name + windows + + + + libhunspell + + license + libhunspell + license_file + LICENSES/hunspell.txt + name + libhunspell + platforms + + darwin + + archive + + hash + 6f5db0ef258df6e5c93c843ec559db6d + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-hunspell/rev/259874/arch/Darwin/installer/libhunspell-1.3.2-darwin-20120616.tar.bz2 + + name + darwin + + linux + + archive + + hash + 0c432d2626aea2e91a56335879c92965 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-hunspell/rev/259874/arch/Linux/installer/libhunspell-1.3.2-linux-20120616.tar.bz2 + + name + linux + + windows + + archive + + hash + 6a140e5620826aa5e587b4157f57b389 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-hunspell/rev/259874/arch/CYGWIN/installer/libhunspell-1.3.2-windows-20120616.tar.bz2 + + name + windows + + + + libpng + + license + libpng + license_file + LICENSES/libpng.txt + name + libpng + platforms + + darwin + + archive + + hash + 6fe1adf12d98bce9111f60ee762007b9 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/libpng-1.5.1-darwin-20110222.tar.bz2 + + name + darwin + + linux + + archive + + hash + 0681ab7e1988dfdbdad7dd9edb7760ee + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/libpng-1.5.1-linux-20110223.tar.bz2 + + name + linux + + windows + + archive + + hash + f194ba857ca8dd86483a3ef24535d0db + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-libpng/rev/226532/arch/CYGWIN/installer/libpng-1.5.1-windows-20110413.tar.bz2 + + name + windows + + + + libuuid + + license + lgpl + license_file + LICENSES/libuuid.txt + name + libuuid + platforms + + linux + + archive + + hash + 873e8e99d29711df2efa30646dca1795 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/uuid-1.6.2-linux-20110315.tar.bz2 + + name + linux + + + + libxml + + license + mit + license_file + LICENSES/libxml.txt + name + libxml + platforms + + linux + + archive + + hash + 6414642528f42dac1cd9a012c99cd748 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/libxml-2.6.24-linux-20101013.tar.bz2 + + name + linux + + + + llphysicsextensions_source + + license + TEMPORARY + license_file + LICENSES/llphysicsextensions.txt + name + llphysicsextensions_source + platforms + + darwin + + archive + + hash + 0578fa67ef9906c6aaa326f51db2669f + hash_algorithm + md5 + url + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions-source/rev/263415/arch/Darwin/installer/llphysicsextensions_source-0.3-darwin-20120814.tar.bz2 + + name + darwin + + linux + + archive + + hash + b706fdeed4ce2182d434043dc33d9d1d + url + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions-source/rev/263415/arch/Linux/installer/llphysicsextensions_source-0.3-linux-20120814.tar.bz2 + + name + linux + + windows + + archive + + hash + 0cebd359ea732a7db363d88f9886a1ef + url + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions-source/rev/263415/arch/CYGWIN/installer/llphysicsextensions_source-0.3-windows-20120814.tar.bz2 + + name + windows + + + version + 0.2 + + llphysicsextensions_stub + + license + TEMPORARY + license_file + LICENSES/llphysicsextensions.txt + name + llphysicsextensions_stub + platforms + + darwin + + archive + + hash + 3ae798d4dfb54a1d806ee5f8b31f7626 + hash_algorithm + md5 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llphysicsextensions-stub/rev/263415/arch/Darwin/installer/llphysicsextensions_stub-0.3-darwin-20120814.tar.bz2 + + name + darwin + + linux + + archive + + hash + aa8a2f25e8629cf5e6a96cc0eb93de8e + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llphysicsextensions-stub/rev/263415/arch/Linux/installer/llphysicsextensions_stub-0.3-linux-20120814.tar.bz2 + + name + linux + + windows + + archive + + hash + 3ea4cee6a8dd4c89fbfd3ad6abd703c2 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llphysicsextensions-stub/rev/263415/arch/CYGWIN/installer/llphysicsextensions_stub-0.3-windows-20120814.tar.bz2 + + name + windows + + + version + 0.2 + + llqtwebkit + + license + lgpl + license_file + LICENSES/llqtwebkit.txt + name + llqtwebkit + platforms + + darwin + + archive + + hash + 4a98d727561cd1f4ac5ee02907411df1 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/250147/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20120228.tar.bz2 + + name + darwin + + linux + + archive + + hash + f50e5f0cc880c55b3f0f7e67dc8f7221 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/250147/arch/Linux/installer/llqtwebkit-4.7.1-linux-20120228.tar.bz2 + + name + linux + + windows + + archive + + hash + 5e3cd6af397e853a963a6de40d440ff4 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/250147/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20120228.tar.bz2 + + name + windows + + + + mesa + + license + mesa + license_file + LICENSES/mesa.txt + name + mesa + platforms + + linux + + archive + + hash + 1f600840463c7327ea17486821425750 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/mesa-7.0-linux-20100930.tar.bz2 + + name + linux + + + + ndofdev + + license + linden + license_file + LICENSES/libndofdev.txt + name + ndofdev + platforms + + darwin + + archive + + hash + 674d37d2ba76a2df7f18c47bf50b5d03 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/libndofdev-0.1-darwin-20110308.tar.bz2 + + name + darwin + + linux + + archive + + hash + 9bf7a96c1d2fadb180fda91740c945c6 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-libndofdev-linux/rev/233137/arch/Linux/installer/libndofdev-0.3-linux-20110617.tar.bz2 + + name + linux + + windows + + archive + + hash + 3a4bec9562ed6ac53e85abcb1afc5fc0 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/libndofdev-0.1-windows-20110223.tar.bz2 + + name + windows + + + + nvapi + + license + NVAPI + license_file + LICENSES/NVAPI_SDK_License_Agreement.pdf + name + nvapi + platforms + + windows + + archive + + hash + baf519d36dffe4e4a59471450e391d01 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-nvapi/rev/267102/arch/CYGWIN/installer/nvapi-304-windows-20121116.tar.bz2 + + name + windows + + + + ogg-vorbis + + license + ogg-vorbis + license_file + LICENSES/ogg-vorbis.txt + name + ogg-vorbis + platforms + + darwin + + archive + + hash + e849bc2b779fb7cc5e81aeb021a542c0 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ogvorbis/rev/229529/arch/Darwin/installer/ogg_vorbis-1.2.2-1.3.2-darwin-20110510.tar.bz2 + + name + darwin + + linux + + archive + + hash + 71eaa462eb0bf8842277a3436483a354 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ogvorbis/rev/229529/arch/Linux/installer/ogg_vorbis-1.2.2-1.3.2-linux-20110511.tar.bz2 + + name + linux + + windows + + archive + + hash + 291dbba89dd8162b76f2c2d82e908c6f + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ogvorbis/rev/229529/arch/CYGWIN/installer/ogg_vorbis-1.2.2-1.3.2-windows-20110510.tar.bz2 + + name + windows + + + + openSSL + + license + openSSL + license_file + LICENSES/openssl.txt + name + openSSL + platforms + + darwin + + archive + + hash + 38ea083fe1204ee106b4d44d9811af19 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-openssl/rev/249044/arch/Darwin/installer/openssl-1.0.0g-darwin-20120207.tar.bz2 + + name + darwin + + linux + + archive + + hash + 7dc5191a3d95074a6ed3bd53f57420e5 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-openssl/rev/249044/arch/Linux/installer/openssl-1.0.0g-linux-20120207.tar.bz2 + + name + linux + + windows + + archive + + hash + ed6cbaf9860a03bc99ac301277f1452a + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-openssl/rev/249044/arch/CYGWIN/installer/openssl-1.0.0g-windows-20120207.tar.bz2 + + name + windows + + + + openal_soft + + license + lgpl + license_file + LICENSES/OPENAL.txt + name + openal_soft + platforms + + linux + + archive + + hash + fccdca18a950ac9363c6fb39118b80e1 + hash_algorithm + md5 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openal-3ad86a1c-linux-20110114.tar.bz2 + + name + linux + + windows + + archive + + hash + 04df406f3e5d04cf176660bdac66c3a1 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openal-1.12.854-1.1.0-windows-20110301.tar.bz2 + + name + windows + + + version + 3ad86a1c + + openjpeg + + license + openjpeg + license_file + LICENSES/openjpeg.txt + name + openjpeg + platforms + + darwin + + archive + + hash + 4be51c7cca7d84831e30b63279df7ae5 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openjpeg-1.4-darwin-20110302.tar.bz2 + + name + darwin + + linux + + archive + + hash + fb2382014c79e0049746e4e29bd834f9 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openjpeg-1.4-linux-20110314.tar.bz2 + + name + linux + + windows + + archive + + hash + ca5765af55f798724d601720afdf6953 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openjpeg-1.4-windows-20110302.tar.bz2 + + name + windows + + + + pcre + + license + bsd + license_file + LICENSES/pcre-license.txt + name + pcre + platforms + + darwin + + archive + + hash + a8e74694a0f4248228c13c845ed0a6f8 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-pcre/rev/228822/arch/Darwin/installer/pcre-7.6-darwin-20110504.tar.bz2 + + name + darwin + + linux + + archive + + hash + bb0abe962b3b8208ed2dab0424aab33d + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-pcre/rev/228822/arch/Linux/installer/pcre-7.6-linux-20110504.tar.bz2 + + name + linux + + + + quicktime + + license + quicktime + license_file + LICENSES/quicktime.txt + name + quicktime + platforms + + windows + + archive + + hash + 52e49ab6937b09882389da0dbaec17f5 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/quicktime-7.3-windows-20110127.tar.bz2 + + name + windows + + + + slvoice + + license + vivox + license_file + LICENSES/slvoice.txt + name + slvoice + platforms + + darwin + + archive + + hash + 24e735ae005f3ce7a21a09cc02cece17 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-slvoice/rev/231678/arch/Darwin/installer/slvoice-3.2.0002.10426-darwin-20110601.tar.bz2 + + name + darwin + + linux + + archive + + hash + 8a0bc982367d6fdc20a28b391cd40566 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-slvoice/rev/231678/arch/Linux/installer/slvoice-3.2.0002.10426-linux-20110601.tar.bz2 + + name + linux + + windows + + archive + + hash + 1e821cc7d25eabad013b7f3db260dd6b + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-slvoice/rev/231678/arch/CYGWIN/installer/slvoice-3.2.0002.10426-windows-20110601.tar.bz2 + + name + windows + + + + tcmalloc + + license + bsd + license_file + LICENSES/google-perftools.txt + name + tcmalloc + platforms + + linux + + archive + + hash + 8aedfdcf670348c18a9991ae1b384a61 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-perftools/rev/262672/arch/Linux/installer/gperftools-2.0-linux-20120727.tar.bz2 + + name + linux + + windows + + archive + + hash + f62841804acb91e1309603a84f3f0ce8 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-perftools/rev/262672/arch/CYGWIN/installer/gperftools-2.0-windows-20120727.tar.bz2 + + name + windows + + + + tut + + license + bsd + license_file + LICENSES/tut.txt + name + tut + platforms + + common + + archive + + hash + 5c6d3e606f027e78f056cb77b20f228e + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/tut-2008-11-30-common-20101001.tar.bz2 + + name + common + + + + xmlrpc-epi + + license + xmlrpc-epi + license_file + LICENSES/xmlrpc-epi.txt + name + xmlrpc-epi + platforms + + darwin + + archive + + hash + a3e0fb4b4a51b01690a99747a1cca531 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/xmlrpc_epi-0.54.1-darwin-20110307.tar.bz2 + + name + darwin + + linux + + archive + + hash + 174ab797440157956eda7061dae37564 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/xmlrpc_epi-0.54.1-linux-20110314.tar.bz2 + + name + linux + + windows + + archive + + hash + 5181d1a8f2516928ac064d72acf164a4 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/xmlrpc_epi-0.54.1-windows-20110224.tar.bz2 + + name + windows + + + + zlib + + license + zlib + license_file + LICENSES/zlib.txt + name + zlib + platforms + + darwin + + archive + + hash + 49b8de20f3bb43537f51311894a72de1 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/zlib-1.2.5-darwin-20110211.tar.bz2 + + name + darwin + + linux + + archive + + hash + 7b4cf3aa2c04937d0a20761516587896 + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-zlib/rev/223739/arch/Linux/installer/zlib-1.2.5-linux-20110314.tar.bz2 + + name + linux + + windows + + archive + + hash + 5852192646681817fc3c3a8c95e91c1e + url + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-zlib/rev/220983/arch/CYGWIN/installer/zlib-1.2.5-windows-20110211.tar.bz2 + + name + windows + + + + + package_description + + description + Spell checking dictionaries + license + various open + name + dictionaries + platforms + + common + + configurations + + Debug + + build + + + configure + + command + cmake + options + + -DCMAKE_BUILD_TYPE:STRING=Debug + -DWORD_SIZE:STRING=32 + -DROOT_PROJECT_NAME:STRING=SecondLife + -DINSTALL_PROPRIETARY=TRUE + + + name + Debug + + DebugOS + + configure + + arguments + + ../indra + + command + cmake + options + + -DCMAKE_BUILD_TYPE:STRING=Debug + -DWORD_SIZE:STRING=32 + -DROOT_PROJECT_NAME:STRING=SecondLife + -DINSTALL_PROPRIETARY=FALSE + + + name + DebugOS + + RelWithDebInfo + + build + + + configure + + command + cmake + options + + -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo + -DWORD_SIZE:STRING=32 + -DROOT_PROJECT_NAME:STRING=SecondLife + -DINSTALL_PROPRIETARY=TRUE + + + name + RelWithDebInfo + + RelWithDebInfoOS + + configure + + arguments + + ../indra + + command + cmake + options + + -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo + -DWORD_SIZE:STRING=32 + -DROOT_PROJECT_NAME:STRING=SecondLife + -DINSTALL_PROPRIETARY=FALSE + + + name + RelWithDebInfoOS + + Release + + build + + + configure + + command + cmake + options + + -DCMAKE_BUILD_TYPE:STRING=Release + -DWORD_SIZE:STRING=32 + -DROOT_PROJECT_NAME:STRING=SecondLife + -DINSTALL_PROPRIETARY=TRUE + + + name + Release + + ReleaseOS + + configure + + arguments + + ../indra + + command + cmake + options + + -DCMAKE_BUILD_TYPE:STRING=Release + -DWORD_SIZE:STRING=32 + -DROOT_PROJECT_NAME:STRING=SecondLife + -DINSTALL_PROPRIETARY=FALSE + + + name + ReleaseOS + + + name + common + + darwin + + build_directory + build-darwin-i386 + configurations + + Debug + + build + + command + xcodebuild + filters + + setenv + + options + + -configuration Debug + -project SecondLife.xcodeproj + + + configure + + arguments + + ../indra + + options + + -G + 'Xcode' + + + name + Debug + + DebugOS + + build + + command + xcodebuild + options + + -configuration Debug + -project SecondLife.xcodeproj + + + configure + + options + + -G + 'Xcode' + + + name + DebugOS + + RelWithDebInfo + + build + + command + xcodebuild + filters + + setenv + + options + + -configuration RelWithDebInfo + -project SecondLife.xcodeproj + + + configure + + arguments + + ../indra + + options + + -G + 'Xcode' + + + default + True + name + RelWithDebInfo + + RelWithDebInfoOS + + build + + command + xcodebuild + options + + -configuration RelWithDebInfo + -project SecondLife.xcodeproj + + + configure + + options + + -G + 'Xcode' + + + name + RelWithDebInfoOS + + Release + + build + + command + xcodebuild + filters + + setenv + + options + + -configuration Release + -project SecondLife.xcodeproj + -DENABLE_SIGNING:BOOL=YES + -DSIGNING_IDENTITY:STRING="Developer ID Application: Linden Research, Inc." + + + configure + + arguments + + ../indra + + options + + -G + 'Xcode' + + + name + Release + + ReleaseOS + + build + + command + xcodebuild + options + + -configuration Release + -project SecondLife.xcodeproj + -DENABLE_SIGNING:BOOL=YES + -DSIGNING_IDENTITY:STRING="Developer ID Application: Linden Research, Inc." + + + configure + + options + + -G + 'Xcode' + + + name + ReleaseOS + + + name + darwin + + linux + + build_directory + build-linux-i686 + configurations + + Debug + + build + + command + make + options + + -j 12 + + + configure + + arguments + + ../indra + + options + + -G + 'Unix Makefiles' + + + name + Debug + + DebugOS + + build + + command + make + options + + -j 2 + + + configure + + options + + -G + 'Unix Makefiles' + + + name + DebugOS + + RelWithDebInfo + + build + + command + make + options + + -j 12 + + + configure + + arguments + + ../indra + + options + + -G + 'Unix Makefiles' + + + default + True + name + RelWithDebInfo + + RelWithDebInfoOS + + build + + command + make + options + + -j 2 + + + configure + + options + + -G + 'Unix Makefiles' + + + name + RelWithDebInfoOS + + Release + + build + + command + make + options + + -j 12 + + + configure + + arguments + + ../indra + + options + + -G + 'Unix Makefiles' + + + name + Release + + ReleaseOS + + build + + command + make + options + + -j 2 + + + configure + + options + + -G + 'Unix Makefiles' + + + name + ReleaseOS + + default + + build + + + name + default + + + name + linux + + windows + + build_directory + build-vc100 + configurations + + Debug + + build + + arguments + + SecondLife.sln + + command + BuildConsole + options + + /build + "/cfg=Debug|Win32" + + + configure + + arguments + + ..\indra + && + ..\indra\tools\vstool\VSTool.exe + --solution + SecondLife.sln + --config + Debug + --startup + secondlife-bin + + options + + -G + "Visual Studio 10" + + + name + Debug + + DebugOS + + build + + arguments + + SecondLife.sln + + command + msbuild.exe + options + + /p:Configuration=Debug + /p:Platform=Win32 + /t:Build + /p:useenv=true + /verbosity:minimal + /toolsversion:4.0 + /p:"VCBuildAdditionalOptions= /incremental" + + + configure + + arguments + + ..\indra + && + ..\indra\tools\vstool\VSTool.exe + --solution + SecondLife.sln + --config + Debug + --startup + secondlife-bin + + options + + -G + "Visual Studio 10" + -DUNATTENDED:BOOL=ON + -DUSE_KDU=FALSE + -DFMOD=FALSE + + + name + DebugOS + + RelWithDebInfo + + build + + arguments + + SecondLife.sln + + command + BuildConsole + options + + /build + "/cfg=RelWithDebInfo|Win32" + + + configure + + arguments + + ..\indra + && + ..\indra\tools\vstool\VSTool.exe + --solution + SecondLife.sln + --config + RelWithDebInfo + --startup + secondlife-bin + + options + + -G + "Visual Studio 10" + + + default + True + name + RelWithDebInfo + + RelWithDebInfoOS + + build + + arguments + + SecondLife.sln + + command + msbuild.exe + options + + /p:Configuration=RelWithDebInfo + /p:Platform=Win32 + /t:Build + /p:useenv=true + /verbosity:minimal + /toolsversion:4.0 + /p:"VCBuildAdditionalOptions= /incremental" + + + configure + + arguments + + ..\indra + && + ..\indra\tools\vstool\VSTool.exe + --solution + SecondLife.sln + --config + RelWithDebInfo + --startup + secondlife-bin + + options + + -G + "Visual Studio 10" + -DUNATTENDED:BOOL=ON + -DINSTALL_PROPRIETARY=FALSE + -DUSE_KDU=FALSE + -DFMOD=FALSE + + + name + RelWithDebInfoOS + + Release + + build + + arguments + + SecondLife.sln + + command + BuildConsole + options + + /build + "/cfg=Release|Win32" + "/CL_ADD=/m:1" + + + configure + + arguments + + ..\indra + && + ..\indra\tools\vstool\VSTool.exe + --solution + SecondLife.sln + --config + Release + --startup + secondlife-bin + + options + + -G + "Visual Studio 10" + + + name + Release + + ReleaseOS + + build + + arguments + + SecondLife.sln + + command + msbuild.exe + options + + /p:Configuration=Release + /p:Platform=Win32 + /t:Build + /p:useenv=true + /verbosity:minimal + /toolsversion:4.0 + /p:"VCBuildAdditionalOptions= /incremental" + + + configure + + arguments + + ..\indra + && + ..\indra\tools\vstool\VSTool.exe + --solution + SecondLife.sln + --config + Release + --startup + secondlife-bin + + options + + -G + "Visual Studio 10" + -DUNATTENDED:BOOL=ON + -DINSTALL_PROPRIETARY=FALSE + -DUSE_KDU=FALSE + -DFMOD=FALSE + + + name + ReleaseOS + + + name + windows + + + version + 1.0 + + type + autobuild + version + 1.2 + + -- cgit v1.2.3 From 5616d198bdace981c0d284d000eddd815d4c7491 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham)" Date: Mon, 11 Mar 2013 09:55:33 -0700 Subject: Fix missing eol at eof in llinstancetracker.cpp tripping up linux build --- indra/llcommon/llinstancetracker.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/llcommon/llinstancetracker.cpp b/indra/llcommon/llinstancetracker.cpp index 0804be358f..65ef4322f6 100644 --- a/indra/llcommon/llinstancetracker.cpp +++ b/indra/llcommon/llinstancetracker.cpp @@ -42,4 +42,5 @@ void * & LLInstanceTrackerBase::getInstances(InstanceTrackType t) // key DOES exist, insert() simply returns (iterator, false). One lookup // handles both cases. return sInstanceTrackerData[t]; -} \ No newline at end of file +} + -- cgit v1.2.3 From 8c1e635317caebbb5532bc0a4dadf0f4a30f737b Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham)" Date: Mon, 11 Mar 2013 10:12:10 -0700 Subject: Fix missing eol at eof in llstaticstringtable.h breaking linux build --- indra/llcommon/llstaticstringtable.h | 163 ++++++++++++++++++----------------- 1 file changed, 82 insertions(+), 81 deletions(-) diff --git a/indra/llcommon/llstaticstringtable.h b/indra/llcommon/llstaticstringtable.h index 05b0848e30..52049b0921 100644 --- a/indra/llcommon/llstaticstringtable.h +++ b/indra/llcommon/llstaticstringtable.h @@ -1,81 +1,82 @@ -/** - * @file llstringtable.h - * @brief The LLStringTable class provides a _fast_ method for finding - * unique copies of strings. - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_STATIC_STRING_TABLE_H -#define LL_STATIC_STRING_TABLE_H - -#include "lldefs.h" -#include -#include "llstl.h" - -class LLStaticHashedString -{ -public: - - LLStaticHashedString(const std::string& s) - { - string_hash = makehash(s); - string = s; - } - - const std::string& String() const { return string; } - size_t Hash() const { return string_hash; } - - bool operator==(const LLStaticHashedString& b) const { return Hash() == b.Hash(); } - -protected: - - size_t makehash(const std::string& s) - { - size_t len = s.size(); - const char* c = s.c_str(); - size_t hashval = 0; - for (size_t i=0; i -class LL_COMMON_API LLStaticStringTable - : public boost::unordered_map< LLStaticHashedString, MappedObject, LLStaticStringHasher > -{ -}; - -#endif \ No newline at end of file +/** + * @file llstringtable.h + * @brief The LLStringTable class provides a _fast_ method for finding + * unique copies of strings. + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_STATIC_STRING_TABLE_H +#define LL_STATIC_STRING_TABLE_H + +#include "lldefs.h" +#include +#include "llstl.h" + +class LLStaticHashedString +{ +public: + + LLStaticHashedString(const std::string& s) + { + string_hash = makehash(s); + string = s; + } + + const std::string& String() const { return string; } + size_t Hash() const { return string_hash; } + + bool operator==(const LLStaticHashedString& b) const { return Hash() == b.Hash(); } + +protected: + + size_t makehash(const std::string& s) + { + size_t len = s.size(); + const char* c = s.c_str(); + size_t hashval = 0; + for (size_t i=0; i +class LL_COMMON_API LLStaticStringTable + : public boost::unordered_map< LLStaticHashedString, MappedObject, LLStaticStringHasher > +{ +}; + +#endif + -- cgit v1.2.3 From c04f4f66c813181eb378b00045aec969dc2c4aae Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Mon, 11 Mar 2013 12:30:16 -0700 Subject: Moved LLAlignedArray from llmath to llcommon and put template func impls in header to work around Mac 4.3.3 link issue. --- indra/llcommon/CMakeLists.txt | 1 + indra/llmath/llvolume.cpp | 87 ------------------------------------------- indra/llmath/llvolume.h | 21 +---------- 3 files changed, 2 insertions(+), 107 deletions(-) diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index e019c17280..0c2ceebb52 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -121,6 +121,7 @@ set(llcommon_HEADER_FILES linden_common.h linked_lists.h llaccountingcost.h + llalignedarray.h llallocator.h llallocator_heap_profile.h llagentconstants.h diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 9fc72fd801..4f3e753276 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -96,93 +96,6 @@ extern BOOL gDebugGL; bool less_than_max_mag(const LLVector4a& vec); -template -LLAlignedArray::LLAlignedArray() -{ - mArray = NULL; - mElementCount = 0; - mCapacity = 0; -} - -template -LLAlignedArray::~LLAlignedArray() -{ - ll_aligned_free(mArray); - mArray = NULL; - mElementCount = 0; - mCapacity = 0; -} - -template -void LLAlignedArray::push_back(const T& elem) -{ - T* old_buf = NULL; - if (mCapacity <= mElementCount) - { - mCapacity++; - mCapacity *= 2; - T* new_buf = (T*) ll_aligned_malloc(mCapacity*sizeof(T), alignment); - if (mArray) - { - LLVector4a::memcpyNonAliased16((F32*) new_buf, (F32*) mArray, sizeof(T)*mElementCount); - } - old_buf = mArray; - mArray = new_buf; - } - - mArray[mElementCount++] = elem; - - //delete old array here to prevent error on a.push_back(a[0]) - ll_aligned_free(old_buf); -} - -template -void LLAlignedArray::resize(U32 size) -{ - if (mCapacity < size) - { - mCapacity = size+mCapacity*2; - T* new_buf = mCapacity > 0 ? (T*) ll_aligned_malloc(mCapacity*sizeof(T), alignment) : NULL; - if (mArray) - { - LLVector4a::memcpyNonAliased16((F32*) new_buf, (F32*) mArray, sizeof(T)*mElementCount); - ll_aligned_free(mArray); - } - - /*for (U32 i = mElementCount; i < mCapacity; ++i) - { - new(new_buf+i) T(); - }*/ - mArray = new_buf; - } - - mElementCount = size; -} - - -template -T& LLAlignedArray::operator[](int idx) -{ - llassert(idx < mElementCount); - return mArray[idx]; -} - -template -const T& LLAlignedArray::operator[](int idx) const -{ - llassert(idx < mElementCount); - return mArray[idx]; -} - -template -T* LLAlignedArray::append(S32 N) -{ - U32 sz = size(); - resize(sz+N); - return &((*this)[sz]); -} - - BOOL check_same_clock_dir( const LLVector3& pt1, const LLVector3& pt2, const LLVector3& pt3, const LLVector3& norm) { LLVector3 test = (pt2-pt1)%(pt3-pt2); diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index 5e43af92ec..1ff53590cf 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -41,6 +41,7 @@ class LLVolumeFace; class LLVolume; class LLVolumeTriangle; +#include "llalignedarray.h" #include "lldarray.h" #include "lluuid.h" #include "v4color.h" @@ -195,26 +196,6 @@ const U8 LL_SCULPT_FLAG_MIRROR = 128; const S32 LL_SCULPT_MESH_MAX_FACES = 8; -template -class LLAlignedArray -{ -public: - T* mArray; - U32 mElementCount; - U32 mCapacity; - - LLAlignedArray(); - ~LLAlignedArray(); - - void push_back(const T& elem); - U32 size() const { return mElementCount; } - void resize(U32 size); - T* append(S32 N); - T& operator[](int idx); - const T& operator[](int idx) const; -}; - - class LLProfileParams { public: -- cgit v1.2.3 From 356d10e6a6cfea279228f371aed88aba73ed70dd Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Mon, 11 Mar 2013 13:12:03 -0700 Subject: Work around 'interesting' forced include order in vmath stuff on Windows --- indra/llmath/llvolume.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index 1ff53590cf..6b599a4126 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -41,7 +41,6 @@ class LLVolumeFace; class LLVolume; class LLVolumeTriangle; -#include "llalignedarray.h" #include "lldarray.h" #include "lluuid.h" #include "v4color.h" @@ -58,6 +57,7 @@ class LLVolumeTriangle; #include "llrefcount.h" #include "llpointer.h" #include "llfile.h" +#include "llalignedarray.h" //============================================================================ -- cgit v1.2.3 From 9a0f913e7089c9b2120856936bf47dcb8de9c6b1 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham)" Date: Mon, 11 Mar 2013 13:55:40 -0700 Subject: Work around bogus gcc 4.3.4 warning from alignment assert --- indra/llmath/llvector4a.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indra/llmath/llvector4a.h b/indra/llmath/llvector4a.h index 0526793d3a..1a478bc8de 100644 --- a/indra/llmath/llvector4a.h +++ b/indra/llmath/llvector4a.h @@ -93,7 +93,11 @@ public: LLVector4a() { //DO NOT INITIALIZE -- The overhead is completely unnecessary +// This assert is causing spurious referenced before set warnings on GCC 4.3.4 +// +#if !LL_LINUX ll_assert_aligned(this,16); +#endif } LLVector4a(F32 x, F32 y, F32 z, F32 w = 0.f) -- cgit v1.2.3 From 6ac6736994240d9789a81bf585468bef50805fd8 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Mon, 11 Mar 2013 16:00:25 -0700 Subject: Move 16b aligned memcpy and alignment utilities to llmem in llcommon for easier use elsewhere --- indra/llcommon/llalignedarray.h | 16 +------ indra/llcommon/llmemory.h | 102 +++++++++++++++++++++++++++++++++++++--- indra/llmath/llsimdmath.h | 28 ----------- indra/llmath/llvector4a.cpp | 50 +------------------- 4 files changed, 99 insertions(+), 97 deletions(-) diff --git a/indra/llcommon/llalignedarray.h b/indra/llcommon/llalignedarray.h index 5e04e8050f..ed8fd31205 100644 --- a/indra/llcommon/llalignedarray.h +++ b/indra/llcommon/llalignedarray.h @@ -29,10 +29,6 @@ #include "llmemory.h" -#if LL_WINDOWS -#include "llvector4a.h" // for 16b fast copy -#endif - template class LLAlignedArray { @@ -81,11 +77,7 @@ void LLAlignedArray::push_back(const T& elem) T* new_buf = (T*) ll_aligned_malloc(mCapacity*sizeof(T), alignment); if (mArray) { -#if LL_WINDOWS - LLVector4a::memcpyNonAliased16((F32*) new_buf, (F32*) mArray, sizeof(T)*mElementCount); -#else - memcpy((F32*)new_buf, (F32*)mArray, sizeof(T)*mElementCount); -#endif + ll_memcpy_nonaliased_aligned_16((char*)new_buf, (char*)mArray, sizeof(T)*mElementCount); } old_buf = mArray; mArray = new_buf; @@ -106,11 +98,7 @@ void LLAlignedArray::resize(U32 size) T* new_buf = mCapacity > 0 ? (T*) ll_aligned_malloc(mCapacity*sizeof(T), alignment) : NULL; if (mArray) { -#if LL_WINDOWS - LLVector4a::memcpyNonAliased16((F32*) new_buf, (F32*) mArray, sizeof(T)*mElementCount); -#else - memcpy((F32*) new_buf, (F32*) mArray, sizeof(T)*mElementCount); -#endif + ll_memcpy_nonaliased_aligned_16((char*) new_buf, (char*) mArray, sizeof(T)*mElementCount); ll_aligned_free(mArray); } diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index 46cabfadcd..4938775e2b 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -36,6 +36,44 @@ class LLMutex ; #define LL_CHECK_MEMORY #endif +LL_COMMON_API void ll_assert_aligned_func(uintptr_t ptr,U32 alignment); + +#ifdef SHOW_ASSERT +#define ll_assert_aligned(ptr,alignment) ll_assert_aligned_func(reinterpret_cast(ptr),((U32)alignment)) +#else +#define ll_assert_aligned(ptr,alignment) +#endif + +#include + +template T* LL_NEXT_ALIGNED_ADDRESS(T* address) +{ + return reinterpret_cast( + (reinterpret_cast(address) + 0xF) & ~0xF); +} + +template T* LL_NEXT_ALIGNED_ADDRESS_64(T* address) +{ + return reinterpret_cast( + (reinterpret_cast(address) + 0x3F) & ~0x3F); +} + +#if LL_LINUX || LL_DARWIN + +#define LL_ALIGN_PREFIX(x) +#define LL_ALIGN_POSTFIX(x) __attribute__((aligned(x))) + +#elif LL_WINDOWS + +#define LL_ALIGN_PREFIX(x) __declspec(align(x)) +#define LL_ALIGN_POSTFIX(x) + +#else +#error "LL_ALIGN_PREFIX and LL_ALIGN_POSTFIX undefined" +#endif + +#define LL_ALIGN_16(var) LL_ALIGN_PREFIX(16) var LL_ALIGN_POSTFIX(16) + inline void* ll_aligned_malloc( size_t size, int align ) { #if defined(LL_WINDOWS) @@ -144,6 +182,64 @@ inline void ll_aligned_free_32(void *p) #endif } + +// Copy words 16-byte blocks from src to dst. Source and destination MUST NOT OVERLAP. +// Source and dest must be 16-byte aligned and size must be multiple of 16. +// +inline void ll_memcpy_nonaliased_aligned_16(char* __restrict dst, const char* __restrict src, size_t bytes) +{ + assert(src != NULL); + assert(dst != NULL); + assert(bytes > 0); + assert((bytes % sizeof(F32))== 0); + ll_assert_aligned(src,16); + ll_assert_aligned(dst,16); + assert((src < dst) ? ((src + bytes) < dst) : ((dst + bytes) < src)); + assert(bytes%16==0); + + char* end = dst + bytes; + + if (bytes > 64) + { + void* begin_64 = LL_NEXT_ALIGNED_ADDRESS_64(dst); + + //at least 64 bytes before the end of the destination, switch to 16 byte copies + void* end_64 = end-64; + + _mm_prefetch((char*)begin_64, _MM_HINT_NTA); + _mm_prefetch((char*)begin_64 + 64, _MM_HINT_NTA); + _mm_prefetch((char*)begin_64 + 128, _MM_HINT_NTA); + _mm_prefetch((char*)begin_64 + 192, _MM_HINT_NTA); + + while (dst < begin_64) + { + + _mm_store_ps((F32*)dst, _mm_load_ps((F32*)src)); + dst += 4; + src += 4; + } + + while (dst < end_64) + { + _mm_prefetch((char*)src + 512, _MM_HINT_NTA); + _mm_prefetch((char*)dst + 512, _MM_HINT_NTA); + _mm_store_ps((F32*)dst, _mm_load_ps((F32*)src)); + _mm_store_ps((F32*)(dst + 16), _mm_load_ps((F32*)(src + 16))); + _mm_store_ps((F32*)(dst + 32), _mm_load_ps((F32*)(src + 32))); + _mm_store_ps((F32*)(dst + 48), _mm_load_ps((F32*)(src + 48))); + dst += 64; + src += 64; + } + } + + while (dst < end) + { + _mm_store_ps((F32*)dst, _mm_load_ps((F32*)src)); + dst += 16; + src += 16; + } +} + #ifndef __DEBUG_PRIVATE_MEM__ #define __DEBUG_PRIVATE_MEM__ 0 #endif @@ -552,13 +648,7 @@ void LLPrivateMemoryPoolTester::operator delete[](void* addr) // LLSingleton moved to llsingleton.h -LL_COMMON_API void ll_assert_aligned_func(uintptr_t ptr,U32 alignment); -#ifdef SHOW_ASSERT -#define ll_assert_aligned(ptr,alignment) ll_assert_aligned_func(reinterpret_cast(ptr),((U32)alignment)) -#else -#define ll_assert_aligned(ptr,alignment) -#endif #endif diff --git a/indra/llmath/llsimdmath.h b/indra/llmath/llsimdmath.h index 01458521ec..cebd2ace7d 100644 --- a/indra/llmath/llsimdmath.h +++ b/indra/llmath/llsimdmath.h @@ -39,34 +39,6 @@ #include #endif -template T* LL_NEXT_ALIGNED_ADDRESS(T* address) -{ - return reinterpret_cast( - (reinterpret_cast(address) + 0xF) & ~0xF); -} - -template T* LL_NEXT_ALIGNED_ADDRESS_64(T* address) -{ - return reinterpret_cast( - (reinterpret_cast(address) + 0x3F) & ~0x3F); -} - -#if LL_LINUX || LL_DARWIN - -#define LL_ALIGN_PREFIX(x) -#define LL_ALIGN_POSTFIX(x) __attribute__((aligned(x))) - -#elif LL_WINDOWS - -#define LL_ALIGN_PREFIX(x) __declspec(align(x)) -#define LL_ALIGN_POSTFIX(x) - -#else -#error "LL_ALIGN_PREFIX and LL_ALIGN_POSTFIX undefined" -#endif - -#define LL_ALIGN_16(var) LL_ALIGN_PREFIX(16) var LL_ALIGN_POSTFIX(16) - #include #include diff --git a/indra/llmath/llvector4a.cpp b/indra/llmath/llvector4a.cpp index 6edeb0fefe..570fa41a43 100644 --- a/indra/llmath/llvector4a.cpp +++ b/indra/llmath/llvector4a.cpp @@ -41,55 +41,7 @@ extern const LLVector4a LL_V4A_EPSILON = reinterpret_cast ( F /*static */void LLVector4a::memcpyNonAliased16(F32* __restrict dst, const F32* __restrict src, size_t bytes) { - assert(src != NULL); - assert(dst != NULL); - assert(bytes > 0); - assert((bytes % sizeof(F32))== 0); - ll_assert_aligned(src,16); - ll_assert_aligned(dst,16); - assert(bytes%16==0); - - F32* end = dst + (bytes / sizeof(F32) ); - - if (bytes > 64) - { - F32* begin_64 = LL_NEXT_ALIGNED_ADDRESS_64(dst); - - //at least 64 (16*4) bytes before the end of the destination, switch to 16 byte copies - F32* end_64 = end-16; - - _mm_prefetch((char*)begin_64, _MM_HINT_NTA); - _mm_prefetch((char*)begin_64 + 64, _MM_HINT_NTA); - _mm_prefetch((char*)begin_64 + 128, _MM_HINT_NTA); - _mm_prefetch((char*)begin_64 + 192, _MM_HINT_NTA); - - while (dst < begin_64) - { - copy4a(dst, src); - dst += 4; - src += 4; - } - - while (dst < end_64) - { - _mm_prefetch((char*)src + 512, _MM_HINT_NTA); - _mm_prefetch((char*)dst + 512, _MM_HINT_NTA); - copy4a(dst, src); - copy4a(dst+4, src+4); - copy4a(dst+8, src+8); - copy4a(dst+12, src+12); - - dst += 16; - src += 16; - } - } - - while (dst < end) - { - copy4a(dst, src); - dst += 4; - src += 4; - } + ll_memcpy_nonaliased_aligned_16((char*)dst, (char*)src, bytes); } void LLVector4a::setRotated( const LLRotation& rot, const LLVector4a& vec ) -- cgit v1.2.3 From 6613d80d72931b13cc008c3dcc8ee90a39bec8f5 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Mon, 11 Mar 2013 14:19:05 -0700 Subject: Clean up moving llalignedarray and fast memcpy to llcommon --- indra/llcommon/llmemory.h | 24 +++++++++++++++++++----- indra/newview/llface.cpp | 3 +++ indra/newview/llpolymesh.cpp | 26 ++++++++++++++++++++------ 3 files changed, 42 insertions(+), 11 deletions(-) diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index 4938775e2b..61e30f11cc 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -201,24 +201,36 @@ inline void ll_memcpy_nonaliased_aligned_16(char* __restrict dst, const char* __ if (bytes > 64) { + + // Find start of 64b aligned area within block + // void* begin_64 = LL_NEXT_ALIGNED_ADDRESS_64(dst); //at least 64 bytes before the end of the destination, switch to 16 byte copies void* end_64 = end-64; - + + // Prefetch the head of the 64b area now + // _mm_prefetch((char*)begin_64, _MM_HINT_NTA); _mm_prefetch((char*)begin_64 + 64, _MM_HINT_NTA); _mm_prefetch((char*)begin_64 + 128, _MM_HINT_NTA); _mm_prefetch((char*)begin_64 + 192, _MM_HINT_NTA); - + + // Copy 16b chunks until we're 64b aligned + // while (dst < begin_64) { _mm_store_ps((F32*)dst, _mm_load_ps((F32*)src)); - dst += 4; - src += 4; + dst += 16; + src += 16; } - + + // Copy 64b chunks up to your tail + // + // might be good to shmoo the 512b prefetch offset + // (characterize performance for various values) + // while (dst < end_64) { _mm_prefetch((char*)src + 512, _MM_HINT_NTA); @@ -232,6 +244,8 @@ inline void ll_memcpy_nonaliased_aligned_16(char* __restrict dst, const char* __ } } + // Copy remainder 16b tail chunks (or ALL 16b chunks for sub-64b copies) + // while (dst < end) { _mm_store_ps((F32*)dst, _mm_load_ps((F32*)src)); diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 86e5f20812..5f86205175 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -64,6 +64,8 @@ BOOL LLFace::sSafeRenderSelect = TRUE; // FALSE #define DOTVEC(a,b) (a.mV[0]*b.mV[0] + a.mV[1]*b.mV[1] + a.mV[2]*b.mV[2]) +//#pragma GCC diagnostic ignored "-Wuninitialized" + /* For each vertex, given: B - binormal @@ -1982,6 +1984,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, //_mm_prefetch((char*)dst, _MM_HINT_NTA); + LLVector4a res0; //,res1,res2,res3; LLVector4a texIdx; diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp index 5f5258bbce..916f3d8e06 100644 --- a/indra/newview/llpolymesh.cpp +++ b/indra/newview/llpolymesh.cpp @@ -983,12 +983,26 @@ LLVector4a *LLPolyMesh::getScaledBinormals() //----------------------------------------------------------------------------- void LLPolyMesh::initializeForMorph() { - LLVector4a::memcpyNonAliased16((F32*) mCoords, (F32*) mSharedData->mBaseCoords, sizeof(LLVector4a) * mSharedData->mNumVertices); - LLVector4a::memcpyNonAliased16((F32*) mNormals, (F32*) mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices); - LLVector4a::memcpyNonAliased16((F32*) mScaledNormals, (F32*) mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices); - LLVector4a::memcpyNonAliased16((F32*) mBinormals, (F32*) mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices); - LLVector4a::memcpyNonAliased16((F32*) mScaledBinormals, (F32*) mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices); - LLVector4a::memcpyNonAliased16((F32*) mTexCoords, (F32*) mSharedData->mTexCoords, sizeof(LLVector2) * (mSharedData->mNumVertices + mSharedData->mNumVertices%2)); + // Must insure that src and dst of copies below + // are actually 16b aligned...the 16b mod 0 size + // is assumed from the data being LLVector4a + // + ll_assert_aligned(mCoords,16); + ll_assert_aligned(mNormals,16); + ll_assert_aligned(mScaledNormals,16); + ll_assert_aligned(mBinormals,16); + ll_assert_aligned(mScaledBinormals,16); + ll_assert_aligned(mTexCoords,16); + ll_assert_aligned(mSharedData->mBaseCoords,16); + ll_assert_aligned(mSharedData->mBaseNormals,16); + ll_assert_aligned(mSharedData->mTexCoords,16); + + ll_memcpy_nonaliased_aligned_16((char*)mCoords, (char*)mSharedData->mBaseCoords, sizeof(LLVector4a) * mSharedData->mNumVertices); + ll_memcpy_nonaliased_aligned_16((char*)mNormals, (char*)mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices); + ll_memcpy_nonaliased_aligned_16((char*)mScaledNormals, (char*)mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices); + ll_memcpy_nonaliased_aligned_16((char*)mBinormals, (char*)mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices); + ll_memcpy_nonaliased_aligned_16((char*)mScaledBinormals, (char*)mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices); + ll_memcpy_nonaliased_aligned_16((char*)mTexCoords, (char*)mSharedData->mTexCoords, sizeof(LLVector2) * (mSharedData->mNumVertices + mSharedData->mNumVertices%2)); for (U32 i = 0; i < mSharedData->mNumVertices; ++i) { -- cgit v1.2.3 From 352138a8486623575ee015c89f3263103b30bef4 Mon Sep 17 00:00:00 2001 From: Cho Date: Tue, 12 Mar 2013 00:56:51 +0100 Subject: ACME-99 FIX Populate the FB tab friends list with FB data --- indra/newview/llpanelpeople.cpp | 93 +++++++++++++++++++++- indra/newview/llpanelpeople.h | 5 ++ .../newview/skins/default/xui/en/panel_people.xml | 19 ++--- 3 files changed, 104 insertions(+), 13 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 85f54b06eb..491b8dd7c5 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -64,9 +64,11 @@ #include "llvoiceclient.h" #include "llworld.h" #include "llspeakers.h" +#include "llfloaterwebcontent.h" #define FRIEND_LIST_UPDATE_TIMEOUT 0.5 #define NEARBY_LIST_UPDATE_INTERVAL 1 +#define FBCTEST_LIST_UPDATE_INTERVAL 0.25 static const std::string NEARBY_TAB_NAME = "nearby_panel"; static const std::string FRIENDS_TAB_NAME = "friends_panel"; @@ -489,6 +491,45 @@ public: } }; +/** + * Periodically updates the FBC test list after a login is initiated. + * + * The period is defined by FBCTEST_LIST_UPDATE_INTERVAL constant. + */ +class LLFbcTestListUpdater : public LLAvatarListUpdater +{ + LOG_CLASS(LLFbcTestListUpdater); + +public: + LLFbcTestListUpdater(callback_t cb) + : LLAvatarListUpdater(cb, FBCTEST_LIST_UPDATE_INTERVAL) + { + setActive(false); + } + + /*virtual*/ void setActive(bool val) + { + if (val) + { + // update immediately and start regular updates + update(); + mEventTimer.start(); + } + else + { + // stop regular updates + mEventTimer.stop(); + } + } + + /*virtual*/ BOOL tick() + { + update(); + return FALSE; + } +private: +}; + //============================================================================= LLPanelPeople::LLPanelPeople() @@ -502,6 +543,7 @@ LLPanelPeople::LLPanelPeople() mNearbyList(NULL), mRecentList(NULL), mGroupList(NULL), + mFbcTestText(NULL), mNearbyGearButton(NULL), mFriendsGearButton(NULL), mGroupsGearButton(NULL), @@ -511,6 +553,7 @@ LLPanelPeople::LLPanelPeople() mFriendListUpdater = new LLFriendListUpdater(boost::bind(&LLPanelPeople::updateFriendList, this)); mNearbyListUpdater = new LLNearbyListUpdater(boost::bind(&LLPanelPeople::updateNearbyList, this)); mRecentListUpdater = new LLRecentListUpdater(boost::bind(&LLPanelPeople::updateRecentList, this)); + mFbcTestListUpdater = new LLFbcTestListUpdater(boost::bind(&LLPanelPeople::updateFbcTestList, this)); mButtonsUpdater = new LLButtonsUpdater(boost::bind(&LLPanelPeople::updateButtons, this)); mCommitCallbackRegistrar.add("People.addFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this)); mCommitCallbackRegistrar.add("People.loginFBC", boost::bind(&LLPanelPeople::onLoginFbcButtonClicked, this)); @@ -522,6 +565,7 @@ LLPanelPeople::~LLPanelPeople() delete mNearbyListUpdater; delete mFriendListUpdater; delete mRecentListUpdater; + delete mFbcTestListUpdater; if(LLVoiceClient::instanceExists()) { @@ -533,7 +577,7 @@ LLPanelPeople::~LLPanelPeople() if (mNearbyViewSortMenuHandle.get()) mNearbyViewSortMenuHandle.get()->die(); if (mGroupsViewSortMenuHandle.get()) mGroupsViewSortMenuHandle.get()->die(); if (mRecentViewSortMenuHandle.get()) mRecentViewSortMenuHandle.get()->die(); - + if (mFbcTestBrowserHandle.get()) mFbcTestBrowserHandle.get()->die(); } void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LLSD& param, LLAvatarList* avatar_list) @@ -598,6 +642,8 @@ BOOL LLPanelPeople::postBuild() mRecentList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu); mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu); mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu); + + mFbcTestText = getChild(FBCTEST_TAB_NAME)->getChild("fbctest_label"); setSortOrder(mRecentList, (ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"), false); setSortOrder(mAllFriendList, (ESortOrder)gSavedSettings.getU32("FriendsSortOrder"), false); @@ -823,6 +869,40 @@ void LLPanelPeople::updateRecentList() mRecentList->setDirty(); } +void LLPanelPeople::updateFbcTestList() +{ + if (!mFbcTestText) + return; + + if (mFbcTestBrowserHandle.get()) + { + // get the browser data (from the title bar, of course!) + std::string title = mFbcTestBrowserHandle.get()->getTitle(); + + // if the data is ready (if it says the magic word) + if (title.length() > 8 && title.substr(0, 8) == "FBCTEST ") + { + // get the list of friends' names from the title bar + std::vector names = LLStringUtil::getTokens(title.substr(8), ","); + + // display the names in the list + std::string label; + for (std::vector::const_iterator i = names.begin() + 1; i != names.end(); ++i) + { + label += *i; + label += "\n"; + } + mFbcTestText->setText(label); + + // close the browser window + mFbcTestBrowserHandle.get()->die(); + + // stop updating + mFbcTestListUpdater->setActive(false); + } + } +} + void LLPanelPeople::buttonSetVisible(std::string btn_name, BOOL visible) { // To make sure we're referencing the right widget (a child of the button bar). @@ -1564,7 +1644,16 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name) void LLPanelPeople::onLoginFbcButtonClicked() { - LLWeb::loadURLInternal("https://cryptic-ridge-1632.herokuapp.com/"); + LLFloaterWebContent::Params p; + p.url("https://cryptic-ridge-1632.herokuapp.com/"); + LLFloater* browser = LLFloaterReg::showInstance("web_content", p); + + if (browser) + { + // start checking the browser to see if the data is available yet + mFbcTestBrowserHandle = browser->getHandle(); + mFbcTestListUpdater->setActive(true); + } } // EOF diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 4df5df2574..010fb5ca77 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -73,6 +73,7 @@ private: void updateFriendList(); void updateNearbyList(); void updateRecentList(); + void updateFbcTestList(); bool isItemsFreeOfFriends(const uuid_vec_t& uuids); @@ -145,16 +146,20 @@ private: LLAvatarList* mRecentList; LLGroupList* mGroupList; LLNetMap* mMiniMap; + + LLTextBox* mFbcTestText; LLHandle mGroupPlusMenuHandle; LLHandle mNearbyViewSortMenuHandle; LLHandle mFriendsViewSortMenuHandle; LLHandle mGroupsViewSortMenuHandle; LLHandle mRecentViewSortMenuHandle; + LLHandle mFbcTestBrowserHandle; Updater* mFriendListUpdater; Updater* mNearbyListUpdater; Updater* mRecentListUpdater; + Updater* mFbcTestListUpdater; Updater* mButtonsUpdater; LLMenuButton* mNearbyGearButton; diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 781a1d773f..cbb6aff4ea 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -585,17 +585,14 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M name="fbctest_panel" top="0" width="313"> - + Date: Tue, 12 Mar 2013 04:51:52 -0700 Subject: Add pragma warning disable for linux only to work-around spurious used before set warnings from GCC 4.3.4 on Vector4a with empty ctor --- indra/newview/llface.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 86e5f20812..73ae3743fc 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -53,6 +53,12 @@ #include "llviewershadermgr.h" #include "llvoavatar.h" +#if LL_LINUX +// Work-around spurious used before init warning on Vector4a +// +#pragma GCC diagnostic ignored "-Wuninitialized" +#endif + extern BOOL gGLDebugLoggingEnabled; #define LL_MAX_INDICES_COUNT 1000000 -- cgit v1.2.3 From 8af4974a02f1ad0c34c7e9cd17d0c2487231468e Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Tue, 12 Mar 2013 06:19:26 -0700 Subject: Disable more warnings to try to get llface.cpp to compile in the TC linux farm --- indra/newview/llface.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 73ae3743fc..f0393dcc5c 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -57,6 +57,8 @@ // Work-around spurious used before init warning on Vector4a // #pragma GCC diagnostic ignored "-Wuninitialized" +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-function" #endif extern BOOL gGLDebugLoggingEnabled; -- cgit v1.2.3 From a7203a79088618552d890945b0bdc56c952f0a5a Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Tue, 12 Mar 2013 07:22:11 -0700 Subject: CMake hack to work around gcc-4.1 lack of pragma warning disable processing. --- indra/cmake/00-Common.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 452fd5f356..9ad17b64b9 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -128,6 +128,13 @@ if (LINUX) # Let's actually get a numerical version of gxx's version STRING(REGEX REPLACE ".* ([0-9])\\.([0-9])\\.([0-9]).*" "\\1\\2\\3" CXX_VERSION_NUMBER ${CXX_VERSION}) + # Hacks to work around gcc 4.1 TC build pool machines which can't process pragma warning disables + # This is pure rubbish; I wish there was another way. + # + if(${CXX_VERSION_NUMBER} LESS 420) + set(CMAKE_CXX_FLAGS "-Wno-deprecated -Wno-unitialized -Wno-unused-variable -Wno-unused-function ${CMAKE_CXX_FLAGS}") + endif (${CXX_VERSION_NUMBER} LESS 420) + # gcc 4.3 and above don't like the LL boost and also # cause warnings due to our use of deprecated headers if(${CXX_VERSION_NUMBER} GREATER 429) -- cgit v1.2.3 From 2874ecea4d59b2db87c764ba5fae0b662992c121 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Tue, 12 Mar 2013 07:47:36 -0700 Subject: Fix -Wno-uninitialized disable --- indra/cmake/00-Common.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 9ad17b64b9..28ace35fd3 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -132,7 +132,7 @@ if (LINUX) # This is pure rubbish; I wish there was another way. # if(${CXX_VERSION_NUMBER} LESS 420) - set(CMAKE_CXX_FLAGS "-Wno-deprecated -Wno-unitialized -Wno-unused-variable -Wno-unused-function ${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "-Wno-deprecated -Wno-uninitialized -Wno-unused-variable -Wno-unused-function ${CMAKE_CXX_FLAGS}") endif (${CXX_VERSION_NUMBER} LESS 420) # gcc 4.3 and above don't like the LL boost and also -- cgit v1.2.3 From d66aa0974abddbaa56be5d1535de4e09576324bc Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Tue, 12 Mar 2013 08:14:19 -0700 Subject: Remove pragma diags which ALSO cause gcc-4.1 to warning and thus error out. *sigh* --- indra/newview/llface.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index f0393dcc5c..86e5f20812 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -53,14 +53,6 @@ #include "llviewershadermgr.h" #include "llvoavatar.h" -#if LL_LINUX -// Work-around spurious used before init warning on Vector4a -// -#pragma GCC diagnostic ignored "-Wuninitialized" -#pragma GCC diagnostic ignored "-Wunused-variable" -#pragma GCC diagnostic ignored "-Wunused-function" -#endif - extern BOOL gGLDebugLoggingEnabled; #define LL_MAX_INDICES_COUNT 1000000 -- cgit v1.2.3 From 5a51a43f23f89b88e7f9b3e16d019a23196131f6 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Tue, 12 Mar 2013 08:45:10 -0700 Subject: Fix eol at eof on wl param files. --- indra/newview/llwlanimator.h | 1 + indra/newview/llwlparammanager.h | 1 + indra/newview/llwlparamset.cpp | 3 ++- indra/newview/llwlparamset.h | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/indra/newview/llwlanimator.h b/indra/newview/llwlanimator.h index 5223b45343..810f4cf7e5 100644 --- a/indra/newview/llwlanimator.h +++ b/indra/newview/llwlanimator.h @@ -137,3 +137,4 @@ private: }; #endif // LL_WL_ANIMATOR_H + diff --git a/indra/newview/llwlparammanager.h b/indra/newview/llwlparammanager.h index 72422500fc..e13aed98ed 100644 --- a/indra/newview/llwlparammanager.h +++ b/indra/newview/llwlparammanager.h @@ -412,3 +412,4 @@ inline LLVector4 LLWLParamManager::getRotatedLightDir(void) const } #endif + diff --git a/indra/newview/llwlparamset.cpp b/indra/newview/llwlparamset.cpp index 745cdae441..b307f19e8a 100644 --- a/indra/newview/llwlparamset.cpp +++ b/indra/newview/llwlparamset.cpp @@ -406,4 +406,5 @@ void LLWLParamSet::updateHashedNames() { mParamHashedNames.push_back(LLStaticHashedString(iter->first)); } -} \ No newline at end of file +} + diff --git a/indra/newview/llwlparamset.h b/indra/newview/llwlparamset.h index 3e9f77ba6c..6e5f1d3a4b 100644 --- a/indra/newview/llwlparamset.h +++ b/indra/newview/llwlparamset.h @@ -243,3 +243,4 @@ inline F32 LLWLParamSet::getCloudScrollY() { #endif // LL_WLPARAM_SET_H + -- cgit v1.2.3 From 067a9cdfa903f3657ffd20008ae2933fb82718c8 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Tue, 12 Mar 2013 01:05:06 -0700 Subject: Better compat with non-Ubuntu distros (bare typedef sometimes conflicts with OS decl of same). --- indra/llcommon/llapp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llcommon/llapp.h b/indra/llcommon/llapp.h index a536a06ea5..afa06df23e 100644 --- a/indra/llcommon/llapp.h +++ b/indra/llcommon/llapp.h @@ -38,7 +38,7 @@ typedef LLAtomic32 LLAtomicU32; class LLErrorThread; class LLLiveFile; #if LL_LINUX -typedef struct siginfo siginfo_t; +#include #endif typedef void (*LLAppErrorHandler)(); -- cgit v1.2.3 From ab60c46a917366574fa7292b6e7142ece858bec5 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Tue, 12 Mar 2013 03:27:24 -0700 Subject: Fix for linux (and likely other platform) shutdown crash from mismatched alloc/free in VBOPool client data --- indra/llrender/llvertexbuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 1d257d8415..c6f1d76653 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -310,7 +310,7 @@ void LLVBOPool::cleanup() if (r.mClientData) { - ll_aligned_free_16((void*) r.mClientData); + ll_aligned_free((void*) r.mClientData); } l.pop_front(); -- cgit v1.2.3 From 35383790fb250532fa7701638d39a8f1c6a0cf76 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Tue, 12 Mar 2013 04:40:51 -0700 Subject: Merge pragma warning hack to fix linux build --- indra/cmake/00-Common.cmake | 2 +- indra/cmake/Variables.cmake | 9 ++------- indra/llrender/llvertexbuffer.cpp | 2 +- indra/newview/llface.cpp | 8 ++++++-- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 452fd5f356..81296965c2 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -218,7 +218,7 @@ if (LINUX OR DARWIN) set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs") if (NOT GCC_DISABLE_FATAL_WARNINGS) - set(GCC_WARNINGS "${GCC_WARNINGS} -Werror") +# set(GCC_WARNINGS "${GCC_WARNINGS} -Werror") endif (NOT GCC_DISABLE_FATAL_WARNINGS) set(GCC_CXX_WARNINGS "${GCC_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor") diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 4b459f1a48..6297ee822e 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -104,13 +104,8 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") OUTPUT_VARIABLE XCODE_VERSION ) # To support a different SDK update these Xcode settings: - if (XCODE_VERSION GREATER 4.2) - set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6) - else (XCODE_VERSION GREATER 4.2) - set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5) - endif (XCODE_VERSION GREATER 4.2) - - set(CMAKE_OSX_SYSROOT macosx10.6) + set(CMAKE_OSX_DEPLOYMENT_TARGET 10.8) + set(CMAKE_OSX_SYSROOT macosx10.8) set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42") set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 1d257d8415..c6f1d76653 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -310,7 +310,7 @@ void LLVBOPool::cleanup() if (r.mClientData) { - ll_aligned_free_16((void*) r.mClientData); + ll_aligned_free((void*) r.mClientData); } l.pop_front(); diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 5f86205175..c3cb914120 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -53,6 +53,12 @@ #include "llviewershadermgr.h" #include "llvoavatar.h" +#if LL_LINUX +// Work-around spurious used before init warning on Vector4a +// +#pragma GCC diagnostic ignored "-Wuninitialized" +#endif + extern BOOL gGLDebugLoggingEnabled; #define LL_MAX_INDICES_COUNT 1000000 @@ -64,8 +70,6 @@ BOOL LLFace::sSafeRenderSelect = TRUE; // FALSE #define DOTVEC(a,b) (a.mV[0]*b.mV[0] + a.mV[1]*b.mV[1] + a.mV[2]*b.mV[2]) -//#pragma GCC diagnostic ignored "-Wuninitialized" - /* For each vertex, given: B - binormal -- cgit v1.2.3 From 45e46cf4c163a7af6544645b5216834d4598b85d Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Tue, 12 Mar 2013 06:59:12 -0700 Subject: Restore cmake to use 10.6 hacked locally to 10.8 of which TC does not approve --- indra/cmake/Variables.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 6297ee822e..4b459f1a48 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -104,8 +104,13 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") OUTPUT_VARIABLE XCODE_VERSION ) # To support a different SDK update these Xcode settings: - set(CMAKE_OSX_DEPLOYMENT_TARGET 10.8) - set(CMAKE_OSX_SYSROOT macosx10.8) + if (XCODE_VERSION GREATER 4.2) + set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6) + else (XCODE_VERSION GREATER 4.2) + set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5) + endif (XCODE_VERSION GREATER 4.2) + + set(CMAKE_OSX_SYSROOT macosx10.6) set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42") set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym) -- cgit v1.2.3 From e08de2f60989658315784f6cc605373e464102a5 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Tue, 12 Mar 2013 07:27:31 -0700 Subject: Fix linux_crash_logger freetype fail (now finds prebuilts as it should) --- autobuild.xml | 4 ++-- indra/cmake/Copy3rdPartyLibs.cmake | 1 + indra/cmake/FreeType.cmake | 8 +------- indra/linux_crash_logger/CMakeLists.txt | 2 ++ 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index cd1e96c799..86a2f4ab2e 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -606,9 +606,9 @@ archive hash - 9f8a9dc39fd7c3da0fb3533782d1fddf + bd6f84f9fb3c2e68850676d06935373f url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-freetype/rev/226814/arch/Linux/installer/freetype-2.3.9-linux-20110418.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-freetype/rev/271684/arch/Linux/installer/freetype-2.4.4-linux-20130312.tar.bz2 name linux diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index c32e357da3..1551b0e3f7 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -266,6 +266,7 @@ elseif(LINUX) libdb-5.1.so libexpat.so libexpat.so.1 + libfreetype.so.6 libglod.so libgmock_main.so libgmock.so.0 diff --git a/indra/cmake/FreeType.cmake b/indra/cmake/FreeType.cmake index 43a9d282d0..c9a90a9a8d 100644 --- a/indra/cmake/FreeType.cmake +++ b/indra/cmake/FreeType.cmake @@ -7,13 +7,7 @@ if (STANDALONE) pkg_check_modules(FREETYPE REQUIRED freetype2) else (STANDALONE) use_prebuilt_binary(freetype) - if (LINUX) - set(FREETYPE_INCLUDE_DIRS - ${LIBS_PREBUILT_DIR}/include) - else (LINUX) - set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) - endif (LINUX) - + set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) set(FREETYPE_LIBRARIES freetype) endif (STANDALONE) diff --git a/indra/linux_crash_logger/CMakeLists.txt b/indra/linux_crash_logger/CMakeLists.txt index 98ebdc7487..5263b59584 100644 --- a/indra/linux_crash_logger/CMakeLists.txt +++ b/indra/linux_crash_logger/CMakeLists.txt @@ -12,6 +12,7 @@ include(LLVFS) include(LLXML) include(Linking) include(UI) +include(FreeType) include_directories( ${LLCOMMON_INCLUDE_DIRS} @@ -53,6 +54,7 @@ target_link_libraries(linux-crash-logger ${LLCOMMON_LIBRARIES} ${UI_LIBRARIES} ${DB_LIBRARIES} + ${FREETYPE_LIBRARIES} ) add_custom_target(linux-crash-logger-target ALL -- cgit v1.2.3 From e8b8a12b7365c17cf0326be365b78bcb1da1bfac Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Tue, 12 Mar 2013 10:48:05 -0700 Subject: Mods to make compile on gcc 4.6.3 work mo betta --- indra/cmake/00-Common.cmake | 4 ++++ indra/llmath/llvolume.cpp | 5 ----- indra/llmessage/lliosocket.cpp | 1 + indra/llui/llconsole.cpp | 2 -- indra/llui/llkeywords.cpp | 2 +- indra/llui/lllayoutstack.cpp | 2 +- indra/llui/lltextbase.cpp | 3 ++- indra/llui/lltexteditor.cpp | 1 - indra/llui/lltoolbar.cpp | 4 +--- indra/lscript/lscript_execute/lscript_readlso.cpp | 6 +++--- indra/test/io.cpp | 1 + indra/test/llstreamtools_tut.cpp | 8 +++++++- indra/test/lltemplatemessagebuilder_tut.cpp | 2 ++ 13 files changed, 23 insertions(+), 18 deletions(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 6bfd8c14d6..aa1d50b993 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -135,6 +135,10 @@ if (LINUX) set(CMAKE_CXX_FLAGS "-Wno-deprecated -Wno-uninitialized -Wno-unused-variable -Wno-unused-function ${CMAKE_CXX_FLAGS}") endif (${CXX_VERSION_NUMBER} LESS 420) + if(${CXX_VERSION_NUMBER} GREATER 459) + set(CMAKE_CXX_FLAGS "-Wno-deprecated -Wno-unused-but-set-variable -Wno-unused-variable ${CMAKE_CXX_FLAGS}") + endif (${CXX_VERSION_NUMBER} GREATER 459) + # gcc 4.3 and above don't like the LL boost and also # cause warnings due to our use of deprecated headers if(${CXX_VERSION_NUMBER} GREATER 429) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index eff224743b..cb5633c1bb 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -5314,12 +5314,7 @@ BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build) S32 max_t = volume->getPath().mPath.size(); // S32 i; - S32 num_vertices = 0, num_indices = 0; S32 grid_size = (profile.size()-1)/4; - S32 quad_count = (grid_size * grid_size); - - num_vertices = (grid_size+1)*(grid_size+1); - num_indices = quad_count * 4; LLVector4a& min = mExtents[0]; LLVector4a& max = mExtents[1]; diff --git a/indra/llmessage/lliosocket.cpp b/indra/llmessage/lliosocket.cpp index 0287026659..7713e553ef 100644 --- a/indra/llmessage/lliosocket.cpp +++ b/indra/llmessage/lliosocket.cpp @@ -592,6 +592,7 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl( PUMP_DEBUG; apr_pool_t* new_pool = NULL; apr_status_t status = apr_pool_create(&new_pool, mPool); + (void)status; apr_socket_t* socket = NULL; status = apr_socket_accept( &socket, diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp index 161496b1f5..fdfaf284de 100644 --- a/indra/llui/llconsole.cpp +++ b/indra/llui/llconsole.cpp @@ -243,8 +243,6 @@ void LLConsole::draw() void LLConsole::Paragraph::makeParagraphColorSegments (const LLColor4 &color) { LLSD paragraph_color_segments; - LLColor4 lcolor=color; - paragraph_color_segments[0]["text"] =wstring_to_utf8str(mParagraphText); LLSD color_sd = color.getValue(); paragraph_color_segments[0]["color"]=color_sd; diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index c1cd04186b..537cc82302 100644 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -368,7 +368,7 @@ void LLKeywords::findSegments(std::vector* seg_list, const LLW const llwchar* base = wtext.c_str(); const llwchar* cur = base; const llwchar* line = NULL; - + (void)line; while( *cur ) { if( *cur == '\n' || cur == base ) diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index c93f538570..32383b1f1d 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -481,7 +481,7 @@ void LLLayoutStack::createResizeBar(LLLayoutPanel* panelp) { LLResizeBar::Side side = (mOrientation == HORIZONTAL) ? LLResizeBar::RIGHT : LLResizeBar::BOTTOM; LLRect resize_bar_rect = getRect(); - + (void)resize_bar_rect; LLResizeBar::Params resize_params; resize_params.name("resize"); resize_params.resizing_view(lp); diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 3815eec447..ec66b6df56 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -351,7 +351,6 @@ void LLTextBase::drawSelectionBackground() S32 selection_left = llmin( mSelectionStart, mSelectionEnd ); S32 selection_right = llmax( mSelectionStart, mSelectionEnd ); - LLRect selection_rect = mVisibleTextRect; // Skip through the lines we aren't drawing. LLRect content_display_rect = getVisibleDocumentRect(); @@ -2241,6 +2240,8 @@ S32 LLTextBase::getDocIndexFromLocalCoord( S32 local_x, S32 local_y, BOOL round, // Figure out which line we're nearest to. LLRect visible_region = getVisibleDocumentRect(); LLRect doc_rect = mDocumentView->getRect(); + (void)visible_region; + (void)doc_rect; S32 doc_y = local_y - doc_rect.mBottom; diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 46fbd1e6a0..e4bd51c8ce 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2490,7 +2490,6 @@ void LLTextEditor::updateSegments() mKeywords.findSegments(&segment_list, getWText(), mDefaultColor.get(), *this); clearSegments(); - segment_set_t::iterator insert_it = mSegments.begin(); for (segment_vec_t::iterator list_it = segment_list.begin(); list_it != segment_list.end(); ++list_it) { insertSegment(*list_it); diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 63b7e452d2..62b6a0cd2f 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -653,7 +653,6 @@ void LLToolBar::updateLayoutAsNeeded() S32 max_row_length = 0; S32 max_length; - S32 max_total_girth; S32 cur_start; S32 cur_row ; S32 row_pad_start; @@ -664,7 +663,6 @@ void LLToolBar::updateLayoutAsNeeded() if (orientation == LLLayoutStack::HORIZONTAL) { max_length = getRect().getWidth() - mPadLeft - mPadRight; - max_total_girth = getRect().getHeight() - mPadTop - mPadBottom; row_pad_start = mPadLeft; row_pad_end = mPadRight; cur_row = mPadTop; @@ -673,7 +671,6 @@ void LLToolBar::updateLayoutAsNeeded() else // VERTICAL { max_length = getRect().getHeight() - mPadTop - mPadBottom; - max_total_girth = getRect().getWidth() - mPadLeft - mPadRight; row_pad_start = mPadTop; row_pad_end = mPadBottom; cur_row = mPadLeft; @@ -842,6 +839,7 @@ void LLToolBar::draw() { LLRect caret_rect = caret->getRect(); LLRect toolbar_rect = getRect(); + (void)toolbar_rect; if (getOrientation(mSideType) == LLLayoutStack::HORIZONTAL) { caret->setRect(LLRect(mDragx-caret_rect.getWidth()/2+1, diff --git a/indra/lscript/lscript_execute/lscript_readlso.cpp b/indra/lscript/lscript_execute/lscript_readlso.cpp index 35caa41ae1..3cdb41ac17 100644 --- a/indra/lscript/lscript_execute/lscript_readlso.cpp +++ b/indra/lscript/lscript_execute/lscript_readlso.cpp @@ -145,7 +145,7 @@ void LLScriptLSOParse::printGlobals(LLFILE *fp) // get offset to skip past name varoffset = global_v_offset; offset = bytestream2integer(mRawData, global_v_offset); - + (void)offset; //hush little compiler // get typeexport type = *(mRawData + global_v_offset++); @@ -262,8 +262,6 @@ void LLScriptLSOParse::printGlobalFunctions(LLFILE *fp) fprintf(fp, "[Function #%d] [0x%X] %s\n", function_number, orig_function_offset, name); fprintf(fp, "\tReturn Type: %s\n", LSCRIPTTypeNames[type]); type = *(mRawData + function_offset++); - S32 params; - params = 0; S32 pcount = 0; while (type) { @@ -350,6 +348,7 @@ void LLScriptLSOParse::printStates(LLFILE *fp) S32 dummy; opcode_end = worst_case_opcode_end; + (void)opcode_end; for (k = LSTT_STATE_BEGIN; k < LSTT_STATE_END; k++) { @@ -357,6 +356,7 @@ void LLScriptLSOParse::printStates(LLFILE *fp) { temp_end = bytestream2integer(mRawData, read_ahead); dummy = bytestream2integer(mRawData, read_ahead); + (void)dummy; if ( (temp_end < opcode_end) &&(temp_end > event_offset)) { diff --git a/indra/test/io.cpp b/indra/test/io.cpp index ce747f667d..7f26ac6724 100644 --- a/indra/test/io.cpp +++ b/indra/test/io.cpp @@ -1141,6 +1141,7 @@ namespace tut ensure("Connected to server", connected); lldebugs << "connected" << llendl; F32 elapsed = pump_loop(mPump,0.1f); + (void)elapsed; count = mPump->runningChains(); ensure_equals("server chain onboard", count, 2); lldebugs << "** Client is connected." << llendl; diff --git a/indra/test/llstreamtools_tut.cpp b/indra/test/llstreamtools_tut.cpp index a93f2e8f65..68e56b5ee2 100644 --- a/indra/test/llstreamtools_tut.cpp +++ b/indra/test/llstreamtools_tut.cpp @@ -386,15 +386,17 @@ namespace tut std::string actual_result; std::istringstream is; bool ret; - is.clear(); is.str(str = " First Second \t \r \n Third Fourth-ShouldThisBePartOfFourth Fifth\n"); actual_result = ""; ret = get_word(actual_result, is); // First + (void)ret; actual_result = ""; ret = get_word(actual_result, is); // Second + (void)ret; actual_result = ""; ret = get_word(actual_result, is); // Third + (void)ret; // the current implementation of get_word seems inconsistent with // skip_to_next_word. skip_to_next_word treats any character other @@ -486,6 +488,7 @@ namespace tut is.str(str = "First Second \t \r\n Third Fourth-ShouldThisBePartOfFourth IsThisFifth\n"); actual_result = ""; ret = get_line(actual_result, is); + (void)ret; expected_result = "First Second \t \r\n"; ensure_equals("get_line: 1", actual_result, expected_result); @@ -551,6 +554,7 @@ namespace tut is.str(str = "Should not skip lone \r.\r\n"); actual_result = ""; ret = get_line(actual_result, is); + (void)ret; expected_result = "Should not skip lone \r.\r\n"; ensure_equals("get_line: carriage return skipped even though not followed by newline", actual_result, expected_result); } @@ -569,6 +573,7 @@ namespace tut is.str(str = "\n"); actual_result = ""; ret = get_line(actual_result, is); + (void)ret; expected_result = "\n"; ensure_equals("get_line: Just newline", actual_result, expected_result); } @@ -588,6 +593,7 @@ namespace tut is.str(str = "First Line.\nSecond Line.\n"); actual_result = ""; ret = get_line(actual_result, is, 255); + (void)ret; expected_result = "First Line.\n"; ensure_equals("get_line: Basic Operation", actual_result, expected_result); diff --git a/indra/test/lltemplatemessagebuilder_tut.cpp b/indra/test/lltemplatemessagebuilder_tut.cpp index 6e1c82bb24..0aad3cbc15 100644 --- a/indra/test/lltemplatemessagebuilder_tut.cpp +++ b/indra/test/lltemplatemessagebuilder_tut.cpp @@ -958,11 +958,13 @@ namespace tut reader->validateMessage(buffer, builtSize, LLHost()); reader->readMessage(buffer, LLHost()); reader->getU32(_PREHASH_Test0, _PREHASH_Test0, outValue); + (void)outValue; char outBuffer[bufferSize]; memset(buffer, 0xcc, bufferSize); reader->getString(_PREHASH_Test1, _PREHASH_Test0, bufferSize, outBuffer); outValue2 = reader->getNumberOfBlocks(_PREHASH_Test1); + (void)outValue2; ensure_equals("Ensure present value ", outValue, inValue); ensure_equals("Ensure unchanged buffer ", strlen(outBuffer), 0); delete reader; -- cgit v1.2.3 From 5d2fea6262d91eb8d3c06d97a160ca9373b96889 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Wed, 13 Mar 2013 10:42:40 -0700 Subject: Move fast memcpy to llcommon and use it in llalignedarray pushback on all platforms. Code Review: DaveP --- indra/llcommon/llalignedarray.h | 16 +----- indra/llcommon/llmemory.h | 116 +++++++++++++++++++++++++++++++++++++--- indra/llmath/llsimdmath.h | 28 ---------- indra/llmath/llvector4a.cpp | 50 +---------------- indra/llmath/llvector4a.h | 4 -- indra/llmath/llvolume.cpp | 11 ++-- 6 files changed, 120 insertions(+), 105 deletions(-) diff --git a/indra/llcommon/llalignedarray.h b/indra/llcommon/llalignedarray.h index 5e04e8050f..ed8fd31205 100644 --- a/indra/llcommon/llalignedarray.h +++ b/indra/llcommon/llalignedarray.h @@ -29,10 +29,6 @@ #include "llmemory.h" -#if LL_WINDOWS -#include "llvector4a.h" // for 16b fast copy -#endif - template class LLAlignedArray { @@ -81,11 +77,7 @@ void LLAlignedArray::push_back(const T& elem) T* new_buf = (T*) ll_aligned_malloc(mCapacity*sizeof(T), alignment); if (mArray) { -#if LL_WINDOWS - LLVector4a::memcpyNonAliased16((F32*) new_buf, (F32*) mArray, sizeof(T)*mElementCount); -#else - memcpy((F32*)new_buf, (F32*)mArray, sizeof(T)*mElementCount); -#endif + ll_memcpy_nonaliased_aligned_16((char*)new_buf, (char*)mArray, sizeof(T)*mElementCount); } old_buf = mArray; mArray = new_buf; @@ -106,11 +98,7 @@ void LLAlignedArray::resize(U32 size) T* new_buf = mCapacity > 0 ? (T*) ll_aligned_malloc(mCapacity*sizeof(T), alignment) : NULL; if (mArray) { -#if LL_WINDOWS - LLVector4a::memcpyNonAliased16((F32*) new_buf, (F32*) mArray, sizeof(T)*mElementCount); -#else - memcpy((F32*) new_buf, (F32*) mArray, sizeof(T)*mElementCount); -#endif + ll_memcpy_nonaliased_aligned_16((char*) new_buf, (char*) mArray, sizeof(T)*mElementCount); ll_aligned_free(mArray); } diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index 46cabfadcd..61e30f11cc 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -36,6 +36,44 @@ class LLMutex ; #define LL_CHECK_MEMORY #endif +LL_COMMON_API void ll_assert_aligned_func(uintptr_t ptr,U32 alignment); + +#ifdef SHOW_ASSERT +#define ll_assert_aligned(ptr,alignment) ll_assert_aligned_func(reinterpret_cast(ptr),((U32)alignment)) +#else +#define ll_assert_aligned(ptr,alignment) +#endif + +#include + +template T* LL_NEXT_ALIGNED_ADDRESS(T* address) +{ + return reinterpret_cast( + (reinterpret_cast(address) + 0xF) & ~0xF); +} + +template T* LL_NEXT_ALIGNED_ADDRESS_64(T* address) +{ + return reinterpret_cast( + (reinterpret_cast(address) + 0x3F) & ~0x3F); +} + +#if LL_LINUX || LL_DARWIN + +#define LL_ALIGN_PREFIX(x) +#define LL_ALIGN_POSTFIX(x) __attribute__((aligned(x))) + +#elif LL_WINDOWS + +#define LL_ALIGN_PREFIX(x) __declspec(align(x)) +#define LL_ALIGN_POSTFIX(x) + +#else +#error "LL_ALIGN_PREFIX and LL_ALIGN_POSTFIX undefined" +#endif + +#define LL_ALIGN_16(var) LL_ALIGN_PREFIX(16) var LL_ALIGN_POSTFIX(16) + inline void* ll_aligned_malloc( size_t size, int align ) { #if defined(LL_WINDOWS) @@ -144,6 +182,78 @@ inline void ll_aligned_free_32(void *p) #endif } + +// Copy words 16-byte blocks from src to dst. Source and destination MUST NOT OVERLAP. +// Source and dest must be 16-byte aligned and size must be multiple of 16. +// +inline void ll_memcpy_nonaliased_aligned_16(char* __restrict dst, const char* __restrict src, size_t bytes) +{ + assert(src != NULL); + assert(dst != NULL); + assert(bytes > 0); + assert((bytes % sizeof(F32))== 0); + ll_assert_aligned(src,16); + ll_assert_aligned(dst,16); + assert((src < dst) ? ((src + bytes) < dst) : ((dst + bytes) < src)); + assert(bytes%16==0); + + char* end = dst + bytes; + + if (bytes > 64) + { + + // Find start of 64b aligned area within block + // + void* begin_64 = LL_NEXT_ALIGNED_ADDRESS_64(dst); + + //at least 64 bytes before the end of the destination, switch to 16 byte copies + void* end_64 = end-64; + + // Prefetch the head of the 64b area now + // + _mm_prefetch((char*)begin_64, _MM_HINT_NTA); + _mm_prefetch((char*)begin_64 + 64, _MM_HINT_NTA); + _mm_prefetch((char*)begin_64 + 128, _MM_HINT_NTA); + _mm_prefetch((char*)begin_64 + 192, _MM_HINT_NTA); + + // Copy 16b chunks until we're 64b aligned + // + while (dst < begin_64) + { + + _mm_store_ps((F32*)dst, _mm_load_ps((F32*)src)); + dst += 16; + src += 16; + } + + // Copy 64b chunks up to your tail + // + // might be good to shmoo the 512b prefetch offset + // (characterize performance for various values) + // + while (dst < end_64) + { + _mm_prefetch((char*)src + 512, _MM_HINT_NTA); + _mm_prefetch((char*)dst + 512, _MM_HINT_NTA); + _mm_store_ps((F32*)dst, _mm_load_ps((F32*)src)); + _mm_store_ps((F32*)(dst + 16), _mm_load_ps((F32*)(src + 16))); + _mm_store_ps((F32*)(dst + 32), _mm_load_ps((F32*)(src + 32))); + _mm_store_ps((F32*)(dst + 48), _mm_load_ps((F32*)(src + 48))); + dst += 64; + src += 64; + } + } + + // Copy remainder 16b tail chunks (or ALL 16b chunks for sub-64b copies) + // + while (dst < end) + { + _mm_store_ps((F32*)dst, _mm_load_ps((F32*)src)); + dst += 16; + src += 16; + } +} + #ifndef __DEBUG_PRIVATE_MEM__ #define __DEBUG_PRIVATE_MEM__ 0 #endif @@ -552,13 +662,7 @@ void LLPrivateMemoryPoolTester::operator delete[](void* addr) // LLSingleton moved to llsingleton.h -LL_COMMON_API void ll_assert_aligned_func(uintptr_t ptr,U32 alignment); -#ifdef SHOW_ASSERT -#define ll_assert_aligned(ptr,alignment) ll_assert_aligned_func(reinterpret_cast(ptr),((U32)alignment)) -#else -#define ll_assert_aligned(ptr,alignment) -#endif #endif diff --git a/indra/llmath/llsimdmath.h b/indra/llmath/llsimdmath.h index 01458521ec..cebd2ace7d 100644 --- a/indra/llmath/llsimdmath.h +++ b/indra/llmath/llsimdmath.h @@ -39,34 +39,6 @@ #include #endif -template T* LL_NEXT_ALIGNED_ADDRESS(T* address) -{ - return reinterpret_cast( - (reinterpret_cast(address) + 0xF) & ~0xF); -} - -template T* LL_NEXT_ALIGNED_ADDRESS_64(T* address) -{ - return reinterpret_cast( - (reinterpret_cast(address) + 0x3F) & ~0x3F); -} - -#if LL_LINUX || LL_DARWIN - -#define LL_ALIGN_PREFIX(x) -#define LL_ALIGN_POSTFIX(x) __attribute__((aligned(x))) - -#elif LL_WINDOWS - -#define LL_ALIGN_PREFIX(x) __declspec(align(x)) -#define LL_ALIGN_POSTFIX(x) - -#else -#error "LL_ALIGN_PREFIX and LL_ALIGN_POSTFIX undefined" -#endif - -#define LL_ALIGN_16(var) LL_ALIGN_PREFIX(16) var LL_ALIGN_POSTFIX(16) - #include #include diff --git a/indra/llmath/llvector4a.cpp b/indra/llmath/llvector4a.cpp index 6edeb0fefe..570fa41a43 100644 --- a/indra/llmath/llvector4a.cpp +++ b/indra/llmath/llvector4a.cpp @@ -41,55 +41,7 @@ extern const LLVector4a LL_V4A_EPSILON = reinterpret_cast ( F /*static */void LLVector4a::memcpyNonAliased16(F32* __restrict dst, const F32* __restrict src, size_t bytes) { - assert(src != NULL); - assert(dst != NULL); - assert(bytes > 0); - assert((bytes % sizeof(F32))== 0); - ll_assert_aligned(src,16); - ll_assert_aligned(dst,16); - assert(bytes%16==0); - - F32* end = dst + (bytes / sizeof(F32) ); - - if (bytes > 64) - { - F32* begin_64 = LL_NEXT_ALIGNED_ADDRESS_64(dst); - - //at least 64 (16*4) bytes before the end of the destination, switch to 16 byte copies - F32* end_64 = end-16; - - _mm_prefetch((char*)begin_64, _MM_HINT_NTA); - _mm_prefetch((char*)begin_64 + 64, _MM_HINT_NTA); - _mm_prefetch((char*)begin_64 + 128, _MM_HINT_NTA); - _mm_prefetch((char*)begin_64 + 192, _MM_HINT_NTA); - - while (dst < begin_64) - { - copy4a(dst, src); - dst += 4; - src += 4; - } - - while (dst < end_64) - { - _mm_prefetch((char*)src + 512, _MM_HINT_NTA); - _mm_prefetch((char*)dst + 512, _MM_HINT_NTA); - copy4a(dst, src); - copy4a(dst+4, src+4); - copy4a(dst+8, src+8); - copy4a(dst+12, src+12); - - dst += 16; - src += 16; - } - } - - while (dst < end) - { - copy4a(dst, src); - dst += 4; - src += 4; - } + ll_memcpy_nonaliased_aligned_16((char*)dst, (char*)src, bytes); } void LLVector4a::setRotated( const LLRotation& rot, const LLVector4a& vec ) diff --git a/indra/llmath/llvector4a.h b/indra/llmath/llvector4a.h index 1a478bc8de..0526793d3a 100644 --- a/indra/llmath/llvector4a.h +++ b/indra/llmath/llvector4a.h @@ -93,11 +93,7 @@ public: LLVector4a() { //DO NOT INITIALIZE -- The overhead is completely unnecessary -// This assert is causing spurious referenced before set warnings on GCC 4.3.4 -// -#if !LL_LINUX ll_assert_aligned(this,16); -#endif } LLVector4a(F32 x, F32 y, F32 z, F32 w = 0.f) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 4f3e753276..e7a0bc7df7 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -4729,10 +4729,13 @@ void LLVolumeFace::optimize(F32 angle_cutoff) } } - llassert(new_face.mNumIndices == mNumIndices); - llassert(new_face.mNumVertices <= mNumVertices); - - swapData(new_face); + // Only swap data if we've actually optimized the mesh + // + if (new_face.mNumVertices < mNumVertices) + { + llassert(new_face.mNumIndices == mNumIndices); + swapData(new_face); + } } class LLVCacheTriangleData; -- cgit v1.2.3 From bba84a3fa9a1af87f6a8080f9093f9277feb1292 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Wed, 13 Mar 2013 13:38:30 -0700 Subject: Cleanup per code review of prev change with DaveP --- indra/llcommon/llmemory.h | 12 ++++++------ indra/llmath/llvolume.cpp | 11 +++++++---- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index 61e30f11cc..d0e4bc9e25 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -188,14 +188,14 @@ inline void ll_aligned_free_32(void *p) // inline void ll_memcpy_nonaliased_aligned_16(char* __restrict dst, const char* __restrict src, size_t bytes) { - assert(src != NULL); - assert(dst != NULL); - assert(bytes > 0); - assert((bytes % sizeof(F32))== 0); + llassert(src != NULL); + llassert(dst != NULL); + llassert(bytes >= 16); + llassert((bytes % sizeof(F32))== 0); + llassert((src < dst) ? ((src + bytes) < dst) : ((dst + bytes) < src)); + llassert(bytes%16==0); ll_assert_aligned(src,16); ll_assert_aligned(dst,16); - assert((src < dst) ? ((src + bytes) < dst) : ((dst + bytes) < src)); - assert(bytes%16==0); char* end = dst + bytes; diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index cb5633c1bb..edd16b5688 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -4729,11 +4729,13 @@ void LLVolumeFace::optimize(F32 angle_cutoff) } } - if (new_face.mNumVertices) + // disallow data amplification + // + if (new_face.mNumVertices <= mNumVertices) { - llassert(new_face.mNumIndices == mNumIndices); - swapData(new_face); - } + llassert(new_face.mNumIndices == mNumIndices); + swapData(new_face); + } } class LLVCacheTriangleData; @@ -6731,3 +6733,4 @@ void calc_binormal_from_triangle(LLVector4a& binormal, binormal.set( 0, 1 , 0 ); } } + -- cgit v1.2.3 From 08ae21f52dbbe6245ac8deee0fdfd5df4d3dba53 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 13 Mar 2013 17:07:22 -0500 Subject: MAINT-2410 Extra Particle Parameters -- viewer implementation Reviewed by Kelly and Graham --- indra/llmessage/llpartdata.cpp | 257 ++++++++++++++++++----------- indra/llmessage/llpartdata.h | 22 ++- indra/llrender/llvertexbuffer.cpp | 9 +- indra/newview/lldrawpoolalpha.cpp | 38 +++-- indra/newview/llspatialpartition.cpp | 4 +- indra/newview/llspatialpartition.h | 2 + indra/newview/llviewerobject.cpp | 21 ++- indra/newview/llviewerobject.h | 8 +- indra/newview/llviewerpartsim.cpp | 27 +++- indra/newview/llviewerpartsim.h | 9 +- indra/newview/llviewerpartsource.cpp | 75 ++++++++- indra/newview/llviewerpartsource.h | 4 +- indra/newview/llvograss.cpp | 7 +- indra/newview/llvograss.h | 1 + indra/newview/llvopartgroup.cpp | 305 +++++++++++++++++++++++++---------- indra/newview/llvopartgroup.h | 6 +- indra/newview/llvovolume.cpp | 6 +- 17 files changed, 573 insertions(+), 228 deletions(-) diff --git a/indra/llmessage/llpartdata.cpp b/indra/llmessage/llpartdata.cpp index c0fd3c9542..0f33a94295 100644 --- a/indra/llmessage/llpartdata.cpp +++ b/indra/llmessage/llpartdata.cpp @@ -37,9 +37,21 @@ -const S32 PS_PART_DATA_GLOW_BLEND_SIZE = 4; -const S32 PS_PART_DATA_BLOCK_SIZE = 4 + 2 + 4 + 4 + 2 + 2; // 18 -const S32 PS_DATA_BLOCK_SIZE = 68 + PS_PART_DATA_BLOCK_SIZE + PS_PART_DATA_GLOW_BLEND_SIZE; // 68 + 18 + 4 = 90 +const S32 PS_PART_DATA_GLOW_SIZE = 2; +const S32 PS_PART_DATA_BLEND_SIZE = 2; +const S32 PS_LEGACY_PART_DATA_BLOCK_SIZE = 4 + 2 + 4 + 4 + 2 + 2; //18 +const S32 PS_SYS_DATA_BLOCK_SIZE = 68; +const S32 PS_MAX_DATA_BLOCK_SIZE = PS_SYS_DATA_BLOCK_SIZE+ + PS_LEGACY_PART_DATA_BLOCK_SIZE + + PS_PART_DATA_BLEND_SIZE + + PS_PART_DATA_GLOW_SIZE+ + 8; //two S32 size fields + +const S32 PS_LEGACY_DATA_BLOCK_SIZE = PS_SYS_DATA_BLOCK_SIZE + PS_LEGACY_PART_DATA_BLOCK_SIZE; + + +const U32 PART_DATA_MASK = LLPartData::LL_PART_DATA_GLOW | LLPartData::LL_PART_DATA_BLEND; + const F32 MAX_PART_SCALE = 4.f; @@ -49,28 +61,9 @@ bool LLPartData::hasGlow() const return mStartGlow > 0.f || mEndGlow > 0.f; } -BOOL LLPartData::pack(LLDataPacker &dp) +bool LLPartData::hasBlendFunc() const { - LLColor4U coloru; - dp.packU32(mFlags, "pdflags"); - dp.packFixed(mMaxAge, "pdmaxage", FALSE, 8, 8); - coloru.setVec(mStartColor); - dp.packColor4U(coloru, "pdstartcolor"); - coloru.setVec(mEndColor); - dp.packColor4U(coloru, "pdendcolor"); - dp.packFixed(mStartScale.mV[0], "pdstartscalex", FALSE, 3, 5); - dp.packFixed(mStartScale.mV[1], "pdstartscaley", FALSE, 3, 5); - dp.packFixed(mEndScale.mV[0], "pdendscalex", FALSE, 3, 5); - dp.packFixed(mEndScale.mV[1], "pdendscaley", FALSE, 3, 5); - - if (hasGlow() || hasBlendFunc()) - { - dp.packU8(mStartGlow * 255,"pdstartglow"); - dp.packU8(mEndGlow * 255,"pdendglow"); - dp.packU8(mBlendFuncSource,"pdblendsource"); - dp.packU8(mBlendFuncDest,"pdblenddest"); - } - return TRUE; + return mBlendFuncSource != LLPartData::LL_PART_BF_SOURCE_ALPHA || mBlendFuncDest != LLPartData::LL_PART_BF_ONE_MINUS_SOURCE_ALPHA; } LLSD LLPartData::asLLSD() const @@ -107,8 +100,17 @@ bool LLPartData::fromLLSD(LLSD& sd) return true; } +S32 LLPartData::getSize() const +{ + S32 size = PS_LEGACY_PART_DATA_BLOCK_SIZE; + if (hasGlow()) size += PS_PART_DATA_GLOW_SIZE; + if (hasBlendFunc()) size += PS_PART_DATA_BLEND_SIZE; + + return size; +} -BOOL LLPartData::unpack(LLDataPacker &dp) + +BOOL LLPartData::unpackLegacy(LLDataPacker &dp) { LLColor4U coloru; @@ -124,7 +126,7 @@ BOOL LLPartData::unpack(LLDataPacker &dp) dp.unpackFixed(mEndScale.mV[0], "pdendscalex", FALSE, 3, 5); dp.unpackFixed(mEndScale.mV[1], "pdendscaley", FALSE, 3, 5); - if (dp.hasNext()) + /*if (dp.hasNext()) { U8 tmp_glow = 0; dp.unpackU8(tmp_glow,"pdstartglow"); @@ -133,11 +135,71 @@ BOOL LLPartData::unpack(LLDataPacker &dp) mEndGlow = tmp_glow / 255.f; dp.unpackU8(mBlendFuncSource,"pdblendsource"); dp.unpackU8(mBlendFuncDest,"pdblenddest"); - } + }*/ + + mStartGlow = 0.f; + mEndGlow = 0.f; + mBlendFuncSource = LLPartData::LL_PART_BF_SOURCE_ALPHA; + mBlendFuncDest = LLPartData::LL_PART_BF_ONE_MINUS_SOURCE_ALPHA; return TRUE; } +BOOL LLPartData::unpack(LLDataPacker &dp) +{ + S32 size = 0; + dp.unpackS32(size, "partsize"); + + unpackLegacy(dp); + size -= PS_LEGACY_PART_DATA_BLOCK_SIZE; + + if (mFlags & LL_PART_DATA_GLOW) + { + if (size < PS_PART_DATA_GLOW_SIZE) return FALSE; + + U8 tmp_glow = 0; + dp.unpackU8(tmp_glow,"pdstartglow"); + mStartGlow = tmp_glow / 255.f; + dp.unpackU8(tmp_glow,"pdendglow"); + mEndGlow = tmp_glow / 255.f; + + size -= PS_PART_DATA_GLOW_SIZE; + } + else + { + mStartGlow = 0.f; + mEndGlow = 0.f; + } + + if (mFlags & LL_PART_DATA_BLEND) + { + if (size < PS_PART_DATA_BLEND_SIZE) return FALSE; + dp.unpackU8(mBlendFuncSource,"pdblendsource"); + dp.unpackU8(mBlendFuncDest,"pdblenddest"); + size -= PS_PART_DATA_BLEND_SIZE; + } + else + { + mBlendFuncSource = LLPartData::LL_PART_BF_SOURCE_ALPHA; + mBlendFuncDest = LLPartData::LL_PART_BF_ONE_MINUS_SOURCE_ALPHA; + } + + if (size > 0) + { //leftover bytes, unrecognized parameters + U8 feh = 0; + while (size > 0) + { //read remaining bytes in block + dp.unpackU8(feh, "whippang"); + size--; + } + + //this particle system won't display properly, better to not show anything + return FALSE; + } + + + return TRUE; +} void LLPartData::setFlags(const U32 flags) { @@ -228,38 +290,7 @@ LLPartSysData::LLPartSysData() mNumParticles = 0; } - -BOOL LLPartSysData::pack(LLDataPacker &dp) -{ - dp.packU32(mCRC, "pscrc"); - dp.packU32(mFlags, "psflags"); - dp.packU8(mPattern, "pspattern"); - dp.packFixed(mMaxAge, "psmaxage", FALSE, 8, 8); - dp.packFixed(mStartAge, "psstartage", FALSE, 8, 8); - dp.packFixed(mInnerAngle, "psinnerangle", FALSE, 3, 5); - dp.packFixed(mOuterAngle, "psouterangle", FALSE, 3, 5); - dp.packFixed(mBurstRate, "psburstrate", FALSE, 8, 8); - dp.packFixed(mBurstRadius, "psburstradius", FALSE, 8, 8); - dp.packFixed(mBurstSpeedMin, "psburstspeedmin", FALSE, 8, 8); - dp.packFixed(mBurstSpeedMax, "psburstspeedmax", FALSE, 8, 8); - dp.packU8(mBurstPartCount, "psburstpartcount"); - - dp.packFixed(mAngularVelocity.mV[0], "psangvelx", TRUE, 8, 7); - dp.packFixed(mAngularVelocity.mV[1], "psangvely", TRUE, 8, 7); - dp.packFixed(mAngularVelocity.mV[2], "psangvelz", TRUE, 8, 7); - - dp.packFixed(mPartAccel.mV[0], "psaccelx", TRUE, 8, 7); - dp.packFixed(mPartAccel.mV[1], "psaccely", TRUE, 8, 7); - dp.packFixed(mPartAccel.mV[2], "psaccelz", TRUE, 8, 7); - - dp.packUUID(mPartImageID, "psuuid"); - dp.packUUID(mTargetUUID, "pstargetuuid"); - mPartData.pack(dp); - return TRUE; -} - - -BOOL LLPartSysData::unpack(LLDataPacker &dp) +BOOL LLPartSysData::unpackSystem(LLDataPacker &dp) { dp.unpackU32(mCRC, "pscrc"); dp.unpackU32(mFlags, "psflags"); @@ -285,10 +316,48 @@ BOOL LLPartSysData::unpack(LLDataPacker &dp) dp.unpackUUID(mPartImageID, "psuuid"); dp.unpackUUID(mTargetUUID, "pstargetuuid"); - mPartData.unpack(dp); return TRUE; } +BOOL LLPartSysData::unpackLegacy(LLDataPacker &dp) +{ + unpackSystem(dp); + mPartData.unpackLegacy(dp); + + return TRUE; +} + +BOOL LLPartSysData::unpack(LLDataPacker &dp) +{ + // syssize is currently unused. Adding now when modifying the 'version to make extensible in the future + S32 size = 0; + dp.unpackS32(size, "syssize"); + + if (size != PS_SYS_DATA_BLOCK_SIZE) + { //unexpected size, this viewer doesn't know how to parse this particle system + + //skip to LLPartData block + U8 feh = 0; + + for (U32 i = 0; i < size; ++i) + { + dp.unpackU8(feh, "whippang"); + } + + dp.unpackS32(size, "partsize"); + //skip LLPartData block + for (U32 i = 0; i < size; ++i) + { + dp.unpackU8(feh, "whippang"); + } + return FALSE; + } + + unpackSystem(dp); + + return mPartData.unpack(dp); +} + std::ostream& operator<<(std::ostream& s, const LLPartSysData &data) { s << "Flags: " << std::hex << data.mFlags; @@ -306,7 +375,7 @@ std::ostream& operator<<(std::ostream& s, const LLPartSysData &data) BOOL LLPartSysData::isNullPS(const S32 block_num) { - U8 ps_data_block[PS_DATA_BLOCK_SIZE]; + U8 ps_data_block[PS_MAX_DATA_BLOCK_SIZE]; U32 crc; S32 size; @@ -318,15 +387,27 @@ BOOL LLPartSysData::isNullPS(const S32 block_num) return TRUE; } - gMessageSystem->getBinaryData("ObjectData", "PSBlock", ps_data_block, PS_DATA_BLOCK_SIZE, block_num, PS_DATA_BLOCK_SIZE); - - if (size > PS_DATA_BLOCK_SIZE) + if (size > PS_MAX_DATA_BLOCK_SIZE) { //size is too big, newer particle version unsupported return TRUE; } + gMessageSystem->getBinaryData("ObjectData", "PSBlock", ps_data_block, size, block_num, PS_MAX_DATA_BLOCK_SIZE); + LLDataPackerBinaryBuffer dp(ps_data_block, size); + if (size > PS_LEGACY_DATA_BLOCK_SIZE) + { + // non legacy systems pack a size before the CRC + S32 tmp = 0; + dp.unpackS32(tmp, "syssize"); + + if (tmp > PS_SYS_DATA_BLOCK_SIZE) + { //unknown system data block size, don't know how to parse it, treat as NULL + return TRUE; + } + } + dp.unpackU32(crc, "crc"); if (crc == 0) @@ -336,53 +417,37 @@ BOOL LLPartSysData::isNullPS(const S32 block_num) return FALSE; } - -//static -BOOL LLPartSysData::packNull() -{ - U8 ps_data_block[PS_DATA_BLOCK_SIZE]; - gMessageSystem->addBinaryData("PSBlock", ps_data_block, 0); - return TRUE; -} - - -BOOL LLPartSysData::packBlock() -{ - U8 ps_data_block[PS_DATA_BLOCK_SIZE]; - - LLDataPackerBinaryBuffer dp(ps_data_block, PS_DATA_BLOCK_SIZE); - - pack(dp); - - S32 size = dp.getCurrentSize(); - - // Add to message - gMessageSystem->addBinaryData("PSBlock", ps_data_block, size); - - return TRUE; -} - - BOOL LLPartSysData::unpackBlock(const S32 block_num) { - U8 ps_data_block[PS_DATA_BLOCK_SIZE]; + U8 ps_data_block[PS_MAX_DATA_BLOCK_SIZE]; // Check size of block S32 size = gMessageSystem->getSize("ObjectData", block_num, "PSBlock"); - if (size > PS_DATA_BLOCK_SIZE) + if (size > PS_MAX_DATA_BLOCK_SIZE) { // Larger packets are newer and unsupported return FALSE; } // Get from message - gMessageSystem->getBinaryData("ObjectData", "PSBlock", ps_data_block, size, block_num, PS_DATA_BLOCK_SIZE); + gMessageSystem->getBinaryData("ObjectData", "PSBlock", ps_data_block, size, block_num, PS_MAX_DATA_BLOCK_SIZE); LLDataPackerBinaryBuffer dp(ps_data_block, size); - unpack(dp); - return TRUE; + if (size == PS_LEGACY_DATA_BLOCK_SIZE) + { + return unpackLegacy(dp); + } + else + { + return unpack(dp); + } +} + +bool LLPartSysData::isLegacyCompatible() const +{ + return !mPartData.hasGlow() && !mPartData.hasBlendFunc(); } void LLPartSysData::clampSourceParticleRate() diff --git a/indra/llmessage/llpartdata.h b/indra/llmessage/llpartdata.h index 19207d994d..80a52b79dd 100644 --- a/indra/llmessage/llpartdata.h +++ b/indra/llmessage/llpartdata.h @@ -88,7 +88,9 @@ public: mParameter(0.f) { } + BOOL unpackLegacy(LLDataPacker &dp); BOOL unpack(LLDataPacker &dp); + BOOL pack(LLDataPacker &dp); LLSD asLLSD() const; operator LLSD() const {return asLLSD(); } @@ -117,6 +119,10 @@ public: //LL_PART_RANDOM_VEL_MASK = 0x200, // Particles have random velocity shifts" //LL_PART_TRAIL_MASK = 0x400, // Particles have historical "trails" + //sYSTEM SET FLAGS + LL_PART_DATA_GLOW = 0x10000, + LL_PART_DATA_BLEND = 0x20000, + // Viewer side use only! LL_PART_HUD = 0x40000000, LL_PART_DEAD_MASK = 0x80000000, @@ -152,6 +158,9 @@ public: friend class LLPartSysData; friend class LLViewerPartSourceScript; +private: + S32 getSize() const; + // These are public because I'm really lazy... public: U32 mFlags; // Particle state/interpolators in effect @@ -178,15 +187,13 @@ public: LLPartSysData(); BOOL unpack(LLDataPacker &dp); - BOOL pack(LLDataPacker &dp); - - + BOOL unpackLegacy(LLDataPacker &dp); BOOL unpackBlock(const S32 block_num); - BOOL packBlock(); - - static BOOL packNull(); + static BOOL isNullPS(const S32 block_num); // Returns FALSE if this is a "NULL" particle system (i.e. no system) + bool isLegacyCompatible() const; + // Different masks for effects on the source enum { @@ -222,6 +229,9 @@ public: S32 getdataBlockSize() const; +private: + BOOL unpackSystem(LLDataPacker &dp); + public: // Public because I'm lazy.... diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 1d257d8415..4460461e12 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -2360,7 +2360,8 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) if (data_mask & MAP_COLOR) { S32 loc = TYPE_COLOR; - void* ptr = (void*)(base + mOffsets[TYPE_COLOR]); + //bind emissive instead of color pointer if emissive is present + void* ptr = (data_mask & MAP_EMISSIVE) ? (void*)(base + mOffsets[TYPE_EMISSIVE]) : (void*)(base + mOffsets[TYPE_COLOR]); glVertexAttribPointerARB(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_COLOR], ptr); } if (data_mask & MAP_EMISSIVE) @@ -2368,6 +2369,12 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) S32 loc = TYPE_EMISSIVE; void* ptr = (void*)(base + mOffsets[TYPE_EMISSIVE]); glVertexAttribPointerARB(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_EMISSIVE], ptr); + + if (!(data_mask & MAP_COLOR)) + { //map emissive to color channel when color is not also being bound to avoid unnecessary shader swaps + loc = TYPE_COLOR; + glVertexAttribPointerARB(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_EMISSIVE], ptr); + } } if (data_mask & MAP_WEIGHT) { diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 313b310e1e..6fa16825df 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -394,10 +394,15 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) if (group->mSpatialPartition->mRenderByGroup && !group->isDead()) { - bool draw_glow_for_this_partition = mVertexShaderLevel > 0 && // no shaders = no glow. - // All particle systems seem to come off the wire with texture entries which claim that they glow. This is probably a bug in the data. Suppress. - group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_PARTICLE && - group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_HUD_PARTICLE; + static LLFastTimer::DeclareTimer FTM_RENDER_ALPHA_GROUP_LOOP("Alpha Group"); + LLFastTimer t(FTM_RENDER_ALPHA_GROUP_LOOP); + + bool draw_glow_for_this_partition = mVertexShaderLevel > 0; // no shaders = no glow. + + bool disable_cull = group->mSpatialPartition->mPartitionType == LLViewerRegion::PARTITION_PARTICLE || + group->mSpatialPartition->mPartitionType == LLViewerRegion::PARTITION_HUD_PARTICLE; + + LLGLDisable cull(disable_cull ? GL_CULL_FACE : 0); LLSpatialGroup::drawmap_elem_t& draw_info = group->mDrawMap[LLRenderPass::PASS_ALPHA]; @@ -498,32 +503,31 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) } } - params.mVertexBuffer->setBuffer(mask); - params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); - gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); + static LLFastTimer::DeclareTimer FTM_RENDER_ALPHA_PUSH("Alpha Push Verts"); + { + LLFastTimer t(FTM_RENDER_ALPHA_PUSH); + gGL.blendFunc((LLRender::eBlendFactor) params.mBlendFuncSrc, (LLRender::eBlendFactor) params.mBlendFuncDst, mAlphaSFactor, mAlphaDFactor); + params.mVertexBuffer->setBuffer(mask); + params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); + gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); + } // If this alpha mesh has glow, then draw it a second time to add the destination-alpha (=glow). Interleaving these state-changing calls could be expensive, but glow must be drawn Z-sorted with alpha. if (current_shader && draw_glow_for_this_partition && params.mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_EMISSIVE)) { + static LLFastTimer::DeclareTimer FTM_RENDER_ALPHA_GLOW("Alpha Glow"); + LLFastTimer t(FTM_RENDER_ALPHA_GLOW); // install glow-accumulating blend mode gGL.blendFunc(LLRender::BF_ZERO, LLRender::BF_ONE, // don't touch color LLRender::BF_ONE, LLRender::BF_ONE); // add to alpha (glow) - emissive_shader->bind(); - - // glow doesn't use vertex colors from the mesh data - params.mVertexBuffer->setBuffer((mask & ~LLVertexBuffer::MAP_COLOR) | LLVertexBuffer::MAP_EMISSIVE); + params.mVertexBuffer->setBuffer(mask | LLVertexBuffer::MAP_EMISSIVE); // do the actual drawing, again params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); - - // restore our alpha blend mode - gGL.blendFunc(mColorSFactor, mColorDFactor, mAlphaSFactor, mAlphaDFactor); - - current_shader->bind(); } if (tex_setup) @@ -536,6 +540,8 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) } } + gGL.setSceneBlendType(LLRender::BT_ALPHA); + LLVertexBuffer::unbind(); if (!light_enabled) diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index dd69172184..1ec56eb5f8 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -4654,7 +4654,9 @@ LLDrawInfo::LLDrawInfo(U16 start, U16 end, U32 count, U32 offset, mGroup(NULL), mFace(NULL), mDistance(0.f), - mDrawMode(LLRender::TRIANGLES) + mDrawMode(LLRender::TRIANGLES), + mBlendFuncSrc(LLRender::BF_SOURCE_ALPHA), + mBlendFuncDst(LLRender::BF_ONE_MINUS_SOURCE_ALPHA) { mVertexBuffer->validateRange(mStart, mEnd, mCount, mOffset); diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index b5543c4a37..08e77855c4 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -119,6 +119,8 @@ public: LL_ALIGN_16(LLFace* mFace); //associated face F32 mDistance; U32 mDrawMode; + U32 mBlendFuncSrc; + U32 mBlendFuncDst; struct CompareTexture { diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index b1a60197a2..09cc4a1121 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -1553,6 +1553,8 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, dp->setPassFlags(value); dp->unpackUUID(owner_id, "Owner"); + mOwnerID = owner_id; + if (value & 0x80) { dp->unpackVector3(new_angv, "Omega"); @@ -1626,13 +1628,13 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, retval |= checkMediaURL(media_url); // - // Unpack particle system data + // Unpack particle system data (legacy) // if (value & 0x8) { - unpackParticleSource(*dp, owner_id); + unpackParticleSource(*dp, owner_id, true); } - else + else if (!(value & 0x400)) { deleteParticleSource(); } @@ -1697,7 +1699,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, // keep local flags and overwrite remote-controlled flags mFlags = (mFlags & FLAGS_LOCAL) | flags; - // ...new objects that should come in selected need to be added to the selected list + // ...new objects that should come in selected need to be added to the selected list mCreateSelected = ((flags & FLAGS_CREATE_SELECTED) != 0); } break; @@ -4604,7 +4606,7 @@ void LLViewerObject::unpackParticleSource(const S32 block_num, const LLUUID& own } } -void LLViewerObject::unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_id) +void LLViewerObject::unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_id, bool legacy) { if (!mPartSourcep.isNull() && mPartSourcep->isDead()) { @@ -4613,7 +4615,7 @@ void LLViewerObject::unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_ if (mPartSourcep) { // If we've got one already, just update the existing source (or remove it) - if (!LLViewerPartSourceScript::unpackPSS(this, mPartSourcep, dp)) + if (!LLViewerPartSourceScript::unpackPSS(this, mPartSourcep, dp, legacy)) { mPartSourcep->setDead(); mPartSourcep = NULL; @@ -4621,7 +4623,7 @@ void LLViewerObject::unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_ } else { - LLPointer pss = LLViewerPartSourceScript::unpackPSS(this, NULL, dp); + LLPointer pss = LLViewerPartSourceScript::unpackPSS(this, NULL, dp, legacy); //If the owner is muted, don't create the system if(LLMuteList::getInstance()->isMuted(owner_id, LLMute::flagParticles)) return; // We need to be able to deal with a particle source that hasn't changed, but still got an update! @@ -5467,6 +5469,11 @@ F32 LLAlphaObject::getPartSize(S32 idx) return 0.f; } +void LLAlphaObject::getBlendFunc(S32 face, U32& src, U32& dst) +{ + +} + // virtual void LLStaticViewerObject::updateDrawable(BOOL force_damped) { diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 97cf0a4850..cab617b745 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -584,6 +584,7 @@ public: } EPhysicsShapeType; LLUUID mID; + LLUUID mOwnerID; //null if unknown // unique within region, not unique across regions // Local ID = 0 is not used @@ -662,7 +663,7 @@ protected: BOOL isOnMap(); void unpackParticleSource(const S32 block_num, const LLUUID& owner_id); - void unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_id); + void unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_id, bool legacy); void deleteParticleSource(); void setParticleSource(const LLPartSysData& particle_parameters, const LLUUID& owner_id); @@ -826,9 +827,12 @@ public: LLStrider& verticesp, LLStrider& normalsp, LLStrider& texcoordsp, - LLStrider& colorsp, + LLStrider& colorsp, + LLStrider& emissivep, LLStrider& indicesp) = 0; + virtual void getBlendFunc(S32 face, U32& src, U32& dst); + F32 mDepth; }; diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index 61cdfd7818..21f1d2619c 100644 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -80,12 +80,31 @@ LLViewerPart::LLViewerPart() : mImagep(NULL) { mPartSourcep = NULL; - + mParent = NULL; + mChild = NULL; ++LLViewerPartSim::sParticleCount2 ; } LLViewerPart::~LLViewerPart() { + if (mPartSourcep.notNull() && mPartSourcep->mLastPart == this) + { + mPartSourcep->mLastPart = NULL; + } + + //patch up holes in the ribbon + if (mParent) + { + llassert(mParent->mChild == this); + mParent->mChild = mChild; + } + + if (mChild) + { + llassert (mChild->mParent == this); + mChild->mParent = mParent; + } + mPartSourcep = NULL; --LLViewerPartSim::sParticleCount2 ; @@ -367,6 +386,9 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) part->mScale += frac*part->mEndScale; } + // Do glow interpolation + part->mGlow.mV[3] = (U8) (lerp(part->mStartGlow, part->mEndGlow, frac)*255.f); + // Set the last update time to now. part->mLastUpdateTime = cur_time; @@ -623,6 +645,9 @@ void LLViewerPartSim::updateSimulation() { static LLFrameTimer update_timer; + //reset VBO cursor + LLVOPartGroup::sVBSlotCursor = 0; + const F32 dt = llmin(update_timer.getElapsedTimeAndResetF32(), 0.1f); if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES))) diff --git a/indra/newview/llviewerpartsim.h b/indra/newview/llviewerpartsim.h index c91fcf0691..095de2060c 100644 --- a/indra/newview/llviewerpartsim.h +++ b/indra/newview/llviewerpartsim.h @@ -65,15 +65,22 @@ public: LLVPCallback mVPCallback; // Callback function for more complicated behaviors LLPointer mPartSourcep; // Particle source used for this object - + + LLViewerPart* mParent; // particle to connect to if this is part of a particle ribbon + LLViewerPart* mChild; // child particle for clean reference destruction // Current particle state (possibly used for rendering) LLPointer mImagep; LLVector3 mPosAgent; LLVector3 mVelocity; LLVector3 mAccel; + LLVector3 mAxis; LLColor4 mColor; LLVector2 mScale; + F32 mStartGlow; + F32 mEndGlow; + LLColor4U mGlow; + static U32 sNextPartID; }; diff --git a/indra/newview/llviewerpartsource.cpp b/indra/newview/llviewerpartsource.cpp index b311f659fb..8c49ce646d 100644 --- a/indra/newview/llviewerpartsource.cpp +++ b/indra/newview/llviewerpartsource.cpp @@ -52,6 +52,8 @@ LLViewerPartSource::LLViewerPartSource(const U32 type) : static U32 id_seed = 0; mID = ++id_seed; + mLastPart = NULL; + mDelay = 0 ; } @@ -279,6 +281,22 @@ void LLViewerPartSourceScript::update(const F32 dt) { part->mFlags |= LLPartData::LL_PART_HUD; } + + if (part->mFlags & LLPartData::LL_PART_RIBBON_MASK && mLastPart) + { //set previous particle's parent to this particle to chain ribbon together + mLastPart->mParent = part; + part->mChild = mLastPart; + part->mAxis = LLVector3(0,0,1); + + if (mSourceObjectp.notNull()) + { + LLQuaternion rot = mSourceObjectp->getRenderRotation(); + part->mAxis *= rot; + } + } + + mLastPart = part; + part->mMaxAge = mPartSysData.mPartData.mMaxAge; part->mStartColor = mPartSysData.mPartData.mStartColor; part->mEndColor = mPartSysData.mPartData.mEndColor; @@ -290,6 +308,13 @@ void LLViewerPartSourceScript::update(const F32 dt) part->mAccel = mPartSysData.mPartAccel; + part->mBlendFuncDest = mPartSysData.mPartData.mBlendFuncDest; + part->mBlendFuncSource = mPartSysData.mPartData.mBlendFuncSource; + + part->mStartGlow = mPartSysData.mPartData.mStartGlow; + part->mEndGlow = mPartSysData.mPartData.mEndGlow; + part->mGlow = LLColor4U(0, 0, 0, (U8) (part->mStartGlow*255.f)); + if (mPartSysData.mPattern & LLPartSysData::LL_PART_SRC_PATTERN_DROP) { part->mPosAgent = mPosAgent; @@ -430,28 +455,51 @@ LLPointer LLViewerPartSourceScript::unpackPSS(LLViewer } -LLPointer LLViewerPartSourceScript::unpackPSS(LLViewerObject *source_objp, LLPointer pssp, LLDataPacker &dp) +LLPointer LLViewerPartSourceScript::unpackPSS(LLViewerObject *source_objp, LLPointer pssp, LLDataPacker &dp, bool legacy) { if (!pssp) { LLPointer new_pssp = new LLViewerPartSourceScript(source_objp); - if (!new_pssp->mPartSysData.unpack(dp)) + if (legacy) { - return NULL; + if (!new_pssp->mPartSysData.unpackLegacy(dp)) + { + return NULL; + } + } + else + { + if (!new_pssp->mPartSysData.unpack(dp)) + { + return NULL; + } } + if (new_pssp->mPartSysData.mTargetUUID.notNull()) { LLViewerObject *target_objp = gObjectList.findObject(new_pssp->mPartSysData.mTargetUUID); new_pssp->setTargetObject(target_objp); } + return new_pssp; } else { - if (!pssp->mPartSysData.unpack(dp)) + if (legacy) { - return NULL; + if (!pssp->mPartSysData.unpackLegacy(dp)) + { + return NULL; + } } + else + { + if (!pssp->mPartSysData.unpack(dp)) + { + return NULL; + } + } + if (pssp->mPartSysData.mTargetUUID.notNull()) { LLViewerObject *target_objp = gObjectList.findObject(pssp->mPartSysData.mTargetUUID); @@ -569,6 +617,11 @@ void LLViewerPartSourceSpiral::update(const F32 dt) part->mScale.mV[0] = 0.25f; part->mScale.mV[1] = 0.25f; part->mParameter = ll_frand(F_TWO_PI); + part->mBlendFuncDest = LLRender::BF_ONE_MINUS_SOURCE_ALPHA; + part->mBlendFuncSource = LLRender::BF_SOURCE_ALPHA; + part->mStartGlow = 0.f; + part->mEndGlow = 0.f; + part->mGlow = LLColor4U(0, 0, 0, 0); LLViewerPartSim::getInstance()->addPart(part); } @@ -721,6 +774,12 @@ void LLViewerPartSourceBeam::update(const F32 dt) part->mPosAgent = mPosAgent; part->mVelocity = mTargetPosAgent - mPosAgent; + part->mBlendFuncDest = LLRender::BF_ONE_MINUS_SOURCE_ALPHA; + part->mBlendFuncSource = LLRender::BF_SOURCE_ALPHA; + part->mStartGlow = 0.f; + part->mEndGlow = 0.f; + part->mGlow = LLColor4U(0, 0, 0, 0); + LLViewerPartSim::getInstance()->addPart(part); } } @@ -825,6 +884,12 @@ void LLViewerPartSourceChat::update(const F32 dt) part->mScale.mV[0] = 0.25f; part->mScale.mV[1] = 0.25f; part->mParameter = ll_frand(F_TWO_PI); + part->mBlendFuncDest = LLRender::BF_ONE_MINUS_SOURCE_ALPHA; + part->mBlendFuncSource = LLRender::BF_SOURCE_ALPHA; + part->mStartGlow = 0.f; + part->mEndGlow = 0.f; + part->mGlow = LLColor4U(0, 0, 0, 0); + LLViewerPartSim::getInstance()->addPart(part); } diff --git a/indra/newview/llviewerpartsource.h b/indra/newview/llviewerpartsource.h index 28702d36a2..12e926173b 100644 --- a/indra/newview/llviewerpartsource.h +++ b/indra/newview/llviewerpartsource.h @@ -76,6 +76,7 @@ public: LLVector3 mLastUpdatePosAgent; LLPointer mSourceObjectp; U32 mID; + LLViewerPart* mLastPart; //last particle emitted (for making particle ribbons) protected: U32 mType; @@ -85,7 +86,6 @@ protected: F32 mLastPartTime; LLUUID mOwnerUUID; LLPointer mImagep; - // Particle information U32 mPartFlags; // Flags for the particle U32 mDelay ; //delay to start particles @@ -114,7 +114,7 @@ public: // Returns a new particle source to attach to an object... static LLPointer unpackPSS(LLViewerObject *source_objp, LLPointer pssp, const S32 block_num); - static LLPointer unpackPSS(LLViewerObject *source_objp, LLPointer pssp, LLDataPacker &dp); + static LLPointer unpackPSS(LLViewerObject *source_objp, LLPointer pssp, LLDataPacker &dp, bool legacy); static LLPointer createPSS(LLViewerObject *source_objp, const LLPartSysData& particle_parameters); LLViewerTexture *getImage() const { return mImagep; } diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index 4dca87652d..ed62abe4ef 100644 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -476,6 +476,7 @@ void LLVOGrass::getGeometry(S32 idx, LLStrider& normalsp, LLStrider& texcoordsp, LLStrider& colorsp, + LLStrider& emissivep, LLStrider& indicesp) { if(!mNumBlades)//stop rendering grass @@ -708,7 +709,11 @@ void LLGrassPartition::getGeometry(LLSpatialGroup* group) facep->setIndicesIndex(index_count); facep->setVertexBuffer(buffer); facep->setPoolType(LLDrawPool::POOL_ALPHA); - object->getGeometry(facep->getTEOffset(), verticesp, normalsp, texcoordsp, colorsp, indicesp); + + //dummy parameter (unused by this implementation) + LLStrider emissivep; + + object->getGeometry(facep->getTEOffset(), verticesp, normalsp, texcoordsp, colorsp, emissivep, indicesp); vertex_count += facep->getGeomCount(); index_count += facep->getIndicesCount(); diff --git a/indra/newview/llvograss.h b/indra/newview/llvograss.h index b9835b8802..1fe9990cea 100644 --- a/indra/newview/llvograss.h +++ b/indra/newview/llvograss.h @@ -63,6 +63,7 @@ public: LLStrider& normalsp, LLStrider& texcoordsp, LLStrider& colorsp, + LLStrider& emissivep, LLStrider& indicesp); void updateFaceSize(S32 idx) { } diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index 1a9769f09d..53d67347d1 100644 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -49,17 +49,11 @@ const F32 MAX_PART_LIFETIME = 120.f; extern U64 gFrameTime; LLPointer LLVOPartGroup::sVB = NULL; -S32 LLVOPartGroup::sVBSlotFree[]; -S32* LLVOPartGroup::sVBSlotCursor = NULL; +S32 LLVOPartGroup::sVBSlotCursor = 0; void LLVOPartGroup::initClass() { - for (S32 i = 0; i < LL_MAX_PARTICLE_COUNT; ++i) - { - sVBSlotFree[i] = i; - } - - sVBSlotCursor = sVBSlotFree; + } //static @@ -122,36 +116,33 @@ void LLVOPartGroup::destroyGL() //static S32 LLVOPartGroup::findAvailableVBSlot() { - if (sVBSlotCursor >= sVBSlotFree+LL_MAX_PARTICLE_COUNT) + if (sVBSlotCursor >= LL_MAX_PARTICLE_COUNT) { //no more available slots return -1; } - S32 ret = *sVBSlotCursor; - sVBSlotCursor++; - - return ret; + return sVBSlotCursor++; } bool ll_is_part_idx_allocated(S32 idx, S32* start, S32* end) { - while (start < end) + /*while (start < end) { if (*start == idx) { //not allocated (in free list) return false; } ++start; - } + }*/ //allocated (not in free list) - return true; + return false; } //static void LLVOPartGroup::freeVBSlot(S32 idx) { - llassert(idx < LL_MAX_PARTICLE_COUNT && idx >= 0); + /*llassert(idx < LL_MAX_PARTICLE_COUNT && idx >= 0); llassert(sVBSlotCursor > sVBSlotFree); llassert(ll_is_part_idx_allocated(idx, sVBSlotCursor, sVBSlotFree+LL_MAX_PARTICLE_COUNT)); @@ -159,7 +150,7 @@ void LLVOPartGroup::freeVBSlot(S32 idx) { sVBSlotCursor--; *sVBSlotCursor = idx; - } + }*/ } LLVOPartGroup::LLVOPartGroup(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) @@ -189,6 +180,7 @@ F32 LLVOPartGroup::getBinRadius() void LLVOPartGroup::updateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) { const LLVector3& pos_agent = getPositionAgent(); + newMin.load3( (pos_agent - mScale).mV); newMax.load3( (pos_agent + mScale).mV); LLVector4a pos; @@ -273,6 +265,16 @@ F32 LLVOPartGroup::getPartSize(S32 idx) return 0.f; } +void LLVOPartGroup::getBlendFunc(S32 idx, U32& src, U32& dst) +{ + if (idx < (S32) mViewerPartGroupp->mParticles.size()) + { + LLViewerPart* part = mViewerPartGroupp->mParticles[idx]; + src = part->mBlendFuncSource; + dst = part->mBlendFuncDest; + } +} + LLVector3 LLVOPartGroup::getCameraPosition() const { return gAgentCamera.getCameraPositionAgent(); @@ -332,13 +334,42 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable) mDepth = 0.f; S32 i = 0 ; LLVector3 camera_agent = getCameraPosition(); + + F32 max_scale = 0.f; + + for (i = 0 ; i < (S32)mViewerPartGroupp->mParticles.size(); i++) { const LLViewerPart *part = mViewerPartGroupp->mParticles[i]; + + //remember the largest particle + max_scale = llmax(max_scale, part->mScale.mV[0], part->mScale.mV[1]); + + if (part->mFlags & LLPartData::LL_PART_RIBBON_MASK) + { //include ribbon segment length in scale + const LLVector3* pos_agent = NULL; + if (part->mParent) + { + pos_agent = &(part->mParent->mPosAgent); + } + else if (part->mPartSourcep.notNull()) + { + pos_agent = &(part->mPartSourcep->mPosAgent); + } + + if (pos_agent) + { + F32 dist = (*pos_agent-part->mPosAgent).length(); + + max_scale = llmax(max_scale, dist); + } + } + LLVector3 part_pos_agent(part->mPosAgent); LLVector3 at(part_pos_agent - camera_agent); + F32 camera_dist_squared = at.lengthSquared(); F32 inv_camera_dist_squared; if (camera_dist_squared > 1.f) @@ -411,6 +442,9 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable) facep->setSize(0, 0); } + //record max scale (used to stretch bounding box for visibility culling) + mScale.set(max_scale, max_scale, max_scale); + mDrawable->movePartition(); LLPipeline::sCompiles++; return TRUE; @@ -478,74 +512,129 @@ BOOL LLVOPartGroup::lineSegmentIntersect(const LLVector3& start, const LLVector3 void LLVOPartGroup::getGeometry(const LLViewerPart& part, LLStrider& verticesp) { - LLVector4a part_pos_agent; - part_pos_agent.load3(part.mPosAgent.mV); - LLVector4a camera_agent; - camera_agent.load3(getCameraPosition().mV); - LLVector4a at; - at.setSub(part_pos_agent, camera_agent); - LLVector4a up(0, 0, 1); - LLVector4a right; - - right.setCross3(at, up); - right.normalize3fast(); - up.setCross3(right, at); - up.normalize3fast(); - - if (part.mFlags & LLPartData::LL_PART_FOLLOW_VELOCITY_MASK) + if (part.mFlags & LLPartData::LL_PART_RIBBON_MASK) { - LLVector4a normvel; - normvel.load3(part.mVelocity.mV); - normvel.normalize3fast(); - LLVector2 up_fracs; - up_fracs.mV[0] = normvel.dot3(right).getF32(); - up_fracs.mV[1] = normvel.dot3(up).getF32(); - up_fracs.normalize(); - LLVector4a new_up; - LLVector4a new_right; - - //new_up = up_fracs.mV[0] * right + up_fracs.mV[1]*up; - LLVector4a t = right; - t.mul(up_fracs.mV[0]); - new_up = up; - new_up.mul(up_fracs.mV[1]); - new_up.add(t); - - //new_right = up_fracs.mV[1] * right - up_fracs.mV[0]*up; - t = right; - t.mul(up_fracs.mV[1]); - new_right = up; - new_right.mul(up_fracs.mV[0]); - t.sub(new_right); - - up = new_up; - right = t; - up.normalize3fast(); - right.normalize3fast(); + LLVector4a axis, pos, paxis, ppos; + F32 scale, pscale; + + pos.load3(part.mPosAgent.mV); + axis.load3(part.mAxis.mV); + scale = part.mScale.mV[0]; + + if (part.mParent) + { + ppos.load3(part.mParent->mPosAgent.mV); + paxis.load3(part.mParent->mAxis.mV); + pscale = part.mParent->mScale.mV[0]; + } + else + { //use source object as position + + if (part.mPartSourcep->mSourceObjectp.notNull()) + { + LLVector3 v = LLVector3(0,0,1); + v *= part.mPartSourcep->mSourceObjectp->getRenderRotation(); + paxis.load3(v.mV); + ppos.load3(part.mPartSourcep->mPosAgent.mV); + pscale = part.mStartScale.mV[0]; + } + else + { //no source object, no parent, nothing to draw + ppos = pos; + pscale = scale; + paxis = axis; + } + } + + LLVector4a p0, p1, p2, p3; + + scale *= 0.5f; + pscale *= 0.5f; + + axis.mul(scale); + paxis.mul(pscale); + + p0.setAdd(pos, axis); + p1.setSub(pos,axis); + p2.setAdd(ppos, paxis); + p3.setSub(ppos, paxis); + + (*verticesp++) = p2; + (*verticesp++) = p3; + (*verticesp++) = p0; + (*verticesp++) = p1; } + else + { + LLVector4a part_pos_agent; + part_pos_agent.load3(part.mPosAgent.mV); + LLVector4a camera_agent; + camera_agent.load3(getCameraPosition().mV); + LLVector4a at; + at.setSub(part_pos_agent, camera_agent); + LLVector4a up(0, 0, 1); + LLVector4a right; + + right.setCross3(at, up); + right.normalize3fast(); + up.setCross3(right, at); + up.normalize3fast(); - right.mul(0.5f*part.mScale.mV[0]); - up.mul(0.5f*part.mScale.mV[1]); + if (part.mFlags & LLPartData::LL_PART_FOLLOW_VELOCITY_MASK) + { + LLVector4a normvel; + normvel.load3(part.mVelocity.mV); + normvel.normalize3fast(); + LLVector2 up_fracs; + up_fracs.mV[0] = normvel.dot3(right).getF32(); + up_fracs.mV[1] = normvel.dot3(up).getF32(); + up_fracs.normalize(); + LLVector4a new_up; + LLVector4a new_right; + + //new_up = up_fracs.mV[0] * right + up_fracs.mV[1]*up; + LLVector4a t = right; + t.mul(up_fracs.mV[0]); + new_up = up; + new_up.mul(up_fracs.mV[1]); + new_up.add(t); + + //new_right = up_fracs.mV[1] * right - up_fracs.mV[0]*up; + t = right; + t.mul(up_fracs.mV[1]); + new_right = up; + new_right.mul(up_fracs.mV[0]); + t.sub(new_right); + + up = new_up; + right = t; + up.normalize3fast(); + right.normalize3fast(); + } + right.mul(0.5f*part.mScale.mV[0]); + up.mul(0.5f*part.mScale.mV[1]); - //HACK -- the verticesp->mV[3] = 0.f here are to set the texture index to 0 (particles don't use texture batching, maybe they should) - // this works because there is actually a 4th float stored after the vertex position which is used as a texture index - // also, somebody please VECTORIZE THIS - LLVector4a ppapu; - LLVector4a ppamu; + //HACK -- the verticesp->mV[3] = 0.f here are to set the texture index to 0 (particles don't use texture batching, maybe they should) + // this works because there is actually a 4th float stored after the vertex position which is used as a texture index + // also, somebody please VECTORIZE THIS - ppapu.setAdd(part_pos_agent, up); - ppamu.setSub(part_pos_agent, up); + LLVector4a ppapu; + LLVector4a ppamu; - verticesp->setSub(ppapu, right); - (*verticesp++).getF32ptr()[3] = 0.f; - verticesp->setSub(ppamu, right); - (*verticesp++).getF32ptr()[3] = 0.f; - verticesp->setAdd(ppapu, right); - (*verticesp++).getF32ptr()[3] = 0.f; - verticesp->setAdd(ppamu, right); - (*verticesp++).getF32ptr()[3] = 0.f; + ppapu.setAdd(part_pos_agent, up); + ppamu.setSub(part_pos_agent, up); + + verticesp->setSub(ppapu, right); + (*verticesp++).getF32ptr()[3] = 0.f; + verticesp->setSub(ppamu, right); + (*verticesp++).getF32ptr()[3] = 0.f; + verticesp->setAdd(ppapu, right); + (*verticesp++).getF32ptr()[3] = 0.f; + verticesp->setAdd(ppamu, right); + (*verticesp++).getF32ptr()[3] = 0.f; + } } @@ -555,6 +644,7 @@ void LLVOPartGroup::getGeometry(S32 idx, LLStrider& normalsp, LLStrider& texcoordsp, LLStrider& colorsp, + LLStrider& emissivep, LLStrider& indicesp) { if (idx >= (S32) mViewerPartGroupp->mParticles.size()) @@ -566,10 +656,40 @@ void LLVOPartGroup::getGeometry(S32 idx, getGeometry(part, verticesp); - *colorsp++ = part.mColor; - *colorsp++ = part.mColor; - *colorsp++ = part.mColor; - *colorsp++ = part.mColor; + LLColor4U pcolor; + LLColor4U color = part.mColor; + + LLColor4U pglow; + + if (part.mFlags & LLPartData::LL_PART_RIBBON_MASK) + { //make sure color blends properly + if (part.mParent) + { + pglow = part.mParent->mGlow; + pcolor = part.mParent->mColor; + } + else + { + pglow = LLColor4U(0, 0, 0, (U8) (255.f*part.mStartGlow)); + pcolor = part.mStartColor; + } + } + else + { + pglow = part.mGlow; + pcolor = color; + } + + *colorsp++ = pcolor; + *colorsp++ = pcolor; + *colorsp++ = color; + *colorsp++ = color; + + *emissivep++ = pglow; + *emissivep++ = pglow; + *emissivep++ = part.mGlow; + *emissivep++ = part.mGlow; + if (!(part.mFlags & LLPartData::LL_PART_EMISSIVE_MASK)) { //not fullbright, needs normal @@ -712,10 +832,13 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) LLStrider normalsp; LLStrider texcoordsp; LLStrider colorsp; + LLStrider emissivep; buffer->getVertexStrider(verticesp); buffer->getNormalStrider(normalsp); buffer->getColorStrider(colorsp); + buffer->getEmissiveStrider(emissivep); + LLSpatialGroup::drawmap_elem_t& draw_vec = group->mDrawMap[mRenderPass]; @@ -724,7 +847,7 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) LLFace* facep = *i; LLAlphaObject* object = (LLAlphaObject*) facep->getViewerObject(); - if (!facep->isState(LLFace::PARTICLE)) + //if (!facep->isState(LLFace::PARTICLE)) { //set the indices of this face S32 idx = LLVOPartGroup::findAvailableVBSlot(); if (idx >= 0) @@ -733,7 +856,7 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) facep->setIndicesIndex(idx*6); facep->setVertexBuffer(LLVOPartGroup::sVB); facep->setPoolType(LLDrawPool::POOL_ALPHA); - facep->setState(LLFace::PARTICLE); + //facep->setState(LLFace::PARTICLE); } else { @@ -748,8 +871,9 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) LLStrider cur_norm = normalsp + geom_idx; LLStrider cur_tc = texcoordsp + geom_idx; LLStrider cur_col = colorsp + geom_idx; + LLStrider cur_glow = emissivep + geom_idx; - object->getGeometry(facep->getTEOffset(), cur_vert, cur_norm, cur_tc, cur_col, cur_idx); + object->getGeometry(facep->getTEOffset(), cur_vert, cur_norm, cur_tc, cur_col, cur_glow, cur_idx); llassert(facep->getGeomCount() == 4); llassert(facep->getIndicesCount() == 6); @@ -765,9 +889,16 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) bool batched = false; + U32 bf_src = LLRender::BF_SOURCE_ALPHA; + U32 bf_dst = LLRender::BF_ONE_MINUS_SOURCE_ALPHA; + + object->getBlendFunc(facep->getTEOffset(), bf_src, bf_dst); + if (idx >= 0 && draw_vec[idx]->mTexture == facep->getTexture() && - draw_vec[idx]->mFullbright == fullbright) + draw_vec[idx]->mFullbright == fullbright && + draw_vec[idx]->mBlendFuncDst == bf_dst && + draw_vec[idx]->mBlendFuncSrc == bf_src) { if (draw_vec[idx]->mEnd == facep->getGeomIndex()-1) { @@ -799,6 +930,8 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) info->mExtents[0] = group->mObjectExtents[0]; info->mExtents[1] = group->mObjectExtents[1]; info->mVSize = vsize; + info->mBlendFuncDst = bf_dst; + info->mBlendFuncSrc = bf_src; draw_vec.push_back(info); //for alpha sorting facep->setDrawInfo(info); diff --git a/indra/newview/llvopartgroup.h b/indra/newview/llvopartgroup.h index ce05a0282e..3c2e0344a2 100644 --- a/indra/newview/llvopartgroup.h +++ b/indra/newview/llvopartgroup.h @@ -42,8 +42,7 @@ public: //vertex buffer for holding all particles static LLPointer sVB; - static S32 sVBSlotFree[LL_MAX_PARTICLE_COUNT]; - static S32* sVBSlotCursor; + static S32 sVBSlotCursor; static void initClass(); static void restoreGL(); @@ -57,6 +56,7 @@ public: LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_COLOR | + LLVertexBuffer::MAP_EMISSIVE | LLVertexBuffer::MAP_TEXTURE_INDEX }; @@ -91,10 +91,12 @@ public: LLStrider& normalsp, LLStrider& texcoordsp, LLStrider& colorsp, + LLStrider& emissivep, LLStrider& indicesp); void updateFaceSize(S32 idx) { } F32 getPartSize(S32 idx); + void getBlendFunc(S32 idx, U32& src, U32& dst); LLUUID getPartOwner(S32 idx); LLUUID getPartSource(S32 idx); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 597fb03526..0df0e653ae 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -384,7 +384,6 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys, } else { - // CORY TO DO: Figure out how to get the value here if (update_type != OUT_TERSE_IMPROVED) { LLVolumeParams volume_params; @@ -453,6 +452,11 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys, mFaceMappingChanged = TRUE; mTexAnimMode = 0; } + + if (value & 0x400) + { //particle system (new) + unpackParticleSource(*dp, mOwnerID, false); + } } else { -- cgit v1.2.3 From ebb57d28ef2ce37e0803f346610e5dff4d65eb85 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Wed, 13 Mar 2013 16:40:06 -0700 Subject: Resurrect merge victim...restoring ll_memcpy_nonaliased_aligned_16 definition --- indra/llcommon/llmemory.h | 78 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 72 insertions(+), 6 deletions(-) diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index 528af83b8f..61e30f11cc 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -182,6 +182,78 @@ inline void ll_aligned_free_32(void *p) #endif } + +// Copy words 16-byte blocks from src to dst. Source and destination MUST NOT OVERLAP. +// Source and dest must be 16-byte aligned and size must be multiple of 16. +// +inline void ll_memcpy_nonaliased_aligned_16(char* __restrict dst, const char* __restrict src, size_t bytes) +{ + assert(src != NULL); + assert(dst != NULL); + assert(bytes > 0); + assert((bytes % sizeof(F32))== 0); + ll_assert_aligned(src,16); + ll_assert_aligned(dst,16); + assert((src < dst) ? ((src + bytes) < dst) : ((dst + bytes) < src)); + assert(bytes%16==0); + + char* end = dst + bytes; + + if (bytes > 64) + { + + // Find start of 64b aligned area within block + // + void* begin_64 = LL_NEXT_ALIGNED_ADDRESS_64(dst); + + //at least 64 bytes before the end of the destination, switch to 16 byte copies + void* end_64 = end-64; + + // Prefetch the head of the 64b area now + // + _mm_prefetch((char*)begin_64, _MM_HINT_NTA); + _mm_prefetch((char*)begin_64 + 64, _MM_HINT_NTA); + _mm_prefetch((char*)begin_64 + 128, _MM_HINT_NTA); + _mm_prefetch((char*)begin_64 + 192, _MM_HINT_NTA); + + // Copy 16b chunks until we're 64b aligned + // + while (dst < begin_64) + { + + _mm_store_ps((F32*)dst, _mm_load_ps((F32*)src)); + dst += 16; + src += 16; + } + + // Copy 64b chunks up to your tail + // + // might be good to shmoo the 512b prefetch offset + // (characterize performance for various values) + // + while (dst < end_64) + { + _mm_prefetch((char*)src + 512, _MM_HINT_NTA); + _mm_prefetch((char*)dst + 512, _MM_HINT_NTA); + _mm_store_ps((F32*)dst, _mm_load_ps((F32*)src)); + _mm_store_ps((F32*)(dst + 16), _mm_load_ps((F32*)(src + 16))); + _mm_store_ps((F32*)(dst + 32), _mm_load_ps((F32*)(src + 32))); + _mm_store_ps((F32*)(dst + 48), _mm_load_ps((F32*)(src + 48))); + dst += 64; + src += 64; + } + } + + // Copy remainder 16b tail chunks (or ALL 16b chunks for sub-64b copies) + // + while (dst < end) + { + _mm_store_ps((F32*)dst, _mm_load_ps((F32*)src)); + dst += 16; + src += 16; + } +} + #ifndef __DEBUG_PRIVATE_MEM__ #define __DEBUG_PRIVATE_MEM__ 0 #endif @@ -590,13 +662,7 @@ void LLPrivateMemoryPoolTester::operator delete[](void* addr) // LLSingleton moved to llsingleton.h -LL_COMMON_API void ll_assert_aligned_func(uintptr_t ptr,U32 alignment); -#ifdef SHOW_ASSERT -#define ll_assert_aligned(ptr,alignment) ll_assert_aligned_func(reinterpret_cast(ptr),((U32)alignment)) -#else -#define ll_assert_aligned(ptr,alignment) -#endif #endif -- cgit v1.2.3 From 3a08b4e3889753e74b35a643b4753912cebe3c5a Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Wed, 13 Mar 2013 17:35:37 -0700 Subject: Now using the FBC Test panel you can select the '+' button to view FBC app settings, send a FBC app invite or send a facebook message. --- indra/newview/llpanelpeople.cpp | 37 +++++++++++++++++++++++++++++++++++++ indra/newview/llpanelpeople.h | 4 ++++ 2 files changed, 41 insertions(+) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 491b8dd7c5..dfc48145dc 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -557,6 +557,8 @@ LLPanelPeople::LLPanelPeople() mButtonsUpdater = new LLButtonsUpdater(boost::bind(&LLPanelPeople::updateButtons, this)); mCommitCallbackRegistrar.add("People.addFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this)); mCommitCallbackRegistrar.add("People.loginFBC", boost::bind(&LLPanelPeople::onLoginFbcButtonClicked, this)); + mCommitCallbackRegistrar.add("People.requestFBC", boost::bind(&LLPanelPeople::onFacebookAppRequestClicked, this)); + mCommitCallbackRegistrar.add("People.sendFBC", boost::bind(&LLPanelPeople::onFacebookAppSendClicked, this)); } LLPanelPeople::~LLPanelPeople() @@ -717,6 +719,7 @@ BOOL LLPanelPeople::postBuild() mFriendsGearButton = getChild("friends_viewsort_btn"); mGroupsGearButton = getChild("groups_viewsort_btn"); mRecentGearButton = getChild("recent_viewsort_btn"); + mFBCGearButton = getChild("fbc_options_btn"); LLMenuGL* plus_menu = LLUICtrlFactory::getInstance()->createFromFile("menu_group_plus.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mGroupPlusMenuHandle = plus_menu->getHandle(); @@ -749,6 +752,13 @@ BOOL LLPanelPeople::postBuild() mRecentGearButton->setMenu(recent_view_sort); } + LLToggleableMenu* fbc_menu = LLUICtrlFactory::getInstance()->createFromFile("menu_gear_fbc.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + if(fbc_menu) + { + mFBCMenuHandle = fbc_menu->getHandle(); + mFBCGearButton->setMenu(fbc_menu); + } + LLVoiceClient::getInstance()->addObserver(this); // call this method in case some list is empty and buttons can be in inconsistent state @@ -1656,4 +1666,31 @@ void LLPanelPeople::onLoginFbcButtonClicked() } } +void LLPanelPeople::onFacebookAppRequestClicked() +{ + LLFloaterWebContent::Params p; + p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=https://cryptic-ridge-1632.herokuapp.com/"); + LLFloater* browser = LLFloaterReg::showInstance("web_content", p); + + if (browser) + { + // start checking the browser to see if the data is available yet + mFbcTestBrowserHandle = browser->getHandle(); + mFbcTestListUpdater->setActive(true); + } +} + +void LLPanelPeople::onFacebookAppSendClicked() +{ + LLFloaterWebContent::Params p; + p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Test&link=http://www.cnet.com&redirect_uri=https://cryptic-ridge-1632.herokuapp.com/"); + LLFloater* browser = LLFloaterReg::showInstance("web_content", p); + + if (browser) + { + // start checking the browser to see if the data is available yet + mFbcTestBrowserHandle = browser->getHandle(); + mFbcTestListUpdater->setActive(true); + } +} // EOF diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 010fb5ca77..feb32d1f69 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -115,6 +115,8 @@ private: void onRecentViewSortMenuItemClicked(const LLSD& userdata); void onLoginFbcButtonClicked(); + void onFacebookAppRequestClicked(); + void onFacebookAppSendClicked(); //returns false only if group is "none" bool isRealGroup(); @@ -154,6 +156,7 @@ private: LLHandle mFriendsViewSortMenuHandle; LLHandle mGroupsViewSortMenuHandle; LLHandle mRecentViewSortMenuHandle; + LLHandle mFBCMenuHandle; LLHandle mFbcTestBrowserHandle; Updater* mFriendListUpdater; @@ -166,6 +169,7 @@ private: LLMenuButton* mFriendsGearButton; LLMenuButton* mGroupsGearButton; LLMenuButton* mRecentGearButton; + LLMenuButton* mFBCGearButton; std::string mFilterSubString; std::string mFilterSubStringOrig; -- cgit v1.2.3 From e95563e10d8c906cf4a09a1e2ff773f345a17c44 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 13 Mar 2013 21:08:17 -0500 Subject: MAINT-2410 Remove unused particle packing code and fix integration test to work without a packer. --- indra/llmessage/llpartdata.cpp | 45 ------ indra/llmessage/llpartdata.h | 5 +- indra/llmessage/tests/llpartdata_test.cpp | 256 +++++++++++------------------- 3 files changed, 98 insertions(+), 208 deletions(-) diff --git a/indra/llmessage/llpartdata.cpp b/indra/llmessage/llpartdata.cpp index 0f33a94295..41a0310ce0 100644 --- a/indra/llmessage/llpartdata.cpp +++ b/indra/llmessage/llpartdata.cpp @@ -66,40 +66,6 @@ bool LLPartData::hasBlendFunc() const return mBlendFuncSource != LLPartData::LL_PART_BF_SOURCE_ALPHA || mBlendFuncDest != LLPartData::LL_PART_BF_ONE_MINUS_SOURCE_ALPHA; } -LLSD LLPartData::asLLSD() const -{ - LLSD sd = LLSD(); - sd["pdflags"] = ll_sd_from_U32(mFlags); - sd["pdmaxage"] = mMaxAge; - sd["pdstartcolor"] = ll_sd_from_color4(mStartColor); - sd["pdendcolor"] = ll_sd_from_color4(mEndColor); - sd["pdstartscale"] = ll_sd_from_vector2(mStartScale); - sd["pdendscale"] = ll_sd_from_vector2(mEndScale); - sd["pdstartglow"] = mStartGlow; - sd["pdendglow"] = mEndGlow; - sd["pdblendsource"] = (S32)mBlendFuncSource; - sd["pdblenddest"] = (S32)mBlendFuncDest; - - return sd; -} - -bool LLPartData::fromLLSD(LLSD& sd) -{ - mFlags = ll_U32_from_sd(sd["pdflags"]); - mMaxAge = (F32)sd["pdmaxage"].asReal(); - mStartColor = ll_color4_from_sd(sd["pdstartcolor"]); - mEndColor = ll_color4_from_sd(sd["pdendcolor"]); - mStartScale = ll_vector2_from_sd(sd["pdstartscale"]); - mEndScale = ll_vector2_from_sd(sd["pdendscale"]); - - mStartGlow = sd.has("pdstartglow") ? sd["pdstartglow"].asReal() : 0.f; - mEndGlow = sd.has("pdendglow") ? sd["pdendglow"].asReal() : 0.f; - mBlendFuncSource = sd.has("pdblendsource") ? (U8)sd["pdblendsource"].asInteger() : LL_PART_BF_SOURCE_ALPHA; - mBlendFuncDest = sd.has("pdblenddest") ? (U8)sd["pdblenddest"].asInteger() : LL_PART_BF_ONE_MINUS_SOURCE_ALPHA; - - return true; -} - S32 LLPartData::getSize() const { S32 size = PS_LEGACY_PART_DATA_BLOCK_SIZE; @@ -126,17 +92,6 @@ BOOL LLPartData::unpackLegacy(LLDataPacker &dp) dp.unpackFixed(mEndScale.mV[0], "pdendscalex", FALSE, 3, 5); dp.unpackFixed(mEndScale.mV[1], "pdendscaley", FALSE, 3, 5); - /*if (dp.hasNext()) - { - U8 tmp_glow = 0; - dp.unpackU8(tmp_glow,"pdstartglow"); - mStartGlow = tmp_glow / 255.f; - dp.unpackU8(tmp_glow,"pdendglow"); - mEndGlow = tmp_glow / 255.f; - dp.unpackU8(mBlendFuncSource,"pdblendsource"); - dp.unpackU8(mBlendFuncDest,"pdblenddest"); - }*/ - mStartGlow = 0.f; mEndGlow = 0.f; mBlendFuncSource = LLPartData::LL_PART_BF_SOURCE_ALPHA; diff --git a/indra/llmessage/llpartdata.h b/indra/llmessage/llpartdata.h index 80a52b79dd..ed5c1a6ac7 100644 --- a/indra/llmessage/llpartdata.h +++ b/indra/llmessage/llpartdata.h @@ -92,10 +92,7 @@ public: BOOL unpack(LLDataPacker &dp); BOOL pack(LLDataPacker &dp); - LLSD asLLSD() const; - operator LLSD() const {return asLLSD(); } - bool fromLLSD(LLSD& sd); - + bool hasGlow() const; bool hasBlendFunc() const; diff --git a/indra/llmessage/tests/llpartdata_test.cpp b/indra/llmessage/tests/llpartdata_test.cpp index 9123bd06c7..de81e0bbb2 100644 --- a/indra/llmessage/tests/llpartdata_test.cpp +++ b/indra/llmessage/tests/llpartdata_test.cpp @@ -38,10 +38,34 @@ namespace tut { + + //bunch of sniffed data that *should* be a valid particle system + static U8 msg[] = { + 0x44, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x80, 0x00, 0x80, + 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x5e, 0x12, 0x0b, 0xa1, 0x58, 0x05, 0xdc, 0x57, 0x66, + 0xb7, 0xf5, 0xac, 0x4b, 0xd1, 0x8f, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x02, 0x05, 0x02, 0x00, 0x00, 0x0a, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x7e, 0xc6, 0x81, 0xdc, 0x7e, 0xc6, 0x81, 0xdc, 0x77, 0xcf, 0xef, 0xd4, 0xce, 0x64, 0x1a, 0x7e, + 0x26, 0x87, 0x55, 0x7f, 0xdd, 0x65, 0x22, 0x7f, 0xdd, 0x65, 0x22, 0x7f, 0x77, 0xcf, 0x98, 0xa3, 0xab, + 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd1, 0xf2, + 0xf1, 0x65, 0x32, 0x1b, 0xef, 0x18, 0x70, 0x66, 0xba, 0x30, 0xa0, 0x11, 0xaa, 0x2f, 0xb0, 0xab, 0xd0, + 0x30, 0x7d, 0xbd, 0x01, 0x00, 0xf8, 0x0d, 0xb8, 0x30, 0x01, 0x00, 0x00, 0x00, 0xce, 0xc6, 0x81, 0xdc, + 0xce, 0xc6, 0x81, 0xdc, 0xc7, 0xcf, 0xef, 0xd4, 0x75, 0x65, 0x1a, 0x7f, 0x62, 0x6f, 0x55, 0x7f, 0x6d, + 0x65, 0x22, 0x7f, 0x6d, 0x65, 0x22, 0x7f, 0xc7, 0xcf, 0x98, 0xa3, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, + 0xab, 0xab, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xf2, 0xf1, 0x62, 0x12, 0x1b, 0xef, + 0x18, 0x7e, 0xbd, 0x01, 0x00, 0x16, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x7c, 0xac, 0x28, 0x03, 0x80, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, + 0xe0, 0xb9, 0x30, 0x03, 0xe1, 0xb9, 0x30, 0xbb, 0x00, 0x00, 0x00, 0x48, 0xe0, 0xb9, 0x30, 0x36, 0xd9, + 0x81, 0xdc, 0x36, 0xd9, 0x81, 0xdc, 0x3f, 0xd0, 0xef, 0xd4, 0xa5, 0x7a, 0x72, 0x7f, 0x26, 0x30, 0x55, + 0x7f, 0x95, 0x7a, 0x22, 0x7f, 0x95, 0x7a, 0x22, 0x7f, 0x3f, 0xd0, 0x98, 0xa3, 0xab, 0xab, 0xab, 0xab, + 0xab, 0xab, 0xab, 0xab, 0x00, 0x00, 0x00, 0x00, 0x00 }; struct partdata_test { }; + typedef test_group partdata_test_t; typedef partdata_test_t::object partdata_test_object_t; tut::partdata_test_t tut_partdata_test("LLPartData"); @@ -49,168 +73,82 @@ namespace tut template<> template<> void partdata_test_object_t::test<1>() { - LLPartData llpdata,llpdata1; - U8 pkbuf[128]; - - llpdata.setFlags(LLPartData::LL_PART_INTERP_COLOR_MASK | LLPartData::LL_PART_INTERP_SCALE_MASK | - LLPartData::LL_PART_BOUNCE_MASK | LLPartData::LL_PART_WIND_MASK | LLPartData::LL_PART_FOLLOW_SRC_MASK | - LLPartData::LL_PART_FOLLOW_VELOCITY_MASK | LLPartData::LL_PART_TARGET_POS_MASK | LLPartData::LL_PART_TARGET_LINEAR_MASK | - LLPartData::LL_PART_EMISSIVE_MASK | LLPartData::LL_PART_BEAM_MASK | LLPartData::LL_PART_DEAD_MASK); - - llpdata.setMaxAge(29.3f); - - LLVector3 llvec1(1.0f, .5f, .25f); - llpdata.setStartColor(llvec1); - llpdata.setStartAlpha(.7f); - - LLVector3 llvec2(.2f, .3f, 1.0f); - llpdata.setEndColor(llvec2); - llpdata.setEndAlpha(1.0f); + LLPartSysData llpsysdata; + LLDataPackerBinaryBuffer dp1(msg, sizeof(msg)); - llpdata.setStartScale(3.23f, 4.0f); - llpdata.setEndScale(2.4678f, 1.0f); + ensure("LLPartSysData::unpack failed.", llpsysdata.unpack(dp1)); - LLDataPackerBinaryBuffer dp((U8*)pkbuf, 128); - llpdata.pack(dp); - S32 cur_size = dp.getCurrentSize(); - - LLDataPackerBinaryBuffer dp1((U8*)pkbuf, cur_size); - llpdata1.unpack(dp1); - - ensure("1.mFlags values are different after unpacking", llpdata1.mFlags == llpdata.mFlags); - ensure_approximately_equals("2.mMaxAge values are different after unpacking", llpdata1.mMaxAge, llpdata.mMaxAge, 8); - - ensure_approximately_equals("3.mStartColor[0] values are different after unpacking", llpdata1.mStartColor.mV[0], llpdata.mStartColor.mV[0], 8); - ensure_approximately_equals("4.mStartColor[1] values are different after unpacking", llpdata1.mStartColor.mV[1], llpdata.mStartColor.mV[1], 8); - ensure_approximately_equals("5.mStartColor[2] values are different after unpacking", llpdata1.mStartColor.mV[2], llpdata.mStartColor.mV[2], 8); - ensure_approximately_equals("6.mStartColor[3] values are different after unpacking", llpdata1.mStartColor.mV[3], llpdata.mStartColor.mV[3], 8); - - ensure_approximately_equals("7.mEndColor[0] values are different after unpacking", llpdata1.mEndColor.mV[0], llpdata.mEndColor.mV[0], 8); - ensure_approximately_equals("8.mEndColor[1] values are different after unpacking", llpdata1.mEndColor.mV[1], llpdata.mEndColor.mV[1], 8); - ensure_approximately_equals("9.mEndColor[2] values are different after unpacking", llpdata1.mEndColor.mV[2], llpdata.mEndColor.mV[2], 8); - ensure_approximately_equals("10.mEndColor[2] values are different after unpacking", llpdata1.mEndColor.mV[3], llpdata.mEndColor.mV[3], 8); - - ensure_approximately_equals("11.mStartScale[0] values are different after unpacking", llpdata1.mStartScale.mV[0], llpdata.mStartScale.mV[0], 5); - ensure_approximately_equals("12.mStartScale[1] values are different after unpacking", llpdata1.mStartScale.mV[1], llpdata.mStartScale.mV[1], 5); - - ensure_approximately_equals("13.mEndScale[0] values are different after unpacking", llpdata1.mEndScale.mV[0], llpdata.mEndScale.mV[0], 5); - ensure_approximately_equals("14.mEndScale[1] values are different after unpacking", llpdata1.mEndScale.mV[1], llpdata.mEndScale.mV[1], 5); - } - - - template<> template<> - void partdata_test_object_t::test<2>() - { - LLPartData llpdata,llpdata1; - - llpdata.setFlags(LLPartData::LL_PART_INTERP_COLOR_MASK | LLPartData::LL_PART_INTERP_SCALE_MASK | - LLPartData::LL_PART_BOUNCE_MASK | LLPartData::LL_PART_WIND_MASK | LLPartData::LL_PART_FOLLOW_SRC_MASK | - LLPartData::LL_PART_FOLLOW_VELOCITY_MASK | LLPartData::LL_PART_TARGET_POS_MASK | LLPartData::LL_PART_TARGET_LINEAR_MASK | - LLPartData::LL_PART_EMISSIVE_MASK | LLPartData::LL_PART_BEAM_MASK | LLPartData::LL_PART_DEAD_MASK); - - llpdata.setMaxAge(29.3f); - - LLVector3 llvec1(1.0f, .5f, .25f); - llpdata.setStartColor(llvec1); - llpdata.setStartAlpha(.7f); - - LLVector3 llvec2(.2f, .3f, 1.0f); - llpdata.setEndColor(llvec2); - llpdata.setEndAlpha(1.0f); - - llpdata.setStartScale(3.23f, 4.0f); - llpdata.setEndScale(2.4678f, 1.0f); - - LLSD llsd = llpdata.asLLSD(); - - llpdata1.fromLLSD(llsd); - - ensure("1.mFlags values are different after unpacking", llpdata1.mFlags == llpdata.mFlags); - ensure_approximately_equals("2.mMaxAge values are different after unpacking", llpdata1.mMaxAge, llpdata.mMaxAge, 8); - - ensure_approximately_equals("3.mStartColor[0] values are different after unpacking", llpdata1.mStartColor.mV[0], llpdata.mStartColor.mV[0], 8); - ensure_approximately_equals("4.mStartColor[1] values are different after unpacking", llpdata1.mStartColor.mV[1], llpdata.mStartColor.mV[1], 8); - ensure_approximately_equals("5.mStartColor[2] values are different after unpacking", llpdata1.mStartColor.mV[2], llpdata.mStartColor.mV[2], 8); - ensure_approximately_equals("6.mStartColor[3] values are different after unpacking", llpdata1.mStartColor.mV[3], llpdata.mStartColor.mV[3], 8); - - ensure_approximately_equals("7.mEndColor[0] values are different after unpacking", llpdata1.mEndColor.mV[0], llpdata.mEndColor.mV[0], 8); - ensure_approximately_equals("8.mEndColor[1] values are different after unpacking", llpdata1.mEndColor.mV[1], llpdata.mEndColor.mV[1], 8); - ensure_approximately_equals("9.mEndColor[2] values are different after unpacking", llpdata1.mEndColor.mV[2], llpdata.mEndColor.mV[2], 8); - ensure_approximately_equals("10.mEndColor[2] values are different after unpacking", llpdata1.mEndColor.mV[3], llpdata.mEndColor.mV[3], 8); - - ensure_approximately_equals("11.mStartScale[0] values are different after unpacking", llpdata1.mStartScale.mV[0], llpdata.mStartScale.mV[0], 5); - ensure_approximately_equals("12.mStartScale[1] values are different after unpacking", llpdata1.mStartScale.mV[1], llpdata.mStartScale.mV[1], 5); - - ensure_approximately_equals("13.mEndScale[0] values are different after unpacking", llpdata1.mEndScale.mV[0], llpdata.mEndScale.mV[0], 5); - ensure_approximately_equals("14.mEndScale[1] values are different after unpacking", llpdata1.mEndScale.mV[1], llpdata.mEndScale.mV[1], 5); - } - - -//*********llpartsysdata*********** - - template<> template<> - void partdata_test_object_t::test<3>() - { - LLPartSysData llpsysdata, llpsysdata1; - U8 pkbuf[256]; - llpsysdata.setBurstSpeedMin(33.33f); - ensure("1.mBurstSpeedMin coudnt be set", 33.33f == llpsysdata.mBurstSpeedMin); - - llpsysdata.setBurstSpeedMax(44.44f); - ensure("2.mBurstSpeedMax coudnt be set", 44.44f == llpsysdata.mBurstSpeedMax); - - llpsysdata.setBurstRadius(45.55f); - ensure("3.mBurstRadius coudnt be set", 45.55f == llpsysdata.mBurstRadius); - - LLVector3 llvec(44.44f, 111.11f, -40.4f); - llpsysdata.setPartAccel(llvec); - - llpsysdata.mCRC = 0xFFFFFFFF; - llpsysdata.mFlags = 0x20; - - llpsysdata.mPattern = LLPartSysData::LL_PART_SRC_PATTERN_ANGLE_CONE_EMPTY; - - llpsysdata.mMaxAge = 99.99f; - llpsysdata.mStartAge = 18.5f; - llpsysdata.mInnerAngle = 4.234f; - llpsysdata.mOuterAngle = 7.123f; - llpsysdata.mBurstRate = 245.53f; - llpsysdata.mBurstPartCount = 0xFF; - llpsysdata.mAngularVelocity = llvec; - - llpsysdata.mPartImageID.generate(); - llpsysdata.mTargetUUID.generate(); + //mCRC 1 unsigned int + ensure("mCRC different after unpacking", llpsysdata.mCRC == (U32) 1); + //mFlags 0 unsigned int + ensure ("mFlags different after unpacking", llpsysdata.mFlags == (U32) 0); + //mPattern 1 '' unsigned char + ensure ("mPattern different after unpacking", llpsysdata.mPattern == (U8) 1); + //mInnerAngle 0.00000000 float + ensure_approximately_equals("mInnerAngle different after unpacking", llpsysdata.mInnerAngle, 0.f, 8); + //mOuterAngle 0.00000000 float + ensure_approximately_equals("mOuterAngle different after unpacking", llpsysdata.mOuterAngle, 0.f, 8); + //mAngularVelocity 0,0,0 + ensure_approximately_equals("mAngularVelocity.mV[0] different after unpacking", llpsysdata.mAngularVelocity.mV[0], 0.f, 8); + ensure_approximately_equals("mAngularVelocity.mV[0] different after unpacking", llpsysdata.mAngularVelocity.mV[1], 0.f, 8); + ensure_approximately_equals("mAngularVelocity.mV[0] different after unpacking", llpsysdata.mAngularVelocity.mV[2], 0.f, 8); + //mBurstRate 0.097656250 float + ensure_approximately_equals("mBurstRate different after unpacking", llpsysdata.mBurstRate, 0.097656250f, 8); + //mBurstPartCount 1 '' unsigned char + ensure("mBurstPartCount different after unpacking", llpsysdata.mBurstPartCount == (U8) 1); + //mBurstRadius 0.00000000 float + ensure_approximately_equals("mBurstRadius different after unpacking", llpsysdata.mBurstRadius, 0.f, 8); + //mBurstSpeedMin 1.0000000 float + ensure_approximately_equals("mBurstSpeedMin different after unpacking", llpsysdata.mBurstSpeedMin, 1.f, 8); + //mBurstSpeedMax 1.0000000 float + ensure_approximately_equals("mBurstSpeedMax different after unpacking", llpsysdata.mBurstSpeedMax, 1.f, 8); + //mMaxAge 0.00000000 float + ensure_approximately_equals("mMaxAge different after unpacking", llpsysdata.mMaxAge, 0.f, 8); + //mStartAge 0.00000000 float + ensure_approximately_equals("mStartAge different after unpacking", llpsysdata.mStartAge, 0.f, 8); + //mPartAccel <0,0,0> + ensure_approximately_equals("mPartAccel.mV[0] different after unpacking", llpsysdata.mPartAccel.mV[0], 0.f, 7); + ensure_approximately_equals("mPartAccel.mV[1] different after unpacking", llpsysdata.mPartAccel.mV[1], 0.f, 7); + ensure_approximately_equals("mPartAccel.mV[2] different after unpacking", llpsysdata.mPartAccel.mV[2], 0.f, 7); + + //mPartData + LLPartData& data = llpsysdata.mPartData; + + //mFlags 132354 unsigned int + ensure ("mPartData.mFlags different after unpacking", data.mFlags == (U32) 132354); + //mMaxAge 10.000000 float + ensure_approximately_equals("mPartData.mMaxAge different after unpacking", data.mMaxAge, 10.f, 8); + //mStartColor <1,1,1,1> + ensure_approximately_equals("mPartData.mStartColor.mV[0] different after unpacking", data.mStartColor.mV[0], 1.f, 8); + ensure_approximately_equals("mPartData.mStartColor.mV[1] different after unpacking", data.mStartColor.mV[1], 1.f, 8); + ensure_approximately_equals("mPartData.mStartColor.mV[2] different after unpacking", data.mStartColor.mV[2], 1.f, 8); + ensure_approximately_equals("mPartData.mStartColor.mV[3] different after unpacking", data.mStartColor.mV[3], 1.f, 8); + //mEndColor <1,1,0,0> + ensure_approximately_equals("mPartData.mEndColor.mV[0] different after unpacking", data.mEndColor.mV[0], 1.f, 8); + ensure_approximately_equals("mPartData.mEndColor.mV[1] different after unpacking", data.mEndColor.mV[1], 1.f, 8); + ensure_approximately_equals("mPartData.mEndColor.mV[2] different after unpacking", data.mEndColor.mV[2], 0.f, 8); + ensure_approximately_equals("mPartData.mEndColor.mV[3] different after unpacking", data.mEndColor.mV[3], 0.f, 8); + //mStartScale <1,1> + ensure_approximately_equals("mPartData.mStartScale.mV[0] different after unpacking", data.mStartScale.mV[0], 1.f, 8); + ensure_approximately_equals("mPartData.mStartScale.mV[1] different after unpacking", data.mStartScale.mV[1], 1.f, 8); + //mEndScale <0,0> + ensure_approximately_equals("mPartData.mEndScale.mV[0] different after unpacking", data.mEndScale.mV[0], 0.f, 8); + ensure_approximately_equals("mPartData.mEndScale.mV[1] different after unpacking", data.mEndScale.mV[1], 0.f, 8); + //mPosOffset <0,0,0> + ensure_approximately_equals("mPartData.mPosOffset.mV[0] different after unpacking", data.mPosOffset.mV[0], 0.f, 8); + ensure_approximately_equals("mPartData.mPosOffset.mV[1] different after unpacking", data.mPosOffset.mV[1], 0.f, 8); + ensure_approximately_equals("mPartData.mPosOffset.mV[2] different after unpacking", data.mPosOffset.mV[2], 0.f, 8); + //mParameter 0.00000000 float + ensure_approximately_equals("mPartData.mParameter different after unpacking", data.mParameter, 0.f, 8); - LLDataPackerBinaryBuffer dp((U8*)pkbuf, 256); - llpsysdata.pack(dp); - S32 cur_size = dp.getCurrentSize(); - LLDataPackerBinaryBuffer dp1((U8*)pkbuf, cur_size); - llpsysdata1.unpack(dp1); - - ensure("1.mCRC's not equal", llpsysdata.mCRC == llpsysdata1.mCRC); - ensure("2.mFlags's not equal", llpsysdata.mFlags == llpsysdata1.mFlags); - ensure("3.mPattern's not equal", llpsysdata.mPattern == llpsysdata1.mPattern); - ensure_approximately_equals("4.mMaxAge's not equal", llpsysdata.mMaxAge , llpsysdata1.mMaxAge, 8); - ensure_approximately_equals("5.mStartAge's not equal", llpsysdata.mStartAge, llpsysdata1.mStartAge, 8); - ensure_approximately_equals("6.mOuterAngle's not equal", llpsysdata.mOuterAngle, llpsysdata1.mOuterAngle, 5); - ensure_approximately_equals("7.mInnerAngles's not equal", llpsysdata.mInnerAngle, llpsysdata1.mInnerAngle, 5); - ensure_approximately_equals("8.mBurstRate's not equal", llpsysdata.mBurstRate, llpsysdata1.mBurstRate, 8); - ensure("9.mBurstPartCount's not equal", llpsysdata.mBurstPartCount == llpsysdata1.mBurstPartCount); - - ensure_approximately_equals("10.mBurstSpeedMin's not equal", llpsysdata.mBurstSpeedMin, llpsysdata1.mBurstSpeedMin, 8); - ensure_approximately_equals("11.mBurstSpeedMax's not equal", llpsysdata.mBurstSpeedMax, llpsysdata1.mBurstSpeedMax, 8); - - ensure_approximately_equals("12.mAngularVelocity's not equal", llpsysdata.mAngularVelocity.mV[0], llpsysdata1.mAngularVelocity.mV[0], 7); - ensure_approximately_equals("13.mAngularVelocity's not equal", llpsysdata.mAngularVelocity.mV[1], llpsysdata1.mAngularVelocity.mV[1], 7); - ensure_approximately_equals("14.mAngularVelocity's not equal", llpsysdata.mAngularVelocity.mV[2], llpsysdata1.mAngularVelocity.mV[2], 7); - - ensure_approximately_equals("15.mPartAccel's not equal", llpsysdata.mPartAccel.mV[0], llpsysdata1.mPartAccel.mV[0], 7); - ensure_approximately_equals("16.mPartAccel's not equal", llpsysdata.mPartAccel.mV[1], llpsysdata1.mPartAccel.mV[1], 7); - ensure_approximately_equals("17.mPartAccel's not equal", llpsysdata.mPartAccel.mV[2], llpsysdata1.mPartAccel.mV[2], 7); - - ensure("18.mPartImageID's not equal", llpsysdata.mPartImageID == llpsysdata1.mPartImageID); - ensure("19.mTargetUUID's not equal", llpsysdata.mTargetUUID == llpsysdata1.mTargetUUID); - ensure_approximately_equals("20.mBurstRadius's not equal", llpsysdata.mBurstRadius, llpsysdata1.mBurstRadius, 8); + //mStartGlow 0.00000000 float + ensure_approximately_equals("mPartData.mStartGlow different after unpacking", data.mStartGlow, 0.f, 8); + //mEndGlow 0.00000000 float + ensure_approximately_equals("mPartData.mEndGlow different after unpacking", data.mEndGlow, 0.f, 8); + //mBlendFuncSource 2 '' unsigned char + ensure("mPartData.mBlendFuncSource different after unpacking", data.mBlendFuncSource == (U8) 2); + //mBlendFuncDest 1 '' unsigned char + ensure("mPartData.mBlendFuncDest different after unpacking", data.mBlendFuncDest == (U8) 1); } } -- cgit v1.2.3 From 85257154a3ba001ecadacf4d81baa6f9c187a041 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Thu, 14 Mar 2013 14:01:39 -0700 Subject: Rollback fix for Maestro 'Jitter Bug' which is causing issues elsewhere --- indra/llcharacter/lleditingmotion.cpp | 4 +- indra/llcharacter/llheadrotmotion.cpp | 4 +- indra/llcharacter/llkeyframemotion.cpp | 6 +- indra/llcharacter/llkeyframewalkmotion.cpp | 6 +- indra/llcharacter/llmotion.cpp | 4 +- indra/llcharacter/lltargetingmotion.cpp | 2 +- indra/llcommon/llcriticaldamp.cpp | 50 +++++++++----- indra/llcommon/llcriticaldamp.h | 82 +--------------------- indra/llui/llbutton.cpp | 5 +- indra/llui/lllayoutstack.cpp | 12 ++-- indra/llui/llmenugl.cpp | 2 +- indra/llui/llscrollbar.cpp | 5 +- indra/llui/lltabcontainer.cpp | 3 +- indra/newview/llagentcamera.cpp | 23 +++---- indra/newview/lldrawable.cpp | 106 ++++++++++++++++------------- indra/newview/llfasttimerview.cpp | 4 +- indra/newview/llfloatercolorpicker.cpp | 5 +- indra/newview/llfloatersnapshot.cpp | 5 +- indra/newview/llfolderviewitem.cpp | 7 +- indra/newview/llfollowcam.cpp | 17 ++--- indra/newview/llhudnametag.cpp | 3 +- indra/newview/llmaniprotate.cpp | 18 ++--- indra/newview/llmanipscale.cpp | 5 +- indra/newview/llmaniptranslate.cpp | 13 ++-- indra/newview/llnetmap.cpp | 3 +- indra/newview/llselectmgr.cpp | 9 --- indra/newview/lltexturectrl.cpp | 4 +- indra/newview/llviewerdisplay.cpp | 3 +- indra/newview/llvoavatar.cpp | 12 ++-- indra/newview/llvovolume.cpp | 5 +- indra/newview/llworldmapview.cpp | 4 +- 31 files changed, 182 insertions(+), 249 deletions(-) diff --git a/indra/llcharacter/lleditingmotion.cpp b/indra/llcharacter/lleditingmotion.cpp index 35508e0a87..4e8c3268c5 100644 --- a/indra/llcharacter/lleditingmotion.cpp +++ b/indra/llcharacter/lleditingmotion.cpp @@ -38,6 +38,8 @@ // Constants //----------------------------------------------------------------------------- const LLQuaternion EDIT_MOTION_WRIST_ROTATION(F_PI_BY_TWO * 0.7f, LLVector3(1.0f, 0.0f, 0.0f)); +const F32 TARGET_LAG_HALF_LIFE = 0.1f; // half-life of IK targeting +const F32 TORSO_LAG_HALF_LIFE = 0.2f; const F32 MAX_TIME_DELTA = 2.f; //max two seconds a frame for calculating interpolation S32 LLEditingMotion::sHandPose = LLHandMotion::HAND_POSE_RELAXED_R; @@ -230,7 +232,7 @@ BOOL LLEditingMotion::onUpdate(F32 time, U8* joint_mask) mIKSolver.solve(); // use blending... - F32 slerp_amt = LLCriticalDamp::getInterpolant(InterpDeltaTargetLagHalfLife); + F32 slerp_amt = LLCriticalDamp::getInterpolant(TARGET_LAG_HALF_LIFE); shoulderRot = slerp(slerp_amt, mShoulderJoint.getRotation(), shoulderRot); elbowRot = slerp(slerp_amt, mElbowJoint.getRotation(), elbowRot); diff --git a/indra/llcharacter/llheadrotmotion.cpp b/indra/llcharacter/llheadrotmotion.cpp index 1eddd0f449..2b1aa194a9 100644 --- a/indra/llcharacter/llheadrotmotion.cpp +++ b/indra/llcharacter/llheadrotmotion.cpp @@ -182,8 +182,8 @@ BOOL LLHeadRotMotion::onUpdate(F32 time, U8* joint_mask) LLQuaternion currentRootRotWorld = mRootJoint->getWorldRotation(); LLQuaternion currentInvRootRotWorld = ~currentRootRotWorld; - F32 head_slerp_amt = LLCriticalDamp::getInterpolant(InterpDeltaHeadLookAtLagHalfLife); - F32 torso_slerp_amt = LLCriticalDamp::getInterpolant(InterpDeltaTorsoLookAtLagHalfLife); + F32 head_slerp_amt = LLCriticalDamp::getInterpolant(HEAD_LOOKAT_LAG_HALF_LIFE); + F32 torso_slerp_amt = LLCriticalDamp::getInterpolant(TORSO_LOOKAT_LAG_HALF_LIFE); LLVector3* targetPos = (LLVector3*)mCharacter->getAnimationData("LookAtPoint"); diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index f394cf2635..905d1c2d26 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -1031,11 +1031,11 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8 if (constraint->mSharedData->mChainLength != 0 && dist_vec_squared(root_pos, target_pos) * 0.95f > constraint->mTotalLength * constraint->mTotalLength) { - constraint->mWeight = lerp(constraint->mWeight, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaSmaller)); + constraint->mWeight = lerp(constraint->mWeight, 0.f, LLCriticalDamp::getInterpolant(0.1f)); } else { - constraint->mWeight = lerp(constraint->mWeight, 1.f, LLCriticalDamp::getInterpolant(InterpDeltaSmallish)); + constraint->mWeight = lerp(constraint->mWeight, 1.f, LLCriticalDamp::getInterpolant(0.3f)); } F32 weight = constraint->mWeight * ((shared_data->mEaseOutStopTime == 0.f) ? 1.f : @@ -1084,7 +1084,7 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8 F32 time_constant = 1.f / clamp_rescale(constraint->mFixupDistanceRMS, 0.f, 0.5f, 0.2f, 8.f); // llinfos << "Interpolant " << LLCriticalDamp::getInterpolant(time_constant, FALSE) << " and fixup distance " << constraint->mFixupDistanceRMS << " on " << mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << llendl; positions[joint_num] = lerp(positions[joint_num], kinematic_position, - LLCriticalDamp::getInterpolant(time_constant)); + LLCriticalDamp::getInterpolant(time_constant, FALSE)); } S32 iteration_count; diff --git a/indra/llcharacter/llkeyframewalkmotion.cpp b/indra/llcharacter/llkeyframewalkmotion.cpp index d17c123e54..8422553beb 100644 --- a/indra/llcharacter/llkeyframewalkmotion.cpp +++ b/indra/llcharacter/llkeyframewalkmotion.cpp @@ -287,7 +287,7 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask) F32 desired_speed_multiplier = llclamp(speed / foot_speed, min_speed_multiplier, ANIM_SPEED_MAX); // blend towards new speed adjustment value - F32 new_speed_adjust = lerp(mAdjustedSpeed, desired_speed_multiplier, LLCriticalDamp::getInterpolant(InterpDeltaSpeedAdjustTime)); + F32 new_speed_adjust = lerp(mAdjustedSpeed, desired_speed_multiplier, LLCriticalDamp::getInterpolant(SPEED_ADJUST_TIME_CONSTANT)); // limit that rate at which the speed adjustment changes F32 speedDelta = llclamp(new_speed_adjust - mAdjustedSpeed, -SPEED_ADJUST_MAX_SEC * delta_time, SPEED_ADJUST_MAX_SEC * delta_time); @@ -305,8 +305,8 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask) { // standing/turning // damp out speed adjustment to 0 - mAnimSpeed = lerp(mAnimSpeed, 1.f, LLCriticalDamp::getInterpolant(InterpDeltaSmall)); - //mPelvisOffset = lerp(mPelvisOffset, LLVector3::zero, LLCriticalDamp::getInterpolant(InterpDeltaSmall)); + mAnimSpeed = lerp(mAnimSpeed, 1.f, LLCriticalDamp::getInterpolant(0.2f)); + //mPelvisOffset = lerp(mPelvisOffset, LLVector3::zero, LLCriticalDamp::getInterpolant(0.2f)); } // broadcast walk speed change diff --git a/indra/llcharacter/llmotion.cpp b/indra/llcharacter/llmotion.cpp index d4db0d84c9..a07f9f4d2e 100644 --- a/indra/llcharacter/llmotion.cpp +++ b/indra/llcharacter/llmotion.cpp @@ -73,7 +73,7 @@ void LLMotion::fadeOut() { if (mFadeWeight > 0.01f) { - mFadeWeight = lerp(mFadeWeight, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaFadeWeight)); + mFadeWeight = lerp(mFadeWeight, 0.f, LLCriticalDamp::getInterpolant(0.15f)); } else { @@ -88,7 +88,7 @@ void LLMotion::fadeIn() { if (mFadeWeight < 0.99f) { - mFadeWeight = lerp(mFadeWeight, 1.f, LLCriticalDamp::getInterpolant(InterpDeltaFadeWeight)); + mFadeWeight = lerp(mFadeWeight, 1.f, LLCriticalDamp::getInterpolant(0.15f)); } else { diff --git a/indra/llcharacter/lltargetingmotion.cpp b/indra/llcharacter/lltargetingmotion.cpp index 6ce6ce31d6..fa5f06328e 100644 --- a/indra/llcharacter/lltargetingmotion.cpp +++ b/indra/llcharacter/lltargetingmotion.cpp @@ -106,7 +106,7 @@ BOOL LLTargetingMotion::onActivate() //----------------------------------------------------------------------------- BOOL LLTargetingMotion::onUpdate(F32 time, U8* joint_mask) { - F32 slerp_amt = LLCriticalDamp::getInterpolant(InterpDeltaTorsoTargetLagHalfLife); + F32 slerp_amt = LLCriticalDamp::getInterpolant(TORSO_TARGET_HALF_LIFE); LLVector3 target; LLVector3* lookAtPoint = (LLVector3*)mCharacter->getAnimationData("LookAtPoint"); diff --git a/indra/llcommon/llcriticaldamp.cpp b/indra/llcommon/llcriticaldamp.cpp index 27fef0e6dc..49aac9ce75 100644 --- a/indra/llcommon/llcriticaldamp.cpp +++ b/indra/llcommon/llcriticaldamp.cpp @@ -32,9 +32,8 @@ // static members //----------------------------------------------------------------------------- LLFrameTimer LLCriticalDamp::sInternalTimer; +std::map LLCriticalDamp::sInterpolants; F32 LLCriticalDamp::sTimeDelta; -F32 LLCriticalDamp::sInterpolants[kNumCachedInterpolants]; -F32 LLCriticalDamp::sInterpolatedValues[kNumCachedInterpolants]; //----------------------------------------------------------------------------- // LLCriticalDamp() @@ -42,17 +41,6 @@ F32 LLCriticalDamp::sInterpolatedValues[kNumCachedInterpolants]; LLCriticalDamp::LLCriticalDamp() { sTimeDelta = 0.f; - - // Init the core interpolant values (to which many, many enums map) - // - setInterpolantConstant(InterpDelta_0_025, 0.025f); - setInterpolantConstant(InterpDelta_0_05, 0.05f ); - setInterpolantConstant(InterpDelta_0_06, 0.06f); - setInterpolantConstant(InterpDelta_0_10, 0.10f); - setInterpolantConstant(InterpDelta_0_15, 0.15f); - setInterpolantConstant(InterpDelta_0_20, 0.20f); - setInterpolantConstant(InterpDelta_0_25, 0.25f); - setInterpolantConstant(InterpDelta_0_30, 0.30f); } // static @@ -63,10 +51,40 @@ void LLCriticalDamp::updateInterpolants() { sTimeDelta = sInternalTimer.getElapsedTimeAndResetF32(); - U32 i; - for (i = 0; i < kNumCachedInterpolants; i++) + F32 time_constant; + + for (std::map::iterator iter = sInterpolants.begin(); + iter != sInterpolants.end(); iter++) + { + time_constant = iter->first; + F32 new_interpolant = 1.f - pow(2.f, -sTimeDelta / time_constant); + new_interpolant = llclamp(new_interpolant, 0.f, 1.f); + sInterpolants[time_constant] = new_interpolant; + } +} + +//----------------------------------------------------------------------------- +// getInterpolant() +//----------------------------------------------------------------------------- +F32 LLCriticalDamp::getInterpolant(const F32 time_constant, BOOL use_cache) +{ + if (time_constant == 0.f) + { + return 1.f; + } + + if (use_cache && sInterpolants.count(time_constant)) { - sInterpolatedValues[i] = llclamp(sTimeDelta / sInterpolants[ i], 0.0f, 1.0f); + return sInterpolants[time_constant]; } + + F32 interpolant = 1.f - pow(2.f, -sTimeDelta / time_constant); + interpolant = llclamp(interpolant, 0.f, 1.f); + if (use_cache) + { + sInterpolants[time_constant] = interpolant; + } + + return interpolant; } diff --git a/indra/llcommon/llcriticaldamp.h b/indra/llcommon/llcriticaldamp.h index 19a2ddb77a..52f052ae25 100644 --- a/indra/llcommon/llcriticaldamp.h +++ b/indra/llcommon/llcriticaldamp.h @@ -32,98 +32,22 @@ #include "llframetimer.h" -// These enums each represent one fixed-time delta value -// that we interpolate once given the actual sTimeDelta time -// that has passed. This allows us to calculate the interp portion -// of those values once and then look them up repeatedly per frame. -// -enum InterpDelta -{ - InterpDelta_0_025, // 0.025 - InterpDeltaTeenier = InterpDelta_0_025, - InterpDeltaFolderOpenTime = InterpDelta_0_025, - InterpDeltaFolderCloseTime = InterpDelta_0_025, - InterpDeltaCameraFocusHalfLife = InterpDelta_0_025, // USED TO BE ZERO.... - - InterpDelta_0_05, // 0.05 - InterpDeltaTeeny = InterpDelta_0_05, - - InterpDelta_0_06, // 0.06 - InterpDeltaObjectDampingConstant = InterpDelta_0_06, - InterpDeltaCameraZoomHalfLife = InterpDelta_0_06, - InterpDeltaFovZoomHalfLife = InterpDelta_0_06, - InterpDeltaManipulatorScaleHalfLife = InterpDelta_0_06, - InterpDeltaContextFadeTime = InterpDelta_0_06, - - InterpDelta_0_10, // 0.10 - InterpDeltaSmaller = InterpDelta_0_10, - InterpDeltaTargetLagHalfLife = InterpDelta_0_10, - InterpDeltaSpeedAdjustTime = InterpDelta_0_10, - - InterpDelta_0_15, // 0.15 - InterpDeltaFadeWeight = InterpDelta_0_15, - InterpDeltaHeadLookAtLagHalfLife = InterpDelta_0_15, - - InterpDelta_0_20, // 0.20 - InterpDeltaSmall = InterpDelta_0_20, - InterpDeltaTorsoLagHalfLife = InterpDelta_0_20, - InterpDeltaPositionDampingTC = InterpDelta_0_20, - - InterpDelta_0_25, // 0.25 - InterpDeltaCameraLagHalfLife = InterpDelta_0_25, - InterpDeltaTorsoTargetLagHalfLife = InterpDelta_0_25, - InterpDeltaTorsoLookAtLagHalfLife = InterpDelta_0_25, - - InterpDelta_0_30, // 0.3 - InterpDeltaSmallish = InterpDelta_0_30, - - // Dynamically set interpolants which use setInterpolantConstant - // - InterpDeltaCameraSmoothingHalfLife, - InterpDeltaBehindnessLag, - InterpDeltaFocusLag, - InterpDeltaPositionLag, - InterpDeltaOpenTime, - InterpDeltaCloseTime, - - kNumCachedInterpolants -}; - class LL_COMMON_API LLCriticalDamp { public: LLCriticalDamp(); - // Updates all the known interp delta values for fast lookup in calls to getInterpolant(InterpDelta) - // + // MANIPULATORS static void updateInterpolants(); - static inline void setInterpolantConstant(InterpDelta whichDelta, const F32 time_constant) - { - llassert(whichDelta < kNumCachedInterpolants); - sInterpolants[whichDelta] = time_constant; - } - // ACCESSORS - static inline F32 getInterpolant(InterpDelta whichDelta) - { - llassert(whichDelta < kNumCachedInterpolants); - return sInterpolatedValues[whichDelta]; - } - - static inline F32 getInterpolant(const F32 time_constant) - { - return llclamp((sTimeDelta / time_constant), 0.0f, 1.0f); - } + static F32 getInterpolant(const F32 time_constant, BOOL use_cache = TRUE); protected: static LLFrameTimer sInternalTimer; // frame timer for calculating deltas - //static std::map sInterpolants; - static F32 sInterpolants[kNumCachedInterpolants]; - static F32 sInterpolatedValues[kNumCachedInterpolants]; + static std::map sInterpolants; static F32 sTimeDelta; }; #endif // LL_LLCRITICALDAMP_H - diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 3dfcb3ffa1..705fe16559 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -758,11 +758,11 @@ void LLButton::draw() mCurGlowStrength = lerp(mCurGlowStrength, mFlashing ? (flash? 1.0 : 0.0) : mHoverGlowStrength, - LLCriticalDamp::getInterpolant(InterpDeltaTeeny)); + LLCriticalDamp::getInterpolant(0.05f)); } else { - mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaTeeny)); + mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLCriticalDamp::getInterpolant(0.05f)); } // Draw button image, if available. @@ -1247,4 +1247,3 @@ BOOL LLButton::handleDoubleClick(S32 x, S32 y, MASK mask) // just treat a double click as a second click return handleMouseDown(x, y, mask); } - diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index c93f538570..4c730286da 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -229,10 +229,7 @@ LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p) mOpenTimeConstant(p.open_time_constant), mCloseTimeConstant(p.close_time_constant), mResizeBarOverlap(p.resize_bar_overlap) -{ - LLCriticalDamp::setInterpolantConstant(InterpDeltaCloseTime, mCloseTimeConstant); - LLCriticalDamp::setInterpolantConstant(InterpDeltaOpenTime, mOpenTimeConstant); -} +{} LLLayoutStack::~LLLayoutStack() { @@ -595,7 +592,7 @@ bool LLLayoutStack::animatePanels() { if (!mAnimatedThisFrame) { - panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 1.f, LLCriticalDamp::getInterpolant(InterpDeltaOpenTime)); + panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 1.f, LLCriticalDamp::getInterpolant(mOpenTimeConstant)); if (panelp->mVisibleAmt > 0.99f) { panelp->mVisibleAmt = 1.f; @@ -620,7 +617,7 @@ bool LLLayoutStack::animatePanels() { if (!mAnimatedThisFrame) { - panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaCloseTime)); + panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 0.f, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); if (panelp->mVisibleAmt < 0.001f) { panelp->mVisibleAmt = 0.f; @@ -647,7 +644,7 @@ bool LLLayoutStack::animatePanels() { if (!mAnimatedThisFrame) { - panelp->mCollapseAmt = lerp(panelp->mCollapseAmt, collapse_state, LLCriticalDamp::getInterpolant(InterpDeltaCloseTime)); + panelp->mCollapseAmt = lerp(panelp->mCollapseAmt, collapse_state, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); } if (llabs(panelp->mCollapseAmt - collapse_state) < 0.001f) @@ -858,4 +855,3 @@ void LLLayoutStack::updateResizeBarLimits() previous_visible_panelp = visible_panelp; } } - diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index f142be885d..cd6cc6a75e 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3673,7 +3673,7 @@ void LLTearOffMenu::draw() if (getRect().getHeight() != mTargetHeight) { // animate towards target height - reshape(getRect().getWidth(), llceil(lerp((F32)getRect().getHeight(), mTargetHeight, LLCriticalDamp::getInterpolant(InterpDeltaTeeny)))); + reshape(getRect().getWidth(), llceil(lerp((F32)getRect().getHeight(), mTargetHeight, LLCriticalDamp::getInterpolant(0.05f)))); } LLFloater::draw(); } diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp index d65b4431a8..5d3bf7a670 100644 --- a/indra/llui/llscrollbar.cpp +++ b/indra/llui/llscrollbar.cpp @@ -493,11 +493,11 @@ void LLScrollbar::draw() BOOL hovered = getEnabled() && !other_captor && (hasMouseCapture() || mThumbRect.pointInRect(local_mouse_x, local_mouse_y)); if (hovered) { - mCurGlowStrength = lerp(mCurGlowStrength, mHoverGlowStrength, LLCriticalDamp::getInterpolant(InterpDeltaTeeny)); + mCurGlowStrength = lerp(mCurGlowStrength, mHoverGlowStrength, LLCriticalDamp::getInterpolant(0.05f)); } else { - mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaTeeny)); + mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLCriticalDamp::getInterpolant(0.05f)); } // Draw background and thumb. @@ -642,4 +642,3 @@ void LLScrollbar::onLineDownBtnPressed( const LLSD& data ) { changeLine( mStepSize, TRUE ); } - diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 1e64cd0df8..5fc2cc350d 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -406,7 +406,7 @@ void LLTabContainer::draw() } } - setScrollPosPixels((S32)lerp((F32)getScrollPosPixels(), (F32)target_pixel_scroll, LLCriticalDamp::getInterpolant(InterpDeltaTeeny))); + setScrollPosPixels((S32)lerp((F32)getScrollPosPixels(), (F32)target_pixel_scroll, LLCriticalDamp::getInterpolant(0.08f))); BOOL has_scroll_arrows = !getTabsHidden() && ((mMaxScrollPos > 0) || (mScrollPosPixels > 0)); if (!mIsVertical) @@ -2046,4 +2046,3 @@ void LLTabContainer::commitHoveredButton(S32 x, S32 y) } } } - diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index a40d9cd318..9025c7af8b 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -179,7 +179,7 @@ LLAgentCamera::LLAgentCamera() : clearGeneralKeys(); clearOrbitKeys(); - clearPanKeys(); + clearPanKeys(); } // Requires gSavedSettings to be initialized. @@ -192,9 +192,6 @@ void LLAgentCamera::init() mDrawDistance = gSavedSettings.getF32("RenderFarClip"); - const F32 SMOOTHING_HALF_LIFE = 0.02f; - LLCriticalDamp::setInterpolantConstant(InterpDeltaCameraSmoothingHalfLife, gSavedSettings.getF32("CameraPositionSmoothing") * SMOOTHING_HALF_LIFE); - LLViewerCamera::getInstance()->setView(DEFAULT_FIELD_OF_VIEW); // Leave at 0.1 meters until we have real near clip management LLViewerCamera::getInstance()->setNear(0.1f); @@ -340,7 +337,7 @@ void LLAgentCamera::resetView(BOOL reset_camera, BOOL change_camera) LLVector3 agent_at_axis = gAgent.getAtAxis(); agent_at_axis -= projected_vec(agent_at_axis, gAgent.getReferenceUpVector()); agent_at_axis.normalize(); - gAgent.resetAxes(lerp(gAgent.getAtAxis(), agent_at_axis, LLCriticalDamp::getInterpolant(InterpDeltaSmall))); + gAgent.resetAxes(lerp(gAgent.getAtAxis(), agent_at_axis, LLCriticalDamp::getInterpolant(0.3f))); } setFocusOnAvatar(TRUE, ANIMATE); @@ -1249,7 +1246,7 @@ void LLAgentCamera::updateCamera() gAgentCamera.clearPanKeys(); // lerp camera focus offset - mCameraFocusOffset = lerp(mCameraFocusOffset, mCameraFocusOffsetTarget, LLCriticalDamp::getInterpolant(InterpDeltaCameraFocusHalfLife)); + mCameraFocusOffset = lerp(mCameraFocusOffset, mCameraFocusOffsetTarget, LLCriticalDamp::getInterpolant(CAMERA_FOCUS_HALF_LIFE)); if ( mCameraMode == CAMERA_MODE_FOLLOW ) { @@ -1364,8 +1361,10 @@ void LLAgentCamera::updateCamera() mCameraSmoothingStop = mCameraSmoothingStop || in_build_mode; if (cameraThirdPerson() && !mCameraSmoothingStop) - { - F32 smoothing = LLCriticalDamp::getInterpolant(InterpDeltaCameraSmoothingHalfLife); + { + const F32 SMOOTHING_HALF_LIFE = 0.02f; + + F32 smoothing = LLCriticalDamp::getInterpolant(gSavedSettings.getF32("CameraPositionSmoothing") * SMOOTHING_HALF_LIFE, FALSE); if (!mFocusObject) // we differentiate on avatar mode { @@ -1395,7 +1394,7 @@ void LLAgentCamera::updateCamera() } - mCameraCurrentFOVZoomFactor = lerp(mCameraCurrentFOVZoomFactor, mCameraFOVZoomFactor, LLCriticalDamp::getInterpolant(InterpDeltaFovZoomHalfLife)); + mCameraCurrentFOVZoomFactor = lerp(mCameraCurrentFOVZoomFactor, mCameraFOVZoomFactor, LLCriticalDamp::getInterpolant(FOV_ZOOM_HALF_LIFE)); // llinfos << "Current FOV Zoom: " << mCameraCurrentFOVZoomFactor << " Target FOV Zoom: " << mCameraFOVZoomFactor << " Object penetration: " << mFocusObjectDist << llendl; @@ -1810,7 +1809,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) if (mTargetCameraDistance != mCurrentCameraDistance) { - F32 camera_lerp_amt = LLCriticalDamp::getInterpolant(InterpDeltaCameraZoomHalfLife); + F32 camera_lerp_amt = LLCriticalDamp::getInterpolant(CAMERA_ZOOM_HALF_LIFE); mCurrentCameraDistance = lerp(mCurrentCameraDistance, mTargetCameraDistance, camera_lerp_amt); } @@ -1828,7 +1827,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) if (isAgentAvatarValid()) { LLVector3d camera_lag_d; - F32 lag_interp = LLCriticalDamp::getInterpolant(InterpDeltaCameraLagHalfLife); + F32 lag_interp = LLCriticalDamp::getInterpolant(CAMERA_LAG_HALF_LIFE); LLVector3 target_lag; LLVector3 vel = gAgent.getVelocity(); @@ -1873,7 +1872,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) } else { - mCameraLag = lerp(mCameraLag, LLVector3::zero, LLCriticalDamp::getInterpolant(InterpDeltaCameraLagHalfLife)); + mCameraLag = lerp(mCameraLag, LLVector3::zero, LLCriticalDamp::getInterpolant(0.15f)); } camera_lag_d.setVec(mCameraLag); diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index dc0e256ebb..d29181a3ce 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -492,83 +492,97 @@ F32 LLDrawable::updateXform(BOOL undamped) BOOL damped = !undamped; // Position - LLVector3 old_pos = mXform.getPosition(); - - // get agent position or parent-relative position as appropriate - // - LLVector3 target_pos = mXform.isRoot() ? mVObjp->getPositionAgent() : mVObjp->getPosition(); - + LLVector3 old_pos(mXform.getPosition()); + LLVector3 target_pos; + if (mXform.isRoot()) + { + // get root position in your agent's region + target_pos = mVObjp->getPositionAgent(); + } + else + { + // parent-relative position + target_pos = mVObjp->getPosition(); + } + // Rotation LLQuaternion old_rot(mXform.getRotation()); LLQuaternion target_rot = mVObjp->getRotation(); - //scaling LLVector3 target_scale = mVObjp->getScale(); LLVector3 old_scale = mCurrentScale; LLVector3 dest_scale = target_scale; - LLVector3 scale_vec = old_scale-target_scale; - - static const F32 dot_threshold = 1.0f - FLT_EPSILON; - - F32 dist_squared = dist_vec_squared(old_pos, target_pos); - - bool translated = dist_squared > 0.0f; - bool rotated = !mVObjp->getAngularVelocity().isExactlyZero() || (dot(old_rot, target_rot) < dot_threshold); - bool scaled = (scale_vec * scale_vec) > MIN_INTERPOLATE_DISTANCE_SQUARED; - // Damping + // Damping + F32 dist_squared = 0.f; + F32 camdist2 = (mDistanceWRTCamera * mDistanceWRTCamera); + if (damped && isVisible()) { - F32 lerp_amt = LLCriticalDamp::getInterpolant(InterpDeltaObjectDampingConstant); + F32 lerp_amt = llclamp(LLCriticalDamp::getInterpolant(OBJECT_DAMPING_TIME_CONSTANT), 0.f, 1.f); LLVector3 new_pos = lerp(old_pos, target_pos, lerp_amt); - dist_squared = dist_vec_squared(new_pos, old_pos); + dist_squared = dist_vec_squared(new_pos, target_pos); LLQuaternion new_rot = nlerp(lerp_amt, old_rot, target_rot); - dist_squared += fabs(1.f - dot(new_rot, old_rot)) * 10.f; + // FIXME: This can be negative! It is be possible for some rots to 'cancel out' pos or size changes. + dist_squared += (1.f - dot(new_rot, target_rot)) * 10.f; LLVector3 new_scale = lerp(old_scale, target_scale, lerp_amt); - dist_squared += dist_vec_squared(new_scale, old_scale); + dist_squared += dist_vec_squared(new_scale, target_scale); - // If our lerp isn't moving too far, substitue the lerp'd pos for our target for this frame - // - if (dist_squared <= MAX_INTERPOLATE_DISTANCE_SQUARED) + if ((dist_squared >= MIN_INTERPOLATE_DISTANCE_SQUARED * camdist2) && + (dist_squared <= MAX_INTERPOLATE_DISTANCE_SQUARED)) { // interpolate target_pos = new_pos; target_rot = new_rot; target_scale = new_scale; } - else + else if (mVObjp->getAngularVelocity().isExactlyZero()) { - llinfos << "skipping update due to overly large lerp" << llendl; + // snap to final position (only if no target omega is applied) + dist_squared = 0.0f; + if (getVOVolume() && !isRoot()) + { //child prim snapping to some position, needs a rebuild + gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); + } } } + else + { + // The following fixes MAINT-1742 but breaks vehicles similar to MAINT-2275 + // dist_squared = dist_vec_squared(old_pos, target_pos); - if (translated || rotated || scaled) - { - if (scaled) - { - mCurrentScale = target_scale; - } + // The following fixes MAINT-2247 but causes MAINT-2275 + //dist_squared += (1.f - dot(old_rot, target_rot)) * 10.f; + //dist_squared += dist_vec_squared(old_scale, target_scale); + } + LLVector3 vec = mCurrentScale-target_scale; + + if (vec*vec > MIN_INTERPOLATE_DISTANCE_SQUARED) + { //scale change requires immediate rebuild + mCurrentScale = target_scale; + gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); + } + else if (!isRoot() && + (!mVObjp->getAngularVelocity().isExactlyZero() || + dist_squared > 0.f)) + { //child prim moving relative to parent, tag as needing to be rendered atomically and rebuild dist_squared = 1.f; //keep this object on the move list - - //child prim moving relative to parent, tag as needing to be rendered atomically - // - if (!isRoot() && !isState(LLDrawable::ANIMATED_CHILD)) + if (!isState(LLDrawable::ANIMATED_CHILD)) { setState(LLDrawable::ANIMATED_CHILD); - } - - // Mark any components that need to be rebuilt based on what change transpired - // - if (!rotated && !scaled) - gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); - else gPipeline.markRebuild(this, LLDrawable::REBUILD_ALL, TRUE); - - mVObjp->dirtySpatialGroup(); + mVObjp->dirtySpatialGroup(); + } } + else if (!isRoot() + && ( dist_vec_squared(old_pos, target_pos) > 0.f + || (1.f - dot(old_rot, target_rot)) > 0.f)) + { // update child prims moved from LSL + gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); + } else if (!getVOVolume() && !isAvatar()) { movePartition(); @@ -767,7 +781,7 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update) } pos -= camera.getOrigin(); - mDistanceWRTCamera = 20.0f;//llround(pos.magVec(), 0.01f); + mDistanceWRTCamera = llround(pos.magVec(), 0.01f); mVObjp->updateLOD(); } } diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 643ce63f29..e7a3f9b390 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -940,7 +940,7 @@ void LLFastTimerView::draw() } //interpolate towards new maximum - last_max = (U64) lerp((F32)last_max, (F32) cur_max, LLCriticalDamp::getInterpolant(InterpDeltaSmaller)); + last_max = (U64) lerp((F32)last_max, (F32) cur_max, LLCriticalDamp::getInterpolant(0.1f)); if (last_max - cur_max <= 1 || cur_max - last_max <= 1) { last_max = cur_max; @@ -948,7 +948,7 @@ void LLFastTimerView::draw() F32 alpha_target = last_max > cur_max ? llmin((F32) last_max/ (F32) cur_max - 1.f,1.f) : llmin((F32) cur_max/ (F32) last_max - 1.f,1.f); - alpha_interp = lerp(alpha_interp, alpha_target, LLCriticalDamp::getInterpolant(InterpDeltaSmaller)); + alpha_interp = lerp(alpha_interp, alpha_target, LLCriticalDamp::getInterpolant(0.1f)); if (mHoverID != NULL) { diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index 10d31df22c..d6ebe44daa 100644 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -525,11 +525,11 @@ void LLFloaterColorPicker::draw() if (gFocusMgr.childHasMouseCapture(getDragHandle())) { - mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(InterpDeltaContextFadeTime)); + mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); } else { - mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaContextFadeTime)); + mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); } mPipetteBtn->setToggleState(LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance()); @@ -1113,4 +1113,3 @@ void LLFloaterColorPicker::stopUsingPipette() LLToolMgr::getInstance()->clearTransientTool(); } } - diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 103eaace88..d8d62e5bbb 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -478,7 +478,7 @@ void LLSnapshotLivePreview::draw() { if (mFlashAlpha < 1.f) { - mFlashAlpha = lerp(mFlashAlpha, 1.f, LLCriticalDamp::getInterpolant(InterpDeltaTeenier)); + mFlashAlpha = lerp(mFlashAlpha, 1.f, LLCriticalDamp::getInterpolant(0.02f)); } else { @@ -487,7 +487,7 @@ void LLSnapshotLivePreview::draw() } else { - mFlashAlpha = lerp(mFlashAlpha, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaSmallish) * 0.5f); + mFlashAlpha = lerp(mFlashAlpha, 0.f, LLCriticalDamp::getInterpolant(0.15f)); } // Draw shining animation if appropriate. @@ -2500,4 +2500,3 @@ BOOL LLSnapshotFloaterView::handleHover(S32 x, S32 y, MASK mask) } return TRUE; } - diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 23241b57c4..3aa16b4413 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -1293,7 +1293,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) // animate current height towards target height if (llabs(mCurHeight - mTargetHeight) > 1.f) { - mCurHeight = lerp(mCurHeight, mTargetHeight, LLCriticalDamp::getInterpolant(mIsOpen ? InterpDeltaFolderOpenTime : InterpDeltaFolderCloseTime)); + mCurHeight = lerp(mCurHeight, mTargetHeight, LLCriticalDamp::getInterpolant(mIsOpen ? FOLDER_OPEN_TIME_CONSTANT : FOLDER_CLOSE_TIME_CONSTANT)); requestArrange(); @@ -2538,11 +2538,11 @@ void LLFolderViewFolder::draw() } else if (mIsOpen) { - mControlLabelRotation = lerp(mControlLabelRotation, -90.f, LLCriticalDamp::getInterpolant(InterpDeltaTeeny)); + mControlLabelRotation = lerp(mControlLabelRotation, -90.f, LLCriticalDamp::getInterpolant(0.04f)); } else { - mControlLabelRotation = lerp(mControlLabelRotation, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaTeenier)); + mControlLabelRotation = lerp(mControlLabelRotation, 0.f, LLCriticalDamp::getInterpolant(0.025f)); } bool possibly_has_children = false; @@ -2899,4 +2899,3 @@ bool LLInventorySort::operator()(const LLFolderViewItem* const& a, const LLFolde } } } - diff --git a/indra/newview/llfollowcam.cpp b/indra/newview/llfollowcam.cpp index a3c1996512..b670af1782 100644 --- a/indra/newview/llfollowcam.cpp +++ b/indra/newview/llfollowcam.cpp @@ -148,16 +148,14 @@ LLFollowCamParams::~LLFollowCamParams() { } //--------------------------------------------------------- void LLFollowCamParams::setPositionLag( F32 p ) { - mPositionLag = llclamp(p, FOLLOW_CAM_MIN_POSITION_LAG, FOLLOW_CAM_MAX_POSITION_LAG); - LLCriticalDamp::setInterpolantConstant(InterpDeltaPositionLag, mPositionLag); + mPositionLag = llclamp(p, FOLLOW_CAM_MIN_POSITION_LAG, FOLLOW_CAM_MAX_POSITION_LAG); } //--------------------------------------------------------- void LLFollowCamParams::setFocusLag( F32 f ) { - mFocusLag = llclamp(f, FOLLOW_CAM_MIN_FOCUS_LAG, FOLLOW_CAM_MAX_FOCUS_LAG); - LLCriticalDamp::setInterpolantConstant(InterpDeltaFocusLag, mFocusLag); + mFocusLag = llclamp(f, FOLLOW_CAM_MIN_FOCUS_LAG, FOLLOW_CAM_MAX_FOCUS_LAG); } @@ -186,7 +184,6 @@ void LLFollowCamParams::setPitch( F32 p ) void LLFollowCamParams::setBehindnessLag( F32 b ) { mBehindnessLag = llclamp(b, FOLLOW_CAM_MIN_BEHINDNESS_LAG, FOLLOW_CAM_MAX_BEHINDNESS_LAG); - LLCriticalDamp::setInterpolantConstant(InterpDeltaBehindnessLag, mBehindnessLag); } //--------------------------------------------------------- @@ -331,11 +328,11 @@ void LLFollowCam::update() F32 force = focusOffsetDistance - focusThresholdNormalizedByDistance; */ - F32 focusLagLerp = LLCriticalDamp::getInterpolant(InterpDeltaFocusLag); + F32 focusLagLerp = LLCriticalDamp::getInterpolant( mFocusLag ); focus_pt_agent = lerp( focus_pt_agent, whereFocusWantsToBe, focusLagLerp ); mSimulatedFocusGlobal = gAgent.getPosGlobalFromAgent(focus_pt_agent); } - mRelativeFocus = lerp(mRelativeFocus, (focus_pt_agent - mSubjectPosition) * ~mSubjectRotation, LLCriticalDamp::getInterpolant(InterpDeltaTeeny)); + mRelativeFocus = lerp(mRelativeFocus, (focus_pt_agent - mSubjectPosition) * ~mSubjectRotation, LLCriticalDamp::getInterpolant(0.05f)); }// if focus is not locked --------------------------------------------- @@ -418,7 +415,7 @@ void LLFollowCam::update() //------------------------------------------------------------------------------------------------- if ( distanceFromPositionToIdealPosition > mPositionThreshold ) { - F32 positionPullLerp = LLCriticalDamp::getInterpolant(InterpDeltaPositionLag); + F32 positionPullLerp = LLCriticalDamp::getInterpolant( mPositionLag ); simulated_pos_agent = lerp( simulated_pos_agent, whereCameraPositionWantsToBe, positionPullLerp ); } @@ -438,7 +435,7 @@ void LLFollowCam::update() updateBehindnessConstraint(gAgent.getPosAgentFromGlobal(mSimulatedFocusGlobal), simulated_pos_agent); mSimulatedPositionGlobal = gAgent.getPosGlobalFromAgent(simulated_pos_agent); - mRelativePos = lerp(mRelativePos, (simulated_pos_agent - mSubjectPosition) * ~mSubjectRotation, LLCriticalDamp::getInterpolant(InterpDeltaTeeny)); + mRelativePos = lerp(mRelativePos, (simulated_pos_agent - mSubjectPosition) * ~mSubjectRotation, LLCriticalDamp::getInterpolant(0.05f)); } // if position is not locked ----------------------------------------------------------- @@ -493,7 +490,7 @@ BOOL LLFollowCam::updateBehindnessConstraint(LLVector3 focus, LLVector3& cam_pos if ( cameraOffsetAngle > mBehindnessMaxAngle ) { - F32 fraction = ((cameraOffsetAngle - mBehindnessMaxAngle) / cameraOffsetAngle) * LLCriticalDamp::getInterpolant(InterpDeltaBehindnessLag); + F32 fraction = ((cameraOffsetAngle - mBehindnessMaxAngle) / cameraOffsetAngle) * LLCriticalDamp::getInterpolant(mBehindnessLag); cam_position = focus + horizontalSubjectBack * (slerp(fraction, camera_offset_rotation, LLQuaternion::DEFAULT)); cam_position.mV[VZ] = cameraZ; // clamp z value back to what it was before we started messing with it constraint_active = TRUE; diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp index b94681b340..482294c8a6 100644 --- a/indra/newview/llhudnametag.cpp +++ b/indra/newview/llhudnametag.cpp @@ -980,7 +980,7 @@ void LLHUDNameTag::updateAll() // { // continue; // } - (*this_object_it)->mPositionOffset = lerp((*this_object_it)->mPositionOffset, (*this_object_it)->mTargetPositionOffset, LLCriticalDamp::getInterpolant(InterpDeltaPositionDampingTC)); + (*this_object_it)->mPositionOffset = lerp((*this_object_it)->mPositionOffset, (*this_object_it)->mTargetPositionOffset, LLCriticalDamp::getInterpolant(POSITION_DAMPING_TC)); } } @@ -1083,4 +1083,3 @@ F32 LLHUDNameTag::LLHUDTextSegment::getWidth(const LLFontGL* font) return width; } } - diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index 748ac7a16e..826e8d560a 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -240,7 +240,7 @@ void LLManipRotate::render() if (mManipPart == LL_ROT_Z) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.pushMatrix(); { // selected part @@ -251,7 +251,7 @@ void LLManipRotate::render() } else if (mManipPart == LL_ROT_Y) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.pushMatrix(); { gGL.rotatef( 90.f, 1.f, 0.f, 0.f ); @@ -262,7 +262,7 @@ void LLManipRotate::render() } else if (mManipPart == LL_ROT_X) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.pushMatrix(); { gGL.rotatef( 90.f, 0.f, 1.f, 0.f ); @@ -273,13 +273,13 @@ void LLManipRotate::render() } else if (mManipPart == LL_ROT_ROLL) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } else if (mManipPart == LL_NO_PART) { if (mHighlightedPart == LL_NO_PART) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } LLGLEnable cull_face(GL_CULL_FACE); @@ -294,7 +294,7 @@ void LLManipRotate::render() { if (mHighlightedPart == LL_ROT_Z) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.scalef(mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ]); // hovering over part gl_ring( mRadiusMeters, width_meters, LLColor4( 0.f, 0.f, 1.f, 1.f ), LLColor4( 0.f, 0.f, 1.f, 0.5f ), CIRCLE_STEPS, i); @@ -312,7 +312,7 @@ void LLManipRotate::render() gGL.rotatef( 90.f, 1.f, 0.f, 0.f ); if (mHighlightedPart == LL_ROT_Y) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.scalef(mManipulatorScales.mV[VY], mManipulatorScales.mV[VY], mManipulatorScales.mV[VY]); // hovering over part gl_ring( mRadiusMeters, width_meters, LLColor4( 0.f, 1.f, 0.f, 1.f ), LLColor4( 0.f, 1.f, 0.f, 0.5f ), CIRCLE_STEPS, i); @@ -330,7 +330,7 @@ void LLManipRotate::render() gGL.rotatef( 90.f, 0.f, 1.f, 0.f ); if (mHighlightedPart == LL_ROT_X) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.scalef(mManipulatorScales.mV[VX], mManipulatorScales.mV[VX], mManipulatorScales.mV[VX]); // hovering over part @@ -346,7 +346,7 @@ void LLManipRotate::render() if (mHighlightedPart == LL_ROT_ROLL) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } } diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index 9802d5503e..00a0bf8894 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -535,11 +535,11 @@ void LLManipScale::highlightManipulators(S32 x, S32 y) { if (mHighlightedPart == MANIPULATOR_IDS[i]) { - mManipulatorScales[i] = lerp(mManipulatorScales[i], SELECTED_MANIPULATOR_SCALE, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales[i] = lerp(mManipulatorScales[i], SELECTED_MANIPULATOR_SCALE, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } else { - mManipulatorScales[i] = lerp(mManipulatorScales[i], 1.f, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales[i] = lerp(mManipulatorScales[i], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } } @@ -2082,4 +2082,3 @@ BOOL LLManipScale::canAffectSelection() } return can_scale; } - diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index 9d287e7a03..0228807dc8 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -1922,18 +1922,18 @@ void LLManipTranslate::renderTranslationHandles() { if (index == mManipPart - LL_X_ARROW || index == mHighlightedPart - LL_X_ARROW) { - mArrowScales.mV[index] = lerp(mArrowScales.mV[index], SELECTED_ARROW_SCALE, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); - mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mArrowScales.mV[index] = lerp(mArrowScales.mV[index], SELECTED_ARROW_SCALE, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); + mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); } else if (index == mManipPart - LL_YZ_PLANE || index == mHighlightedPart - LL_YZ_PLANE) { - mArrowScales.mV[index] = lerp(mArrowScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); - mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], SELECTED_ARROW_SCALE, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mArrowScales.mV[index] = lerp(mArrowScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); + mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], SELECTED_ARROW_SCALE, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); } else { - mArrowScales.mV[index] = lerp(mArrowScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); - mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mArrowScales.mV[index] = lerp(mArrowScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); + mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); } } @@ -2323,4 +2323,3 @@ BOOL LLManipTranslate::canAffectSelection() } return can_move; } - diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 274497f2b5..1bda7640bd 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -162,7 +162,7 @@ void LLNetMap::draw() static LLUICachedControl auto_center("MiniMapAutoCenter", true); if (auto_center) { - mCurPan = lerp(mCurPan, mTargetPan, LLCriticalDamp::getInterpolant(InterpDeltaSmaller)); + mCurPan = lerp(mCurPan, mTargetPan, LLCriticalDamp::getInterpolant(0.1f)); } // Prepare a scissor region @@ -987,4 +987,3 @@ void LLNetMap::handleStopTracking (const LLSD& userdata) LLTracker::stopTracking ((void*)LLTracker::isTracking(NULL)); } } - diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index cf9d95455e..343316d30a 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6108,14 +6108,6 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); gGL.begin(LLRender::LINES); { - // Lines require an even number of verts so repeat the first - // vert if we don't meet that requirement - // - if (mSilhouetteVertices.size() & 0x1) - { - mSilhouetteVertices.push_back(mSilhouetteVertices[0]); - } - for(S32 i = 0; i < mSilhouetteVertices.size(); i += 2) { u_coord += u_divisor * LLSelectMgr::sHighlightUScale; @@ -7555,4 +7547,3 @@ void LLSelectMgr::sendSelectionMove() //saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); } - diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 8c5844eca7..ec36cf48c2 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -549,11 +549,11 @@ void LLFloaterTexturePicker::draw() if (gFocusMgr.childHasMouseCapture(getDragHandle())) { - mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(InterpDeltaContextFadeTime)); + mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); } else { - mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaContextFadeTime)); + mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); } updateImageStats(); diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 3f97659c66..9ffc64312d 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -1033,7 +1033,7 @@ void render_hud_attachments() // clamp target zoom level to reasonable values gAgentCamera.mHUDTargetZoom = llclamp(gAgentCamera.mHUDTargetZoom, 0.1f, 1.f); // smoothly interpolate current zoom level - gAgentCamera.mHUDCurZoom = lerp(gAgentCamera.mHUDCurZoom, gAgentCamera.mHUDTargetZoom, LLCriticalDamp::getInterpolant(InterpDeltaTeenier)); + gAgentCamera.mHUDCurZoom = lerp(gAgentCamera.mHUDCurZoom, gAgentCamera.mHUDTargetZoom, LLCriticalDamp::getInterpolant(0.03f)); if (LLPipeline::sShowHUDAttachments && !gDisconnected && setup_hud_matrices()) { @@ -1593,4 +1593,3 @@ void display_cleanup() { gDisconnectedImagep = NULL; } - diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index d28da507ea..4efd59685e 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2913,7 +2913,7 @@ void LLVOAvatar::idleUpdateWindEffect() LLVector3 velocity = getVelocity(); F32 speed = velocity.length(); //RN: velocity varies too much frame to frame for this to work - mRippleAccel.clearVec();//lerp(mRippleAccel, (velocity - mLastVel) * time_delta, LLCriticalDamp::getInterpolant(InterpDeltaTeenier)); + mRippleAccel.clearVec();//lerp(mRippleAccel, (velocity - mLastVel) * time_delta, LLCriticalDamp::getInterpolant(0.02f)); mLastVel = velocity; LLVector4 wind; wind.setVec(getRegion()->mWind.getVelocityNoisy(getPositionAgent(), 4.f) - velocity); @@ -2934,10 +2934,13 @@ void LLVOAvatar::idleUpdateWindEffect() wind.mV[VW] = llmin(0.025f + (speed * 0.015f) + hover_strength, 0.5f); F32 interp; - interp = LLCriticalDamp::getInterpolant(InterpDeltaSmall); - if (wind.mV[VW] <= mWindVec.mV[VW]) + if (wind.mV[VW] > mWindVec.mV[VW]) { - interp *= 2.0f; + interp = LLCriticalDamp::getInterpolant(0.2f); + } + else + { + interp = LLCriticalDamp::getInterpolant(0.4f); } mWindVec = lerp(mWindVec, wind, interp); @@ -3798,6 +3801,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // Set the root rotation, but do so incrementally so that it // lags in time by some fixed amount. + //F32 u = LLCriticalDamp::getInterpolant(PELVIS_LAG); F32 pelvis_lag_time = 0.f; if (self_in_mouselook) { diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 3c831bafa0..7adf18b6d0 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1268,7 +1268,7 @@ BOOL LLVOVolume::calcLOD() else { distance = mDrawable->mDistanceWRTCamera; - radius = getVolume() ? getVolume()->mLODScaleBias.scaledVec(getScale()).length() : getScale().length(); + radius = getVolume()->mLODScaleBias.scaledVec(getScale()).length(); } //hold onto unmodified distance for debugging @@ -2990,8 +2990,7 @@ void LLVOVolume::generateSilhouette(LLSelectNode* nodep, const LLVector3& view_p //transform view vector into volume space view_vector -= getRenderPosition(); - // WTF...why is silhouette generation touching a variable used all over the place?! - //mDrawable->mDistanceWRTCamera = view_vector.length(); + mDrawable->mDistanceWRTCamera = view_vector.length(); LLQuaternion worldRot = getRenderRotation(); view_vector = view_vector * ~worldRot; if (!isVolumeGlobal()) diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 7c3bc5988c..eeaa30aafb 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -302,8 +302,8 @@ void LLWorldMapView::draw() mVisibleRegions.clear(); // animate pan if necessary - sPanX = lerp(sPanX, sTargetPanX, LLCriticalDamp::getInterpolant(InterpDeltaSmaller)); - sPanY = lerp(sPanY, sTargetPanY, LLCriticalDamp::getInterpolant(InterpDeltaSmaller)); + sPanX = lerp(sPanX, sTargetPanX, LLCriticalDamp::getInterpolant(0.1f)); + sPanY = lerp(sPanY, sTargetPanY, LLCriticalDamp::getInterpolant(0.1f)); const S32 width = getRect().getWidth(); const S32 height = getRect().getHeight(); -- cgit v1.2.3 From e8dfa28697c177e8ed08ff76a9b81f920805a92f Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Thu, 14 Mar 2013 14:12:26 -0700 Subject: Rollback Maestro interp changes --- indra/llcharacter/lleditingmotion.cpp | 4 +- indra/llcharacter/llheadrotmotion.cpp | 4 +- indra/llcharacter/llkeyframemotion.cpp | 6 +- indra/llcharacter/llkeyframewalkmotion.cpp | 6 +- indra/llcharacter/llmotion.cpp | 4 +- indra/llcharacter/lltargetingmotion.cpp | 2 +- indra/llcommon/llcriticaldamp.cpp | 50 +++++++++----- indra/llcommon/llcriticaldamp.h | 82 +---------------------- indra/llui/llbutton.cpp | 5 +- indra/llui/lllayoutstack.cpp | 12 ++-- indra/llui/llmenugl.cpp | 2 +- indra/llui/llscrollbar.cpp | 5 +- indra/llui/lltabcontainer.cpp | 3 +- indra/newview/llagentcamera.cpp | 23 +++---- indra/newview/lldrawable.cpp | 104 ++++++++++++++++------------- indra/newview/llfasttimerview.cpp | 4 +- indra/newview/llfloatercolorpicker.cpp | 5 +- indra/newview/llfloatersnapshot.cpp | 5 +- indra/newview/llfolderviewitem.cpp | 7 +- indra/newview/llfollowcam.cpp | 17 ++--- indra/newview/llhudnametag.cpp | 3 +- indra/newview/llmaniprotate.cpp | 18 ++--- indra/newview/llmanipscale.cpp | 5 +- indra/newview/llmaniptranslate.cpp | 13 ++-- indra/newview/llnetmap.cpp | 3 +- indra/newview/llselectmgr.cpp | 9 --- indra/newview/lltexturectrl.cpp | 4 +- indra/newview/llviewerdisplay.cpp | 3 +- indra/newview/llvoavatar.cpp | 12 ++-- indra/newview/llworldmapview.cpp | 4 +- 30 files changed, 179 insertions(+), 245 deletions(-) diff --git a/indra/llcharacter/lleditingmotion.cpp b/indra/llcharacter/lleditingmotion.cpp index 35508e0a87..4e8c3268c5 100644 --- a/indra/llcharacter/lleditingmotion.cpp +++ b/indra/llcharacter/lleditingmotion.cpp @@ -38,6 +38,8 @@ // Constants //----------------------------------------------------------------------------- const LLQuaternion EDIT_MOTION_WRIST_ROTATION(F_PI_BY_TWO * 0.7f, LLVector3(1.0f, 0.0f, 0.0f)); +const F32 TARGET_LAG_HALF_LIFE = 0.1f; // half-life of IK targeting +const F32 TORSO_LAG_HALF_LIFE = 0.2f; const F32 MAX_TIME_DELTA = 2.f; //max two seconds a frame for calculating interpolation S32 LLEditingMotion::sHandPose = LLHandMotion::HAND_POSE_RELAXED_R; @@ -230,7 +232,7 @@ BOOL LLEditingMotion::onUpdate(F32 time, U8* joint_mask) mIKSolver.solve(); // use blending... - F32 slerp_amt = LLCriticalDamp::getInterpolant(InterpDeltaTargetLagHalfLife); + F32 slerp_amt = LLCriticalDamp::getInterpolant(TARGET_LAG_HALF_LIFE); shoulderRot = slerp(slerp_amt, mShoulderJoint.getRotation(), shoulderRot); elbowRot = slerp(slerp_amt, mElbowJoint.getRotation(), elbowRot); diff --git a/indra/llcharacter/llheadrotmotion.cpp b/indra/llcharacter/llheadrotmotion.cpp index 1eddd0f449..2b1aa194a9 100644 --- a/indra/llcharacter/llheadrotmotion.cpp +++ b/indra/llcharacter/llheadrotmotion.cpp @@ -182,8 +182,8 @@ BOOL LLHeadRotMotion::onUpdate(F32 time, U8* joint_mask) LLQuaternion currentRootRotWorld = mRootJoint->getWorldRotation(); LLQuaternion currentInvRootRotWorld = ~currentRootRotWorld; - F32 head_slerp_amt = LLCriticalDamp::getInterpolant(InterpDeltaHeadLookAtLagHalfLife); - F32 torso_slerp_amt = LLCriticalDamp::getInterpolant(InterpDeltaTorsoLookAtLagHalfLife); + F32 head_slerp_amt = LLCriticalDamp::getInterpolant(HEAD_LOOKAT_LAG_HALF_LIFE); + F32 torso_slerp_amt = LLCriticalDamp::getInterpolant(TORSO_LOOKAT_LAG_HALF_LIFE); LLVector3* targetPos = (LLVector3*)mCharacter->getAnimationData("LookAtPoint"); diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index f394cf2635..905d1c2d26 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -1031,11 +1031,11 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8 if (constraint->mSharedData->mChainLength != 0 && dist_vec_squared(root_pos, target_pos) * 0.95f > constraint->mTotalLength * constraint->mTotalLength) { - constraint->mWeight = lerp(constraint->mWeight, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaSmaller)); + constraint->mWeight = lerp(constraint->mWeight, 0.f, LLCriticalDamp::getInterpolant(0.1f)); } else { - constraint->mWeight = lerp(constraint->mWeight, 1.f, LLCriticalDamp::getInterpolant(InterpDeltaSmallish)); + constraint->mWeight = lerp(constraint->mWeight, 1.f, LLCriticalDamp::getInterpolant(0.3f)); } F32 weight = constraint->mWeight * ((shared_data->mEaseOutStopTime == 0.f) ? 1.f : @@ -1084,7 +1084,7 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8 F32 time_constant = 1.f / clamp_rescale(constraint->mFixupDistanceRMS, 0.f, 0.5f, 0.2f, 8.f); // llinfos << "Interpolant " << LLCriticalDamp::getInterpolant(time_constant, FALSE) << " and fixup distance " << constraint->mFixupDistanceRMS << " on " << mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << llendl; positions[joint_num] = lerp(positions[joint_num], kinematic_position, - LLCriticalDamp::getInterpolant(time_constant)); + LLCriticalDamp::getInterpolant(time_constant, FALSE)); } S32 iteration_count; diff --git a/indra/llcharacter/llkeyframewalkmotion.cpp b/indra/llcharacter/llkeyframewalkmotion.cpp index d17c123e54..8422553beb 100644 --- a/indra/llcharacter/llkeyframewalkmotion.cpp +++ b/indra/llcharacter/llkeyframewalkmotion.cpp @@ -287,7 +287,7 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask) F32 desired_speed_multiplier = llclamp(speed / foot_speed, min_speed_multiplier, ANIM_SPEED_MAX); // blend towards new speed adjustment value - F32 new_speed_adjust = lerp(mAdjustedSpeed, desired_speed_multiplier, LLCriticalDamp::getInterpolant(InterpDeltaSpeedAdjustTime)); + F32 new_speed_adjust = lerp(mAdjustedSpeed, desired_speed_multiplier, LLCriticalDamp::getInterpolant(SPEED_ADJUST_TIME_CONSTANT)); // limit that rate at which the speed adjustment changes F32 speedDelta = llclamp(new_speed_adjust - mAdjustedSpeed, -SPEED_ADJUST_MAX_SEC * delta_time, SPEED_ADJUST_MAX_SEC * delta_time); @@ -305,8 +305,8 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask) { // standing/turning // damp out speed adjustment to 0 - mAnimSpeed = lerp(mAnimSpeed, 1.f, LLCriticalDamp::getInterpolant(InterpDeltaSmall)); - //mPelvisOffset = lerp(mPelvisOffset, LLVector3::zero, LLCriticalDamp::getInterpolant(InterpDeltaSmall)); + mAnimSpeed = lerp(mAnimSpeed, 1.f, LLCriticalDamp::getInterpolant(0.2f)); + //mPelvisOffset = lerp(mPelvisOffset, LLVector3::zero, LLCriticalDamp::getInterpolant(0.2f)); } // broadcast walk speed change diff --git a/indra/llcharacter/llmotion.cpp b/indra/llcharacter/llmotion.cpp index d4db0d84c9..a07f9f4d2e 100644 --- a/indra/llcharacter/llmotion.cpp +++ b/indra/llcharacter/llmotion.cpp @@ -73,7 +73,7 @@ void LLMotion::fadeOut() { if (mFadeWeight > 0.01f) { - mFadeWeight = lerp(mFadeWeight, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaFadeWeight)); + mFadeWeight = lerp(mFadeWeight, 0.f, LLCriticalDamp::getInterpolant(0.15f)); } else { @@ -88,7 +88,7 @@ void LLMotion::fadeIn() { if (mFadeWeight < 0.99f) { - mFadeWeight = lerp(mFadeWeight, 1.f, LLCriticalDamp::getInterpolant(InterpDeltaFadeWeight)); + mFadeWeight = lerp(mFadeWeight, 1.f, LLCriticalDamp::getInterpolant(0.15f)); } else { diff --git a/indra/llcharacter/lltargetingmotion.cpp b/indra/llcharacter/lltargetingmotion.cpp index 6ce6ce31d6..fa5f06328e 100644 --- a/indra/llcharacter/lltargetingmotion.cpp +++ b/indra/llcharacter/lltargetingmotion.cpp @@ -106,7 +106,7 @@ BOOL LLTargetingMotion::onActivate() //----------------------------------------------------------------------------- BOOL LLTargetingMotion::onUpdate(F32 time, U8* joint_mask) { - F32 slerp_amt = LLCriticalDamp::getInterpolant(InterpDeltaTorsoTargetLagHalfLife); + F32 slerp_amt = LLCriticalDamp::getInterpolant(TORSO_TARGET_HALF_LIFE); LLVector3 target; LLVector3* lookAtPoint = (LLVector3*)mCharacter->getAnimationData("LookAtPoint"); diff --git a/indra/llcommon/llcriticaldamp.cpp b/indra/llcommon/llcriticaldamp.cpp index 27fef0e6dc..49aac9ce75 100644 --- a/indra/llcommon/llcriticaldamp.cpp +++ b/indra/llcommon/llcriticaldamp.cpp @@ -32,9 +32,8 @@ // static members //----------------------------------------------------------------------------- LLFrameTimer LLCriticalDamp::sInternalTimer; +std::map LLCriticalDamp::sInterpolants; F32 LLCriticalDamp::sTimeDelta; -F32 LLCriticalDamp::sInterpolants[kNumCachedInterpolants]; -F32 LLCriticalDamp::sInterpolatedValues[kNumCachedInterpolants]; //----------------------------------------------------------------------------- // LLCriticalDamp() @@ -42,17 +41,6 @@ F32 LLCriticalDamp::sInterpolatedValues[kNumCachedInterpolants]; LLCriticalDamp::LLCriticalDamp() { sTimeDelta = 0.f; - - // Init the core interpolant values (to which many, many enums map) - // - setInterpolantConstant(InterpDelta_0_025, 0.025f); - setInterpolantConstant(InterpDelta_0_05, 0.05f ); - setInterpolantConstant(InterpDelta_0_06, 0.06f); - setInterpolantConstant(InterpDelta_0_10, 0.10f); - setInterpolantConstant(InterpDelta_0_15, 0.15f); - setInterpolantConstant(InterpDelta_0_20, 0.20f); - setInterpolantConstant(InterpDelta_0_25, 0.25f); - setInterpolantConstant(InterpDelta_0_30, 0.30f); } // static @@ -63,10 +51,40 @@ void LLCriticalDamp::updateInterpolants() { sTimeDelta = sInternalTimer.getElapsedTimeAndResetF32(); - U32 i; - for (i = 0; i < kNumCachedInterpolants; i++) + F32 time_constant; + + for (std::map::iterator iter = sInterpolants.begin(); + iter != sInterpolants.end(); iter++) + { + time_constant = iter->first; + F32 new_interpolant = 1.f - pow(2.f, -sTimeDelta / time_constant); + new_interpolant = llclamp(new_interpolant, 0.f, 1.f); + sInterpolants[time_constant] = new_interpolant; + } +} + +//----------------------------------------------------------------------------- +// getInterpolant() +//----------------------------------------------------------------------------- +F32 LLCriticalDamp::getInterpolant(const F32 time_constant, BOOL use_cache) +{ + if (time_constant == 0.f) + { + return 1.f; + } + + if (use_cache && sInterpolants.count(time_constant)) { - sInterpolatedValues[i] = llclamp(sTimeDelta / sInterpolants[ i], 0.0f, 1.0f); + return sInterpolants[time_constant]; } + + F32 interpolant = 1.f - pow(2.f, -sTimeDelta / time_constant); + interpolant = llclamp(interpolant, 0.f, 1.f); + if (use_cache) + { + sInterpolants[time_constant] = interpolant; + } + + return interpolant; } diff --git a/indra/llcommon/llcriticaldamp.h b/indra/llcommon/llcriticaldamp.h index 19a2ddb77a..52f052ae25 100644 --- a/indra/llcommon/llcriticaldamp.h +++ b/indra/llcommon/llcriticaldamp.h @@ -32,98 +32,22 @@ #include "llframetimer.h" -// These enums each represent one fixed-time delta value -// that we interpolate once given the actual sTimeDelta time -// that has passed. This allows us to calculate the interp portion -// of those values once and then look them up repeatedly per frame. -// -enum InterpDelta -{ - InterpDelta_0_025, // 0.025 - InterpDeltaTeenier = InterpDelta_0_025, - InterpDeltaFolderOpenTime = InterpDelta_0_025, - InterpDeltaFolderCloseTime = InterpDelta_0_025, - InterpDeltaCameraFocusHalfLife = InterpDelta_0_025, // USED TO BE ZERO.... - - InterpDelta_0_05, // 0.05 - InterpDeltaTeeny = InterpDelta_0_05, - - InterpDelta_0_06, // 0.06 - InterpDeltaObjectDampingConstant = InterpDelta_0_06, - InterpDeltaCameraZoomHalfLife = InterpDelta_0_06, - InterpDeltaFovZoomHalfLife = InterpDelta_0_06, - InterpDeltaManipulatorScaleHalfLife = InterpDelta_0_06, - InterpDeltaContextFadeTime = InterpDelta_0_06, - - InterpDelta_0_10, // 0.10 - InterpDeltaSmaller = InterpDelta_0_10, - InterpDeltaTargetLagHalfLife = InterpDelta_0_10, - InterpDeltaSpeedAdjustTime = InterpDelta_0_10, - - InterpDelta_0_15, // 0.15 - InterpDeltaFadeWeight = InterpDelta_0_15, - InterpDeltaHeadLookAtLagHalfLife = InterpDelta_0_15, - - InterpDelta_0_20, // 0.20 - InterpDeltaSmall = InterpDelta_0_20, - InterpDeltaTorsoLagHalfLife = InterpDelta_0_20, - InterpDeltaPositionDampingTC = InterpDelta_0_20, - - InterpDelta_0_25, // 0.25 - InterpDeltaCameraLagHalfLife = InterpDelta_0_25, - InterpDeltaTorsoTargetLagHalfLife = InterpDelta_0_25, - InterpDeltaTorsoLookAtLagHalfLife = InterpDelta_0_25, - - InterpDelta_0_30, // 0.3 - InterpDeltaSmallish = InterpDelta_0_30, - - // Dynamically set interpolants which use setInterpolantConstant - // - InterpDeltaCameraSmoothingHalfLife, - InterpDeltaBehindnessLag, - InterpDeltaFocusLag, - InterpDeltaPositionLag, - InterpDeltaOpenTime, - InterpDeltaCloseTime, - - kNumCachedInterpolants -}; - class LL_COMMON_API LLCriticalDamp { public: LLCriticalDamp(); - // Updates all the known interp delta values for fast lookup in calls to getInterpolant(InterpDelta) - // + // MANIPULATORS static void updateInterpolants(); - static inline void setInterpolantConstant(InterpDelta whichDelta, const F32 time_constant) - { - llassert(whichDelta < kNumCachedInterpolants); - sInterpolants[whichDelta] = time_constant; - } - // ACCESSORS - static inline F32 getInterpolant(InterpDelta whichDelta) - { - llassert(whichDelta < kNumCachedInterpolants); - return sInterpolatedValues[whichDelta]; - } - - static inline F32 getInterpolant(const F32 time_constant) - { - return llclamp((sTimeDelta / time_constant), 0.0f, 1.0f); - } + static F32 getInterpolant(const F32 time_constant, BOOL use_cache = TRUE); protected: static LLFrameTimer sInternalTimer; // frame timer for calculating deltas - //static std::map sInterpolants; - static F32 sInterpolants[kNumCachedInterpolants]; - static F32 sInterpolatedValues[kNumCachedInterpolants]; + static std::map sInterpolants; static F32 sTimeDelta; }; #endif // LL_LLCRITICALDAMP_H - diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 3dfcb3ffa1..705fe16559 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -758,11 +758,11 @@ void LLButton::draw() mCurGlowStrength = lerp(mCurGlowStrength, mFlashing ? (flash? 1.0 : 0.0) : mHoverGlowStrength, - LLCriticalDamp::getInterpolant(InterpDeltaTeeny)); + LLCriticalDamp::getInterpolant(0.05f)); } else { - mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaTeeny)); + mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLCriticalDamp::getInterpolant(0.05f)); } // Draw button image, if available. @@ -1247,4 +1247,3 @@ BOOL LLButton::handleDoubleClick(S32 x, S32 y, MASK mask) // just treat a double click as a second click return handleMouseDown(x, y, mask); } - diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 32383b1f1d..3adc1a6c70 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -229,10 +229,7 @@ LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p) mOpenTimeConstant(p.open_time_constant), mCloseTimeConstant(p.close_time_constant), mResizeBarOverlap(p.resize_bar_overlap) -{ - LLCriticalDamp::setInterpolantConstant(InterpDeltaCloseTime, mCloseTimeConstant); - LLCriticalDamp::setInterpolantConstant(InterpDeltaOpenTime, mOpenTimeConstant); -} +{} LLLayoutStack::~LLLayoutStack() { @@ -595,7 +592,7 @@ bool LLLayoutStack::animatePanels() { if (!mAnimatedThisFrame) { - panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 1.f, LLCriticalDamp::getInterpolant(InterpDeltaOpenTime)); + panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 1.f, LLCriticalDamp::getInterpolant(mOpenTimeConstant)); if (panelp->mVisibleAmt > 0.99f) { panelp->mVisibleAmt = 1.f; @@ -620,7 +617,7 @@ bool LLLayoutStack::animatePanels() { if (!mAnimatedThisFrame) { - panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaCloseTime)); + panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 0.f, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); if (panelp->mVisibleAmt < 0.001f) { panelp->mVisibleAmt = 0.f; @@ -647,7 +644,7 @@ bool LLLayoutStack::animatePanels() { if (!mAnimatedThisFrame) { - panelp->mCollapseAmt = lerp(panelp->mCollapseAmt, collapse_state, LLCriticalDamp::getInterpolant(InterpDeltaCloseTime)); + panelp->mCollapseAmt = lerp(panelp->mCollapseAmt, collapse_state, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); } if (llabs(panelp->mCollapseAmt - collapse_state) < 0.001f) @@ -858,4 +855,3 @@ void LLLayoutStack::updateResizeBarLimits() previous_visible_panelp = visible_panelp; } } - diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index f142be885d..cd6cc6a75e 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3673,7 +3673,7 @@ void LLTearOffMenu::draw() if (getRect().getHeight() != mTargetHeight) { // animate towards target height - reshape(getRect().getWidth(), llceil(lerp((F32)getRect().getHeight(), mTargetHeight, LLCriticalDamp::getInterpolant(InterpDeltaTeeny)))); + reshape(getRect().getWidth(), llceil(lerp((F32)getRect().getHeight(), mTargetHeight, LLCriticalDamp::getInterpolant(0.05f)))); } LLFloater::draw(); } diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp index d65b4431a8..5d3bf7a670 100644 --- a/indra/llui/llscrollbar.cpp +++ b/indra/llui/llscrollbar.cpp @@ -493,11 +493,11 @@ void LLScrollbar::draw() BOOL hovered = getEnabled() && !other_captor && (hasMouseCapture() || mThumbRect.pointInRect(local_mouse_x, local_mouse_y)); if (hovered) { - mCurGlowStrength = lerp(mCurGlowStrength, mHoverGlowStrength, LLCriticalDamp::getInterpolant(InterpDeltaTeeny)); + mCurGlowStrength = lerp(mCurGlowStrength, mHoverGlowStrength, LLCriticalDamp::getInterpolant(0.05f)); } else { - mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaTeeny)); + mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLCriticalDamp::getInterpolant(0.05f)); } // Draw background and thumb. @@ -642,4 +642,3 @@ void LLScrollbar::onLineDownBtnPressed( const LLSD& data ) { changeLine( mStepSize, TRUE ); } - diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 1e64cd0df8..5fc2cc350d 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -406,7 +406,7 @@ void LLTabContainer::draw() } } - setScrollPosPixels((S32)lerp((F32)getScrollPosPixels(), (F32)target_pixel_scroll, LLCriticalDamp::getInterpolant(InterpDeltaTeeny))); + setScrollPosPixels((S32)lerp((F32)getScrollPosPixels(), (F32)target_pixel_scroll, LLCriticalDamp::getInterpolant(0.08f))); BOOL has_scroll_arrows = !getTabsHidden() && ((mMaxScrollPos > 0) || (mScrollPosPixels > 0)); if (!mIsVertical) @@ -2046,4 +2046,3 @@ void LLTabContainer::commitHoveredButton(S32 x, S32 y) } } } - diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index a40d9cd318..9025c7af8b 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -179,7 +179,7 @@ LLAgentCamera::LLAgentCamera() : clearGeneralKeys(); clearOrbitKeys(); - clearPanKeys(); + clearPanKeys(); } // Requires gSavedSettings to be initialized. @@ -192,9 +192,6 @@ void LLAgentCamera::init() mDrawDistance = gSavedSettings.getF32("RenderFarClip"); - const F32 SMOOTHING_HALF_LIFE = 0.02f; - LLCriticalDamp::setInterpolantConstant(InterpDeltaCameraSmoothingHalfLife, gSavedSettings.getF32("CameraPositionSmoothing") * SMOOTHING_HALF_LIFE); - LLViewerCamera::getInstance()->setView(DEFAULT_FIELD_OF_VIEW); // Leave at 0.1 meters until we have real near clip management LLViewerCamera::getInstance()->setNear(0.1f); @@ -340,7 +337,7 @@ void LLAgentCamera::resetView(BOOL reset_camera, BOOL change_camera) LLVector3 agent_at_axis = gAgent.getAtAxis(); agent_at_axis -= projected_vec(agent_at_axis, gAgent.getReferenceUpVector()); agent_at_axis.normalize(); - gAgent.resetAxes(lerp(gAgent.getAtAxis(), agent_at_axis, LLCriticalDamp::getInterpolant(InterpDeltaSmall))); + gAgent.resetAxes(lerp(gAgent.getAtAxis(), agent_at_axis, LLCriticalDamp::getInterpolant(0.3f))); } setFocusOnAvatar(TRUE, ANIMATE); @@ -1249,7 +1246,7 @@ void LLAgentCamera::updateCamera() gAgentCamera.clearPanKeys(); // lerp camera focus offset - mCameraFocusOffset = lerp(mCameraFocusOffset, mCameraFocusOffsetTarget, LLCriticalDamp::getInterpolant(InterpDeltaCameraFocusHalfLife)); + mCameraFocusOffset = lerp(mCameraFocusOffset, mCameraFocusOffsetTarget, LLCriticalDamp::getInterpolant(CAMERA_FOCUS_HALF_LIFE)); if ( mCameraMode == CAMERA_MODE_FOLLOW ) { @@ -1364,8 +1361,10 @@ void LLAgentCamera::updateCamera() mCameraSmoothingStop = mCameraSmoothingStop || in_build_mode; if (cameraThirdPerson() && !mCameraSmoothingStop) - { - F32 smoothing = LLCriticalDamp::getInterpolant(InterpDeltaCameraSmoothingHalfLife); + { + const F32 SMOOTHING_HALF_LIFE = 0.02f; + + F32 smoothing = LLCriticalDamp::getInterpolant(gSavedSettings.getF32("CameraPositionSmoothing") * SMOOTHING_HALF_LIFE, FALSE); if (!mFocusObject) // we differentiate on avatar mode { @@ -1395,7 +1394,7 @@ void LLAgentCamera::updateCamera() } - mCameraCurrentFOVZoomFactor = lerp(mCameraCurrentFOVZoomFactor, mCameraFOVZoomFactor, LLCriticalDamp::getInterpolant(InterpDeltaFovZoomHalfLife)); + mCameraCurrentFOVZoomFactor = lerp(mCameraCurrentFOVZoomFactor, mCameraFOVZoomFactor, LLCriticalDamp::getInterpolant(FOV_ZOOM_HALF_LIFE)); // llinfos << "Current FOV Zoom: " << mCameraCurrentFOVZoomFactor << " Target FOV Zoom: " << mCameraFOVZoomFactor << " Object penetration: " << mFocusObjectDist << llendl; @@ -1810,7 +1809,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) if (mTargetCameraDistance != mCurrentCameraDistance) { - F32 camera_lerp_amt = LLCriticalDamp::getInterpolant(InterpDeltaCameraZoomHalfLife); + F32 camera_lerp_amt = LLCriticalDamp::getInterpolant(CAMERA_ZOOM_HALF_LIFE); mCurrentCameraDistance = lerp(mCurrentCameraDistance, mTargetCameraDistance, camera_lerp_amt); } @@ -1828,7 +1827,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) if (isAgentAvatarValid()) { LLVector3d camera_lag_d; - F32 lag_interp = LLCriticalDamp::getInterpolant(InterpDeltaCameraLagHalfLife); + F32 lag_interp = LLCriticalDamp::getInterpolant(CAMERA_LAG_HALF_LIFE); LLVector3 target_lag; LLVector3 vel = gAgent.getVelocity(); @@ -1873,7 +1872,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) } else { - mCameraLag = lerp(mCameraLag, LLVector3::zero, LLCriticalDamp::getInterpolant(InterpDeltaCameraLagHalfLife)); + mCameraLag = lerp(mCameraLag, LLVector3::zero, LLCriticalDamp::getInterpolant(0.15f)); } camera_lag_d.setVec(mCameraLag); diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 235da41998..d29181a3ce 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -492,83 +492,97 @@ F32 LLDrawable::updateXform(BOOL undamped) BOOL damped = !undamped; // Position - LLVector3 old_pos = mXform.getPosition(); - - // get agent position or parent-relative position as appropriate - // - LLVector3 target_pos = mXform.isRoot() ? mVObjp->getPositionAgent() : mVObjp->getPosition(); - + LLVector3 old_pos(mXform.getPosition()); + LLVector3 target_pos; + if (mXform.isRoot()) + { + // get root position in your agent's region + target_pos = mVObjp->getPositionAgent(); + } + else + { + // parent-relative position + target_pos = mVObjp->getPosition(); + } + // Rotation LLQuaternion old_rot(mXform.getRotation()); LLQuaternion target_rot = mVObjp->getRotation(); - //scaling LLVector3 target_scale = mVObjp->getScale(); LLVector3 old_scale = mCurrentScale; LLVector3 dest_scale = target_scale; - LLVector3 scale_vec = old_scale-target_scale; - - static const F32 dot_threshold = 1.0f - FLT_EPSILON; - - F32 dist_squared = dist_vec_squared(old_pos, target_pos); - - bool translated = dist_squared > 0.0f; - bool rotated = !mVObjp->getAngularVelocity().isExactlyZero() || (dot(old_rot, target_rot) < dot_threshold); - bool scaled = (scale_vec * scale_vec) > MIN_INTERPOLATE_DISTANCE_SQUARED; - // Damping + // Damping + F32 dist_squared = 0.f; + F32 camdist2 = (mDistanceWRTCamera * mDistanceWRTCamera); + if (damped && isVisible()) { - F32 lerp_amt = LLCriticalDamp::getInterpolant(InterpDeltaObjectDampingConstant); + F32 lerp_amt = llclamp(LLCriticalDamp::getInterpolant(OBJECT_DAMPING_TIME_CONSTANT), 0.f, 1.f); LLVector3 new_pos = lerp(old_pos, target_pos, lerp_amt); - dist_squared = dist_vec_squared(new_pos, old_pos); + dist_squared = dist_vec_squared(new_pos, target_pos); LLQuaternion new_rot = nlerp(lerp_amt, old_rot, target_rot); - dist_squared += fabs(1.f - dot(new_rot, old_rot)) * 10.f; + // FIXME: This can be negative! It is be possible for some rots to 'cancel out' pos or size changes. + dist_squared += (1.f - dot(new_rot, target_rot)) * 10.f; LLVector3 new_scale = lerp(old_scale, target_scale, lerp_amt); - dist_squared += dist_vec_squared(new_scale, old_scale); + dist_squared += dist_vec_squared(new_scale, target_scale); - // If our lerp isn't moving too far, substitue the lerp'd pos for our target for this frame - // - if (dist_squared <= MAX_INTERPOLATE_DISTANCE_SQUARED) + if ((dist_squared >= MIN_INTERPOLATE_DISTANCE_SQUARED * camdist2) && + (dist_squared <= MAX_INTERPOLATE_DISTANCE_SQUARED)) { // interpolate target_pos = new_pos; target_rot = new_rot; target_scale = new_scale; } - else + else if (mVObjp->getAngularVelocity().isExactlyZero()) { - llinfos << "skipping update due to overly large lerp" << llendl; + // snap to final position (only if no target omega is applied) + dist_squared = 0.0f; + if (getVOVolume() && !isRoot()) + { //child prim snapping to some position, needs a rebuild + gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); + } } } + else + { + // The following fixes MAINT-1742 but breaks vehicles similar to MAINT-2275 + // dist_squared = dist_vec_squared(old_pos, target_pos); - if (translated || rotated || scaled) - { - if (scaled) - { - mCurrentScale = target_scale; - } + // The following fixes MAINT-2247 but causes MAINT-2275 + //dist_squared += (1.f - dot(old_rot, target_rot)) * 10.f; + //dist_squared += dist_vec_squared(old_scale, target_scale); + } + LLVector3 vec = mCurrentScale-target_scale; + + if (vec*vec > MIN_INTERPOLATE_DISTANCE_SQUARED) + { //scale change requires immediate rebuild + mCurrentScale = target_scale; + gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); + } + else if (!isRoot() && + (!mVObjp->getAngularVelocity().isExactlyZero() || + dist_squared > 0.f)) + { //child prim moving relative to parent, tag as needing to be rendered atomically and rebuild dist_squared = 1.f; //keep this object on the move list - - //child prim moving relative to parent, tag as needing to be rendered atomically - // - if (!isRoot() && !isState(LLDrawable::ANIMATED_CHILD)) + if (!isState(LLDrawable::ANIMATED_CHILD)) { setState(LLDrawable::ANIMATED_CHILD); - } - - // Mark any components that need to be rebuilt based on what change transpired - // - if (!rotated && !scaled) - gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); - else gPipeline.markRebuild(this, LLDrawable::REBUILD_ALL, TRUE); - - mVObjp->dirtySpatialGroup(); + mVObjp->dirtySpatialGroup(); + } } + else if (!isRoot() + && ( dist_vec_squared(old_pos, target_pos) > 0.f + || (1.f - dot(old_rot, target_rot)) > 0.f)) + { // update child prims moved from LSL + gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); + } else if (!getVOVolume() && !isAvatar()) { movePartition(); diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 643ce63f29..e7a3f9b390 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -940,7 +940,7 @@ void LLFastTimerView::draw() } //interpolate towards new maximum - last_max = (U64) lerp((F32)last_max, (F32) cur_max, LLCriticalDamp::getInterpolant(InterpDeltaSmaller)); + last_max = (U64) lerp((F32)last_max, (F32) cur_max, LLCriticalDamp::getInterpolant(0.1f)); if (last_max - cur_max <= 1 || cur_max - last_max <= 1) { last_max = cur_max; @@ -948,7 +948,7 @@ void LLFastTimerView::draw() F32 alpha_target = last_max > cur_max ? llmin((F32) last_max/ (F32) cur_max - 1.f,1.f) : llmin((F32) cur_max/ (F32) last_max - 1.f,1.f); - alpha_interp = lerp(alpha_interp, alpha_target, LLCriticalDamp::getInterpolant(InterpDeltaSmaller)); + alpha_interp = lerp(alpha_interp, alpha_target, LLCriticalDamp::getInterpolant(0.1f)); if (mHoverID != NULL) { diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index 10d31df22c..d6ebe44daa 100644 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -525,11 +525,11 @@ void LLFloaterColorPicker::draw() if (gFocusMgr.childHasMouseCapture(getDragHandle())) { - mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(InterpDeltaContextFadeTime)); + mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); } else { - mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaContextFadeTime)); + mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); } mPipetteBtn->setToggleState(LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance()); @@ -1113,4 +1113,3 @@ void LLFloaterColorPicker::stopUsingPipette() LLToolMgr::getInstance()->clearTransientTool(); } } - diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 103eaace88..d8d62e5bbb 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -478,7 +478,7 @@ void LLSnapshotLivePreview::draw() { if (mFlashAlpha < 1.f) { - mFlashAlpha = lerp(mFlashAlpha, 1.f, LLCriticalDamp::getInterpolant(InterpDeltaTeenier)); + mFlashAlpha = lerp(mFlashAlpha, 1.f, LLCriticalDamp::getInterpolant(0.02f)); } else { @@ -487,7 +487,7 @@ void LLSnapshotLivePreview::draw() } else { - mFlashAlpha = lerp(mFlashAlpha, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaSmallish) * 0.5f); + mFlashAlpha = lerp(mFlashAlpha, 0.f, LLCriticalDamp::getInterpolant(0.15f)); } // Draw shining animation if appropriate. @@ -2500,4 +2500,3 @@ BOOL LLSnapshotFloaterView::handleHover(S32 x, S32 y, MASK mask) } return TRUE; } - diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 23241b57c4..3aa16b4413 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -1293,7 +1293,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) // animate current height towards target height if (llabs(mCurHeight - mTargetHeight) > 1.f) { - mCurHeight = lerp(mCurHeight, mTargetHeight, LLCriticalDamp::getInterpolant(mIsOpen ? InterpDeltaFolderOpenTime : InterpDeltaFolderCloseTime)); + mCurHeight = lerp(mCurHeight, mTargetHeight, LLCriticalDamp::getInterpolant(mIsOpen ? FOLDER_OPEN_TIME_CONSTANT : FOLDER_CLOSE_TIME_CONSTANT)); requestArrange(); @@ -2538,11 +2538,11 @@ void LLFolderViewFolder::draw() } else if (mIsOpen) { - mControlLabelRotation = lerp(mControlLabelRotation, -90.f, LLCriticalDamp::getInterpolant(InterpDeltaTeeny)); + mControlLabelRotation = lerp(mControlLabelRotation, -90.f, LLCriticalDamp::getInterpolant(0.04f)); } else { - mControlLabelRotation = lerp(mControlLabelRotation, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaTeenier)); + mControlLabelRotation = lerp(mControlLabelRotation, 0.f, LLCriticalDamp::getInterpolant(0.025f)); } bool possibly_has_children = false; @@ -2899,4 +2899,3 @@ bool LLInventorySort::operator()(const LLFolderViewItem* const& a, const LLFolde } } } - diff --git a/indra/newview/llfollowcam.cpp b/indra/newview/llfollowcam.cpp index a3c1996512..b670af1782 100644 --- a/indra/newview/llfollowcam.cpp +++ b/indra/newview/llfollowcam.cpp @@ -148,16 +148,14 @@ LLFollowCamParams::~LLFollowCamParams() { } //--------------------------------------------------------- void LLFollowCamParams::setPositionLag( F32 p ) { - mPositionLag = llclamp(p, FOLLOW_CAM_MIN_POSITION_LAG, FOLLOW_CAM_MAX_POSITION_LAG); - LLCriticalDamp::setInterpolantConstant(InterpDeltaPositionLag, mPositionLag); + mPositionLag = llclamp(p, FOLLOW_CAM_MIN_POSITION_LAG, FOLLOW_CAM_MAX_POSITION_LAG); } //--------------------------------------------------------- void LLFollowCamParams::setFocusLag( F32 f ) { - mFocusLag = llclamp(f, FOLLOW_CAM_MIN_FOCUS_LAG, FOLLOW_CAM_MAX_FOCUS_LAG); - LLCriticalDamp::setInterpolantConstant(InterpDeltaFocusLag, mFocusLag); + mFocusLag = llclamp(f, FOLLOW_CAM_MIN_FOCUS_LAG, FOLLOW_CAM_MAX_FOCUS_LAG); } @@ -186,7 +184,6 @@ void LLFollowCamParams::setPitch( F32 p ) void LLFollowCamParams::setBehindnessLag( F32 b ) { mBehindnessLag = llclamp(b, FOLLOW_CAM_MIN_BEHINDNESS_LAG, FOLLOW_CAM_MAX_BEHINDNESS_LAG); - LLCriticalDamp::setInterpolantConstant(InterpDeltaBehindnessLag, mBehindnessLag); } //--------------------------------------------------------- @@ -331,11 +328,11 @@ void LLFollowCam::update() F32 force = focusOffsetDistance - focusThresholdNormalizedByDistance; */ - F32 focusLagLerp = LLCriticalDamp::getInterpolant(InterpDeltaFocusLag); + F32 focusLagLerp = LLCriticalDamp::getInterpolant( mFocusLag ); focus_pt_agent = lerp( focus_pt_agent, whereFocusWantsToBe, focusLagLerp ); mSimulatedFocusGlobal = gAgent.getPosGlobalFromAgent(focus_pt_agent); } - mRelativeFocus = lerp(mRelativeFocus, (focus_pt_agent - mSubjectPosition) * ~mSubjectRotation, LLCriticalDamp::getInterpolant(InterpDeltaTeeny)); + mRelativeFocus = lerp(mRelativeFocus, (focus_pt_agent - mSubjectPosition) * ~mSubjectRotation, LLCriticalDamp::getInterpolant(0.05f)); }// if focus is not locked --------------------------------------------- @@ -418,7 +415,7 @@ void LLFollowCam::update() //------------------------------------------------------------------------------------------------- if ( distanceFromPositionToIdealPosition > mPositionThreshold ) { - F32 positionPullLerp = LLCriticalDamp::getInterpolant(InterpDeltaPositionLag); + F32 positionPullLerp = LLCriticalDamp::getInterpolant( mPositionLag ); simulated_pos_agent = lerp( simulated_pos_agent, whereCameraPositionWantsToBe, positionPullLerp ); } @@ -438,7 +435,7 @@ void LLFollowCam::update() updateBehindnessConstraint(gAgent.getPosAgentFromGlobal(mSimulatedFocusGlobal), simulated_pos_agent); mSimulatedPositionGlobal = gAgent.getPosGlobalFromAgent(simulated_pos_agent); - mRelativePos = lerp(mRelativePos, (simulated_pos_agent - mSubjectPosition) * ~mSubjectRotation, LLCriticalDamp::getInterpolant(InterpDeltaTeeny)); + mRelativePos = lerp(mRelativePos, (simulated_pos_agent - mSubjectPosition) * ~mSubjectRotation, LLCriticalDamp::getInterpolant(0.05f)); } // if position is not locked ----------------------------------------------------------- @@ -493,7 +490,7 @@ BOOL LLFollowCam::updateBehindnessConstraint(LLVector3 focus, LLVector3& cam_pos if ( cameraOffsetAngle > mBehindnessMaxAngle ) { - F32 fraction = ((cameraOffsetAngle - mBehindnessMaxAngle) / cameraOffsetAngle) * LLCriticalDamp::getInterpolant(InterpDeltaBehindnessLag); + F32 fraction = ((cameraOffsetAngle - mBehindnessMaxAngle) / cameraOffsetAngle) * LLCriticalDamp::getInterpolant(mBehindnessLag); cam_position = focus + horizontalSubjectBack * (slerp(fraction, camera_offset_rotation, LLQuaternion::DEFAULT)); cam_position.mV[VZ] = cameraZ; // clamp z value back to what it was before we started messing with it constraint_active = TRUE; diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp index b94681b340..482294c8a6 100644 --- a/indra/newview/llhudnametag.cpp +++ b/indra/newview/llhudnametag.cpp @@ -980,7 +980,7 @@ void LLHUDNameTag::updateAll() // { // continue; // } - (*this_object_it)->mPositionOffset = lerp((*this_object_it)->mPositionOffset, (*this_object_it)->mTargetPositionOffset, LLCriticalDamp::getInterpolant(InterpDeltaPositionDampingTC)); + (*this_object_it)->mPositionOffset = lerp((*this_object_it)->mPositionOffset, (*this_object_it)->mTargetPositionOffset, LLCriticalDamp::getInterpolant(POSITION_DAMPING_TC)); } } @@ -1083,4 +1083,3 @@ F32 LLHUDNameTag::LLHUDTextSegment::getWidth(const LLFontGL* font) return width; } } - diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index 748ac7a16e..826e8d560a 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -240,7 +240,7 @@ void LLManipRotate::render() if (mManipPart == LL_ROT_Z) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.pushMatrix(); { // selected part @@ -251,7 +251,7 @@ void LLManipRotate::render() } else if (mManipPart == LL_ROT_Y) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.pushMatrix(); { gGL.rotatef( 90.f, 1.f, 0.f, 0.f ); @@ -262,7 +262,7 @@ void LLManipRotate::render() } else if (mManipPart == LL_ROT_X) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.pushMatrix(); { gGL.rotatef( 90.f, 0.f, 1.f, 0.f ); @@ -273,13 +273,13 @@ void LLManipRotate::render() } else if (mManipPart == LL_ROT_ROLL) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } else if (mManipPart == LL_NO_PART) { if (mHighlightedPart == LL_NO_PART) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } LLGLEnable cull_face(GL_CULL_FACE); @@ -294,7 +294,7 @@ void LLManipRotate::render() { if (mHighlightedPart == LL_ROT_Z) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.scalef(mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ]); // hovering over part gl_ring( mRadiusMeters, width_meters, LLColor4( 0.f, 0.f, 1.f, 1.f ), LLColor4( 0.f, 0.f, 1.f, 0.5f ), CIRCLE_STEPS, i); @@ -312,7 +312,7 @@ void LLManipRotate::render() gGL.rotatef( 90.f, 1.f, 0.f, 0.f ); if (mHighlightedPart == LL_ROT_Y) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.scalef(mManipulatorScales.mV[VY], mManipulatorScales.mV[VY], mManipulatorScales.mV[VY]); // hovering over part gl_ring( mRadiusMeters, width_meters, LLColor4( 0.f, 1.f, 0.f, 1.f ), LLColor4( 0.f, 1.f, 0.f, 0.5f ), CIRCLE_STEPS, i); @@ -330,7 +330,7 @@ void LLManipRotate::render() gGL.rotatef( 90.f, 0.f, 1.f, 0.f ); if (mHighlightedPart == LL_ROT_X) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.scalef(mManipulatorScales.mV[VX], mManipulatorScales.mV[VX], mManipulatorScales.mV[VX]); // hovering over part @@ -346,7 +346,7 @@ void LLManipRotate::render() if (mHighlightedPart == LL_ROT_ROLL) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } } diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index 9802d5503e..00a0bf8894 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -535,11 +535,11 @@ void LLManipScale::highlightManipulators(S32 x, S32 y) { if (mHighlightedPart == MANIPULATOR_IDS[i]) { - mManipulatorScales[i] = lerp(mManipulatorScales[i], SELECTED_MANIPULATOR_SCALE, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales[i] = lerp(mManipulatorScales[i], SELECTED_MANIPULATOR_SCALE, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } else { - mManipulatorScales[i] = lerp(mManipulatorScales[i], 1.f, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales[i] = lerp(mManipulatorScales[i], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } } @@ -2082,4 +2082,3 @@ BOOL LLManipScale::canAffectSelection() } return can_scale; } - diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index 9d287e7a03..0228807dc8 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -1922,18 +1922,18 @@ void LLManipTranslate::renderTranslationHandles() { if (index == mManipPart - LL_X_ARROW || index == mHighlightedPart - LL_X_ARROW) { - mArrowScales.mV[index] = lerp(mArrowScales.mV[index], SELECTED_ARROW_SCALE, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); - mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mArrowScales.mV[index] = lerp(mArrowScales.mV[index], SELECTED_ARROW_SCALE, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); + mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); } else if (index == mManipPart - LL_YZ_PLANE || index == mHighlightedPart - LL_YZ_PLANE) { - mArrowScales.mV[index] = lerp(mArrowScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); - mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], SELECTED_ARROW_SCALE, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mArrowScales.mV[index] = lerp(mArrowScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); + mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], SELECTED_ARROW_SCALE, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); } else { - mArrowScales.mV[index] = lerp(mArrowScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); - mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mArrowScales.mV[index] = lerp(mArrowScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); + mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); } } @@ -2323,4 +2323,3 @@ BOOL LLManipTranslate::canAffectSelection() } return can_move; } - diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 274497f2b5..1bda7640bd 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -162,7 +162,7 @@ void LLNetMap::draw() static LLUICachedControl auto_center("MiniMapAutoCenter", true); if (auto_center) { - mCurPan = lerp(mCurPan, mTargetPan, LLCriticalDamp::getInterpolant(InterpDeltaSmaller)); + mCurPan = lerp(mCurPan, mTargetPan, LLCriticalDamp::getInterpolant(0.1f)); } // Prepare a scissor region @@ -987,4 +987,3 @@ void LLNetMap::handleStopTracking (const LLSD& userdata) LLTracker::stopTracking ((void*)LLTracker::isTracking(NULL)); } } - diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index cf9d95455e..343316d30a 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6108,14 +6108,6 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); gGL.begin(LLRender::LINES); { - // Lines require an even number of verts so repeat the first - // vert if we don't meet that requirement - // - if (mSilhouetteVertices.size() & 0x1) - { - mSilhouetteVertices.push_back(mSilhouetteVertices[0]); - } - for(S32 i = 0; i < mSilhouetteVertices.size(); i += 2) { u_coord += u_divisor * LLSelectMgr::sHighlightUScale; @@ -7555,4 +7547,3 @@ void LLSelectMgr::sendSelectionMove() //saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); } - diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 8c5844eca7..ec36cf48c2 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -549,11 +549,11 @@ void LLFloaterTexturePicker::draw() if (gFocusMgr.childHasMouseCapture(getDragHandle())) { - mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(InterpDeltaContextFadeTime)); + mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); } else { - mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaContextFadeTime)); + mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); } updateImageStats(); diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 3f97659c66..9ffc64312d 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -1033,7 +1033,7 @@ void render_hud_attachments() // clamp target zoom level to reasonable values gAgentCamera.mHUDTargetZoom = llclamp(gAgentCamera.mHUDTargetZoom, 0.1f, 1.f); // smoothly interpolate current zoom level - gAgentCamera.mHUDCurZoom = lerp(gAgentCamera.mHUDCurZoom, gAgentCamera.mHUDTargetZoom, LLCriticalDamp::getInterpolant(InterpDeltaTeenier)); + gAgentCamera.mHUDCurZoom = lerp(gAgentCamera.mHUDCurZoom, gAgentCamera.mHUDTargetZoom, LLCriticalDamp::getInterpolant(0.03f)); if (LLPipeline::sShowHUDAttachments && !gDisconnected && setup_hud_matrices()) { @@ -1593,4 +1593,3 @@ void display_cleanup() { gDisconnectedImagep = NULL; } - diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index d28da507ea..4efd59685e 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2913,7 +2913,7 @@ void LLVOAvatar::idleUpdateWindEffect() LLVector3 velocity = getVelocity(); F32 speed = velocity.length(); //RN: velocity varies too much frame to frame for this to work - mRippleAccel.clearVec();//lerp(mRippleAccel, (velocity - mLastVel) * time_delta, LLCriticalDamp::getInterpolant(InterpDeltaTeenier)); + mRippleAccel.clearVec();//lerp(mRippleAccel, (velocity - mLastVel) * time_delta, LLCriticalDamp::getInterpolant(0.02f)); mLastVel = velocity; LLVector4 wind; wind.setVec(getRegion()->mWind.getVelocityNoisy(getPositionAgent(), 4.f) - velocity); @@ -2934,10 +2934,13 @@ void LLVOAvatar::idleUpdateWindEffect() wind.mV[VW] = llmin(0.025f + (speed * 0.015f) + hover_strength, 0.5f); F32 interp; - interp = LLCriticalDamp::getInterpolant(InterpDeltaSmall); - if (wind.mV[VW] <= mWindVec.mV[VW]) + if (wind.mV[VW] > mWindVec.mV[VW]) { - interp *= 2.0f; + interp = LLCriticalDamp::getInterpolant(0.2f); + } + else + { + interp = LLCriticalDamp::getInterpolant(0.4f); } mWindVec = lerp(mWindVec, wind, interp); @@ -3798,6 +3801,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // Set the root rotation, but do so incrementally so that it // lags in time by some fixed amount. + //F32 u = LLCriticalDamp::getInterpolant(PELVIS_LAG); F32 pelvis_lag_time = 0.f; if (self_in_mouselook) { diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 7c3bc5988c..eeaa30aafb 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -302,8 +302,8 @@ void LLWorldMapView::draw() mVisibleRegions.clear(); // animate pan if necessary - sPanX = lerp(sPanX, sTargetPanX, LLCriticalDamp::getInterpolant(InterpDeltaSmaller)); - sPanY = lerp(sPanY, sTargetPanY, LLCriticalDamp::getInterpolant(InterpDeltaSmaller)); + sPanX = lerp(sPanX, sTargetPanX, LLCriticalDamp::getInterpolant(0.1f)); + sPanY = lerp(sPanY, sTargetPanY, LLCriticalDamp::getInterpolant(0.1f)); const S32 width = getRect().getWidth(); const S32 height = getRect().getHeight(); -- cgit v1.2.3 From 54d8249691aea2b1bd3cd21d2569c977ff469e6f Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Thu, 14 Mar 2013 06:56:23 -0700 Subject: Fix mismerge losing rollback change --- indra/llcharacter/llkeyframewalkmotion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llcharacter/llkeyframewalkmotion.cpp b/indra/llcharacter/llkeyframewalkmotion.cpp index 8422553beb..69f064b615 100644 --- a/indra/llcharacter/llkeyframewalkmotion.cpp +++ b/indra/llcharacter/llkeyframewalkmotion.cpp @@ -383,7 +383,7 @@ BOOL LLFlyAdjustMotion::onUpdate(F32 time, U8* joint_mask) F32 target_roll = llclamp(ang_vel.mV[VZ], -4.f, 4.f) * roll_factor; // roll is critically damped interpolation between current roll and angular velocity-derived target roll - mRoll = lerp(mRoll, target_roll, LLCriticalDamp::getInterpolant(InterpDeltaSmaller)); + mRoll = lerp(mRoll, target_roll, LLCriticalDamp::getInterpolant(0.1f)); LLQuaternion roll(mRoll, LLVector3(0.f, 0.f, 1.f)); mPelvisState->setRotation(roll); -- cgit v1.2.3 From aec007f8bd21d2133130fc6157202101c2424a6c Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 14 Mar 2013 11:09:39 -0700 Subject: forgot to add new .xml file for the gear menu in the FBC Test panel. Also cleaned up the code I added. --- indra/newview/llpanelpeople.cpp | 29 ++++++++------------- indra/newview/llpanelpeople.h | 2 ++ .../newview/skins/default/xui/en/menu_gear_fbc.xml | 30 ++++++++++++++++++++++ 3 files changed, 42 insertions(+), 19 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/menu_gear_fbc.xml diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index dfc48145dc..ab82273ccd 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1652,10 +1652,8 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name) return isAccordionCollapsedByUser(getChild(name)); } -void LLPanelPeople::onLoginFbcButtonClicked() +void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p) { - LLFloaterWebContent::Params p; - p.url("https://cryptic-ridge-1632.herokuapp.com/"); LLFloater* browser = LLFloaterReg::showInstance("web_content", p); if (browser) @@ -1666,31 +1664,24 @@ void LLPanelPeople::onLoginFbcButtonClicked() } } +void LLPanelPeople::onLoginFbcButtonClicked() +{ + LLFloaterWebContent::Params p; + p.url("https://cryptic-ridge-1632.herokuapp.com/"); + openFacebookWeb(p); +} + void LLPanelPeople::onFacebookAppRequestClicked() { LLFloaterWebContent::Params p; p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=https://cryptic-ridge-1632.herokuapp.com/"); - LLFloater* browser = LLFloaterReg::showInstance("web_content", p); - - if (browser) - { - // start checking the browser to see if the data is available yet - mFbcTestBrowserHandle = browser->getHandle(); - mFbcTestListUpdater->setActive(true); - } + openFacebookWeb(p); } void LLPanelPeople::onFacebookAppSendClicked() { LLFloaterWebContent::Params p; p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Test&link=http://www.cnet.com&redirect_uri=https://cryptic-ridge-1632.herokuapp.com/"); - LLFloater* browser = LLFloaterReg::showInstance("web_content", p); - - if (browser) - { - // start checking the browser to see if the data is available yet - mFbcTestBrowserHandle = browser->getHandle(); - mFbcTestListUpdater->setActive(true); - } + openFacebookWeb(p); } // EOF diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index feb32d1f69..39cdbc9bd7 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -30,6 +30,7 @@ #include #include "llcallingcard.h" // for avatar tracker +#include "llfloaterwebcontent.h" #include "llvoiceclient.h" class LLAvatarList; @@ -117,6 +118,7 @@ private: void onLoginFbcButtonClicked(); void onFacebookAppRequestClicked(); void onFacebookAppSendClicked(); + void openFacebookWeb(LLFloaterWebContent::Params& p); //returns false only if group is "none" bool isRealGroup(); diff --git a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml new file mode 100644 index 0000000000..b05ba46107 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3 From ea5ddf3c9f887719eb9fe0c7908eba7d22749b44 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Thu, 14 Mar 2013 11:22:09 -0700 Subject: Remove hard-coded cam distance hack --- indra/newview/lldrawable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index dc0e256ebb..235da41998 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -767,7 +767,7 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update) } pos -= camera.getOrigin(); - mDistanceWRTCamera = 20.0f;//llround(pos.magVec(), 0.01f); + mDistanceWRTCamera = llround(pos.magVec(), 0.01f); mVObjp->updateLOD(); } } -- cgit v1.2.3 From cc2e0caa5f26baf29ce6cccb120ea95621cfe038 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 14 Mar 2013 13:22:23 -0500 Subject: Fix for broken LoD. Reviewed by Graham. --- indra/newview/lldrawable.cpp | 2 +- indra/newview/llvovolume.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index dc0e256ebb..235da41998 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -767,7 +767,7 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update) } pos -= camera.getOrigin(); - mDistanceWRTCamera = 20.0f;//llround(pos.magVec(), 0.01f); + mDistanceWRTCamera = llround(pos.magVec(), 0.01f); mVObjp->updateLOD(); } } diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 3ce32b40bb..9dcdd467e7 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1299,9 +1299,9 @@ BOOL LLVOVolume::calcLOD() if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_LOD_INFO) && mDrawable->getFace(0)) { - //setDebugText(llformat("%.2f:%.2f, %d", debug_distance, radius, cur_detail)); + setDebugText(llformat("%.2f:%.2f, %d", mDrawable->mDistanceWRTCamera, radius, cur_detail)); - setDebugText(llformat("%d", mDrawable->getFace(0)->getTextureIndex())); + //setDebugText(llformat("%d", mDrawable->getFace(0)->getTextureIndex())); } if (cur_detail != mLOD) @@ -2993,7 +2993,7 @@ void LLVOVolume::generateSilhouette(LLSelectNode* nodep, const LLVector3& view_p //transform view vector into volume space view_vector -= getRenderPosition(); - mDrawable->mDistanceWRTCamera = view_vector.length(); + //mDrawable->mDistanceWRTCamera = view_vector.length(); LLQuaternion worldRot = getRenderRotation(); view_vector = view_vector * ~worldRot; if (!isVolumeGlobal()) -- cgit v1.2.3 From 830e3ea0ec83070b56b805e43cb3ad261c413802 Mon Sep 17 00:00:00 2001 From: Baker Linden Date: Fri, 15 Mar 2013 16:30:11 -0700 Subject: [MAINT-2386] Viewer crashes when user move landmarks from Inventory -> Landmarks or Places to Favorite bar - Fixed a bug where the viewer would crash when adding multiple landmarks to an empty favorites bar [Reviewer] Kelly --- indra/newview/llfavoritesbar.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 4cbc9cab4a..eb2b4b1ba2 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -1,4 +1,4 @@ -/** +]/** * @file llfavoritesbar.cpp * @brief LLFavoritesBarCtrl class implementation * @@ -546,6 +546,10 @@ void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, con bool insert_before = true; if (!mItems.empty()) { + // [MAINT-2386] When multiple landmarks are selected and dragged onto an empty favorites bar, + // the viewer would crash when casting mLastTab below, as mLastTab is still null when the + // second landmark is being added. + // To ensure mLastTab is valid, we need to call updateButtons() at the end of this function dest = dynamic_cast(mLandingTab); if (!dest) { @@ -616,6 +620,11 @@ void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, con cb); } + // [MAINT-2386] Ensure the favorite button has been created and is valid. + // This also ensures that mLastTab will be valid when dropping multiple + // landmarks to an empty favorites bar. + updateButtons(); + llinfos << "Copied inventory item #" << item->getUUID() << " to favorites." << llendl; } -- cgit v1.2.3 From 5216e9579f05b133b0cbd3fda9d5f7322ed4aacf Mon Sep 17 00:00:00 2001 From: Baker Linden Date: Mon, 18 Mar 2013 11:39:24 -0700 Subject: Found an errant right bracket at the top of the file -- whoopsie! --- indra/newview/llfavoritesbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index eb2b4b1ba2..b5f5a1d169 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -1,4 +1,4 @@ -]/** +/** * @file llfavoritesbar.cpp * @brief LLFavoritesBarCtrl class implementation * -- cgit v1.2.3 From 79edd066a4ddce341b556642bf6b98ef761d59f6 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Mon, 18 Mar 2013 17:00:29 -0700 Subject: MAINT-2497 FIX (Viewer) - viewer side change that goes with server side fix - adds direction when you set a TP landing point --- indra/newview/llfloaterland.cpp | 9 +++++++-- indra/newview/llviewermessage.cpp | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 5f58577a7c..22dd688be1 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2025,6 +2025,10 @@ void LLPanelLandOptions::refresh() mSnapshotCtrl->setImageAssetID(parcel->getSnapshotID()); mSnapshotCtrl->setEnabled( can_change_identity ); + // find out where we're looking and convert that to an angle in degrees on a regular compass (not the internal representation) + LLVector3 user_look_at = parcel->getUserLookAt(); + U32 user_look_at_angle = ( (U32)( ( atan2(user_look_at[1], -user_look_at[0]) + F_PI * 2 ) * RAD_TO_DEG + 0.5) - 90) % 360; + LLVector3 pos = parcel->getUserLocation(); if (pos.isExactlyZero()) { @@ -2032,10 +2036,11 @@ void LLPanelLandOptions::refresh() } else { - mLocationText->setTextArg("[LANDING]",llformat("%d, %d, %d", + mLocationText->setTextArg("[LANDING]",llformat("%d, %d, %d (%d\xC2\xB0)", llround(pos.mV[VX]), llround(pos.mV[VY]), - llround(pos.mV[VZ]))); + llround(pos.mV[VZ]), + user_look_at_angle)); } mSetBtn->setEnabled( can_change_landing_point ); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 6e02fafd01..bdb09b4c6f 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4065,7 +4065,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) { LLTracker::stopTracking(NULL); } - else if ( is_teleport && !gAgent.getTeleportKeepsLookAt() ) + else if ( is_teleport && !gAgent.getTeleportKeepsLookAt() && look_at.isExactlyZero()) { //look at the beacon LLVector3 global_agent_pos = agent_pos; -- cgit v1.2.3 From ad26f3c39002b6043e5fc4e00f9793e0f0e4941c Mon Sep 17 00:00:00 2001 From: Geenz Date: Tue, 19 Mar 2013 05:50:50 -0400 Subject: IME support (and revamped text input support) semi-working. --- indra/llwindow/llopenglview-objc.h | 3 +- indra/llwindow/llopenglview-objc.mm | 126 ++++++++++++++++++++++++++++++++---- indra/llwindow/llwindowmacosx.cpp | 12 +++- indra/newview/SecondLife.nib | Bin 7403 -> 7403 bytes indra/newview/SecondLife.xib | 31 ++++++--- 5 files changed, 146 insertions(+), 26 deletions(-) diff --git a/indra/llwindow/llopenglview-objc.h b/indra/llwindow/llopenglview-objc.h index c3ae34ea50..c144831da4 100644 --- a/indra/llwindow/llopenglview-objc.h +++ b/indra/llwindow/llopenglview-objc.h @@ -15,9 +15,10 @@ // Some nasty shovelling of LLOpenGLView from LLNativeBindings to prevent any C++ <-> Obj-C interop oddities. // Redraw callback handling removed (for now) due to being unneeded in the patch that preceeds this addition. -@interface LLOpenGLView : NSOpenGLView +@interface LLOpenGLView : NSOpenGLView { std::string mLastDraggedUrl; + unsigned int mModifiers; } - (id) initWithSamples:(NSUInteger)samples; - (id) initWithSamples:(NSUInteger)samples andVsync:(BOOL)vsync; diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 6ea523ea05..d568ed2fe5 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -94,6 +94,7 @@ - (id) initWithFrame:(NSRect)frame withSamples:(NSUInteger)samples andVsync:(BOOL)vsync { + [[self window] makeFirstResponder:self]; [self registerForDraggedTypes:[NSArray arrayWithObject:NSURLPboardType]]; [self initWithFrame:frame]; @@ -199,6 +200,7 @@ - (void) mouseDown:(NSEvent *)theEvent { + [self becomeFirstResponder]; [_window mouseDown:theEvent]; } @@ -234,7 +236,49 @@ - (void) keyDown:(NSEvent *)theEvent { - [_window keyDown:theEvent]; + [[self inputContext] handleEvent:theEvent]; + uint keycode = [theEvent keyCode]; + + switch (keycode) { + case 0x7b: + case 0x7c: + case 0x7d: + case 0x7e: + callKeyDown(keycode, mModifiers); + break; + + default: + callKeyDown(keycode, mModifiers); + NSString *chars = [theEvent characters]; + for (uint i = 0; i < [chars length]; i++) { + // Enter and Return are special cases. + unichar returntest = [chars characterAtIndex:i]; + if ((returntest == NSCarriageReturnCharacter || returntest == NSEnterCharacter) && + !([theEvent modifierFlags] & NSCommandKeyMask) && + !([theEvent modifierFlags] & NSAlternateKeyMask) && + !([theEvent modifierFlags] & NSControlKeyMask)) + { + callUnicodeCallback(13, 0); + } else { + // The command key being pressed is also a special case. + // Control + produces an ASCII control character code. + // Command + produces just the character's code. + // Check to see if the command key is pressed, then filter through the different character ranges that are relevant to control characters, and subtract the appropriate range. + if ([theEvent modifierFlags] & NSCommandKeyMask) + { + if (returntest >= 64 && returntest <= 95) + { + callUnicodeCallback(returntest - 63, mModifiers); + } else if (returntest >= 97 && returntest <= 122) + { + callUnicodeCallback(returntest - 96, mModifiers); + } + } + } + } + break; + } + } - (void) mouseMoved:(NSEvent *)theEvent @@ -242,9 +286,9 @@ [_window mouseMoved:theEvent]; } -- (void) flagsChanged:(NSEvent *)theEvent -{ - [_window flagsChanged:theEvent]; +- (void)flagsChanged:(NSEvent *)theEvent { + mModifiers = [theEvent modifierFlags]; + callModifier([theEvent modifierFlags]); } - (void) mouseExited:(NSEvent *)theEvent @@ -252,14 +296,9 @@ [_window mouseExited:theEvent]; } -- (BOOL) becomeFirstResponder +- (BOOL) acceptsFirstResponder { - return [_window becomeFirstResponder]; -} - -- (BOOL) resignFirstResponder -{ - return [_window resignFirstResponder]; + return YES; } - (NSDragOperation) draggingEntered:(id)sender @@ -305,6 +344,67 @@ return true; } +- (BOOL)hasMarkedText +{ + return NO; +} + +- (NSRange)markedRange +{ + return NSMakeRange(NSNotFound, 0); +} + +- (NSRange)selectedRange +{ + return NSMakeRange(NSNotFound, 0); +} + +- (void)setMarkedText:(id)aString selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange +{ +} + +- (void)unmarkText +{ + +} + +- (NSArray *)validAttributesForMarkedText +{ + return [NSArray array]; +} + +- (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange +{ + return nil; +} + +- (void)insertText:(id)aString replacementRange:(NSRange)replacementRange +{ + for (NSInteger i = 0; i < [aString length]; i++) + { + callUnicodeCallback([aString characterAtIndex:i], mModifiers); + } +} + +- (NSUInteger)characterIndexForPoint:(NSPoint)aPoint +{ + return NSNotFound; +} + +- (NSRect)firstRectForCharacterRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange +{ + return NSZeroRect; +} + +- (void)doCommandBySelector:(SEL)aSelector +{ +} + +- (BOOL)drawsVerticallyForCharacterAtIndex:(NSUInteger)charIndex +{ + return NO; +} + @end // We use a custom NSWindow for our event handling. @@ -315,12 +415,13 @@ - (id) init { - + [self makeFirstResponder:[self contentView]]; return self; } - (void) keyDown:(NSEvent *)theEvent { + uint keycode = [theEvent keyCode]; switch (keycode) { @@ -364,6 +465,7 @@ } break; } + } - (void) keyUp:(NSEvent *)theEvent { diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 34cc371526..08612bace4 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -223,7 +223,10 @@ void callUnicodeCallback(wchar_t character, unsigned int mask) void callFocus() { - gWindowImplementation->getCallbacks()->handleFocus(gWindowImplementation); + if (gWindowImplementation) + { + gWindowImplementation->getCallbacks()->handleFocus(gWindowImplementation); + } } void callFocusLost() @@ -369,9 +372,12 @@ void callHandleDragDropped(std::string url) void callQuitHandler() { - if(gWindowImplementation->getCallbacks()->handleCloseRequest(gWindowImplementation)) + if (gWindowImplementation) { - gWindowImplementation->getCallbacks()->handleQuit(gWindowImplementation); + if(gWindowImplementation->getCallbacks()->handleCloseRequest(gWindowImplementation)) + { + gWindowImplementation->getCallbacks()->handleQuit(gWindowImplementation); + } } } diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib index ff218a21c8..f55ddaabcd 100644 Binary files a/indra/newview/SecondLife.nib and b/indra/newview/SecondLife.nib differ diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib index 86e8d81ebc..7d20b7fd7c 100644 --- a/indra/newview/SecondLife.xib +++ b/indra/newview/SecondLife.xib @@ -2,7 +2,7 @@ 1060 - 12D76 + 12D78 3084 1187.37 626.00 @@ -775,24 +775,27 @@ - 888 + 940 LLAppDelegate NSObject - - window - LLNSWindow - - - window - + + LLOpenGLView + LLNSWindow + + + + glview + LLOpenGLView + + window LLNSWindow - + IBProjectSource ./Classes/LLAppDelegate.h @@ -806,6 +809,14 @@ ./Classes/LLNSWindow.h + + LLOpenGLView + NSOpenGLView + + IBProjectSource + ./Classes/LLOpenGLView.h + + 0 -- cgit v1.2.3 From ebe320e7c3579241e2e034a424ade9f087523b75 Mon Sep 17 00:00:00 2001 From: Geenz Date: Tue, 19 Mar 2013 06:32:56 -0400 Subject: Refactored LLNSWindow and LLOpenGLView significantly. All input goes through LLOpenGLView now. --- indra/llwindow/llopenglview-objc.h | 6 +- indra/llwindow/llopenglview-objc.mm | 290 ++++++++++-------------------------- 2 files changed, 80 insertions(+), 216 deletions(-) diff --git a/indra/llwindow/llopenglview-objc.h b/indra/llwindow/llopenglview-objc.h index c144831da4..5134063193 100644 --- a/indra/llwindow/llopenglview-objc.h +++ b/indra/llwindow/llopenglview-objc.h @@ -19,6 +19,7 @@ { std::string mLastDraggedUrl; unsigned int mModifiers; + float mMousePos[2]; } - (id) initWithSamples:(NSUInteger)samples; - (id) initWithSamples:(NSUInteger)samples andVsync:(BOOL)vsync; @@ -41,10 +42,7 @@ @end -@interface LLNSWindow : NSWindow { - float mMousePos[2]; - unsigned int mModifiers; -} +@interface LLNSWindow : NSWindow - (NSPoint)convertToScreenFromLocalPoint:(NSPoint)point relativeToView:(NSView *)view; - (NSPoint)flipPoint:(NSPoint)aPoint; diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index d568ed2fe5..45a5f24481 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -94,7 +94,6 @@ - (id) initWithFrame:(NSRect)frame withSamples:(NSUInteger)samples andVsync:(BOOL)vsync { - [[self window] makeFirstResponder:self]; [self registerForDraggedTypes:[NSArray arrayWithObject:NSURLPboardType]]; [self initWithFrame:frame]; @@ -188,102 +187,102 @@ // Various events can be intercepted by our view, thus not reaching our window. // Intercept these events, and pass them to the window as needed. - Geenz -- (void) mouseDragged:(NSEvent *)theEvent +- (void) mouseDown:(NSEvent *)theEvent { - [_window mouseDragged:theEvent]; + if ([theEvent clickCount] >= 2) + { + callDoubleClick(mMousePos, mModifiers); + } else if ([theEvent clickCount] == 1) { + callLeftMouseDown(mMousePos, mModifiers); + } } -- (void) scrollWheel:(NSEvent *)theEvent +- (void) mouseUp:(NSEvent *)theEvent { - [_window scrollWheel:theEvent]; + callLeftMouseUp(mMousePos, mModifiers); } -- (void) mouseDown:(NSEvent *)theEvent +- (void) rightMouseDown:(NSEvent *)theEvent { - [self becomeFirstResponder]; - [_window mouseDown:theEvent]; + callRightMouseDown(mMousePos, mModifiers); } -- (void) mouseUp:(NSEvent *)theEvent +- (void) rightMouseUp:(NSEvent *)theEvent { - [_window mouseUp:theEvent]; + callRightMouseUp(mMousePos, mModifiers); } -- (void) rightMouseDown:(NSEvent *)theEvent +- (void)mouseMoved:(NSEvent *)theEvent { - [_window rightMouseDown:theEvent]; + float mouseDeltas[2] = { + [theEvent deltaX], + [theEvent deltaY] + }; + + callDeltaUpdate(mouseDeltas, 0); + + NSPoint mPoint = [theEvent locationInWindow]; + mMousePos[0] = mPoint.x; + mMousePos[1] = mPoint.y; + callMouseMoved(mMousePos, 0); } -- (void) rightMouseUp:(NSEvent *)theEvent +// NSWindow doesn't trigger mouseMoved when the mouse is being clicked and dragged. +// Use mouseDragged for situations like this to trigger our movement callback instead. + +- (void) mouseDragged:(NSEvent *)theEvent { - [_window rightMouseUp:theEvent]; + // Trust the deltas supplied by NSEvent. + // The old CoreGraphics APIs we previously relied on are now flagged as obsolete. + // NSEvent isn't obsolete, and provides us with the correct deltas. + float mouseDeltas[2] = { + [theEvent deltaX], + [theEvent deltaY] + }; + + callDeltaUpdate(mouseDeltas, 0); + + NSPoint mPoint = [theEvent locationInWindow]; + mMousePos[0] = mPoint.x; + mMousePos[1] = mPoint.y; + callMouseMoved(mMousePos, 0); } - (void) otherMouseDown:(NSEvent *)theEvent { - [_window otherMouseDown:theEvent]; + callMiddleMouseDown(mMousePos, mModifiers); } - (void) otherMouseUp:(NSEvent *)theEvent { - [_window otherMouseUp:theEvent]; + callMiddleMouseUp(mMousePos, mModifiers); +} + +- (void) otherMouseDragged:(NSEvent *)theEvent +{ + +} + +- (void) scrollWheel:(NSEvent *)theEvent +{ + callScrollMoved(-[theEvent deltaY]); +} + +- (void) mouseExited:(NSEvent *)theEvent +{ + callMouseExit(); } - (void) keyUp:(NSEvent *)theEvent { - [_window keyUp:theEvent]; + callKeyUp([theEvent keyCode], mModifiers); } - (void) keyDown:(NSEvent *)theEvent { [[self inputContext] handleEvent:theEvent]; uint keycode = [theEvent keyCode]; - - switch (keycode) { - case 0x7b: - case 0x7c: - case 0x7d: - case 0x7e: - callKeyDown(keycode, mModifiers); - break; - - default: - callKeyDown(keycode, mModifiers); - NSString *chars = [theEvent characters]; - for (uint i = 0; i < [chars length]; i++) { - // Enter and Return are special cases. - unichar returntest = [chars characterAtIndex:i]; - if ((returntest == NSCarriageReturnCharacter || returntest == NSEnterCharacter) && - !([theEvent modifierFlags] & NSCommandKeyMask) && - !([theEvent modifierFlags] & NSAlternateKeyMask) && - !([theEvent modifierFlags] & NSControlKeyMask)) - { - callUnicodeCallback(13, 0); - } else { - // The command key being pressed is also a special case. - // Control + produces an ASCII control character code. - // Command + produces just the character's code. - // Check to see if the command key is pressed, then filter through the different character ranges that are relevant to control characters, and subtract the appropriate range. - if ([theEvent modifierFlags] & NSCommandKeyMask) - { - if (returntest >= 64 && returntest <= 95) - { - callUnicodeCallback(returntest - 63, mModifiers); - } else if (returntest >= 97 && returntest <= 122) - { - callUnicodeCallback(returntest - 96, mModifiers); - } - } - } - } - break; - } - -} - -- (void) mouseMoved:(NSEvent *)theEvent -{ - [_window mouseMoved:theEvent]; + callKeyDown(keycode, mModifiers); } - (void)flagsChanged:(NSEvent *)theEvent { @@ -291,11 +290,6 @@ callModifier([theEvent modifierFlags]); } -- (void) mouseExited:(NSEvent *)theEvent -{ - [_window mouseExited:theEvent]; -} - - (BOOL) acceptsFirstResponder { return YES; @@ -386,6 +380,18 @@ } } +- (void) insertNewline:(id)sender +{ + if (!(mModifiers & NSCommandKeyMask) && + !(mModifiers & NSShiftKeyMask) && + !(mModifiers & NSAlternateKeyMask)) + { + callUnicodeCallback(13, 0); + } else { + callUnicodeCallback(13, mModifiers); + } +} + - (NSUInteger)characterIndexForPoint:(NSPoint)aPoint { return NSNotFound; @@ -398,6 +404,10 @@ - (void)doCommandBySelector:(SEL)aSelector { + if (aSelector == @selector(insertNewline:)) + { + [self insertNewline:self]; + } } - (BOOL)drawsVerticallyForCharacterAtIndex:(NSUInteger)charIndex @@ -419,150 +429,6 @@ return self; } -- (void) keyDown:(NSEvent *)theEvent -{ - - uint keycode = [theEvent keyCode]; - - switch (keycode) { - case 0x7b: - case 0x7c: - case 0x7d: - case 0x7e: - callKeyDown(keycode, mModifiers); - break; - - default: - callKeyDown(keycode, mModifiers); - NSString *chars = [theEvent characters]; - for (uint i = 0; i < [chars length]; i++) { - // Enter and Return are special cases. - unichar returntest = [chars characterAtIndex:i]; - if ((returntest == NSCarriageReturnCharacter || returntest == NSEnterCharacter) && - !([theEvent modifierFlags] & NSCommandKeyMask) && - !([theEvent modifierFlags] & NSAlternateKeyMask) && - !([theEvent modifierFlags] & NSControlKeyMask)) - { - callUnicodeCallback(13, 0); - } else { - // The command key being pressed is also a special case. - // Control + produces an ASCII control character code. - // Command + produces just the character's code. - // Check to see if the command key is pressed, then filter through the different character ranges that are relevant to control characters, and subtract the appropriate range. - if ([theEvent modifierFlags] & NSCommandKeyMask) - { - if (returntest >= 64 && returntest <= 95) - { - callUnicodeCallback(returntest - 63, mModifiers); - } else if (returntest >= 97 && returntest <= 122) - { - callUnicodeCallback(returntest - 96, mModifiers); - } - } else { - callUnicodeCallback(returntest, mModifiers); - } - } - } - break; - } - -} - -- (void) keyUp:(NSEvent *)theEvent { - callKeyUp([theEvent keyCode], mModifiers); -} - -- (void)flagsChanged:(NSEvent *)theEvent { - mModifiers = [theEvent modifierFlags]; - callModifier([theEvent modifierFlags]); -} - -- (void) mouseDown:(NSEvent *)theEvent -{ - if ([theEvent clickCount] >= 2) - { - callDoubleClick(mMousePos, mModifiers); - } else if ([theEvent clickCount] == 1) { - callLeftMouseDown(mMousePos, mModifiers); - } -} - -- (void) mouseUp:(NSEvent *)theEvent -{ - callLeftMouseUp(mMousePos, mModifiers); -} - -- (void) rightMouseDown:(NSEvent *)theEvent -{ - callRightMouseDown(mMousePos, mModifiers); -} - -- (void) rightMouseUp:(NSEvent *)theEvent -{ - callRightMouseUp(mMousePos, mModifiers); -} - -- (void)mouseMoved:(NSEvent *)theEvent -{ - float mouseDeltas[2] = { - [theEvent deltaX], - [theEvent deltaY] - }; - - callDeltaUpdate(mouseDeltas, 0); - - NSPoint mPoint = [theEvent locationInWindow]; - mMousePos[0] = mPoint.x; - mMousePos[1] = mPoint.y; - callMouseMoved(mMousePos, 0); -} - -// NSWindow doesn't trigger mouseMoved when the mouse is being clicked and dragged. -// Use mouseDragged for situations like this to trigger our movement callback instead. - -- (void) mouseDragged:(NSEvent *)theEvent -{ - // Trust the deltas supplied by NSEvent. - // The old CoreGraphics APIs we previously relied on are now flagged as obsolete. - // NSEvent isn't obsolete, and provides us with the correct deltas. - float mouseDeltas[2] = { - [theEvent deltaX], - [theEvent deltaY] - }; - - callDeltaUpdate(mouseDeltas, 0); - - NSPoint mPoint = [theEvent locationInWindow]; - mMousePos[0] = mPoint.x; - mMousePos[1] = mPoint.y; - callMouseMoved(mMousePos, 0); -} - -- (void) otherMouseDown:(NSEvent *)theEvent -{ - callMiddleMouseDown(mMousePos, mModifiers); -} - -- (void) otherMouseUp:(NSEvent *)theEvent -{ - callMiddleMouseUp(mMousePos, mModifiers); -} - -- (void) otherMouseDragged:(NSEvent *)theEvent -{ - -} - -- (void) scrollWheel:(NSEvent *)theEvent -{ - callScrollMoved(-[theEvent deltaY]); -} - -- (void) mouseExited:(NSEvent *)theEvent -{ - callMouseExit(); -} - - (NSPoint)convertToScreenFromLocalPoint:(NSPoint)point relativeToView:(NSView *)view { NSScreen *currentScreen = [NSScreen currentScreenForMouseLocation]; -- cgit v1.2.3 From a8245c51b9cd6fac1d26932dbb1fcf052f00da18 Mon Sep 17 00:00:00 2001 From: Maestro Linden Date: Tue, 19 Mar 2013 19:25:24 +0000 Subject: MAINT-2506 added viewer support for PERMISSION_SILENT_ESTATE_MANAGEMENT and PERMISSION_OVERRIDE_ANIMATIONS. Reviewed by Simon. --- indra/lscript/lscript_byteformat.h | 6 ++++++ indra/lscript/lscript_compile/indra.l | 2 ++ indra/newview/app_settings/keywords.ini | 2 ++ indra/newview/llviewermessage.cpp | 10 ++++++++-- indra/newview/skins/default/xui/en/strings.xml | 7 +++++-- 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/indra/lscript/lscript_byteformat.h b/indra/lscript/lscript_byteformat.h index a294def734..9650574622 100644 --- a/indra/lscript/lscript_byteformat.h +++ b/indra/lscript/lscript_byteformat.h @@ -530,6 +530,9 @@ typedef enum e_lscript_runtime_permissions SCRIPT_PERMISSION_TRACK_CAMERA, SCRIPT_PERMISSION_CONTROL_CAMERA, SCRIPT_PERMISSION_TELEPORT, + SCRIPT_PERMISSION_EXPERIENCE, + SCRIPT_PERMISSION_SILENT_ESTATE_MANAGEMENT, + SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS, SCRIPT_PERMISSION_EOF } LSCRIPTRunTimePermissions; @@ -547,6 +550,9 @@ const U32 LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_EOF] = (0x1 << 10),// SCRIPT_PERMISSION_TRACK_CAMERA (0x1 << 11),// SCRIPT_PERMISSION_CONTROL_CAMERA (0x1 << 12),// SCRIPT_PERMISSION_TELEPORT + (0x1 << 13),// SCRIPT_PERMISSION_EXPERIENCE + (0x1 << 14),// SCRIPT_PERMISSION_SILENT_ESTATE_MANAGEMENT + (0x1 << 15),// SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS }; // http_request string constants diff --git a/indra/lscript/lscript_compile/indra.l b/indra/lscript/lscript_compile/indra.l index 3f844d0fd1..42c89b8709 100644 --- a/indra/lscript/lscript_compile/indra.l +++ b/indra/lscript/lscript_compile/indra.l @@ -214,6 +214,8 @@ extern "C" { int yyerror(const char *fmt, ...); } "PERMISSION_TRACK_CAMERA" { count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TRACK_CAMERA]; return(INTEGER_CONSTANT); } "PERMISSION_CONTROL_CAMERA" { count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_CONTROL_CAMERA]; return(INTEGER_CONSTANT); } "PERMISSION_TELEPORT" { count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TELEPORT]; return(INTEGER_CONSTANT); } +"PERMISSION_SILENT_ESTATE_MANAGEMENT" { count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_SILENT_ESTATE_MANAGEMENT]; return(INTEGER_CONSTANT); } +"PERMISSION_OVERRIDE_ANIMATIONS" { count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS]; return(INTEGER_CONSTANT); } "INVENTORY_TEXTURE" { count(); yylval.ival = LLAssetType::AT_TEXTURE; return(INTEGER_CONSTANT); } "INVENTORY_SOUND" { count(); yylval.ival = LLAssetType::AT_SOUND; return(INTEGER_CONSTANT); } diff --git a/indra/newview/app_settings/keywords.ini b/indra/newview/app_settings/keywords.ini index 0b346286c8..56b549ab62 100644 --- a/indra/newview/app_settings/keywords.ini +++ b/indra/newview/app_settings/keywords.ini @@ -92,6 +92,8 @@ PERMISSION_CHANGE_LINKS Passed to llRequestPermissions library function to req PERMISSION_TRACK_CAMERA Passed to llRequestPermissions library function to request permission to track agent's camera PERMISSION_CONTROL_CAMERA Passed to llRequestPermissions library function to request permission to change agent's camera PERMISSION_TELEPORT Passed to llRequestPermissions library function to request permission to teleport agent +PERMISSION_SILENT_ESTATE_MANAGEMENT Passed to llRequestPermissions library function to request permission to modify estate settings without notifying the owner +PERMISSION_OVERRIDE_ANIMATIONS Passed to llRequestPermissions library function to request permission to change agent's default animations DEBUG_CHANNEL Chat channel reserved for debug and error messages from scripts PUBLIC_CHANNEL Chat channel that broadcasts to all nearby users diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index bdb09b4c6f..d7d82e1d67 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -160,7 +160,10 @@ const std::string SCRIPT_QUESTIONS[SCRIPT_PERMISSION_EOF] = "ChangePermissions", "TrackYourCamera", "ControlYourCamera", - "TeleportYourAgent" + "TeleportYourAgent", + "ExperiencePlaceholder", + "ManageEstateSilently", + "ChangeYourDefaultAnimations" }; const BOOL SCRIPT_QUESTION_IS_CAUTION[SCRIPT_PERMISSION_EOF] = @@ -176,7 +179,10 @@ const BOOL SCRIPT_QUESTION_IS_CAUTION[SCRIPT_PERMISSION_EOF] = FALSE, // ChangePermissions FALSE, // TrackYourCamera, FALSE, // ControlYourCamera - FALSE // TeleportYourAgent + FALSE, // TeleportYourAgent + FALSE, // ExperiencePlaceholder + FALSE, // ManageEstateSilently + FALSE // ChangeYourDefaultAnimations }; bool friendship_offer_callback(const LLSD& notification, const LLSD& response) diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 0f4424a7f9..6be044d03c 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -404,8 +404,11 @@ Please try logging in again in a minute. Add and remove joints with other objects Change its permissions Track your camera - Control your camera - Teleport you + Control your camera + Teleport you + Manage your estates silently + Change your default animations + Not Connected -- cgit v1.2.3 From 64c0455db568e6818c483785cff0fcd9cfa47aff Mon Sep 17 00:00:00 2001 From: Geenz Date: Tue, 19 Mar 2013 23:02:47 -0400 Subject: More LLPreeditor work. --- indra/llwindow/llopenglview-objc.mm | 10 +++++++--- indra/llwindow/llwindowmacosx-objc.h | 1 + indra/llwindow/llwindowmacosx-objc.mm | 5 +++++ indra/llwindow/llwindowmacosx.cpp | 24 ++++++++++++++++++++---- 4 files changed, 33 insertions(+), 7 deletions(-) diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 45a5f24481..ca00185dff 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -345,16 +345,21 @@ - (NSRange)markedRange { - return NSMakeRange(NSNotFound, 0); + int range[2]; + getPreeditMarkedRange(&range[0], &range[1]); + return NSMakeRange(range[0], range[1]); } - (NSRange)selectedRange { - return NSMakeRange(NSNotFound, 0); + int range[2]; + getPreeditSelectionRange(&range[0], &range[1]); + return NSMakeRange(range[0], range[1]); } - (void)setMarkedText:(id)aString selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange { + } - (void)unmarkText @@ -425,7 +430,6 @@ - (id) init { - [self makeFirstResponder:[self contentView]]; return self; } diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index f3d6d2b1f1..57bb071690 100644 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -74,6 +74,7 @@ void convertScreenToView(NSWindowRef window, float *coord); void setWindowPos(NSWindowRef window, float* pos); void closeWindow(NSWindowRef window); void removeGLView(GLViewRef view); +void makeFirstResponder(NSWindowRef window, GLViewRef view); // These are all implemented in llwindowmacosx.cpp. // This is largely for easier interop between Obj-C and C++ (at least in the viewer's case due to the BOOL vs. BOOL conflict) diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index b859f236d4..9530785b83 100644 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -337,6 +337,11 @@ NSWindowRef getMainAppWindow() return winRef; } +void makeFirstResponder(NSWindowRef window, GLViewRef view) +{ + [(LLNSWindow*)window makeFirstResponder:(LLOpenGLView*)view]; +} + /* GLViewRef getGLView() { diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 08612bace4..7e4b9a84a1 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -383,22 +383,37 @@ void callQuitHandler() std::basic_string getPreeditString() { - return gWindowImplementation->getPreeditor()->getPreeditString(); + std::basic_string str; + if (gWindowImplementation->getPreeditor()) + { + str = gWindowImplementation->getPreeditor()->getPreeditString(); + } + + return str; } void getPreeditSelectionRange(int *position, int *length) { - gWindowImplementation->getPreeditor()->getSelectionRange(position, length); + if (gWindowImplementation->getPreeditor()) + { + gWindowImplementation->getPreeditor()->getSelectionRange(position, length); + } } void getPreeditMarkedRange(int *position, int *length) { - gWindowImplementation->getPreeditor()->getPreeditRange(position, length); + if (gWindowImplementation->getPreeditor()) + { + gWindowImplementation->getPreeditor()->getPreeditRange(position, length); + } } void handleUnicodeCharacter(wchar_t c) { - gWindowImplementation->getPreeditor()->handleUnicodeCharHere(c); + if (gWindowImplementation->getPreeditor()) + { + gWindowImplementation->getPreeditor()->handleUnicodeCharHere(c); + } } void LLWindowMacOSX::updateMouseDeltas(float* deltas) @@ -498,6 +513,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits } } LL_INFOS("Window") << "Completed context creation." << LL_ENDL; + makeFirstResponder(mWindow, mGLView); // Don't need to get the current gamma, since there's a call that restores it to the system defaults. return TRUE; } -- cgit v1.2.3 From 5dbb0a31da9bb3fb5ff7c5ead5d90808f9e4b797 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 20 Mar 2013 11:37:11 -0700 Subject: MAINT-2510 : Time can go backwards for viewer animation, assert fires. Reviewed by Kelly --- indra/llcharacter/llkeyframemotion.cpp | 3 ++- indra/newview/llmeshrepository.cpp | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index 905d1c2d26..07ef52228e 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -672,7 +672,8 @@ BOOL LLKeyframeMotion::onActivate() //----------------------------------------------------------------------------- BOOL LLKeyframeMotion::onUpdate(F32 time, U8* joint_mask) { - llassert(time >= 0.f); + // llassert(time >= 0.f); // This will fire + time = llmax(0.f, time); if (mJointMotionList->mLoop) { diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 306f29f703..7a857ea7be 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -288,7 +288,7 @@ public: ~LLMeshSkinInfoResponder() { - llassert(mProcessed); + //llassert(mProcessed); this will assert due to a timeout (not handled?) MAINT-2511 } virtual void completedRaw(U32 status, const std::string& reason, @@ -313,7 +313,7 @@ public: ~LLMeshDecompositionResponder() { - llassert(mProcessed); + //llassert(mProcessed); this will assert due to a timeout (not handled?) MAINT-2511 } virtual void completedRaw(U32 status, const std::string& reason, @@ -338,7 +338,7 @@ public: ~LLMeshPhysicsShapeResponder() { - llassert(mProcessed); + //llassert(mProcessed); this will assert due to a timeout (not handled?) MAINT-2511 } virtual void completedRaw(U32 status, const std::string& reason, -- cgit v1.2.3 From 8e54ae95d1417f51edd6c68c389fd6cd7322ca52 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 20 Mar 2013 15:25:14 -0700 Subject: Prototype code for "simple imposter" mode rendering of avatars. Reviewed by Kelly --- indra/newview/app_settings/settings.xml | 26 ++- indra/newview/lldrawpoolavatar.cpp | 135 ++++++------- indra/newview/llviewermenu.cpp | 59 ++++++ indra/newview/llvoavatar.cpp | 221 ++++++++++++++++----- indra/newview/llvoavatar.h | 29 ++- indra/newview/pipeline.cpp | 14 +- .../skins/default/xui/en/menu_attachment_other.xml | 35 ++++ .../skins/default/xui/en/menu_avatar_other.xml | 39 +++- indra/newview/skins/default/xui/en/menu_viewer.xml | 9 + 9 files changed, 440 insertions(+), 127 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index d2c3c6089c..21c278fd3b 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9370,7 +9370,7 @@ RenderAutoMuteRenderCostLimit Comment - Maximum render cost before an avatar is automatically visually muted (0 for no limit). + Maximum render weight before an avatar is automatically visually muted (0 to not use this limit). Persist 1 Type @@ -9381,7 +9381,7 @@ RenderAutoMuteSurfaceAreaLimit Comment - Maximum surface area of attachments before an avatar is automatically visually muted (0 for no limit). + Maximum surface area of attachments before an avatar is automatically visually muted (0 to not use this limit). Persist 1 Type @@ -9389,6 +9389,28 @@ Value 0 + RenderAutoMuteEnabled + + Comment + Apply visual muting to high cost, non-friends, not in IM, or somewhat distant avatars + Persist + 1 + Type + Boolean + Value + 0 + + RenderAutoMuteVisibilityRank + + Comment + Number of avatars to show normally for visual muting mode. + Persist + 1 + Type + U32 + Value + 0 + RenderAutoHideSurfaceAreaLimit diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index d5afa25c9c..3d7407ab54 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1163,88 +1163,85 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) } else if (pass >= 3 && pass <= 9) { //render rigged attachments - if (!avatarp->isVisuallyMuted()) + if (!avatarp->isVisuallyMuted()) // These details are skipped for visually muted (plain imposter) avatars { - if (pass == 3) - { - if (is_deferred_render) - { - renderDeferredRiggedSimple(avatarp); - } - else - { - renderRiggedSimple(avatarp); - } - } + if (pass == 3) // To do - use switch statement + { + if (is_deferred_render) + { + renderDeferredRiggedSimple(avatarp); + } + else + { + renderRiggedSimple(avatarp); + } + } else if (pass == 4) - { - if (is_deferred_render) - { - renderDeferredRiggedBump(avatarp); - } - else - { - renderRiggedFullbright(avatarp); - } - } + { + if (is_deferred_render) + { + renderDeferredRiggedBump(avatarp); + } + else + { + renderRiggedFullbright(avatarp); + } + } else if (pass == 5) - { - renderRiggedShinySimple(avatarp); - } + { + renderRiggedShinySimple(avatarp); + } else if (pass == 6) - { - renderRiggedFullbrightShiny(avatarp); - } - else if (pass >= 7 && pass < 9) - { - if (pass == 7) - { - renderRiggedAlpha(avatarp); - } - else if (pass == 8) - { - renderRiggedFullbrightAlpha(avatarp); - } - } + { + renderRiggedFullbrightShiny(avatarp); + } + else if (pass == 7) + { + renderRiggedAlpha(avatarp); + } + else if (pass == 8) + { + renderRiggedFullbrightAlpha(avatarp); + } else if (pass == 9) - { - renderRiggedGlow(avatarp); - } + { + renderRiggedGlow(avatarp); + } } } else { - if ((sShaderLevel >= SHADER_LEVEL_CLOTH)) - { - LLMatrix4 rot_mat; - LLViewerCamera::getInstance()->getMatrixToLocal(rot_mat); - LLMatrix4 cfr(OGL_TO_CFR_ROTATION); - rot_mat *= cfr; + if ((sShaderLevel >= SHADER_LEVEL_CLOTH)) + { + LLMatrix4 rot_mat; + LLViewerCamera::getInstance()->getMatrixToLocal(rot_mat); + LLMatrix4 cfr(OGL_TO_CFR_ROTATION); + rot_mat *= cfr; - LLVector4 wind; - wind.setVec(avatarp->mWindVec); - wind.mV[VW] = 0; - wind = wind * rot_mat; - wind.mV[VW] = avatarp->mWindVec.mV[VW]; - - sVertexProgram->uniform4fv(LLViewerShaderMgr::AVATAR_WIND, 1, wind.mV); - F32 phase = -1.f * (avatarp->mRipplePhase); - - F32 freq = 7.f + (noise1(avatarp->mRipplePhase) * 2.f); - LLVector4 sin_params(freq, freq, freq, phase); - sVertexProgram->uniform4fv(LLViewerShaderMgr::AVATAR_SINWAVE, 1, sin_params.mV); - - LLVector4 gravity(0.f, 0.f, -CLOTHING_GRAVITY_EFFECT, 0.f); - gravity = gravity * rot_mat; - sVertexProgram->uniform4fv(LLViewerShaderMgr::AVATAR_GRAVITY, 1, gravity.mV); - } + LLVector4 wind; + wind.setVec(avatarp->mWindVec); + wind.mV[VW] = 0; + wind = wind * rot_mat; + wind.mV[VW] = avatarp->mWindVec.mV[VW]; + + sVertexProgram->uniform4fv(LLViewerShaderMgr::AVATAR_WIND, 1, wind.mV); + F32 phase = -1.f * (avatarp->mRipplePhase); + + F32 freq = 7.f + (noise1(avatarp->mRipplePhase) * 2.f); + LLVector4 sin_params(freq, freq, freq, phase); + sVertexProgram->uniform4fv(LLViewerShaderMgr::AVATAR_SINWAVE, 1, sin_params.mV); + + LLVector4 gravity(0.f, 0.f, -CLOTHING_GRAVITY_EFFECT, 0.f); + gravity = gravity * rot_mat; + sVertexProgram->uniform4fv(LLViewerShaderMgr::AVATAR_GRAVITY, 1, gravity.mV); + } - if( !single_avatar || (avatarp == single_avatar) ) - { - avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE); + if( !single_avatar || (avatarp == single_avatar) ) + { + avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE); + } } } -} void LLDrawPoolAvatar::getRiggedGeometry(LLFace* face, LLPointer& buffer, U32 data_mask, const LLMeshSkinInfo* skin, LLVolume* volume, const LLVolumeFace& vol_face) { diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 4c99e65c99..aab4d93882 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2934,6 +2934,63 @@ bool enable_object_unmute() } } + +// 0 = normal, 1 = always, 2 = never +class LLAvatarCheckImposterMode : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); + if (!object) return false; + + LLVOAvatar* avatar = find_avatar_from_object(object); + if (!avatar) return false; + + U32 mode = userdata.asInteger(); + switch (mode) + { + case 0: + return (avatar->getVisualMuteSettings() == LLVOAvatar::VISUAL_MUTE_NOT_SET); + case 1: + return (avatar->getVisualMuteSettings() == LLVOAvatar::ALWAYS_VISUAL_MUTE); + case 2: + return (avatar->getVisualMuteSettings() == LLVOAvatar::NEVER_VISUAL_MUTE); + default: + return false; + } + } // handleEvent() +}; + +// 0 = normal, 1 = always, 2 = never +class LLAvatarSetImposterMode : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); + if (!object) return false; + + LLVOAvatar* avatar = find_avatar_from_object(object); + if (!avatar) return false; + + U32 mode = userdata.asInteger(); + switch (mode) + { + case 0: + avatar->setVisualMuteSettings(LLVOAvatar::VISUAL_MUTE_NOT_SET); + return true; + case 1: + avatar->setVisualMuteSettings(LLVOAvatar::VISUAL_MUTE_NOT_SET); + return true; + case 2: + avatar->setVisualMuteSettings(LLVOAvatar::NEVER_VISUAL_MUTE); + return true; + default: + return false; + } + } // handleEvent() +}; + + class LLObjectMute : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -8644,6 +8701,8 @@ void initialize_menus() view_listener_t::addMenu( new LLCheckPanelPeopleTab(), "SideTray.CheckPanelPeopleTab"); // Avatar pie menu + view_listener_t::addMenu(new LLAvatarCheckImposterMode(), "Avatar.CheckImposterMode"); + view_listener_t::addMenu(new LLAvatarSetImposterMode(), "Avatar.SetImposterMode"); view_listener_t::addMenu(new LLObjectMute(), "Avatar.Mute"); view_listener_t::addMenu(new LLAvatarAddFriend(), "Avatar.AddFriend"); view_listener_t::addMenu(new LLAvatarAddContact(), "Avatar.AddContact"); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7d099d690a..cce4925e0a 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -62,6 +62,7 @@ #include "llhudmanager.h" #include "llhudnametag.h" #include "llhudtext.h" // for mText/mDebugText +#include "llimview.h" #include "llinitparam.h" #include "llkeyframefallmotion.h" #include "llkeyframestandmotion.h" @@ -784,6 +785,13 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mLastPelvisToFoot = 0.0f; mPelvisFixup = 0.0f; mLastPelvisFixup = 0.0f; + + mCachedVisualMute = !isSelf(); + mCachedVisualMuteUpdateTime = LLFrameTimer::getTotalSeconds() + 5.0; + mVisuallyMuteSetting = VISUAL_MUTE_NOT_SET; + + F32 color_value = (F32) (getID().mData[0]); + mMutedAVColor = calcMutedAVColor(color_value, 0, 256); } std::string LLVOAvatar::avString() const @@ -3435,24 +3443,82 @@ void LLVOAvatar::slamPosition() mRoot.updateWorldMatrixChildren(); } -bool LLVOAvatar::isVisuallyMuted() const +bool LLVOAvatar::isVisuallyMuted() { - bool ret = false; + bool muted = false; + + // Priority order (highest priority first) + // * own avatar is never visually muted + // * if on the "always draw normally" list, draw them normally + // * if on the "always visually mute" list, mute them + // * draw them normally if they meet the following criteria: + // - within the closest N avatars OR on friends list OR in an IM chat + // - AND aren't over the thresholds + // * otherwise visually mute all other avatars if (!isSelf()) { + static LLCachedControl render_mute_enabled(gSavedSettings, "RenderAutoMuteEnabled"); static LLCachedControl max_attachment_bytes(gSavedSettings, "RenderAutoMuteByteLimit"); static LLCachedControl max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit"); static LLCachedControl max_render_cost(gSavedSettings, "RenderAutoMuteRenderCostLimit"); - - U32 max_cost = (U32) (max_render_cost*(LLVOAvatar::sLODFactor+0.5)); + static LLCachedControl visibility_rank(gSavedSettings, "RenderAutoMuteVisibilityRank"); + + if (mVisuallyMuteSetting == ALWAYS_VISUAL_MUTE) + { // Always want to see this AV as an imposter + muted = true; + } + else if (mVisuallyMuteSetting == NEVER_VISUAL_MUTE) + { // Never show as imposter + muted = false; + } + else if (render_mute_enabled) + { + F64 now = LLFrameTimer::getTotalSeconds(); + + if (now < mCachedVisualMuteUpdateTime) + { // Use cached mute value + muted = mCachedVisualMute; + } + else + { // Determine if visually muted or not + + U32 max_cost = (U32) (max_render_cost*(LLVOAvatar::sLODFactor+0.5)); - ret = LLMuteList::getInstance()->isMuted(getID()) || - (mAttachmentSurfaceArea > max_attachment_area && max_attachment_area > 0.f) || - (mVisualComplexity > max_cost && max_render_cost > 0); + muted = LLMuteList::getInstance()->isMuted(getID()) || + (mAttachmentGeometryBytes > max_attachment_bytes && max_attachment_bytes > 0) || + (mAttachmentSurfaceArea > max_attachment_area && max_attachment_area > 0.f) || + (mVisualComplexity > max_cost && max_render_cost > 0); + + // Could be part of the grand || collection above, but yanked out to make the logic visible + if (!muted) + { + if (visibility_rank > 0) + { // They are above the visibilty rank - mute them + muted = (mVisibilityRank > visibility_rank); + } + + if (muted || // Don't mute friends or IMs + visibility_rank == 0) + { + muted = !(LLAvatarTracker::instance().isBuddy(getID())); + if (muted) + { // Not a friend, so they are muted ... are they in an IM? + LLUUID session_id = gIMMgr->computeSessionID(IM_NOTHING_SPECIAL,getID()); + muted = !gIMMgr->hasSession(session_id); + } + } + } + + // Save visual mute state and set interval for updating + const F64 SECONDS_BETWEEN_RENDER_AUTO_MUTE_UPDATES = 1.5; + mCachedVisualMuteUpdateTime = now + SECONDS_BETWEEN_RENDER_AUTO_MUTE_UPDATES; + mCachedVisualMute = muted; + } + } } - return ret; + return muted; } //------------------------------------------------------------------------ @@ -3509,7 +3575,8 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // the rest should only be done occasionally for far away avatars //-------------------------------------------------------------------- - if (visible && (!isSelf() || isVisuallyMuted()) && !mIsDummy && sUseImpostors && !mNeedsAnimUpdate && !sFreezeCounter) + bool visually_muted = isVisuallyMuted(); + if (visible && (!isSelf() || visually_muted) && !mIsDummy && sUseImpostors && !mNeedsAnimUpdate && !sFreezeCounter) { const LLVector4a* ext = mDrawable->getSpatialExtents(); LLVector4a size; @@ -3518,8 +3585,8 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) F32 impostor_area = 256.f*512.f*(8.125f - LLVOAvatar::sLODFactor*8.f); - if (isVisuallyMuted()) - { // muted avatars update at 16 hz + if (visually_muted) + { // visually muted avatars update at 16 hz mUpdatePeriod = 16; } else if (mVisibilityRank <= LLVOAvatar::sMaxVisible || @@ -4295,23 +4362,23 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) BOOL first_pass = TRUE; if (!LLDrawPoolAvatar::sSkipOpaque) { - bool muted = isVisuallyMuted(); + bool visually_muted = isVisuallyMuted(); if (!isSelf() || gAgent.needsRenderHead() || LLPipeline::sShadowRender) { - if (isTextureVisible(TEX_HEAD_BAKED) || mIsDummy || muted) + if (isTextureVisible(TEX_HEAD_BAKED) || mIsDummy || visually_muted) { num_indices += mMeshLOD[MESH_ID_HEAD]->render(mAdjustedPixelArea, TRUE, mIsDummy); first_pass = FALSE; } } - if (isTextureVisible(TEX_UPPER_BAKED) || mIsDummy || muted) + if (isTextureVisible(TEX_UPPER_BAKED) || mIsDummy || visually_muted) { num_indices += mMeshLOD[MESH_ID_UPPER_BODY]->render(mAdjustedPixelArea, first_pass, mIsDummy); first_pass = FALSE; } - if (isTextureVisible(TEX_LOWER_BAKED) || mIsDummy || muted) + if (isTextureVisible(TEX_LOWER_BAKED) || mIsDummy || visually_muted) { num_indices += mMeshLOD[MESH_ID_LOWER_BODY]->render(mAdjustedPixelArea, first_pass, mIsDummy); first_pass = FALSE; @@ -8396,7 +8463,7 @@ void LLVOAvatar::updateImpostors() LLCharacter::sAllowInstancesChange = TRUE ; } -BOOL LLVOAvatar::isImpostor() const +BOOL LLVOAvatar::isImpostor() { return sUseImpostors && (isVisuallyMuted() || (mUpdatePeriod >= IMPOSTOR_PERIOD)) ? TRUE : FALSE; } @@ -8441,15 +8508,13 @@ void LLVOAvatar::getImpostorValues(LLVector4a* extents, LLVector3& angle, F32& d angle.mV[2] = da; } + void LLVOAvatar::idleUpdateRenderCost() { static LLCachedControl max_render_cost(gSavedSettings, "RenderAutoMuteRenderCostLimit"); - static const U32 ARC_BODY_PART_COST = 200; static const U32 ARC_LIMIT = 20000; - static std::set all_textures; - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_ATTACHMENT_BYTES)) { //set debug text to attachment geometry bytes here so render cost will override setDebugText(llformat("%.1f KB, %.2f m^2", mAttachmentGeometryBytes/1024.f, mAttachmentSurfaceArea)); @@ -8460,6 +8525,69 @@ void LLVOAvatar::idleUpdateRenderCost() return; } + calculateUpdateRenderCost(); // Update mVisualComplexity if needed + + doRenderCostNagging(max_render_cost); // Remind the user their AV is too complex + + if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHAME)) + { + std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus()); + setDebugText(llformat("%s %d", viz_string.c_str(), mVisualComplexity)); + F32 green = 1.f-llclamp(((F32) mVisualComplexity-(F32)ARC_LIMIT)/(F32)ARC_LIMIT, 0.f, 1.f); + F32 red = llmin((F32) mVisualComplexity/(F32)ARC_LIMIT, 1.f); + mText->setColor(LLColor4(red,green,0,1)); + } +} + + +// Remind the user about their expensive avatar +void LLVOAvatar::doRenderCostNagging(U32 max_render_cost) +{ + if (isSelf()) + { + static S32 sOldComplexity = 0; + static F64 sLastRenderCostNagTime = 0.0; + + const F64 RENDER_NAG_INTERVAL = 60.0; + + F64 now = LLFrameTimer::getTotalSeconds(); + if (sLastRenderCostNagTime > 0.0 && + (now - sLastRenderCostNagTime) > RENDER_NAG_INTERVAL && + sOldComplexity != mVisualComplexity) + { + sOldComplexity = mVisualComplexity; + + if (max_render_cost > 0) + { //pop up notification that you have exceeded a render cost limit + if (mVisualComplexity > max_render_cost+max_render_cost/2) + { + LLNotificationsUtil::add("ExceededHighDetailRenderCost"); + sLastRenderCostNagTime = now; + } + else if (mVisualComplexity > max_render_cost) + { + LLNotificationsUtil::add("ExceededMidDetailRenderCost"); + sLastRenderCostNagTime = now; + } + else if (mVisualComplexity > max_render_cost/2) + { + LLNotificationsUtil::add("ExceededLowDetailRenderCost"); + sLastRenderCostNagTime = now; + } + } + } + } +} + + +// Calculations for mVisualComplexity value +void LLVOAvatar::calculateUpdateRenderCost() +{ + static const U32 ARC_BODY_PART_COST = 200; + + // Diagnostic list of all textures on our avatar + static std::set all_textures; + if (mVisualComplexityStale) { mVisualComplexityStale = FALSE; @@ -8526,8 +8654,6 @@ void LLVOAvatar::idleUpdateRenderCost() } - - // Diagnostic output to identify all avatar-related textures. // Does not affect rendering cost calculation. // Could be wrapped in a debug option if output becomes problematic. @@ -8568,34 +8694,37 @@ void LLVOAvatar::idleUpdateRenderCost() } } - if (isSelf() && max_render_cost > 0 && mVisualComplexity != cost) - { //pop up notification that you have exceeded a render cost limit - if (cost > max_render_cost+max_render_cost/2) - { - LLNotificationsUtil::add("ExceededHighDetailRenderCost"); - } - else if (cost > max_render_cost) - { - LLNotificationsUtil::add("ExceededMidDetailRenderCost"); - } - else if (cost > max_render_cost/2) - { - LLNotificationsUtil::add("ExceededLowDetailRenderCost"); - } - } - mVisualComplexity = cost; } +} - - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHAME)) - { - std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus()); - setDebugText(llformat("%s %d", viz_string.c_str(), mVisualComplexity)); - F32 green = 1.f-llclamp(((F32) mVisualComplexity-(F32)ARC_LIMIT)/(F32)ARC_LIMIT, 0.f, 1.f); - F32 red = llmin((F32) mVisualComplexity/(F32)ARC_LIMIT, 1.f); - mText->setColor(LLColor4(red,green,0,1)); - } + +// static +LLColor4 LLVOAvatar::calcMutedAVColor(F32 value, S32 range_low, S32 range_high) +{ + F32 clamped_value = llmin(value, (F32) range_high); + clamped_value = llmax(value, (F32) range_low); + F32 spectrum = (clamped_value / range_high); // spectrum is between 0 and 1.f + + // Array of colors. These are arranged so only one RGB color changes between each step, + // and it loops back to red so there is an even distribution. It is not a heat map + const S32 NUM_SPECTRUM_COLORS = 7; + static LLColor4 * spectrum_color[NUM_SPECTRUM_COLORS] = { &LLColor4::red, &LLColor4::magenta, &LLColor4::blue, &LLColor4::cyan, &LLColor4::green, &LLColor4::yellow, &LLColor4::red }; + + spectrum = spectrum * (NUM_SPECTRUM_COLORS - 1); // Scale to range of number of colors + S32 spectrum_index_1 = floor(spectrum); // Desired color will be after this index + S32 spectrum_index_2 = spectrum_index_1 + 1; // and before this index (inclusive) + F32 fractBetween = spectrum - (F32)(spectrum_index_1); // distance between the two indexes (0-1) + + LLColor4 new_color = lerp(*spectrum_color[spectrum_index_1], *spectrum_color[spectrum_index_2], fractBetween); + //new_color.normalize(); + + //llinfos << "From value " << std::setprecision(3) << value << " returning color " << new_color + // << " using indexes " << spectrum_index_1 << ", " << spectrum_index_2 + // << " and fractBetween " << fractBetween + // << llendl; + + return new_color; } // static diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 386d9d7746..0e7bf7a6c9 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -253,7 +253,14 @@ public: static void invalidateNameTags(); void addNameTagLine(const std::string& line, const LLColor4& color, S32 style, const LLFontGL* font); void idleUpdateRenderCost(); + void doRenderCostNagging(U32 max_render_cost); + void calculateUpdateRenderCost(); void updateVisualComplexity() { mVisualComplexityStale = TRUE; } + + S32 getVisualComplexity() { return mVisualComplexity; }; + S32 getUpdatePeriod() { return mUpdatePeriod; }; + const LLColor4 & getMutedAVColor() { return mMutedAVColor; }; + void idleUpdateBelowWater(); //-------------------------------------------------------------------- @@ -304,11 +311,14 @@ public: return mPhases; } + static LLColor4 calcMutedAVColor(F32 value, S32 range_low, S32 range_high); + protected: BOOL updateIsFullyLoaded(); BOOL processFullyLoadedChange(bool loading); void updateRuthTimer(bool loading); F32 calcMorphAmount(); + private: BOOL mFirstFullyVisible; BOOL mFullyLoaded; @@ -317,6 +327,7 @@ private: S32 mFullyLoadedFrameCounter; S32 mVisualComplexity; BOOL mVisualComplexityStale; + LLColor4 mMutedAVColor; LLFrameTimer mFullyLoadedTimer; LLFrameTimer mRuthTimer; @@ -437,7 +448,16 @@ private: public: U32 renderImpostor(LLColor4U color = LLColor4U(255,255,255,255), S32 diffuse_channel = 0); - bool isVisuallyMuted() const; + bool isVisuallyMuted(); + + enum VisualMuteSettings + { + VISUAL_MUTE_NOT_SET = 0, + ALWAYS_VISUAL_MUTE = 1, + NEVER_VISUAL_MUTE = 2 + }; + void setVisualMuteSettings(VisualMuteSettings set) { mVisuallyMuteSetting = set; }; + VisualMuteSettings getVisualMuteSettings() { return mVisuallyMuteSetting; }; U32 renderRigid(); U32 renderSkinned(EAvatarRenderPass pass); @@ -461,6 +481,11 @@ private: S32 mUpdatePeriod; S32 mNumInitFaces; //number of faces generated when creating the avatar drawable, does not inculde splitted faces due to long vertex buffer. + bool mCachedVisualMute; // cached return value for isVisuallyMuted() + F64 mCachedVisualMuteUpdateTime; // Time to update mCachedVisualMute + + VisualMuteSettings mVisuallyMuteSetting; // Always or never visually mute this AV + //-------------------------------------------------------------------- // Morph masks //-------------------------------------------------------------------- @@ -493,7 +518,7 @@ private: // Impostors //-------------------------------------------------------------------- public: - BOOL isImpostor() const; + BOOL isImpostor(); BOOL needsImpostorUpdate() const; const LLVector3& getImpostorOffset() const; const LLVector2& getImpostorDim() const; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index df7a3c7593..61e42bbcee 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2862,7 +2862,7 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) llassert(vobj); // trying to catch a bad assumption if (vobj) // this test may not be needed, see above { - const LLVOAvatar* av = vobj->asAvatar(); + LLVOAvatar* av = vobj->asAvatar(); if (av && av->isImpostor()) { return; @@ -10103,11 +10103,11 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) assertInitialized(); - bool muted = avatar->isVisuallyMuted(); + bool visually_muted = avatar->isVisuallyMuted(); pushRenderTypeMask(); - if (muted) + if (visually_muted) { andRenderTypeMask(LLPipeline::RENDER_TYPE_AVATAR, END_RENDER_TYPES); } @@ -10251,7 +10251,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) F32 old_alpha = LLDrawPoolAvatar::sMinimumAlpha; - if (muted) + if (visually_muted) { //disable alpha masking for muted avatars (get whole skin silhouette) LLDrawPoolAvatar::sMinimumAlpha = 0.f; } @@ -10282,7 +10282,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) LLGLDisable blend(GL_BLEND); - if (muted) + if (visually_muted) { gGL.setColorMask(true, true); @@ -10317,8 +10317,8 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) gGL.diffuseColor4ub(64,64,64,255); } else - { //blue visually muted avatar - gGL.diffuseColor4ub(72,61,139,255); + { // Visually muted avatar + gGL.diffuseColor4fv( avatar->getMutedAVColor().mV ); } { diff --git a/indra/newview/skins/default/xui/en/menu_attachment_other.xml b/indra/newview/skins/default/xui/en/menu_attachment_other.xml index 00d4b1dab1..87fa7c3f00 100644 --- a/indra/newview/skins/default/xui/en/menu_attachment_other.xml +++ b/indra/newview/skins/default/xui/en/menu_attachment_other.xml @@ -104,8 +104,43 @@ + + + + + + + + + + + + + + + + + + - @@ -95,8 +97,43 @@ + + + + + + + + + + + + + + + + + + + + + Date: Wed, 20 Mar 2013 15:25:41 -0700 Subject: Don't assert on HTTP_NOT_FOUND for some mesh data. Reviewed by Kelly --- indra/newview/llmeshrepository.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 7a857ea7be..809f85a7b5 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -2177,7 +2177,7 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason, // and (somewhat more optional than the others) retries // again after some set period of time - llassert(status == HTTP_SERVICE_UNAVAILABLE || status == HTTP_REQUEST_TIME_OUT || status == HTTP_INTERNAL_ERROR); + llassert(status == HTTP_NOT_FOUND || status == HTTP_SERVICE_UNAVAILABLE || status == HTTP_REQUEST_TIME_OUT || status == HTTP_INTERNAL_ERROR); if (status == HTTP_SERVICE_UNAVAILABLE || status == HTTP_REQUEST_TIME_OUT || status == HTTP_INTERNAL_ERROR) { //retry -- cgit v1.2.3 From c9bdc734fd9d48de263999226c49b557d5c5af81 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 22 Mar 2013 11:29:32 -0700 Subject: MAINT-2518 : Viewer LLViewerTextureList::removeImageFromList() shouldn't crash Reviewed by Kelly. --- indra/newview/llviewertexturelist.cpp | 60 ++++++++++++++++++++++++----------- 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 82d990cf97..466d75233b 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -515,15 +515,17 @@ void LLViewerTextureList::addImageToList(LLViewerFetchedTexture *image) llassert_always(mInitialized) ; llassert(image); if (image->isInImageList()) - { - llerrs << "LLViewerTextureList::addImageToList - Image already in list" << llendl; + { // Flag is already set? + llwarns << "LLViewerTextureList::addImageToList - image " << image->getID() << " already in list" << llendl; } - if((mImageList.insert(image)).second != true) + else { - llerrs << "Error happens when insert image to mImageList!" << llendl ; + if((mImageList.insert(image)).second != true) + { + llwarns << "Error happens when insert image " << image->getID() << " into mImageList!" << llendl ; + } + image->setInImageList(TRUE) ; } - - image->setInImageList(TRUE) ; } void LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *image) @@ -531,24 +533,46 @@ void LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *image) assert_main_thread(); llassert_always(mInitialized) ; llassert(image); - if (!image->isInImageList()) + + S32 count = 0; + if (image->isInImageList()) { - llinfos << "RefCount: " << image->getNumRefs() << llendl ; + count = mImageList.erase(image) ; + if(count != 1) + { + llwarns << "Image " << image->getID() + << " had mInImageList set but mImageList.erase() returned " << count + << llendl; + } + } + else + { // Something is wrong, image is expected in list or callers should check first + llwarns << "Calling removeImageFromList() for " << image->getID() + << " but doesn't have mInImageList set" + << " ref count is " << image->getNumRefs() + << llendl; uuid_map_t::iterator iter = mUUIDMap.find(image->getID()); - if(iter == mUUIDMap.end() || iter->second != image) + if(iter == mUUIDMap.end()) + { + llwarns << "Image " << image->getID() << " is also not in mUUIDMap!" << llendl ; + } + else if (iter->second != image) + { + llwarns << "Image " << image->getID() << " was in mUUIDMap but with different pointer" << llendl ; + } + else { - llinfos << "Image is not in mUUIDMap!" << llendl ; + llwarns << "Image " << image->getID() << " was in mUUIDMap with same pointer" << llendl ; + } + count = mImageList.erase(image) ; + if(count != 0) + { // it was in the list already? + llwarns << "Image " << image->getID() + << " had mInImageList false but mImageList.erase() returned " << count + << llendl; } - llerrs << "LLViewerTextureList::removeImageFromList - Image not in list" << llendl; } - S32 count = mImageList.erase(image) ; - if(count != 1) - { - llinfos << image->getID() << llendl ; - llerrs << "Error happens when remove image from mImageList: " << count << llendl ; - } - image->setInImageList(FALSE) ; } -- cgit v1.2.3 From fcf894af255e8b931af09883aa8ee2a900199d39 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 22 Mar 2013 13:13:09 -0700 Subject: Lighten imposter avatar colors a bit per feedeback. --- indra/newview/llvoavatar.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index cce4925e0a..76df6dc0ed 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -8717,7 +8717,8 @@ LLColor4 LLVOAvatar::calcMutedAVColor(F32 value, S32 range_low, S32 range_high) F32 fractBetween = spectrum - (F32)(spectrum_index_1); // distance between the two indexes (0-1) LLColor4 new_color = lerp(*spectrum_color[spectrum_index_1], *spectrum_color[spectrum_index_2], fractBetween); - //new_color.normalize(); + new_color.normalize(); + new_color *= 0.9f; //llinfos << "From value " << std::setprecision(3) << value << " returning color " << new_color // << " using indexes " << spectrum_index_1 << ", " << spectrum_index_2 -- cgit v1.2.3 From 395f8baf03622f3a36b03b8e31679e3b594b1757 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 22 Mar 2013 14:03:39 -0700 Subject: Fix simple bug in LLAvatarSetImposterMode::handleEvent() --- indra/newview/llviewermenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index aab4d93882..2d18600540 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2979,7 +2979,7 @@ class LLAvatarSetImposterMode : public view_listener_t avatar->setVisualMuteSettings(LLVOAvatar::VISUAL_MUTE_NOT_SET); return true; case 1: - avatar->setVisualMuteSettings(LLVOAvatar::VISUAL_MUTE_NOT_SET); + avatar->setVisualMuteSettings(LLVOAvatar::ALWAYS_VISUAL_MUTE); return true; case 2: avatar->setVisualMuteSettings(LLVOAvatar::NEVER_VISUAL_MUTE); -- cgit v1.2.3 From e1d133d73f93f52193397c5fe9cbfa532f4359ed Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 22 Mar 2013 16:54:21 -0700 Subject: MAINT-1452 : Viewer floods the log file with hundreds of exactly the same lines. Reviewed by Kelly --- indra/newview/llvovolume.cpp | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index e0ed13a3a7..426ad8bc21 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1157,28 +1157,38 @@ void LLVOVolume::sculpt() S32 current_discard = getVolume()->getSculptLevel() ; if(current_discard < -2) { - static S32 low_sculpty_discard_warning_count = 100; - if (++low_sculpty_discard_warning_count >= 100) - { // Log first time, then every 100 afterwards otherwise this can flood the logs + static S32 low_sculpty_discard_warning_count = 1; + S32 exponent = llmax(1, llfloor( log10((F64) low_sculpty_discard_warning_count) )); + S32 interval = pow(10.0, exponent); + if ( low_sculpty_discard_warning_count < 10 || + (low_sculpty_discard_warning_count % interval) == 0) + { // Log first 10 time, then decreasing intervals afterwards otherwise this can flood the logs llwarns << "WARNING!!: Current discard for sculpty " << mSculptTexture->getID() << " at " << current_discard - << " is less than -2." << llendl; - low_sculpty_discard_warning_count = 0; + << " is less than -2." + << " Hit this " << low_sculpty_discard_warning_count << " times" + << llendl; } + low_sculpty_discard_warning_count++; // corrupted volume... don't update the sculpty return; } else if (current_discard > MAX_DISCARD_LEVEL) { - static S32 high_sculpty_discard_warning_count = 100; - if (++high_sculpty_discard_warning_count >= 100) - { // Log first time, then every 100 afterwards otherwise this can flood the logs + static S32 high_sculpty_discard_warning_count = 1; + S32 exponent = llmax(1, llfloor( log10((F64) high_sculpty_discard_warning_count) )); + S32 interval = pow(10.0, exponent); + if ( high_sculpty_discard_warning_count < 10 || + (high_sculpty_discard_warning_count % interval) == 0) + { // Log first 10 time, then decreasing intervals afterwards otherwise this can flood the logs llwarns << "WARNING!!: Current discard for sculpty " << mSculptTexture->getID() << " at " << current_discard - << " is more than than allowed max of " << MAX_DISCARD_LEVEL << llendl; - high_sculpty_discard_warning_count = 0; + << " is more than than allowed max of " << MAX_DISCARD_LEVEL + << ". Hit this " << high_sculpty_discard_warning_count << " times" + << llendl; } + high_sculpty_discard_warning_count++; // corrupted volume... don't update the sculpty return; -- cgit v1.2.3 From 6c200a94f705667201bcaf0753986da90a2748eb Mon Sep 17 00:00:00 2001 From: Geenz Date: Sat, 23 Mar 2013 01:05:21 -0400 Subject: Fix for command key presses + a letter not triggering keyUp. Fix by Katharine Berry. --- indra/llwindow/llopenglview-objc.mm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index ca00185dff..de159816e0 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -283,6 +283,14 @@ [[self inputContext] handleEvent:theEvent]; uint keycode = [theEvent keyCode]; callKeyDown(keycode, mModifiers); + + // OS X intentionally does not send us key-up information on cmd-key combinations. + // This behaviour is not a bug, and only applies to cmd-combinations (no others). + // Since SL assumes we receive those, we fake it here. + if (mModifiers & NSCommandKeyMask) + { + callKeyUp([theEvent keyCode], mModifiers); + } } - (void)flagsChanged:(NSEvent *)theEvent { -- cgit v1.2.3 From 258b77b64777a5ce5fef0ef066aa52b34b43ba65 Mon Sep 17 00:00:00 2001 From: Geenz Date: Mon, 25 Mar 2013 05:26:55 -0400 Subject: Additional IME support. LLPreeditor is largely good to go at this point, but there's still some work to do in getSegments. --- indra/llwindow/llkeyboardmacosx.cpp | 1 - indra/llwindow/llopenglview-objc.h | 4 ++ indra/llwindow/llopenglview-objc.mm | 97 ++++++++++++++++++++++---- indra/llwindow/llwindowmacosx-objc.h | 11 +++ indra/llwindow/llwindowmacosx-objc.mm | 45 ++++++++++-- indra/llwindow/llwindowmacosx.cpp | 126 ++++++++++++++++++++++++++++++---- indra/newview/Info-SecondLife.plist | 2 +- indra/newview/llviewerkeyboard.cpp | 1 - indra/newview/llviewerwindow.cpp | 1 - 9 files changed, 252 insertions(+), 36 deletions(-) diff --git a/indra/llwindow/llkeyboardmacosx.cpp b/indra/llwindow/llkeyboardmacosx.cpp index 274e92c225..85bb7b9aeb 100644 --- a/indra/llwindow/llkeyboardmacosx.cpp +++ b/indra/llwindow/llkeyboardmacosx.cpp @@ -253,7 +253,6 @@ BOOL LLKeyboardMacOSX::handleKeyUp(const U16 key, const U32 mask) if(translateNumpadKey(key, &translated_key)) { - LL_INFOS("Keyboard") << "Handled key!" << LL_ENDL; handled = handleTranslatedKeyUp(translated_key, translated_mask); } diff --git a/indra/llwindow/llopenglview-objc.h b/indra/llwindow/llopenglview-objc.h index 5134063193..8140421e44 100644 --- a/indra/llwindow/llopenglview-objc.h +++ b/indra/llwindow/llopenglview-objc.h @@ -20,6 +20,8 @@ std::string mLastDraggedUrl; unsigned int mModifiers; float mMousePos[2]; + bool mHasMarkedText; + unsigned int mMarkedTextLength; } - (id) initWithSamples:(NSUInteger)samples; - (id) initWithSamples:(NSUInteger)samples andVsync:(BOOL)vsync; @@ -40,6 +42,8 @@ - (unsigned long) getVramSize; +- (segment_t) getSegments:(NSAttributedString*)str; + @end @interface LLNSWindow : NSWindow diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index de159816e0..31b0e02ad8 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -281,15 +281,18 @@ - (void) keyDown:(NSEvent *)theEvent { [[self inputContext] handleEvent:theEvent]; - uint keycode = [theEvent keyCode]; - callKeyDown(keycode, mModifiers); - - // OS X intentionally does not send us key-up information on cmd-key combinations. - // This behaviour is not a bug, and only applies to cmd-combinations (no others). - // Since SL assumes we receive those, we fake it here. - if (mModifiers & NSCommandKeyMask) + if (!mHasMarkedText) { - callKeyUp([theEvent keyCode], mModifiers); + uint keycode = [theEvent keyCode]; + callKeyDown(keycode, mModifiers); + + // OS X intentionally does not send us key-up information on cmd-key combinations. + // This behaviour is not a bug, and only applies to cmd-combinations (no others). + // Since SL assumes we receive those, we fake it here. + if (mModifiers & NSCommandKeyMask) + { + callKeyUp([theEvent keyCode], mModifiers); + } } } @@ -348,7 +351,7 @@ - (BOOL)hasMarkedText { - return NO; + return mHasMarkedText; } - (NSRange)markedRange @@ -365,21 +368,73 @@ return NSMakeRange(range[0], range[1]); } -- (void)setMarkedText:(id)aString selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange +- (segment_t) getSegments:(NSAttributedString*)str { + segment_t segments; + + int segment = 0; + + NSRange l; + NSRange r = NSMakeRange(0, [str length]); + + while (r.length > 0) + { + NSNumber *segmentAttrib = [str attribute:NSUnderlineStyleAttributeName atIndex:r.location longestEffectiveRange:&l inRange:r]; + + r = NSMakeRange(NSMaxRange(l), NSMaxRange(r) - NSMaxRange(l)); + bool standout; + if ([segmentAttrib integerValue] == 1) + { + standout = false; + } else { + standout = true; + } + segments.insert(std::pair(l.length, standout)); + + segment++; + } + return segments; +} + +- (void)setMarkedText:(id)aString selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange +{ + if ([aString class] == NSClassFromString(@"NSConcreteMutableAttributedString")) + { + unsigned int selected[2] = { + selectedRange.location, + selectedRange.length + }; + + unsigned int replacement[2] = { + replacementRange.location, + replacementRange.length + }; + + NSLog(@"Attributed string: %@", aString); + + unichar text[[aString length]]; + [[aString mutableString] getCharacters:text range:NSMakeRange(0, [aString length])]; + segment_t segments = [self getSegments:(NSAttributedString *)aString]; + setMarkedText(text, selected, replacement, [aString length], segments); + mHasMarkedText = TRUE; + mMarkedTextLength = [aString length]; + } } - (void)unmarkText { - + resetPreedit(); + mHasMarkedText = FALSE; } +// We don't support attributed strings. - (NSArray *)validAttributesForMarkedText { return [NSArray array]; } +// See above. - (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange { return nil; @@ -387,9 +442,21 @@ - (void)insertText:(id)aString replacementRange:(NSRange)replacementRange { - for (NSInteger i = 0; i < [aString length]; i++) + if (!mHasMarkedText) { - callUnicodeCallback([aString characterAtIndex:i], mModifiers); + for (NSInteger i = 0; i < [aString length]; i++) + { + callUnicodeCallback([aString characterAtIndex:i], mModifiers); + } + } else { + // We may never get this point since unmarkText may be called before insertText ever gets called once we submit our text. + // But just in case... + resetPreedit(); + for (NSInteger i = 0; i < [aString length]; i++) + { + handleUnicodeCharacter([aString characterAtIndex:i]); + } + mHasMarkedText = FALSE; } } @@ -412,7 +479,9 @@ - (NSRect)firstRectForCharacterRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange { - return NSZeroRect; + float pos[4] = {0, 0, 0, 0}; + getPreeditLocation(pos, mMarkedTextLength); + return NSMakeRect(pos[0], pos[1], pos[2], pos[3]); } - (void)doCommandBySelector:(SEL)aSelector diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index 57bb071690..2de185fed3 100644 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -25,6 +25,10 @@ * $/LicenseInfo$ */ +#include + +typedef std::map segment_t; + // This will actually hold an NSCursor*, but that type is only available in objective C. typedef void *CursorRef; typedef void *NSWindowRef; @@ -71,6 +75,8 @@ void makeWindowOrderFront(NSWindowRef window); void convertScreenToWindow(NSWindowRef window, float *coord); void convertWindowToScreen(NSWindowRef window, float *coord); void convertScreenToView(NSWindowRef window, float *coord); +void convertRectToScreen(NSWindowRef window, float *coord); +void convertRectFromScreen(NSWindowRef window, float *coord); void setWindowPos(NSWindowRef window, float* pos); void closeWindow(NSWindowRef window); void removeGLView(GLViewRef view); @@ -113,6 +119,11 @@ void getPreeditSelectionRange(int *position, int *length); void getPreeditMarkedRange(int *position, int *length); void handleUnicodeCharacter(wchar_t c); void updatePreeditor(unsigned short *str); +void setPreeditMarkedRange(int position, int length); +void resetPreedit(); +int wstring_length(const std::basic_string & wstr, const int woffset, const int utf16_length, int *unaligned); +void setMarkedText(unsigned short *text, unsigned int *selectedRange, unsigned int *replacementRange, long text_len, segment_t segments); +void getPreeditLocation(float *location, unsigned int length); NSWindowRef getMainAppWindow(); GLViewRef getGLView(); diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index 9530785b83..1a0647485c 100644 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -119,6 +119,7 @@ CursorRef createImageCursor(const char *fullpath, int hotspotX, int hotspotY) void setArrowCursor() { NSCursor *cursor = [NSCursor arrowCursor]; + [NSCursor unhide]; [cursor set]; } @@ -290,12 +291,44 @@ void makeWindowOrderFront(NSWindowRef window) void convertScreenToWindow(NSWindowRef window, float *coord) { - NSPoint point; - point.x = coord[0]; - point.y = coord[1]; - point = [(LLNSWindow*)window convertScreenToBase:point]; - coord[0] = point.x; - coord[1] = point.y; + NSRect point; + point.origin.x = coord[0]; + point.origin.y = coord[1]; + point = [(LLNSWindow*)window convertRectFromScreen:point]; + coord[0] = point.origin.x; + coord[1] = point.origin.y; +} + +void convertRectToScreen(NSWindowRef window, float *coord) +{ + NSRect point; + point.origin.x = coord[0]; + point.origin.y = coord[1]; + point.size.width = coord[2]; + point.size.height = coord[3]; + + point = [(LLNSWindow*)window convertRectToScreen:point]; + + coord[0] = point.origin.x; + coord[1] = point.origin.y; + coord[2] = point.size.width; + coord[3] = point.size.height; +} + +void convertRectFromScreen(NSWindowRef window, float *coord) +{ + NSRect point; + point.origin.x = coord[0]; + point.origin.y = coord[1]; + point.size.width = coord[2]; + point.size.height = coord[3]; + + point = [(LLNSWindow*)window convertRectFromScreen:point]; + + coord[0] = point.origin.x; + coord[1] = point.origin.y; + coord[2] = point.size.width; + coord[3] = point.size.height; } void convertScreenToView(NSWindowRef window, float *coord) diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 7e4b9a84a1..4e8934b149 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -381,30 +381,27 @@ void callQuitHandler() } } -std::basic_string getPreeditString() +void getPreeditSelectionRange(int *position, int *length) { - std::basic_string str; if (gWindowImplementation->getPreeditor()) { - str = gWindowImplementation->getPreeditor()->getPreeditString(); + gWindowImplementation->getPreeditor()->getSelectionRange(position, length); } - - return str; } -void getPreeditSelectionRange(int *position, int *length) +void getPreeditMarkedRange(int *position, int *length) { if (gWindowImplementation->getPreeditor()) { - gWindowImplementation->getPreeditor()->getSelectionRange(position, length); + gWindowImplementation->getPreeditor()->getPreeditRange(position, length); } } -void getPreeditMarkedRange(int *position, int *length) +void setPreeditMarkedRange(int position, int length) { if (gWindowImplementation->getPreeditor()) { - gWindowImplementation->getPreeditor()->getPreeditRange(position, length); + gWindowImplementation->getPreeditor()->markAsPreedit(position, length); } } @@ -416,6 +413,69 @@ void handleUnicodeCharacter(wchar_t c) } } +void resetPreedit() +{ + if (gWindowImplementation->getPreeditor()) + { + gWindowImplementation->getPreeditor()->resetPreedit(); + } +} + +// For reasons of convenience, handle IME updates here. +// This largely mirrors the old implementation, only sans the carbon parameters. +void setMarkedText(unsigned short *unitext, unsigned int *selectedRange, unsigned int *replacementRange, long text_len, segment_t segments) +{ + if (gWindowImplementation->getPreeditor()) + { + LLPreeditor *preeditor = gWindowImplementation->getPreeditor(); + + // This should be a viable replacement for the kEventParamTextInputSendReplaceRange parameter. + if (replacementRange[0] < replacementRange[1]) + { + const LLWString& text = preeditor->getPreeditString(); + const S32 location = wstring_wstring_length_from_utf16_length(text, 0, replacementRange[0]); + const S32 length = wstring_wstring_length_from_utf16_length(text, location, replacementRange[1]); + preeditor->markAsPreedit(location, length); + } + + preeditor->resetPreedit(); + + LLWString fix_str = utf16str_to_wstring(llutf16string(unitext, text_len)); + + LLPreeditor::segment_lengths_t preedit_segment_lengths; + LLPreeditor::standouts_t preedit_standouts; + S32 caret_position = fix_str.length(); + + for (segment_t::iterator i = segments.begin(); i != segments.end(); i++) + { + preedit_segment_lengths.push_back(i->first); + preedit_standouts.push_back(i->second); + } + + preeditor->updatePreedit(fix_str, preedit_segment_lengths, preedit_standouts, caret_position); + } +} + +void getPreeditLocation(float *location, unsigned int length) +{ + if (gWindowImplementation->getPreeditor()) + { + LLPreeditor *preeditor = gWindowImplementation->getPreeditor(); + LLCoordGL coord; + LLCoordScreen screen; + LLRect rect; + + preeditor->getPreeditLocation(length, &coord, &rect, NULL); + + float c[4] = {coord.mX, coord.mY, 0, 0}; + + convertRectToScreen(gWindowImplementation->getWindow(), c); + + location[0] = c[0]; + location[1] = c[1]; + } +} + void LLWindowMacOSX::updateMouseDeltas(float* deltas) { if (mCursorDecoupled) @@ -1295,8 +1355,22 @@ BOOL LLWindowMacOSX::convertCoords(LLCoordScreen from, LLCoordGL *to) BOOL LLWindowMacOSX::convertCoords(LLCoordGL from, LLCoordScreen *to) { LLCoordWindow window_coord; + if (mFullscreen) + { + to->mX = from.mX; + to->mY = from.mY; + return TRUE; + } else if (mWindow) + { + convertCoords(from, &window_coord); + convertCoords(window_coord, to); + + LL_INFOS("Coords") << to->mX << ", " << to->mY << LL_ENDL; + + return TRUE; + } - return(convertCoords(from, &window_coord) && convertCoords(window_coord, to)); + return FALSE; } @@ -1425,7 +1499,7 @@ void LLWindowMacOSX::updateCursor() // Find out what they look like and replicate them. // These are essentially correct - case UI_CURSOR_WAIT: /* Apple purposely doesn't allow us to set the beachball cursor manually. */ break; + case UI_CURSOR_WAIT: /* Apple purposely doesn't allow us to set the beachball cursor manually. Let NSApp figure out when to do this. */ break; case UI_CURSOR_IBEAM: setIBeamCursor(); break; case UI_CURSOR_CROSS: setCrossCursor(); break; case UI_CURSOR_HAND: setPointingHandCursor(); break; @@ -1810,7 +1884,35 @@ static long getDictLong (CFDictionaryRef refDict, CFStringRef key) void LLWindowMacOSX::allowLanguageTextInput(LLPreeditor *preeditor, BOOL b) { - // TODO: IME support + if (preeditor != mPreeditor && !b) + { + // This condition may occur by a call to + // setEnabled(BOOL) against LLTextEditor or LLLineEditor + // when the control is not focused. + // We need to silently ignore the case so that + // the language input status of the focused control + // is not disturbed. + return; + } + + // Take care of old and new preeditors. + if (preeditor != mPreeditor || !b) + { + // We need to interrupt before updating mPreeditor, + // so that the fix string from input method goes to + // the old preeditor. + if (mLanguageTextInputAllowed) + { + interruptLanguageTextInput(); + } + mPreeditor = (b ? preeditor : NULL); + } + + if (b == mLanguageTextInputAllowed) + { + return; + } + mLanguageTextInputAllowed = b; } void LLWindowMacOSX::interruptLanguageTextInput() diff --git a/indra/newview/Info-SecondLife.plist b/indra/newview/Info-SecondLife.plist index 5db52f040f..8fb4e88bc3 100644 --- a/indra/newview/Info-SecondLife.plist +++ b/indra/newview/Info-SecondLife.plist @@ -13,7 +13,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - Second Life + SecondLife CFBundlePackageType APPL CFBundleSignature diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 92d8f2937e..f3b7c0fad4 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -653,7 +653,6 @@ BOOL LLViewerKeyboard::modeFromString(const std::string& string, S32 *mode) BOOL LLViewerKeyboard::handleKey(KEY translated_key, MASK translated_mask, BOOL repeated) { - LL_INFOS("Keyboard Handling") << "Handling key " << translated_key << LL_ENDL; // check for re-map EKeyboardMode mode = gViewerKeyboard.getMode(); U32 keyidx = (translated_mask<<16) | translated_key; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index ccaa9245cf..48a69129eb 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2429,7 +2429,6 @@ void LLViewerWindow::draw() // Takes a single keydown event, usually when UI is visible BOOL LLViewerWindow::handleKey(KEY key, MASK mask) { - LL_INFOS("Keyboard Handling") << "Handling key " << key << LL_ENDL; // hide tooltips on keypress LLToolTipMgr::instance().blockToolTips(); -- cgit v1.2.3 From 6bb7fd40d0fdc7902f1ac9db06a479121c177d0d Mon Sep 17 00:00:00 2001 From: Maestro Linden Date: Tue, 26 Mar 2013 21:25:10 +0000 Subject: MAINT-2507 Added syntax highlighting for new particle system settings (from MAINT-2410). Reviewed by Kelly. --- indra/newview/app_settings/keywords.ini | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/indra/newview/app_settings/keywords.ini b/indra/newview/app_settings/keywords.ini index 56b549ab62..ef0f78d4d4 100644 --- a/indra/newview/app_settings/keywords.ini +++ b/indra/newview/app_settings/keywords.ini @@ -131,6 +131,7 @@ PSYS_PART_FOLLOW_VELOCITY_MASK PSYS_PART_TARGET_POS_MASK PSYS_PART_EMISSIVE_MASK PSYS_PART_TARGET_LINEAR_MASK +PSYS_PART_RIBBON_MASK PSYS_SRC_PATTERN PSYS_SRC_INNERANGLE Deprecated -- Use PSYS_SRC_ANGLE_BEGIN @@ -147,12 +148,24 @@ PSYS_SRC_ACCEL PSYS_SRC_TEXTURE PSYS_SRC_TARGET_KEY PSYS_SRC_OMEGA +PSYS_PART_BLEND_FUNC_SOURCE +PSYS_PART_BLEND_FUNC_DEST +PSYS_PART_START_GLOW +PSYS_PART_END_GLOW PSYS_SRC_PATTERN_DROP PSYS_SRC_PATTERN_EXPLODE PSYS_SRC_PATTERN_ANGLE PSYS_SRC_PATTERN_ANGLE_CONE PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY +PSYS_PART_BF_ONE +PSYS_PART_BF_ZERO +PSYS_PART_BF_DEST_COLOR +PSYS_PART_BF_SOURCE_COLOR +PSYS_PART_BF_ONE_MINUS_DEST_COLOR +PSYS_PART_BF_ONE_MINUS_SOURCE_COLOR +PSYS_PART_BF_SOURCE_ALPHA +PSYS_PART_BF_ONE_MINUS_SOURCE_ALPHA OBJECT_UNKNOWN_DETAIL Returned by llGetObjectDetails when passed an invalid object parameter type OBJECT_NAME Used with llGetObjectDetails to get an object's name -- cgit v1.2.3 From 80a79e5d7b4f37f862b312e848b1d1e7f85b0fa9 Mon Sep 17 00:00:00 2001 From: Geenz Date: Wed, 27 Mar 2013 08:49:45 -0400 Subject: IME support is pretty much finished at this point. --- indra/llwindow/llappdelegate-objc.h | 1 - indra/llwindow/llopenglview-objc.h | 4 +-- indra/llwindow/llopenglview-objc.mm | 66 ++++++++++++++++++----------------- indra/llwindow/llwindowmacosx-objc.h | 13 +++++-- indra/llwindow/llwindowmacosx-objc.mm | 2 +- indra/llwindow/llwindowmacosx.cpp | 13 ++----- indra/newview/llappdelegate-objc.mm | 1 + 7 files changed, 51 insertions(+), 49 deletions(-) diff --git a/indra/llwindow/llappdelegate-objc.h b/indra/llwindow/llappdelegate-objc.h index 56b7a30797..6a4794f3c3 100644 --- a/indra/llwindow/llappdelegate-objc.h +++ b/indra/llwindow/llappdelegate-objc.h @@ -8,7 +8,6 @@ #import #import "llopenglview-objc.h" -#include "llwindowmacosx-objc.h" @interface LLAppDelegate : NSObject { LLNSWindow *window; diff --git a/indra/llwindow/llopenglview-objc.h b/indra/llwindow/llopenglview-objc.h index 8140421e44..5f972b1a98 100644 --- a/indra/llwindow/llopenglview-objc.h +++ b/indra/llwindow/llopenglview-objc.h @@ -10,7 +10,7 @@ #import #import #import -#include "llwindowmacosx-objc.h" +#include // Some nasty shovelling of LLOpenGLView from LLNativeBindings to prevent any C++ <-> Obj-C interop oddities. // Redraw callback handling removed (for now) due to being unneeded in the patch that preceeds this addition. @@ -42,8 +42,6 @@ - (unsigned long) getVramSize; -- (segment_t) getSegments:(NSAttributedString*)str; - @end @interface LLNSWindow : NSWindow diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 31b0e02ad8..376d238c90 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -7,6 +7,7 @@ // #import "llopenglview-objc.h" +#include "llwindowmacosx-objc.h" @implementation NSScreen (PointConversion) @@ -37,6 +38,37 @@ @end +attributedStringInfo getSegments(NSAttributedString *str) +{ + attributedStringInfo segments; + segment_lengths seg_lengths; + segment_standouts seg_standouts; + NSRange effectiveRange; + NSRange limitRange = NSMakeRange(0, [str length]); + while (limitRange.length > 0) { + NSNumber *attr = [str attribute:NSUnderlineStyleAttributeName atIndex:limitRange.location longestEffectiveRange:&effectiveRange inRange:limitRange]; + limitRange = NSMakeRange(NSMaxRange(effectiveRange), NSMaxRange(limitRange) - NSMaxRange(effectiveRange)); + + if (effectiveRange.length <= 0) + { + effectiveRange.length = 1; + } + + if ([attr integerValue] == 2) + { + seg_lengths.push_back(effectiveRange.length); + seg_standouts.push_back(true); + } else + { + seg_lengths.push_back(effectiveRange.length); + seg_standouts.push_back(false); + } + } + segments.seg_lengths = seg_lengths; + segments.seg_standouts = seg_standouts; + return segments; +} + @implementation LLOpenGLView - (unsigned long)getVramSize @@ -368,35 +400,6 @@ return NSMakeRange(range[0], range[1]); } -- (segment_t) getSegments:(NSAttributedString*)str -{ - segment_t segments; - - int segment = 0; - - NSRange l; - NSRange r = NSMakeRange(0, [str length]); - - while (r.length > 0) - { - NSNumber *segmentAttrib = [str attribute:NSUnderlineStyleAttributeName atIndex:r.location longestEffectiveRange:&l inRange:r]; - - r = NSMakeRange(NSMaxRange(l), NSMaxRange(r) - NSMaxRange(l)); - bool standout; - if ([segmentAttrib integerValue] == 1) - { - standout = false; - } else { - standout = true; - } - segments.insert(std::pair(l.length, standout)); - - segment++; - } - - return segments; -} - - (void)setMarkedText:(id)aString selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange { if ([aString class] == NSClassFromString(@"NSConcreteMutableAttributedString")) @@ -411,11 +414,9 @@ replacementRange.length }; - NSLog(@"Attributed string: %@", aString); - unichar text[[aString length]]; [[aString mutableString] getCharacters:text range:NSMakeRange(0, [aString length])]; - segment_t segments = [self getSegments:(NSAttributedString *)aString]; + attributedStringInfo segments = getSegments((NSAttributedString *)aString); setMarkedText(text, selected, replacement, [aString length], segments); mHasMarkedText = TRUE; mMarkedTextLength = [aString length]; @@ -452,6 +453,7 @@ // We may never get this point since unmarkText may be called before insertText ever gets called once we submit our text. // But just in case... resetPreedit(); + for (NSInteger i = 0; i < [aString length]; i++) { handleUnicodeCharacter([aString characterAtIndex:i]); diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index 2de185fed3..1d05db14b2 100644 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -26,8 +26,17 @@ */ #include +#include -typedef std::map segment_t; +typedef std::vector > segment_t; + +typedef std::vector segment_lengths; +typedef std::vector segment_standouts; + +struct attributedStringInfo { + segment_lengths seg_lengths; + segment_standouts seg_standouts; +}; // This will actually hold an NSCursor*, but that type is only available in objective C. typedef void *CursorRef; @@ -122,7 +131,7 @@ void updatePreeditor(unsigned short *str); void setPreeditMarkedRange(int position, int length); void resetPreedit(); int wstring_length(const std::basic_string & wstr, const int woffset, const int utf16_length, int *unaligned); -void setMarkedText(unsigned short *text, unsigned int *selectedRange, unsigned int *replacementRange, long text_len, segment_t segments); +void setMarkedText(unsigned short *text, unsigned int *selectedRange, unsigned int *replacementRange, long text_len, attributedStringInfo segments); void getPreeditLocation(float *location, unsigned int length); NSWindowRef getMainAppWindow(); diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index 1a0647485c..43f853bfd1 100644 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -27,8 +27,8 @@ #include #include -#include "llwindowmacosx-objc.h" #include "llopenglview-objc.h" +#include "llwindowmacosx-objc.h" #include "llappdelegate-objc.h" /* diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 4e8934b149..6f66da66a4 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -39,6 +39,7 @@ #include "indra_constants.h" #include +#include extern BOOL gDebugWindowProc; @@ -423,7 +424,7 @@ void resetPreedit() // For reasons of convenience, handle IME updates here. // This largely mirrors the old implementation, only sans the carbon parameters. -void setMarkedText(unsigned short *unitext, unsigned int *selectedRange, unsigned int *replacementRange, long text_len, segment_t segments) +void setMarkedText(unsigned short *unitext, unsigned int *selectedRange, unsigned int *replacementRange, long text_len, attributedStringInfo segments) { if (gWindowImplementation->getPreeditor()) { @@ -442,17 +443,9 @@ void setMarkedText(unsigned short *unitext, unsigned int *selectedRange, unsigne LLWString fix_str = utf16str_to_wstring(llutf16string(unitext, text_len)); - LLPreeditor::segment_lengths_t preedit_segment_lengths; - LLPreeditor::standouts_t preedit_standouts; S32 caret_position = fix_str.length(); - for (segment_t::iterator i = segments.begin(); i != segments.end(); i++) - { - preedit_segment_lengths.push_back(i->first); - preedit_standouts.push_back(i->second); - } - - preeditor->updatePreedit(fix_str, preedit_segment_lengths, preedit_standouts, caret_position); + preeditor->updatePreedit(fix_str, segments.seg_lengths, segments.seg_standouts, caret_position); } } diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 9e0e0e35c5..5fb5087cd8 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -7,6 +7,7 @@ // #import "llappdelegate-objc.h" +#include "llwindowmacosx-objc.h" @implementation LLAppDelegate -- cgit v1.2.3 From d8dc74b83349752768d99b77c92a284955ee04e4 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 28 Mar 2013 16:06:07 -0700 Subject: MAINT-2426 : Viewer support for new simulator AvatarRenderInfo capability. Reviewed by Kelly --- indra/newview/CMakeLists.txt | 2 + indra/newview/llappviewer.cpp | 4 + indra/newview/llavatarrenderinfoaccountant.cpp | 360 +++++++++++++++++++++++++ indra/newview/llavatarrenderinfoaccountant.h | 54 ++++ indra/newview/llspatialpartition.cpp | 2 + indra/newview/llviewerregion.cpp | 5 + indra/newview/llviewerregion.h | 4 + indra/newview/llvoavatar.cpp | 3 + indra/newview/llvoavatar.h | 23 +- indra/newview/llvovolume.cpp | 2 + 10 files changed, 455 insertions(+), 4 deletions(-) create mode 100644 indra/newview/llavatarrenderinfoaccountant.cpp create mode 100644 indra/newview/llavatarrenderinfoaccountant.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index bd0169fb2f..cb96dfeb48 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -113,6 +113,7 @@ set(viewer_SOURCE_FILES llavatariconctrl.cpp llavatarlist.cpp llavatarlistitem.cpp + llavatarrenderinfoaccountant.cpp llavatarpropertiesprocessor.cpp llblockedlistitem.cpp llblocklist.cpp @@ -702,6 +703,7 @@ set(viewer_HEADER_FILES llavatarlist.h llavatarlistitem.h llavatarpropertiesprocessor.h + llavatarrenderinfoaccountant.h llblockedlistitem.h llblocklist.h llbox.h diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 4745157c8b..7404d2d228 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -97,6 +97,7 @@ #include "llupdaterservice.h" #include "llfloatertexturefetchdebugger.h" #include "llspellcheck.h" +#include "llavatarrenderinfoaccountant.h" // Linden library includes #include "llavatarnamecache.h" @@ -4587,6 +4588,9 @@ void LLAppViewer::idle() gObjectList.updateApparentAngles(gAgent); } + // Update AV render info + LLAvatarRenderInfoAccountant::idle(); + { LLFastTimer t(FTM_AUDIO_UPDATE); diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp new file mode 100644 index 0000000000..04a79f7d4c --- /dev/null +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -0,0 +1,360 @@ +/** + * @file llavatarrenderinfoaccountant.cpp + * @author Dave Simmons + * @date 2013-02-28 + * @brief + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +// Precompiled header +#include "llviewerprecompiledheaders.h" +// associated header +#include "llavatarrenderinfoaccountant.h" +// STL headers +// std headers +// external library headers +// other Linden headers +#include "llcharacter.h" +#include "llhttpclient.h" +#include "lltimer.h" +#include "llviewerobjectlist.h" +#include "llviewerregion.h" +#include "llvoavatar.h" +#include "llworld.h" + + +// Use this for debugging +//#define LL_AVATAR_RENDER_INFO_LOG_SPAM + +static const std::string KEY_AGENTS = "agents"; // map +static const std::string KEY_WEIGHT = "weight"; // integer +static const std::string KEY_GEOMETRY = "geometry"; // integer +static const std::string KEY_SURFACE = "surface"; // float + +static const std::string KEY_IDENTIFIER = "identifier"; +static const std::string KEY_MESSAGE = "message"; +static const std::string KEY_ERROR = "error"; + + +// Send data updates about once per minute, only need per-frame resolution +LLFrameTimer LLAvatarRenderInfoAccountant::sRenderInfoReportTimer; + + +// HTTP responder class for GET request for avatar render weight information +class LLAvatarRenderInfoGetResponder : public LLHTTPClient::Responder +{ +public: + LLAvatarRenderInfoGetResponder(U64 region_handle) : mRegionHandle(region_handle) + { + } + + virtual void error(U32 statusNum, const std::string& reason) + { + LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); + if (regionp) + { + llwarns << "HTTP error result for avatar weight GET: " << statusNum + << ", " << reason + << " returned by region " << regionp->getName() + << llendl; + } + else + { + llwarns << "Avatar render weight GET error recieved but region not found for " + << mRegionHandle + << ", error " << statusNum + << ", " << reason + << llendl; + } + + } + + virtual void result(const LLSD& content) + { + LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); + if (regionp) + { + #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM + llinfos << "Result for avatar weights request for region " << regionp->getName() << ":" << llendl; + #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + + if (content.isMap()) + { + if (content.has(KEY_AGENTS)) + { + const LLSD & agents = content[KEY_AGENTS]; + if (agents.isMap()) + { + LLSD::map_const_iterator report_iter = agents.beginMap(); + while (report_iter != agents.endMap()) + { + LLUUID target_agent_id = LLUUID(report_iter->first); + const LLSD & agent_info_map = report_iter->second; + LLViewerObject* avatarp = gObjectList.findObject(target_agent_id); + if (avatarp && + avatarp->isAvatar() && + agent_info_map.isMap()) + { // Extract the data for this avatar + + #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM + llinfos << " Agent " << target_agent_id + << ": " << agent_info_map << llendl; + #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + + if (agent_info_map.has(KEY_WEIGHT)) + { + ((LLVOAvatar *) avatarp)->setReportedVisualComplexity(agent_info_map[KEY_WEIGHT].asInteger()); + } + if (agent_info_map.has(KEY_GEOMETRY)) + { + ((LLVOAvatar *) avatarp)->setReportedAttachmentGeometryBytes(agent_info_map[KEY_GEOMETRY].asInteger()); + } + if (agent_info_map.has(KEY_SURFACE)) + { + ((LLVOAvatar *) avatarp)->setReportedAttachmentSurfaceArea((F32) agent_info_map[KEY_SURFACE].asReal()); + } + } + report_iter++; + } + } + } // has "agents" + else if (content.has(KEY_ERROR)) + { + const LLSD & error = content[KEY_ERROR]; + llwarns << "Avatar render info GET error: " + << error[KEY_IDENTIFIER] + << ": " << error[KEY_MESSAGE] + << " from region " << regionp->getName() + << llendl; + } + } + } + else + { + llinfos << "Avatar render weight info recieved but region not found for " + << mRegionHandle << llendl; + } + } + +private: + U64 mRegionHandle; +}; + + +// HTTP responder class for POST request for avatar render weight information +class LLAvatarRenderInfoPostResponder : public LLHTTPClient::Responder +{ +public: + LLAvatarRenderInfoPostResponder(U64 region_handle) : mRegionHandle(region_handle) + { + } + + virtual void error(U32 statusNum, const std::string& reason) + { + LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); + if (regionp) + { + llwarns << "HTTP error result for avatar weight POST: " << statusNum + << ", " << reason + << " returned by region " << regionp->getName() + << llendl; + } + else + { + llwarns << "Avatar render weight POST error recieved but region not found for " + << mRegionHandle + << ", error " << statusNum + << ", " << reason + << llendl; + } + } + + virtual void result(const LLSD& content) + { + LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); + if (regionp) + { + #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM + llinfos << "Result for avatar weights POST for region " << regionp->getName() + << ": " << content << llendl; + #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + + if (content.isMap()) + { + if (content.has(KEY_ERROR)) + { + const LLSD & error = content[KEY_ERROR]; + llwarns << "Avatar render info POST error: " + << error[KEY_IDENTIFIER] + << ": " << error[KEY_MESSAGE] + << " from region " << regionp->getName() + << llendl; + } + } + } + else + { + llinfos << "Avatar render weight POST result recieved but region not found for " + << mRegionHandle << llendl; + } + } + +private: + U64 mRegionHandle; +}; + + +// static +// Send request for one region, no timer checks +void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regionp) +{ + std::string url = regionp->getCapability("AvatarRenderInfo"); + if (!url.empty()) + { + #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM + llinfos << "Sending avatar render info to region " + << regionp->getName() + << " from " << url + << llendl; + #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + + // Build the render info to POST to the region + LLSD report = LLSD::emptyMap(); + LLSD agents = LLSD::emptyMap(); + + std::vector::iterator iter = LLCharacter::sInstances.begin(); + while( iter != LLCharacter::sInstances.end() ) + { + LLVOAvatar* avatar = dynamic_cast(*iter); + if (avatar && + avatar->getRezzedStatus() == 2 && // Fully rezzed + !avatar->isDead() && // Not dead yet + avatar->getObjectHost() == regionp->getHost()) // Ensure it's on the same region + { + avatar->calculateUpdateRenderCost(); // Make sure the numbers are up-to-date + + LLSD info = LLSD::emptyMap(); + if (avatar->getVisualComplexity() > 0) + { + info[KEY_WEIGHT] = avatar->getVisualComplexity(); + } + if (avatar->getAttachmentGeometryBytes() > 0) + { + info[KEY_GEOMETRY] = (S32) avatar->getAttachmentGeometryBytes(); + } + if (avatar->getAttachmentSurfaceArea() > 0.f) + { + info[KEY_SURFACE] = avatar->getAttachmentSurfaceArea(); + } + if (info.size() > 0) + { + agents[avatar->getID().asString()] = info; + } + + #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM + llinfos << "Sending avatar render info for " << avatar->getID() + << ": " << info << llendl; + #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + } + iter++; + } + + report[KEY_AGENTS] = agents; + if (agents.size() > 0) + { + LLHTTPClient::post(url, report, new LLAvatarRenderInfoPostResponder(regionp->getHandle())); + } + } +} + + + + +// static +// Send request for one region, no timer checks +void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regionp) +{ + std::string url = regionp->getCapability("AvatarRenderInfo"); + if (!url.empty()) + { + #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM + llinfos << "Requesting avatar render info for region " + << regionp->getName() + << " from " << url + << llendl; + #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + + // First send a request to get the latest data + LLHTTPClient::get(url, new LLAvatarRenderInfoGetResponder(regionp->getHandle())); + } +} + + +// static +// Called every frame - send render weight requests to every region +void LLAvatarRenderInfoAccountant::idle() +{ + if (sRenderInfoReportTimer.hasExpired()) + { + const F32 SECS_BETWEEN_REGION_SCANS = 5.f; // Scan the region list every 5 seconds + const F32 SECS_BETWEEN_REGION_REQUEST = 60.0; // Update each region every 60 seconds + + S32 num_avs = LLCharacter::sInstances.size(); + + // Check all regions and see if it's time to fetch/send data + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) + { + LLViewerRegion* regionp = *iter; + if (regionp && + regionp->isAlive() && + regionp->capabilitiesReceived() && // Region has capability URLs available + regionp->getRenderInfoRequestTimer().hasExpired()) // Time to make request + { + sendRenderInfoToRegion(regionp); + getRenderInfoFromRegion(regionp); + + // Reset this regions timer, moving to longer intervals if there are lots of avatars around + regionp->getRenderInfoRequestTimer().resetWithExpiry(SECS_BETWEEN_REGION_REQUEST + (2.f * num_avs)); + } + } + + // We scanned all the regions, reset the request timer. + sRenderInfoReportTimer.resetWithExpiry(SECS_BETWEEN_REGION_SCANS); + } +} + + +// static +// Make sRenderInfoReportTimer expire so the next call to idle() will scan and query a new region +// called via LLViewerRegion::setCapabilitiesReceived() boost signals when the capabilities +// are returned for a new LLViewerRegion, and is the earliest time to get render info +void LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer() +{ + #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM + llinfos << "Viewer has new region capabilities" << llendl; + #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + + sRenderInfoReportTimer.resetWithExpiry(0.f); +} + diff --git a/indra/newview/llavatarrenderinfoaccountant.h b/indra/newview/llavatarrenderinfoaccountant.h new file mode 100644 index 0000000000..5b4a4d3db2 --- /dev/null +++ b/indra/newview/llavatarrenderinfoaccountant.h @@ -0,0 +1,54 @@ +/** + * @file llavatarrenderinfoaccountant.h + * @author Dave Simmons + * @date 2013-02-28 + * @brief + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#if ! defined(LL_llavatarrenderinfoaccountant_H) +#define LL_llavatarrenderinfoaccountant_H + +class LLViewerRegion; + +// Class to gather avatar rendering information +// that is sent to or fetched from regions. +class LLAvatarRenderInfoAccountant +{ +public: + LLAvatarRenderInfoAccountant() {}; + ~LLAvatarRenderInfoAccountant() {}; + + static void sendRenderInfoToRegion(LLViewerRegion * regionp); + static void getRenderInfoFromRegion(LLViewerRegion * regionp); + + static void expireRenderInfoReportTimer(); + + static void idle(); + +private: + // Send data updates about once per minute, only need per-frame resolution + static LLFrameTimer sRenderInfoReportTimer; +}; + +#endif /* ! defined(LL_llavatarrenderinfoaccountant_H) */ diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 759e1a7b4c..1d30b19308 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -1404,7 +1404,9 @@ void LLSpatialGroup::handleDestruction(const TreeNode* node) if (bridge->mAvatar.notNull()) { bridge->mAvatar->mAttachmentGeometryBytes -= mGeometryBytes; + bridge->mAvatar->mAttachmentGeometryBytes = llmax(bridge->mAvatar->mAttachmentGeometryBytes, 0); bridge->mAvatar->mAttachmentSurfaceArea -= mSurfaceArea; + bridge->mAvatar->mAttachmentSurfaceArea = llmax(bridge->mAvatar->mAttachmentSurfaceArea, 0.f); } } diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index e4234a538d..eb5a0b8d37 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -44,6 +44,7 @@ #include "llagent.h" #include "llagentcamera.h" +#include "llavatarrenderinfoaccountant.h" #include "llcallingcard.h" #include "llcaphttpsender.h" #include "llcapabilitylistener.h" @@ -333,6 +334,9 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mImpl->mObjectPartition.push_back(new LLBridgePartition()); //PARTITION_BRIDGE mImpl->mObjectPartition.push_back(new LLHUDParticlePartition());//PARTITION_HUD_PARTICLE mImpl->mObjectPartition.push_back(NULL); //PARTITION_NONE + + mRenderInfoRequestTimer.resetWithExpiry(0.f); // Set timer to be expired + setCapabilitiesReceivedCallback(boost::bind(&LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer)); } @@ -1514,6 +1518,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("AgentState"); capabilityNames.append("AttachmentResources"); capabilityNames.append("AvatarPickerSearch"); + capabilityNames.append("AvatarRenderInfo"); capabilityNames.append("CharacterProperties"); capabilityNames.append("ChatSessionRequest"); capabilityNames.append("CopyInventoryFromNotecard"); diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index c9fffaf30e..2d3a622e42 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -365,6 +365,8 @@ public: LLDynamicArray mMapAvatars; LLDynamicArray mMapAvatarIDs; + LLFrameTimer & getRenderInfoRequestTimer() { return mRenderInfoRequestTimer; }; + private: LLViewerRegionImpl * mImpl; @@ -421,6 +423,8 @@ private: BOOL mReleaseNotesRequested; LLSD mSimulatorFeatures; + + LLFrameTimer mRenderInfoRequestTimer; }; inline BOOL LLViewerRegion::getAllowDamage() const diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9e5d44eb1f..1fc20fd207 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -662,6 +662,9 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mSpecialRenderMode(0), mAttachmentGeometryBytes(0), mAttachmentSurfaceArea(0.f), + mReportedVisualComplexity(-1), + mReportedAttachmentGeometryBytes(-1), + mReportedAttachmentSurfaceArea(-1.f), mTurning(FALSE), mPelvisToFoot(0.f), mLastSkeletonSerialNum( 0 ), diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 0e7bf7a6c9..495d3e9483 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -257,9 +257,20 @@ public: void calculateUpdateRenderCost(); void updateVisualComplexity() { mVisualComplexityStale = TRUE; } - S32 getVisualComplexity() { return mVisualComplexity; }; - S32 getUpdatePeriod() { return mUpdatePeriod; }; - const LLColor4 & getMutedAVColor() { return mMutedAVColor; }; + S32 getVisualComplexity() { return mVisualComplexity; }; // Numbers calculated here by rendering AV + S32 getAttachmentGeometryBytes() { return mAttachmentGeometryBytes; }; // number of bytes in attached geometry + F32 getAttachmentSurfaceArea() { return mAttachmentSurfaceArea; }; // estimated surface area of attachments + + S32 getReportedVisualComplexity() { return mReportedVisualComplexity; }; // Numbers as reported by the SL server + void setReportedVisualComplexity(S32 value) { mReportedVisualComplexity = value; }; + S32 getReportedAttachmentGeometryBytes() { return mReportedAttachmentGeometryBytes; }; //number of bytes in attached geometry + void setReportedAttachmentGeometryBytes(S32 value) { mReportedAttachmentGeometryBytes = value; }; + F32 getReportedAttachmentSurfaceArea() { return mReportedAttachmentSurfaceArea; }; //estimated surface area of attachments + void setReportedAttachmentSurfaceArea(F32 value) { mReportedAttachmentSurfaceArea = value; }; + + S32 getUpdatePeriod() { return mUpdatePeriod; }; + const LLColor4 & getMutedAVColor() { return mMutedAVColor; }; + void idleUpdateBelowWater(); @@ -469,9 +480,13 @@ public: static void restoreGL(); BOOL mIsDummy; // for special views S32 mSpecialRenderMode; // special lighting - U32 mAttachmentGeometryBytes; //number of bytes in attached geometry + S32 mAttachmentGeometryBytes; //number of bytes in attached geometry F32 mAttachmentSurfaceArea; //estimated surface area of attachments + S32 mReportedVisualComplexity; // Numbers as reported by the SL server + S32 mReportedAttachmentGeometryBytes; //number of bytes in attached geometry + F32 mReportedAttachmentSurfaceArea; //estimated surface area of attachments + private: bool shouldAlphaMask(); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 426ad8bc21..71ee2da216 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4242,7 +4242,9 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (pAvatarVO) { pAvatarVO->mAttachmentGeometryBytes -= group->mGeometryBytes; + pAvatarVO->mAttachmentGeometryBytes = llmax(pAvatarVO->mAttachmentGeometryBytes, 0); pAvatarVO->mAttachmentSurfaceArea -= group->mSurfaceArea; + pAvatarVO->mAttachmentSurfaceArea = llmax(pAvatarVO->mAttachmentSurfaceArea, 0.f); } group->mGeometryBytes = 0; -- cgit v1.2.3 From ecbcef1224899d7f61860289fc079aae284a3360 Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 29 Mar 2013 01:42:50 +0100 Subject: changed url to pdp15.lindenlab.com --- indra/newview/llpanelpeople.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index ab82273ccd..10a783053b 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1667,21 +1667,21 @@ void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p) void LLPanelPeople::onLoginFbcButtonClicked() { LLFloaterWebContent::Params p; - p.url("https://cryptic-ridge-1632.herokuapp.com/"); + p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=https://pdp15.lindenlab.com/authenticate/" + gAgentID.asString()); openFacebookWeb(p); } void LLPanelPeople::onFacebookAppRequestClicked() { LLFloaterWebContent::Params p; - p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=https://cryptic-ridge-1632.herokuapp.com/"); + p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=https://pdp15.lindenlab.com/"); openFacebookWeb(p); } void LLPanelPeople::onFacebookAppSendClicked() { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Test&link=http://www.cnet.com&redirect_uri=https://cryptic-ridge-1632.herokuapp.com/"); + p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Test&link=http://www.cnet.com&redirect_uri=https://pdp15.lindenlab.com/"); openFacebookWeb(p); } // EOF -- cgit v1.2.3 From 67726254a7d638a61025cbff53d88378f9b0ef04 Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 29 Mar 2013 21:40:23 +0100 Subject: added response to successful FBC authentication --- indra/newview/llpanelpeople.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 10a783053b..8f138a821a 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -78,6 +78,8 @@ static const std::string FBCTEST_TAB_NAME = "fbctest_panel"; static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; +static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com"; + /** Comparator for comparing avatar items by last interaction date */ class LLAvatarItemRecentComparator : public LLAvatarItemComparator { @@ -890,19 +892,18 @@ void LLPanelPeople::updateFbcTestList() std::string title = mFbcTestBrowserHandle.get()->getTitle(); // if the data is ready (if it says the magic word) - if (title.length() > 8 && title.substr(0, 8) == "FBCTEST ") + if (title.length() >= 2 && title[0] == ':') { - // get the list of friends' names from the title bar - std::vector names = LLStringUtil::getTokens(title.substr(8), ","); - - // display the names in the list - std::string label; - for (std::vector::const_iterator i = names.begin() + 1; i != names.end(); ++i) + // success! :) + if (title[1] == ')') + { + mFbcTestText->setText(std::string("okay, now we can get the list of friends!")); + } + // failure :( + else if (title[1] == '(') { - label += *i; - label += "\n"; + mFbcTestText->setText(std::string("hmm, the authentication failed somehow")); } - mFbcTestText->setText(label); // close the browser window mFbcTestBrowserHandle.get()->die(); @@ -1667,21 +1668,21 @@ void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p) void LLPanelPeople::onLoginFbcButtonClicked() { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=https://pdp15.lindenlab.com/authenticate/" + gAgentID.asString()); + p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/authenticate/" + gAgentID.asString()); openFacebookWeb(p); } void LLPanelPeople::onFacebookAppRequestClicked() { LLFloaterWebContent::Params p; - p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=https://pdp15.lindenlab.com/"); + p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + FBC_SERVICES_URL); openFacebookWeb(p); } void LLPanelPeople::onFacebookAppSendClicked() { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Test&link=http://www.cnet.com&redirect_uri=https://pdp15.lindenlab.com/"); + p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Test&link=http://www.cnet.com&redirect_uri=" + FBC_SERVICES_URL); openFacebookWeb(p); } // EOF -- cgit v1.2.3 From 11aed44bab1da46e0fadb458464e3cfd7ea2be43 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 29 Mar 2013 15:28:41 -0700 Subject: Using curl to access pdp with the has-acces-token API and then upon receipt will open the webview when no token exists for the user. --- indra/newview/llpanelpeople.cpp | 42 ++++++++++++++++++++++++++++++++++++++--- indra/newview/llpanelpeople.h | 2 +- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 10a783053b..e229fd3cf3 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1664,11 +1664,47 @@ void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p) } } +class LLFacebookLogin : public LLHTTPClient::Responder +{ +public: + + LLPanelPeople * mPanelPeople; + + LLFacebookLogin(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {} + + /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) + { + // in case of invalid characters, the avatar picker returns a 400 + // just set it to process so it displays 'not found' + if (isGoodStatus(status) || status == 400) + { + llinfos << content << llendl; + + bool has_token = content["has_access_token"].asBoolean(); + + //use the token to pull down graph data + if(has_token) + { + + } + //request user to login + else + { + LLFloaterWebContent::Params p; + p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=https://pdp15.lindenlab.com/authenticate/" + gAgentID.asString()); + mPanelPeople->openFacebookWeb(p); + } + } + else + { + llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl; + } + } +}; + void LLPanelPeople::onLoginFbcButtonClicked() { - LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=https://pdp15.lindenlab.com/authenticate/" + gAgentID.asString()); - openFacebookWeb(p); + LLHTTPClient::get("https://pdp15.lindenlab.com/has-access-token/" + gAgentID.asString(), new LLFacebookLogin(this)); } void LLPanelPeople::onFacebookAppRequestClicked() diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 39cdbc9bd7..dadd273603 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -55,6 +55,7 @@ public: // Implements LLVoiceClientStatusObserver::onChange() to enable call buttons // when voice is available /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal); + void openFacebookWeb(LLFloaterWebContent::Params& p); // internals class Updater; @@ -118,7 +119,6 @@ private: void onLoginFbcButtonClicked(); void onFacebookAppRequestClicked(); void onFacebookAppSendClicked(); - void openFacebookWeb(LLFloaterWebContent::Params& p); //returns false only if group is "none" bool isRealGroup(); -- cgit v1.2.3 From 2656b1f405dcf3b67d644bf47b02a64886ef2ca4 Mon Sep 17 00:00:00 2001 From: Geenz Date: Mon, 1 Apr 2013 08:15:12 -0400 Subject: First pass at adding a viable replacement for TSM's old UseInputWindow method (which is now deprecated with seemingly no Cocoa replacement). --- indra/llwindow/llappdelegate-objc.h | 6 +- indra/llwindow/llopenglview-objc.h | 12 +- indra/llwindow/llopenglview-objc.mm | 22 +- indra/llwindow/llwindowmacosx-objc.h | 2 + indra/llwindow/llwindowmacosx-objc.mm | 10 + indra/llwindow/llwindowmacosx.cpp | 14 +- indra/newview/SecondLife.nib | Bin 7403 -> 12997 bytes indra/newview/SecondLife.xib | 381 +++++++++++++++++++++++++++++++++- indra/newview/llappdelegate-objc.mm | 15 ++ 9 files changed, 444 insertions(+), 18 deletions(-) diff --git a/indra/llwindow/llappdelegate-objc.h b/indra/llwindow/llappdelegate-objc.h index 6a4794f3c3..e7f6ecd5fc 100644 --- a/indra/llwindow/llappdelegate-objc.h +++ b/indra/llwindow/llappdelegate-objc.h @@ -11,11 +11,15 @@ @interface LLAppDelegate : NSObject { LLNSWindow *window; + NSWindow *inputWindow; + LLNonInlineTextView *inputView; NSTimer *frameTimer; } @property (assign) IBOutlet LLNSWindow *window; +@property (assign) IBOutlet NSWindow *inputWindow; +@property (assign) IBOutlet LLNonInlineTextView *inputView; - (void) mainLoop; - +- (void) showInputWindow:(bool)show; @end diff --git a/indra/llwindow/llopenglview-objc.h b/indra/llwindow/llopenglview-objc.h index 5f972b1a98..6b21148bb6 100644 --- a/indra/llwindow/llopenglview-objc.h +++ b/indra/llwindow/llopenglview-objc.h @@ -12,9 +12,6 @@ #import #include -// Some nasty shovelling of LLOpenGLView from LLNativeBindings to prevent any C++ <-> Obj-C interop oddities. -// Redraw callback handling removed (for now) due to being unneeded in the patch that preceeds this addition. - @interface LLOpenGLView : NSOpenGLView { std::string mLastDraggedUrl; @@ -44,6 +41,15 @@ @end +@interface LLNonInlineTextView : NSTextView +{ + LLOpenGLView *glview; +} + +- (void) setGLView:(LLOpenGLView*)view; + +@end + @interface LLNSWindow : NSWindow - (NSPoint)convertToScreenFromLocalPoint:(NSPoint)point relativeToView:(NSView *)view; diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 376d238c90..a6ef35a8eb 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -501,9 +501,25 @@ attributedStringInfo getSegments(NSAttributedString *str) @end -// We use a custom NSWindow for our event handling. -// Why not an NSWindowController you may ask? -// Answer: this is easier. +@implementation LLNonInlineTextView + +- (void) setGLView:(LLOpenGLView *)view +{ + glview = view; +} + +- (void) insertText:(id)insertString +{ + [self insertText:insertString replacementRange:NSMakeRange(0, 0)]; +} + +- (void) insertText:(id)aString replacementRange:(NSRange)replacementRange +{ + [glview insertText:aString replacementRange:replacementRange]; + [_window orderOut:_window]; +} + +@end @implementation LLNSWindow diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index 1d05db14b2..14a0c22d66 100644 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -90,6 +90,8 @@ void setWindowPos(NSWindowRef window, float* pos); void closeWindow(NSWindowRef window); void removeGLView(GLViewRef view); void makeFirstResponder(NSWindowRef window, GLViewRef view); +void setupInputWindow(NSWindowRef window, GLViewRef view); +void showInputWindow(bool show); // These are all implemented in llwindowmacosx.cpp. // This is largely for easier interop between Obj-C and C++ (at least in the viewer's case due to the BOOL vs. BOOL conflict) diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index 43f853bfd1..0eef8c9f83 100644 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -362,6 +362,16 @@ void removeGLView(GLViewRef view) [(LLOpenGLView*)view release]; } +void setupInputWindow(NSWindowRef window, GLViewRef glview) +{ + [[(LLAppDelegate*)[NSApp delegate] inputView] setGLView:(LLOpenGLView*)glview]; +} + +void showInputWindow(bool show) +{ + [(LLAppDelegate*)[NSApp delegate] showInputWindow:show]; +} + NSWindowRef getMainAppWindow() { LLNSWindow *winRef = [(LLAppDelegate*)[[NSApplication sharedApplication] delegate] window]; diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 6f66da66a4..2d0f981b3e 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -191,6 +191,8 @@ LLWindowMacOSX::LLWindowMacOSX(LLWindowCallbacks* callbacks, //start with arrow cursor initCursors(); setCursor( UI_CURSOR_ARROW ); + + allowLanguageTextInput(NULL, FALSE); } mCallbacks = callbacks; @@ -513,18 +515,22 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits // Get the view instead. mGLView = createOpenGLView(mWindow, mFSAASamples, !disable_vsync); mContext = getCGLContextObj(mGLView); + // Since we just created the context, it needs to be set up. glNeedsInit = TRUE; gGLManager.mVRAM = getVramSize(mGLView); } - + + // This sets up our view to recieve text from our non-inline text input window. + setupInputWindow(mWindow, mGLView); + // Hook up the context to a drawable if(mContext != NULL) { - LL_INFOS("Window") << "Setting CGL Context..." << LL_ENDL; - LL_DEBUGS("Window") << "createContext: setting current context" << LL_ENDL; + + U32 err = CGLSetCurrentContext(mContext); if (err != kCGLNoError) { @@ -1888,6 +1894,8 @@ void LLWindowMacOSX::allowLanguageTextInput(LLPreeditor *preeditor, BOOL b) return; } + showInputWindow(!b); + // Take care of old and new preeditors. if (preeditor != mPreeditor || !b) { diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib index f55ddaabcd..0b0ff5308b 100644 Binary files a/indra/newview/SecondLife.nib and b/indra/newview/SecondLife.nib differ diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib index 7d20b7fd7c..fdfea49c42 100644 --- a/indra/newview/SecondLife.xib +++ b/indra/newview/SecondLife.xib @@ -11,9 +11,13 @@ 3084 + IBNSLayoutConstraint NSCustomObject NSMenu NSMenuItem + NSScrollView + NSScroller + NSTextView NSView NSWindowTemplate @@ -340,6 +344,202 @@ 128 YES + + 31 + 2 + {{272, 176}, {938, 42}} + -1535638528 + Window + NSPanel + + + + + 256 + + + + 256 + + + + 2304 + + + + 2322 + + Apple HTML pasteboard type + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + Apple URL pasteboard type + CorePasteboardFlavorType 0x6D6F6F76 + NSColor pasteboard type + NSFilenamesPboardType + NSStringPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT RTFD pasteboard type + NeXT Rich Text Format v1.0 pasteboard type + NeXT TIFF v4.0 pasteboard type + NeXT font pasteboard type + NeXT ruler pasteboard type + WebURLsWithTitlesPboardType + public.url + + {938, 42} + + + + _NS:13 + + + + + + + + + + + + 166 + + + + 938 + 1 + + + 67121127 + 0 + + + 3 + MQA + + + + 6 + System + selectedTextBackgroundColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + selectedTextColor + + 3 + MAA + + + + + + + 1 + MCAwIDEAA + + + {8, -8} + 13 + + + + + + 1 + + 6 + {939, 10000000} + + + + {{1, 1}, {938, 42}} + + + + _NS:11 + + + + {4, 5} + + 79691776 + + + + + + file://localhost/Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Resources/DVTIbeamCursor.tiff + + + + + 3 + MCAwAA + + + + 4 + + + + 256 + {{923, 1}, {16, 42}} + + + + _NS:83 + NO + + _doScroller: + 0.96666666666666667 + + + + -2147483392 + {{-100, -100}, {87, 18}} + + + + _NS:33 + NO + 1 + + _doScroller: + 1 + 0.94565218687057495 + + + {{-1, -1}, {940, 44}} + + + + _NS:9 + 133138 + + + + 0.25 + 4 + 1 + + + {938, 42} + + + + _NS:21 + + {{0, 0}, {2560, 1440}} + {10000000000000, 10000000000000} + YES + @@ -471,6 +671,22 @@ 850 + + + inputWindow + + + + 953 + + + + inputView + + + + 954 + @@ -726,6 +942,131 @@ + + 941 + + + + + + + + 942 + + + + + + 4 + 0 + + 4 + 1 + + -1 + + 1000 + + 8 + 29 + 3 + + + + 6 + 0 + + 6 + 1 + + -1 + + 1000 + + 8 + 29 + 3 + + + + 3 + 0 + + 3 + 1 + + -1 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 5 + 1 + + -1 + + 1000 + + 8 + 29 + 3 + + + + + + 943 + + + + + + + + + + 944 + + + + + 945 + + + + + 946 + + + + + 949 + + + + + 950 + + + + + 951 + + + + + 952 + + + @@ -770,12 +1111,31 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + LLNonInlineTextView + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin - 940 + 954 @@ -783,13 +1143,18 @@ LLAppDelegate NSObject - LLOpenGLView + LLNonInlineTextView + NSWindow LLNSWindow - - glview - LLOpenGLView + + inputView + LLNonInlineTextView + + + inputWindow + NSWindow window @@ -810,11 +1175,11 @@ - LLOpenGLView - NSOpenGLView + LLNonInlineTextView + NSTextView IBProjectSource - ./Classes/LLOpenGLView.h + ./Classes/LLNonInlineTextView.h diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 5fb5087cd8..8da44fcf33 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -12,6 +12,8 @@ @implementation LLAppDelegate @synthesize window; +@synthesize inputWindow; +@synthesize inputView; - (void)dealloc { @@ -63,4 +65,17 @@ } } +- (void) showInputWindow:(bool)show +{ + if (show) + { + NSLog(@"Showing input window."); + [inputWindow makeKeyAndOrderFront:inputWindow]; + } else { + NSLog(@"Hiding input window."); + [inputWindow orderOut:inputWindow]; + [window makeKeyAndOrderFront:window]; + } +} + @end -- cgit v1.2.3 From 5098d43a9be5b9638a8806918e9bb82a096c000f Mon Sep 17 00:00:00 2001 From: Geenz Date: Mon, 1 Apr 2013 08:25:11 -0400 Subject: STORM-1941: Cocoa project viewer: some coordinate conversions are off (Katharine Berry) --- doc/contributions.txt | 2 ++ indra/llwindow/llwindowmacosx.cpp | 70 +++++---------------------------------- 2 files changed, 10 insertions(+), 62 deletions(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index e86ef11a72..f7f528e084 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -661,6 +661,8 @@ Kagehi Kohn Kaimen Takahe Katharine Berry STORM-1900 + STORM-1940 + STORM-1941 Keklily Longfall Ken Lavender Ken March diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 2d0f981b3e..4f6ae5c799 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1255,52 +1255,21 @@ LLWindow::LLWindowResolution* LLWindowMacOSX::getSupportedResolutions(S32 &num_r BOOL LLWindowMacOSX::convertCoords(LLCoordGL from, LLCoordWindow *to) { - S32 client_height; - float client_rect[4]; - getContentViewBounds(mWindow, client_rect); - if (!mWindow || - NULL == to) - { - return FALSE; - } - to->mX = from.mX; - client_height = client_rect[3]; - to->mY = from.mY - 1; - + to->mY = from.mY; return TRUE; } BOOL LLWindowMacOSX::convertCoords(LLCoordWindow from, LLCoordGL* to) { - S32 client_height; - float client_rect[4]; - - getContentViewBounds(mWindow, client_rect); - - if (!mWindow || - NULL == to) - { - return FALSE; - } - to->mX = from.mX; - client_height = client_rect[3]; - to->mY = from.mY - 1; - + to->mY = from.mY; return TRUE; } BOOL LLWindowMacOSX::convertCoords(LLCoordScreen from, LLCoordWindow* to) { - if(mFullscreen) - { - // In the fullscreen case, window and screen coordinates are the same. - to->mX = from.mX; - to->mY = from.mY; - return TRUE; - } - else if(mWindow) + if(mWindow) { float mouse_point[2]; @@ -1314,20 +1283,12 @@ BOOL LLWindowMacOSX::convertCoords(LLCoordScreen from, LLCoordWindow* to) return TRUE; } - return FALSE; } BOOL LLWindowMacOSX::convertCoords(LLCoordWindow from, LLCoordScreen *to) { - if(mFullscreen) - { - // In the fullscreen case, window and screen coordinates are the same. - to->mX = from.mX; - to->mY = from.mY; - return TRUE; - } - else if(mWindow) + if(mWindow) { float mouse_point[2]; @@ -1340,7 +1301,6 @@ BOOL LLWindowMacOSX::convertCoords(LLCoordWindow from, LLCoordScreen *to) return TRUE; } - return FALSE; } @@ -1354,22 +1314,8 @@ BOOL LLWindowMacOSX::convertCoords(LLCoordScreen from, LLCoordGL *to) BOOL LLWindowMacOSX::convertCoords(LLCoordGL from, LLCoordScreen *to) { LLCoordWindow window_coord; - if (mFullscreen) - { - to->mX = from.mX; - to->mY = from.mY; - return TRUE; - } else if (mWindow) - { - convertCoords(from, &window_coord); - convertCoords(window_coord, to); - - LL_INFOS("Coords") << to->mX << ", " << to->mY << LL_ENDL; - - return TRUE; - } - return FALSE; + return(convertCoords(from, &window_coord) && convertCoords(window_coord, to)); } @@ -1981,11 +1927,11 @@ void LLWindowMacOSX::handleDragNDrop(std::string url, LLWindowCallbacks::DragNDr MASK mask = LLWindowMacOSX::modifiersToMask(getModifiers()); float mouse_point[2]; - // This will return the mouse point in global screen coords + // This will return the mouse point in window coords getCursorPos(mWindow, mouse_point); - LLCoordScreen screen_coords(mouse_point[0], mouse_point[1]); + LLCoordWindow window_coords(mouse_point[0], mouse_point[1]); LLCoordGL gl_pos; - convertCoords(screen_coords, &gl_pos); + convertCoords(window_coords, &gl_pos); if(!url.empty()) { -- cgit v1.2.3 From bdf8cacc4cd216d7df8212177587a21979d2a883 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 1 Apr 2013 14:35:12 -0700 Subject: MAINT-2511 : Mesh requests not handling time outs. Reviewed by Kelly --- indra/newview/llmeshrepository.cpp | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 809f85a7b5..5154809240 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -288,7 +288,14 @@ public: ~LLMeshSkinInfoResponder() { - //llassert(mProcessed); this will assert due to a timeout (not handled?) MAINT-2511 + if (!LLApp::isQuitting() && + !mProcessed && + mMeshID.notNull()) + { // Something went wrong, retry + llwarns << "Timeout or service unavailable, retrying loadMeshSkinInfo() for " << mMeshID << llendl; + LLMeshRepository::sHTTPRetryCount++; + gMeshRepo.mThread->loadMeshSkinInfo(mMeshID); + } } virtual void completedRaw(U32 status, const std::string& reason, @@ -313,7 +320,14 @@ public: ~LLMeshDecompositionResponder() { - //llassert(mProcessed); this will assert due to a timeout (not handled?) MAINT-2511 + if (!LLApp::isQuitting() && + !mProcessed && + mMeshID.notNull()) + { // Something went wrong, retry + llwarns << "Timeout or service unavailable, retrying loadMeshDecomposition() for " << mMeshID << llendl; + LLMeshRepository::sHTTPRetryCount++; + gMeshRepo.mThread->loadMeshDecomposition(mMeshID); + } } virtual void completedRaw(U32 status, const std::string& reason, @@ -338,7 +352,14 @@ public: ~LLMeshPhysicsShapeResponder() { - //llassert(mProcessed); this will assert due to a timeout (not handled?) MAINT-2511 + if (!LLApp::isQuitting() && + !mProcessed && + mMeshID.notNull()) + { // Something went wrong, retry + llwarns << "Timeout or service unavailable, retrying loadMeshPhysicsShape() for " << mMeshID << llendl; + LLMeshRepository::sHTTPRetryCount++; + gMeshRepo.mThread->loadMeshPhysicsShape(mMeshID); + } } virtual void completedRaw(U32 status, const std::string& reason, @@ -1984,7 +2005,7 @@ void LLMeshSkinInfoResponder::completedRaw(U32 status, const std::string& reason { if (status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE) { //timeout or service unavailable, try again - llwarns << "Timeout or service unavailable, retrying." << llendl; + llwarns << "Timeout or service unavailable, retrying loadMeshSkinInfo() for " << mMeshID << llendl; LLMeshRepository::sHTTPRetryCount++; gMeshRepo.mThread->loadMeshSkinInfo(mMeshID); } @@ -2047,7 +2068,7 @@ void LLMeshDecompositionResponder::completedRaw(U32 status, const std::string& r { if (status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE) { //timeout or service unavailable, try again - llwarns << "Timeout or service unavailable, retrying." << llendl; + llwarns << "Timeout or service unavailable, retrying loadMeshDecomposition() for " << mMeshID << llendl; LLMeshRepository::sHTTPRetryCount++; gMeshRepo.mThread->loadMeshDecomposition(mMeshID); } @@ -2111,7 +2132,7 @@ void LLMeshPhysicsShapeResponder::completedRaw(U32 status, const std::string& re { if (status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE) { //timeout or service unavailable, try again - llwarns << "Timeout or service unavailable, retrying." << llendl; + llwarns << "Timeout or service unavailable, retrying loadMeshPhysicsShape() for " << mMeshID << llendl; LLMeshRepository::sHTTPRetryCount++; gMeshRepo.mThread->loadMeshPhysicsShape(mMeshID); } -- cgit v1.2.3 From 4fe3e00aad663d1afd35007b4e8093ae4e58e92e Mon Sep 17 00:00:00 2001 From: Cho Date: Tue, 2 Apr 2013 02:10:04 +0100 Subject: added request to /get-friends/ after FB login --- indra/newview/llpanelpeople.cpp | 67 +++++++++++++++++++++++++++++++++++------ indra/newview/llpanelpeople.h | 3 ++ 2 files changed, 61 insertions(+), 9 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 01d68cb9a0..87bede76bc 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -896,8 +896,11 @@ void LLPanelPeople::updateFbcTestList() { // success! :) if (title[1] == ')') - { + { mFbcTestText->setText(std::string("okay, now we can get the list of friends!")); + + // get the friends + getFacebookFriends(); } // failure :( else if (title[1] == '(') @@ -1665,13 +1668,28 @@ void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p) } } -class LLFacebookLogin : public LLHTTPClient::Responder +void LLPanelPeople::showFacebookFriends(const LLSD& friends) +{ + std::string text = "Facebook Friends"; + for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i) + { + std::string name = (*i)["name"].asString(); + std::string id = (*i)["id"].asString(); + + text += "\n" + name + " (" + id + ")"; + } + + // display the facebook friend data on the test text box + mFbcTestText->setText(text); +} + +class FacebookLoginResponder : public LLHTTPClient::Responder { public: LLPanelPeople * mPanelPeople; - LLFacebookLogin(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {} + FacebookLoginResponder(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {} /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) { @@ -1686,15 +1704,41 @@ public: //use the token to pull down graph data if(has_token) { - + mPanelPeople->getFacebookFriends(); } //request user to login else { - LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/authenticate/" + gAgentID.asString()); + LLFloaterWebContent::Params p; + p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/authenticate/" + gAgentID.asString()); mPanelPeople->openFacebookWeb(p); -} + } + } + else + { + llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl; + } + } +}; + +class FacebookFriendsResponder : public LLHTTPClient::Responder +{ +public: + + LLPanelPeople * mPanelPeople; + + FacebookFriendsResponder(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {} + + /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) + { + // in case of invalid characters, the avatar picker returns a 400 + // just set it to process so it displays 'not found' + if (isGoodStatus(status) || status == 400) + { + llinfos << content << llendl; + + // display the friend data + mPanelPeople->showFacebookFriends(content["friends"]); } else { @@ -1703,9 +1747,14 @@ public: } }; +void LLPanelPeople::getFacebookFriends() +{ + LLHTTPClient::get(FBC_SERVICES_URL + "/get-friends/" + gAgentID.asString(), new FacebookFriendsResponder(this)); +} + void LLPanelPeople::onLoginFbcButtonClicked() { - LLHTTPClient::get("https://pdp15.lindenlab.com/has-access-token/" + gAgentID.asString(), new LLFacebookLogin(this)); + LLHTTPClient::get(FBC_SERVICES_URL + "/has-access-token/" + gAgentID.asString(), new FacebookLoginResponder(this)); } void LLPanelPeople::onFacebookAppRequestClicked() @@ -1718,7 +1767,7 @@ void LLPanelPeople::onFacebookAppRequestClicked() void LLPanelPeople::onFacebookAppSendClicked() { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Test&link=http://www.cnet.com&redirect_uri=" + FBC_SERVICES_URL); + p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + FBC_SERVICES_URL); openFacebookWeb(p); } // EOF diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index dadd273603..86bcac3ede 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -55,7 +55,10 @@ public: // Implements LLVoiceClientStatusObserver::onChange() to enable call buttons // when voice is available /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal); + void openFacebookWeb(LLFloaterWebContent::Params& p); + void showFacebookFriends(const LLSD& friends); + void getFacebookFriends(); // internals class Updater; -- cgit v1.2.3 From 0a4ab0c64790b82edba369891a1983cd4b7f84f2 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 1 Apr 2013 23:08:16 -0700 Subject: Some not so clean code to use to show facebook friends using the existing avatar list. --- indra/newview/llavatarlist.cpp | 36 +++++++++++++++++++++ indra/newview/llavatarlist.h | 27 +++++++++++++--- indra/newview/llpanelpeople.cpp | 37 ++++------------------ indra/newview/llpanelpeople.h | 2 ++ .../newview/skins/default/xui/en/panel_people.xml | 36 +++++++++++++++++---- 5 files changed, 96 insertions(+), 42 deletions(-) diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 771419f60a..37de2d5793 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -624,3 +624,39 @@ void LLAvalineListItem::setName(const std::string& name) LLAvatarListItem::setAvatarToolTip(formatted_phone); } } + +/************************************************************************/ +/* class LLAvatarListSocial */ +/************************************************************************/ + +static LLDefaultChildRegistry::Register s("avatar_list_social"); + +LLAvatarListSocial::LLAvatarListSocial(const Params& p) : LLAvatarList(p) +{ + +} + +void LLAvatarListSocial::addSocialItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos) +{ + LLAvatarListItem* item = new LLAvatarListItem(); + // This sets the name as a side effect + item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus, false); + item->setAvatarName(name); + item->setOnline(mIgnoreOnlineStatus ? true : is_online); + item->showLastInteractionTime(mShowLastInteractionTime); + + item->setAvatarIconVisible(mShowIcons); + item->setShowInfoBtn(mShowInfoBtn); + item->setShowProfileBtn(mShowProfileBtn); + item->showSpeakingIndicator(mShowSpeakingIndicator); + item->setShowPermissions(mShowPermissions); + + item->setDoubleClickCallback(boost::bind(&LLAvatarListSocial::onItemDoubleClicked, this, _1, _2, _3, _4)); + + addItem(item, id, pos); +} + +void LLAvatarListSocial::refresh() +{ + +} diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h index 4814a88a79..cbe5956493 100644 --- a/indra/newview/llavatarlist.h +++ b/indra/newview/llavatarlist.h @@ -97,10 +97,12 @@ public: void addAvalineItem(const LLUUID& item_id, const LLUUID& session_id, const std::string& item_name); void handleDisplayNamesOptionChanged(); -protected: - void refresh(); + - void addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos = ADD_BOTTOM); +protected: + virtual void refresh(); + virtual void addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos = ADD_BOTTOM); + void computeDifference( const uuid_vec_t& vnew, uuid_vec_t& vadded, @@ -110,8 +112,6 @@ protected: void onItemDoubleClicked(LLUICtrl* ctrl, S32 x, S32 y, MASK mask); void updateAvatarNames(); -private: - bool isAvalineItemSelected(); bool mIgnoreOnlineStatus; @@ -205,4 +205,21 @@ private: bool mIsHideNumber; }; +class LLAvatarListSocial : public LLAvatarList +{ + public: + struct Params : public LLInitParam::Block + { + + }; + + LLAvatarListSocial(const Params&); + + void addSocialItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos = ADD_BOTTOM); + + protected: + /*virtual*/ void refresh(); +}; + + #endif // LL_LLAVATARLIST_H diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 01d68cb9a0..7a3e6abb7f 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -647,7 +647,9 @@ BOOL LLPanelPeople::postBuild() mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu); mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu); - mFbcTestText = getChild(FBCTEST_TAB_NAME)->getChild("fbctest_label"); + LLPanel * social_tab = getChild(FBCTEST_TAB_NAME); + social_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFbcTestListUpdater, _2)); + mFacebookFriends = social_tab->getChild("facebook_friends"); setSortOrder(mRecentList, (ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"), false); setSortOrder(mAllFriendList, (ESortOrder)gSavedSettings.getU32("FriendsSortOrder"), false); @@ -883,35 +885,10 @@ void LLPanelPeople::updateRecentList() void LLPanelPeople::updateFbcTestList() { - if (!mFbcTestText) - return; - - if (mFbcTestBrowserHandle.get()) - { - // get the browser data (from the title bar, of course!) - std::string title = mFbcTestBrowserHandle.get()->getTitle(); - - // if the data is ready (if it says the magic word) - if (title.length() >= 2 && title[0] == ':') - { - // success! :) - if (title[1] == ')') - { - mFbcTestText->setText(std::string("okay, now we can get the list of friends!")); - } - // failure :( - else if (title[1] == '(') - { - mFbcTestText->setText(std::string("hmm, the authentication failed somehow")); - } - - // close the browser window - mFbcTestBrowserHandle.get()->die(); - - // stop updating - mFbcTestListUpdater->setActive(false); - } - } + mFacebookFriends->addSocialItem(LLUUID(), "TEST", false); + + // stop updating + mFbcTestListUpdater->setActive(false); } void LLPanelPeople::buttonSetVisible(std::string btn_name, BOOL visible) diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index dadd273603..a00b5be516 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -34,6 +34,7 @@ #include "llvoiceclient.h" class LLAvatarList; +class LLAvatarListSocial; class LLAvatarName; class LLFilterEditor; class LLGroupList; @@ -149,6 +150,7 @@ private: LLAvatarList* mNearbyList; LLAvatarList* mRecentList; LLGroupList* mGroupList; + LLAvatarListSocial* mFacebookFriends; LLNetMap* mMiniMap; LLTextBox* mFbcTestText; diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index cbb6aff4ea..f3334fd767 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -585,14 +585,36 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M name="fbctest_panel" top="0" width="313"> - + + height="172" + min_height="150" + name="tab_facebook" + title="Facebook Friends"> + + + Date: Mon, 1 Apr 2013 23:48:51 -0700 Subject: removing the facebook test label which appends friends names. Now using the avatar list widgit. --- indra/newview/llpanelpeople.cpp | 15 +++------------ indra/newview/llpanelpeople.h | 2 -- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 05dcdd97fa..c7e10d67db 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -545,7 +545,6 @@ LLPanelPeople::LLPanelPeople() mNearbyList(NULL), mRecentList(NULL), mGroupList(NULL), - mFbcTestText(NULL), mNearbyGearButton(NULL), mFriendsGearButton(NULL), mGroupsGearButton(NULL), @@ -648,7 +647,6 @@ BOOL LLPanelPeople::postBuild() mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu); LLPanel * social_tab = getChild(FBCTEST_TAB_NAME); - social_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFbcTestListUpdater, _2)); mFacebookFriends = social_tab->getChild("facebook_friends"); setSortOrder(mRecentList, (ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"), false); @@ -885,9 +883,6 @@ void LLPanelPeople::updateRecentList() void LLPanelPeople::updateFbcTestList() { - if (!mFbcTestText) - return; - if (mFbcTestBrowserHandle.get()) { // get the browser data (from the title bar, of course!) @@ -899,15 +894,13 @@ void LLPanelPeople::updateFbcTestList() // success! :) if (title[1] == ')') { - mFbcTestText->setText(std::string("okay, now we can get the list of friends!")); - // get the friends getFacebookFriends(); } // failure :( else if (title[1] == '(') { - mFbcTestText->setText(std::string("hmm, the authentication failed somehow")); + llinfos << "authentication failed" << llendl; } // close the browser window @@ -1678,11 +1671,9 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) std::string name = (*i)["name"].asString(); std::string id = (*i)["id"].asString(); - text += "\n" + name + " (" + id + ")"; + text = name + " (" + id + ")"; + mFacebookFriends->addSocialItem(LLUUID(NULL), text, false); } - - // display the facebook friend data on the test text box - mFbcTestText->setText(text); } class FacebookLoginResponder : public LLHTTPClient::Responder diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index dab5d74f77..45ed7e1039 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -155,8 +155,6 @@ private: LLGroupList* mGroupList; LLAvatarListSocial* mFacebookFriends; LLNetMap* mMiniMap; - - LLTextBox* mFbcTestText; LLHandle mGroupPlusMenuHandle; LLHandle mNearbyViewSortMenuHandle; -- cgit v1.2.3 From 37b57559538aede47d46274208a6974d93caad1c Mon Sep 17 00:00:00 2001 From: Cho Date: Tue, 2 Apr 2013 21:07:46 +0100 Subject: updated to work with new /get-friends/ response format --- indra/newview/llavatarlist.cpp | 10 ++++++---- indra/newview/llpanelpeople.cpp | 34 +++++++++++++++++++++------------- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 37de2d5793..a407515621 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -626,7 +626,7 @@ void LLAvalineListItem::setName(const std::string& name) } /************************************************************************/ -/* class LLAvatarListSocial */ +/* class LLAvatarListSocial */ /************************************************************************/ static LLDefaultChildRegistry::Register s("avatar_list_social"); @@ -638,10 +638,12 @@ LLAvatarListSocial::LLAvatarListSocial(const Params& p) : LLAvatarList(p) void LLAvatarListSocial::addSocialItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos) { + LLAvatarName avatar_name; + bool has_avatar_name = id.notNull() && LLAvatarNameCache::get(id, &avatar_name); + LLAvatarListItem* item = new LLAvatarListItem(); - // This sets the name as a side effect - item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus, false); - item->setAvatarName(name); + item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus, false); // this sets the name as a side effect + item->setAvatarName(has_avatar_name ? avatar_name.mDisplayName : name); item->setOnline(mIgnoreOnlineStatus ? true : is_online); item->showLastInteractionTime(mShowLastInteractionTime); diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index c7e10d67db..183714b436 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1665,14 +1665,16 @@ void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p) void LLPanelPeople::showFacebookFriends(const LLSD& friends) { - std::string text = "Facebook Friends"; + mFacebookFriends->clear(); + for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i) { - std::string name = (*i)["name"].asString(); - std::string id = (*i)["id"].asString(); + const LLSD& fb_friend = *i; - text = name + " (" + id + ")"; - mFacebookFriends->addSocialItem(LLUUID(NULL), text, false); + std::string name = fb_friend["name"].asString(); + LLUUID agent_id = fb_friend.has("agent_id") ? fb_friend["agent_id"].asUUID() : LLUUID(NULL); + + mFacebookFriends->addSocialItem(agent_id, name, false); } } @@ -1692,20 +1694,19 @@ public: { llinfos << content << llendl; + // use the token to pull down graph data bool has_token = content["has_access_token"].asBoolean(); - - //use the token to pull down graph data - if(has_token) + if (has_token) { mPanelPeople->getFacebookFriends(); } - //request user to login + // request user to login else { - LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/authenticate/" + gAgentID.asString()); + LLFloaterWebContent::Params p; + p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/authenticate/" + gAgentID.asString()); mPanelPeople->openFacebookWeb(p); -} + } } else { @@ -1731,7 +1732,14 @@ public: llinfos << content << llendl; // display the friend data - mPanelPeople->showFacebookFriends(content["friends"]); + if (content.has("friends")) + { + mPanelPeople->showFacebookFriends(content["friends"]); + } + else if (content.has("error")) + { + llinfos << "failed to get facebook friends. reason: " << content["error"] << llendl; + } } else { -- cgit v1.2.3 From 0c55af934d19145993c6ec0756397fa75f9a9842 Mon Sep 17 00:00:00 2001 From: Cho Date: Tue, 2 Apr 2013 21:46:00 +0100 Subject: added display of FB name to SL user in FBCTEST list --- indra/newview/llavatarlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index a407515621..fb6d042807 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -643,7 +643,7 @@ void LLAvatarListSocial::addSocialItem(const LLUUID& id, const std::string& name LLAvatarListItem* item = new LLAvatarListItem(); item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus, false); // this sets the name as a side effect - item->setAvatarName(has_avatar_name ? avatar_name.mDisplayName : name); + item->setAvatarName(has_avatar_name ? avatar_name.mDisplayName + " (" + name + ")" : name); item->setOnline(mIgnoreOnlineStatus ? true : is_online); item->showLastInteractionTime(mShowLastInteractionTime); -- cgit v1.2.3 From caad92499e2a2f8419e4c217c74f54cf4f2be54c Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 3 Apr 2013 01:10:19 +0100 Subject: updated to account for new routes in FBC Services --- indra/newview/llpanelpeople.cpp | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 183714b436..d2e764df13 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1678,33 +1678,31 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) } } -class FacebookLoginResponder : public LLHTTPClient::Responder +class FacebookConnectedResponder : public LLHTTPClient::Responder { public: LLPanelPeople * mPanelPeople; + bool mShowLoginIfNotConnected; - FacebookLoginResponder(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {} + FacebookConnectedResponder(LLPanelPeople * panel_people, bool show_login_if_not_connected) : mPanelPeople(panel_people), mShowLoginIfNotConnected(show_login_if_not_connected) {} /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) { - // in case of invalid characters, the avatar picker returns a 400 - // just set it to process so it displays 'not found' - if (isGoodStatus(status) || status == 400) + if (isGoodStatus(status)) { llinfos << content << llendl; - // use the token to pull down graph data - bool has_token = content["has_access_token"].asBoolean(); - if (has_token) + // pull down graph data if already contected + if (content["connected"]) { mPanelPeople->getFacebookFriends(); } - // request user to login - else + // show the facebook login page + else if (mShowLoginIfNotConnected) { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/authenticate/" + gAgentID.asString()); + p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect"); mPanelPeople->openFacebookWeb(p); } } @@ -1725,9 +1723,7 @@ public: /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) { - // in case of invalid characters, the avatar picker returns a 400 - // just set it to process so it displays 'not found' - if (isGoodStatus(status) || status == 400) + if (isGoodStatus(status)) { llinfos << content << llendl; @@ -1738,7 +1734,7 @@ public: } else if (content.has("error")) { - llinfos << "failed to get facebook friends. reason: " << content["error"] << llendl; + llinfos << "failed to get facebook friends. reason: " << content["error"]["message"] << llendl; } } else @@ -1750,25 +1746,25 @@ public: void LLPanelPeople::getFacebookFriends() { - LLHTTPClient::get(FBC_SERVICES_URL + "/get-friends/" + gAgentID.asString(), new FacebookFriendsResponder(this)); + LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/friends", new FacebookFriendsResponder(this)); } void LLPanelPeople::onLoginFbcButtonClicked() { - LLHTTPClient::get(FBC_SERVICES_URL + "/has-access-token/" + gAgentID.asString(), new FacebookLoginResponder(this)); + LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connected", new FacebookConnectedResponder(this, true)); } void LLPanelPeople::onFacebookAppRequestClicked() { LLFloaterWebContent::Params p; - p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + FBC_SERVICES_URL); + p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=https://secondlife.com/"); openFacebookWeb(p); } void LLPanelPeople::onFacebookAppSendClicked() { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + FBC_SERVICES_URL); + p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=https://secondlife.com/"); openFacebookWeb(p); } // EOF -- cgit v1.2.3 From 21e8d2ca30842422eb5eef469c9e1bb91c0c847b Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 3 Apr 2013 02:11:11 +0100 Subject: updated to use POST for connect and disconnect, instead of Webkit --- indra/newview/llpanelpeople.cpp | 132 ++++++++++++++++++++++++++++++++-------- indra/newview/llpanelpeople.h | 7 ++- 2 files changed, 112 insertions(+), 27 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index d2e764df13..ebf7002fc1 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -536,6 +536,7 @@ private: LLPanelPeople::LLPanelPeople() : LLPanel(), + mConnectedToFbc(false), mFilterSubString(LLStringUtil::null), mFilterSubStringOrig(LLStringUtil::null), mFilterEditor(NULL), @@ -885,23 +886,17 @@ void LLPanelPeople::updateFbcTestList() { if (mFbcTestBrowserHandle.get()) { - // get the browser data (from the title bar, of course!) - std::string title = mFbcTestBrowserHandle.get()->getTitle(); + // get the current browser url (from the title bar, of course!) + std::string url = mFbcTestBrowserHandle.get()->getTitle(); - // if the data is ready (if it says the magic word) - if (title.length() >= 2 && title[0] == ':') + // if the browser has redirected from facebook + if (url.substr(0, FBC_SERVICES_URL.length()) == FBC_SERVICES_URL) { - // success! :) - if (title[1] == ')') - { - // get the friends - getFacebookFriends(); - } - // failure :( - else if (title[1] == '(') - { - llinfos << "authentication failed" << llendl; - } + // get the auth code + std::string auth_code = url.substr(FBC_SERVICES_URL.length() + 6); + + // finish authenticating on the server + connectToFacebook(auth_code); // close the browser window mFbcTestBrowserHandle.get()->die(); @@ -1669,15 +1664,82 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i) { - const LLSD& fb_friend = *i; - - std::string name = fb_friend["name"].asString(); - LLUUID agent_id = fb_friend.has("agent_id") ? fb_friend["agent_id"].asUUID() : LLUUID(NULL); + std::string name = (*i)["name"].asString(); + LLUUID agent_id = (*i).has("agent_id") ? (*i)["agent_id"].asUUID() : LLUUID(NULL); mFacebookFriends->addSocialItem(agent_id, name, false); } } +void LLPanelPeople::hideFacebookFriends() +{ + mFacebookFriends->clear(); +} + +class FacebookConnectResponder : public LLHTTPClient::Responder +{ +public: + + LLPanelPeople * mPanelPeople; + + FacebookConnectResponder(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {} + + /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) + { + if (isGoodStatus(status)) + { + llinfos << content << llendl; + + // grab some graph data now that we are connected + if (content["success"]) + { + mPanelPeople->mConnectedToFbc = true; + mPanelPeople->loadFacebookFriends(); + } + else if (content.has("error")) + { + llinfos << "failed to connect. reason: " << content["error"]["message"] << llendl; + } + } + else + { + llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl; + } + } +}; + +class FacebookDisconnectResponder : public LLHTTPClient::Responder +{ +public: + + LLPanelPeople * mPanelPeople; + + FacebookDisconnectResponder(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {} + + /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) + { + if (isGoodStatus(status)) + { + llinfos << content << llendl; + + // hide all the facebook stuff + if (content["success"]) + { + mPanelPeople->mConnectedToFbc = false; + mPanelPeople->hideFacebookFriends(); + } + else if (content.has("error")) + { + llinfos << "failed to disconnect. reason: " << content["error"]["message"] << llendl; + } + } + else + { + llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl; + } + } +}; + class FacebookConnectedResponder : public LLHTTPClient::Responder { public: @@ -1693,16 +1755,17 @@ public: { llinfos << content << llendl; - // pull down graph data if already contected + // grab some graph data if already connected if (content["connected"]) { - mPanelPeople->getFacebookFriends(); + mPanelPeople->mConnectedToFbc = true; + mPanelPeople->loadFacebookFriends(); } - // show the facebook login page + // show the facebook login page if not connected yet else if (mShowLoginIfNotConnected) { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect"); + p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL); mPanelPeople->openFacebookWeb(p); } } @@ -1727,7 +1790,7 @@ public: { llinfos << content << llendl; - // display the friend data + // display the list of friends if (content.has("friends")) { mPanelPeople->showFacebookFriends(content["friends"]); @@ -1744,14 +1807,31 @@ public: } }; -void LLPanelPeople::getFacebookFriends() +void LLPanelPeople::loadFacebookFriends() { LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/friends", new FacebookFriendsResponder(this)); } +void LLPanelPeople::connectToFacebook(const std::string& auth_code) +{ + LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect/" + auth_code, LLSD(), new FacebookConnectResponder(this)); +} + +void LLPanelPeople::disconnectFromFacebook() +{ + LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/disconnect", LLSD(), new FacebookDisconnectResponder(this)); +} + void LLPanelPeople::onLoginFbcButtonClicked() { - LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connected", new FacebookConnectedResponder(this, true)); + if (mConnectedToFbc) + { + disconnectFromFacebook(); + } + else + { + LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connected", new FacebookConnectedResponder(this, true)); + } } void LLPanelPeople::onFacebookAppRequestClicked() diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 45ed7e1039..914899ca6d 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -59,7 +59,12 @@ public: void openFacebookWeb(LLFloaterWebContent::Params& p); void showFacebookFriends(const LLSD& friends); - void getFacebookFriends(); + void hideFacebookFriends(); + void loadFacebookFriends(); + void connectToFacebook(const std::string& auth_code); + void disconnectFromFacebook(); + + bool mConnectedToFbc; // internals class Updater; -- cgit v1.2.3 From 207db356c21246ca9eb1b255b71623b0a5a4d470 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 3 Apr 2013 03:06:24 +0100 Subject: got it working --- indra/newview/llpanelpeople.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index ebf7002fc1..4b4dd27bf2 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -893,7 +893,10 @@ void LLPanelPeople::updateFbcTestList() if (url.substr(0, FBC_SERVICES_URL.length()) == FBC_SERVICES_URL) { // get the auth code - std::string auth_code = url.substr(FBC_SERVICES_URL.length() + 6); + std::string auth_code = url.substr(FBC_SERVICES_URL.length() + 7); + auth_code = auth_code.substr(0, auth_code.length() - 4); + + llinfos << "extracted code " << auth_code << " from url " << url << llendl; // finish authenticating on the server connectToFacebook(auth_code); @@ -1765,7 +1768,7 @@ public: else if (mShowLoginIfNotConnected) { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL); + p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/"); mPanelPeople->openFacebookWeb(p); } } @@ -1814,6 +1817,7 @@ void LLPanelPeople::loadFacebookFriends() void LLPanelPeople::connectToFacebook(const std::string& auth_code) { + llinfos << "attempting to connect to facebook with code " << auth_code << llendl; LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect/" + auth_code, LLSD(), new FacebookConnectResponder(this)); } @@ -1837,14 +1841,14 @@ void LLPanelPeople::onLoginFbcButtonClicked() void LLPanelPeople::onFacebookAppRequestClicked() { LLFloaterWebContent::Params p; - p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=https://secondlife.com/"); + p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + FBC_SERVICES_URL); openFacebookWeb(p); } void LLPanelPeople::onFacebookAppSendClicked() { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=https://secondlife.com/"); + p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + FBC_SERVICES_URL); openFacebookWeb(p); } // EOF -- cgit v1.2.3 From ae4dcb2d1cade521f4cb116e3b7aa79475c38cc6 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 2 Apr 2013 19:34:44 -0700 Subject: created LLSocialList and LLSocialListItem and linked them up to the facebook tab. --- indra/newview/CMakeLists.txt | 2 + indra/newview/llpanelpeople.cpp | 5 +- indra/newview/llpanelpeople.h | 3 +- indra/newview/llsociallist.cpp | 130 +++++++++++++++++++++ indra/newview/llsociallist.h | 98 ++++++++++++++++ .../newview/skins/default/xui/en/panel_people.xml | 2 +- 6 files changed, 236 insertions(+), 4 deletions(-) create mode 100644 indra/newview/llsociallist.cpp create mode 100644 indra/newview/llsociallist.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index dff2c04fbc..b303ff3d18 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -483,6 +483,7 @@ set(viewer_SOURCE_FILES llsidetraypanelcontainer.cpp llsky.cpp llslurl.cpp + llsociallist.cpp llspatialpartition.cpp llspeakers.cpp llspeakingindicatormanager.cpp @@ -1050,6 +1051,7 @@ set(viewer_HEADER_FILES llsidetraypanelcontainer.h llsky.h llslurl.h + llsociallist.h llspatialpartition.h llspeakers.h llspeakingindicatormanager.h diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 4b4dd27bf2..cbc5eba65f 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -63,6 +63,7 @@ #include "llviewermenu.h" // for gMenuHolder #include "llvoiceclient.h" #include "llworld.h" +#include "llsociallist.h" #include "llspeakers.h" #include "llfloaterwebcontent.h" @@ -648,7 +649,7 @@ BOOL LLPanelPeople::postBuild() mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu); LLPanel * social_tab = getChild(FBCTEST_TAB_NAME); - mFacebookFriends = social_tab->getChild("facebook_friends"); + mFacebookFriends = social_tab->getChild("facebook_friends"); setSortOrder(mRecentList, (ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"), false); setSortOrder(mAllFriendList, (ESortOrder)gSavedSettings.getU32("FriendsSortOrder"), false); @@ -1670,7 +1671,7 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) std::string name = (*i)["name"].asString(); LLUUID agent_id = (*i).has("agent_id") ? (*i)["agent_id"].asUUID() : LLUUID(NULL); - mFacebookFriends->addSocialItem(agent_id, name, false); + mFacebookFriends->addNewItem(agent_id, name, false); } } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 914899ca6d..d61eb80f57 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -38,6 +38,7 @@ class LLAvatarListSocial; class LLAvatarName; class LLFilterEditor; class LLGroupList; +class LLSocialList; class LLMenuButton; class LLTabContainer; @@ -158,7 +159,7 @@ private: LLAvatarList* mNearbyList; LLAvatarList* mRecentList; LLGroupList* mGroupList; - LLAvatarListSocial* mFacebookFriends; + LLSocialList* mFacebookFriends; LLNetMap* mMiniMap; LLHandle mGroupPlusMenuHandle; diff --git a/indra/newview/llsociallist.cpp b/indra/newview/llsociallist.cpp new file mode 100644 index 0000000000..3d1d256149 --- /dev/null +++ b/indra/newview/llsociallist.cpp @@ -0,0 +1,130 @@ +sDestroyImmediate +/** +* @file llsociallist.cpp +* @brief Implementation of llsociallist +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + + +#include "llviewerprecompiledheaders.h" + +#include "llsociallist.h" + +#include "llavatariconctrl.h" +#include "lloutputmonitorctrl.h" +#include "lltextutil.h" + +static LLDefaultChildRegistry::Register r("social_list"); + +LLSocialList::LLSocialList(const Params&p) : LLFlatListViewEx(p) +{ + +} + +LLSocialList::~LLSocialList() +{ + +} + +void LLSocialList::draw() +{ + LLFlatListView::draw(); +} + +void LLSocialList::refresh() +{ + +} + +void LLSocialList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos) +{ + LLSocialListItem * item = new LLSocialListItem(); + item->setName(name, mNameFilter); + addItem(item, id, pos); +} + +LLSocialListItem::LLSocialListItem() +{ + buildFromFile("panel_avatar_list_item.xml"); +} + +LLSocialListItem::~LLSocialListItem() +{ + +} + +BOOL LLSocialListItem::postBuild() +{ + mIcon = getChild("avatar_icon"); + mLabelTextBox = getChild("avatar_name"); + + mLastInteractionTime = getChild("last_interaction"); + mIconPermissionOnline = getChild("permission_online_icon"); + mIconPermissionMap = getChild("permission_map_icon"); + mIconPermissionEditMine = getChild("permission_edit_mine_icon"); + mIconPermissionEditTheirs = getChild("permission_edit_theirs_icon"); + mSpeakingIndicator = getChild("speaking_indicator"); + mInfoBtn = getChild("info_btn"); + mProfileBtn = getChild("profile_btn"); + + mLastInteractionTime->setVisible(false); + mIconPermissionOnline->setVisible(false); + mIconPermissionMap->setVisible(false); + mIconPermissionEditMine->setVisible(false); + mIconPermissionEditTheirs->setVisible(false); + mSpeakingIndicator->setVisible(false); + mInfoBtn->setVisible(false); + mProfileBtn->setVisible(false); + + return TRUE; +} + +void LLSocialListItem::setName(const std::string& name, const std::string& highlight) +{ + mLabel = name; + LLTextUtil::textboxSetHighlightedVal(mLabelTextBox, mLabelTextBoxStyle, name, highlight); +} + +void LLSocialListItem::setValue(const LLSD& value) +{ + getChildView("selected_icon")->setVisible( value["selected"]); +} + +void LLSocialListItem::onMouseEnter(S32 x, S32 y, MASK mask) +{ + getChildView("hovered_icon")->setVisible( true); + mInfoBtn->setVisible(true); + mProfileBtn->setVisible(true); + + LLPanel::onMouseEnter(x, y, mask); +} + +void LLSocialListItem::onMouseLeave(S32 x, S32 y, MASK mask) +{ + getChildView("hovered_icon")->setVisible( false); + mInfoBtn->setVisible(false); + mProfileBtn->setVisible(false); + + LLPanel::onMouseLeave(x, y, mask); +} diff --git a/indra/newview/llsociallist.h b/indra/newview/llsociallist.h new file mode 100644 index 0000000000..884d6ebd7e --- /dev/null +++ b/indra/newview/llsociallist.h @@ -0,0 +1,98 @@ +/** +* @file llsociallist.h +* @brief Header file for llsociallist +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ +#ifndef LL_LLSOCIALLIST_H +#define LL_LLSOCIALLIST_H + +#include "llflatlistview.h" +#include "llstyle.h" + + +/** + * Generic list of avatars. + * + * Updates itself when it's dirty, using optional name filter. + * To initiate update, modify the UUID list and call setDirty(). + * + * @see getIDs() + * @see setDirty() + * @see setNameFilter() + */ + +class LLAvatarIconCtrl; +class LLIconCtrl; +class LLOutputMonitorCtrl; + +class LLSocialList : public LLFlatListViewEx +{ +public: + + struct Params : public LLInitParam::Block + { + }; + + LLSocialList(const Params&p); + virtual ~LLSocialList(); + + virtual void draw(); + void refresh(); + void addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos = ADD_BOTTOM); + + + + std::string mNameFilter; +}; + +class LLSocialListItem : public LLPanel +{ + public: + LLSocialListItem(); + ~LLSocialListItem(); + + BOOL postBuild(); + void setName(const std::string& name, const std::string& highlight = LLStringUtil::null); + void setValue(const LLSD& value); + void onMouseEnter(S32 x, S32 y, MASK mask); + void onMouseLeave(S32 x, S32 y, MASK mask); + + LLTextBox * mLabelTextBox; + std::string mLabel; + LLStyle::Params mLabelTextBoxStyle; + + + LLAvatarIconCtrl * mIcon; + LLTextBox * mLastInteractionTime; + LLIconCtrl * mIconPermissionOnline; + LLIconCtrl * mIconPermissionMap; + LLIconCtrl * mIconPermissionEditMine; + LLIconCtrl * mIconPermissionEditTheirs; + LLOutputMonitorCtrl * mSpeakingIndicator; + LLButton * mInfoBtn; + LLButton * mProfileBtn; +}; + + +#endif // LL_LLSOCIALLIST_H diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index f3334fd767..81946ff7f9 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -602,7 +602,7 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M min_height="150" name="tab_facebook" title="Facebook Friends"> - Date: Wed, 3 Apr 2013 03:55:53 +0100 Subject: got connectToFacebook working with code and redirect_uri passed as LLSD body in POST request --- indra/newview/llpanelpeople.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index cbc5eba65f..f55459afec 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -80,6 +80,7 @@ static const std::string FBCTEST_TAB_NAME = "fbctest_panel"; static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com"; +static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/"; /** Comparator for comparing avatar items by last interaction date */ class LLAvatarItemRecentComparator : public LLAvatarItemComparator @@ -1769,7 +1770,7 @@ public: else if (mShowLoginIfNotConnected) { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/"); + p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_REDIRECT_URI); mPanelPeople->openFacebookWeb(p); } } @@ -1818,8 +1819,10 @@ void LLPanelPeople::loadFacebookFriends() void LLPanelPeople::connectToFacebook(const std::string& auth_code) { - llinfos << "attempting to connect to facebook with code " << auth_code << llendl; - LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect/" + auth_code, LLSD(), new FacebookConnectResponder(this)); + LLSD body; + body["code"] = auth_code; + body["redirect_uri"] = FBC_SERVICES_REDIRECT_URI; + LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect", body, new FacebookConnectResponder(this)); } void LLPanelPeople::disconnectFromFacebook() -- cgit v1.2.3 From 859f7b5484df50bb45e10c8d73517205328b6b9c Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 2 Apr 2013 20:10:44 -0700 Subject: adding support for showing avatar icon and avatar name + facebook name into LLSocialListItem. Also the info button and profile button should now work --- indra/newview/llsociallist.cpp | 27 ++++++++++++++++++++++++++- indra/newview/llsociallist.h | 4 ++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/indra/newview/llsociallist.cpp b/indra/newview/llsociallist.cpp index 3d1d256149..2402a7c4b8 100644 --- a/indra/newview/llsociallist.cpp +++ b/indra/newview/llsociallist.cpp @@ -31,7 +31,10 @@ sDestroyImmediate #include "llsociallist.h" +#include "llavataractions.h" +#include "llfloaterreg.h" #include "llavatariconctrl.h" +#include "llavatarnamecache.h" #include "lloutputmonitorctrl.h" #include "lltextutil.h" @@ -60,7 +63,16 @@ void LLSocialList::refresh() void LLSocialList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos) { LLSocialListItem * item = new LLSocialListItem(); - item->setName(name, mNameFilter); + LLAvatarName avatar_name; + bool has_avatar_name = id.notNull() && LLAvatarNameCache::get(id, &avatar_name); + + item->mAvatarId = id; + if(id.notNull()) + { + item->mIcon->setValue(id); + } + + item->setName(has_avatar_name ? avatar_name.mDisplayName + " (" + name + ")" : name, mNameFilter); addItem(item, id, pos); } @@ -97,6 +109,9 @@ BOOL LLSocialListItem::postBuild() mInfoBtn->setVisible(false); mProfileBtn->setVisible(false); + mInfoBtn->setClickedCallback(boost::bind(&LLSocialListItem::onInfoBtnClick, this)); + mProfileBtn->setClickedCallback(boost::bind(&LLSocialListItem::onProfileBtnClick, this)); + return TRUE; } @@ -128,3 +143,13 @@ void LLSocialListItem::onMouseLeave(S32 x, S32 y, MASK mask) LLPanel::onMouseLeave(x, y, mask); } + +void LLSocialListItem::onInfoBtnClick() +{ + LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", mAvatarId)); +} + +void LLSocialListItem::onProfileBtnClick() +{ + LLAvatarActions::showProfile(mAvatarId); +} diff --git a/indra/newview/llsociallist.h b/indra/newview/llsociallist.h index 884d6ebd7e..bc667fc400 100644 --- a/indra/newview/llsociallist.h +++ b/indra/newview/llsociallist.h @@ -77,6 +77,10 @@ class LLSocialListItem : public LLPanel void setValue(const LLSD& value); void onMouseEnter(S32 x, S32 y, MASK mask); void onMouseLeave(S32 x, S32 y, MASK mask); + void onInfoBtnClick(); + void onProfileBtnClick(); + + LLUUID mAvatarId; LLTextBox * mLabelTextBox; std::string mLabel; -- cgit v1.2.3 From 436bccf58be3e5f3dd5f990304b9aa0f8c9c66f4 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 3 Apr 2013 04:11:43 +0100 Subject: made auth code extraction more robust --- indra/newview/llpanelpeople.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index f55459afec..8fc1d378db 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -892,12 +892,24 @@ void LLPanelPeople::updateFbcTestList() std::string url = mFbcTestBrowserHandle.get()->getTitle(); // if the browser has redirected from facebook - if (url.substr(0, FBC_SERVICES_URL.length()) == FBC_SERVICES_URL) + if (url.find(FBC_SERVICES_REDIRECT_URI) == 0) { - // get the auth code - std::string auth_code = url.substr(FBC_SERVICES_URL.length() + 7); - auth_code = auth_code.substr(0, auth_code.length() - 4); - + // find the auth code in the url + std::string begin_string = "code="; + std::string end_string = "#"; + size_t begin_index = begin_string.length() + url.find(begin_string, FBC_SERVICES_REDIRECT_URI.length()); + size_t end_index = url.find(end_string, begin_index); + + // extract the auth code from the url + std::string auth_code; + if (end_index != std::string::npos) + { + auth_code = url.substr(begin_index, end_index - begin_index); + } + else + { + auth_code = url.substr(begin_index); + } llinfos << "extracted code " << auth_code << " from url " << url << llendl; // finish authenticating on the server -- cgit v1.2.3 From 06d06454b25fd6b97d81076ce93b573fc53c36f9 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 3 Apr 2013 04:40:11 +0100 Subject: made Facebook Friends list auto-populate --- indra/newview/llpanelpeople.cpp | 23 ++++++++++++++++++++++- indra/newview/llpanelpeople.h | 2 ++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 8fc1d378db..6a83e84da1 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -539,6 +539,7 @@ private: LLPanelPeople::LLPanelPeople() : LLPanel(), mConnectedToFbc(false), + mTryToConnectToFbc(true), mFilterSubString(LLStringUtil::null), mFilterSubStringOrig(LLStringUtil::null), mFilterEditor(NULL), @@ -633,7 +634,7 @@ BOOL LLPanelPeople::postBuild() mMiniMap = (LLNetMap*)getChildView("Net Map",true); mMiniMap->setToolTipMsg(gSavedSettings.getBOOL("DoubleClickTeleport") ? getString("AltMiniMapToolTipMsg") : getString("MiniMapToolTipMsg")); - + mRecentList = getChild(RECENT_TAB_NAME)->getChild("avatar_list"); mRecentList->setNoItemsCommentText(getString("no_recent_people")); mRecentList->setNoItemsMsg(getString("no_recent_people")); @@ -651,6 +652,7 @@ BOOL LLPanelPeople::postBuild() LLPanel * social_tab = getChild(FBCTEST_TAB_NAME); mFacebookFriends = social_tab->getChild("facebook_friends"); + social_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFbcTestListUpdater, _2)); setSortOrder(mRecentList, (ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"), false); setSortOrder(mAllFriendList, (ESortOrder)gSavedSettings.getU32("FriendsSortOrder"), false); @@ -922,6 +924,17 @@ void LLPanelPeople::updateFbcTestList() mFbcTestListUpdater->setActive(false); } } + else if (mTryToConnectToFbc) + { + // try to reconnect to facebook! + tryToReconnectToFacebook(); + + // don't try again + mTryToConnectToFbc = false; + + // stop updating + mFbcTestListUpdater->setActive(false); + } } void LLPanelPeople::buttonSetVisible(std::string btn_name, BOOL visible) @@ -1829,6 +1842,14 @@ void LLPanelPeople::loadFacebookFriends() LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/friends", new FacebookFriendsResponder(this)); } +void LLPanelPeople::tryToReconnectToFacebook() +{ + if (!mConnectedToFbc) + { + LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connected", new FacebookConnectedResponder(this, false)); + } +} + void LLPanelPeople::connectToFacebook(const std::string& auth_code) { LLSD body; diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index d61eb80f57..2ac83c3677 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -62,10 +62,12 @@ public: void showFacebookFriends(const LLSD& friends); void hideFacebookFriends(); void loadFacebookFriends(); + void tryToReconnectToFacebook(); void connectToFacebook(const std::string& auth_code); void disconnectFromFacebook(); bool mConnectedToFbc; + bool mTryToConnectToFbc; // internals class Updater; -- cgit v1.2.3 From a8e89fbb46730ca51241f4f0b51d06210e2cf347 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 3 Apr 2013 23:55:25 +0100 Subject: changed FBC Services redirect_uri for testing --- indra/newview/llpanelpeople.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 6a83e84da1..93e8411eb7 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -80,7 +80,7 @@ static const std::string FBCTEST_TAB_NAME = "fbctest_panel"; static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com"; -static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/"; +static const std::string FBC_SERVICES_REDIRECT_URI = "http://axcho.com/secondlife/"; /** Comparator for comparing avatar items by last interaction date */ class LLAvatarItemRecentComparator : public LLAvatarItemComparator -- cgit v1.2.3 From 819bbce34a2f265287df1e4e9adde90b5a70c8b6 Mon Sep 17 00:00:00 2001 From: Cho Date: Thu, 4 Apr 2013 00:04:52 +0100 Subject: made FB+SL friends show up as (setAvatarId(id, mSessionID, mIgnoreOnlineStatus, false); // this sets the name as a side effect - item->setAvatarName(has_avatar_name ? avatar_name.mDisplayName + " (" + name + ")" : name); + item->setAvatarName(has_avatar_name ? name + " (" + avatar_name.mDisplayName + ")" : name); item->setOnline(mIgnoreOnlineStatus ? true : is_online); item->showLastInteractionTime(mShowLastInteractionTime); diff --git a/indra/newview/llsociallist.cpp b/indra/newview/llsociallist.cpp index 2402a7c4b8..6cf0851fd7 100644 --- a/indra/newview/llsociallist.cpp +++ b/indra/newview/llsociallist.cpp @@ -72,7 +72,7 @@ void LLSocialList::addNewItem(const LLUUID& id, const std::string& name, BOOL is item->mIcon->setValue(id); } - item->setName(has_avatar_name ? avatar_name.mDisplayName + " (" + name + ")" : name, mNameFilter); + item->setName(has_avatar_name ? name + " (" + avatar_name.mDisplayName + ")" : name, mNameFilter); addItem(item, id, pos); } -- cgit v1.2.3 From 15e2f76615581341a861ed0e37da96170e2aee61 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 3 Apr 2013 16:26:11 -0700 Subject: MAINT-2558 - Add viewer debug setting for more logging on avatar render info. Reviewed by Kelly --- indra/newview/app_settings/settings.xml | 11 ++++ indra/newview/llavatarrenderinfoaccountant.cpp | 77 +++++++++++++++----------- indra/newview/llavatarrenderinfoaccountant.h | 2 + 3 files changed, 57 insertions(+), 33 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 384e83a2a0..4c6940500e 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9400,6 +9400,17 @@ Value 0 + RenderAutoMuteLogging + + Comment + Show extra information in viewer logs about avatar rendering costs + Persist + 1 + Type + Boolean + Value + 0 + RenderAutoMuteVisibilityRank Comment diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 04a79f7d4c..54144677f4 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -37,15 +37,13 @@ #include "llcharacter.h" #include "llhttpclient.h" #include "lltimer.h" +#include "llviewercontrol.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" #include "llvoavatar.h" #include "llworld.h" -// Use this for debugging -//#define LL_AVATAR_RENDER_INFO_LOG_SPAM - static const std::string KEY_AGENTS = "agents"; // map static const std::string KEY_WEIGHT = "weight"; // integer static const std::string KEY_GEOMETRY = "geometry"; // integer @@ -94,9 +92,10 @@ public: LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if (regionp) { - #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM - llinfos << "Result for avatar weights request for region " << regionp->getName() << ":" << llendl; - #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + if (LLAvatarRenderInfoAccountant::logRenderInfo()) + { + llinfos << "Result for avatar weights request for region " << regionp->getName() << ":" << llendl; + } if (content.isMap()) { @@ -116,10 +115,11 @@ public: agent_info_map.isMap()) { // Extract the data for this avatar - #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM - llinfos << " Agent " << target_agent_id - << ": " << agent_info_map << llendl; - #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + if (LLAvatarRenderInfoAccountant::logRenderInfo()) + { + llinfos << " Agent " << target_agent_id + << ": " << agent_info_map << llendl; + } if (agent_info_map.has(KEY_WEIGHT)) { @@ -194,10 +194,11 @@ public: LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if (regionp) { - #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM - llinfos << "Result for avatar weights POST for region " << regionp->getName() - << ": " << content << llendl; - #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + if (LLAvatarRenderInfoAccountant::logRenderInfo()) + { + llinfos << "Result for avatar weights POST for region " << regionp->getName() + << ": " << content << llendl; + } if (content.isMap()) { @@ -231,12 +232,13 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio std::string url = regionp->getCapability("AvatarRenderInfo"); if (!url.empty()) { - #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM - llinfos << "Sending avatar render info to region " - << regionp->getName() - << " from " << url - << llendl; - #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + if (logRenderInfo()) + { + llinfos << "Sending avatar render info to region " + << regionp->getName() + << " from " << url + << llendl; + } // Build the render info to POST to the region LLSD report = LLSD::emptyMap(); @@ -271,10 +273,11 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio agents[avatar->getID().asString()] = info; } - #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM - llinfos << "Sending avatar render info for " << avatar->getID() - << ": " << info << llendl; - #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + if (logRenderInfo()) + { + llinfos << "Sending avatar render info for " << avatar->getID() + << ": " << info << llendl; + } } iter++; } @@ -297,12 +300,13 @@ void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regi std::string url = regionp->getCapability("AvatarRenderInfo"); if (!url.empty()) { - #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM - llinfos << "Requesting avatar render info for region " - << regionp->getName() - << " from " << url - << llendl; - #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + if (logRenderInfo()) + { + llinfos << "Requesting avatar render info for region " + << regionp->getName() + << " from " << url + << llendl; + } // First send a request to get the latest data LLHTTPClient::get(url, new LLAvatarRenderInfoGetResponder(regionp->getHandle())); @@ -351,10 +355,17 @@ void LLAvatarRenderInfoAccountant::idle() // are returned for a new LLViewerRegion, and is the earliest time to get render info void LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer() { - #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM - llinfos << "Viewer has new region capabilities" << llendl; - #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + if (logRenderInfo()) + { + llinfos << "Viewer has new region capabilities" << llendl; + } sRenderInfoReportTimer.resetWithExpiry(0.f); } +// static +bool LLAvatarRenderInfoAccountant::logRenderInfo() +{ + static LLCachedControl render_mute_logging_enabled(gSavedSettings, "RenderAutoMuteLogging"); + return render_mute_logging_enabled; +} diff --git a/indra/newview/llavatarrenderinfoaccountant.h b/indra/newview/llavatarrenderinfoaccountant.h index 5b4a4d3db2..97dd9f0ad3 100644 --- a/indra/newview/llavatarrenderinfoaccountant.h +++ b/indra/newview/llavatarrenderinfoaccountant.h @@ -46,6 +46,8 @@ public: static void idle(); + static bool logRenderInfo(); + private: // Send data updates about once per minute, only need per-frame resolution static LLFrameTimer sRenderInfoReportTimer; -- cgit v1.2.3 From 10dba6b20148868ab630e53ac9aec67d2ed01cc1 Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 5 Apr 2013 03:15:35 +0100 Subject: changed routes according to Kelly's and Enkidu's advice --- indra/newview/llpanelpeople.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 2ca22a1382..4bcd146ad2 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1741,7 +1741,7 @@ void LLPanelPeople::tryToReconnectToFacebook() { if (!mConnectedToFbc) { - LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connected", new FacebookConnectedResponder(this, false)); + LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", new FacebookConnectedResponder(this, false)); } } @@ -1750,12 +1750,12 @@ void LLPanelPeople::connectToFacebook(const std::string& auth_code) LLSD body; body["code"] = auth_code; body["redirect_uri"] = FBC_SERVICES_REDIRECT_URI; - LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect", body, new FacebookConnectResponder(this)); + LLHTTPClient::put(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", body, new FacebookConnectResponder(this)); } void LLPanelPeople::disconnectFromFacebook() { - LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/disconnect", LLSD(), new FacebookDisconnectResponder(this)); + LLHTTPClient::del(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", new FacebookDisconnectResponder(this)); } void LLPanelPeople::onLoginFbcButtonClicked() @@ -1766,7 +1766,7 @@ void LLPanelPeople::onLoginFbcButtonClicked() } else { - LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connected", new FacebookConnectedResponder(this, true)); + LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", new FacebookConnectedResponder(this, true)); } } -- cgit v1.2.3 From 2465634bf77b7c471106855c347b611bcd8ef2ab Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 5 Apr 2013 21:27:20 +0100 Subject: changed connect to use POST --- indra/newview/llpanelpeople.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 4bcd146ad2..29a92525de 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1750,7 +1750,7 @@ void LLPanelPeople::connectToFacebook(const std::string& auth_code) LLSD body; body["code"] = auth_code; body["redirect_uri"] = FBC_SERVICES_REDIRECT_URI; - LLHTTPClient::put(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", body, new FacebookConnectResponder(this)); + LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", body, new FacebookConnectResponder(this)); } void LLPanelPeople::disconnectFromFacebook() -- cgit v1.2.3 From aa0cb35db561004c205c7aac2570407ae88ad472 Mon Sep 17 00:00:00 2001 From: Geenz Date: Sun, 7 Apr 2013 11:33:39 -0400 Subject: Support the committing of the current pre edit string when language input is interrupted per the viewer's original pre edit functionality. --- indra/llwindow/llopenglview-objc.h | 3 +++ indra/llwindow/llopenglview-objc.mm | 11 +++++++++++ indra/llwindow/llwindowmacosx-objc.h | 1 + indra/llwindow/llwindowmacosx-objc.mm | 5 +++++ indra/llwindow/llwindowmacosx.cpp | 2 +- 5 files changed, 21 insertions(+), 1 deletion(-) diff --git a/indra/llwindow/llopenglview-objc.h b/indra/llwindow/llopenglview-objc.h index 6b21148bb6..6d0f138950 100644 --- a/indra/llwindow/llopenglview-objc.h +++ b/indra/llwindow/llopenglview-objc.h @@ -19,11 +19,14 @@ float mMousePos[2]; bool mHasMarkedText; unsigned int mMarkedTextLength; + NSAttributedString *mMarkedText; } - (id) initWithSamples:(NSUInteger)samples; - (id) initWithSamples:(NSUInteger)samples andVsync:(BOOL)vsync; - (id) initWithFrame:(NSRect)frame withSamples:(NSUInteger)samples andVsync:(BOOL)vsync; +- (void)commitCurrentPreedit; + // rebuildContext // Destroys and recreates a context with the view's internal format set via setPixelFormat; // Use this in event of needing to rebuild a context for whatever reason, without needing to assign a new pixel format. diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index a6ef35a8eb..9d55b2c551 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -420,11 +420,20 @@ attributedStringInfo getSegments(NSAttributedString *str) setMarkedText(text, selected, replacement, [aString length], segments); mHasMarkedText = TRUE; mMarkedTextLength = [aString length]; + mMarkedText = (NSAttributedString*)[aString mutableString]; } } +- (void)commitCurrentPreedit +{ + [self insertText:mMarkedText replacementRange:NSMakeRange(0, [mMarkedText length])]; + [[self inputContext] discardMarkedText]; +} + - (void)unmarkText { + [[self inputContext] discardMarkedText]; + [mMarkedText setValue:@""]; resetPreedit(); mHasMarkedText = FALSE; } @@ -517,6 +526,8 @@ attributedStringInfo getSegments(NSAttributedString *str) { [glview insertText:aString replacementRange:replacementRange]; [_window orderOut:_window]; + [[self textStorage] setValue:@""]; + [[self inputContext] discardMarkedText]; } @end diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index 14a0c22d66..59d956d4c8 100644 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -117,6 +117,7 @@ void callFocus(); void callFocusLost(); void callModifier(unsigned int mask); void callQuitHandler(); +void commitCurrentPreedit(GLViewRef glView); #include void callHandleDragEntered(std::string url); diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index 0eef8c9f83..4bd65ade82 100644 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -372,6 +372,11 @@ void showInputWindow(bool show) [(LLAppDelegate*)[NSApp delegate] showInputWindow:show]; } +void commitCurrentPreedit(GLViewRef glView) +{ + [(LLOpenGLView*)glView commitCurrentPreedit]; +} + NSWindowRef getMainAppWindow() { LLNSWindow *winRef = [(LLAppDelegate*)[[NSApplication sharedApplication] delegate] window]; diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 4f6ae5c799..e1220c83f4 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1864,7 +1864,7 @@ void LLWindowMacOSX::allowLanguageTextInput(LLPreeditor *preeditor, BOOL b) void LLWindowMacOSX::interruptLanguageTextInput() { - // TODO: IME support + commitCurrentPreedit(mGLView); } //static -- cgit v1.2.3 From c8883f6a5245056c4f26f2ce4f874549e62b2b29 Mon Sep 17 00:00:00 2001 From: Cho Date: Tue, 9 Apr 2013 01:15:00 +0100 Subject: updated to use new API routes --- indra/newview/llpanelpeople.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 29a92525de..052637742b 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -888,6 +888,9 @@ void LLPanelPeople::updateFbcTestList() // close the browser window mFbcTestBrowserHandle.get()->die(); + + // get rid of the handle + mFbcTestBrowserHandle = LLHandle(); // stop updating mFbcTestListUpdater->setActive(false); @@ -1716,7 +1719,7 @@ public: llinfos << content << llendl; // display the list of friends - if (content.has("friends")) + if (content.has("friends") && !content.has("error")) { mPanelPeople->showFacebookFriends(content["friends"]); } @@ -1748,14 +1751,17 @@ void LLPanelPeople::tryToReconnectToFacebook() void LLPanelPeople::connectToFacebook(const std::string& auth_code) { LLSD body; + body["agent_id"] = gAgentID.asString(); body["code"] = auth_code; body["redirect_uri"] = FBC_SERVICES_REDIRECT_URI; - LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", body, new FacebookConnectResponder(this)); + LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect", body, new FacebookConnectResponder(this)); } void LLPanelPeople::disconnectFromFacebook() { - LLHTTPClient::del(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", new FacebookDisconnectResponder(this)); + LLSD body; + body["agent_id"] = gAgentID.asString(); + LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/disconnect", body, new FacebookDisconnectResponder(this)); } void LLPanelPeople::onLoginFbcButtonClicked() -- cgit v1.2.3 From 2b8632a81b40ef92a9b3872ad0909575a3bd938a Mon Sep 17 00:00:00 2001 From: Cho Date: Tue, 9 Apr 2013 02:01:56 +0100 Subject: changed redirect_uri to pdp15.lindenlab.com/redirect --- indra/newview/llpanelpeople.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 052637742b..a425919390 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -80,7 +80,7 @@ static const std::string FBCTEST_TAB_NAME = "fbctest_panel"; static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com"; -static const std::string FBC_SERVICES_REDIRECT_URI = "http://axcho.com/secondlife/"; +static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/redirect"; /** Comparator for comparing avatar items by last interaction date */ class LLAvatarItemRecentComparator : public LLAvatarItemComparator -- cgit v1.2.3 From 479c5f4b4aad98dbb654cb03c343b2dce6222922 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 9 Apr 2013 13:24:51 -0700 Subject: adding in logging of building a list of 300 users inside LLAvatarList and LLFolderView to determine drawbacks/benefits and timing. --- indra/newview/llfloaterimcontainer.cpp | 7 +++++-- indra/newview/llpanelpeople.cpp | 17 +++++++++++++++++ indra/newview/llpanelpeople.h | 1 + indra/newview/llparticipantlist.cpp | 14 ++++++++++++++ indra/newview/llparticipantlist.h | 1 + indra/newview/skins/default/xui/en/menu_gear_fbc.xml | 9 ++++++++- 6 files changed, 46 insertions(+), 3 deletions(-) diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 7e281bd99b..af8c7e9dc4 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -342,8 +342,11 @@ void LLFloaterIMContainer::onStubCollapseButtonClicked() void LLFloaterIMContainer::onSpeakButtonClicked() { - LLAgent::toggleMicrophone("speak"); - updateSpeakBtnState(); + //LLAgent::toggleMicrophone("speak"); + //updateSpeakBtnState(); + + LLParticipantList* session_model = dynamic_cast(mConversationsItems[LLUUID(NULL)]); + session_model->addTestAvatarAgents(); } void LLFloaterIMContainer::onExpandCollapseButtonClicked() { diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index a425919390..493395fdd1 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -49,6 +49,7 @@ #include "llavatarlist.h" #include "llavatarlistitem.h" #include "llcallingcard.h" // for LLAvatarTracker +#include "llerror.h" #include "llfloateravatarpicker.h" //#include "llfloaterminiinspector.h" #include "llfriendcard.h" @@ -557,6 +558,7 @@ LLPanelPeople::LLPanelPeople() mCommitCallbackRegistrar.add("People.loginFBC", boost::bind(&LLPanelPeople::onLoginFbcButtonClicked, this)); mCommitCallbackRegistrar.add("People.requestFBC", boost::bind(&LLPanelPeople::onFacebookAppRequestClicked, this)); mCommitCallbackRegistrar.add("People.sendFBC", boost::bind(&LLPanelPeople::onFacebookAppSendClicked, this)); + mCommitCallbackRegistrar.add("People.testaddFBC", boost::bind(&LLPanelPeople::onFacebookTestAddClicked, this)); mCommitCallbackRegistrar.add("People.AddFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this)); @@ -1789,4 +1791,19 @@ void LLPanelPeople::onFacebookAppSendClicked() p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + FBC_SERVICES_URL); openFacebookWeb(p); } + +void LLPanelPeople::onFacebookTestAddClicked() +{ + mFacebookFriends->clear(); + + LL_INFOS("LLPanelPeople") << "start adding 300 users" << LL_ENDL; + + for(int i = 0; i < 300; ++i) + { + mFacebookFriends->addNewItem(LLUUID(), "Test", false); + } + + LL_INFOS("LLPanelPeople") << "finished adding 300 users" << LL_ENDL; +} + // EOF diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index ffb3f74192..76207108cd 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -124,6 +124,7 @@ private: void onLoginFbcButtonClicked(); void onFacebookAppRequestClicked(); void onFacebookAppSendClicked(); + void onFacebookTestAddClicked(); bool onFriendsViewSortMenuItemCheck(const LLSD& userdata); bool onRecentViewSortMenuItemCheck(const LLSD& userdata); diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index c53760bca1..e05b27e539 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llavatarnamecache.h" +#include "llerror.h" #include "llimview.h" #include "llfloaterimcontainer.h" #include "llparticipantlist.h" @@ -401,6 +402,19 @@ void LLParticipantList::addAvatarIDExceptAgent(const LLUUID& avatar_id) adjustParticipant(avatar_id); } + +void LLParticipantList::addTestAvatarAgents() +{ + LL_INFOS("LLParticipantList") << "start adding 300 users" << LL_ENDL; + + for(int i = 0; i < 300; ++i) + { + addAvatarIDExceptAgent(LLUUID().generateNewID()); + } + + LL_INFOS("LLParticipantList") << "finished adding 300 users" << LL_ENDL; +} + void LLParticipantList::adjustParticipant(const LLUUID& speaker_id) { LLPointer speakerp = mSpeakerMgr->findSpeaker(speaker_id); diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h index 3a3ae76604..936e289c08 100644 --- a/indra/newview/llparticipantlist.h +++ b/indra/newview/llparticipantlist.h @@ -50,6 +50,7 @@ public: * @param[in] avatar_id - Avatar UUID to be added into the list */ void addAvatarIDExceptAgent(const LLUUID& avatar_id); + void addTestAvatarAgents(); /** * Refreshes the participant list. diff --git a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml index b05ba46107..4d8cbb432e 100644 --- a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml +++ b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml @@ -26,5 +26,12 @@ - + + + + \ No newline at end of file -- cgit v1.2.3 From 31eb1f6ebb27c016c66a50f3b32917ea7496fb2f Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 10 Apr 2013 00:46:15 +0100 Subject: updated routes URLs --- indra/newview/llpanelpeople.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index a425919390..cabc2cf4fe 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -79,8 +79,8 @@ static const std::string BLOCKED_TAB_NAME = "blocked_panel"; // blocked avatars static const std::string FBCTEST_TAB_NAME = "fbctest_panel"; static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; -static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com"; -static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/redirect"; +static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com/fbc"; +static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/fbc/redirect"; /** Comparator for comparing avatar items by last interaction date */ class LLAvatarItemRecentComparator : public LLAvatarItemComparator @@ -1737,14 +1737,14 @@ public: void LLPanelPeople::loadFacebookFriends() { - LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/friends", new FacebookFriendsResponder(this)); + LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/friends", new FacebookFriendsResponder(this)); } void LLPanelPeople::tryToReconnectToFacebook() { if (!mConnectedToFbc) { - LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", new FacebookConnectedResponder(this, false)); + LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString(), new FacebookConnectedResponder(this, false)); } } @@ -1754,14 +1754,14 @@ void LLPanelPeople::connectToFacebook(const std::string& auth_code) body["agent_id"] = gAgentID.asString(); body["code"] = auth_code; body["redirect_uri"] = FBC_SERVICES_REDIRECT_URI; - LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect", body, new FacebookConnectResponder(this)); + LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/connect", body, new FacebookConnectResponder(this)); } void LLPanelPeople::disconnectFromFacebook() { LLSD body; body["agent_id"] = gAgentID.asString(); - LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/disconnect", body, new FacebookDisconnectResponder(this)); + LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/disconnect", body, new FacebookDisconnectResponder(this)); } void LLPanelPeople::onLoginFbcButtonClicked() @@ -1772,7 +1772,7 @@ void LLPanelPeople::onLoginFbcButtonClicked() } else { - LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", new FacebookConnectedResponder(this, true)); + LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString(), new FacebookConnectedResponder(this, true)); } } -- cgit v1.2.3 From 1d3f018e812daf5fb7834258940b13a2239106b4 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Tue, 9 Apr 2013 17:04:57 -0700 Subject: MAINT-2417 FIX Update Graphics tab layout --- indra/newview/llfloaterpreference.cpp | 29 ++++--- indra/newview/llfloaterpreference.h | 3 +- .../default/xui/en/panel_preferences_graphics1.xml | 96 +++++++++++++++++++--- 3 files changed, 105 insertions(+), 23 deletions(-) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index a28af2101b..cdfaab88eb 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -337,7 +337,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.HardwareDefaults", boost::bind(&LLFloaterPreference::setHardwareDefaults, this)); mCommitCallbackRegistrar.add("Pref.VertexShaderEnable", boost::bind(&LLFloaterPreference::onVertexShaderEnable, this)); mCommitCallbackRegistrar.add("Pref.WindowedMod", boost::bind(&LLFloaterPreference::onCommitWindowedMode, this)); - mCommitCallbackRegistrar.add("Pref.UpdateSliderText", boost::bind(&LLFloaterPreference::onUpdateSliderText,this, _1,_2)); + mCommitCallbackRegistrar.add("Pref.UpdateSliderText", boost::bind(&LLFloaterPreference::refreshUI,this)); mCommitCallbackRegistrar.add("Pref.QualityPerformance", boost::bind(&LLFloaterPreference::onChangeQuality, this, _2)); mCommitCallbackRegistrar.add("Pref.applyUIColor", boost::bind(&LLFloaterPreference::applyUIColor, this ,_1, _2)); mCommitCallbackRegistrar.add("Pref.getUIColor", boost::bind(&LLFloaterPreference::getUIColor, this ,_1, _2)); @@ -1147,6 +1147,8 @@ void LLFloaterPreference::refreshEnabledState() //Deferred/SSAO/Shadows LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); + LLCheckBoxCtrl* ctrl_deferred2 = getChild("UseLightShaders2"); + BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && shaders && @@ -1155,11 +1157,13 @@ void LLFloaterPreference::refreshEnabledState() (ctrl_wind_light->get()) ? TRUE : FALSE; ctrl_deferred->setEnabled(enabled); - + ctrl_deferred2->setEnabled(enabled); + LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); LLCheckBoxCtrl* ctrl_dof = getChild("UseDoF"); LLComboBox* ctrl_shadow = getChild("ShadowDetail"); + // note, okay here to get from ctrl_deferred as it's twin, ctrl_deferred2 will alway match it enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO") && (ctrl_deferred->get() ? TRUE : FALSE); ctrl_ssao->setEnabled(enabled); @@ -1185,6 +1189,7 @@ void LLFloaterPreference::disableUnavailableSettings() LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); LLCheckBoxCtrl* ctrl_avatar_impostors = getChild("AvatarImpostors"); LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); + LLCheckBoxCtrl* ctrl_deferred2 = getChild("UseLightShaders2"); LLComboBox* ctrl_shadows = getChild("ShadowDetail"); LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); LLCheckBoxCtrl* ctrl_dof = getChild("UseDoF"); @@ -1218,6 +1223,8 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_deferred->setEnabled(FALSE); ctrl_deferred->setValue(FALSE); + ctrl_deferred2->setEnabled(FALSE); + ctrl_deferred2->setValue(FALSE); } // disabled windlight @@ -1238,6 +1245,8 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_deferred->setEnabled(FALSE); ctrl_deferred->setValue(FALSE); + ctrl_deferred2->setEnabled(FALSE); + ctrl_deferred2->setValue(FALSE); } // disabled deferred @@ -1255,6 +1264,8 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_deferred->setEnabled(FALSE); ctrl_deferred->setValue(FALSE); + ctrl_deferred2->setEnabled(FALSE); + ctrl_deferred2->setValue(FALSE); } // disabled deferred SSAO @@ -1299,6 +1310,8 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_deferred->setEnabled(FALSE); ctrl_deferred->setValue(FALSE); + ctrl_deferred2->setEnabled(FALSE); + ctrl_deferred2->setValue(FALSE); } // disabled cloth @@ -1327,6 +1340,7 @@ void LLFloaterPreference::refresh() updateSliderText(getChild("FlexibleMeshDetail", true), getChild("FlexibleMeshDetailText", true)); updateSliderText(getChild("TreeMeshDetail", true), getChild("TreeMeshDetailText", true)); updateSliderText(getChild("AvatarMeshDetail", true), getChild("AvatarMeshDetailText", true)); + updateSliderText(getChild("AvatarMeshDetail2", true), getChild("AvatarMeshDetailText2", true)); updateSliderText(getChild("AvatarPhysicsDetail", true), getChild("AvatarPhysicsDetailText", true)); updateSliderText(getChild("TerrainMeshDetail", true), getChild("TerrainMeshDetailText", true)); updateSliderText(getChild("RenderPostProcess", true), getChild("PostProcessText", true)); @@ -1578,16 +1592,9 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im getChildView("chat_font_size")->setEnabled(TRUE); } -void LLFloaterPreference::onUpdateSliderText(LLUICtrl* ctrl, const LLSD& name) +void LLFloaterPreference::refreshUI() { - std::string ctrl_name = name.asString(); - - if ((ctrl_name =="" )|| !hasChild(ctrl_name, true)) - return; - - LLTextBox* text_box = getChild(name.asString()); - LLSliderCtrl* slider = dynamic_cast(ctrl); - updateSliderText(slider, text_box); + refresh(); } void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box) diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 22e80a21cb..cb180f6f1e 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -154,8 +154,7 @@ public: void onChangeQuality(const LLSD& data); void updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box); - void onUpdateSliderText(LLUICtrl* ctrl, const LLSD& name); -// void fractionFromDecimal(F32 decimal_val, S32& numerator, S32& denominator); + void refreshUI(); void onCommitParcelMediaAutoPlayEnable(); void onCommitMediaEnabled(); diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index 4ed95f0758..7abc67494f 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -177,10 +177,86 @@ width="80"> Ultra + + + + + Low + + + + m + + + + + width="256" /> Date: Thu, 11 Apr 2013 13:27:11 -0700 Subject: Clean up transfer manager code and log messages. Reviewed by Kelly --- indra/llmessage/lltransfermanager.cpp | 60 +++++++++++++++++++++-------------- indra/llmessage/lltransfermanager.h | 4 +-- 2 files changed, 39 insertions(+), 25 deletions(-) diff --git a/indra/llmessage/lltransfermanager.cpp b/indra/llmessage/lltransfermanager.cpp index 034680caf8..38b743fb75 100644 --- a/indra/llmessage/lltransfermanager.cpp +++ b/indra/llmessage/lltransfermanager.cpp @@ -606,16 +606,21 @@ void LLTransferManager::processTransferAbort(LLMessageSystem *msgp, void **) void LLTransferManager::reliablePacketCallback(void **user_data, S32 result) { LLUUID *transfer_idp = (LLUUID *)user_data; - if (result) + if (result && + transfer_idp != NULL) { - llwarns << "Aborting reliable transfer " << *transfer_idp << " due to failed reliable resends!" << llendl; LLTransferSource *tsp = gTransferManager.findTransferSource(*transfer_idp); if (tsp) { + llwarns << "Aborting reliable transfer " << *transfer_idp << " due to failed reliable resends!" << llendl; LLTransferSourceChannel *tscp = tsp->mChannelp; tsp->abortTransfer(); tscp->deleteTransfer(tsp); } + else + { + llwarns << "Aborting reliable transfer " << *transfer_idp << " but can't find the LLTransferSource object" << llendl; + } } delete transfer_idp; } @@ -892,22 +897,26 @@ LLTransferSource *LLTransferSourceChannel::findTransferSource(const LLUUID &tran } -BOOL LLTransferSourceChannel::deleteTransfer(LLTransferSource *tsp) +void LLTransferSourceChannel::deleteTransfer(LLTransferSource *tsp) { - - LLPriQueueMap::pqm_iter iter; - for (iter = mTransferSources.mMap.begin(); iter != mTransferSources.mMap.end(); iter++) + if (tsp) { - if (iter->second == tsp) + LLPriQueueMap::pqm_iter iter; + for (iter = mTransferSources.mMap.begin(); iter != mTransferSources.mMap.end(); iter++) { - delete tsp; - mTransferSources.mMap.erase(iter); - return TRUE; + if (iter->second == tsp) + { + delete tsp; + mTransferSources.mMap.erase(iter); + return; + } } - } - llerrs << "Unable to find transfer source to delete!" << llendl; - return FALSE; + llwarns << "Unable to find transfer source id " + << tsp->getID() + << " to delete!" + << llendl; + } } @@ -1008,21 +1017,26 @@ LLTransferTarget *LLTransferTargetChannel::findTransferTarget(const LLUUID &tran } -BOOL LLTransferTargetChannel::deleteTransfer(LLTransferTarget *ttp) +void LLTransferTargetChannel::deleteTransfer(LLTransferTarget *ttp) { - tt_iter iter; - for (iter = mTransferTargets.begin(); iter != mTransferTargets.end(); iter++) + if (ttp) { - if (*iter == ttp) + tt_iter iter; + for (iter = mTransferTargets.begin(); iter != mTransferTargets.end(); iter++) { - delete ttp; - mTransferTargets.erase(iter); - return TRUE; + if (*iter == ttp) + { + delete ttp; + mTransferTargets.erase(iter); + return; + } } - } - llerrs << "Unable to find transfer target to delete!" << llendl; - return FALSE; + llwarns << "Unable to find transfer target id " + << ttp->getID() + << " to delete!" + << llendl; + } } diff --git a/indra/llmessage/lltransfermanager.h b/indra/llmessage/lltransfermanager.h index 252e05d1d1..6aad153c24 100644 --- a/indra/llmessage/lltransfermanager.h +++ b/indra/llmessage/lltransfermanager.h @@ -199,7 +199,7 @@ public: void addTransferSource(LLTransferSource *sourcep); LLTransferSource *findTransferSource(const LLUUID &transfer_id); - BOOL deleteTransfer(LLTransferSource *tsp); + void deleteTransfer(LLTransferSource *tsp); void setThrottleID(const S32 throttle_id) { mThrottleID = throttle_id; } @@ -232,7 +232,7 @@ public: const F32 priority); LLTransferTarget *findTransferTarget(const LLUUID &transfer_id); - BOOL deleteTransfer(LLTransferTarget *ttp); + void deleteTransfer(LLTransferTarget *ttp); LLTransferChannelType getChannelType() const { return mChannelType; } -- cgit v1.2.3 From 46c690bd50c588f126d8b5dba67a6802d255c2bd Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 11 Apr 2013 18:26:48 -0700 Subject: Adding in fast timer for testing creation of 300 avatar list items vs folderview items. --- indra/newview/llpanelpeople.cpp | 4 ++++ indra/newview/llparticipantlist.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 2e97e8bab9..b33574bcc3 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1792,8 +1792,12 @@ void LLPanelPeople::onFacebookAppSendClicked() openFacebookWeb(p); } +static LLFastTimer::DeclareTimer FTM_AVATAR_LIST_TEST("avatar list test"); + void LLPanelPeople::onFacebookTestAddClicked() { + LLFastTimer _(FTM_AVATAR_LIST_TEST); + mFacebookFriends->clear(); LL_INFOS("LLPanelPeople") << "start adding 300 users" << LL_ENDL; diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index e05b27e539..b5c9f4a310 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -402,9 +402,13 @@ void LLParticipantList::addAvatarIDExceptAgent(const LLUUID& avatar_id) adjustParticipant(avatar_id); } +static LLFastTimer::DeclareTimer FTM_FOLDERVIEW_TEST("add test avatar agents"); + void LLParticipantList::addTestAvatarAgents() { + LLFastTimer _(FTM_FOLDERVIEW_TEST); + LL_INFOS("LLParticipantList") << "start adding 300 users" << LL_ENDL; for(int i = 0; i < 300; ++i) -- cgit v1.2.3 From cd8cd8c265abb0c568ee7b925551023c8081c298 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 12 Apr 2013 09:26:59 -0700 Subject: Fix merge oddities --- indra/llui/llkeywords.cpp | 1 - indra/llui/lllayoutstack.cpp | 1 - indra/llui/lltoolbar.cpp | 1 - indra/lscript/lscript_execute/lscript_readlso.cpp | 2 -- 4 files changed, 5 deletions(-) diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index 5f9dbb33ad..26d27d1f34 100644 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -367,7 +367,6 @@ void LLKeywords::findSegments(std::vector* seg_list, const LLW const llwchar* base = wtext.c_str(); const llwchar* cur = base; - (void)line; while( *cur ) { if( *cur == '\n' || cur == base ) diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 7115ad496a..dff98f33b9 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -476,7 +476,6 @@ void LLLayoutStack::createResizeBar(LLLayoutPanel* panelp) if (lp->mResizeBar == NULL) { LLResizeBar::Side side = (mOrientation == HORIZONTAL) ? LLResizeBar::RIGHT : LLResizeBar::BOTTOM; - (void)resize_bar_rect; LLResizeBar::Params resize_params; resize_params.name("resize"); resize_params.resizing_view(lp); diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 5d0ac9eeb4..3d9f5cbbc2 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -838,7 +838,6 @@ void LLToolBar::draw() if (mDragAndDropTarget && !mButtonCommands.empty()) { LLRect caret_rect = caret->getRect(); - (void)toolbar_rect; if (getOrientation(mSideType) == LLLayoutStack::HORIZONTAL) { caret->setRect(LLRect(mDragx-caret_rect.getWidth()/2+1, diff --git a/indra/lscript/lscript_execute/lscript_readlso.cpp b/indra/lscript/lscript_execute/lscript_readlso.cpp index c88b43ed83..6384a57100 100644 --- a/indra/lscript/lscript_execute/lscript_readlso.cpp +++ b/indra/lscript/lscript_execute/lscript_readlso.cpp @@ -145,7 +145,6 @@ void LLScriptLSOParse::printGlobals(LLFILE *fp) // get offset to skip past name varoffset = global_v_offset; bytestream2integer(mRawData, global_v_offset); - (void)offset; //hush little compiler // get typeexport type = *(mRawData + global_v_offset++); @@ -355,7 +354,6 @@ void LLScriptLSOParse::printStates(LLFILE *fp) { temp_end = bytestream2integer(mRawData, read_ahead); bytestream2integer(mRawData, read_ahead); - (void)dummy; if ( (temp_end < opcode_end) &&(temp_end > event_offset)) { -- cgit v1.2.3 From 9a0cd53bdaf10652236f082a63fe43ec126a9251 Mon Sep 17 00:00:00 2001 From: Cho Date: Sat, 13 Apr 2013 02:10:13 +0100 Subject: switched to use FacebookConnect and FacebookRedirect capabilities --- indra/newview/llpanelpeople.cpp | 39 +++++++++++++++++++++++++++------------ indra/newview/llpanelpeople.h | 3 +++ indra/newview/llviewerregion.cpp | 2 ++ 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 2e97e8bab9..5a4eca87ff 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -81,7 +81,7 @@ static const std::string FBCTEST_TAB_NAME = "fbctest_panel"; static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com/fbc"; -static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/fbc/redirect"; +static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/redirect"; /** Comparator for comparing avatar items by last interaction date */ class LLAvatarItemRecentComparator : public LLAvatarItemComparator @@ -865,12 +865,12 @@ void LLPanelPeople::updateFbcTestList() std::string url = mFbcTestBrowserHandle.get()->getTitle(); // if the browser has redirected from facebook - if (url.find(FBC_SERVICES_REDIRECT_URI) == 0) + if (url.find(getFacebookRedirectURL()) == 0) { // find the auth code in the url std::string begin_string = "code="; std::string end_string = "#"; - size_t begin_index = begin_string.length() + url.find(begin_string, FBC_SERVICES_REDIRECT_URI.length()); + size_t begin_index = begin_string.length() + url.find(begin_string, getFacebookRedirectURL().length()); size_t end_index = url.find(end_string, begin_index); // extract the auth code from the url @@ -1695,7 +1695,7 @@ public: else if (mShowLoginIfNotConnected) { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_REDIRECT_URI); + p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + mPanelPeople->getFacebookRedirectURL()); mPanelPeople->openFacebookWeb(p); } } @@ -1739,14 +1739,14 @@ public: void LLPanelPeople::loadFacebookFriends() { - LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/friends", new FacebookFriendsResponder(this)); + LLHTTPClient::get(getFacebookConnectURL("/friends"), new FacebookFriendsResponder(this)); } void LLPanelPeople::tryToReconnectToFacebook() { if (!mConnectedToFbc) { - LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString(), new FacebookConnectedResponder(this, false)); + LLHTTPClient::get(getFacebookConnectURL(), new FacebookConnectedResponder(this, false)); } } @@ -1755,17 +1755,32 @@ void LLPanelPeople::connectToFacebook(const std::string& auth_code) LLSD body; body["agent_id"] = gAgentID.asString(); body["code"] = auth_code; - body["redirect_uri"] = FBC_SERVICES_REDIRECT_URI; - LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/connect", body, new FacebookConnectResponder(this)); + body["redirect_uri"] = getFacebookRedirectURL(); + LLHTTPClient::post(getFacebookConnectURL("/connect"), body, new FacebookConnectResponder(this)); } void LLPanelPeople::disconnectFromFacebook() { LLSD body; body["agent_id"] = gAgentID.asString(); - LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/disconnect", body, new FacebookDisconnectResponder(this)); + LLHTTPClient::post(getFacebookConnectURL("/disconnect"), body, new FacebookDisconnectResponder(this)); } +std::string LLPanelPeople::getFacebookConnectURL(const std::string& route) +{ + static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); + std::string url = sFacebookConnectUrl + route; + llinfos << url << llendl; + return url; +} + +std::string LLPanelPeople::getFacebookRedirectURL() +{ + static std::string sFacebookRedirectUrl = gAgent.getRegion()->getCapability("FacebookRedirect"); + llinfos << sFacebookRedirectUrl << llendl; + return sFacebookRedirectUrl; +} + void LLPanelPeople::onLoginFbcButtonClicked() { if (mConnectedToFbc) @@ -1774,21 +1789,21 @@ void LLPanelPeople::onLoginFbcButtonClicked() } else { - LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString(), new FacebookConnectedResponder(this, true)); + LLHTTPClient::get(getFacebookConnectURL(), new FacebookConnectedResponder(this, true)); } } void LLPanelPeople::onFacebookAppRequestClicked() { LLFloaterWebContent::Params p; - p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + FBC_SERVICES_URL); + p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + getFacebookRedirectURL()); openFacebookWeb(p); } void LLPanelPeople::onFacebookAppSendClicked() { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + FBC_SERVICES_URL); + p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + getFacebookRedirectURL()); openFacebookWeb(p); } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 76207108cd..e9581bb5f3 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -66,6 +66,9 @@ public: void connectToFacebook(const std::string& auth_code); void disconnectFromFacebook(); + std::string getFacebookConnectURL(const std::string& route = ""); + std::string getFacebookRedirectURL(); + bool mConnectedToFbc; bool mTryToConnectToFbc; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index e4234a538d..5b3b11ae2d 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1522,6 +1522,8 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("EnvironmentSettings"); capabilityNames.append("EstateChangeInfo"); capabilityNames.append("EventQueueGet"); + capabilityNames.append("FacebookConnect"); + //capabilityNames.append("FacebookRedirect"); if (gSavedSettings.getBOOL("UseHTTPInventory")) { -- cgit v1.2.3 From 569b75bae934e89bfe872e6d8994a850c0051475 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 15 Apr 2013 11:56:15 -0700 Subject: MAINT-2595 - Viewer spams log at startup with caps issue. Reviewed by Kelly --- indra/newview/llvoicevivox.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 9b5d981aa5..ac35bd4287 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -532,25 +532,25 @@ void LLVivoxVoiceClient::requestVoiceAccountProvision(S32 retries) { LLViewerRegion *region = gAgent.getRegion(); - if ( region && (mVoiceEnabled || !mIsInitialized)) + // If we've not received the capability yet, return. + // the password will remain empty, so we'll remain in + // stateIdle + if ( region && + region->capabilitiesReceived() && + (mVoiceEnabled || !mIsInitialized)) { std::string url = region->getCapability("ProvisionVoiceAccountRequest"); - if ( url.empty() ) + if ( !url.empty() ) { - // we've not received the capability yet, so return. - // the password will remain empty, so we'll remain in - // stateIdle - return; - } + LLHTTPClient::post( + url, + LLSD(), + new LLVivoxVoiceAccountProvisionResponder(retries)); - LLHTTPClient::post( - url, - LLSD(), - new LLVivoxVoiceAccountProvisionResponder(retries)); - - setState(stateConnectorStart); + setState(stateConnectorStart); + } } } -- cgit v1.2.3 From c6991c9c75ff125654b68992c61a3c17c39bf5c5 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 15 Apr 2013 13:51:18 -0700 Subject: MAINT-2598 : Viewer logs warning about VoiceServiceConnectionStateChangedEvent --- indra/newview/llvoicevivox.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index ac35bd4287..abead02174 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -7660,6 +7660,9 @@ void LLVivoxProtocolParser::processResponse(std::string tag) */ // We don't need to process this, but we also shouldn't warn on it, since that confuses people. } + else if (!stricmp(eventTypeCstr, "VoiceServiceConnectionStateChangedEvent")) + { // Yet another ignored event + } else { LL_WARNS("VivoxProtocolParser") << "Unknown event type " << eventTypeString << LL_ENDL; -- cgit v1.2.3 From 205938b652bc9218494835afadce095b29f1d19d Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 15 Apr 2013 16:27:13 -0700 Subject: Fix crash introduced by LLInstanceTrackerBase optimization. Reviewed by Kelly --- indra/llcommon/llinstancetracker.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/indra/llcommon/llinstancetracker.cpp b/indra/llcommon/llinstancetracker.cpp index 65ef4322f6..89430f82d7 100644 --- a/indra/llcommon/llinstancetracker.cpp +++ b/indra/llcommon/llinstancetracker.cpp @@ -32,7 +32,9 @@ // external library headers // other Linden headers -static void* sInstanceTrackerData[ kInstanceTrackTypeCount ] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +static bool sInstanceTrackerData_initialized = false; +static void* sInstanceTrackerData[ kInstanceTrackTypeCount ]; + void * & LLInstanceTrackerBase::getInstances(InstanceTrackType t) { @@ -41,6 +43,15 @@ void * & LLInstanceTrackerBase::getInstances(InstanceTrackType t) // the pair and returns a std::pair of (iterator, true). If the specified // key DOES exist, insert() simply returns (iterator, false). One lookup // handles both cases. + if (!sInstanceTrackerData_initialized) + { + for (S32 i = 0; i < (S32) kInstanceTrackTypeCount; i++) + { + sInstanceTrackerData[i] = NULL; + } + sInstanceTrackerData_initialized = true; + } + return sInstanceTrackerData[t]; } -- cgit v1.2.3 From 98f438656b3f4ae8a0b6fbd6327cfff3ef243545 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 15 Apr 2013 16:29:14 -0700 Subject: MAINT-2548 : Add debug viewer render info for AV metrics. Reviewed by Kelly --- indra/newview/app_settings/settings.xml | 11 ++++++ indra/newview/llviewerwindow.cpp | 43 ++++++++++++++++++++-- indra/newview/skins/default/xui/en/menu_viewer.xml | 10 +++++ 3 files changed, 61 insertions(+), 3 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c7895fbd99..75c38ad62f 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2136,6 +2136,17 @@ Value 0 + DebugShowAvatarRenderInfo + + Comment + Show avatar render cost information + Persist + 1 + Type + Boolean + Value + 0 + DebugShowColor Comment diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index b3bb584881..bb71707db6 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -332,9 +332,10 @@ public: mTextColor = LLColor4( 0.86f, 0.86f, 0.86f, 1.f ); // Draw stuff growing up from right lower corner of screen - U32 xpos = mWindow->getWorldViewWidthScaled() - 350; - U32 ypos = 64; - const U32 y_inc = 20; + S32 xpos = mWindow->getWorldViewWidthScaled() - 400; + xpos = llmax(xpos, 0); + S32 ypos = 64; + const S32 y_inc = 20; clearText(); @@ -634,6 +635,42 @@ public: LLVertexBuffer::sSetCount = LLImageGL::sUniqueCount = gPipeline.mNumVisibleNodes = LLPipeline::sVisibleLightCount = 0; } + if (gSavedSettings.getBOOL("DebugShowAvatarRenderInfo")) + { + std::map sorted_avs; + + std::vector::iterator sort_iter = LLCharacter::sInstances.begin(); + while (sort_iter != LLCharacter::sInstances.end()) + { + LLVOAvatar* avatar = dynamic_cast(*sort_iter); + if (avatar && + !avatar->isDead()) // Not dead yet + { + // Stuff into a sorted map so the display is ordered + sorted_avs[avatar->getFullname()] = avatar; + } + sort_iter++; + } + + std::string trunc_name; + std::map::reverse_iterator av_iter = sorted_avs.rbegin(); // Put "A" at the top + while (av_iter != sorted_avs.rend()) + { + LLVOAvatar* avatar = av_iter->second; + + avatar->calculateUpdateRenderCost(); // Make sure the numbers are up-to-date + + trunc_name = utf8str_truncate(avatar->getFullname(), 16); + addText(xpos, ypos, llformat("%s : rez %d, weight %d, bytes %d area %.2f", + trunc_name.c_str(), + avatar->getRezzedStatus(), + avatar->getVisualComplexity(), + avatar->getAttachmentGeometryBytes(), + avatar->getAttachmentSurfaceArea())); + ypos += y_inc; + av_iter++; + } + } if (gSavedSettings.getBOOL("DebugShowRenderMatrices")) { addText(xpos, ypos, llformat("%.4f .%4f %.4f %.4f", gGLProjection[12], gGLProjection[13], gGLProjection[14], gGLProjection[15])); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 1197f1ce1f..f66272aa2e 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2205,6 +2205,16 @@ + + + + Date: Wed, 17 Apr 2013 02:53:50 +0100 Subject: updated to use new API as suggested by Don Linden --- indra/newview/llpanelpeople.cpp | 68 +++++++++++++---------------------------- 1 file changed, 21 insertions(+), 47 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 519868612a..75c29558e5 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1592,10 +1592,10 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) { mFacebookFriends->clear(); - for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i) + for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) { - std::string name = (*i)["name"].asString(); - LLUUID agent_id = (*i).has("agent_id") ? (*i)["agent_id"].asUUID() : LLUUID(NULL); + std::string name = i->second["name"].asString(); + LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); mFacebookFriends->addNewItem(agent_id, name, false); } @@ -1621,15 +1621,8 @@ public: llinfos << content << llendl; // grab some graph data now that we are connected - if (content["success"]) - { - mPanelPeople->mConnectedToFbc = true; - mPanelPeople->loadFacebookFriends(); - } - else if (content.has("error")) - { - llinfos << "failed to connect. reason: " << content["error"]["message"] << llendl; - } + mPanelPeople->mConnectedToFbc = true; + mPanelPeople->loadFacebookFriends(); } else { @@ -1653,15 +1646,8 @@ public: llinfos << content << llendl; // hide all the facebook stuff - if (content["success"]) - { - mPanelPeople->mConnectedToFbc = false; - mPanelPeople->hideFacebookFriends(); - } - else if (content.has("error")) - { - llinfos << "failed to disconnect. reason: " << content["error"]["message"] << llendl; - } + mPanelPeople->mConnectedToFbc = false; + mPanelPeople->hideFacebookFriends(); } else { @@ -1686,23 +1672,21 @@ public: llinfos << content << llendl; // grab some graph data if already connected - if (content["connected"]) - { - mPanelPeople->mConnectedToFbc = true; - mPanelPeople->loadFacebookFriends(); - } + mPanelPeople->mConnectedToFbc = true; + mPanelPeople->loadFacebookFriends(); + } + else + { + llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl; + // show the facebook login page if not connected yet - else if (mShowLoginIfNotConnected) + if (status == 404 && mShowLoginIfNotConnected) { LLFloaterWebContent::Params p; p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + mPanelPeople->getFacebookRedirectURL()); mPanelPeople->openFacebookWeb(p); } } - else - { - llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl; - } } }; @@ -1721,14 +1705,7 @@ public: llinfos << content << llendl; // display the list of friends - if (content.has("friends") && !content.has("error")) - { - mPanelPeople->showFacebookFriends(content["friends"]); - } - else if (content.has("error")) - { - llinfos << "failed to get facebook friends. reason: " << content["error"]["message"] << llendl; - } + mPanelPeople->showFacebookFriends(content); } else { @@ -1739,31 +1716,28 @@ public: void LLPanelPeople::loadFacebookFriends() { - LLHTTPClient::get(getFacebookConnectURL("/friends"), new FacebookFriendsResponder(this)); + LLHTTPClient::get(getFacebookConnectURL("/friend"), new FacebookFriendsResponder(this)); } void LLPanelPeople::tryToReconnectToFacebook() { if (!mConnectedToFbc) { - LLHTTPClient::get(getFacebookConnectURL(), new FacebookConnectedResponder(this, false)); + LLHTTPClient::get(getFacebookConnectURL("/connection"), new FacebookConnectedResponder(this, false)); } } void LLPanelPeople::connectToFacebook(const std::string& auth_code) { LLSD body; - body["agent_id"] = gAgentID.asString(); body["code"] = auth_code; body["redirect_uri"] = getFacebookRedirectURL(); - LLHTTPClient::post(getFacebookConnectURL("/connect"), body, new FacebookConnectResponder(this)); + LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new FacebookConnectResponder(this)); } void LLPanelPeople::disconnectFromFacebook() { - LLSD body; - body["agent_id"] = gAgentID.asString(); - LLHTTPClient::post(getFacebookConnectURL("/disconnect"), body, new FacebookDisconnectResponder(this)); + LLHTTPClient::del(getFacebookConnectURL("/connection"), new FacebookDisconnectResponder(this)); } std::string LLPanelPeople::getFacebookConnectURL(const std::string& route) @@ -1789,7 +1763,7 @@ void LLPanelPeople::onLoginFbcButtonClicked() } else { - LLHTTPClient::get(getFacebookConnectURL(), new FacebookConnectedResponder(this, true)); + LLHTTPClient::get(getFacebookConnectURL("/connection"), new FacebookConnectedResponder(this, true)); } } -- cgit v1.2.3 From 7f0798fd6dad069aca44b954aa0fb7e49d42198c Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 16 Apr 2013 19:34:40 -0700 Subject: adding a new tab in people panel that has a folder view --- indra/newview/llconversationmodel.cpp | 1 + indra/newview/llpanelpeople.cpp | 142 +++++++++++++++++++++ indra/newview/llpanelpeople.h | 18 ++- .../newview/skins/default/xui/en/panel_people.xml | 13 ++ 4 files changed, 173 insertions(+), 1 deletion(-) diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index c74ce24872..ed434d82d5 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -95,6 +95,7 @@ void LLConversationItem::postEvent(const std::string& event_type, LLConversation LLUUID participant_id = (participant ? participant->getUUID() : LLUUID()); LLSD event(LLSDMap("type", event_type)("session_uuid", session_id)("participant_uuid", participant_id)); LLEventPumps::instance().obtain("ConversationsEvents").post(event); + LLEventPumps::instance().obtain("ConversationsEventsTwo").post(event); } // Virtual action callbacks diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 519868612a..6864381404 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -28,6 +28,8 @@ // libs #include "llavatarname.h" +#include "llconversationview.h" +#include "llfloaterimcontainer.h" #include "llfloaterreg.h" #include "llfloatersidepanelcontainer.h" #include "llmenubutton.h" @@ -48,7 +50,9 @@ #include "llavataractions.h" #include "llavatarlist.h" #include "llavatarlistitem.h" +#include "llavatarnamecache.h" #include "llcallingcard.h" // for LLAvatarTracker +#include "llcallbacklist.h" #include "llerror.h" #include "llfloateravatarpicker.h" //#include "llfloaterminiinspector.h" @@ -58,6 +62,7 @@ #include "llinventoryobserver.h" #include "llnetmap.h" #include "llpanelpeoplemenus.h" +#include "llparticipantlist.h" #include "llsidetraypanelcontainer.h" #include "llrecentpeople.h" #include "llviewercontrol.h" // for gSavedSettings @@ -78,6 +83,7 @@ static const std::string GROUP_TAB_NAME = "groups_panel"; static const std::string RECENT_TAB_NAME = "recent_panel"; static const std::string BLOCKED_TAB_NAME = "blocked_panel"; // blocked avatars static const std::string FBCTEST_TAB_NAME = "fbctest_panel"; +static const std::string FBCTESTTWO_TAB_NAME = "fbctesttwo_panel"; static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com/fbc"; @@ -540,6 +546,8 @@ private: LLPanelPeople::LLPanelPeople() : LLPanel(), mConnectedToFbc(false), + mConversationsRoot(NULL), + mConversationsEventStream("ConversationsEventsTwo"), mTryToConnectToFbc(true), mTabContainer(NULL), mOnlineFriendList(NULL), @@ -595,6 +603,8 @@ LLPanelPeople::~LLPanelPeople() } if (mFbcTestBrowserHandle.get()) mFbcTestBrowserHandle.get()->die(); + + mConversationsEventStream.stopListening("ConversationsRefresh"); } void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LLSD& param, LLAvatarList* avatar_list) @@ -678,6 +688,61 @@ BOOL LLPanelPeople::postBuild() mFacebookFriends = social_tab->getChild("facebook_friends"); social_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFbcTestListUpdater, _2)); + //===Test START======================================================================== + + LLPanel * socialtwo_tab = getChild(FBCTESTTWO_TAB_NAME); + + //Create folder view + LLConversationItem* base_item = new LLConversationItem(mConversationViewModel); + + LLFolderView::Params folder_view_params(LLUICtrlFactory::getDefaultParams()); + folder_view_params.rect.left(0).right(0).top(0).bottom(0); + folder_view_params.parent_panel = friends_tab; + folder_view_params.listener = base_item; + folder_view_params.view_model = &mConversationViewModel; + folder_view_params.root = NULL; + folder_view_params.use_ellipses = false; + folder_view_params.options_menu = "menu_conversation.xml"; + folder_view_params.name = "fbcfolderview"; + mConversationsRoot = LLUICtrlFactory::create(folder_view_params); + mConversationsEventStream.listen("ConversationsRefresh", boost::bind(&LLPanelPeople::onConversationModelEvent, this, _1)); + + //Create scroller + LLRect scroller_view_rect = socialtwo_tab->getRect(); + //scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom); + LLScrollContainer::Params scroller_params(LLUICtrlFactory::getDefaultParams()); + scroller_params.rect(scroller_view_rect); + + LLScrollContainer* scroller = LLUICtrlFactory::create(scroller_params); + socialtwo_tab->addChildInBack(scroller); + scroller->addChild(mConversationsRoot); + scroller->setFollowsAll(); + mConversationsRoot->setScrollContainer(scroller); + mConversationsRoot->setFollowsAll(); + + //Create a session + //LLSpeakerMgr* speaker_manager = (LLSpeakerMgr*)LLLocalSpeakerMgr::getInstance(); + LLConversationItemSession* item = new LLConversationItemSession(LLUUID(NULL), mConversationViewModel); + item->renameItem("Facebook Friends"); + LLConversationViewSession::Params params; + + params.name = item->getDisplayName(); + params.root = mConversationsRoot; + params.listener = item; + params.tool_tip = params.name; + params.container = LLFloaterIMContainer::getInstance(); + LLConversationViewSession * widget = LLUICtrlFactory::create(params); + widget->addToFolder(mConversationsRoot); + + mConversationsItems[LLUUID(NULL)] = item; + mConversationsWidgits[LLUUID(NULL)] = widget; + + gIdleCallbacks.addFunction(idle, this); + + //===Test END======================================================================== + + + setSortOrder(mRecentList, (ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"), false); setSortOrder(mAllFriendList, (ESortOrder)gSavedSettings.getU32("FriendsSortOrder"), false); setSortOrder(mNearbyList, (ESortOrder)gSavedSettings.getU32("NearbyPeopleSortOrder"), false); @@ -757,6 +822,12 @@ void LLPanelPeople::onChange(EStatusType status, const std::string &channelURI, updateButtons(); } +void LLPanelPeople::idle(void * user_data) +{ + LLPanelPeople * self = static_cast(user_data); + self->mConversationsRoot->update(); +} + void LLPanelPeople::updateFriendListHelpText() { // show special help text for just created account to help finding friends. EXT-4836 @@ -999,6 +1070,10 @@ LLUUID LLPanelPeople::getCurrentItemID() const if (cur_tab == FBCTEST_TAB_NAME) return LLUUID::null; + if (cur_tab == FBCTESTTWO_TAB_NAME) + return LLUUID::null; + + llassert(0 && "unknown tab selected"); return LLUUID::null; } @@ -1023,6 +1098,8 @@ void LLPanelPeople::getCurrentItemIDs(uuid_vec_t& selected_uuids) const selected_uuids.clear(); // FIXME? else if (cur_tab == FBCTEST_TAB_NAME) return; + else if (cur_tab == FBCTESTTWO_TAB_NAME) + return; else llassert(0 && "unknown tab selected"); @@ -1576,6 +1653,49 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name) return isAccordionCollapsedByUser(getChild(name)); } +bool LLPanelPeople::onConversationModelEvent(const LLSD& event) +{ + std::string type = event.get("type").asString(); + LLUUID session_id = event.get("session_uuid").asUUID(); + LLUUID participant_id = event.get("participant_uuid").asUUID(); + + if(type == "add_participant") + { + LLConversationItemSession * session_model = dynamic_cast(mConversationsItems[session_id]); + LLConversationViewSession * session_view = dynamic_cast(mConversationsWidgits[session_id]); + LLConversationItemParticipant * participant_model = session_model->findParticipant(participant_id); + + if(participant_model) + { + LLConversationViewParticipant * participant_view = createConversationViewParticipant(participant_model); + participant_view->addToFolder(session_view); + } + + + llinfos << "adding!!!!!!" << llendl; + } + + return false; +} + +LLConversationViewParticipant * LLPanelPeople::createConversationViewParticipant(LLConversationItem * item) +{ + LLConversationViewParticipant::Params params; + LLRect panel_rect = getChild(FBCTESTTWO_TAB_NAME)->getRect(); + + params.name = item->getDisplayName(); + params.root = mConversationsRoot; + params.listener = item; + + //24 is the the current hight of an item (itemHeight) loaded from conversation_view_participant.xml. + params.rect = LLRect (0, 24, panel_rect.getWidth(), 0); + params.tool_tip = params.name; + params.participant_id = item->getUUID(); + params.folder_indentation = 2; + + return LLUICtrlFactory::create(params); +} + void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p) { LLFloater* browser = LLFloaterReg::showInstance("web_content", p); @@ -1601,6 +1721,28 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) } } +void LLPanelPeople::addTestParticipant() +{ + for(int i = 0; i < 300; ++i) + { + LLConversationItemSession * session_model = dynamic_cast(mConversationsItems[LLUUID(NULL)]); + addParticipantToModel(session_model, LLUUID().generateNewID(), "Test"); + } + } + +void LLPanelPeople::addParticipantToModel(LLConversationItemSession * session_model, const LLUUID& agent_id, const std::string& name) +{ + LLConversationItemParticipant* participant = NULL; + + // Create a participant model + LLAvatarName avatar_name; + bool has_name = LLAvatarNameCache::get(agent_id, &avatar_name); + std::string avatar_name_string = has_name ? name + " (" + avatar_name.getDisplayName() + ")" : name; + + participant = new LLConversationItemParticipant(avatar_name_string , agent_id, mConversationViewModel); + session_model->addParticipant(participant); +} + void LLPanelPeople::hideFacebookFriends() { mFacebookFriends->clear(); diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index e9581bb5f3..b4582d9a3e 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -22,7 +22,7 @@ * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ - */ + */ #ifndef LL_LLPANELPEOPLE_H #define LL_LLPANELPEOPLE_H @@ -30,6 +30,8 @@ #include #include "llcallingcard.h" // for avatar tracker +#include "llconversationmodel.h" +#include "llevents.h" #include "llfloaterwebcontent.h" #include "llvoiceclient.h" @@ -41,6 +43,7 @@ class LLGroupList; class LLSocialList; class LLMenuButton; class LLTabContainer; +class LLFolderView; class LLPanelPeople : public LLPanel @@ -58,8 +61,12 @@ public: // when voice is available /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal); + static void idle(void * user_data); + void openFacebookWeb(LLFloaterWebContent::Params& p); void showFacebookFriends(const LLSD& friends); + void addTestParticipant(); + void addParticipantToModel(LLConversationItemSession * session_model, const LLUUID& agent_id, const std::string& name); void hideFacebookFriends(); void loadFacebookFriends(); void tryToReconnectToFacebook(); @@ -149,6 +156,9 @@ private: bool isAccordionCollapsedByUser(LLUICtrl* acc_tab); bool isAccordionCollapsedByUser(const std::string& name); + bool onConversationModelEvent(const LLSD& event); + LLConversationViewParticipant * createConversationViewParticipant(LLConversationItem * item); + LLTabContainer* mTabContainer; LLAvatarList* mOnlineFriendList; LLAvatarList* mAllFriendList; @@ -170,6 +180,12 @@ private: Updater* mButtonsUpdater; LLMenuButton* mFBCGearButton; LLHandle< LLFloater > mPicker; + + conversations_items_map mConversationsItems; + conversations_widgets_map mConversationsWidgits; + LLConversationViewModel mConversationViewModel; + LLFolderView* mConversationsRoot; + LLEventStream mConversationsEventStream; }; #endif //LL_LLPANELPEOPLE_H diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 08c8aef1e9..c4db547a8e 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -725,5 +725,18 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M /> + -- cgit v1.2.3 From 0eb2248f55c835e51705c4dc026e177f3930c5db Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 16 Apr 2013 22:36:32 -0700 Subject: made a separate button to add test users to the folder view list. Also when receiving facebook friends both the avatarlist and folderview will be populated. --- indra/newview/llpanelpeople.cpp | 13 +++++++++---- indra/newview/skins/default/xui/en/menu_gear_fbc.xml | 9 ++++++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 94b60ca2d6..34d565bbaa 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -567,7 +567,7 @@ LLPanelPeople::LLPanelPeople() mCommitCallbackRegistrar.add("People.requestFBC", boost::bind(&LLPanelPeople::onFacebookAppRequestClicked, this)); mCommitCallbackRegistrar.add("People.sendFBC", boost::bind(&LLPanelPeople::onFacebookAppSendClicked, this)); mCommitCallbackRegistrar.add("People.testaddFBC", boost::bind(&LLPanelPeople::onFacebookTestAddClicked, this)); - + mCommitCallbackRegistrar.add("People.testaddFBCFolderView", boost::bind(&LLPanelPeople::addTestParticipant, this)); mCommitCallbackRegistrar.add("People.AddFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this)); mCommitCallbackRegistrar.add("People.AddFriendWizard", boost::bind(&LLPanelPeople::onAddFriendWizButtonClicked, this)); @@ -1670,9 +1670,6 @@ bool LLPanelPeople::onConversationModelEvent(const LLSD& event) LLConversationViewParticipant * participant_view = createConversationViewParticipant(participant_model); participant_view->addToFolder(session_view); } - - - llinfos << "adding!!!!!!" << llendl; } return false; @@ -1717,7 +1714,15 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) std::string name = i->second["name"].asString(); LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); + //add to avatar list mFacebookFriends->addNewItem(agent_id, name, false); + + //Add to folder view + LLConversationItemSession * session_model = dynamic_cast(mConversationsItems[LLUUID(NULL)]); + if(session_model) + { + addParticipantToModel(session_model, agent_id, name); + } } } diff --git a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml index 4d8cbb432e..d73cee344b 100644 --- a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml +++ b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml @@ -28,10 +28,17 @@ parameter="http://www.facebook.com/settings?tab=applications" /> + + + \ No newline at end of file -- cgit v1.2.3 From 6742d90d39fbb5c5bc3b675f37841fd6c8ec09c9 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 17 Apr 2013 11:17:46 -0700 Subject: Some minor cleanups while hunting crashes. Reviewed by Kelly --- indra/llcommon/llcommon.cpp | 1 + indra/llcommon/llinstancetracker.h | 8 +++++++- indra/llcommon/llthread.cpp | 3 ++- indra/llcommon/llthread.h | 2 ++ indra/newview/llflexibleobject.cpp | 5 ++++- indra/newview/llviewerobject.h | 18 ++++++++++-------- 6 files changed, 26 insertions(+), 11 deletions(-) diff --git a/indra/llcommon/llcommon.cpp b/indra/llcommon/llcommon.cpp index 8be9e4f4de..b938b0e65a 100644 --- a/indra/llcommon/llcommon.cpp +++ b/indra/llcommon/llcommon.cpp @@ -44,6 +44,7 @@ void LLCommon::initClass() } LLTimer::initClass(); LLThreadSafeRefCount::initThreadSafeRefCount(); + assert_main_thread(); // Make sure we record the main thread // LLWorkerThread::initClass(); // LLFrameCallbackManager::initClass(); } diff --git a/indra/llcommon/llinstancetracker.h b/indra/llcommon/llinstancetracker.h index 0f952f56ac..b290526754 100644 --- a/indra/llcommon/llinstancetracker.h +++ b/indra/llcommon/llinstancetracker.h @@ -102,6 +102,8 @@ protected: }; }; +LL_COMMON_API void assert_main_thread(); + /// This mix-in class adds support for tracking all instances of the specified class parameter T /// The (optional) key associates a value of type KEY with a given instance of T, for quick lookup /// If KEY is not provided, then instances are stored in a simple set @@ -116,7 +118,11 @@ class LLInstanceTracker : public LLInstanceTrackerBase InstanceMap sMap; }; static StaticData& getStatic() { return LLInstanceTrackerBase::getStatic(); } - static InstanceMap& getMap_() { return getStatic().sMap; } + static InstanceMap& getMap_() + { + // assert_main_thread(); fwiw this class is not thread safe, and it used by multiple threads. Bad things happen. + return getStatic().sMap; + } public: class instance_iter : public boost::iterator_facade diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index 6c117f7daf..60adeeaeb7 100644 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -67,7 +67,8 @@ LL_COMMON_API void assert_main_thread() static U32 s_thread_id = LLThread::currentID(); if (LLThread::currentID() != s_thread_id) { - llerrs << "Illegal execution outside main thread." << llendl; + llwarns << "Illegal execution from thread id " << (S32) LLThread::currentID() + << " outside main thread " << (S32) s_thread_id << llendl; } } diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index 8c95b1c0e5..11594f276e 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -311,4 +311,6 @@ public: //============================================================================ +extern LL_COMMON_API void assert_main_thread(); + #endif // LL_LLTHREAD_H diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index bf479dc92e..98c0c0bf51 100644 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -294,6 +294,9 @@ void LLVolumeImplFlexible::onSetVolume(const LLVolumeParams &volume_params, cons void LLVolumeImplFlexible::updateRenderRes() { + if (!mAttributes) + return; + LLDrawable* drawablep = mVO->mDrawable; S32 new_res = mAttributes->getSimulateLOD(); @@ -435,7 +438,7 @@ void LLVolumeImplFlexible::doFlexibleUpdate() } } - if(!mInitialized) + if(!mInitialized || !mAttributes) { //the object is not visible return ; diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 1b4291a1d1..40e09a4f41 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -112,14 +112,6 @@ class LLViewerObject : public LLPrimitive, public LLRefCount, public LLGLUpdate protected: ~LLViewerObject(); // use unref() - // TomY: Provide for a list of extra parameter structures, mapped by structure name - struct ExtraParameter - { - BOOL in_use; - LLNetworkData *data; - }; - std::map mExtraParameterList; - public: typedef std::list > child_list_t; typedef std::list > vobj_list_t; @@ -545,6 +537,8 @@ public: std::vector mUnselectedChildrenPositions ; private: + // TomY: Provide for a list of extra parameter structures, mapped by structure name + struct ExtraParameter; ExtraParameter* createNewParameterEntry(U16 param_type); ExtraParameter* getExtraParameterEntry(U16 param_type) const; ExtraParameter* getExtraParameterEntryCreate(U16 param_type); @@ -782,6 +776,14 @@ private: LLUUID mAttachmentItemID; // ItemID of the associated object is in user inventory. EObjectUpdateType mLastUpdateType; BOOL mLastUpdateCached; + + // TomY: Provide for a list of extra parameter structures, mapped by structure name + struct ExtraParameter + { + BOOL in_use; + LLNetworkData *data; + }; + std::map mExtraParameterList; }; /////////////////// -- cgit v1.2.3 From 57d88fdccb397257642530b36cbe918df65b41f4 Mon Sep 17 00:00:00 2001 From: Simon Linden Date: Thu, 18 Apr 2013 18:22:57 -0700 Subject: MAINT-2605 : Eliminate LLControlGroup::set warning in log when starting the viewer --- indra/newview/app_settings/settings.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 75c38ad62f..8e4bf2a384 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -14525,5 +14525,18 @@ Value 0 + + VersionChannelName + + Comment + Version information generated by running the viewer + Persist + 1 + Type + String + Value + + + -- cgit v1.2.3 From b7235f1a4492bf4365d241e239eb49fb3ae8bb3e Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 22 Apr 2013 14:35:07 -0400 Subject: MAINT-2612: Remove no-longer-valid unused-var warning suppressions. Somehow viewer-cat acquired a lot of source lines (in several different files) of the form: (void)somevar; where ?somevar? was not declared. Apparently someone introduced an unused declaration of ?somevar?, encountered unused-variable warnings, introduced the (void) casts to suppress those warnings, then deleted the declarations -- without deleting the (void) casts. It seems worth noting that the resulting code should not have compiled successfully on any platform. --- indra/test/io.cpp | 1 - indra/test/llstreamtools_tut.cpp | 7 ------- indra/test/lltemplatemessagebuilder_tut.cpp | 1 - 3 files changed, 9 deletions(-) diff --git a/indra/test/io.cpp b/indra/test/io.cpp index 62e516accb..47a67deed0 100644 --- a/indra/test/io.cpp +++ b/indra/test/io.cpp @@ -1141,7 +1141,6 @@ namespace tut ensure("Connected to server", connected); lldebugs << "connected" << llendl; pump_loop(mPump,0.1f); - (void)elapsed; count = mPump->runningChains(); ensure_equals("server chain onboard", count, 2); lldebugs << "** Client is connected." << llendl; diff --git a/indra/test/llstreamtools_tut.cpp b/indra/test/llstreamtools_tut.cpp index a9bb15d911..354c3dfe10 100644 --- a/indra/test/llstreamtools_tut.cpp +++ b/indra/test/llstreamtools_tut.cpp @@ -389,13 +389,10 @@ namespace tut is.str(str = " First Second \t \r \n Third Fourth-ShouldThisBePartOfFourth Fifth\n"); actual_result = ""; get_word(actual_result, is); // First - (void)ret; actual_result = ""; get_word(actual_result, is); // Second - (void)ret; actual_result = ""; get_word(actual_result, is); // Third - (void)ret; // the current implementation of get_word seems inconsistent with // skip_to_next_word. skip_to_next_word treats any character other @@ -486,7 +483,6 @@ namespace tut is.str(str = "First Second \t \r\n Third Fourth-ShouldThisBePartOfFourth IsThisFifth\n"); actual_result = ""; get_line(actual_result, is); - (void)ret; expected_result = "First Second \t \r\n"; ensure_equals("get_line: 1", actual_result, expected_result); @@ -551,7 +547,6 @@ namespace tut is.str(str = "Should not skip lone \r.\r\n"); actual_result = ""; get_line(actual_result, is); - (void)ret; expected_result = "Should not skip lone \r.\r\n"; ensure_equals("get_line: carriage return skipped even though not followed by newline", actual_result, expected_result); } @@ -569,7 +564,6 @@ namespace tut is.str(str = "\n"); actual_result = ""; get_line(actual_result, is); - (void)ret; expected_result = "\n"; ensure_equals("get_line: Just newline", actual_result, expected_result); } @@ -588,7 +582,6 @@ namespace tut is.str(str = "First Line.\nSecond Line.\n"); actual_result = ""; get_line(actual_result, is, 255); - (void)ret; expected_result = "First Line.\n"; ensure_equals("get_line: Basic Operation", actual_result, expected_result); diff --git a/indra/test/lltemplatemessagebuilder_tut.cpp b/indra/test/lltemplatemessagebuilder_tut.cpp index 3d3edab102..dde70f98c8 100644 --- a/indra/test/lltemplatemessagebuilder_tut.cpp +++ b/indra/test/lltemplatemessagebuilder_tut.cpp @@ -963,7 +963,6 @@ namespace tut memset(buffer, 0xcc, bufferSize); reader->getString(_PREHASH_Test1, _PREHASH_Test0, bufferSize, outBuffer); - (void)outValue2; ensure_equals("Ensure present value ", outValue, inValue); ensure_equals("Ensure unchanged buffer ", strlen(outBuffer), 0); delete reader; -- cgit v1.2.3 From 4bd3fef6f7018a0092c02aeba61af43265d12ceb Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Mon, 22 Apr 2013 13:29:33 -0700 Subject: MAINT-2612 fix issues between extern C linkage and yyval ifdefs on Mac with toolchain > 4.5.1 --- indra/lscript/lscript_compile/indra.l | 8 +++++++- indra/lscript/lscript_compile/indra.y | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/indra/lscript/lscript_compile/indra.l b/indra/lscript/lscript_compile/indra.l index 0d93f5cba2..ab0d31ec46 100644 --- a/indra/lscript/lscript_compile/indra.l +++ b/indra/lscript/lscript_compile/indra.l @@ -79,11 +79,17 @@ void parse_string(); #define yyfree indra_free +#if LL_DARWIN +int yyparse( void ); +int yylex( void ); +int yyerror(const char *fmt, ...); +#else #if defined(__cplusplus) -extern "C" { int yylex( void ); } extern "C" { int yyparse( void ); } +extern "C" { int yylex( void ); } extern "C" { int yyerror(const char *fmt, ...); } #endif +#endif %} diff --git a/indra/lscript/lscript_compile/indra.y b/indra/lscript/lscript_compile/indra.y index e4b10ffdd9..8df0e8ad83 100644 --- a/indra/lscript/lscript_compile/indra.y +++ b/indra/lscript/lscript_compile/indra.y @@ -2,8 +2,10 @@ #include "linden_common.h" #include "lscript_tree.h" - #ifdef __cplusplus + #if !LL_DARWIN + #ifdef __cplusplus extern "C" { + #endif #endif int yylex(void); @@ -20,9 +22,11 @@ #pragma warning( disable : 4065 ) // warning: switch statement contains 'default' but no 'case' labels #endif + #if !LL_DARWIN #ifdef __cplusplus } #endif + #endif %} %union -- cgit v1.2.3 From a505c3734a4a3f644500558030b4496d3cb5a5b5 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 22 Apr 2013 18:08:36 -0700 Subject: ACME 162: Implemented a foundation model for the facebook connect folder view. --- indra/newview/CMakeLists.txt | 4 + indra/newview/llconversationmodel.cpp | 1 - indra/newview/llpanelpeople.cpp | 80 +++++------ indra/newview/llpanelpeople.h | 16 ++- indra/newview/llpersonfolderview.cpp | 126 ++++++++++++++++ indra/newview/llpersonfolderview.h | 93 ++++++++++++ indra/newview/llpersonmodelcommon.cpp | 158 +++++++++++++++++++++ indra/newview/llpersonmodelcommon.h | 132 +++++++++++++++++ .../default/xui/en/widgets/person_folder_view.xml | 13 ++ 9 files changed, 577 insertions(+), 46 deletions(-) create mode 100644 indra/newview/llpersonfolderview.cpp create mode 100644 indra/newview/llpersonfolderview.h create mode 100644 indra/newview/llpersonmodelcommon.cpp create mode 100644 indra/newview/llpersonmodelcommon.h create mode 100644 indra/newview/skins/default/xui/en/widgets/person_folder_view.xml diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 02ab1c9ff1..84e8811ce8 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -452,6 +452,8 @@ set(viewer_SOURCE_FILES llpathfindingobjectlist.cpp llpathfindingpathtool.cpp llpersistentnotificationstorage.cpp + llpersonmodelcommon.cpp + llpersonfolderview.cpp llphysicsmotion.cpp llphysicsshapebuilderutil.cpp llplacesinventorybridge.cpp @@ -1029,6 +1031,8 @@ set(viewer_HEADER_FILES llpathfindingobjectlist.h llpathfindingpathtool.h llpersistentnotificationstorage.h + llpersonmodelcommon.h + llpersonfolderview.h llphysicsmotion.h llphysicsshapebuilderutil.h llplacesinventorybridge.h diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index ed434d82d5..c74ce24872 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -95,7 +95,6 @@ void LLConversationItem::postEvent(const std::string& event_type, LLConversation LLUUID participant_id = (participant ? participant->getUUID() : LLUUID()); LLSD event(LLSDMap("type", event_type)("session_uuid", session_id)("participant_uuid", participant_id)); LLEventPumps::instance().obtain("ConversationsEvents").post(event); - LLEventPumps::instance().obtain("ConversationsEventsTwo").post(event); } // Virtual action callbacks diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 34d565bbaa..d2d1e602be 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -63,6 +63,8 @@ #include "llnetmap.h" #include "llpanelpeoplemenus.h" #include "llparticipantlist.h" +#include "llpersonmodelcommon.h" +#include "llpersonfolderview.h" #include "llsidetraypanelcontainer.h" #include "llrecentpeople.h" #include "llviewercontrol.h" // for gSavedSettings @@ -696,7 +698,6 @@ BOOL LLPanelPeople::postBuild() LLConversationItem* base_item = new LLConversationItem(mConversationViewModel); LLFolderView::Params folder_view_params(LLUICtrlFactory::getDefaultParams()); - folder_view_params.rect.left(0).right(0).top(0).bottom(0); folder_view_params.parent_panel = friends_tab; folder_view_params.listener = base_item; folder_view_params.view_model = &mConversationViewModel; @@ -709,7 +710,9 @@ BOOL LLPanelPeople::postBuild() //Create scroller LLRect scroller_view_rect = socialtwo_tab->getRect(); - //scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom); + scroller_view_rect.mTop -= 4; + scroller_view_rect.mRight -=6; + scroller_view_rect.mLeft += 2; LLScrollContainer::Params scroller_params(LLUICtrlFactory::getDefaultParams()); scroller_params.rect(scroller_view_rect); @@ -722,21 +725,18 @@ BOOL LLPanelPeople::postBuild() //Create a session //LLSpeakerMgr* speaker_manager = (LLSpeakerMgr*)LLLocalSpeakerMgr::getInstance(); - LLConversationItemSession* item = new LLConversationItemSession(LLUUID(NULL), mConversationViewModel); - item->renameItem("Facebook Friends"); - LLConversationViewSession::Params params; - + LLPersonFolderModel* item = new LLPersonFolderModel("Facebook Friends", mConversationViewModel); + LLPersonFolderView::Params params; params.name = item->getDisplayName(); params.root = mConversationsRoot; params.listener = item; params.tool_tip = params.name; - params.container = LLFloaterIMContainer::getInstance(); - LLConversationViewSession * widget = LLUICtrlFactory::create(params); + LLPersonFolderView * widget = LLUICtrlFactory::create(params); widget->addToFolder(mConversationsRoot); - mConversationsItems[LLUUID(NULL)] = item; - mConversationsWidgits[LLUUID(NULL)] = widget; - + mPersonFolderModelMap[item->getID()] = item; + mPersonFolderViewMap[item->getID()] = widget; + gIdleCallbacks.addFunction(idle, this); //===Test END======================================================================== @@ -1656,28 +1656,32 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name) bool LLPanelPeople::onConversationModelEvent(const LLSD& event) { std::string type = event.get("type").asString(); - LLUUID session_id = event.get("session_uuid").asUUID(); - LLUUID participant_id = event.get("participant_uuid").asUUID(); + LLUUID folder_id = event.get("folder_id").asUUID(); + LLUUID person_id = event.get("person_id").asUUID(); if(type == "add_participant") { - LLConversationItemSession * session_model = dynamic_cast(mConversationsItems[session_id]); - LLConversationViewSession * session_view = dynamic_cast(mConversationsWidgits[session_id]); - LLConversationItemParticipant * participant_model = session_model->findParticipant(participant_id); - - if(participant_model) + LLPersonFolderModel * person_folder_model = dynamic_cast(mPersonFolderModelMap[folder_id]); + LLPersonFolderView * person_folder_view = dynamic_cast(mPersonFolderViewMap[person_id]); + + if(person_folder_model) { - LLConversationViewParticipant * participant_view = createConversationViewParticipant(participant_model); - participant_view->addToFolder(session_view); + LLPersonModel * person_model = person_folder_model->findParticipant(person_id); + + if(person_model) + { + LLPersonView * participant_view = createConversationViewParticipant(person_model); + participant_view->addToFolder(person_folder_view); + } } } return false; } -LLConversationViewParticipant * LLPanelPeople::createConversationViewParticipant(LLConversationItem * item) +LLPersonView * LLPanelPeople::createConversationViewParticipant(LLPersonModel * item) { - LLConversationViewParticipant::Params params; + LLPersonView::Params params; LLRect panel_rect = getChild(FBCTESTTWO_TAB_NAME)->getRect(); params.name = item->getDisplayName(); @@ -1687,10 +1691,9 @@ LLConversationViewParticipant * LLPanelPeople::createConversationViewParticipant //24 is the the current hight of an item (itemHeight) loaded from conversation_view_participant.xml. params.rect = LLRect (0, 24, panel_rect.getWidth(), 0); params.tool_tip = params.name; - params.participant_id = item->getUUID(); params.folder_indentation = 2; - return LLUICtrlFactory::create(params); + return LLUICtrlFactory::create(params); } void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p) @@ -1718,11 +1721,11 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) mFacebookFriends->addNewItem(agent_id, name, false); //Add to folder view - LLConversationItemSession * session_model = dynamic_cast(mConversationsItems[LLUUID(NULL)]); - if(session_model) - { - addParticipantToModel(session_model, agent_id, name); - } + //LLConversationItemSession * session_model = dynamic_cast(mConversationsItems[LLUUID(NULL)]); + //if(session_model) + //{ + // addParticipantToModel(session_model, agent_id, name); + //} } } @@ -1730,22 +1733,17 @@ void LLPanelPeople::addTestParticipant() { for(int i = 0; i < 300; ++i) { - LLConversationItemSession * session_model = dynamic_cast(mConversationsItems[LLUUID(NULL)]); - addParticipantToModel(session_model, LLUUID().generateNewID(), "Test"); - } + LLPersonFolderModel * person_folder_model = dynamic_cast(mPersonFolderModelMap.begin()->second); + addParticipantToModel(person_folder_model, LLUUID().generateNewID(), "EastBayGuy"); } +} -void LLPanelPeople::addParticipantToModel(LLConversationItemSession * session_model, const LLUUID& agent_id, const std::string& name) +void LLPanelPeople::addParticipantToModel(LLPersonFolderModel * person_folder_model, const LLUUID& agent_id, const std::string& name) { - LLConversationItemParticipant* participant = NULL; - - // Create a participant model - LLAvatarName avatar_name; - bool has_name = LLAvatarNameCache::get(agent_id, &avatar_name); - std::string avatar_name_string = has_name ? name + " (" + avatar_name.getDisplayName() + ")" : name; + LLPersonModel* person_model = NULL; - participant = new LLConversationItemParticipant(avatar_name_string , agent_id, mConversationViewModel); - session_model->addParticipant(participant); + person_model = new LLPersonModel(name, mConversationViewModel); + person_folder_model->addParticipant(person_model); } void LLPanelPeople::hideFacebookFriends() diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index b4582d9a3e..935171df2b 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -45,6 +45,14 @@ class LLMenuButton; class LLTabContainer; class LLFolderView; +class LLPersonFolderModel; +class LLPersonFolderView; +class LLPersonView; +class LLPersonModel; + +typedef std::map person_folder_model_map; +typedef std::map person_folder_view_map; + class LLPanelPeople : public LLPanel , public LLVoiceClientStatusObserver @@ -66,7 +74,7 @@ public: void openFacebookWeb(LLFloaterWebContent::Params& p); void showFacebookFriends(const LLSD& friends); void addTestParticipant(); - void addParticipantToModel(LLConversationItemSession * session_model, const LLUUID& agent_id, const std::string& name); + void addParticipantToModel(LLPersonFolderModel * session_model, const LLUUID& agent_id, const std::string& name); void hideFacebookFriends(); void loadFacebookFriends(); void tryToReconnectToFacebook(); @@ -157,7 +165,7 @@ private: bool isAccordionCollapsedByUser(const std::string& name); bool onConversationModelEvent(const LLSD& event); - LLConversationViewParticipant * createConversationViewParticipant(LLConversationItem * item); + LLPersonView * createConversationViewParticipant(LLPersonModel * item); LLTabContainer* mTabContainer; LLAvatarList* mOnlineFriendList; @@ -181,8 +189,8 @@ private: LLMenuButton* mFBCGearButton; LLHandle< LLFloater > mPicker; - conversations_items_map mConversationsItems; - conversations_widgets_map mConversationsWidgits; + person_folder_model_map mPersonFolderModelMap; + person_folder_view_map mPersonFolderViewMap; LLConversationViewModel mConversationViewModel; LLFolderView* mConversationsRoot; LLEventStream mConversationsEventStream; diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp new file mode 100644 index 0000000000..e1f1cbb1fa --- /dev/null +++ b/indra/newview/llpersonfolderview.cpp @@ -0,0 +1,126 @@ +/** +* @file llpersonfolderview.cpp +* @brief Implementation of llpersonfolderview +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "llviewerprecompiledheaders.h" + +#include "llpersonfolderview.h" + +static LLDefaultChildRegistry::Register r_person_folder_view("person_folder_view"); + +const LLColor4U DEFAULT_WHITE(255, 255, 255); + +LLPersonFolderView::Params::Params() +{} + +LLPersonFolderView::LLPersonFolderView(const LLPersonFolderView::Params& p) : +LLFolderViewFolder(p) +{ + +} + +S32 LLPersonFolderView::getLabelXPos() +{ + return getIndentation() + mArrowSize + 15;//Should be a .xml variable but causes crash; +} + +LLPersonFolderView::~LLPersonFolderView() +{ + +} + +void LLPersonFolderView::draw() +{ + static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); + static const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams(); + + static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); + static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE); + static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); + static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("DkGray", DEFAULT_WHITE); + + const LLFontGL * font = LLFontGL::getFontSansSerif(); + F32 text_left = (F32)getLabelXPos(); + F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad; + LLColor4 color = sFgColor; + F32 right_x = 0; + + drawHighlight(false, mIsSelected, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor); + + updateLabelRotation(); + drawOpenFolderArrow(default_params, sFgColor); + + drawLabel(font, text_left, y, color, right_x); + + LLView::draw(); +} + +// +// LLPersonFolderModel +// + + +LLPersonView::Params::Params() +{} + +LLPersonView::LLPersonView(const LLPersonView::Params& p) : +LLFolderViewItem(p) +{ + +} + +S32 LLPersonView::getLabelXPos() +{ + return getIndentation(); +} + +void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) +{ + LLFolderViewItem::addToFolder(person_folder_view); + //Added item to folder, could change folder's mHasVisibleChildren flag so call arrange + person_folder_view->requestArrange(); +} + +LLPersonView::~LLPersonView() +{ + +} + +void LLPersonView::draw() +{ + static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); + static LLUIColor sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE); + + const LLFontGL * font = LLFontGL::getFontSansSerifSmall(); + F32 text_left = (F32)getLabelXPos(); + F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad; + LLColor4 color = color = mIsSelected ? sHighlightFgColor : sFgColor; + F32 right_x = 0; + + drawLabel(font, text_left, y, color, right_x); + + LLView::draw(); +} diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h new file mode 100644 index 0000000000..de032ac674 --- /dev/null +++ b/indra/newview/llpersonfolderview.h @@ -0,0 +1,93 @@ +/** +* @file llpersonfolderview.h +* @brief Header file for llpersonfolderview +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ +#ifndef LL_LLPERSONFOLDERVIEW_H +#define LL_LLPERSONFOLDERVIEW_H + +#include "llavatariconctrl.h" +#include "llfolderviewitem.h" + +class LLPersonFolderView : public LLFolderViewFolder +{ + +public: + + struct Params : public LLInitParam::Block + { + Params(); + }; + + LLPersonFolderView(const LLPersonFolderView::Params& p); + virtual ~LLPersonFolderView(); + + S32 getLabelXPos(); + + +protected: + void draw(); + +private: +}; + +class LLPersonView : public LLFolderViewItem +{ + +public: + + struct Params : public LLInitParam::Block + { + Params(); + }; + + LLPersonView(const LLPersonView::Params& p); + virtual ~LLPersonView(); + + S32 getLabelXPos(); + void addToFolder(LLFolderViewFolder * person_folder_view); + +protected: + void draw(); + +private: + + LLAvatarIconCtrl* mAvatarIcon; + LLButton * mInfoBtn; + + typedef enum e_avatar_item_child { + ALIC_SPEAKER_INDICATOR, + ALIC_INFO_BUTTON, + ALIC_COUNT, + } EAvatarListItemChildIndex; + + static bool sStaticInitialized; // this variable is introduced to improve code readability + static S32 sChildrenWidths[ALIC_COUNT]; + //static void initChildrenWidths(LLConversationViewParticipant* self); + //void updateChildren(); + //LLView* getItemChildView(EAvatarListItemChildIndex child_view_index); +}; + +#endif // LL_LLPERSONFOLDERVIEW_H + diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp new file mode 100644 index 0000000000..62208b98c9 --- /dev/null +++ b/indra/newview/llpersonmodelcommon.cpp @@ -0,0 +1,158 @@ +/** +* @file llavatarfolder.cpp +* @brief Implementation of llavatarfolder +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "llviewerprecompiledheaders.h" + +#include "llpersonmodelcommon.h" + +#include "llevents.h" +#include "llsdutil.h" + +// +// LLPersonModelCommon +// + +LLPersonModelCommon::LLPersonModelCommon(std::string display_name, LLFolderViewModelInterface& root_view_model) : +LLFolderViewModelItemCommon(root_view_model), + mName(display_name) +{ +} + +LLPersonModelCommon::LLPersonModelCommon(LLFolderViewModelInterface& root_view_model) : +LLFolderViewModelItemCommon(root_view_model), + mName(""), + mID(LLUUID().generateNewID()) +{ +} + +LLPersonModelCommon::~LLPersonModelCommon() +{ + +} + +void LLPersonModelCommon::postEvent(const std::string& event_type, LLPersonFolderModel* folder, LLPersonModel* person) +{ + LLUUID folder_id = folder->getID(); + LLUUID person_id = person->getID(); + LLSD event(LLSDMap("type", event_type)("folder_id", folder_id)("person_id", person_id)); + LLEventPumps::instance().obtain("ConversationsEventsTwo").post(event); +} + +// Virtual action callbacks +void LLPersonModelCommon::performAction(LLInventoryModel* model, std::string action) +{ +} + +void LLPersonModelCommon::openItem( void ) +{ +} + +void LLPersonModelCommon::closeItem( void ) +{ +} + +void LLPersonModelCommon::previewItem( void ) +{ +} + +void LLPersonModelCommon::showProperties(void) +{ +} + +// +// LLPersonFolderModel +// + +LLPersonFolderModel::LLPersonFolderModel(std::string display_name, LLFolderViewModelInterface& root_view_model) : +LLPersonModelCommon(display_name,root_view_model) +{ + +} + +LLPersonFolderModel::LLPersonFolderModel(LLFolderViewModelInterface& root_view_model) : +LLPersonModelCommon(root_view_model) +{ + +} + +void LLPersonFolderModel::addParticipant(LLPersonModel* participant) +{ + addChild(participant); + postEvent("add_participant", this, participant); +} + +void LLPersonFolderModel::removeParticipant(LLPersonModel* participant) +{ + removeChild(participant); + postEvent("remove_participant", this, participant); +} + +void LLPersonFolderModel::removeParticipant(const LLUUID& participant_id) +{ + LLPersonModel* participant = findParticipant(participant_id); + if (participant) + { + removeParticipant(participant); + } +} + +void LLPersonFolderModel::clearParticipants() +{ + clearChildren(); +} + +LLPersonModel* LLPersonFolderModel::findParticipant(const LLUUID& person_id) +{ + LLPersonModel * person_model = NULL; + child_list_t::iterator iter; + + for(iter = mChildren.begin(); iter != mChildren.end(); ++iter) + { + person_model = static_cast(*iter); + + if(person_model->getID() == person_id) + { + break; + } + } + + return iter == mChildren.end() ? NULL : person_model; +} + +// +// LLConversationItemParticipant +// + +LLPersonModel::LLPersonModel(std::string display_name, LLFolderViewModelInterface& root_view_model) : +LLPersonModelCommon(display_name,root_view_model) +{ +} + +LLPersonModel::LLPersonModel(LLFolderViewModelInterface& root_view_model) : +LLPersonModelCommon(root_view_model) +{ +} diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h new file mode 100644 index 0000000000..76ea139479 --- /dev/null +++ b/indra/newview/llpersonmodelcommon.h @@ -0,0 +1,132 @@ +/** +* @file llavatarfolder.h +* @brief Header file for llavatarfolder +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ +#ifndef LL_LLPERSONMODELCOMMON_H +#define LL_LLPERSONMODELCOMMON_H + +#include "../llui/llfolderviewitem.h" +#include "../llui/llfolderviewmodel.h" + +class LLPersonFolderModel; +class LLPersonModel; + +// Conversation items: we hold a list of those and create an LLFolderViewItem widget for each +// that we tuck into the mConversationsListPanel. +class LLPersonModelCommon : public LLFolderViewModelItemCommon +{ +public: + + LLPersonModelCommon(std::string name, LLFolderViewModelInterface& root_view_model); + LLPersonModelCommon(LLFolderViewModelInterface& root_view_model); + virtual ~LLPersonModelCommon(); + + // Stub those things we won't really be using in this conversation context + virtual const std::string& getName() const { return mName; } + virtual const std::string& getDisplayName() const { return mName; } + virtual const std::string& getSearchableName() const { return mName; } + virtual LLPointer getIcon() const { return NULL; } + virtual LLPointer getOpenIcon() const { return getIcon(); } + virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; } + virtual std::string getLabelSuffix() const { return LLStringUtil::null; } + virtual BOOL isItemRenameable() const { return TRUE; } + virtual BOOL renameItem(const std::string& new_name) { mName = new_name; return TRUE; } + virtual BOOL isItemMovable( void ) const { return FALSE; } + virtual BOOL isItemRemovable( void ) const { return FALSE; } + virtual BOOL isItemInTrash( void) const { return FALSE; } + virtual BOOL removeItem() { return FALSE; } + virtual void removeBatch(std::vector& batch) { } + virtual void move( LLFolderViewModelItem* parent_listener ) { } + virtual BOOL isItemCopyable() const { return FALSE; } + virtual BOOL copyToClipboard() const { return FALSE; } + virtual BOOL cutToClipboard() const { return FALSE; } + virtual BOOL isClipboardPasteable() const { return FALSE; } + virtual void pasteFromClipboard() { } + virtual void pasteLinkFromClipboard() { } + virtual void buildContextMenu(LLMenuGL& menu, U32 flags) { } + virtual BOOL isUpToDate() const { return TRUE; } + virtual bool hasChildren() const { return FALSE; } + + virtual bool potentiallyVisible() { return true; } + virtual bool filter( LLFolderViewFilter& filter) { return false; } + virtual bool descendantsPassedFilter(S32 filter_generation = -1) { return true; } + virtual void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) { } + virtual bool passedFilter(S32 filter_generation = -1) { return true; } + + // The action callbacks + virtual void performAction(LLInventoryModel* model, std::string action); + virtual void openItem( void ); + virtual void closeItem( void ); + virtual void previewItem( void ); + virtual void selectItem(void) { } + virtual void showProperties(void); + + // This method will be called to determine if a drop can be + // performed, and will set drop to TRUE if a drop is + // requested. + // Returns TRUE if a drop is possible/happened, FALSE otherwise. + virtual BOOL dragOrDrop(MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + std::string& tooltip_msg) { return FALSE; } + + const LLUUID& getID() {return mID;} + void postEvent(const std::string& event_type, LLPersonFolderModel* session, LLPersonModel* participant); + +protected: + + std::string mName; // Name of the session or the participant + LLUUID mID; +}; + +class LLPersonFolderModel : public LLPersonModelCommon +{ +public: + LLPersonFolderModel(std::string display_name, LLFolderViewModelInterface& root_view_model); + LLPersonFolderModel(LLFolderViewModelInterface& root_view_model); + + LLPointer getIcon() const { return NULL; } + void addParticipant(LLPersonModel* participant); + void removeParticipant(LLPersonModel* participant); + void removeParticipant(const LLUUID& participant_id); + void clearParticipants(); + LLPersonModel* findParticipant(const LLUUID& person_id); + +private: +}; + +class LLPersonModel : public LLPersonModelCommon +{ +public: + LLPersonModel(std::string display_name, LLFolderViewModelInterface& root_view_model); + LLPersonModel(LLFolderViewModelInterface& root_view_model); + +private: + +}; + + +#endif // LL_LLPERSONMODELCOMMON_H + diff --git a/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml b/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml new file mode 100644 index 0000000000..bf22230ff9 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml @@ -0,0 +1,13 @@ + + -- cgit v1.2.3 From 74f0d33dc1f81fe3d372da4b11799067349b64e7 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 22 Apr 2013 18:52:03 -0700 Subject: ACME-252: Created a folder view for the facebook connect tab --- indra/newview/llpersonfolderview.cpp | 4 ++-- indra/newview/skins/default/xui/en/widgets/person_folder_view.xml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index e1f1cbb1fa..97b2ce092b 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -43,7 +43,7 @@ LLFolderViewFolder(p) } S32 LLPersonFolderView::getLabelXPos() -{ +{ return getIndentation() + mArrowSize + 15;//Should be a .xml variable but causes crash; } @@ -55,7 +55,7 @@ LLPersonFolderView::~LLPersonFolderView() void LLPersonFolderView::draw() { static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); - static const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams(); + static const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams(); static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE); diff --git a/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml b/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml index bf22230ff9..46857ac700 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml @@ -1,13 +1,13 @@ -- cgit v1.2.3 From f8ce67f0e0cd9afe8bd9542ea97d01769b690ffa Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 23 Apr 2013 12:23:09 -0700 Subject: ACME-251 Create AvatarFolderItemView: Changed classes name from LLPersonFolder* to LLPersonTab* --- indra/newview/CMakeLists.txt | 4 +- indra/newview/llpanelpeople.cpp | 16 +-- indra/newview/llpanelpeople.h | 10 +- indra/newview/llpersonfolderview.cpp | 126 --------------------- indra/newview/llpersonfolderview.h | 93 --------------- indra/newview/llpersonmodelcommon.cpp | 20 ++-- indra/newview/llpersonmodelcommon.h | 10 +- indra/newview/llpersontabview.cpp | 126 +++++++++++++++++++++ indra/newview/llpersontabview.h | 93 +++++++++++++++ .../default/xui/en/widgets/person_folder_view.xml | 13 --- .../default/xui/en/widgets/person_tab_view.xml | 13 +++ 11 files changed, 262 insertions(+), 262 deletions(-) delete mode 100644 indra/newview/llpersonfolderview.cpp delete mode 100644 indra/newview/llpersonfolderview.h create mode 100644 indra/newview/llpersontabview.cpp create mode 100644 indra/newview/llpersontabview.h delete mode 100644 indra/newview/skins/default/xui/en/widgets/person_folder_view.xml create mode 100644 indra/newview/skins/default/xui/en/widgets/person_tab_view.xml diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 84e8811ce8..145affeb60 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -453,7 +453,7 @@ set(viewer_SOURCE_FILES llpathfindingpathtool.cpp llpersistentnotificationstorage.cpp llpersonmodelcommon.cpp - llpersonfolderview.cpp + llpersontabview.cpp llphysicsmotion.cpp llphysicsshapebuilderutil.cpp llplacesinventorybridge.cpp @@ -1032,7 +1032,7 @@ set(viewer_HEADER_FILES llpathfindingpathtool.h llpersistentnotificationstorage.h llpersonmodelcommon.h - llpersonfolderview.h + llpersontabview.h llphysicsmotion.h llphysicsshapebuilderutil.h llplacesinventorybridge.h diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index d2d1e602be..3f4ff39644 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -64,7 +64,7 @@ #include "llpanelpeoplemenus.h" #include "llparticipantlist.h" #include "llpersonmodelcommon.h" -#include "llpersonfolderview.h" +#include "llpersontabview.h" #include "llsidetraypanelcontainer.h" #include "llrecentpeople.h" #include "llviewercontrol.h" // for gSavedSettings @@ -725,13 +725,13 @@ BOOL LLPanelPeople::postBuild() //Create a session //LLSpeakerMgr* speaker_manager = (LLSpeakerMgr*)LLLocalSpeakerMgr::getInstance(); - LLPersonFolderModel* item = new LLPersonFolderModel("Facebook Friends", mConversationViewModel); - LLPersonFolderView::Params params; + LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mConversationViewModel); + LLPersonTabView::Params params; params.name = item->getDisplayName(); params.root = mConversationsRoot; params.listener = item; params.tool_tip = params.name; - LLPersonFolderView * widget = LLUICtrlFactory::create(params); + LLPersonTabView * widget = LLUICtrlFactory::create(params); widget->addToFolder(mConversationsRoot); mPersonFolderModelMap[item->getID()] = item; @@ -1661,8 +1661,8 @@ bool LLPanelPeople::onConversationModelEvent(const LLSD& event) if(type == "add_participant") { - LLPersonFolderModel * person_folder_model = dynamic_cast(mPersonFolderModelMap[folder_id]); - LLPersonFolderView * person_folder_view = dynamic_cast(mPersonFolderViewMap[person_id]); + LLPersonTabModel * person_folder_model = dynamic_cast(mPersonFolderModelMap[folder_id]); + LLPersonTabView * person_folder_view = dynamic_cast(mPersonFolderViewMap[person_id]); if(person_folder_model) { @@ -1733,12 +1733,12 @@ void LLPanelPeople::addTestParticipant() { for(int i = 0; i < 300; ++i) { - LLPersonFolderModel * person_folder_model = dynamic_cast(mPersonFolderModelMap.begin()->second); + LLPersonTabModel * person_folder_model = dynamic_cast(mPersonFolderModelMap.begin()->second); addParticipantToModel(person_folder_model, LLUUID().generateNewID(), "EastBayGuy"); } } -void LLPanelPeople::addParticipantToModel(LLPersonFolderModel * person_folder_model, const LLUUID& agent_id, const std::string& name) +void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model, const LLUUID& agent_id, const std::string& name) { LLPersonModel* person_model = NULL; diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 935171df2b..d112ac2ec7 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -45,13 +45,13 @@ class LLMenuButton; class LLTabContainer; class LLFolderView; -class LLPersonFolderModel; -class LLPersonFolderView; +class LLPersonTabModel; +class LLPersonTabView; class LLPersonView; class LLPersonModel; -typedef std::map person_folder_model_map; -typedef std::map person_folder_view_map; +typedef std::map person_folder_model_map; +typedef std::map person_folder_view_map; class LLPanelPeople : public LLPanel @@ -74,7 +74,7 @@ public: void openFacebookWeb(LLFloaterWebContent::Params& p); void showFacebookFriends(const LLSD& friends); void addTestParticipant(); - void addParticipantToModel(LLPersonFolderModel * session_model, const LLUUID& agent_id, const std::string& name); + void addParticipantToModel(LLPersonTabModel * session_model, const LLUUID& agent_id, const std::string& name); void hideFacebookFriends(); void loadFacebookFriends(); void tryToReconnectToFacebook(); diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp deleted file mode 100644 index 97b2ce092b..0000000000 --- a/indra/newview/llpersonfolderview.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/** -* @file llpersonfolderview.cpp -* @brief Implementation of llpersonfolderview -* @author Gilbert@lindenlab.com -* -* $LicenseInfo:firstyear=2013&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2013, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ - -#include "llviewerprecompiledheaders.h" - -#include "llpersonfolderview.h" - -static LLDefaultChildRegistry::Register r_person_folder_view("person_folder_view"); - -const LLColor4U DEFAULT_WHITE(255, 255, 255); - -LLPersonFolderView::Params::Params() -{} - -LLPersonFolderView::LLPersonFolderView(const LLPersonFolderView::Params& p) : -LLFolderViewFolder(p) -{ - -} - -S32 LLPersonFolderView::getLabelXPos() -{ - return getIndentation() + mArrowSize + 15;//Should be a .xml variable but causes crash; -} - -LLPersonFolderView::~LLPersonFolderView() -{ - -} - -void LLPersonFolderView::draw() -{ - static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); - static const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams(); - - static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); - static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE); - static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); - static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("DkGray", DEFAULT_WHITE); - - const LLFontGL * font = LLFontGL::getFontSansSerif(); - F32 text_left = (F32)getLabelXPos(); - F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad; - LLColor4 color = sFgColor; - F32 right_x = 0; - - drawHighlight(false, mIsSelected, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor); - - updateLabelRotation(); - drawOpenFolderArrow(default_params, sFgColor); - - drawLabel(font, text_left, y, color, right_x); - - LLView::draw(); -} - -// -// LLPersonFolderModel -// - - -LLPersonView::Params::Params() -{} - -LLPersonView::LLPersonView(const LLPersonView::Params& p) : -LLFolderViewItem(p) -{ - -} - -S32 LLPersonView::getLabelXPos() -{ - return getIndentation(); -} - -void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) -{ - LLFolderViewItem::addToFolder(person_folder_view); - //Added item to folder, could change folder's mHasVisibleChildren flag so call arrange - person_folder_view->requestArrange(); -} - -LLPersonView::~LLPersonView() -{ - -} - -void LLPersonView::draw() -{ - static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); - static LLUIColor sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE); - - const LLFontGL * font = LLFontGL::getFontSansSerifSmall(); - F32 text_left = (F32)getLabelXPos(); - F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad; - LLColor4 color = color = mIsSelected ? sHighlightFgColor : sFgColor; - F32 right_x = 0; - - drawLabel(font, text_left, y, color, right_x); - - LLView::draw(); -} diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h deleted file mode 100644 index de032ac674..0000000000 --- a/indra/newview/llpersonfolderview.h +++ /dev/null @@ -1,93 +0,0 @@ -/** -* @file llpersonfolderview.h -* @brief Header file for llpersonfolderview -* @author Gilbert@lindenlab.com -* -* $LicenseInfo:firstyear=2013&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2013, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ -#ifndef LL_LLPERSONFOLDERVIEW_H -#define LL_LLPERSONFOLDERVIEW_H - -#include "llavatariconctrl.h" -#include "llfolderviewitem.h" - -class LLPersonFolderView : public LLFolderViewFolder -{ - -public: - - struct Params : public LLInitParam::Block - { - Params(); - }; - - LLPersonFolderView(const LLPersonFolderView::Params& p); - virtual ~LLPersonFolderView(); - - S32 getLabelXPos(); - - -protected: - void draw(); - -private: -}; - -class LLPersonView : public LLFolderViewItem -{ - -public: - - struct Params : public LLInitParam::Block - { - Params(); - }; - - LLPersonView(const LLPersonView::Params& p); - virtual ~LLPersonView(); - - S32 getLabelXPos(); - void addToFolder(LLFolderViewFolder * person_folder_view); - -protected: - void draw(); - -private: - - LLAvatarIconCtrl* mAvatarIcon; - LLButton * mInfoBtn; - - typedef enum e_avatar_item_child { - ALIC_SPEAKER_INDICATOR, - ALIC_INFO_BUTTON, - ALIC_COUNT, - } EAvatarListItemChildIndex; - - static bool sStaticInitialized; // this variable is introduced to improve code readability - static S32 sChildrenWidths[ALIC_COUNT]; - //static void initChildrenWidths(LLConversationViewParticipant* self); - //void updateChildren(); - //LLView* getItemChildView(EAvatarListItemChildIndex child_view_index); -}; - -#endif // LL_LLPERSONFOLDERVIEW_H - diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp index 62208b98c9..764dd08115 100644 --- a/indra/newview/llpersonmodelcommon.cpp +++ b/indra/newview/llpersonmodelcommon.cpp @@ -54,7 +54,7 @@ LLPersonModelCommon::~LLPersonModelCommon() } -void LLPersonModelCommon::postEvent(const std::string& event_type, LLPersonFolderModel* folder, LLPersonModel* person) +void LLPersonModelCommon::postEvent(const std::string& event_type, LLPersonTabModel* folder, LLPersonModel* person) { LLUUID folder_id = folder->getID(); LLUUID person_id = person->getID(); @@ -84,34 +84,34 @@ void LLPersonModelCommon::showProperties(void) } // -// LLPersonFolderModel +// LLPersonTabModel // -LLPersonFolderModel::LLPersonFolderModel(std::string display_name, LLFolderViewModelInterface& root_view_model) : +LLPersonTabModel::LLPersonTabModel(std::string display_name, LLFolderViewModelInterface& root_view_model) : LLPersonModelCommon(display_name,root_view_model) { } -LLPersonFolderModel::LLPersonFolderModel(LLFolderViewModelInterface& root_view_model) : +LLPersonTabModel::LLPersonTabModel(LLFolderViewModelInterface& root_view_model) : LLPersonModelCommon(root_view_model) { } -void LLPersonFolderModel::addParticipant(LLPersonModel* participant) +void LLPersonTabModel::addParticipant(LLPersonModel* participant) { addChild(participant); postEvent("add_participant", this, participant); } -void LLPersonFolderModel::removeParticipant(LLPersonModel* participant) +void LLPersonTabModel::removeParticipant(LLPersonModel* participant) { removeChild(participant); postEvent("remove_participant", this, participant); } -void LLPersonFolderModel::removeParticipant(const LLUUID& participant_id) +void LLPersonTabModel::removeParticipant(const LLUUID& participant_id) { LLPersonModel* participant = findParticipant(participant_id); if (participant) @@ -120,12 +120,12 @@ void LLPersonFolderModel::removeParticipant(const LLUUID& participant_id) } } -void LLPersonFolderModel::clearParticipants() +void LLPersonTabModel::clearParticipants() { clearChildren(); } -LLPersonModel* LLPersonFolderModel::findParticipant(const LLUUID& person_id) +LLPersonModel* LLPersonTabModel::findParticipant(const LLUUID& person_id) { LLPersonModel * person_model = NULL; child_list_t::iterator iter; @@ -144,7 +144,7 @@ LLPersonModel* LLPersonFolderModel::findParticipant(const LLUUID& person_id) } // -// LLConversationItemParticipant +// LLPersonModel // LLPersonModel::LLPersonModel(std::string display_name, LLFolderViewModelInterface& root_view_model) : diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h index 76ea139479..866d863581 100644 --- a/indra/newview/llpersonmodelcommon.h +++ b/indra/newview/llpersonmodelcommon.h @@ -30,7 +30,7 @@ #include "../llui/llfolderviewitem.h" #include "../llui/llfolderviewmodel.h" -class LLPersonFolderModel; +class LLPersonTabModel; class LLPersonModel; // Conversation items: we hold a list of those and create an LLFolderViewItem widget for each @@ -93,7 +93,7 @@ public: std::string& tooltip_msg) { return FALSE; } const LLUUID& getID() {return mID;} - void postEvent(const std::string& event_type, LLPersonFolderModel* session, LLPersonModel* participant); + void postEvent(const std::string& event_type, LLPersonTabModel* session, LLPersonModel* participant); protected: @@ -101,11 +101,11 @@ protected: LLUUID mID; }; -class LLPersonFolderModel : public LLPersonModelCommon +class LLPersonTabModel : public LLPersonModelCommon { public: - LLPersonFolderModel(std::string display_name, LLFolderViewModelInterface& root_view_model); - LLPersonFolderModel(LLFolderViewModelInterface& root_view_model); + LLPersonTabModel(std::string display_name, LLFolderViewModelInterface& root_view_model); + LLPersonTabModel(LLFolderViewModelInterface& root_view_model); LLPointer getIcon() const { return NULL; } void addParticipant(LLPersonModel* participant); diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp new file mode 100644 index 0000000000..156ff591f9 --- /dev/null +++ b/indra/newview/llpersontabview.cpp @@ -0,0 +1,126 @@ +/** +* @file llpersontabview.cpp +* @brief Implementation of llpersontabview +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "llviewerprecompiledheaders.h" + +#include "llpersontabview.h" + +static LLDefaultChildRegistry::Register r_person_folder_view("person_folder_view"); + +const LLColor4U DEFAULT_WHITE(255, 255, 255); + +LLPersonTabView::Params::Params() +{} + +LLPersonTabView::LLPersonTabView(const LLPersonTabView::Params& p) : +LLFolderViewFolder(p) +{ + +} + +S32 LLPersonTabView::getLabelXPos() +{ + return getIndentation() + mArrowSize + 15;//Should be a .xml variable but causes crash; +} + +LLPersonTabView::~LLPersonTabView() +{ + +} + +void LLPersonTabView::draw() +{ + static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); + static const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams(); + + static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); + static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE); + static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); + static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("DkGray", DEFAULT_WHITE); + + const LLFontGL * font = LLFontGL::getFontSansSerif(); + F32 text_left = (F32)getLabelXPos(); + F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad; + LLColor4 color = sFgColor; + F32 right_x = 0; + + drawHighlight(false, mIsSelected, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor); + + updateLabelRotation(); + drawOpenFolderArrow(default_params, sFgColor); + + drawLabel(font, text_left, y, color, right_x); + + LLView::draw(); +} + +// +// LLPersonView +// + + +LLPersonView::Params::Params() +{} + +LLPersonView::LLPersonView(const LLPersonView::Params& p) : +LLFolderViewItem(p) +{ + +} + +S32 LLPersonView::getLabelXPos() +{ + return getIndentation(); +} + +void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) +{ + LLFolderViewItem::addToFolder(person_folder_view); + //Added item to folder, could change folder's mHasVisibleChildren flag so call arrange + person_folder_view->requestArrange(); +} + +LLPersonView::~LLPersonView() +{ + +} + +void LLPersonView::draw() +{ + static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); + static LLUIColor sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE); + + const LLFontGL * font = LLFontGL::getFontSansSerifSmall(); + F32 text_left = (F32)getLabelXPos(); + F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad; + LLColor4 color = color = mIsSelected ? sHighlightFgColor : sFgColor; + F32 right_x = 0; + + drawLabel(font, text_left, y, color, right_x); + + LLView::draw(); +} diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h new file mode 100644 index 0000000000..9aabad26fc --- /dev/null +++ b/indra/newview/llpersontabview.h @@ -0,0 +1,93 @@ +/** +* @file llpersontabview.h +* @brief Header file for llpersontabview +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ +#ifndef LL_LLPERSONTABVIEW_H +#define LL_LLPERSONTABVIEW_H + +#include "llavatariconctrl.h" +#include "llfolderviewitem.h" + +class LLPersonTabView : public LLFolderViewFolder +{ + +public: + + struct Params : public LLInitParam::Block + { + Params(); + }; + + LLPersonTabView(const LLPersonTabView::Params& p); + virtual ~LLPersonTabView(); + + S32 getLabelXPos(); + + +protected: + void draw(); + +private: +}; + +class LLPersonView : public LLFolderViewItem +{ + +public: + + struct Params : public LLInitParam::Block + { + Params(); + }; + + LLPersonView(const LLPersonView::Params& p); + virtual ~LLPersonView(); + + S32 getLabelXPos(); + void addToFolder(LLFolderViewFolder * person_folder_view); + +protected: + void draw(); + +private: + + LLAvatarIconCtrl* mAvatarIcon; + LLButton * mInfoBtn; + + typedef enum e_avatar_item_child { + ALIC_SPEAKER_INDICATOR, + ALIC_INFO_BUTTON, + ALIC_COUNT, + } EAvatarListItemChildIndex; + + static bool sStaticInitialized; // this variable is introduced to improve code readability + static S32 sChildrenWidths[ALIC_COUNT]; + //static void initChildrenWidths(LLConversationViewParticipant* self); + //void updateChildren(); + //LLView* getItemChildView(EAvatarListItemChildIndex child_view_index); +}; + +#endif // LL_LLPERSONTABVIEW_H + diff --git a/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml b/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml deleted file mode 100644 index 46857ac700..0000000000 --- a/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml +++ /dev/null @@ -1,13 +0,0 @@ - - diff --git a/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml new file mode 100644 index 0000000000..46857ac700 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml @@ -0,0 +1,13 @@ + + -- cgit v1.2.3 From 2ca3612dae3258b489df8e47879f8339e24947ba Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 23 Apr 2013 14:02:36 -0700 Subject: ACME-251 Create AvatarFolderItemView: When making the folderview using LLPersonModelCommon instead of LLConverationItem. Also the .xml file file read in for LLPersonTabView was incorrect, now using person_tab_view.xml. And lastly made a new file called llpersonfolderview which which be the implementation of folderview. --- indra/newview/CMakeLists.txt | 2 ++ indra/newview/llpanelpeople.cpp | 2 +- indra/newview/llpersonfolderview.cpp | 32 +++++++++++++++++++++++++++++++ indra/newview/llpersonfolderview.h | 37 ++++++++++++++++++++++++++++++++++++ indra/newview/llpersontabview.cpp | 2 +- 5 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 indra/newview/llpersonfolderview.cpp create mode 100644 indra/newview/llpersonfolderview.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 145affeb60..52ce82560b 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -452,6 +452,7 @@ set(viewer_SOURCE_FILES llpathfindingobjectlist.cpp llpathfindingpathtool.cpp llpersistentnotificationstorage.cpp + llpersonfolderview.cpp llpersonmodelcommon.cpp llpersontabview.cpp llphysicsmotion.cpp @@ -1031,6 +1032,7 @@ set(viewer_HEADER_FILES llpathfindingobjectlist.h llpathfindingpathtool.h llpersistentnotificationstorage.h + llpersonfolderview.h llpersonmodelcommon.h llpersontabview.h llphysicsmotion.h diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 3f4ff39644..91f7c61088 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -695,7 +695,7 @@ BOOL LLPanelPeople::postBuild() LLPanel * socialtwo_tab = getChild(FBCTESTTWO_TAB_NAME); //Create folder view - LLConversationItem* base_item = new LLConversationItem(mConversationViewModel); + LLPersonModelCommon* base_item = new LLPersonModelCommon(mConversationViewModel); LLFolderView::Params folder_view_params(LLUICtrlFactory::getDefaultParams()); folder_view_params.parent_panel = friends_tab; diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp new file mode 100644 index 0000000000..e04eda2658 --- /dev/null +++ b/indra/newview/llpersonfolderview.cpp @@ -0,0 +1,32 @@ +/** +* @file llpersonfolderview.cpp +* @brief Implementation of llpersonfolderview +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "llviewerprecompiledheaders.h" + +#include "llpersonfolderview.h" + + diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h new file mode 100644 index 0000000000..f96e45abc6 --- /dev/null +++ b/indra/newview/llpersonfolderview.h @@ -0,0 +1,37 @@ +/** +* @file llpersonfolderview.h +* @brief Header file for llpersonfolderview +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ +#ifndef LL_LLPERSONFOLDERVIEW_H +#define LL_LLPERSONFOLDERVIEW_H + +#include "llfolderview.h" + +#endif // LL_LLPERSONFOLDERVIEW_H + +class LLPersonFolderView : public LLFolderView +{ + +}; diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 156ff591f9..72a95d3f4c 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -29,7 +29,7 @@ #include "llpersontabview.h" -static LLDefaultChildRegistry::Register r_person_folder_view("person_folder_view"); +static LLDefaultChildRegistry::Register r_person_tab_view("person_tab_view"); const LLColor4U DEFAULT_WHITE(255, 255, 255); -- cgit v1.2.3 From 104f576400370a468c87fca6657ae5db0688c3c0 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 23 Apr 2013 16:27:24 -0700 Subject: Fix Windows Debug build --- indra/llplugin/slplugin/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt index 03412d95d5..5d2b1d922e 100644 --- a/indra/llplugin/slplugin/CMakeLists.txt +++ b/indra/llplugin/slplugin/CMakeLists.txt @@ -53,6 +53,9 @@ add_executable(SLPlugin set_target_properties(SLPlugin PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/slplugin_info.plist +if (WINDOWS) + LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMTD\"" +endif (WINDOWS) ) target_link_libraries(SLPlugin -- cgit v1.2.3 From e2eca610459362eda50f6a5edfb9ed5269fd5e51 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 23 Apr 2013 16:31:20 -0700 Subject: Revert LLThreadSafeRefCount optimization; caps fetching was failing. Reviewed by Kelly --- indra/llcommon/llthread.h | 68 +++++++++++++++++++++++++++++++++++++++++++++- indra/llui/llmodaldialog.h | 2 +- 2 files changed, 68 insertions(+), 2 deletions(-) diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index 11594f276e..a6eb14db9d 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -225,6 +225,71 @@ void LLThread::unlockData() // see llmemory.h for LLPointer<> definition +#if (1) // Old code - see comment below +class LL_COMMON_API LLThreadSafeRefCount +{ +public: + static void initThreadSafeRefCount(); // creates sMutex + static void cleanupThreadSafeRefCount(); // destroys sMutex + +private: + static LLMutex* sMutex; + +protected: + virtual ~LLThreadSafeRefCount(); // use unref() + +public: + LLThreadSafeRefCount(); + LLThreadSafeRefCount(const LLThreadSafeRefCount&); + LLThreadSafeRefCount& operator=(const LLThreadSafeRefCount& ref) + { + if (sMutex) + { + sMutex->lock(); + } + mRef = 0; + if (sMutex) + { + sMutex->unlock(); + } + return *this; + } + + + + void ref() + { + if (sMutex) sMutex->lock(); + mRef++; + if (sMutex) sMutex->unlock(); + } + + S32 unref() + { + llassert(mRef >= 1); + if (sMutex) sMutex->lock(); + S32 res = --mRef; + if (sMutex) sMutex->unlock(); + if (0 == res) + { + delete this; + return 0; + } + return res; + } + S32 getNumRefs() const + { + return mRef; + } + +private: + S32 mRef; +}; + +#else + // New code - This was from https://bitbucket.org/lindenlab/viewer-cat/commits/b03bb43e4ead57f904cb3c1e9745dc8460de6efc + // and attempts + class LL_COMMON_API LLThreadSafeRefCount { public: @@ -263,7 +328,7 @@ public: // so that two threads who get into the if in parallel // don't both attempt to the delete. // - mRef--; + mRef--; // Simon: why not if (mRef == 1) delete this; ? There still seems to be a window where mRef could be modified if (mRef == 0) delete this; if (sMutex) sMutex->unlock(); @@ -280,6 +345,7 @@ public: private: LLAtomic32< S32 > mRef; }; +#endif // new code /** * intrusive pointer support for LLThreadSafeRefCount diff --git a/indra/llui/llmodaldialog.h b/indra/llui/llmodaldialog.h index 4e09d11d77..f81273b96a 100644 --- a/indra/llui/llmodaldialog.h +++ b/indra/llui/llmodaldialog.h @@ -40,7 +40,7 @@ class LLModalDialog : public LLFloater { public: LLModalDialog( const LLSD& key, BOOL modal = true ); - /*virtual*/ ~LLModalDialog(); + virtual ~LLModalDialog(); /*virtual*/ BOOL postBuild(); -- cgit v1.2.3 From 1a5ef465ef4059e05a21aae0aa2c6de610f7485f Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 23 Apr 2013 17:14:13 -0700 Subject: ACME-251 Create AvatarFolderItemView: Now the facebook friends tab is using LLPersonFolderViewModel instead of mConversationViewModel --- indra/newview/llpanelpeople.cpp | 8 ++-- indra/newview/llpanelpeople.h | 4 +- indra/newview/llpersonfolderview.cpp | 32 ---------------- indra/newview/llpersonfolderview.h | 37 ------------------ indra/newview/llpersonmodelcommon.h | 73 ++++++++++++++++++++++++++++++++++++ 5 files changed, 79 insertions(+), 75 deletions(-) delete mode 100644 indra/newview/llpersonfolderview.cpp delete mode 100644 indra/newview/llpersonfolderview.h diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 91f7c61088..02a286b880 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -695,12 +695,12 @@ BOOL LLPanelPeople::postBuild() LLPanel * socialtwo_tab = getChild(FBCTESTTWO_TAB_NAME); //Create folder view - LLPersonModelCommon* base_item = new LLPersonModelCommon(mConversationViewModel); + LLPersonModelCommon* base_item = new LLPersonModelCommon(mPersonFolderViewModel); LLFolderView::Params folder_view_params(LLUICtrlFactory::getDefaultParams()); folder_view_params.parent_panel = friends_tab; folder_view_params.listener = base_item; - folder_view_params.view_model = &mConversationViewModel; + folder_view_params.view_model = &mPersonFolderViewModel; folder_view_params.root = NULL; folder_view_params.use_ellipses = false; folder_view_params.options_menu = "menu_conversation.xml"; @@ -725,7 +725,7 @@ BOOL LLPanelPeople::postBuild() //Create a session //LLSpeakerMgr* speaker_manager = (LLSpeakerMgr*)LLLocalSpeakerMgr::getInstance(); - LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mConversationViewModel); + LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mPersonFolderViewModel); LLPersonTabView::Params params; params.name = item->getDisplayName(); params.root = mConversationsRoot; @@ -1742,7 +1742,7 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model { LLPersonModel* person_model = NULL; - person_model = new LLPersonModel(name, mConversationViewModel); + person_model = new LLPersonModel(name, mPersonFolderViewModel); person_folder_model->addParticipant(person_model); } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index d112ac2ec7..f1fa7ec981 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -30,7 +30,7 @@ #include #include "llcallingcard.h" // for avatar tracker -#include "llconversationmodel.h" +#include "llpersonmodelcommon.h" #include "llevents.h" #include "llfloaterwebcontent.h" #include "llvoiceclient.h" @@ -191,7 +191,7 @@ private: person_folder_model_map mPersonFolderModelMap; person_folder_view_map mPersonFolderViewMap; - LLConversationViewModel mConversationViewModel; + LLPersonFolderViewModel mPersonFolderViewModel; LLFolderView* mConversationsRoot; LLEventStream mConversationsEventStream; }; diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp deleted file mode 100644 index e04eda2658..0000000000 --- a/indra/newview/llpersonfolderview.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/** -* @file llpersonfolderview.cpp -* @brief Implementation of llpersonfolderview -* @author Gilbert@lindenlab.com -* -* $LicenseInfo:firstyear=2013&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2013, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ - -#include "llviewerprecompiledheaders.h" - -#include "llpersonfolderview.h" - - diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h deleted file mode 100644 index f96e45abc6..0000000000 --- a/indra/newview/llpersonfolderview.h +++ /dev/null @@ -1,37 +0,0 @@ -/** -* @file llpersonfolderview.h -* @brief Header file for llpersonfolderview -* @author Gilbert@lindenlab.com -* -* $LicenseInfo:firstyear=2013&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2013, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ -#ifndef LL_LLPERSONFOLDERVIEW_H -#define LL_LLPERSONFOLDERVIEW_H - -#include "llfolderview.h" - -#endif // LL_LLPERSONFOLDERVIEW_H - -class LLPersonFolderView : public LLFolderView -{ - -}; diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h index 866d863581..f3454df53f 100644 --- a/indra/newview/llpersonmodelcommon.h +++ b/indra/newview/llpersonmodelcommon.h @@ -127,6 +127,79 @@ private: }; +//Below code is just copied and adjusted from llconversationmodel.h, will need to investigate further + +class LLPersonViewFilter : public LLFolderViewFilter +{ +public: + + enum ESortOrderType + { + SO_NAME = 0, // Sort by name + SO_DATE = 0x1, // Sort by date (most recent) + SO_SESSION_TYPE = 0x2, // Sort by type (valid only for sessions) + SO_DISTANCE = 0x3, // Sort by distance (valid only for participants in nearby chat) + }; + // Default sort order is by type for sessions and by date for participants + static const U32 SO_DEFAULT = (SO_SESSION_TYPE << 16) | (SO_DATE); + + LLPersonViewFilter() { mEmpty = ""; } + ~LLPersonViewFilter() {} + + bool check(const LLFolderViewModelItem* item) { return true; } + bool checkFolder(const LLFolderViewModelItem* folder) const { return true; } + void setEmptyLookupMessage(const std::string& message) { } + std::string getEmptyLookupMessage() const { return mEmpty; } + bool showAllResults() const { return true; } + std::string::size_type getStringMatchOffset(LLFolderViewModelItem* item) const { return std::string::npos; } + std::string::size_type getFilterStringSize() const { return 0; } + + bool isActive() const { return false; } + bool isModified() const { return false; } + void clearModified() { } + const std::string& getName() const { return mEmpty; } + const std::string& getFilterText() { return mEmpty; } + void setModified(EFilterModified behavior = FILTER_RESTART) { } + + void setFilterCount(S32 count) { } + S32 getFilterCount() const { return 0; } + void decrementFilterCount() { } + + bool isDefault() const { return true; } + bool isNotDefault() const { return false; } + void markDefault() { } + void resetDefault() { } + + S32 getCurrentGeneration() const { return 0; } + S32 getFirstSuccessGeneration() const { return 0; } + S32 getFirstRequiredGeneration() const { return 0; } +private: + std::string mEmpty; +}; + +class LLPersonViewSort +{ +public: + LLPersonViewSort(U32 order = LLPersonViewFilter::SO_DEFAULT) : mSortOrder(order) { } + + bool operator()(const LLPersonModelCommon* const& a, const LLPersonModelCommon* const& b) const {return false;} + operator U32() const { return mSortOrder; } +private: + // Note: we're treating this value as a sort order bitmask as done in other places in the code (e.g. inventory) + U32 mSortOrder; +}; + + +class LLPersonFolderViewModel + : public LLFolderViewModel +{ +public: + typedef LLFolderViewModel base_t; + + void sort(LLFolderViewFolder* folder) { base_t::sort(folder);} + bool startDrag(std::vector& items) { return false; } // We do not allow drag of conversation items +}; + #endif // LL_LLPERSONMODELCOMMON_H -- cgit v1.2.3 From 6aa08021c75d2674002c766b3bc02ea8773ee35f Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 23 Apr 2013 17:15:22 -0700 Subject: Fix build failures on Mac : suppress cruft that tripped gcc --- indra/newview/llpersontabview.cpp | 2 +- indra/newview/llsociallist.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 72a95d3f4c..fff72c7758 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -117,7 +117,7 @@ void LLPersonView::draw() const LLFontGL * font = LLFontGL::getFontSansSerifSmall(); F32 text_left = (F32)getLabelXPos(); F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad; - LLColor4 color = color = mIsSelected ? sHighlightFgColor : sFgColor; + LLColor4 color = mIsSelected ? sHighlightFgColor : sFgColor; F32 right_x = 0; drawLabel(font, text_left, y, color, right_x); diff --git a/indra/newview/llsociallist.cpp b/indra/newview/llsociallist.cpp index bcf6d5a63c..9f827cf04f 100644 --- a/indra/newview/llsociallist.cpp +++ b/indra/newview/llsociallist.cpp @@ -1,4 +1,3 @@ -sDestroyImmediate /** * @file llsociallist.cpp * @brief Implementation of llsociallist @@ -37,7 +36,7 @@ sDestroyImmediate #include "llavatarnamecache.h" #include "lloutputmonitorctrl.h" #include "lltextutil.h" - + static LLDefaultChildRegistry::Register r("social_list"); LLSocialList::LLSocialList(const Params&p) : LLFlatListViewEx(p) -- cgit v1.2.3 From b9d9a40273dc574c95b3a83587c526eb140c9922 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 23 Apr 2013 17:16:43 -0700 Subject: ACME-251 Create AvatarFolderItemView: forgot to remove deleted files from indra/newview/CMakeLists.txt. --- indra/newview/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 52ce82560b..145affeb60 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -452,7 +452,6 @@ set(viewer_SOURCE_FILES llpathfindingobjectlist.cpp llpathfindingpathtool.cpp llpersistentnotificationstorage.cpp - llpersonfolderview.cpp llpersonmodelcommon.cpp llpersontabview.cpp llphysicsmotion.cpp @@ -1032,7 +1031,6 @@ set(viewer_HEADER_FILES llpathfindingobjectlist.h llpathfindingpathtool.h llpersistentnotificationstorage.h - llpersonfolderview.h llpersonmodelcommon.h llpersontabview.h llphysicsmotion.h -- cgit v1.2.3 From 955cc72f90413d5c28023d7d6a0a4ac58d04e74a Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 23 Apr 2013 18:38:54 -0700 Subject: ACME-251 Create AvatarFolderItemView: Re-adding llpersonfolderview.h/cpp and to use a class called LLPersonFolderView to manage the creation of subwidgits and selection of tabs. --- indra/newview/CMakeLists.txt | 2 + indra/newview/llpanelpeople.cpp | 58 +++--------------------- indra/newview/llpanelpeople.h | 19 +------- indra/newview/llpersonfolderview.cpp | 88 ++++++++++++++++++++++++++++++++++++ indra/newview/llpersonfolderview.h | 63 ++++++++++++++++++++++++++ 5 files changed, 161 insertions(+), 69 deletions(-) create mode 100644 indra/newview/llpersonfolderview.cpp create mode 100644 indra/newview/llpersonfolderview.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 145affeb60..52ce82560b 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -452,6 +452,7 @@ set(viewer_SOURCE_FILES llpathfindingobjectlist.cpp llpathfindingpathtool.cpp llpersistentnotificationstorage.cpp + llpersonfolderview.cpp llpersonmodelcommon.cpp llpersontabview.cpp llphysicsmotion.cpp @@ -1031,6 +1032,7 @@ set(viewer_HEADER_FILES llpathfindingobjectlist.h llpathfindingpathtool.h llpersistentnotificationstorage.h + llpersonfolderview.h llpersonmodelcommon.h llpersontabview.h llphysicsmotion.h diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 02a286b880..c4ce56cb4f 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -63,6 +63,7 @@ #include "llnetmap.h" #include "llpanelpeoplemenus.h" #include "llparticipantlist.h" +#include "llpersonfolderview.h" #include "llpersonmodelcommon.h" #include "llpersontabview.h" #include "llsidetraypanelcontainer.h" @@ -549,7 +550,6 @@ LLPanelPeople::LLPanelPeople() : LLPanel(), mConnectedToFbc(false), mConversationsRoot(NULL), - mConversationsEventStream("ConversationsEventsTwo"), mTryToConnectToFbc(true), mTabContainer(NULL), mOnlineFriendList(NULL), @@ -605,8 +605,6 @@ LLPanelPeople::~LLPanelPeople() } if (mFbcTestBrowserHandle.get()) mFbcTestBrowserHandle.get()->die(); - - mConversationsEventStream.stopListening("ConversationsRefresh"); } void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LLSD& param, LLAvatarList* avatar_list) @@ -697,7 +695,7 @@ BOOL LLPanelPeople::postBuild() //Create folder view LLPersonModelCommon* base_item = new LLPersonModelCommon(mPersonFolderViewModel); - LLFolderView::Params folder_view_params(LLUICtrlFactory::getDefaultParams()); + LLPersonFolderView::Params folder_view_params(LLUICtrlFactory::getDefaultParams()); folder_view_params.parent_panel = friends_tab; folder_view_params.listener = base_item; folder_view_params.view_model = &mPersonFolderViewModel; @@ -705,8 +703,7 @@ BOOL LLPanelPeople::postBuild() folder_view_params.use_ellipses = false; folder_view_params.options_menu = "menu_conversation.xml"; folder_view_params.name = "fbcfolderview"; - mConversationsRoot = LLUICtrlFactory::create(folder_view_params); - mConversationsEventStream.listen("ConversationsRefresh", boost::bind(&LLPanelPeople::onConversationModelEvent, this, _1)); + mConversationsRoot = LLUICtrlFactory::create(folder_view_params); //Create scroller LLRect scroller_view_rect = socialtwo_tab->getRect(); @@ -734,8 +731,8 @@ BOOL LLPanelPeople::postBuild() LLPersonTabView * widget = LLUICtrlFactory::create(params); widget->addToFolder(mConversationsRoot); - mPersonFolderModelMap[item->getID()] = item; - mPersonFolderViewMap[item->getID()] = widget; + mConversationsRoot->mPersonFolderModelMap[item->getID()] = item; + mConversationsRoot->mPersonFolderViewMap[item->getID()] = widget; gIdleCallbacks.addFunction(idle, this); @@ -1653,49 +1650,6 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name) return isAccordionCollapsedByUser(getChild(name)); } -bool LLPanelPeople::onConversationModelEvent(const LLSD& event) -{ - std::string type = event.get("type").asString(); - LLUUID folder_id = event.get("folder_id").asUUID(); - LLUUID person_id = event.get("person_id").asUUID(); - - if(type == "add_participant") - { - LLPersonTabModel * person_folder_model = dynamic_cast(mPersonFolderModelMap[folder_id]); - LLPersonTabView * person_folder_view = dynamic_cast(mPersonFolderViewMap[person_id]); - - if(person_folder_model) - { - LLPersonModel * person_model = person_folder_model->findParticipant(person_id); - - if(person_model) - { - LLPersonView * participant_view = createConversationViewParticipant(person_model); - participant_view->addToFolder(person_folder_view); - } - } - } - - return false; -} - -LLPersonView * LLPanelPeople::createConversationViewParticipant(LLPersonModel * item) -{ - LLPersonView::Params params; - LLRect panel_rect = getChild(FBCTESTTWO_TAB_NAME)->getRect(); - - params.name = item->getDisplayName(); - params.root = mConversationsRoot; - params.listener = item; - - //24 is the the current hight of an item (itemHeight) loaded from conversation_view_participant.xml. - params.rect = LLRect (0, 24, panel_rect.getWidth(), 0); - params.tool_tip = params.name; - params.folder_indentation = 2; - - return LLUICtrlFactory::create(params); -} - void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p) { LLFloater* browser = LLFloaterReg::showInstance("web_content", p); @@ -1733,7 +1687,7 @@ void LLPanelPeople::addTestParticipant() { for(int i = 0; i < 300; ++i) { - LLPersonTabModel * person_folder_model = dynamic_cast(mPersonFolderModelMap.begin()->second); + LLPersonTabModel * person_folder_model = dynamic_cast(mConversationsRoot->mPersonFolderModelMap.begin()->second); addParticipantToModel(person_folder_model, LLUUID().generateNewID(), "EastBayGuy"); } } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index f1fa7ec981..a448b7935e 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -31,7 +31,6 @@ #include "llcallingcard.h" // for avatar tracker #include "llpersonmodelcommon.h" -#include "llevents.h" #include "llfloaterwebcontent.h" #include "llvoiceclient.h" @@ -40,18 +39,10 @@ class LLAvatarListSocial; class LLAvatarName; class LLFilterEditor; class LLGroupList; +class LLPersonFolderView; class LLSocialList; class LLMenuButton; class LLTabContainer; -class LLFolderView; - -class LLPersonTabModel; -class LLPersonTabView; -class LLPersonView; -class LLPersonModel; - -typedef std::map person_folder_model_map; -typedef std::map person_folder_view_map; class LLPanelPeople : public LLPanel @@ -164,9 +155,6 @@ private: bool isAccordionCollapsedByUser(LLUICtrl* acc_tab); bool isAccordionCollapsedByUser(const std::string& name); - bool onConversationModelEvent(const LLSD& event); - LLPersonView * createConversationViewParticipant(LLPersonModel * item); - LLTabContainer* mTabContainer; LLAvatarList* mOnlineFriendList; LLAvatarList* mAllFriendList; @@ -189,11 +177,8 @@ private: LLMenuButton* mFBCGearButton; LLHandle< LLFloater > mPicker; - person_folder_model_map mPersonFolderModelMap; - person_folder_view_map mPersonFolderViewMap; LLPersonFolderViewModel mPersonFolderViewModel; - LLFolderView* mConversationsRoot; - LLEventStream mConversationsEventStream; + LLPersonFolderView* mConversationsRoot; }; #endif //LL_LLPANELPEOPLE_H diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp new file mode 100644 index 0000000000..d94c8cf32f --- /dev/null +++ b/indra/newview/llpersonfolderview.cpp @@ -0,0 +1,88 @@ +/** +* @file llpersonfolderview.cpp +* @brief Implementation of llpersonfolderview +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "llviewerprecompiledheaders.h" + +#include "llpersonfolderview.h" + +#include "llpersontabview.h" +#include "llpersonmodelcommon.h" + + +LLPersonFolderView::LLPersonFolderView(const Params &p) : +LLFolderView(p), + mConversationsEventStream("ConversationsEventsTwo") +{ + mConversationsEventStream.listen("ConversationsRefresh", boost::bind(&LLPersonFolderView::onConversationModelEvent, this, _1)); +} + +LLPersonFolderView::~LLPersonFolderView() +{ + mConversationsEventStream.stopListening("ConversationsRefresh"); +} + +bool LLPersonFolderView::onConversationModelEvent(const LLSD &event) +{ + std::string type = event.get("type").asString(); + LLUUID folder_id = event.get("folder_id").asUUID(); + LLUUID person_id = event.get("person_id").asUUID(); + + if(type == "add_participant") + { + LLPersonTabModel * person_folder_model = dynamic_cast(mPersonFolderModelMap[folder_id]); + LLPersonTabView * person_folder_view = dynamic_cast(mPersonFolderViewMap[person_id]); + + if(person_folder_model) + { + LLPersonModel * person_model = person_folder_model->findParticipant(person_id); + + if(person_model) + { + LLPersonView * participant_view = createConversationViewParticipant(person_model); + participant_view->addToFolder(person_folder_view); + } + } + } + + return false; +} + +LLPersonView * LLPersonFolderView::createConversationViewParticipant(LLPersonModel * item) +{ + LLPersonView::Params params; + + params.name = item->getDisplayName(); + params.root = this; + params.listener = item; + + //24 should be loaded from .xml somehow + params.rect = LLRect (0, 24, getRect().getWidth(), 0); + params.tool_tip = params.name; + params.folder_indentation = 2; + + return LLUICtrlFactory::create(params); +} diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h new file mode 100644 index 0000000000..60260dc5ea --- /dev/null +++ b/indra/newview/llpersonfolderview.h @@ -0,0 +1,63 @@ +/** +* @file llpersonfolderview.h +* @brief Header file for llpersonfolderview +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ +#ifndef LL_LLPERSONFOLDERVIEW_H +#define LL_LLPERSONFOLDERVIEW_H + +class LLPersonTabModel; +class LLPersonTabView; +class LLPersonView; +class LLPersonModel; + +typedef std::map person_folder_model_map; +typedef std::map person_folder_view_map; + +#include "llevents.h" +#include "llfolderview.h" + +class LLPersonFolderView : public LLFolderView +{ +public: + struct Params : public LLInitParam::Block + { + Params() + {} + }; + + LLPersonFolderView(const Params &p); + ~LLPersonFolderView(); + + bool onConversationModelEvent(const LLSD &event); + + LLPersonView * createConversationViewParticipant(LLPersonModel * item); + + person_folder_model_map mPersonFolderModelMap; + person_folder_view_map mPersonFolderViewMap; + LLEventStream mConversationsEventStream; +}; + +#endif // LL_LLPERSONFOLDERVIEW_H + -- cgit v1.2.3 From 87ba85eaabbfd5fd7ad8ca8136f4783b1d932264 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 24 Apr 2013 09:35:38 -0700 Subject: =?UTF-8?q?=C3=AF=C2=BB=C2=BFdiff=20-r=2059c7bed66dfd=20indra/llco?= =?UTF-8?q?mmon/lleventapi.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- indra/llcommon/lleventapi.h | 4 +- indra/llcommon/lleventtimer.h | 2 +- indra/llcommon/llfasttimer.cpp | 8 +-- indra/llcommon/llfasttimer.h | 4 +- indra/llcommon/llinstancetracker.cpp | 22 -------- indra/llcommon/llinstancetracker.h | 58 +++------------------ indra/llcommon/llleap.h | 2 +- indra/llcommon/llsingleton.cpp | 1 - indra/llcommon/llsingleton.h | 60 ++++------------------ indra/llcommon/tests/llinstancetracker_test.cpp | 6 +-- indra/llrender/llgl.h | 4 +- indra/llui/llconsole.h | 2 +- indra/llui/llfloater.h | 2 +- indra/llui/lllayoutstack.h | 2 +- indra/llui/llnotifications.cpp | 4 +- indra/llui/llnotifications.h | 6 +-- indra/llwindow/llwindow.h | 2 +- indra/llxml/llcontrol.cpp | 2 +- indra/llxml/llcontrol.h | 10 ++-- indra/newview/llfloaterwebcontent.cpp | 2 +- indra/newview/llfloaterwebcontent.h | 4 +- indra/newview/llmediactrl.cpp | 2 +- indra/newview/llmediactrl.h | 2 +- indra/newview/llnamelistctrl.h | 2 +- indra/newview/lltoast.cpp | 3 +- indra/newview/lltoast.h | 2 +- indra/newview/lltoastnotifypanel.cpp | 2 +- indra/newview/lltoastnotifypanel.h | 2 +- indra/newview/lltoolselect.h | 2 +- indra/newview/tests/llagentaccess_test.cpp | 2 +- indra/newview/tests/lllogininstance_test.cpp | 2 +- indra/newview/tests/llremoteparcelrequest_test.cpp | 2 +- indra/newview/tests/llsecapi_test.cpp | 2 +- indra/newview/tests/llsechandler_basic_test.cpp | 2 +- indra/newview/tests/llslurl_test.cpp | 2 +- indra/newview/tests/lltranslate_test.cpp | 2 +- indra/newview/tests/llviewerhelputil_test.cpp | 2 +- indra/newview/tests/llviewernetwork_test.cpp | 2 +- indra/newview/tests/llworldmipmap_test.cpp | 2 +- 39 files changed, 68 insertions(+), 176 deletions(-) diff --git a/indra/llcommon/lleventapi.h b/indra/llcommon/lleventapi.h index 10c7e7a23f..5991fe8fd5 100644 --- a/indra/llcommon/lleventapi.h +++ b/indra/llcommon/lleventapi.h @@ -41,10 +41,10 @@ * Deriving from LLInstanceTracker lets us enumerate instances. */ class LL_COMMON_API LLEventAPI: public LLDispatchListener, - public INSTANCE_TRACKER_KEYED(LLEventAPI, std::string) + public LLInstanceTracker { typedef LLDispatchListener lbase; - typedef INSTANCE_TRACKER_KEYED(LLEventAPI, std::string) ibase; + typedef LLInstanceTracker ibase; public: diff --git a/indra/llcommon/lleventtimer.h b/indra/llcommon/lleventtimer.h index e55f851758..dc918121e1 100644 --- a/indra/llcommon/lleventtimer.h +++ b/indra/llcommon/lleventtimer.h @@ -33,7 +33,7 @@ #include "lltimer.h" // class for scheduling a function to be called at a given frequency (approximate, inprecise) -class LL_COMMON_API LLEventTimer : public INSTANCE_TRACKER(LLEventTimer) +class LL_COMMON_API LLEventTimer : public LLInstanceTracker { public: diff --git a/indra/llcommon/llfasttimer.cpp b/indra/llcommon/llfasttimer.cpp index 9b15804e97..51a9441cd5 100644 --- a/indra/llcommon/llfasttimer.cpp +++ b/indra/llcommon/llfasttimer.cpp @@ -107,17 +107,13 @@ class NamedTimerFactory : public LLSingleton { public: NamedTimerFactory() - : mTimerRoot(NULL) - {} - - /*virtual */ void initSingleton() + : mTimerRoot(new LLFastTimer::NamedTimer("root")) { - mTimerRoot = new LLFastTimer::NamedTimer("root"); mRootFrameState.setNamedTimer(mTimerRoot); mTimerRoot->setFrameState(&mRootFrameState); mTimerRoot->mParent = mTimerRoot; mTimerRoot->setCollapsed(false); - mRootFrameState.mParent = &mRootFrameState; + mRootFrameState.mParent = &mRootFrameState; } ~NamedTimerFactory() diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index a6b34bdc69..a99a1d88af 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -63,7 +63,7 @@ public: // stores a "named" timer instance to be reused via multiple LLFastTimer stack instances class LL_COMMON_API NamedTimer - : public LLInstanceTracker + : public LLInstanceTracker { friend class DeclareTimer; public: @@ -139,7 +139,7 @@ public: // used to statically declare a new named timer class LL_COMMON_API DeclareTimer - : public LLInstanceTracker< DeclareTimer, InstanceTrackType_DeclareTimer > + : public LLInstanceTracker< DeclareTimer > { friend class LLFastTimer; public: diff --git a/indra/llcommon/llinstancetracker.cpp b/indra/llcommon/llinstancetracker.cpp index 89430f82d7..247d0dc4fb 100644 --- a/indra/llcommon/llinstancetracker.cpp +++ b/indra/llcommon/llinstancetracker.cpp @@ -32,26 +32,4 @@ // external library headers // other Linden headers -static bool sInstanceTrackerData_initialized = false; -static void* sInstanceTrackerData[ kInstanceTrackTypeCount ]; - - -void * & LLInstanceTrackerBase::getInstances(InstanceTrackType t) -{ - // std::map::insert() is just what we want here. You attempt to insert a - // (key, value) pair. If the specified key doesn't yet exist, it inserts - // the pair and returns a std::pair of (iterator, true). If the specified - // key DOES exist, insert() simply returns (iterator, false). One lookup - // handles both cases. - if (!sInstanceTrackerData_initialized) - { - for (S32 i = 0; i < (S32) kInstanceTrackTypeCount; i++) - { - sInstanceTrackerData[i] = NULL; - } - sInstanceTrackerData_initialized = true; - } - - return sInstanceTrackerData[t]; -} diff --git a/indra/llcommon/llinstancetracker.h b/indra/llcommon/llinstancetracker.h index b290526754..361182380a 100644 --- a/indra/llcommon/llinstancetracker.h +++ b/indra/llcommon/llinstancetracker.h @@ -38,33 +38,6 @@ #include #include -enum InstanceTrackType -{ - InstanceTrackType_LLEventAPI, - InstanceTrackType_LLEventTimer, - InstanceTrackType_NamedTimer, - InstanceTrackType_DeclareTimer, - InstanceTrackType_LLLeap, - InstanceTrackType_LLGLNamePool, - InstanceTrackType_LLConsole, - InstanceTrackType_LLFloater, - InstanceTrackType_LLFloaterWebContent, - InstanceTrackType_LLLayoutStack, - InstanceTrackType_LLNotificationContext, - InstanceTrackType_LLWindow, - InstanceTrackType_LLControlGroup, - InstanceTrackType_LLControlCache, - InstanceTrackType_LLMediaCtrl, - InstanceTrackType_LLNameListCtrl, - InstanceTrackType_LLToast, - InstanceTrackType_Keyed, // for integ tests - InstanceTrackType_Unkeyed, // for integ tests - kInstanceTrackTypeCount -}; - -#define INSTANCE_TRACKER(T) LLInstanceTracker< T, InstanceTrackType_##T > -#define INSTANCE_TRACKER_KEYED(T,K) LLInstanceTracker< T, InstanceTrackType_##T, K > - /** * Base class manages "class-static" data that must actually have singleton * semantics: one instance per process, rather than one instance per module as @@ -73,22 +46,7 @@ enum InstanceTrackType class LL_COMMON_API LLInstanceTrackerBase { protected: - /// Get a process-unique void* pointer slot for the specified type_info - //static void * & getInstances(std::type_info const & info); - static void * & getInstances(InstanceTrackType t); - - /// Find or create a STATICDATA instance for the specified TRACKED class. - /// STATICDATA must be default-constructible. - template - static STATICDATA& getStatic() - { - void *& instances = getInstances(TRACKEDTYPE); - if (! instances) - { - instances = new STATICDATA; - } - return *static_cast(instances); - } + /// It's not essential to derive your STATICDATA (for use with /// getStatic()) from StaticBase; it's just that both known @@ -108,16 +66,16 @@ LL_COMMON_API void assert_main_thread(); /// The (optional) key associates a value of type KEY with a given instance of T, for quick lookup /// If KEY is not provided, then instances are stored in a simple set /// @NOTE: see explicit specialization below for default KEY==T* case -template +template class LLInstanceTracker : public LLInstanceTrackerBase { - typedef LLInstanceTracker MyT; + typedef LLInstanceTracker self_t; typedef typename std::map InstanceMap; struct StaticData: public StaticBase { InstanceMap sMap; }; - static StaticData& getStatic() { return LLInstanceTrackerBase::getStatic(); } + static StaticData& getStatic() { static StaticData sData; return sData;} static InstanceMap& getMap_() { // assert_main_thread(); fwiw this class is not thread safe, and it used by multiple threads. Bad things happen. @@ -263,16 +221,16 @@ private: /// explicit specialization for default case where KEY is T* /// use a simple std::set -template -class LLInstanceTracker : public LLInstanceTrackerBase +template +class LLInstanceTracker : public LLInstanceTrackerBase { - typedef LLInstanceTracker MyT; + typedef LLInstanceTracker self_t; typedef typename std::set InstanceSet; struct StaticData: public StaticBase { InstanceSet sSet; }; - static StaticData& getStatic() { return LLInstanceTrackerBase::getStatic(); } + static StaticData& getStatic() { static StaticData sData; return sData; } static InstanceSet& getSet_() { return getStatic().sSet; } public: diff --git a/indra/llcommon/llleap.h b/indra/llcommon/llleap.h index d4e138f4be..e33f25e530 100644 --- a/indra/llcommon/llleap.h +++ b/indra/llcommon/llleap.h @@ -29,7 +29,7 @@ * LLLeap* pointer should be validated before use by * LLLeap::getInstance(LLLeap*) (see LLInstanceTracker). */ -class LL_COMMON_API LLLeap: public INSTANCE_TRACKER(LLLeap) +class LL_COMMON_API LLLeap: public LLInstanceTracker { public: diff --git a/indra/llcommon/llsingleton.cpp b/indra/llcommon/llsingleton.cpp index eb8e2c9456..9b49e52377 100644 --- a/indra/llcommon/llsingleton.cpp +++ b/indra/llcommon/llsingleton.cpp @@ -28,5 +28,4 @@ #include "llsingleton.h" -std::map * LLSingletonRegistry::sSingletonMap = NULL; diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h index 49d99f2cd0..84afeb563e 100644 --- a/indra/llcommon/llsingleton.h +++ b/indra/llcommon/llsingleton.h @@ -30,38 +30,6 @@ #include #include -/// @brief A global registry of all singletons to prevent duplicate allocations -/// across shared library boundaries -class LL_COMMON_API LLSingletonRegistry { - private: - typedef std::map TypeMap; - static TypeMap * sSingletonMap; - - static void checkInit() - { - if(sSingletonMap == NULL) - { - sSingletonMap = new TypeMap(); - } - } - - public: - template static void * & get() - { - std::string name(typeid(T).name()); - - checkInit(); - - // the first entry of the pair returned by insert will be either the existing - // iterator matching our key, or the newly inserted NULL initialized entry - // see "Insert element" in http://www.sgi.com/tech/stl/UniqueAssociativeContainer.html - TypeMap::iterator result = - sSingletonMap->insert(std::make_pair(name, (void*)NULL)).first; - - return result->second; - } -}; - // LLSingleton implements the getInstance() method part of the Singleton // pattern. It can't make the derived class constructors protected, though, so // you have to do that yourself. @@ -93,7 +61,6 @@ class LLSingleton : private boost::noncopyable private: typedef enum e_init_state { - UNINITIALIZED, CONSTRUCTING, INITIALIZING, INITIALIZED, @@ -109,8 +76,11 @@ private: SingletonInstanceData() : mSingletonInstance(NULL), - mInitState(UNINITIALIZED) - {} + mInitState(CONSTRUCTING) + { + mSingletonInstance = new DERIVED_TYPE(); + mInitState = INITIALIZING; + } ~SingletonInstanceData() { @@ -159,16 +129,8 @@ public: static SingletonInstanceData& getData() { // this is static to cache the lookup results - static void * & registry = LLSingletonRegistry::get(); - - // *TODO - look into making this threadsafe - if(NULL == registry) - { - static SingletonInstanceData data; - registry = &data; - } - - return *static_cast(registry); + static SingletonInstanceData sData; + return sData; } static DERIVED_TYPE* getInstance() @@ -185,13 +147,11 @@ public: llwarns << "Trying to access deleted singleton " << typeid(DERIVED_TYPE).name() << " creating new instance" << llendl; } - if (!data.mSingletonInstance) + if (data.mInitState == INITIALIZING) { - data.mInitState = CONSTRUCTING; - data.mSingletonInstance = new DERIVED_TYPE(); - data.mInitState = INITIALIZING; + // go ahead and flag ourselves as initialized so we can be reentrant during initialization + data.mInitState = INITIALIZED; data.mSingletonInstance->initSingleton(); - data.mInitState = INITIALIZED; } return data.mSingletonInstance; diff --git a/indra/llcommon/tests/llinstancetracker_test.cpp b/indra/llcommon/tests/llinstancetracker_test.cpp index b2d82d1843..e769c3e22c 100644 --- a/indra/llcommon/tests/llinstancetracker_test.cpp +++ b/indra/llcommon/tests/llinstancetracker_test.cpp @@ -48,16 +48,16 @@ struct Badness: public std::runtime_error Badness(const std::string& what): std::runtime_error(what) {} }; -struct Keyed: public INSTANCE_TRACKER_KEYED(Keyed, std::string) +struct Keyed: public LLInstanceTracker { Keyed(const std::string& name): - INSTANCE_TRACKER_KEYED(Keyed, std::string)(name), + LLInstanceTracker(name), mName(name) {} std::string mName; }; -struct Unkeyed: public INSTANCE_TRACKER(Unkeyed) +struct Unkeyed: public LLInstanceTracker { Unkeyed(const std::string& thrw="") { diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index 133c2de1f5..823de9d361 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -350,10 +350,10 @@ public: Generic pooling scheme for things which use GL names (used for occlusion queries and vertex buffer objects). Prevents thrashing of GL name caches by avoiding calls to glGenFoo and glDeleteFoo. */ -class LLGLNamePool : public INSTANCE_TRACKER(LLGLNamePool) +class LLGLNamePool : public LLInstanceTracker { public: - typedef INSTANCE_TRACKER(LLGLNamePool) tracker_t; + typedef LLInstanceTracker tracker_t; struct NameEntry { diff --git a/indra/llui/llconsole.h b/indra/llui/llconsole.h index b264aeb7eb..5ff05698b0 100644 --- a/indra/llui/llconsole.h +++ b/indra/llui/llconsole.h @@ -34,7 +34,7 @@ class LLSD; -class LLConsole : public LLFixedBuffer, public LLUICtrl, public INSTANCE_TRACKER(LLConsole) +class LLConsole : public LLFixedBuffer, public LLUICtrl, public LLInstanceTracker { public: diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index f28ceb0ce4..99d1d2614d 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -116,7 +116,7 @@ struct LLCoordFloater : LLCoord }; -class LLFloater : public LLPanel, public INSTANCE_TRACKER(LLFloater) +class LLFloater : public LLPanel, public LLInstanceTracker { friend class LLFloaterView; friend class LLFloaterReg; diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index a8b5466242..8e330278af 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -35,7 +35,7 @@ class LLLayoutPanel; -class LLLayoutStack : public LLView, public INSTANCE_TRACKER(LLLayoutStack) +class LLLayoutStack : public LLView, public LLInstanceTracker { public: diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 8bafbd53d8..1789f003b9 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -1121,7 +1121,7 @@ bool LLNotificationChannelBase::updateItem(const LLSD& payload, LLNotificationPt LLNotificationChannel::LLNotificationChannel(const Params& p) : LLNotificationChannelBase(p.filter()), - LLInstanceTracker(p.name.isProvided() ? p.name : LLUUID::generateNewID().asString()), + LLInstanceTracker(p.name.isProvided() ? p.name : LLUUID::generateNewID().asString()), mName(p.name.isProvided() ? p.name : LLUUID::generateNewID().asString()) { BOOST_FOREACH(const std::string& source, p.sources) @@ -1135,7 +1135,7 @@ LLNotificationChannel::LLNotificationChannel(const std::string& name, const std::string& parent, LLNotificationFilter filter) : LLNotificationChannelBase(filter), - LLInstanceTracker(name), + LLInstanceTracker(name), mName(name) { // bind to notification broadcast diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 2561125aa5..cd3728305e 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -135,11 +135,11 @@ typedef LLFunctorRegistration LLNotificationFunctorRegi // context data that can be looked up via a notification's payload by the display logic // derive from this class to implement specific contexts -class LLNotificationContext : public INSTANCE_TRACKER_KEYED(LLNotificationContext, LLUUID) +class LLNotificationContext : public LLInstanceTracker { public: - LLNotificationContext() : INSTANCE_TRACKER_KEYED(LLNotificationContext, LLUUID)(LLUUID::generateNewID()) + LLNotificationContext() : LLInstanceTracker(LLUUID::generateNewID()) { } @@ -815,7 +815,7 @@ typedef boost::intrusive_ptr LLNotificationChannelPtr; class LLNotificationChannel : boost::noncopyable, public LLNotificationChannelBase, - public LLInstanceTracker + public LLInstanceTracker { LOG_CLASS(LLNotificationChannel); diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index 06d7e4907a..78186004b8 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -39,7 +39,7 @@ class LLWindowCallbacks; // Refer to llwindow_test in test/common/llwindow for usage example -class LLWindow : public INSTANCE_TRACKER(LLWindow) +class LLWindow : public LLInstanceTracker { public: diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp index f82750af47..666c03e9ff 100644 --- a/indra/llxml/llcontrol.cpp +++ b/indra/llxml/llcontrol.cpp @@ -316,7 +316,7 @@ LLPointer LLControlGroup::getControl(const std::string& name) //////////////////////////////////////////////////////////////////////////// LLControlGroup::LLControlGroup(const std::string& name) -: INSTANCE_TRACKER_KEYED(LLControlGroup, std::string)(name) +: LLInstanceTracker(name) { mTypeString[TYPE_U32] = "U32"; mTypeString[TYPE_S32] = "S32"; diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h index 6ea010f4f9..ee7d1d50b7 100644 --- a/indra/llxml/llcontrol.h +++ b/indra/llxml/llcontrol.h @@ -180,7 +180,7 @@ T convert_from_llsd(const LLSD& sd, eControlType type, const std::string& contro } //const U32 STRING_CACHE_SIZE = 10000; -class LLControlGroup : public INSTANCE_TRACKER_KEYED(LLControlGroup, std::string) +class LLControlGroup : public LLInstanceTracker { LOG_CLASS(LLControlGroup); @@ -197,7 +197,7 @@ public: ~LLControlGroup(); void cleanup(); - typedef INSTANCE_TRACKER_KEYED(LLControlGroup, std::string)::instance_iter instance_iter; + typedef LLInstanceTracker::instance_iter instance_iter; LLControlVariablePtr getControl(const std::string& name); @@ -306,7 +306,7 @@ public: //! without have to manually create and bind a listener to a local //! object. template -class LLControlCache : public LLRefCount, public LLInstanceTracker, InstanceTrackType_LLControlCache, std::string> +class LLControlCache : public LLRefCount, public LLInstanceTracker, std::string> { public: // This constructor will declare a control if it doesn't exist in the contol group @@ -314,7 +314,7 @@ public: const std::string& name, const T& default_value, const std::string& comment) - : LLInstanceTracker, InstanceTrackType_LLControlCache, std::string >(name) + : LLInstanceTracker, std::string >(name) { if(!group.controlExists(name)) { @@ -329,7 +329,7 @@ public: LLControlCache(LLControlGroup& group, const std::string& name) - : LLInstanceTracker, InstanceTrackType_LLControlCache, std::string >(name) + : LLInstanceTracker, std::string >(name) { if(!group.controlExists(name)) { diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 94c3f4149c..3fe2518de6 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -54,7 +54,7 @@ LLFloaterWebContent::_Params::_Params() LLFloaterWebContent::LLFloaterWebContent( const Params& params ) : LLFloater( params ), - INSTANCE_TRACKER_KEYED(LLFloaterWebContent, std::string)(params.id()), + LLInstanceTracker(params.id()), mWebBrowser(NULL), mAddressCombo(NULL), mSecureLockIcon(NULL), diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h index 409c15fb0b..86b5a5e00b 100644 --- a/indra/newview/llfloaterwebcontent.h +++ b/indra/newview/llfloaterwebcontent.h @@ -40,11 +40,11 @@ class LLIconCtrl; class LLFloaterWebContent : public LLFloater, public LLViewerMediaObserver, - public INSTANCE_TRACKER_KEYED(LLFloaterWebContent, std::string) + public LLInstanceTracker { public: - typedef INSTANCE_TRACKER_KEYED(LLFloaterWebContent, std::string) instance_tracker_t; + typedef LLInstanceTracker instance_tracker_t; LOG_CLASS(LLFloaterWebContent); struct _Params : public LLInitParam::Block<_Params> diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 6362165c77..2075aeed63 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -81,7 +81,7 @@ LLMediaCtrl::Params::Params() LLMediaCtrl::LLMediaCtrl( const Params& p) : LLPanel( p ), - INSTANCE_TRACKER_KEYED(LLMediaCtrl, LLUUID)(LLUUID::generateNewID()), + LLInstanceTracker(LLUUID::generateNewID()), mTextureDepthBytes( 4 ), mBorder(NULL), mFrequentUpdates( true ), diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 4fed21bf22..6c38c1fb56 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -42,7 +42,7 @@ class LLMediaCtrl : public LLPanel, public LLViewerMediaObserver, public LLViewerMediaEventEmitter, - public INSTANCE_TRACKER_KEYED(LLMediaCtrl, LLUUID) + public LLInstanceTracker { LOG_CLASS(LLMediaCtrl); public: diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index d82727f018..92e82b672d 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -64,7 +64,7 @@ private: class LLNameListCtrl -: public LLScrollListCtrl, public INSTANCE_TRACKER(LLNameListCtrl) +: public LLScrollListCtrl, public LLInstanceTracker { public: diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index 49debe67f6..a26e47e1c8 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -572,7 +572,8 @@ S32 LLToast::notifyParent(const LLSD& info) //static void LLToast::updateClass() { - for (INSTANCE_TRACKER(LLToast)::instance_iter iter = INSTANCE_TRACKER(LLToast)::beginInstances(); iter != INSTANCE_TRACKER(LLToast)::endInstances(); ) + for (LLInstanceTracker::instance_iter iter = LLInstanceTracker::beginInstances(); + iter != LLInstanceTracker::endInstances(); ) { LLToast& toast = *iter++; diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index 718b464977..5da7120e84 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -69,7 +69,7 @@ private : * Represents toast pop-up. * This is a parent view for all toast panels. */ -class LLToast : public LLModalDialog, public INSTANCE_TRACKER(LLToast) +class LLToast : public LLModalDialog, public LLInstanceTracker { friend class LLToastLifeTimer; public: diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 9b5ccc0150..94d07b37ef 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -57,7 +57,7 @@ LLToastNotifyPanel::button_click_signal_t LLToastNotifyPanel::sButtonClickSignal LLToastNotifyPanel::LLToastNotifyPanel(const LLNotificationPtr& notification, const LLRect& rect, bool show_images) : LLToastPanel(notification), - LLInstanceTracker(notification->getID()) + LLInstanceTracker(notification->getID()) { init(rect, show_images); } diff --git a/indra/newview/lltoastnotifypanel.h b/indra/newview/lltoastnotifypanel.h index 5de75a7a9f..d02171b512 100644 --- a/indra/newview/lltoastnotifypanel.h +++ b/indra/newview/lltoastnotifypanel.h @@ -47,7 +47,7 @@ class LLNotificationForm; * @deprecated this class will be removed after all toast panel types are * implemented in separate classes. */ -class LLToastNotifyPanel: public LLToastPanel, public LLInstanceTracker +class LLToastNotifyPanel: public LLToastPanel, public LLInstanceTracker { public: /** diff --git a/indra/newview/lltoolselect.h b/indra/newview/lltoolselect.h index baa27f6071..74dababe8c 100644 --- a/indra/newview/lltoolselect.h +++ b/indra/newview/lltoolselect.h @@ -34,7 +34,7 @@ class LLObjectSelection; -class LLToolSelect : public LLTool, public LLSingleton +class LLToolSelect : public LLTool { public: LLToolSelect( LLToolComposite* composite ); diff --git a/indra/newview/tests/llagentaccess_test.cpp b/indra/newview/tests/llagentaccess_test.cpp index 426ad40342..05289f0309 100644 --- a/indra/newview/tests/llagentaccess_test.cpp +++ b/indra/newview/tests/llagentaccess_test.cpp @@ -40,7 +40,7 @@ static U32 test_preferred_maturity = SIM_ACCESS_PG; LLControlGroup::LLControlGroup(const std::string& name) - : INSTANCE_TRACKER_KEYED(LLControlGroup, std::string)(name) +: LLInstanceTracker(name) { } diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index 25da5939f1..7705b4c567 100644 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -167,7 +167,7 @@ std::string LLGridManager::getAppSLURLBase(const std::string& grid_name) LLControlGroup gSavedSettings("Global"); LLControlGroup::LLControlGroup(const std::string& name) : - INSTANCE_TRACKER_KEYED(LLControlGroup, std::string)(name){} + LLInstanceTracker(name){} LLControlGroup::~LLControlGroup() {} void LLControlGroup::setBOOL(const std::string& name, BOOL val) {} BOOL LLControlGroup::getBOOL(const std::string& name) { return FALSE; } diff --git a/indra/newview/tests/llremoteparcelrequest_test.cpp b/indra/newview/tests/llremoteparcelrequest_test.cpp index da273132db..ed66066b0a 100644 --- a/indra/newview/tests/llremoteparcelrequest_test.cpp +++ b/indra/newview/tests/llremoteparcelrequest_test.cpp @@ -69,7 +69,7 @@ void LLAgent::sendReliableMessage(void) { } LLUUID gAgentSessionID; LLUUID gAgentID; LLUIColor::LLUIColor(void) { } -LLControlGroup::LLControlGroup(std::string const & name) : INSTANCE_TRACKER_KEYED(LLControlGroup, std::string)(name) { } +LLControlGroup::LLControlGroup(std::string const & name) : LLInstanceTracker(name) { } LLControlGroup::~LLControlGroup(void) { } void LLUrlEntryParcel::processParcelInfo(const LLUrlEntryParcel::LLParcelData& parcel_data) { } diff --git a/indra/newview/tests/llsecapi_test.cpp b/indra/newview/tests/llsecapi_test.cpp index 83a4149971..703603e2db 100644 --- a/indra/newview/tests/llsecapi_test.cpp +++ b/indra/newview/tests/llsecapi_test.cpp @@ -37,7 +37,7 @@ // Mock objects for the dependencies of the code we're testing LLControlGroup::LLControlGroup(const std::string& name) -: INSTANCE_TRACKER_KEYED(LLControlGroup, std::string)(name) {} +: LLInstanceTracker(name) {} LLControlGroup::~LLControlGroup() {} BOOL LLControlGroup::declareString(const std::string& name, const std::string& initial_val, diff --git a/indra/newview/tests/llsechandler_basic_test.cpp b/indra/newview/tests/llsechandler_basic_test.cpp index 814010028f..0235400976 100644 --- a/indra/newview/tests/llsechandler_basic_test.cpp +++ b/indra/newview/tests/llsechandler_basic_test.cpp @@ -69,7 +69,7 @@ extern bool _cert_hostname_wildcard_match(const std::string& hostname, const std std::string gFirstName; std::string gLastName; LLControlGroup::LLControlGroup(const std::string& name) -: INSTANCE_TRACKER_KEYED(LLControlGroup, std::string)(name) {} +: LLInstanceTracker(name) {} LLControlGroup::~LLControlGroup() {} BOOL LLControlGroup::declareString(const std::string& name, const std::string& initial_val, diff --git a/indra/newview/tests/llslurl_test.cpp b/indra/newview/tests/llslurl_test.cpp index d7debd6c67..09343ef227 100644 --- a/indra/newview/tests/llslurl_test.cpp +++ b/indra/newview/tests/llslurl_test.cpp @@ -35,7 +35,7 @@ // Mock objects for the dependencies of the code we're testing LLControlGroup::LLControlGroup(const std::string& name) -: INSTANCE_TRACKER_KEYED(LLControlGroup, std::string)(name) {} +: LLInstanceTracker(name) {} LLControlGroup::~LLControlGroup() {} BOOL LLControlGroup::declareString(const std::string& name, const std::string& initial_val, diff --git a/indra/newview/tests/lltranslate_test.cpp b/indra/newview/tests/lltranslate_test.cpp index c13660332d..fd9527d631 100644 --- a/indra/newview/tests/lltranslate_test.cpp +++ b/indra/newview/tests/lltranslate_test.cpp @@ -295,7 +295,7 @@ LLControlGroup gSavedSettings("test"); std::string LLUI::getLanguage() { return "en"; } std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args) { return "dummy"; } -LLControlGroup::LLControlGroup(const std::string& name) : INSTANCE_TRACKER_KEYED(LLControlGroup, std::string)(name) {} +LLControlGroup::LLControlGroup(const std::string& name) : LLInstanceTracker(name) {} std::string LLControlGroup::getString(const std::string& name) { return "dummy"; } LLControlGroup::~LLControlGroup() {} diff --git a/indra/newview/tests/llviewerhelputil_test.cpp b/indra/newview/tests/llviewerhelputil_test.cpp index 102cad8852..710881d811 100644 --- a/indra/newview/tests/llviewerhelputil_test.cpp +++ b/indra/newview/tests/llviewerhelputil_test.cpp @@ -47,7 +47,7 @@ static std::string gOS; // Mock objects for the dependencies of the code we're testing LLControlGroup::LLControlGroup(const std::string& name) - : INSTANCE_TRACKER_KEYED(LLControlGroup, std::string)(name) {} + : LLInstanceTracker(name) {} LLControlGroup::~LLControlGroup() {} BOOL LLControlGroup::declareString(const std::string& name, const std::string& initial_val, diff --git a/indra/newview/tests/llviewernetwork_test.cpp b/indra/newview/tests/llviewernetwork_test.cpp index 725b5122fb..a1e97ea17e 100644 --- a/indra/newview/tests/llviewernetwork_test.cpp +++ b/indra/newview/tests/llviewernetwork_test.cpp @@ -35,7 +35,7 @@ // Mock objects for the dependencies of the code we're testing LLControlGroup::LLControlGroup(const std::string& name) -: INSTANCE_TRACKER_KEYED(LLControlGroup, std::string)(name) {} +: LLInstanceTracker(name) {} LLControlGroup::~LLControlGroup() {} BOOL LLControlGroup::declareString(const std::string& name, const std::string& initial_val, diff --git a/indra/newview/tests/llworldmipmap_test.cpp b/indra/newview/tests/llworldmipmap_test.cpp index a6a2f8d7b9..142d75bcfd 100644 --- a/indra/newview/tests/llworldmipmap_test.cpp +++ b/indra/newview/tests/llworldmipmap_test.cpp @@ -46,7 +46,7 @@ void LLGLTexture::setBoostLevel(S32 ) { } LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTextureFromUrl(const std::string&, FTType, BOOL, LLGLTexture::EBoostLevel, S8, LLGLint, LLGLenum, const LLUUID& ) { return NULL; } -LLControlGroup::LLControlGroup(const std::string& name) : INSTANCE_TRACKER_KEYED(LLControlGroup, std::string)(name) { } +LLControlGroup::LLControlGroup(const std::string& name) : LLInstanceTracker(name) { } LLControlGroup::~LLControlGroup() { } std::string LLControlGroup::getString(const std::string& ) { return std::string("test_url"); } LLControlGroup gSavedSettings("test_settings"); -- cgit v1.2.3 From cbd3f4b9974c23dc127e080a090c26645b8aa00c Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 24 Apr 2013 10:24:42 -0700 Subject: Fix crash discovered during other testing. Reviewed by Kelly --- indra/newview/llmeshrepository.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index b1b31240e9..83b7cae347 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1235,8 +1235,8 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat mLODReqQ.push(req); LLMeshRepository::sLODProcessing++; } + mPendingLOD.erase(iter); } - mPendingLOD.erase(iter); } return true; -- cgit v1.2.3 From faf844ff996f205af6eb6b2ebd5290594da8d142 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 24 Apr 2013 10:59:25 -0700 Subject: Trivial change to note that earlier changeset 27742 (1c3262183eb5) is a re-work of the LLInstanceTracker code done by Richard. The commit comment is cryptic --- indra/llcommon/llinstancetracker.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/llcommon/llinstancetracker.cpp b/indra/llcommon/llinstancetracker.cpp index 247d0dc4fb..64a313b5ff 100644 --- a/indra/llcommon/llinstancetracker.cpp +++ b/indra/llcommon/llinstancetracker.cpp @@ -32,4 +32,3 @@ // external library headers // other Linden headers - -- cgit v1.2.3 From cc3361352df3463e9ba16e57c04cc35e65821f33 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 24 Apr 2013 15:34:18 -0700 Subject: Follow-up code cleaning for LLToast work trying to get branch healthy. Reviewed by Kelly --- indra/newview/llfloaterimnearbychathandler.cpp | 13 ++++---- indra/newview/lltoast.cpp | 41 ++++++++++++++++++++++++-- indra/newview/lltoast.h | 1 + indra/newview/llviewerwindow.cpp | 4 +++ 4 files changed, 49 insertions(+), 10 deletions(-) diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp index 9ce5e12897..c4d7bbb7f6 100644 --- a/indra/newview/llfloaterimnearbychathandler.cpp +++ b/indra/newview/llfloaterimnearbychathandler.cpp @@ -187,14 +187,11 @@ void LLFloaterIMNearbyChatScreenChannel::deactivateToast(LLToast* toast) { toast_vec_t::iterator pos = std::find(m_active_toasts.begin(), m_active_toasts.end(), toast->getHandle()); - if (pos == m_active_toasts.end()) + if (pos != m_active_toasts.end()) { - llassert(pos == m_active_toasts.end()); - return; + LL_DEBUGS("NearbyChat") << "Deactivating toast" << llendl; + m_active_toasts.erase(pos); } - - LL_DEBUGS("NearbyChat") << "Deactivating toast" << llendl; - m_active_toasts.erase(pos); } void LLFloaterIMNearbyChatScreenChannel::createOverflowToast(S32 bottom, F32 timer) @@ -210,8 +207,8 @@ void LLFloaterIMNearbyChatScreenChannel::onToastDestroyed(LLToast* toast, bool a { // Viewer is quitting. // Immediately stop processing chat messages (EXT-1419). - mStopProcessing = true; -} + mStopProcessing = true; + } else { // The toast is being closed by user (STORM-192). diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index a26e47e1c8..4b60f49573 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -173,8 +173,20 @@ void LLToast::setHideButtonEnabled(bool enabled) //-------------------------------------------------------------------------- LLToast::~LLToast() -{ - mOnToastDestroyedSignal(this); +{ + if(LLApp::isQuitting()) + { + mOnFadeSignal.disconnect_all_slots(); + mOnDeleteToastSignal.disconnect_all_slots(); + mOnToastDestroyedSignal.disconnect_all_slots(); + mOnToastHoverSignal.disconnect_all_slots(); + mToastMouseEnterSignal.disconnect_all_slots(); + mToastMouseLeaveSignal.disconnect_all_slots(); + } + else + { + mOnToastDestroyedSignal(this); + } } //-------------------------------------------------------------------------- @@ -580,3 +592,28 @@ void LLToast::updateClass() toast.updateHoveredState(); } } + +// static +void LLToast::cleanupToasts() +{ + LL_CHECK_MEMORY; + + LLToast * toastp = NULL; + + while (LLInstanceTracker::instanceCount() > 0) + { + { // Need to scope iter to allow deletion + LLInstanceTracker::instance_iter iter = LLInstanceTracker::beginInstances(); + toastp = &(*iter); + } + + //llinfos << "Cleaning up toast id " << toastp->getNotificationID() << llendl; + + // LLToast destructor will remove it from the LLInstanceTracker. + if (!toastp) + break; // Don't get stuck in the loop if a null pointer somehow got on the list + + delete toastp; + } +} + diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index 5da7120e84..f02d7c2a1a 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -106,6 +106,7 @@ public: }; static void updateClass(); + static void cleanupToasts(); LLToast(const LLToast::Params& p); virtual ~LLToast(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index bb71707db6..136e61389a 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -150,6 +150,7 @@ #include "lltexturecache.h" #include "lltexturefetch.h" #include "lltextureview.h" +#include "lltoast.h" #include "lltool.h" #include "lltoolbarview.h" #include "lltoolcomp.h" @@ -2035,6 +2036,9 @@ void LLViewerWindow::shutdownViews() } llinfos << "Global views cleaned." << llendl ; + LLNotificationsUI::LLToast::cleanupToasts(); + llinfos << "Leftover toast cleaned up." << llendl; + // DEV-40930: Clear sModalStack. Otherwise, any LLModalDialog left open // will crump with LL_ERRS. LLModalDialog::shutdownModals(); -- cgit v1.2.3 From 7cb2f4f35856d4b51132d3915c05ac69dc3a90d5 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 24 Apr 2013 16:02:12 -0700 Subject: Remove an un-needed LL_CHECK_MEMORY check --- indra/newview/lltoast.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index 4b60f49573..d876c9a3f4 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -596,8 +596,6 @@ void LLToast::updateClass() // static void LLToast::cleanupToasts() { - LL_CHECK_MEMORY; - LLToast * toastp = NULL; while (LLInstanceTracker::instanceCount() > 0) -- cgit v1.2.3 From 4921c654939d118cb4f9847512d6e3008c67428f Mon Sep 17 00:00:00 2001 From: Cho Date: Thu, 25 Apr 2013 00:10:09 +0100 Subject: added SLApp for fbc --- indra/newview/llpanelpeople.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index c4ce56cb4f..04881a12f1 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -75,6 +75,8 @@ #include "llsociallist.h" #include "llspeakers.h" #include "llfloaterwebcontent.h" +#include "llurlaction.h" +#include "llcommandhandler.h" #define FRIEND_LIST_UPDATE_TIMEOUT 0.5 #define NEARBY_LIST_UPDATE_INTERVAL 1 @@ -92,6 +94,36 @@ static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com/fbc"; static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/redirect"; +class LLFacebookConnectHandler : public LLCommandHandler +{ +public: + LLFacebookConnectHandler() : LLCommandHandler("fbc", UNTRUSTED_THROTTLE), mPanelPeople(NULL) { } + + LLPanelPeople* mPanelPeople; + + bool handle(const LLSD& tokens, const LLSD& query_map, + LLMediaCtrl* web) + { + if (tokens.size() > 0) + { + if (tokens[0].asString() == "connect") + { + if (query_map.has("code")) + { + if (mPanelPeople) + { + mPanelPeople->connectToFacebook(query_map["code"]); + return true; + } + } + } + } + + return false; + } +}; +LLFacebookConnectHandler gFacebookConnectHandler; + /** Comparator for comparing avatar items by last interaction date */ class LLAvatarItemRecentComparator : public LLAvatarItemComparator { @@ -1652,6 +1684,9 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name) void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p) { + gFacebookConnectHandler.mPanelPeople = this; + LLUrlAction::openURLExternal(p.url); + LLFloater* browser = LLFloaterReg::showInstance("web_content", p); if (browser) -- cgit v1.2.3 From 1787988c47921478598c5f47828f3dde8922ffa6 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Wed, 24 Apr 2013 17:41:49 -0700 Subject: ACME-251 Create AvatarFolderItemView: Adding in code to make the persontab's function more like accordiontabs --- indra/newview/llpanelpeople.cpp | 13 ++++++++++++- indra/newview/llpersonfolderview.cpp | 19 +++++++++++++++++++ indra/newview/llpersonfolderview.h | 3 ++- indra/newview/llpersontabview.cpp | 17 +++++++++++++++-- indra/newview/llpersontabview.h | 2 ++ 5 files changed, 50 insertions(+), 4 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 04881a12f1..16dc252946 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -753,7 +753,6 @@ BOOL LLPanelPeople::postBuild() mConversationsRoot->setFollowsAll(); //Create a session - //LLSpeakerMgr* speaker_manager = (LLSpeakerMgr*)LLLocalSpeakerMgr::getInstance(); LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mPersonFolderViewModel); LLPersonTabView::Params params; params.name = item->getDisplayName(); @@ -763,6 +762,18 @@ BOOL LLPanelPeople::postBuild() LLPersonTabView * widget = LLUICtrlFactory::create(params); widget->addToFolder(mConversationsRoot); + mConversationsRoot->mPersonFolderModelMap[item->getID()] = item; + mConversationsRoot->mPersonFolderViewMap[item->getID()] = widget; + + //Create a session + item = new LLPersonTabModel("Facebook Friends Tab Two", mPersonFolderViewModel); + params.name = item->getDisplayName(); + params.root = mConversationsRoot; + params.listener = item; + params.tool_tip = params.name; + widget = LLUICtrlFactory::create(params); + widget->addToFolder(mConversationsRoot); + mConversationsRoot->mPersonFolderModelMap[item->getID()] = item; mConversationsRoot->mPersonFolderViewMap[item->getID()] = widget; diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index d94c8cf32f..dac3dd03c7 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -45,6 +45,25 @@ LLPersonFolderView::~LLPersonFolderView() mConversationsEventStream.stopListening("ConversationsRefresh"); } +BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) +{ + LLFolderViewItem * prior_item = getCurSelectedItem(); + LLFolderViewItem * current_item; + + bool selected_item = LLFolderView::handleMouseDown(x, y, mask); + + current_item = getCurSelectedItem(); + + LLPersonTabView * prior_folder = dynamic_cast(prior_item); + + if(prior_folder && current_item != prior_folder) + { + prior_folder->highlight = false; + } + + return selected_item; +} + bool LLPersonFolderView::onConversationModelEvent(const LLSD &event) { std::string type = event.get("type").asString(); diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h index 60260dc5ea..74e9142a7c 100644 --- a/indra/newview/llpersonfolderview.h +++ b/indra/newview/llpersonfolderview.h @@ -51,9 +51,10 @@ public: ~LLPersonFolderView(); bool onConversationModelEvent(const LLSD &event); - LLPersonView * createConversationViewParticipant(LLPersonModel * item); + BOOL handleMouseDown( S32 x, S32 y, MASK mask ); + person_folder_model_map mPersonFolderModelMap; person_folder_view_map mPersonFolderViewMap; LLEventStream mConversationsEventStream; diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index fff72c7758..20db0572fc 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -37,7 +37,8 @@ LLPersonTabView::Params::Params() {} LLPersonTabView::LLPersonTabView(const LLPersonTabView::Params& p) : -LLFolderViewFolder(p) +LLFolderViewFolder(p), +highlight(false) { } @@ -52,6 +53,18 @@ LLPersonTabView::~LLPersonTabView() } +BOOL LLPersonTabView::handleMouseDown( S32 x, S32 y, MASK mask ) +{ + bool selected_item = LLFolderViewFolder::handleMouseDown(x, y, mask); + + if(selected_item) + { + highlight = true; + } + + return selected_item; +} + void LLPersonTabView::draw() { static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); @@ -68,7 +81,7 @@ void LLPersonTabView::draw() LLColor4 color = sFgColor; F32 right_x = 0; - drawHighlight(false, mIsSelected, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor); + drawHighlight(false, highlight, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor); updateLabelRotation(); drawOpenFolderArrow(default_params, sFgColor); diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index 9aabad26fc..df3f786c69 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -44,7 +44,9 @@ public: virtual ~LLPersonTabView(); S32 getLabelXPos(); + bool highlight; + BOOL handleMouseDown( S32 x, S32 y, MASK mask ); protected: void draw(); -- cgit v1.2.3 From c4a45fca396bea8abf8362b15b5cf0f85e57ad6b Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 25 Apr 2013 11:05:06 -0700 Subject: Enhance "duplicate seed caps" log message ... this needs more investigation. Reviewed by Kelly --- indra/newview/llviewerregion.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 808bc9f3f7..62fb0ed8c1 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -301,12 +301,16 @@ public: if ( regionp->getRegionImpl()->mCapabilities.size() != regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() ) { - llinfos<<"BaseCapabilitiesCompleteTracker "<<"Sim sent duplicate seed caps that differs in size - most likely content."<getName() + << " sent duplicate seed caps that differs in size - most likely content. " + << (S32) regionp->getRegionImpl()->mCapabilities.size() << " vs " << regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() + << llendl; //todo#add cap debug versus original check? - /*CapabilityMap::const_iterator iter = regionp->getRegionImpl()->mCapabilities.begin(); + /* + CapabilityMap::const_iterator iter = regionp->getRegionImpl()->mCapabilities.begin(); while (iter!=regionp->getRegionImpl()->mCapabilities.end() ) { - llinfos<<"BaseCapabilitiesCompleteTracker Original "<first<<" "<< iter->second<first << " is " << iter->second << llendl; ++iter; } */ -- cgit v1.2.3 From 06e1b03362d021e5bdce25a20a78663fdaf7650f Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 25 Apr 2013 11:33:58 -0700 Subject: ACME-251: Create AvatarFolderItemView: Fixed a bug that was causing facebook friends to not be inserted into the proper friends tab. --- indra/newview/llpersonfolderview.cpp | 2 +- indra/newview/llpersonmodelcommon.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index dac3dd03c7..97f5d5a03a 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -73,7 +73,7 @@ bool LLPersonFolderView::onConversationModelEvent(const LLSD &event) if(type == "add_participant") { LLPersonTabModel * person_folder_model = dynamic_cast(mPersonFolderModelMap[folder_id]); - LLPersonTabView * person_folder_view = dynamic_cast(mPersonFolderViewMap[person_id]); + LLPersonTabView * person_folder_view = dynamic_cast(mPersonFolderViewMap[folder_id]); if(person_folder_model) { diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp index 764dd08115..bea7f3d45e 100644 --- a/indra/newview/llpersonmodelcommon.cpp +++ b/indra/newview/llpersonmodelcommon.cpp @@ -38,7 +38,8 @@ LLPersonModelCommon::LLPersonModelCommon(std::string display_name, LLFolderViewModelInterface& root_view_model) : LLFolderViewModelItemCommon(root_view_model), - mName(display_name) + mName(display_name), + mID(LLUUID().generateNewID()) { } -- cgit v1.2.3 From 6e483af1f6b7a6f8d0f83e54d79a941607760f7b Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 25 Apr 2013 14:14:35 -0700 Subject: Revert ares and libcurl version update that was causing problems, revise curl handle duplication code. Reviewed by Kelly --- autobuild.xml | 24 +++++++-------- indra/llcorehttp/_httpinternal.h | 3 -- indra/llcorehttp/_httpoprequest.cpp | 13 +-------- indra/llcorehttp/_httpoprequest.h | 3 -- indra/llmessage/llcurl.cpp | 58 ++++++++++++++++++++++++++----------- indra/llmessage/llcurl.h | 11 ++----- 6 files changed, 57 insertions(+), 55 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index f6f23f6c1c..3aa097bfab 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -138,9 +138,9 @@ archive hash - 4dd93da518dc00319cadac43dce2676b + e6caaeea16131e1f2343ecd7765e3147 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ares/rev/239515/arch/Darwin/installer/ares-1.7.5-darwin-20110825.tar.bz2 + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/ares-1.7.1-darwin-20110217.tar.bz2 name darwin @@ -150,9 +150,9 @@ archive hash - c223c0df8ebdab02a5bd785c21459875 + 0745872db83d45f4ab3bdc697d98e264 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ares/rev/239515/arch/Linux/installer/ares-1.7.5-linux-20110825.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ares/rev/223275/arch/Linux/installer/ares-1.7.1-linux-20110310.tar.bz2 name linux @@ -162,9 +162,9 @@ archive hash - a0a002359e44a9c68f897b45217abf7e + 1dcec6babd249a2597114d4ac226c461 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ares/rev/239515/arch/CYGWIN/installer/ares-1.7.5-windows-20110825.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ares/rev/220963/arch/CYGWIN/installer/ares-1.7.1-windows-20110211.tar.bz2 name windows @@ -282,9 +282,9 @@ archive hash - 6f6b4fc6268e7935e82e694ed3f5912a + aaea644191807f51051cefa2fac11069 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-curl/rev/249347/arch/Darwin/installer/curl-7.24.0-darwin-20120213.tar.bz2 + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/curl-7.21.1-darwin-20110316.tar.bz2 name darwin @@ -294,9 +294,9 @@ archive hash - 384e6d46f2f4228117cda7eea396df06 + 2d9377951d99a1aa4735cea8d4b5aa71 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-curl/rev/263749/arch/Linux/installer/curl-7.24.0-linux-20120820.tar.bz2 + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/curl-7.21.1-linux-20110316.tar.bz2 name linux @@ -306,9 +306,9 @@ archive hash - 56c72a3b4d6faab81a4d66a630a67c83 + fea96aa2a7d513397317194f3d6c979b url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-curl/rev/249347/arch/CYGWIN/installer/curl-7.24.0-windows-20120213.tar.bz2 + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/curl-7.21.1-windows-20110211.tar.bz2 name windows diff --git a/indra/llcorehttp/_httpinternal.h b/indra/llcorehttp/_httpinternal.h index 14f744a9f1..008e4fd95c 100644 --- a/indra/llcorehttp/_httpinternal.h +++ b/indra/llcorehttp/_httpinternal.h @@ -146,9 +146,6 @@ const int HTTP_SERVICE_LOOP_SLEEP_NORMAL_MS = 2; // Block allocation size (a tuning parameter) is found // in bufferarray.h. -// Compatibility controls -const bool HTTP_ENABLE_LINKSYS_WRT54G_V5_DNS_FIX = true; - } // end namespace LLCore #endif // _LLCORE_HTTP_INTERNAL_H_ diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index 469ce75434..89dcd334f4 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -380,18 +380,7 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) // Get policy options HttpPolicyGlobal & policy(service->getPolicy().getGlobalOptions()); - mCurlHandle = LLCurlHandleHandler::getInstance()->CreateCurlHandle(); - - if (HTTP_ENABLE_LINKSYS_WRT54G_V5_DNS_FIX) - { - // The Linksys WRT54G V5 router has an issue with frequent - // DNS lookups from LAN machines. If they happen too often, - // like for every HTTP request, the router gets annoyed after - // about 700 or so requests and starts issuing TCP RSTs to - // new connections. Reuse the DNS lookups for even a few - // seconds and no RSTs. - curl_easy_setopt(mCurlHandle, CURLOPT_DNS_CACHE_TIMEOUT, 15); - } + mCurlHandle = LLCurl::createStandardCurlHandle(); curl_easy_setopt(mCurlHandle, CURLOPT_WRITEFUNCTION, writeCallback); curl_easy_setopt(mCurlHandle, CURLOPT_READFUNCTION, readCallback); diff --git a/indra/llcorehttp/_httpoprequest.h b/indra/llcorehttp/_httpoprequest.h index e819f74079..74a349b0bf 100644 --- a/indra/llcorehttp/_httpoprequest.h +++ b/indra/llcorehttp/_httpoprequest.h @@ -29,7 +29,6 @@ #include "linden_common.h" // Modifies curl/curl.h interfaces -#include "llsingleton.h" #include #include @@ -66,8 +65,6 @@ class HttpOpRequest : public HttpOperation public: HttpOpRequest(); - friend class CurlHandleHandler; - protected: virtual ~HttpOpRequest(); // Use release() diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index c02483ccf5..081f070866 100644 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -92,6 +92,7 @@ S32 LLCurl::sTotalHandles = 0 ; bool LLCurl::sNotQuitting = true; F32 LLCurl::sCurlRequestTimeOut = 120.f; //seonds S32 LLCurl::sMaxHandles = 256; //max number of handles, (multi handles and easy handles combined). +CURL* LLCurl::sCurlTemplateStandardHandle = NULL; void check_curl_code(CURLcode code) { @@ -1815,7 +1816,7 @@ CURL* LLCurl::newEasyHandle() } sTotalHandles++; - CURL* ret = LLCurlHandleHandler::getInstance()->CreateCurlHandle(); + CURL* ret = createStandardCurlHandle(); if(!ret) { llwarns << "failed to create curl handle." << llendl ; @@ -1849,23 +1850,46 @@ void LLCurlFF::check_multi_code(CURLMcode code) check_curl_multi_code(code); } -CURL* LLCurlHandleHandler::the_one_true_curl_handle; -LLCurlHandleHandler::LLCurlHandleHandler() +// Static +CURL* LLCurl::createStandardCurlHandle() { - the_one_true_curl_handle = curl_easy_init(); - curl_easy_setopt(the_one_true_curl_handle, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); - curl_easy_setopt(the_one_true_curl_handle, CURLOPT_NOSIGNAL, 1); - curl_easy_setopt(the_one_true_curl_handle, CURLOPT_NOPROGRESS, 1); - curl_easy_setopt(the_one_true_curl_handle, CURLOPT_ENCODING, ""); - curl_easy_setopt(the_one_true_curl_handle, CURLOPT_AUTOREFERER, 1); - curl_easy_setopt(the_one_true_curl_handle, CURLOPT_FOLLOWLOCATION, 1); - curl_easy_setopt(the_one_true_curl_handle, CURLOPT_SSL_VERIFYPEER, 1); - curl_easy_setopt(the_one_true_curl_handle, CURLOPT_SSL_VERIFYHOST, 0); - curl_easy_setopt(the_one_true_curl_handle, CURLOPT_DNS_CACHE_TIMEOUT, 0); -} + if (sCurlTemplateStandardHandle == NULL) + { // Late creation of the template curl handle + sCurlTemplateStandardHandle = curl_easy_init(); + if (sCurlTemplateStandardHandle == NULL) + { + llwarns << "curl error calling curl_easy_init()" << llendl; + } + else + { + CURLcode result = curl_easy_setopt(sCurlTemplateStandardHandle, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); + check_curl_code(result); + result = curl_easy_setopt(sCurlTemplateStandardHandle, CURLOPT_NOSIGNAL, 1); + check_curl_code(result); + result = curl_easy_setopt(sCurlTemplateStandardHandle, CURLOPT_NOPROGRESS, 1); + check_curl_code(result); + result = curl_easy_setopt(sCurlTemplateStandardHandle, CURLOPT_ENCODING, ""); + check_curl_code(result); + result = curl_easy_setopt(sCurlTemplateStandardHandle, CURLOPT_AUTOREFERER, 1); + check_curl_code(result); + result = curl_easy_setopt(sCurlTemplateStandardHandle, CURLOPT_FOLLOWLOCATION, 1); + check_curl_code(result); + result = curl_easy_setopt(sCurlTemplateStandardHandle, CURLOPT_SSL_VERIFYPEER, 1); + check_curl_code(result); + result = curl_easy_setopt(sCurlTemplateStandardHandle, CURLOPT_SSL_VERIFYHOST, 0); + check_curl_code(result); + + // The Linksys WRT54G V5 router has an issue with frequent + // DNS lookups from LAN machines. If they happen too often, + // like for every HTTP request, the router gets annoyed after + // about 700 or so requests and starts issuing TCP RSTs to + // new connections. Reuse the DNS lookups for even a few + // seconds and no RSTs. + result = curl_easy_setopt(sCurlTemplateStandardHandle, CURLOPT_DNS_CACHE_TIMEOUT, 15); + check_curl_code(result); + } + } -CURL* LLCurlHandleHandler::CreateCurlHandle() -{ - return curl_easy_duphandle(the_one_true_curl_handle); + return curl_easy_duphandle(sCurlTemplateStandardHandle); } diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h index a03333157c..90b3f2815d 100644 --- a/indra/llmessage/llcurl.h +++ b/indra/llmessage/llcurl.h @@ -53,14 +53,6 @@ class LLCurlThread; // For whatever reason, this is not typedef'd in curl.h typedef size_t (*curl_header_callback)(void *ptr, size_t size, size_t nmemb, void *stream); -class LLCurlHandleHandler : public LLSingleton -{ -public: - static CURL* the_one_true_curl_handle; - LLCurlHandleHandler(); - static CURL* CreateCurlHandle(); -}; - class LLCurl { LOG_CLASS(LLCurl); @@ -196,6 +188,8 @@ public: static CURL* newEasyHandle() ; static void deleteEasyHandle(CURL* handle) ; + static CURL* createStandardCurlHandle(); + private: static std::string sCAPath; static std::string sCAFile; @@ -205,6 +199,7 @@ private: static LLMutex* sHandleMutexp ; static S32 sTotalHandles ; static S32 sMaxHandles; + static CURL* sCurlTemplateStandardHandle; public: static bool sNotQuitting; static F32 sCurlRequestTimeOut; -- cgit v1.2.3 From b49f6e1e744e7650fbea77e5744343d223e962a3 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 25 Apr 2013 16:21:32 -0700 Subject: Clean up LLSingleton work - special case to re-create instance if it's been deleted. --- indra/llcommon/llsingleton.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h index 84afeb563e..550e3c0d20 100644 --- a/indra/llcommon/llsingleton.h +++ b/indra/llcommon/llsingleton.h @@ -145,7 +145,9 @@ public: if (data.mInitState == DELETED) { llwarns << "Trying to access deleted singleton " << typeid(DERIVED_TYPE).name() << " creating new instance" << llendl; - } + data.mSingletonInstance = new DERIVED_TYPE(); + data.mInitState = INITIALIZING; + } // Fall into INITIALIZING case below if (data.mInitState == INITIALIZING) { -- cgit v1.2.3 From 4562efdc7418923caa88bcf0c68a177f772c044b Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 25 Apr 2013 16:29:02 -0700 Subject: ACME-251: This should be final commit for this task, now the peopletab looks like the accordion tab. --- indra/newview/llpersonfolderview.cpp | 25 ++++++---- indra/newview/llpersontabview.cpp | 58 ++++++++++++++++++++-- indra/newview/llpersontabview.h | 7 +++ .../default/xui/en/widgets/person_tab_view.xml | 4 +- 4 files changed, 77 insertions(+), 17 deletions(-) diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index 97f5d5a03a..8141eecc35 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -47,21 +47,24 @@ LLPersonFolderView::~LLPersonFolderView() BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) { - LLFolderViewItem * prior_item = getCurSelectedItem(); - LLFolderViewItem * current_item; + LLFolderViewItem * item = getCurSelectedItem(); - bool selected_item = LLFolderView::handleMouseDown(x, y, mask); - - current_item = getCurSelectedItem(); - - LLPersonTabView * prior_folder = dynamic_cast(prior_item); - - if(prior_folder && current_item != prior_folder) + //Will disable highlight on tab + if(item) { - prior_folder->highlight = false; + LLPersonTabView * person_tab= dynamic_cast(item); + if(person_tab) + { + person_tab->highlight = false; + } + else + { + person_tab = dynamic_cast(item->getParent()); + person_tab->highlight = false; + } } - return selected_item; + return LLFolderView::handleMouseDown(x, y, mask); } bool LLPersonFolderView::onConversationModelEvent(const LLSD &event) diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 20db0572fc..3556878b91 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -38,9 +38,11 @@ LLPersonTabView::Params::Params() LLPersonTabView::LLPersonTabView(const LLPersonTabView::Params& p) : LLFolderViewFolder(p), -highlight(false) +highlight(false), +mImageHeader(LLUI::getUIImage("Accordion_Off")), +mImageHeaderOver(LLUI::getUIImage("Accordion_Over")), +mImageHeaderFocused(LLUI::getUIImage("Accordion_Selected")) { - } S32 LLPersonTabView::getLabelXPos() @@ -73,7 +75,7 @@ void LLPersonTabView::draw() static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE); static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); - static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("DkGray", DEFAULT_WHITE); + const LLFontGL * font = LLFontGL::getFontSansSerif(); F32 text_left = (F32)getLabelXPos(); @@ -81,8 +83,9 @@ void LLPersonTabView::draw() LLColor4 color = sFgColor; F32 right_x = 0; - drawHighlight(false, highlight, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor); + //drawHighlight(false, highlight, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor); + drawHighlight(); updateLabelRotation(); drawOpenFolderArrow(default_params, sFgColor); @@ -91,6 +94,53 @@ void LLPersonTabView::draw() LLView::draw(); } +void LLPersonTabView::drawHighlight() +{ + S32 width = getRect().getWidth(); + S32 height = mItemHeight; + S32 x = 1; + S32 y = getRect().getHeight() - mItemHeight; + + //const S32 FOCUS_LEFT = 1; + //const S32 focus_top = getRect().getHeight(); + //const S32 focus_bottom = getRect().getHeight() - mItemHeight; + //static LLUIColor bgColor = LLUIColorTable::instance().getColor("DkGray2", DEFAULT_WHITE); + //static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); + + if(highlight) + { + //reference will remove + /*gl_rect_2d(FOCUS_LEFT, + focus_top, + getRect().getWidth() - 2, + focus_bottom, + sMouseOverColor, TRUE);*/ + mImageHeaderFocused->draw(x,y,width,height); + } + else + { + //reference will remove + /*gl_rect_2d(FOCUS_LEFT, + focus_top, + getRect().getWidth() - 2, + focus_bottom, + bgColor, TRUE);*/ + mImageHeader->draw(x,y,width,height); + } + + if(mIsMouseOverTitle) + { + //reference will remove + /*gl_rect_2d(FOCUS_LEFT, + focus_top, + getRect().getWidth() - 2, + focus_bottom, + sMouseOverColor, TRUE);*/ + mImageHeaderOver->draw(x,y,width,height); + } + +} + // // LLPersonView // diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index df3f786c69..35cb219ce2 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -50,8 +50,15 @@ public: protected: void draw(); + void drawHighlight(); private: + + // Background images + LLPointer mImageHeader; + LLPointer mImageHeaderOver; + LLPointer mImageHeaderFocused; + }; class LLPersonView : public LLFolderViewItem diff --git a/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml index 46857ac700..b36011763a 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml @@ -2,11 +2,11 @@ Date: Thu, 25 Apr 2013 17:38:54 -0700 Subject: ACME-252 Create AvatarFolderItemView: Now the sub items of the persontab are drawn with different highlights depending on if they are selected or moused over. --- indra/newview/llpersontabview.cpp | 63 +++++++++++----------- indra/newview/llpersontabview.h | 4 ++ .../default/xui/en/widgets/person_tab_view.xml | 2 +- .../skins/default/xui/en/widgets/person_view.xml | 13 +++++ 4 files changed, 49 insertions(+), 33 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/widgets/person_view.xml diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 3556878b91..dc55f627d6 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -72,19 +72,12 @@ void LLPersonTabView::draw() static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); static const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams(); - static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); - static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE); - static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); - - const LLFontGL * font = LLFontGL::getFontSansSerif(); F32 text_left = (F32)getLabelXPos(); F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad; LLColor4 color = sFgColor; F32 right_x = 0; - //drawHighlight(false, highlight, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor); - drawHighlight(); updateLabelRotation(); drawOpenFolderArrow(default_params, sFgColor); @@ -101,41 +94,17 @@ void LLPersonTabView::drawHighlight() S32 x = 1; S32 y = getRect().getHeight() - mItemHeight; - //const S32 FOCUS_LEFT = 1; - //const S32 focus_top = getRect().getHeight(); - //const S32 focus_bottom = getRect().getHeight() - mItemHeight; - //static LLUIColor bgColor = LLUIColorTable::instance().getColor("DkGray2", DEFAULT_WHITE); - //static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); - if(highlight) { - //reference will remove - /*gl_rect_2d(FOCUS_LEFT, - focus_top, - getRect().getWidth() - 2, - focus_bottom, - sMouseOverColor, TRUE);*/ mImageHeaderFocused->draw(x,y,width,height); } else { - //reference will remove - /*gl_rect_2d(FOCUS_LEFT, - focus_top, - getRect().getWidth() - 2, - focus_bottom, - bgColor, TRUE);*/ mImageHeader->draw(x,y,width,height); } if(mIsMouseOverTitle) { - //reference will remove - /*gl_rect_2d(FOCUS_LEFT, - focus_top, - getRect().getWidth() - 2, - focus_bottom, - sMouseOverColor, TRUE);*/ mImageHeaderOver->draw(x,y,width,height); } @@ -145,12 +114,15 @@ void LLPersonTabView::drawHighlight() // LLPersonView // +static LLDefaultChildRegistry::Register r_person_view("person_view"); LLPersonView::Params::Params() {} LLPersonView::LLPersonView(const LLPersonView::Params& p) : -LLFolderViewItem(p) +LLFolderViewItem(p), +mImageOver(LLUI::getUIImage("ListItem_Over")), +mImageSelected(LLUI::getUIImage("ListItem_Select")) { } @@ -183,7 +155,34 @@ void LLPersonView::draw() LLColor4 color = mIsSelected ? sHighlightFgColor : sFgColor; F32 right_x = 0; + drawHighlight(); drawLabel(font, text_left, y, color, right_x); LLView::draw(); } + +void LLPersonView::drawHighlight() +{ + static LLUIColor outline_color = LLUIColorTable::instance().getColor("Green_80", DEFAULT_WHITE); + + S32 width = getRect().getWidth(); + S32 height = mItemHeight; + S32 x = 1; + S32 y = 0; + + if(mIsSelected) + { + mImageSelected->draw(x, y, width, height); + //Need to find a better color that matches the outline in avatarlistitem + gl_rect_2d(x, + height, + width, + y, + outline_color, FALSE); + } + + if(mIsMouseOverTitle) + { + mImageOver->draw(x, y, width, height); + } +} diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index 35cb219ce2..b246be288a 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -79,9 +79,13 @@ public: protected: void draw(); + void drawHighlight(); private: + LLPointer mImageOver; + LLPointer mImageSelected; + LLAvatarIconCtrl* mAvatarIcon; LLButton * mInfoBtn; diff --git a/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml index b36011763a..d46938d3b7 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml @@ -6,7 +6,7 @@ item_top_pad="3" mouse_opaque="true" follows="left|top|right" - text_pad="5" + text_pad="6" text_pad_left="4" text_pad_right="4" arrow_size="10" diff --git a/indra/newview/skins/default/xui/en/widgets/person_view.xml b/indra/newview/skins/default/xui/en/widgets/person_view.xml new file mode 100644 index 0000000000..d46938d3b7 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml @@ -0,0 +1,13 @@ + + -- cgit v1.2.3 From 228a312cf68088a8388a9318d1c8d23aaa52eaab Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 26 Apr 2013 09:49:48 -0700 Subject: ACME-252 Create AvatarFolderItemView: Corrected person_tab_view.xml and person_view.xml to have the proper parent tag. It was conversation_view_session for both which was wrong. Also updated the selected color for the personview. --- indra/newview/llpersontabview.cpp | 2 +- indra/newview/skins/default/xui/en/widgets/person_tab_view.xml | 2 +- indra/newview/skins/default/xui/en/widgets/person_view.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index dc55f627d6..3093ff9015 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -163,7 +163,7 @@ void LLPersonView::draw() void LLPersonView::drawHighlight() { - static LLUIColor outline_color = LLUIColorTable::instance().getColor("Green_80", DEFAULT_WHITE); + static LLUIColor outline_color = LLUIColorTable::instance().getColor("EmphasisColor", DEFAULT_WHITE); S32 width = getRect().getWidth(); S32 height = mItemHeight; diff --git a/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml index d46938d3b7..af5aec2c34 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml @@ -1,5 +1,5 @@ - - Date: Fri, 26 Apr 2013 10:10:31 -0700 Subject: ACME-252 Create AvatarFolderItemView: Now when connecting to facebook using the + button the fctest two tab is populated. --- indra/newview/llpanelpeople.cpp | 40 ++++++++++++++++++++-------------------- indra/newview/llpanelpeople.h | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 16dc252946..ab8d090cb6 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -581,7 +581,7 @@ private: LLPanelPeople::LLPanelPeople() : LLPanel(), mConnectedToFbc(false), - mConversationsRoot(NULL), + mPersonFolderView(NULL), mTryToConnectToFbc(true), mTabContainer(NULL), mOnlineFriendList(NULL), @@ -735,7 +735,7 @@ BOOL LLPanelPeople::postBuild() folder_view_params.use_ellipses = false; folder_view_params.options_menu = "menu_conversation.xml"; folder_view_params.name = "fbcfolderview"; - mConversationsRoot = LLUICtrlFactory::create(folder_view_params); + mPersonFolderView = LLUICtrlFactory::create(folder_view_params); //Create scroller LLRect scroller_view_rect = socialtwo_tab->getRect(); @@ -747,35 +747,35 @@ BOOL LLPanelPeople::postBuild() LLScrollContainer* scroller = LLUICtrlFactory::create(scroller_params); socialtwo_tab->addChildInBack(scroller); - scroller->addChild(mConversationsRoot); + scroller->addChild(mPersonFolderView); scroller->setFollowsAll(); - mConversationsRoot->setScrollContainer(scroller); - mConversationsRoot->setFollowsAll(); + mPersonFolderView->setScrollContainer(scroller); + mPersonFolderView->setFollowsAll(); //Create a session LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mPersonFolderViewModel); LLPersonTabView::Params params; params.name = item->getDisplayName(); - params.root = mConversationsRoot; + params.root = mPersonFolderView; params.listener = item; params.tool_tip = params.name; LLPersonTabView * widget = LLUICtrlFactory::create(params); - widget->addToFolder(mConversationsRoot); + widget->addToFolder(mPersonFolderView); - mConversationsRoot->mPersonFolderModelMap[item->getID()] = item; - mConversationsRoot->mPersonFolderViewMap[item->getID()] = widget; + mPersonFolderView->mPersonFolderModelMap[item->getID()] = item; + mPersonFolderView->mPersonFolderViewMap[item->getID()] = widget; //Create a session item = new LLPersonTabModel("Facebook Friends Tab Two", mPersonFolderViewModel); params.name = item->getDisplayName(); - params.root = mConversationsRoot; + params.root = mPersonFolderView; params.listener = item; params.tool_tip = params.name; widget = LLUICtrlFactory::create(params); - widget->addToFolder(mConversationsRoot); + widget->addToFolder(mPersonFolderView); - mConversationsRoot->mPersonFolderModelMap[item->getID()] = item; - mConversationsRoot->mPersonFolderViewMap[item->getID()] = widget; + mPersonFolderView->mPersonFolderModelMap[item->getID()] = item; + mPersonFolderView->mPersonFolderViewMap[item->getID()] = widget; gIdleCallbacks.addFunction(idle, this); @@ -865,7 +865,7 @@ void LLPanelPeople::onChange(EStatusType status, const std::string &channelURI, void LLPanelPeople::idle(void * user_data) { LLPanelPeople * self = static_cast(user_data); - self->mConversationsRoot->update(); + self->mPersonFolderView->update(); } void LLPanelPeople::updateFriendListHelpText() @@ -1721,11 +1721,11 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) mFacebookFriends->addNewItem(agent_id, name, false); //Add to folder view - //LLConversationItemSession * session_model = dynamic_cast(mConversationsItems[LLUUID(NULL)]); - //if(session_model) - //{ - // addParticipantToModel(session_model, agent_id, name); - //} + LLPersonTabModel * session_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap.begin()->second); + if(session_model) + { + addParticipantToModel(session_model, agent_id, name); + } } } @@ -1733,7 +1733,7 @@ void LLPanelPeople::addTestParticipant() { for(int i = 0; i < 300; ++i) { - LLPersonTabModel * person_folder_model = dynamic_cast(mConversationsRoot->mPersonFolderModelMap.begin()->second); + LLPersonTabModel * person_folder_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap.begin()->second); addParticipantToModel(person_folder_model, LLUUID().generateNewID(), "EastBayGuy"); } } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index a448b7935e..497871bedb 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -178,7 +178,7 @@ private: LLHandle< LLFloater > mPicker; LLPersonFolderViewModel mPersonFolderViewModel; - LLPersonFolderView* mConversationsRoot; + LLPersonFolderView* mPersonFolderView; }; #endif //LL_LLPANELPEOPLE_H -- cgit v1.2.3 From e1dbbd0213dd96e28aec2c5e6d9fd821ab144e48 Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 26 Apr 2013 21:26:38 +0100 Subject: removed internal browser hack for getting auth code in favor of SLApp-only approach --- indra/newview/llappviewer.cpp | 15 ++++----- indra/newview/llpanelpeople.cpp | 67 +++++------------------------------------ indra/newview/llpanelpeople.h | 2 +- 3 files changed, 16 insertions(+), 68 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 53c694eaca..31f7f61396 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2577,19 +2577,20 @@ bool LLAppViewer::initConfiguration() // What can happen is that someone can use IE (or potentially // other browsers) and do the rough equivalent of command // injection and steal passwords. Phoenix. SL-55321 + LLSLURL option_slurl; if(clp.hasOption("url")) { - LLStartUp::setStartSLURL(LLSLURL(clp.getOption("url")[0])); + option_slurl = LLSLURL(clp.getOption("url")[0]); + LLStartUp::setStartSLURL(option_slurl); if(LLStartUp::getStartSLURL().getType() == LLSLURL::LOCATION) { LLGridManager::getInstance()->setGridChoice(LLStartUp::getStartSLURL().getGrid()); - - } + } } else if(clp.hasOption("slurl")) { - LLSLURL start_slurl(clp.getOption("slurl")[0]); - LLStartUp::setStartSLURL(start_slurl); + option_slurl = LLSLURL(clp.getOption("slurl")[0]); + LLStartUp::setStartSLURL(option_slurl); } const LLControlVariable* skinfolder = gSavedSettings.getControl("SkinCurrent"); @@ -2686,10 +2687,10 @@ bool LLAppViewer::initConfiguration() // it relies on checking a marker file which will not work when running // out of different directories - if (LLStartUp::getStartSLURL().isValid() && + if (option_slurl.isValid() && (gSavedSettings.getBOOL("SLURLPassToOtherInstance"))) { - if (sendURLToOtherInstance(LLStartUp::getStartSLURL().getSLURLString())) + if (sendURLToOtherInstance(option_slurl.getSLURLString())) { // successfully handed off URL to existing instance, exit return false; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index ab8d090cb6..86303cee70 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -113,6 +113,7 @@ public: if (mPanelPeople) { mPanelPeople->connectToFacebook(query_map["code"]); + mPanelPeople = NULL; return true; } } @@ -970,46 +971,7 @@ void LLPanelPeople::updateRecentList() void LLPanelPeople::updateFbcTestList() { - if (mFbcTestBrowserHandle.get()) - { - // get the current browser url (from the title bar, of course!) - std::string url = mFbcTestBrowserHandle.get()->getTitle(); - - // if the browser has redirected from facebook - if (url.find(getFacebookRedirectURL()) == 0) - { - // find the auth code in the url - std::string begin_string = "code="; - std::string end_string = "#"; - size_t begin_index = begin_string.length() + url.find(begin_string, getFacebookRedirectURL().length()); - size_t end_index = url.find(end_string, begin_index); - - // extract the auth code from the url - std::string auth_code; - if (end_index != std::string::npos) - { - auth_code = url.substr(begin_index, end_index - begin_index); - } - else - { - auth_code = url.substr(begin_index); - } - llinfos << "extracted code " << auth_code << " from url " << url << llendl; - - // finish authenticating on the server - connectToFacebook(auth_code); - - // close the browser window - mFbcTestBrowserHandle.get()->die(); - - // get rid of the handle - mFbcTestBrowserHandle = LLHandle(); - - // stop updating - mFbcTestListUpdater->setActive(false); - } - } - else if (mTryToConnectToFbc) + if (mTryToConnectToFbc) { // try to reconnect to facebook! tryToReconnectToFacebook(); @@ -1693,19 +1655,10 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name) return isAccordionCollapsedByUser(getChild(name)); } -void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p) +void LLPanelPeople::openFacebookWeb(std::string url) { gFacebookConnectHandler.mPanelPeople = this; - LLUrlAction::openURLExternal(p.url); - - LLFloater* browser = LLFloaterReg::showInstance("web_content", p); - - if (browser) - { - // start checking the browser to see if the data is available yet - mFbcTestBrowserHandle = browser->getHandle(); - mFbcTestListUpdater->setActive(true); - } + LLUrlAction::openURLExternal(url); } void LLPanelPeople::showFacebookFriends(const LLSD& friends) @@ -1827,9 +1780,7 @@ public: // show the facebook login page if not connected yet if (status == 404 && mShowLoginIfNotConnected) { - LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + mPanelPeople->getFacebookRedirectURL()); - mPanelPeople->openFacebookWeb(p); + mPanelPeople->openFacebookWeb("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + mPanelPeople->getFacebookRedirectURL()); } } } @@ -1914,16 +1865,12 @@ void LLPanelPeople::onLoginFbcButtonClicked() void LLPanelPeople::onFacebookAppRequestClicked() { - LLFloaterWebContent::Params p; - p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + getFacebookRedirectURL()); - openFacebookWeb(p); + openFacebookWeb("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + getFacebookRedirectURL()); } void LLPanelPeople::onFacebookAppSendClicked() { - LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + getFacebookRedirectURL()); - openFacebookWeb(p); + openFacebookWeb("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + getFacebookRedirectURL()); } static LLFastTimer::DeclareTimer FTM_AVATAR_LIST_TEST("avatar list test"); diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 497871bedb..95105309d2 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -62,7 +62,7 @@ public: static void idle(void * user_data); - void openFacebookWeb(LLFloaterWebContent::Params& p); + void openFacebookWeb(std::string url); void showFacebookFriends(const LLSD& friends); void addTestParticipant(); void addParticipantToModel(LLPersonTabModel * session_model, const LLUUID& agent_id, const std::string& name); -- cgit v1.2.3 From f36171b8cae93bdaf6d3df2bf964313d1da087b6 Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 26 Apr 2013 23:35:28 +0100 Subject: made sendURLToOtherInstance() happen before viewer window actually appears, in the event of an external browser launching a SLApp --- indra/newview/llappviewer.cpp | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 31f7f61396..e97c264af3 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2577,7 +2577,9 @@ bool LLAppViewer::initConfiguration() // What can happen is that someone can use IE (or potentially // other browsers) and do the rough equivalent of command // injection and steal passwords. Phoenix. SL-55321 + LLSLURL option_slurl; + if(clp.hasOption("url")) { option_slurl = LLSLURL(clp.getOption("url")[0]); @@ -2592,6 +2594,21 @@ bool LLAppViewer::initConfiguration() option_slurl = LLSLURL(clp.getOption("slurl")[0]); LLStartUp::setStartSLURL(option_slurl); } + + //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 + + if (option_slurl.isValid() && + (gSavedSettings.getBOOL("SLURLPassToOtherInstance"))) + { + if (sendURLToOtherInstance(option_slurl.getSLURLString())) + { + // successfully handed off URL to existing instance, exit + return false; + } + } const LLControlVariable* skinfolder = gSavedSettings.getControl("SkinCurrent"); if(skinfolder && LLStringUtil::null != skinfolder->getValue().asString()) @@ -2682,21 +2699,6 @@ bool LLAppViewer::initConfiguration() #endif LLStringUtil::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 - - if (option_slurl.isValid() && - (gSavedSettings.getBOOL("SLURLPassToOtherInstance"))) - { - if (sendURLToOtherInstance(option_slurl.getSLURLString())) - { - // successfully handed off URL to existing instance, exit - return false; - } - } - if (!gSavedSettings.getBOOL("AllowMultipleViewers")) { // -- cgit v1.2.3 From 39638b0de3734fea2d112161a3289b67f7594ba3 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 26 Apr 2013 15:54:03 -0700 Subject: Convert LLThreadSafeRefCount back to atomic ref counting. Reviewed by Kelly --- indra/llcommon/llthread.h | 90 +++++------------------------------------------ 1 file changed, 9 insertions(+), 81 deletions(-) diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index a6eb14db9d..f51d985b5f 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -225,7 +225,6 @@ void LLThread::unlockData() // see llmemory.h for LLPointer<> definition -#if (1) // Old code - see comment below class LL_COMMON_API LLThreadSafeRefCount { public: @@ -243,99 +242,28 @@ public: LLThreadSafeRefCount(const LLThreadSafeRefCount&); LLThreadSafeRefCount& operator=(const LLThreadSafeRefCount& ref) { - if (sMutex) - { - sMutex->lock(); - } mRef = 0; - if (sMutex) - { - sMutex->unlock(); - } return *this; } - - void ref() { - if (sMutex) sMutex->lock(); mRef++; - if (sMutex) sMutex->unlock(); } - S32 unref() + void unref() { llassert(mRef >= 1); - if (sMutex) sMutex->lock(); - S32 res = --mRef; - if (sMutex) sMutex->unlock(); - if (0 == res) - { - delete this; - return 0; + if ((--mRef) == 0) // See note in llapr.h on atomic decrement operator return value. + { + // If we hit zero, the caller should be the only smart pointer owning the object and we can delete it. + // It is technically possible for a vanilla pointer to mess this up, or another thread to + // jump in, find this object, create another smart pointer and end up dangling, but if + // the code is that bad and not thread-safe, it's trouble already. + delete this; } - return res; - } - S32 getNumRefs() const - { - return mRef; } -private: - S32 mRef; -}; - -#else - // New code - This was from https://bitbucket.org/lindenlab/viewer-cat/commits/b03bb43e4ead57f904cb3c1e9745dc8460de6efc - // and attempts - -class LL_COMMON_API LLThreadSafeRefCount -{ -public: - static void initThreadSafeRefCount(); // creates sMutex - static void cleanupThreadSafeRefCount(); // destroys sMutex - -private: - static LLMutex* sMutex; - -protected: - virtual ~LLThreadSafeRefCount(); // use unref() - -public: - LLThreadSafeRefCount(); - LLThreadSafeRefCount(const LLThreadSafeRefCount&); - LLThreadSafeRefCount& operator=(const LLThreadSafeRefCount& ref) - { - mRef = 0; - return *this; - } - - void ref() - { - mRef++; - } - - S32 unref() - { - llassert(mRef >= 1); - bool time_to_die = (mRef == 1); - if (time_to_die) - { - if (sMutex) sMutex->lock(); - // Looks redundant, but is very much not - // We need to check again once we've acquired the lock - // so that two threads who get into the if in parallel - // don't both attempt to the delete. - // - mRef--; // Simon: why not if (mRef == 1) delete this; ? There still seems to be a window where mRef could be modified - if (mRef == 0) - delete this; - if (sMutex) sMutex->unlock(); - return 0; - } - return --mRef; - } S32 getNumRefs() const { const S32 currentVal = mRef.CurrentValue(); @@ -345,7 +273,7 @@ public: private: LLAtomic32< S32 > mRef; }; -#endif // new code + /** * intrusive pointer support for LLThreadSafeRefCount -- cgit v1.2.3 From 743720f41454af16193789859a5b2048bad30b7e Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 26 Apr 2013 18:50:45 -0700 Subject: ACME-272 : Add the top toolbar to the FBC panel 2 --- indra/newview/llpanelpeople.cpp | 8 +- .../newview/skins/default/xui/en/panel_people.xml | 92 +++++++++++++++++++++- 2 files changed, 96 insertions(+), 4 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 86303cee70..12d8f6b83a 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -672,6 +672,7 @@ BOOL LLPanelPeople::postBuild() getChild("friends_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2)); getChild("groups_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2)); getChild("recent_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2)); + getChild("fbc_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2)); mTabContainer = getChild("tabs"); mTabContainer->setCommitCallback(boost::bind(&LLPanelPeople::onTabSelected, this, _2)); @@ -729,7 +730,8 @@ BOOL LLPanelPeople::postBuild() LLPersonModelCommon* base_item = new LLPersonModelCommon(mPersonFolderViewModel); LLPersonFolderView::Params folder_view_params(LLUICtrlFactory::getDefaultParams()); - folder_view_params.parent_panel = friends_tab; + + folder_view_params.parent_panel = socialtwo_tab; folder_view_params.listener = base_item; folder_view_params.view_model = &mPersonFolderViewModel; folder_view_params.root = NULL; @@ -740,8 +742,8 @@ BOOL LLPanelPeople::postBuild() //Create scroller LLRect scroller_view_rect = socialtwo_tab->getRect(); - scroller_view_rect.mTop -= 4; - scroller_view_rect.mRight -=6; + scroller_view_rect.mTop -= 2+27; // 27 is the height of the top toolbar + scroller_view_rect.mRight -= 4; scroller_view_rect.mLeft += 2; LLScrollContainer::Params scroller_params(LLUICtrlFactory::getDefaultParams()); scroller_params.rect(scroller_view_rect); diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index c4db547a8e..9bab2ccb0b 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -633,6 +633,9 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M top="0" right="-1" /> + + + + + + + top="0"> + + + + + + + + -- cgit v1.2.3 From 59880225108ef807ef58ed98357f0706c045ff61 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 29 Apr 2013 10:59:09 -0700 Subject: ACME-252 Create AvatarFolderItemView: Now the avatar icon will display but it is not yet functional --- indra/newview/llpanelpeople.cpp | 4 ++-- indra/newview/llpersontabview.cpp | 16 +++++++++++++--- indra/newview/llpersontabview.h | 2 ++ .../newview/skins/default/xui/en/widgets/person_view.xml | 14 +++++++++++++- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 12d8f6b83a..ef45cc44f7 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -755,7 +755,7 @@ BOOL LLPanelPeople::postBuild() mPersonFolderView->setScrollContainer(scroller); mPersonFolderView->setFollowsAll(); - //Create a session + //Create a person tab LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mPersonFolderViewModel); LLPersonTabView::Params params; params.name = item->getDisplayName(); @@ -768,7 +768,7 @@ BOOL LLPanelPeople::postBuild() mPersonFolderView->mPersonFolderModelMap[item->getID()] = item; mPersonFolderView->mPersonFolderViewMap[item->getID()] = widget; - //Create a session + //Create a person tab item = new LLPersonTabModel("Facebook Friends Tab Two", mPersonFolderViewModel); params.name = item->getDisplayName(); params.root = mPersonFolderView; diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 3093ff9015..e0bda32308 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -116,20 +116,22 @@ void LLPersonTabView::drawHighlight() static LLDefaultChildRegistry::Register r_person_view("person_view"); -LLPersonView::Params::Params() +LLPersonView::Params::Params() : +avatar_icon("avatar_icon") {} LLPersonView::LLPersonView(const LLPersonView::Params& p) : LLFolderViewItem(p), mImageOver(LLUI::getUIImage("ListItem_Over")), -mImageSelected(LLUI::getUIImage("ListItem_Select")) +mImageSelected(LLUI::getUIImage("ListItem_Select")), +mAvatarIcon(NULL) { } S32 LLPersonView::getLabelXPos() { - return getIndentation(); + return getIndentation() + mAvatarIcon->getRect().getWidth() + mIconPad; } void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) @@ -186,3 +188,11 @@ void LLPersonView::drawHighlight() mImageOver->draw(x, y, width, height); } } + +void LLPersonView::initFromParams(const LLPersonView::Params & params) +{ + LLAvatarIconCtrl::Params avatar_icon_params(params.avatar_icon()); + applyXUILayout(avatar_icon_params, this); + mAvatarIcon = LLUICtrlFactory::create(avatar_icon_params); + addChild(mAvatarIcon); +} diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index b246be288a..e1b34e1da4 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -69,6 +69,7 @@ public: struct Params : public LLInitParam::Block { Params(); + Optional avatar_icon; }; LLPersonView(const LLPersonView::Params& p); @@ -76,6 +77,7 @@ public: S32 getLabelXPos(); void addToFolder(LLFolderViewFolder * person_folder_view); + void initFromParams(const LLPersonView::Params & params); protected: void draw(); diff --git a/indra/newview/skins/default/xui/en/widgets/person_view.xml b/indra/newview/skins/default/xui/en/widgets/person_view.xml index 13aa26959f..84ad807b83 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml @@ -6,8 +6,20 @@ item_top_pad="3" mouse_opaque="true" follows="left|top|right" + icon_pad="4" + icon_width="20" text_pad="6" text_pad_left="4" text_pad_right="4" arrow_size="10" - max_folder_item_overlap="2"/> + max_folder_item_overlap="2"> + + + -- cgit v1.2.3 From f9850aa5d2fbed3e039ac1a1015ff73065664f17 Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Mon, 29 Apr 2013 17:09:13 -0400 Subject: BUG-2295/MAINT-2624 [FIXED] Crash in HttpOpRequest::stageFromActive w/ Content-Range Don't rely on a response body being present should a Content-Range header be parsed. Unit tests captured the original crash and confirm the fix. --- indra/llcorehttp/_httpoprequest.cpp | 10 +- indra/llcorehttp/httpresponse.h | 9 +- indra/llcorehttp/tests/test_httprequest.hpp | 152 ++++++++++++++++++++++++- indra/llcorehttp/tests/test_llcorehttp_peer.py | 84 +++++++++++--- 4 files changed, 231 insertions(+), 24 deletions(-) diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index 89dcd334f4..12eed06b10 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2012&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2012, Linden Research, Inc. + * Copyright (C) 2012-2013, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -186,9 +186,11 @@ void HttpOpRequest::stageFromActive(HttpService * service) if (mReplyLength) { // If non-zero, we received and processed a Content-Range - // header with the response. Verify that what it says - // is consistent with the received data. - if (mReplyLength != mReplyBody->size()) + // header with the response. If there is received data + // (and there may not be due to protocol violations, + // HEAD requests, etc., see BUG-2295) Verify that what it + // says is consistent with the received data. + if (mReplyBody && mReplyBody->size() && mReplyLength != mReplyBody->size()) { // Not as expected, fail the request mStatus = HttpStatus(HttpStatus::LLCORE, HE_INV_CONTENT_RANGE_HDR); diff --git a/indra/llcorehttp/httpresponse.h b/indra/llcorehttp/httpresponse.h index 4a481db6ac..f19b521fbf 100644 --- a/indra/llcorehttp/httpresponse.h +++ b/indra/llcorehttp/httpresponse.h @@ -48,8 +48,9 @@ class HttpHeaders; /// individual pieces of the response. /// /// Typical usage will have the caller interrogate the object -/// and return from the handler callback. Instances are refcounted -/// and callers can bump the count and retain the object as needed. +/// during the handler callback and then simply returning. +/// But instances are refcounted and and callers can add a +/// reference and hold onto the object after the callback. /// /// Threading: Not intrinsically thread-safe. /// @@ -119,6 +120,10 @@ public: /// caller is going to have to make assumptions on receipt of /// a 206 status. The @full value may also be zero in cases of /// parsing problems or a wild-carded length response. + /// + /// These values will not necessarily agree with the data in + /// the body itself (if present). The BufferArray object + /// is authoritative for actual data length. void getRange(unsigned int * offset, unsigned int * length, unsigned int * full) const { *offset = mReplyOffset; diff --git a/indra/llcorehttp/tests/test_httprequest.hpp b/indra/llcorehttp/tests/test_httprequest.hpp index e5488cf941..16f39845bb 100644 --- a/indra/llcorehttp/tests/test_httprequest.hpp +++ b/indra/llcorehttp/tests/test_httprequest.hpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2012&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2012, Linden Research, Inc. + * Copyright (C) 2012-2013, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -2650,6 +2650,156 @@ void HttpRequestTestObjectType::test<21>() } } +// BUG-2295 Tests - Content-Range header received but no body +template <> template <> +void HttpRequestTestObjectType::test<22>() +{ + ScopedCurlInit ready; + + std::string url_base(get_base_url()); + // std::cerr << "Base: " << url_base << std::endl; + + set_test_name("BUG-2295"); + + // Handler can be stack-allocated *if* there are no dangling + // references to it after completion of this method. + // Create before memory record as the string copy will bump numbers. + TestHandler2 handler(this, "handler"); + + // record the total amount of dynamically allocated memory + mMemTotal = GetMemTotal(); + mHandlerCalls = 0; + + HttpRequest * req = NULL; + + try + { + // Get singletons created + HttpRequest::createService(); + + // Start threading early so that thread memory is invariant + // over the test. + HttpRequest::startThread(); + + // create a new ref counted object with an implicit reference + req = new HttpRequest(); + ensure("Memory allocated on construction", mMemTotal < GetMemTotal()); + + // ====================================== + // Issue bug2295 GETs that will get a 206 + // ====================================== + mStatus = HttpStatus(206); + static const int test_count(3); + for (int i(0); i < test_count; ++i) + { + char buffer[128]; + sprintf(buffer, "/bug2295/%d/", i); + HttpHandle handle = req->requestGetByteRange(HttpRequest::DEFAULT_POLICY_ID, + 0U, + url_base + buffer, + 0, + 25, + NULL, + NULL, + &handler); + ensure("Valid handle returned for ranged request", handle != LLCORE_HTTP_HANDLE_INVALID); + } + + // Run the notification pump. + int count(0); + int limit(10); + while (count++ < limit && mHandlerCalls < test_count) + { + req->update(1000000); + usleep(100000); + } + ensure("Request executed in reasonable time", count < limit); + ensure("One handler invocation for each request", mHandlerCalls == test_count); + + // ====================================== + // Issue bug2295 GETs that will get a libcurl 18 (PARTIAL_FILE) + // ====================================== + mStatus = HttpStatus(HttpStatus::EXT_CURL_EASY, CURLE_PARTIAL_FILE); + static const int test2_count(1); + for (int i(0); i < test2_count; ++i) + { + char buffer[128]; + sprintf(buffer, "/bug2295/00000012/%d/", i); + HttpHandle handle = req->requestGetByteRange(HttpRequest::DEFAULT_POLICY_ID, + 0U, + url_base + buffer, + 0, + 25, + NULL, + NULL, + &handler); + ensure("Valid handle returned for ranged request", handle != LLCORE_HTTP_HANDLE_INVALID); + } + + // Run the notification pump. + count = 0; + limit = 10; + while (count++ < limit && mHandlerCalls < (test_count + test2_count)) + { + req->update(1000000); + usleep(100000); + } + ensure("Request executed in reasonable time", count < limit); + ensure("One handler invocation for each request", mHandlerCalls == (test_count + test2_count)); + + // ====================================== + // Okay, request a shutdown of the servicing thread + // ====================================== + mStatus = HttpStatus(); + HttpHandle handle = req->requestStopThread(&handler); + ensure("Valid handle returned for second request", handle != LLCORE_HTTP_HANDLE_INVALID); + + // Run the notification pump again + count = 0; + limit = 10; + while (count++ < limit && mHandlerCalls < (test_count + test2_count + 1)) + { + req->update(1000000); + usleep(100000); + } + ensure("Second request executed in reasonable time", count < limit); + ensure("Second handler invocation", mHandlerCalls == (test_count + test2_count + 1)); + + // See that we actually shutdown the thread + count = 0; + limit = 10; + while (count++ < limit && ! HttpService::isStopped()) + { + usleep(100000); + } + ensure("Thread actually stopped running", HttpService::isStopped()); + + // release the request object + delete req; + req = NULL; + + // Shut down service + HttpRequest::destroyService(); + + ensure("4 + 1 handler calls on the way out", (test_count + test2_count + 1) == mHandlerCalls); + +#if defined(WIN32) + // Can only do this memory test on Windows. On other platforms, + // the LL logging system holds on to memory and produces what looks + // like memory leaks... + + // printf("Old mem: %d, New mem: %d\n", mMemTotal, GetMemTotal()); + ensure("Memory usage back to that at entry", mMemTotal == GetMemTotal()); +#endif + } + catch (...) + { + stop_thread(req); + delete req; + HttpRequest::destroyService(); + throw; + } +} } // end namespace tut diff --git a/indra/llcorehttp/tests/test_llcorehttp_peer.py b/indra/llcorehttp/tests/test_llcorehttp_peer.py index 75a3c39ef2..7f8f765366 100644 --- a/indra/llcorehttp/tests/test_llcorehttp_peer.py +++ b/indra/llcorehttp/tests/test_llcorehttp_peer.py @@ -9,7 +9,7 @@ $LicenseInfo:firstyear=2008&license=viewerlgpl$ Second Life Viewer Source Code -Copyright (C) 2012, Linden Research, Inc. +Copyright (C) 2012-2013, Linden Research, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -47,6 +47,26 @@ from testrunner import freeport, run, debug, VERBOSE class TestHTTPRequestHandler(BaseHTTPRequestHandler): """This subclass of BaseHTTPRequestHandler is to receive and echo LLSD-flavored messages sent by the C++ LLHTTPClient. + + Target URLs are fairly free-form and are assembled by + concatinating fragments. Currently defined fragments + are: + - '/reflect/' Request headers are bounced back to caller + after prefixing with 'X-Reflect-' + - '/fail/' Body of request can contain LLSD with + 'reason' string and 'status' integer + which will become response header. + - '/bug2295/' 206 response, no data in body: + -- '/bug2295/0/' "Content-Range: bytes 0-75/2983" + -- '/bug2295/1/' "Content-Range: bytes 0-75/*" + -- '/bug2295/2/' "Content-Range: bytes 0-75/2983", + "Content-Length: 0" + -- '/bug2295/00000018/0/' Generates PARTIAL_FILE (18) error in libcurl. + "Content-Range: bytes 0-75/2983", + "Content-Length: 76" + + Some combinations make no sense, there's no effort to protect + you from that. """ def read(self): # The following logic is adapted from the library module @@ -107,22 +127,7 @@ class TestHTTPRequestHandler(BaseHTTPRequestHandler): if "/sleep/" in self.path: time.sleep(30) - if "fail" not in self.path: - data = data.copy() # we're going to modify - # Ensure there's a "reply" key in data, even if there wasn't before - data["reply"] = data.get("reply", llsd.LLSD("success")) - response = llsd.format_xml(data) - debug("success: %s", response) - self.send_response(200) - if "/reflect/" in self.path: - self.reflect_headers() - self.send_header("Content-type", "application/llsd+xml") - self.send_header("Content-Length", str(len(response))) - self.send_header("X-LL-Special", "Mememememe"); - self.end_headers() - if withdata: - self.wfile.write(response) - else: # fail requested + if "fail" in self.path: status = data.get("status", 500) # self.responses maps an int status to a (short, long) pair of # strings. We want the longer string. That's why we pass a string @@ -138,6 +143,51 @@ class TestHTTPRequestHandler(BaseHTTPRequestHandler): if "/reflect/" in self.path: self.reflect_headers() self.end_headers() + elif "/bug2295/" in self.path: + # Test for https://jira.secondlife.com/browse/BUG-2295 + # + # Client can receive a header indicating data should + # appear in the body without actually getting the body. + # Library needs to defend against this case. + # + if "/bug2295/0/" in self.path: + self.send_response(206) + self.send_header("Content-Range", "bytes 0-75/2983") + elif "/bug2295/1/" in self.path: + self.send_response(206) + self.send_header("Content-Range", "bytes 0-75/*") + elif "/bug2295/2/" in self.path: + self.send_response(206) + self.send_header("Content-Range", "bytes 0-75/2983") + self.send_header("Content-Length", "0") + elif "/bug2295/00000012/0/" in self.path: + self.send_response(206) + self.send_header("Content-Range", "bytes 0-75/2983") + self.send_header("Content-Length", "76") + else: + # Unknown request + self.send_response(400) + if "/reflect/" in self.path: + self.reflect_headers() + self.send_header("Content-type", "text/plain") + self.end_headers() + # No data + else: + # Normal response path + data = data.copy() # we're going to modify + # Ensure there's a "reply" key in data, even if there wasn't before + data["reply"] = data.get("reply", llsd.LLSD("success")) + response = llsd.format_xml(data) + debug("success: %s", response) + self.send_response(200) + if "/reflect/" in self.path: + self.reflect_headers() + self.send_header("Content-type", "application/llsd+xml") + self.send_header("Content-Length", str(len(response))) + self.send_header("X-LL-Special", "Mememememe"); + self.end_headers() + if withdata: + self.wfile.write(response) def reflect_headers(self): for name in self.headers.keys(): -- cgit v1.2.3 From 0ce0d897f4e8bed87299b88b3ac24812bfe6afbd Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 29 Apr 2013 17:01:47 -0700 Subject: ACME-252 Create AvatarFolderItemView: Now the personview contains all icons that the avatarlistitem view contains. --- indra/newview/llpersonfolderview.cpp | 1 - indra/newview/llpersontabview.cpp | 64 +++++++++++++++-- indra/newview/llpersontabview.h | 35 ++++++++-- .../skins/default/xui/en/widgets/person_view.xml | 81 ++++++++++++++++++++++ 4 files changed, 172 insertions(+), 9 deletions(-) diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index 8141eecc35..636d093e0e 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -104,7 +104,6 @@ LLPersonView * LLPersonFolderView::createConversationViewParticipant(LLPersonMod //24 should be loaded from .xml somehow params.rect = LLRect (0, 24, getRect().getWidth(), 0); params.tool_tip = params.name; - params.folder_indentation = 2; return LLUICtrlFactory::create(params); } diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index e0bda32308..eaa112e051 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -117,16 +117,32 @@ void LLPersonTabView::drawHighlight() static LLDefaultChildRegistry::Register r_person_view("person_view"); LLPersonView::Params::Params() : -avatar_icon("avatar_icon") +avatar_icon("avatar_icon"), +last_interaction_time_textbox("last_interaction_time_textbox"), +permission_edit_theirs_icon("permission_edit_theirs_icon"), +permission_edit_mine_icon("permission_edit_mine_icon"), +permission_map_icon("permission_map_icon"), +permission_online_icon("permission_online_icon"), +info_btn("info_btn"), +profile_btn("profile_btn"), +output_monitor("output_monitor") {} LLPersonView::LLPersonView(const LLPersonView::Params& p) : LLFolderViewItem(p), mImageOver(LLUI::getUIImage("ListItem_Over")), mImageSelected(LLUI::getUIImage("ListItem_Select")), -mAvatarIcon(NULL) +mAvatarIcon(NULL), +mLastInteractionTimeTextbox(NULL), +mPermissionEditTheirsIcon(NULL), +mPermissionEditMineIcon(NULL), +mPermissionMapIcon(NULL), +mPermissionOnlineIcon(NULL), +mInfoBtn(NULL), +mProfileBtn(NULL), +mOutputMonitorCtrl(NULL) { - + initChildrenWidths(this); } S32 LLPersonView::getLabelXPos() @@ -175,7 +191,7 @@ void LLPersonView::drawHighlight() if(mIsSelected) { mImageSelected->draw(x, y, width, height); - //Need to find a better color that matches the outline in avatarlistitem + //Draw outline gl_rect_2d(x, height, width, @@ -195,4 +211,44 @@ void LLPersonView::initFromParams(const LLPersonView::Params & params) applyXUILayout(avatar_icon_params, this); mAvatarIcon = LLUICtrlFactory::create(avatar_icon_params); addChild(mAvatarIcon); + + LLTextBox::Params last_interaction_time_textbox(params.last_interaction_time_textbox()); + applyXUILayout(last_interaction_time_textbox, this); + mLastInteractionTimeTextbox = LLUICtrlFactory::create(last_interaction_time_textbox); + addChild(mLastInteractionTimeTextbox); + + LLIconCtrl::Params permission_edit_theirs_icon(params.permission_edit_theirs_icon()); + applyXUILayout(permission_edit_theirs_icon, this); + mPermissionEditTheirsIcon = LLUICtrlFactory::create(permission_edit_theirs_icon); + addChild(mPermissionEditTheirsIcon); + + LLIconCtrl::Params permission_map_icon(params.permission_map_icon()); + applyXUILayout(permission_map_icon, this); + mPermissionMapIcon = LLUICtrlFactory::create(permission_map_icon); + addChild(mPermissionMapIcon); + + LLIconCtrl::Params permission_online_icon(params.permission_online_icon()); + applyXUILayout(permission_online_icon, this); + mPermissionOnlineIcon = LLUICtrlFactory::create(permission_online_icon); + addChild(mPermissionOnlineIcon); + + LLButton::Params info_btn(params.info_btn()); + applyXUILayout(info_btn, this); + mInfoBtn = LLUICtrlFactory::create(info_btn); + addChild(mInfoBtn); + + LLButton::Params profile_btn(params.profile_btn()); + applyXUILayout(profile_btn, this); + mProfileBtn = LLUICtrlFactory::create(profile_btn); + addChild(mProfileBtn); + + LLOutputMonitorCtrl::Params output_monitor(params.output_monitor()); + applyXUILayout(output_monitor, this); + mOutputMonitorCtrl = LLUICtrlFactory::create(output_monitor); + addChild(mOutputMonitorCtrl); +} + +void LLPersonView::initChildrenWidths(LLPersonView* self) +{ + } diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index e1b34e1da4..d8d1a65df6 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -28,7 +28,10 @@ #define LL_LLPERSONTABVIEW_H #include "llavatariconctrl.h" +#include "llbutton.h" #include "llfolderviewitem.h" +#include "lloutputmonitorctrl.h" +#include "lltextbox.h" class LLPersonTabView : public LLFolderViewFolder { @@ -70,6 +73,14 @@ public: { Params(); Optional avatar_icon; + Optional last_interaction_time_textbox; + Optional permission_edit_theirs_icon; + Optional permission_edit_mine_icon; + Optional permission_map_icon; + Optional permission_online_icon; + Optional info_btn; + Optional profile_btn; + Optional output_monitor; }; LLPersonView(const LLPersonView::Params& p); @@ -89,18 +100,34 @@ private: LLPointer mImageSelected; LLAvatarIconCtrl* mAvatarIcon; + LLTextBox * mLastInteractionTimeTextbox; + LLIconCtrl * mPermissionEditTheirsIcon; + LLIconCtrl * mPermissionEditMineIcon; + LLIconCtrl * mPermissionMapIcon; + LLIconCtrl * mPermissionOnlineIcon; LLButton * mInfoBtn; + LLButton * mProfileBtn; + LLOutputMonitorCtrl * mOutputMonitorCtrl; + + typedef enum e_avatar_item_child { ALIC_SPEAKER_INDICATOR, + ALIC_PROFILE_BUTTON, ALIC_INFO_BUTTON, + ALIC_PERMISSION_ONLINE, + ALIC_PERMISSION_MAP, + ALIC_PERMISSION_EDIT_MINE, + ALIC_PERMISSION_EDIT_THEIRS, + ALIC_INTERACTION_TIME, ALIC_COUNT, } EAvatarListItemChildIndex; - static bool sStaticInitialized; // this variable is introduced to improve code readability - static S32 sChildrenWidths[ALIC_COUNT]; - //static void initChildrenWidths(LLConversationViewParticipant* self); - //void updateChildren(); + static bool sStaticInitialized; + static S32 sMouseOverChildrenWidths[ALIC_COUNT]; + static S32 sMouseOverChildren[ALIC_COUNT]; + static void initChildrenWidths(LLPersonView* self); + void updateChildren(); //LLView* getItemChildView(EAvatarListItemChildIndex child_view_index); }; diff --git a/indra/newview/skins/default/xui/en/widgets/person_view.xml b/indra/newview/skins/default/xui/en/widgets/person_view.xml index 84ad807b83..d257a5114f 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml @@ -21,5 +21,86 @@ left="5" top="2" width="20" /> + + + + + + + + -- cgit v1.2.3 From 548b75f3fdec08227c5d41424e3af90fbe455208 Mon Sep 17 00:00:00 2001 From: Cho Date: Tue, 30 Apr 2013 01:40:46 +0100 Subject: updated to grab FB URLs from server --- indra/newview/llpanelpeople.cpp | 35 ++++++++++++++++++++--------------- indra/newview/llpanelpeople.h | 3 +-- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index ef45cc44f7..712a116873 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -91,9 +91,6 @@ static const std::string FBCTEST_TAB_NAME = "fbctest_panel"; static const std::string FBCTESTTWO_TAB_NAME = "fbctesttwo_panel"; static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; -static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com/fbc"; -static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/redirect"; - class LLFacebookConnectHandler : public LLCommandHandler { public: @@ -1729,6 +1726,14 @@ public: llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl; } } + + /*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content) + { + if (status == 302) + { + mPanelPeople->openFacebookWeb(content["location"]); + } + } }; class FacebookDisconnectResponder : public LLHTTPClient::Responder @@ -1782,7 +1787,7 @@ public: // show the facebook login page if not connected yet if (status == 404 && mShowLoginIfNotConnected) { - mPanelPeople->openFacebookWeb("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + mPanelPeople->getFacebookRedirectURL()); + mPanelPeople->connectToFacebook(); } } } @@ -1810,6 +1815,14 @@ public: llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl; } } + + /*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content) + { + if (status == 302) + { + mPanelPeople->openFacebookWeb(content["location"]); + } + } }; void LLPanelPeople::loadFacebookFriends() @@ -1828,8 +1841,9 @@ void LLPanelPeople::tryToReconnectToFacebook() void LLPanelPeople::connectToFacebook(const std::string& auth_code) { LLSD body; - body["code"] = auth_code; - body["redirect_uri"] = getFacebookRedirectURL(); + if (!auth_code.empty()) + body["code"] = auth_code; + LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new FacebookConnectResponder(this)); } @@ -1846,13 +1860,6 @@ std::string LLPanelPeople::getFacebookConnectURL(const std::string& route) return url; } -std::string LLPanelPeople::getFacebookRedirectURL() -{ - static std::string sFacebookRedirectUrl = gAgent.getRegion()->getCapability("FacebookRedirect"); - llinfos << sFacebookRedirectUrl << llendl; - return sFacebookRedirectUrl; -} - void LLPanelPeople::onLoginFbcButtonClicked() { if (mConnectedToFbc) @@ -1867,12 +1874,10 @@ void LLPanelPeople::onLoginFbcButtonClicked() void LLPanelPeople::onFacebookAppRequestClicked() { - openFacebookWeb("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + getFacebookRedirectURL()); } void LLPanelPeople::onFacebookAppSendClicked() { - openFacebookWeb("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + getFacebookRedirectURL()); } static LLFastTimer::DeclareTimer FTM_AVATAR_LIST_TEST("avatar list test"); diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 95105309d2..943d84ac1d 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -69,11 +69,10 @@ public: void hideFacebookFriends(); void loadFacebookFriends(); void tryToReconnectToFacebook(); - void connectToFacebook(const std::string& auth_code); + void connectToFacebook(const std::string& auth_code = ""); void disconnectFromFacebook(); std::string getFacebookConnectURL(const std::string& route = ""); - std::string getFacebookRedirectURL(); bool mConnectedToFbc; bool mTryToConnectToFbc; -- cgit v1.2.3 From a3a0d665022e9b0a9ab99f41d4a989af3fafb122 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 29 Apr 2013 18:55:23 -0700 Subject: ACME-252 Create AvatarFolderItemView: Now mouse over of peopleview items show the info button and profile button. --- indra/newview/llpersontabview.cpp | 77 +++++++++++++++++++++- indra/newview/llpersontabview.h | 16 +++-- .../skins/default/xui/en/widgets/person_view.xml | 9 +++ 3 files changed, 95 insertions(+), 7 deletions(-) diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index eaa112e051..fa7bc09e10 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -142,7 +142,6 @@ mInfoBtn(NULL), mProfileBtn(NULL), mOutputMonitorCtrl(NULL) { - initChildrenWidths(this); } S32 LLPersonView::getLabelXPos() @@ -162,6 +161,29 @@ LLPersonView::~LLPersonView() } +BOOL LLPersonView::postBuild() +{ + initChildrenWidths(this); + updateChildren(); + return LLFolderViewItem::postBuild(); +} + +void LLPersonView::onMouseEnter(S32 x, S32 y, MASK mask) +{ + mInfoBtn->setVisible(TRUE); + mProfileBtn->setVisible(TRUE); + updateChildren(); + LLFolderViewItem::onMouseEnter(x, y, mask); +} + +void LLPersonView::onMouseLeave(S32 x, S32 y, MASK mask) +{ + mInfoBtn->setVisible(FALSE); + mProfileBtn->setVisible(FALSE); + updateChildren(); + LLFolderViewItem::onMouseLeave(x, y, mask); +} + void LLPersonView::draw() { static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); @@ -222,6 +244,11 @@ void LLPersonView::initFromParams(const LLPersonView::Params & params) mPermissionEditTheirsIcon = LLUICtrlFactory::create(permission_edit_theirs_icon); addChild(mPermissionEditTheirsIcon); + LLIconCtrl::Params permission_edit_mine_icon(params.permission_edit_mine_icon()); + applyXUILayout(permission_edit_mine_icon, this); + mPermissionEditMineIcon = LLUICtrlFactory::create(permission_edit_mine_icon); + addChild(mPermissionEditMineIcon); + LLIconCtrl::Params permission_map_icon(params.permission_map_icon()); applyXUILayout(permission_map_icon, this); mPermissionMapIcon = LLUICtrlFactory::create(permission_map_icon); @@ -250,5 +277,53 @@ void LLPersonView::initFromParams(const LLPersonView::Params & params) void LLPersonView::initChildrenWidths(LLPersonView* self) { + S32 output_monitor_width = self->getRect().getWidth() - self->mOutputMonitorCtrl->getRect().mLeft; + S32 profile_btn_width = self->mOutputMonitorCtrl->getRect().mLeft - self->mProfileBtn->getRect().mLeft; + S32 info_btn_width = self->mProfileBtn->getRect().mLeft - self->mInfoBtn->getRect().mLeft; + S32 permission_online_icon_width = self->mInfoBtn->getRect().mLeft - self->mPermissionOnlineIcon->getRect().mLeft; + S32 permissions_map_icon_width = self->mPermissionOnlineIcon->getRect().mLeft - self->mPermissionMapIcon->getRect().mLeft; + S32 permission_edit_mine_icon_width = self->mPermissionMapIcon->getRect().mLeft - self->mPermissionEditMineIcon->getRect().mLeft; + S32 permission_edit_theirs_icon_width = self->mPermissionEditMineIcon->getRect().mLeft - self->mPermissionEditTheirsIcon->getRect().mLeft; + S32 last_interaction_time_textbox_width = self->mPermissionEditTheirsIcon->getRect().mLeft - self->mLastInteractionTimeTextbox->getRect().mLeft; + + self->mChildAndWidthVec.push_back(std::pair(self->mOutputMonitorCtrl, output_monitor_width)); + self->mChildAndWidthVec.push_back(std::pair(self->mProfileBtn, profile_btn_width)); + self->mChildAndWidthVec.push_back(std::pair(self->mInfoBtn, info_btn_width)); + self->mChildAndWidthVec.push_back(std::pair(self->mPermissionOnlineIcon, permission_online_icon_width)); + self->mChildAndWidthVec.push_back(std::pair(self->mPermissionMapIcon, permissions_map_icon_width)); + self->mChildAndWidthVec.push_back(std::pair(self->mPermissionEditMineIcon, permission_edit_mine_icon_width)); + self->mChildAndWidthVec.push_back(std::pair(self->mPermissionEditTheirsIcon, permission_edit_theirs_icon_width)); + self->mChildAndWidthVec.push_back(std::pair(self->mLastInteractionTimeTextbox, last_interaction_time_textbox_width)); } + +void LLPersonView::updateChildren() +{ + mLabelPaddingRight = 0; + LLView * control; + S32 control_width; + LLRect control_rect; + + for(S32 i = 0; i < mChildAndWidthVec.size(); ++i) + { + control = mChildAndWidthVec[i].first; + + if(!control->getVisible()) + { + continue; + } + + control_width = mChildAndWidthVec[i].second; + mLabelPaddingRight += control_width; + + control_rect = control->getRect(); + control_rect.setLeftTopAndSize( + getLocalRect().getWidth() - mLabelPaddingRight, + control_rect.mTop, + control_rect.getWidth(), + control_rect.getHeight()); + + control->setShape(control_rect); + + } +} diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index d8d1a65df6..56d7f4eade 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -86,11 +86,15 @@ public: LLPersonView(const LLPersonView::Params& p); virtual ~LLPersonView(); - S32 getLabelXPos(); - void addToFolder(LLFolderViewFolder * person_folder_view); - void initFromParams(const LLPersonView::Params & params); + S32 getLabelXPos(); + void addToFolder(LLFolderViewFolder * person_folder_view); + void initFromParams(const LLPersonView::Params & params); + BOOL postBuild(); + void onMouseEnter(S32 x, S32 y, MASK mask); + void onMouseLeave(S32 x, S32 y, MASK mask); protected: + void draw(); void drawHighlight(); @@ -123,12 +127,12 @@ private: ALIC_COUNT, } EAvatarListItemChildIndex; + typedef std::vector> ChildAndWidthVec; + ChildAndWidthVec mChildAndWidthVec; + static bool sStaticInitialized; - static S32 sMouseOverChildrenWidths[ALIC_COUNT]; - static S32 sMouseOverChildren[ALIC_COUNT]; static void initChildrenWidths(LLPersonView* self); void updateChildren(); - //LLView* getItemChildView(EAvatarListItemChildIndex child_view_index); }; #endif // LL_LLPERSONTABVIEW_H diff --git a/indra/newview/skins/default/xui/en/widgets/person_view.xml b/indra/newview/skins/default/xui/en/widgets/person_view.xml index d257a5114f..d0d87c02c2 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml @@ -31,6 +31,7 @@ name="last_interaction_time_textbox" text_color="LtGray_50" value="0s" + visible="false" width="35" /> -- cgit v1.2.3 From 343ad70696349f4b30b7f2f9a6242cdd1035cd21 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 29 Apr 2013 18:57:26 -0700 Subject: ACME-275 : WIP : Starting to write the LLPersonViewerFilter code --- indra/newview/llpanelpeople.cpp | 24 ++++++++------ indra/newview/llpersonmodelcommon.cpp | 62 +++++++++++++++++++++++++++++++++++ indra/newview/llpersonmodelcommon.h | 26 +++++++++------ 3 files changed, 92 insertions(+), 20 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index ef45cc44f7..ce31c735e3 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1200,23 +1200,23 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string) { // store accordion tabs opened/closed state before any manipulation with accordion tabs if (!saved_filter.empty()) - { - notifyChildren(LLSD().with("action","store_state")); - } + { + notifyChildren(LLSD().with("action","store_state")); + } mOnlineFriendList->setNameFilter(filter); mAllFriendList->setNameFilter(filter); - setAccordionCollapsedByUser("tab_online", false); - setAccordionCollapsedByUser("tab_all", false); - showFriendsAccordionsIfNeeded(); + setAccordionCollapsedByUser("tab_online", false); + setAccordionCollapsedByUser("tab_all", false); + showFriendsAccordionsIfNeeded(); // restore accordion tabs state _after_ all manipulations if(saved_filter.empty()) - { - notifyChildren(LLSD().with("action","restore_state")); - } -} + { + notifyChildren(LLSD().with("action","restore_state")); + } + } else if (cur_tab == GROUP_TAB_NAME) { mGroupList->setNameFilter(filter); @@ -1225,6 +1225,10 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string) { mRecentList->setNameFilter(filter); } + else if (cur_tab == FBCTESTTWO_TAB_NAME) + { + mPersonFolderViewModel.getFilter().setFilterSubString(filter); + } } void LLPanelPeople::onTabSelected(const LLSD& param) diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp index bea7f3d45e..4e54562f18 100644 --- a/indra/newview/llpersonmodelcommon.cpp +++ b/indra/newview/llpersonmodelcommon.cpp @@ -157,3 +157,65 @@ LLPersonModel::LLPersonModel(LLFolderViewModelInterface& root_view_model) : LLPersonModelCommon(root_view_model) { } + +// +// LLPersonViewFilter +// + +LLPersonViewFilter::LLPersonViewFilter() : + mEmpty(""), + mFilterSubString(""), + mFilterModified(FILTER_NONE) +{ +} + +void LLPersonViewFilter::setFilterSubString(const std::string& string) +{ + std::string filter_sub_string_new = string; + LLStringUtil::trimHead(filter_sub_string_new); + LLStringUtil::toUpper(filter_sub_string_new); + + if (mFilterSubString != filter_sub_string_new) + { + mFilterSubString = filter_sub_string_new; + } +} + +std::string::size_type LLPersonViewFilter::getFilterStringSize() const +{ + return mFilterSubString.size(); +} + +bool LLPersonViewFilter::check(const LLFolderViewModelItem* item) +{ + //const LLPersonModelCommon* person = dynamic_cast(item); + std::string::size_type string_offset = mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos; + + return (mFilterSubString.size() == 0 || string_offset != std::string::npos); +} + +bool LLPersonViewFilter::showAllResults() const +{ + return mFilterSubString.size() > 0; +} + +std::string::size_type LLPersonViewFilter::getStringMatchOffset(LLFolderViewModelItem* item) const +{ + return mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos; +} + +bool LLPersonViewFilter::isActive() const +{ + return mFilterSubString.size(); +} + +bool LLPersonViewFilter::isModified() const +{ + return isActive(); +} + +void LLPersonViewFilter::clearModified() +{ + mFilterModified = FILTER_NONE; + setFilterSubString(""); +} diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h index f3454df53f..bdbee002e6 100644 --- a/indra/newview/llpersonmodelcommon.h +++ b/indra/newview/llpersonmodelcommon.h @@ -127,7 +127,7 @@ private: }; -//Below code is just copied and adjusted from llconversationmodel.h, will need to investigate further +// Filtering functional object class LLPersonViewFilter : public LLFolderViewFilter { @@ -143,20 +143,23 @@ public: // Default sort order is by type for sessions and by date for participants static const U32 SO_DEFAULT = (SO_SESSION_TYPE << 16) | (SO_DATE); - LLPersonViewFilter() { mEmpty = ""; } + LLPersonViewFilter(); ~LLPersonViewFilter() {} - bool check(const LLFolderViewModelItem* item) { return true; } + void setFilterSubString(const std::string& string); + std::string::size_type getFilterStringSize() const; + bool check(const LLFolderViewModelItem* item); + bool showAllResults() const; + std::string::size_type getStringMatchOffset(LLFolderViewModelItem* item) const; + bool isActive() const; + bool isModified() const; + void clearModified(); + bool checkFolder(const LLFolderViewModelItem* folder) const { return true; } + void setEmptyLookupMessage(const std::string& message) { } std::string getEmptyLookupMessage() const { return mEmpty; } - bool showAllResults() const { return true; } - std::string::size_type getStringMatchOffset(LLFolderViewModelItem* item) const { return std::string::npos; } - std::string::size_type getFilterStringSize() const { return 0; } - bool isActive() const { return false; } - bool isModified() const { return false; } - void clearModified() { } const std::string& getName() const { return mEmpty; } const std::string& getFilterText() { return mEmpty; } void setModified(EFilterModified behavior = FILTER_RESTART) { } @@ -173,8 +176,11 @@ public: S32 getCurrentGeneration() const { return 0; } S32 getFirstSuccessGeneration() const { return 0; } S32 getFirstRequiredGeneration() const { return 0; } + private: - std::string mEmpty; + std::string mEmpty; + std::string mFilterSubString; + EFilterModified mFilterModified; }; class LLPersonViewSort -- cgit v1.2.3 From 8189c27cfad6f498966dc99dd483df8466330ccd Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 30 Apr 2013 11:37:16 -0700 Subject: ACME-252 Create AvatarFolderItemView: Optimization. Now the widths for the personview are computed once and stored staticically since they don't change per control. --- indra/newview/llpersontabview.cpp | 48 ++++++++++++++++++++++++++++----------- indra/newview/llpersontabview.h | 14 ++++++++---- 2 files changed, 45 insertions(+), 17 deletions(-) diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index fa7bc09e10..2bc436226d 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -116,6 +116,9 @@ void LLPersonTabView::drawHighlight() static LLDefaultChildRegistry::Register r_person_view("person_view"); +bool LLPersonView::sChildrenWidthsInitialized = false; +ChildWidthVec LLPersonView::mChildWidthVec; + LLPersonView::Params::Params() : avatar_icon("avatar_icon"), last_interaction_time_textbox("last_interaction_time_textbox"), @@ -163,7 +166,13 @@ LLPersonView::~LLPersonView() BOOL LLPersonView::postBuild() { - initChildrenWidths(this); + if(!sChildrenWidthsInitialized) + { + initChildrenWidthVec(this); + sChildrenWidthsInitialized = true; + } + + initChildVec(); updateChildren(); return LLFolderViewItem::postBuild(); } @@ -275,7 +284,7 @@ void LLPersonView::initFromParams(const LLPersonView::Params & params) addChild(mOutputMonitorCtrl); } -void LLPersonView::initChildrenWidths(LLPersonView* self) +void LLPersonView::initChildrenWidthVec(LLPersonView* self) { S32 output_monitor_width = self->getRect().getWidth() - self->mOutputMonitorCtrl->getRect().mLeft; S32 profile_btn_width = self->mOutputMonitorCtrl->getRect().mLeft - self->mProfileBtn->getRect().mLeft; @@ -286,15 +295,26 @@ void LLPersonView::initChildrenWidths(LLPersonView* self) S32 permission_edit_theirs_icon_width = self->mPermissionEditMineIcon->getRect().mLeft - self->mPermissionEditTheirsIcon->getRect().mLeft; S32 last_interaction_time_textbox_width = self->mPermissionEditTheirsIcon->getRect().mLeft - self->mLastInteractionTimeTextbox->getRect().mLeft; - self->mChildAndWidthVec.push_back(std::pair(self->mOutputMonitorCtrl, output_monitor_width)); - self->mChildAndWidthVec.push_back(std::pair(self->mProfileBtn, profile_btn_width)); - self->mChildAndWidthVec.push_back(std::pair(self->mInfoBtn, info_btn_width)); - self->mChildAndWidthVec.push_back(std::pair(self->mPermissionOnlineIcon, permission_online_icon_width)); - self->mChildAndWidthVec.push_back(std::pair(self->mPermissionMapIcon, permissions_map_icon_width)); - self->mChildAndWidthVec.push_back(std::pair(self->mPermissionEditMineIcon, permission_edit_mine_icon_width)); - self->mChildAndWidthVec.push_back(std::pair(self->mPermissionEditTheirsIcon, permission_edit_theirs_icon_width)); - self->mChildAndWidthVec.push_back(std::pair(self->mLastInteractionTimeTextbox, last_interaction_time_textbox_width)); + self->mChildWidthVec.push_back(output_monitor_width); + self->mChildWidthVec.push_back(profile_btn_width); + self->mChildWidthVec.push_back(info_btn_width); + self->mChildWidthVec.push_back(permission_online_icon_width); + self->mChildWidthVec.push_back(permissions_map_icon_width); + self->mChildWidthVec.push_back(permission_edit_mine_icon_width); + self->mChildWidthVec.push_back(permission_edit_theirs_icon_width); + self->mChildWidthVec.push_back(last_interaction_time_textbox_width); +} +void LLPersonView::initChildVec() +{ + mChildVec.push_back(mOutputMonitorCtrl); + mChildVec.push_back(mProfileBtn); + mChildVec.push_back(mInfoBtn); + mChildVec.push_back(mPermissionOnlineIcon); + mChildVec.push_back(mPermissionMapIcon); + mChildVec.push_back(mPermissionEditMineIcon); + mChildVec.push_back(mPermissionEditTheirsIcon); + mChildVec.push_back(mLastInteractionTimeTextbox); } void LLPersonView::updateChildren() @@ -304,16 +324,18 @@ void LLPersonView::updateChildren() S32 control_width; LLRect control_rect; - for(S32 i = 0; i < mChildAndWidthVec.size(); ++i) + llassert(mChildWidthVec.size() == mChildVec.size()); + + for(S32 i = 0; i < mChildWidthVec.size(); ++i) { - control = mChildAndWidthVec[i].first; + control = mChildVec[i]; if(!control->getVisible()) { continue; } - control_width = mChildAndWidthVec[i].second; + control_width = mChildWidthVec[i]; mLabelPaddingRight += control_width; control_rect = control->getRect(); diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index 56d7f4eade..80020073d7 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -64,6 +64,9 @@ private: }; +typedef std::vector ChildWidthVec; +typedef std::vector ChildVec; + class LLPersonView : public LLFolderViewItem { @@ -127,11 +130,14 @@ private: ALIC_COUNT, } EAvatarListItemChildIndex; - typedef std::vector> ChildAndWidthVec; - ChildAndWidthVec mChildAndWidthVec; + //Widths of controls are same for every instance so can be static + static ChildWidthVec mChildWidthVec; + //Control pointers are different for each instance so non-static + ChildVec mChildVec; - static bool sStaticInitialized; - static void initChildrenWidths(LLPersonView* self); + static bool sChildrenWidthsInitialized; + static void initChildrenWidthVec(LLPersonView* self); + void initChildVec(); void updateChildren(); }; -- cgit v1.2.3 From 03239c14e82f4d400cefa8c4b418a6192cc08654 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 30 Apr 2013 14:03:04 -0700 Subject: ACME-252 Create AvatarFolderItemView: Now clicking the profile button and info button will show a facebook user's SL profile or info respectively. --- indra/newview/llpanelpeople.cpp | 2 +- indra/newview/llpersonmodelcommon.cpp | 13 ++++++++++--- indra/newview/llpersonmodelcommon.h | 6 ++++-- indra/newview/llpersontabview.cpp | 10 ++++++++++ 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 609284cdd5..4c044c2471 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1698,7 +1698,7 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model { LLPersonModel* person_model = NULL; - person_model = new LLPersonModel(name, mPersonFolderViewModel); + person_model = new LLPersonModel(agent_id, name, mPersonFolderViewModel); person_folder_model->addParticipant(person_model); } diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp index 4e54562f18..91c3f6a92a 100644 --- a/indra/newview/llpersonmodelcommon.cpp +++ b/indra/newview/llpersonmodelcommon.cpp @@ -148,14 +148,21 @@ LLPersonModel* LLPersonTabModel::findParticipant(const LLUUID& person_id) // LLPersonModel // -LLPersonModel::LLPersonModel(std::string display_name, LLFolderViewModelInterface& root_view_model) : -LLPersonModelCommon(display_name,root_view_model) +LLPersonModel::LLPersonModel(const LLUUID& agent_id, const std::string display_name, LLFolderViewModelInterface& root_view_model) : +LLPersonModelCommon(display_name,root_view_model), +mAgentID(agent_id) { } LLPersonModel::LLPersonModel(LLFolderViewModelInterface& root_view_model) : -LLPersonModelCommon(root_view_model) +LLPersonModelCommon(root_view_model), +mAgentID(LLUUID(NULL)) +{ +} + +LLUUID LLPersonModel::getAgentID() { + return mAgentID; } // diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h index bdbee002e6..4030cd11df 100644 --- a/indra/newview/llpersonmodelcommon.h +++ b/indra/newview/llpersonmodelcommon.h @@ -120,11 +120,13 @@ private: class LLPersonModel : public LLPersonModelCommon { public: - LLPersonModel(std::string display_name, LLFolderViewModelInterface& root_view_model); + LLPersonModel(const LLUUID& agent_id, const std::string display_name, LLFolderViewModelInterface& root_view_model); LLPersonModel(LLFolderViewModelInterface& root_view_model); -private: + LLUUID getAgentID(); +private: + LLUUID mAgentID; }; // Filtering functional object diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 2bc436226d..a0d6b40d08 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -29,6 +29,10 @@ #include "llpersontabview.h" +#include "llavataractions.h" +#include "llfloaterreg.h" +#include "llpersonmodelcommon.h" + static LLDefaultChildRegistry::Register r_person_tab_view("person_tab_view"); const LLColor4U DEFAULT_WHITE(255, 255, 255); @@ -174,6 +178,12 @@ BOOL LLPersonView::postBuild() initChildVec(); updateChildren(); + + LLPersonModel * person_model = static_cast(getViewModelItem()); + + mInfoBtn->setClickedCallback(boost::bind(&LLFloaterReg::showInstance, "inspect_avatar", LLSD().with("avatar_id", person_model->getAgentID()), FALSE)); + mProfileBtn->setClickedCallback(boost::bind(&LLAvatarActions::showProfile, person_model->getAgentID())); + return LLFolderViewItem::postBuild(); } -- cgit v1.2.3 From f18c5ad3c6cb95ad329ad7147631edd6855f3ac5 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 30 Apr 2013 15:33:40 -0700 Subject: ACME-252 Create AvatarFolderItemView: Now the people view shows both the facebook name and the SL name (assuming this connection exists). --- indra/newview/llpanelpeople.cpp | 7 ++++++- indra/newview/llpersontabview.cpp | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 4c044c2471..a9a024c9ed 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1698,7 +1698,12 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model { LLPersonModel* person_model = NULL; - person_model = new LLPersonModel(agent_id, name, mPersonFolderViewModel); + LLAvatarName avatar_name; + bool avatar_name_exists = LLAvatarNameCache::get(agent_id, &avatar_name); + + std::string aggregated_name = avatar_name_exists ? name + " (" + avatar_name.getDisplayName() + ") " : name; + + person_model = new LLPersonModel(agent_id, aggregated_name, mPersonFolderViewModel); person_folder_model->addParticipant(person_model); } diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index a0d6b40d08..76f3151777 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -181,6 +181,7 @@ BOOL LLPersonView::postBuild() LLPersonModel * person_model = static_cast(getViewModelItem()); + mAvatarIcon->setValue(person_model->getAgentID()); mInfoBtn->setClickedCallback(boost::bind(&LLFloaterReg::showInstance, "inspect_avatar", LLSD().with("avatar_id", person_model->getAgentID()), FALSE)); mProfileBtn->setClickedCallback(boost::bind(&LLAvatarActions::showProfile, person_model->getAgentID())); -- cgit v1.2.3 From 9fdfc8dd5c52e515990f3ef4e552b9084fa66373 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 30 Apr 2013 16:01:31 -0700 Subject: ACME-252 Create AvatarFolderItemView: Slight xml change for person view to make the profile button display lower. --- indra/newview/skins/default/xui/en/widgets/person_view.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/widgets/person_view.xml b/indra/newview/skins/default/xui/en/widgets/person_view.xml index d0d87c02c2..4a39109f36 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml @@ -90,6 +90,7 @@ visible="false" width="16" /> Date: Tue, 30 Apr 2013 17:18:29 -0700 Subject: ACME-275 : WIP : Write all LLPersonViewerFilter methods and clean up interface --- indra/newview/llpersonmodelcommon.cpp | 32 ++++++++++++------ indra/newview/llpersonmodelcommon.h | 64 +++++++++++++++++++++++------------ 2 files changed, 64 insertions(+), 32 deletions(-) diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp index 4e54562f18..32ceef096d 100644 --- a/indra/newview/llpersonmodelcommon.cpp +++ b/indra/newview/llpersonmodelcommon.cpp @@ -163,8 +163,9 @@ LLPersonModelCommon(root_view_model) // LLPersonViewFilter::LLPersonViewFilter() : - mEmpty(""), + mEmptyLookupMessage(""), mFilterSubString(""), + mName(""), mFilterModified(FILTER_NONE) { } @@ -177,31 +178,32 @@ void LLPersonViewFilter::setFilterSubString(const std::string& string) if (mFilterSubString != filter_sub_string_new) { + // *TODO : Add logic to support more and less restrictive filtering + mFilterModified = FILTER_RESTART; mFilterSubString = filter_sub_string_new; } } -std::string::size_type LLPersonViewFilter::getFilterStringSize() const +bool LLPersonViewFilter::showAllResults() const { - return mFilterSubString.size(); + return mFilterSubString.size() > 0; } bool LLPersonViewFilter::check(const LLFolderViewModelItem* item) { - //const LLPersonModelCommon* person = dynamic_cast(item); std::string::size_type string_offset = mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos; return (mFilterSubString.size() == 0 || string_offset != std::string::npos); } -bool LLPersonViewFilter::showAllResults() const +std::string::size_type LLPersonViewFilter::getStringMatchOffset(LLFolderViewModelItem* item) const { - return mFilterSubString.size() > 0; + return mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos; } -std::string::size_type LLPersonViewFilter::getStringMatchOffset(LLFolderViewModelItem* item) const +std::string::size_type LLPersonViewFilter::getFilterStringSize() const { - return mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos; + return mFilterSubString.size(); } bool LLPersonViewFilter::isActive() const @@ -211,11 +213,21 @@ bool LLPersonViewFilter::isActive() const bool LLPersonViewFilter::isModified() const { - return isActive(); + return mFilterModified != FILTER_NONE; } void LLPersonViewFilter::clearModified() { mFilterModified = FILTER_NONE; - setFilterSubString(""); } + +void LLPersonViewFilter::setEmptyLookupMessage(const std::string& message) +{ + mEmptyLookupMessage = message; +} + +std::string LLPersonViewFilter::getEmptyLookupMessage() const +{ + return mEmptyLookupMessage; +} + diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h index bdbee002e6..2ddec3d05e 100644 --- a/indra/newview/llpersonmodelcommon.h +++ b/indra/newview/llpersonmodelcommon.h @@ -136,49 +136,69 @@ public: enum ESortOrderType { SO_NAME = 0, // Sort by name - SO_DATE = 0x1, // Sort by date (most recent) - SO_SESSION_TYPE = 0x2, // Sort by type (valid only for sessions) - SO_DISTANCE = 0x3, // Sort by distance (valid only for participants in nearby chat) + SO_ONLINE_STATUS = 0x1 // Sort by online status (i.e. online or not) }; - // Default sort order is by type for sessions and by date for participants - static const U32 SO_DEFAULT = (SO_SESSION_TYPE << 16) | (SO_DATE); + // Default sort order is by name + static const U32 SO_DEFAULT = SO_NAME; LLPersonViewFilter(); ~LLPersonViewFilter() {} - void setFilterSubString(const std::string& string); - std::string::size_type getFilterStringSize() const; + // +-------------------------------------------------------------------+ + // + Execution And Results + // +-------------------------------------------------------------------+ bool check(const LLFolderViewModelItem* item); + bool checkFolder(const LLFolderViewModelItem* folder) const { return true; } + + void setEmptyLookupMessage(const std::string& message); + std::string getEmptyLookupMessage() const; + bool showAllResults() const; + std::string::size_type getStringMatchOffset(LLFolderViewModelItem* item) const; + std::string::size_type getFilterStringSize() const; + + // +-------------------------------------------------------------------+ + // + Status + // +-------------------------------------------------------------------+ bool isActive() const; bool isModified() const; void clearModified(); - - bool checkFolder(const LLFolderViewModelItem* folder) const { return true; } + const std::string& getName() const { return mName; } + const std::string& getFilterText() { return mName; } + void setModified(EFilterModified behavior = FILTER_RESTART) { mFilterModified = behavior; } - void setEmptyLookupMessage(const std::string& message) { } - std::string getEmptyLookupMessage() const { return mEmpty; } - - const std::string& getName() const { return mEmpty; } - const std::string& getFilterText() { return mEmpty; } - void setModified(EFilterModified behavior = FILTER_RESTART) { } - + // +-------------------------------------------------------------------+ + // + Count + // +-------------------------------------------------------------------+ + // Note : we currently filter the whole person list at once, no need to count then. void setFilterCount(S32 count) { } S32 getFilterCount() const { return 0; } void decrementFilterCount() { } - bool isDefault() const { return true; } - bool isNotDefault() const { return false; } + // +-------------------------------------------------------------------+ + // + Default + // +-------------------------------------------------------------------+ + // Note : we don't support runtime default setting for person filter + bool isDefault() const { return !isActive(); } + bool isNotDefault() const { return isActive(); } void markDefault() { } - void resetDefault() { } - + void resetDefault() { setModified(); } + + // +-------------------------------------------------------------------+ + // + Generation + // +-------------------------------------------------------------------+ + // Note : unclear if we have to take tab on generation at that point S32 getCurrentGeneration() const { return 0; } S32 getFirstSuccessGeneration() const { return 0; } S32 getFirstRequiredGeneration() const { return 0; } - + + // Non Virtual Methods (i.e. specific to this class) + void setFilterSubString(const std::string& string); + private: - std::string mEmpty; + std::string mName; + std::string mEmptyLookupMessage; std::string mFilterSubString; EFilterModified mFilterModified; }; -- cgit v1.2.3 From 4d72a6ea92d87822350be63e235b90daa4727d55 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 30 Apr 2013 18:17:20 -0700 Subject: ACME-252 Create AvatarFolderItemView: Fixed focusing issue when hovering over a people view and then selected an icon. Now when selecting the icon upon hover the corresponding people view will be selected as well. --- indra/newview/llpanelpeople.cpp | 2 +- indra/newview/llpersonfolderview.cpp | 7 ++++++- indra/newview/llpersontabview.cpp | 36 ++++++++++++++++++++++++++++++++++++ indra/newview/llpersontabview.h | 1 + 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index a9a024c9ed..77c3430c01 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1690,7 +1690,7 @@ void LLPanelPeople::addTestParticipant() for(int i = 0; i < 300; ++i) { LLPersonTabModel * person_folder_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap.begin()->second); - addParticipantToModel(person_folder_model, LLUUID().generateNewID(), "EastBayGuy"); + addParticipantToModel(person_folder_model, gAgent.getID(), "Test Name"); } } diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index 636d093e0e..ba1e9d20eb 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -64,7 +64,12 @@ BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) } } - return LLFolderView::handleMouseDown(x, y, mask); + mKeyboardSelection = FALSE; + mSearchString.clear(); + + LLEditMenuHandler::gEditMenuHandler = this; + + return LLView::handleMouseDown( x, y, mask ); } bool LLPersonFolderView::onConversationModelEvent(const LLSD &event) diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 76f3151777..fdc024beb8 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -65,6 +65,7 @@ BOOL LLPersonTabView::handleMouseDown( S32 x, S32 y, MASK mask ) if(selected_item) { + gFocusMgr.setKeyboardFocus( this ); highlight = true; } @@ -204,6 +205,41 @@ void LLPersonView::onMouseLeave(S32 x, S32 y, MASK mask) LLFolderViewItem::onMouseLeave(x, y, mask); } +BOOL LLPersonView::handleMouseDown( S32 x, S32 y, MASK mask) +{ + if(!LLView::childrenHandleMouseDown(x, y, mask)) + { + gFocusMgr.setMouseCapture( this ); + } + + if (!mIsSelected) + { + if(mask & MASK_CONTROL) + { + getRoot()->changeSelection(this, !mIsSelected); + } + else if (mask & MASK_SHIFT) + { + getParentFolder()->extendSelectionTo(this); + } + else + { + getRoot()->setSelection(this, FALSE); + } + make_ui_sound("UISndClick"); + } + else + { + // If selected, we reserve the decision of deselecting/reselecting to the mouse up moment. + // This is necessary so we maintain selection consistent when starting a drag. + mSelectPending = TRUE; + } + + mDragStartX = x; + mDragStartY = y; + return TRUE; +} + void LLPersonView::draw() { static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index 80020073d7..9cce615167 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -95,6 +95,7 @@ public: BOOL postBuild(); void onMouseEnter(S32 x, S32 y, MASK mask); void onMouseLeave(S32 x, S32 y, MASK mask); + BOOL handleMouseDown( S32 x, S32 y, MASK mask); protected: -- cgit v1.2.3 From 145bbacc6c167351357572a5d635f790e6715b86 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 1 May 2013 20:43:49 +0100 Subject: made secondlife:///app/fbc/connect avoid 'the slurl you click on is not supported' messages --- indra/newview/llpanelpeople.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index a9a024c9ed..640c5e4e4e 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -111,12 +111,11 @@ public: { mPanelPeople->connectToFacebook(query_map["code"]); mPanelPeople = NULL; - return true; } } + return true; } } - return false; } }; -- cgit v1.2.3 From 348d4b66806cca07c91cab63f810d3d986e12377 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 1 May 2013 14:44:09 -0700 Subject: Manually pull in Richard's fixes for llcommon/llsingleton.h --- indra/llcommon/llsingleton.h | 101 +++++++++++++++++++++++++------------------ 1 file changed, 58 insertions(+), 43 deletions(-) diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h index 550e3c0d20..40002313f1 100644 --- a/indra/llcommon/llsingleton.h +++ b/indra/llcommon/llsingleton.h @@ -61,6 +61,7 @@ class LLSingleton : private boost::noncopyable private: typedef enum e_init_state { + UNINITIALIZED, CONSTRUCTING, INITIALIZING, INITIALIZED, @@ -68,23 +69,23 @@ private: } EInitState; // stores pointer to singleton instance - // and tracks initialization state of singleton - struct SingletonInstanceData + struct SingletonLifetimeManager { - EInitState mInitState; - DERIVED_TYPE* mSingletonInstance; - - SingletonInstanceData() - : mSingletonInstance(NULL), - mInitState(CONSTRUCTING) + SingletonLifetimeManager() + { + construct(); + } + + static void construct() { - mSingletonInstance = new DERIVED_TYPE(); - mInitState = INITIALIZING; + sData.mInitState = CONSTRUCTING; + sData.mInstance = new DERIVED_TYPE(); + sData.mInitState = INITIALIZING; } - ~SingletonInstanceData() + ~SingletonLifetimeManager() { - if (mInitState != DELETED) + if (sData.mInitState != DELETED) { deleteSingleton(); } @@ -94,9 +95,8 @@ private: public: virtual ~LLSingleton() { - SingletonInstanceData& data = getData(); - data.mSingletonInstance = NULL; - data.mInitState = DELETED; + sData.mInstance = NULL; + sData.mInitState = DELETED; } /** @@ -121,42 +121,46 @@ public: */ static void deleteSingleton() { - delete getData().mSingletonInstance; - getData().mSingletonInstance = NULL; - getData().mInitState = DELETED; + delete sData.mInstance; + sData.mInstance = NULL; + sData.mInitState = DELETED; } - static SingletonInstanceData& getData() - { - // this is static to cache the lookup results - static SingletonInstanceData sData; - return sData; - } static DERIVED_TYPE* getInstance() { - SingletonInstanceData& data = getData(); + static SingletonLifetimeManager sLifeTimeMgr; - if (data.mInitState == CONSTRUCTING) + switch (sData.mInitState) { + case UNINITIALIZED: + // should never be uninitialized at this point + llassert(false); + return NULL; + case CONSTRUCTING: llerrs << "Tried to access singleton " << typeid(DERIVED_TYPE).name() << " from singleton constructor!" << llendl; - } - - if (data.mInitState == DELETED) - { - llwarns << "Trying to access deleted singleton " << typeid(DERIVED_TYPE).name() << " creating new instance" << llendl; - data.mSingletonInstance = new DERIVED_TYPE(); - data.mInitState = INITIALIZING; - } // Fall into INITIALIZING case below - - if (data.mInitState == INITIALIZING) - { + return NULL; + case INITIALIZING: // go ahead and flag ourselves as initialized so we can be reentrant during initialization - data.mInitState = INITIALIZED; - data.mSingletonInstance->initSingleton(); + sData.mInitState = INITIALIZED; + sData.mInstance->initSingleton(); + return sData.mInstance; + case INITIALIZED: + return sData.mInstance; + case DELETED: + llwarns << "Trying to access deleted singleton " << typeid(DERIVED_TYPE).name() << " creating new instance" << llendl; + SingletonLifetimeManager::construct(); + sData.mInitState = INITIALIZED; + sData.mInstance->initSingleton(); + return sData.mInstance; } - - return data.mSingletonInstance; + + return NULL; + } + + static DERIVED_TYPE* getIfExists() + { + return sData.mInstance; } // Reference version of getInstance() @@ -170,18 +174,29 @@ public: // Use this to avoid accessing singletons before the can safely be constructed static bool instanceExists() { - return getData().mInitState == INITIALIZED; + return sData.mInitState == INITIALIZED; } // Has this singleton already been deleted? // Use this to avoid accessing singletons from a static object's destructor static bool destroyed() { - return getData().mInitState == DELETED; + return sData.mInitState == DELETED; } private: + virtual void initSingleton() {} + + struct SingletonData + { + EInitState mInitState; + DERIVED_TYPE* mInstance; + }; + static SingletonData sData; }; +template +typename LLSingleton::SingletonData LLSingleton::sData; + #endif -- cgit v1.2.3 From 88ae31a3adcdc9fabf45b4a7cf1e53bd08615875 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 2 May 2013 13:31:21 -0700 Subject: Fix line endings --- indra/newview/llviewerwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 136e61389a..c65caea3ec 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2036,8 +2036,8 @@ void LLViewerWindow::shutdownViews() } llinfos << "Global views cleaned." << llendl ; - LLNotificationsUI::LLToast::cleanupToasts(); - llinfos << "Leftover toast cleaned up." << llendl; + LLNotificationsUI::LLToast::cleanupToasts(); + llinfos << "Leftover toast cleaned up." << llendl; // DEV-40930: Clear sModalStack. Otherwise, any LLModalDialog left open // will crump with LL_ERRS. -- cgit v1.2.3 From 299433c544d23888169109c2ce5c4807f0d882b4 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 2 May 2013 15:13:05 -0700 Subject: Fix the cmake fix --- indra/llplugin/slplugin/CMakeLists.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt index 5d2b1d922e..20088293ff 100644 --- a/indra/llplugin/slplugin/CMakeLists.txt +++ b/indra/llplugin/slplugin/CMakeLists.txt @@ -50,13 +50,21 @@ add_executable(SLPlugin ${SLPlugin_SOURCE_FILES} ) +if (WINDOWS) set_target_properties(SLPlugin PROPERTIES - MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/slplugin_info.plist -if (WINDOWS) LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMTD\"" -endif (WINDOWS) ) +elseif (DARWIN) +set_target_properties(SLPlugin + PROPERTIES + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/slplugin_info.plist + ) +else () # LINUX +set_target_properties(SLPlugin + PROPERTIES + ) +endif () target_link_libraries(SLPlugin ${LLPLUGIN_LIBRARIES} -- cgit v1.2.3 From 291b38717805f7de41af447c651c5b91352d0a51 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 2 May 2013 15:36:26 -0700 Subject: Cmake doesn't like me --- indra/llplugin/slplugin/CMakeLists.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt index 20088293ff..6e7fefeb21 100644 --- a/indra/llplugin/slplugin/CMakeLists.txt +++ b/indra/llplugin/slplugin/CMakeLists.txt @@ -55,15 +55,11 @@ set_target_properties(SLPlugin PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMTD\"" ) -elseif (DARWIN) +else () set_target_properties(SLPlugin PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/slplugin_info.plist ) -else () # LINUX -set_target_properties(SLPlugin - PROPERTIES - ) endif () target_link_libraries(SLPlugin -- cgit v1.2.3 From a73305c41d058fc755b824e5a9243afe43b424e1 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 2 May 2013 16:24:09 -0700 Subject: ACME-275 : WIP : Implemented filter(), still arrange() not done timely, tweaked test values to allow test of sort and filter --- indra/newview/llpanelpeople.cpp | 14 ++++++++- indra/newview/llpersonmodelcommon.cpp | 55 ++++++++++++++++++++++++++++++----- indra/newview/llpersonmodelcommon.h | 18 +++++++----- 3 files changed, 72 insertions(+), 15 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index a9a024c9ed..9daf441ab3 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1687,10 +1687,22 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) void LLPanelPeople::addTestParticipant() { + std::string suffix("Aa"); + std::string prefix("EastBayGuy"); for(int i = 0; i < 300; ++i) { LLPersonTabModel * person_folder_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap.begin()->second); - addParticipantToModel(person_folder_model, LLUUID().generateNewID(), "EastBayGuy"); + std::string name = prefix + " " + suffix; + addParticipantToModel(person_folder_model, LLUUID().generateNewID(), name); + // Next suffix : Aa, Ab, Ac ... Az, Ba, Bb, Bc ... Bz, Ca, Cb ... + suffix[1]+=1; + if (suffix[1]=='{') + { + suffix[1]='a'; + suffix[0]+=1; + if (suffix[0]=='[') + suffix[0]='A'; + } } } diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp index 3e9ca9c3b9..9660432b80 100644 --- a/indra/newview/llpersonmodelcommon.cpp +++ b/indra/newview/llpersonmodelcommon.cpp @@ -31,21 +31,23 @@ #include "llevents.h" #include "llsdutil.h" +#include "llstring.h" // // LLPersonModelCommon // LLPersonModelCommon::LLPersonModelCommon(std::string display_name, LLFolderViewModelInterface& root_view_model) : -LLFolderViewModelItemCommon(root_view_model), - mName(display_name), + LLFolderViewModelItemCommon(root_view_model), mID(LLUUID().generateNewID()) { + renameItem(display_name); } LLPersonModelCommon::LLPersonModelCommon(LLFolderViewModelInterface& root_view_model) : -LLFolderViewModelItemCommon(root_view_model), + LLFolderViewModelItemCommon(root_view_model), mName(""), + mSearchableName(""), mID(LLUUID().generateNewID()) { } @@ -55,6 +57,14 @@ LLPersonModelCommon::~LLPersonModelCommon() } +BOOL LLPersonModelCommon::renameItem(const std::string& new_name) +{ + mName = new_name; + mSearchableName = new_name; + LLStringUtil::toUpper(mSearchableName); + return TRUE; +} + void LLPersonModelCommon::postEvent(const std::string& event_type, LLPersonTabModel* folder, LLPersonModel* person) { LLUUID folder_id = folder->getID(); @@ -84,6 +94,39 @@ void LLPersonModelCommon::showProperties(void) { } +bool LLPersonModelCommon::filter( LLFolderViewFilter& filter) +{ + // See LLFolderViewModelItemInventory::filter() +/* + if (!filter.isModified()) + { + llinfos << "Merov : LLPersonModelCommon::filter, exit, no modif" << llendl; + return true; + } +*/ + if (!mChildren.empty()) + { + //llinfos << "Merov : LLPersonModelCommon::filter, filtering folder = " << getDisplayName() << llendl; + setPassedFilter(1, -1, filter.getStringMatchOffset(this), filter.getFilterStringSize()); + for (child_list_t::iterator iter = mChildren.begin(), end_iter = mChildren.end(); + iter != end_iter; + ++iter) + { + // LLFolderViewModelItem + LLPersonModelCommon* item = dynamic_cast(*iter); + item->filter(filter); + } + } + else + { + const bool passed_filter = filter.check(this); + setPassedFilter(passed_filter, -1, filter.getStringMatchOffset(this), filter.getFilterStringSize()); + } + + filter.clearModified(); + return true; +} + // // LLPersonTabModel // @@ -186,7 +229,7 @@ void LLPersonViewFilter::setFilterSubString(const std::string& string) if (mFilterSubString != filter_sub_string_new) { // *TODO : Add logic to support more and less restrictive filtering - mFilterModified = FILTER_RESTART; + setModified(FILTER_RESTART); mFilterSubString = filter_sub_string_new; } } @@ -198,9 +241,7 @@ bool LLPersonViewFilter::showAllResults() const bool LLPersonViewFilter::check(const LLFolderViewModelItem* item) { - std::string::size_type string_offset = mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos; - - return (mFilterSubString.size() == 0 || string_offset != std::string::npos); + return (mFilterSubString.size() ? (item->getSearchableName().find(mFilterSubString) != std::string::npos) : true); } std::string::size_type LLPersonViewFilter::getStringMatchOffset(LLFolderViewModelItem* item) const diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h index 9e13a7d7d9..1e9117c2df 100644 --- a/indra/newview/llpersonmodelcommon.h +++ b/indra/newview/llpersonmodelcommon.h @@ -46,13 +46,14 @@ public: // Stub those things we won't really be using in this conversation context virtual const std::string& getName() const { return mName; } virtual const std::string& getDisplayName() const { return mName; } - virtual const std::string& getSearchableName() const { return mName; } + virtual const std::string& getSearchableName() const { return mSearchableName; } + virtual LLPointer getIcon() const { return NULL; } virtual LLPointer getOpenIcon() const { return getIcon(); } virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; } virtual std::string getLabelSuffix() const { return LLStringUtil::null; } virtual BOOL isItemRenameable() const { return TRUE; } - virtual BOOL renameItem(const std::string& new_name) { mName = new_name; return TRUE; } + virtual BOOL renameItem(const std::string& new_name); virtual BOOL isItemMovable( void ) const { return FALSE; } virtual BOOL isItemRemovable( void ) const { return FALSE; } virtual BOOL isItemInTrash( void) const { return FALSE; } @@ -70,10 +71,12 @@ public: virtual bool hasChildren() const { return FALSE; } virtual bool potentiallyVisible() { return true; } - virtual bool filter( LLFolderViewFilter& filter) { return false; } + + virtual bool filter( LLFolderViewFilter& filter); + virtual bool descendantsPassedFilter(S32 filter_generation = -1) { return true; } - virtual void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) { } - virtual bool passedFilter(S32 filter_generation = -1) { return true; } +// virtual void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) { } + virtual bool passedFilter(S32 filter_generation = -1) { return mPassedFilter; } // The action callbacks virtual void performAction(LLInventoryModel* model, std::string action); @@ -97,7 +100,8 @@ public: protected: - std::string mName; // Name of the session or the participant + std::string mName; // Name of the person + std::string mSearchableName; // Name used in string matching for this person LLUUID mID; }; @@ -175,7 +179,7 @@ public: // +-------------------------------------------------------------------+ // Note : we currently filter the whole person list at once, no need to count then. void setFilterCount(S32 count) { } - S32 getFilterCount() const { return 0; } + S32 getFilterCount() const { return 1; } void decrementFilterCount() { } // +-------------------------------------------------------------------+ -- cgit v1.2.3 From 933cff41a6b03f2b11403970866db9fbbcf7e85f Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 2 May 2013 16:41:16 -0700 Subject: ACME-307 Fix crash when clicking profile button: The crash was caused by existing code which was taking the last focused element and assuming it was a pointer to a LLUICtrl. Now assume the pointer is of type LLView since there is not need to have it as a LLUICtrl pointer. --- indra/llui/llfloater.cpp | 2 +- indra/llui/llfocusmgr.cpp | 4 ++-- indra/llui/llfocusmgr.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 09e27a264a..ef4b1450ca 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1346,7 +1346,7 @@ void LLFloater::setFocus( BOOL b ) { return; } - LLUICtrl* last_focus = gFocusMgr.getLastFocusForGroup(this); + LLView* last_focus = gFocusMgr.getLastFocusForGroup(this); // a descendent already has focus BOOL child_had_focus = hasFocus(); diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp index 724d190307..f03c8d444b 100644 --- a/indra/llui/llfocusmgr.cpp +++ b/indra/llui/llfocusmgr.cpp @@ -469,7 +469,7 @@ void LLFocusMgr::setAppHasFocus(BOOL focus) mAppHasFocus = focus; } -LLUICtrl* LLFocusMgr::getLastFocusForGroup(LLView* subtree_root) const +LLView* LLFocusMgr::getLastFocusForGroup(LLView* subtree_root) const { if (subtree_root) { @@ -477,7 +477,7 @@ LLUICtrl* LLFocusMgr::getLastFocusForGroup(LLView* subtree_root) const if (found_it != mImpl->mFocusHistory.end()) { // found last focus for this subtree - return static_cast(found_it->second.get()); + return found_it->second.get(); } } return NULL; diff --git a/indra/llui/llfocusmgr.h b/indra/llui/llfocusmgr.h index 25ae1d2579..1c7326260c 100644 --- a/indra/llui/llfocusmgr.h +++ b/indra/llui/llfocusmgr.h @@ -97,7 +97,7 @@ public: void triggerFocusFlash(); BOOL getAppHasFocus() const { return mAppHasFocus; } void setAppHasFocus(BOOL focus); - LLUICtrl* getLastFocusForGroup(LLView* subtree_root) const; + LLView* getLastFocusForGroup(LLView* subtree_root) const; void clearLastFocusForGroup(LLView* subtree_root); // If setKeyboardFocus(NULL) is called, and there is a non-NULL default -- cgit v1.2.3 From 6cce8629b962cd73515e2d0a85620b602e57a0fe Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 2 May 2013 18:47:56 -0700 Subject: CHUI-275 : WIP : Cleaned up comments --- indra/newview/llpersonmodelcommon.cpp | 9 +++++---- indra/newview/llpersonmodelcommon.h | 8 -------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp index 9660432b80..6b4c71faa2 100644 --- a/indra/newview/llpersonmodelcommon.cpp +++ b/indra/newview/llpersonmodelcommon.cpp @@ -96,8 +96,8 @@ void LLPersonModelCommon::showProperties(void) bool LLPersonModelCommon::filter( LLFolderViewFilter& filter) { - // See LLFolderViewModelItemInventory::filter() /* + Hack: for the moment, we always apply the filter if we're called if (!filter.isModified()) { llinfos << "Merov : LLPersonModelCommon::filter, exit, no modif" << llendl; @@ -106,19 +106,20 @@ bool LLPersonModelCommon::filter( LLFolderViewFilter& filter) */ if (!mChildren.empty()) { - //llinfos << "Merov : LLPersonModelCommon::filter, filtering folder = " << getDisplayName() << llendl; - setPassedFilter(1, -1, filter.getStringMatchOffset(this), filter.getFilterStringSize()); + // If the current instance has children, it's a "person folder" and always passes filters (we do not filter out empty folders) + setPassedFilter(1, -1); + // Call filter recursively on all children for (child_list_t::iterator iter = mChildren.begin(), end_iter = mChildren.end(); iter != end_iter; ++iter) { - // LLFolderViewModelItem LLPersonModelCommon* item = dynamic_cast(*iter); item->filter(filter); } } else { + // If there's no children, the current instance is a person and we check and set the passed filter flag on it const bool passed_filter = filter.check(this); setPassedFilter(passed_filter, -1, filter.getStringMatchOffset(this), filter.getFilterStringSize()); } diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h index ffd145b549..f44f619d18 100644 --- a/indra/newview/llpersonmodelcommon.h +++ b/indra/newview/llpersonmodelcommon.h @@ -174,14 +174,6 @@ public: const std::string& getFilterText() { return mName; } void setModified(EFilterModified behavior = FILTER_RESTART) { mFilterModified = behavior; } - // +-------------------------------------------------------------------+ - // + Count - // +-------------------------------------------------------------------+ - // Note : we currently filter the whole person list at once, no need to count then. - //void setFilterCount(S32 count) { } - //S32 getFilterCount() const { return 1; } - //void decrementFilterCount() { } - // +-------------------------------------------------------------------+ // + Time // +-------------------------------------------------------------------+ -- cgit v1.2.3 From 1b6d6b7e794ad4401faa91a79774922a5baec968 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 3 May 2013 11:57:59 -0700 Subject: ACME-323 Create a tab for 'Invite people you know to SL': FBC Test Two tabs are now named to match UX spec. Also created a function called createPersonTabs() which simplifies tab creation. The LLPersonFolderView is being turned into the tab manager. --- indra/newview/llpanelpeople.cpp | 25 ------------------------- indra/newview/llpersonfolderview.cpp | 24 ++++++++++++++++++++++++ indra/newview/llpersonfolderview.h | 4 ++++ 3 files changed, 28 insertions(+), 25 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 03135ce580..22b79a9380 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -750,31 +750,6 @@ BOOL LLPanelPeople::postBuild() scroller->setFollowsAll(); mPersonFolderView->setScrollContainer(scroller); mPersonFolderView->setFollowsAll(); - - //Create a person tab - LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mPersonFolderViewModel); - LLPersonTabView::Params params; - params.name = item->getDisplayName(); - params.root = mPersonFolderView; - params.listener = item; - params.tool_tip = params.name; - LLPersonTabView * widget = LLUICtrlFactory::create(params); - widget->addToFolder(mPersonFolderView); - - mPersonFolderView->mPersonFolderModelMap[item->getID()] = item; - mPersonFolderView->mPersonFolderViewMap[item->getID()] = widget; - - //Create a person tab - item = new LLPersonTabModel("Facebook Friends Tab Two", mPersonFolderViewModel); - params.name = item->getDisplayName(); - params.root = mPersonFolderView; - params.listener = item; - params.tool_tip = params.name; - widget = LLUICtrlFactory::create(params); - widget->addToFolder(mPersonFolderView); - - mPersonFolderView->mPersonFolderModelMap[item->getID()] = item; - mPersonFolderView->mPersonFolderViewMap[item->getID()] = widget; gIdleCallbacks.addFunction(idle, this); diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index ba1e9d20eb..21578e986b 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -38,6 +38,8 @@ LLFolderView(p), mConversationsEventStream("ConversationsEventsTwo") { mConversationsEventStream.listen("ConversationsRefresh", boost::bind(&LLPersonFolderView::onConversationModelEvent, this, _1)); + + createPersonTabs(); } LLPersonFolderView::~LLPersonFolderView() @@ -45,6 +47,28 @@ LLPersonFolderView::~LLPersonFolderView() mConversationsEventStream.stopListening("ConversationsRefresh"); } +void LLPersonFolderView::createPersonTabs() +{ + createPersonTab("SL residents you may want to friend"); + createPersonTab("Invite people you know to SL"); +} + +void LLPersonFolderView::createPersonTab(const std::string& tab_name) +{ + //Create a person tab + LLPersonTabModel* item = new LLPersonTabModel(tab_name, *mViewModel); + LLPersonTabView::Params params; + params.name = item->getDisplayName(); + params.root = this; + params.listener = item; + params.tool_tip = params.name; + LLPersonTabView * widget = LLUICtrlFactory::create(params); + widget->addToFolder(this); + + mPersonFolderModelMap[item->getID()] = item; + mPersonFolderViewMap[item->getID()] = widget; +} + BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) { LLFolderViewItem * item = getCurSelectedItem(); diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h index 74e9142a7c..1cf597b8c9 100644 --- a/indra/newview/llpersonfolderview.h +++ b/indra/newview/llpersonfolderview.h @@ -50,6 +50,10 @@ public: LLPersonFolderView(const Params &p); ~LLPersonFolderView(); + + void createPersonTabs(); + void createPersonTab(const std::string& tab_name); + bool onConversationModelEvent(const LLSD &event); LLPersonView * createConversationViewParticipant(LLPersonModel * item); -- cgit v1.2.3 From 0408a984d3efb55cdf88c314e333be3b29c291ea Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 3 May 2013 13:55:12 -0700 Subject: ACME-324 Populate list with FB only friends: When clicking the '+' button FB only friends will appear in the second tab titled 'Invite people you know to SL'. --- indra/newview/llpanelpeople.cpp | 38 ++++++++++++++++++++++++++++++++---- indra/newview/llpersonfolderview.cpp | 1 + indra/newview/llpersonfolderview.h | 1 + 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 22b79a9380..e1933c041c 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1641,17 +1641,29 @@ void LLPanelPeople::openFacebookWeb(std::string url) void LLPanelPeople::showFacebookFriends(const LLSD& friends) { mFacebookFriends->clear(); + S32 model_index; for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) { std::string name = i->second["name"].asString(); LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); + //FB+SL but not SL friend + if(agent_id.notNull()) + { + model_index = 0; + } + //FB only friend + else + { + model_index = 1; + } + //add to avatar list mFacebookFriends->addNewItem(agent_id, name, false); //Add to folder view - LLPersonTabModel * session_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap.begin()->second); + LLPersonTabModel * session_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap[mPersonFolderView->mPersonTabIDs[model_index]]); if(session_model) { addParticipantToModel(session_model, agent_id, name); @@ -1663,11 +1675,29 @@ void LLPanelPeople::addTestParticipant() { std::string suffix("Aa"); std::string prefix("Test Name"); + LLPersonTabModel * person_folder_model; + LLUUID agentID; + std::string name; + S32 model_index; + for(int i = 0; i < 300; ++i) { - LLPersonTabModel * person_folder_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap.begin()->second); - std::string name = prefix + " " + suffix; - addParticipantToModel(person_folder_model, gAgent.getID(), name); + //Adds FB+SL people that aren't yet SL friends + if(i < 10) + { + model_index = 0; + agentID = gAgent.getID(); + } + //Adds FB only friends + else + { + model_index = 1; + agentID = LLUUID(NULL); + } + + person_folder_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap[mPersonFolderView->mPersonTabIDs[model_index]]); + name = prefix + " " + suffix; + addParticipantToModel(person_folder_model, agentID, name); // Next suffix : Aa, Ab, Ac ... Az, Ba, Bb, Bc ... Bz, Ca, Cb ... suffix[1]+=1; if (suffix[1]=='{') diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index 21578e986b..8f468e6814 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -65,6 +65,7 @@ void LLPersonFolderView::createPersonTab(const std::string& tab_name) LLPersonTabView * widget = LLUICtrlFactory::create(params); widget->addToFolder(this); + mPersonTabIDs.push_back(item->getID()); mPersonFolderModelMap[item->getID()] = item; mPersonFolderViewMap[item->getID()] = widget; } diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h index 1cf597b8c9..3f5f874e0f 100644 --- a/indra/newview/llpersonfolderview.h +++ b/indra/newview/llpersonfolderview.h @@ -61,6 +61,7 @@ public: person_folder_model_map mPersonFolderModelMap; person_folder_view_map mPersonFolderViewMap; + std::vector mPersonTabIDs; LLEventStream mConversationsEventStream; }; -- cgit v1.2.3 From cca67a38d89da30d2b36690d91eb00cac04384bd Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 3 May 2013 16:18:47 -0700 Subject: =?UTF-8?q?ACME-326=20Add=20=E2=80=98connect=20to=20facebook?= =?UTF-8?q?=E2=80=99=20on=20menu=20bar=20with=20functionality:=20Now=20the?= =?UTF-8?q?=20'SL=20residents=20you=20may=20want=20to=20friend'=20folder?= =?UTF-8?q?=20is=20populated=20only=20with=20FB+SL=20users=20who=20are=20n?= =?UTF-8?q?ot=20yet=20friends.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- indra/newview/llpanelpeople.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index e1933c041c..f9f4d6d1b6 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1642,14 +1642,18 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) { mFacebookFriends->clear(); S32 model_index; + LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance(); for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) { std::string name = i->second["name"].asString(); LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); + //add to avatar list + mFacebookFriends->addNewItem(agent_id, name, false); + //FB+SL but not SL friend - if(agent_id.notNull()) + if(agent_id.notNull() && !avatar_tracker.isBuddy(agent_id)) { model_index = 0; } @@ -1659,9 +1663,6 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) model_index = 1; } - //add to avatar list - mFacebookFriends->addNewItem(agent_id, name, false); - //Add to folder view LLPersonTabModel * session_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap[mPersonFolderView->mPersonTabIDs[model_index]]); if(session_model) -- cgit v1.2.3 From ad12517329e73abf64ccc926aa49453cb4b73bfc Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 3 May 2013 17:03:37 -0700 Subject: ACME-275 : WIP : Filtering --- indra/llui/llfolderview.cpp | 5 +++++ indra/llui/llfolderviewitem.cpp | 16 +++++++++++++++- indra/newview/llpanelpeople.cpp | 1 + indra/newview/llpersonfolderview.cpp | 1 + 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index cf449217f5..679a76e26f 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -1652,6 +1652,11 @@ void LLFolderView::update() } BOOL is_visible = isInVisibleChain(); + + if (getName() == "Persons") + { + llinfos << "Merov : update Persons, is_visible = " << is_visible << llendl; + } // Puts folders/items in proper positions // arrange() takes the model filter flag into account and call sort() if necessary (CHUI-849) diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 6c147ccc12..88bc0ccfd4 100755 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -953,6 +953,12 @@ static LLFastTimer::DeclareTimer FTM_ARRANGE("Arrange"); // * Makes sure that this view and its children are the right size S32 LLFolderViewFolder::arrange( S32* width, S32* height ) { + llinfos << "Merov : LLFolderViewFolder::arrange, folder = " << getName() << llendl; + if (getName() == "Facebook Friends Tab Two") + { + llinfos << "Merov : Arranging Facebook Friends Tab Two, needs arrange = " << needsArrange() << ", is open = " << isOpen() << llendl; + } + // Sort before laying out contents // Note that we sort from the root (CHUI-849) getRoot()->getFolderViewModel()->sort(this); @@ -1109,7 +1115,11 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height ) BOOL LLFolderViewFolder::needsArrange() { - return mLastArrangeGeneration < getRoot()->getArrangeGeneration(); + if (getName() != "") + { + llinfos << "Merov : needsArrange for " << getName() << ", last = " << mLastArrangeGeneration << ", current = " << getRoot()->getArrangeGeneration() << ", need = " << (mLastArrangeGeneration < getRoot()->getArrangeGeneration() ? "true" : "false") << llendl; + } + return mLastArrangeGeneration != getRoot()->getArrangeGeneration(); } // Passes selection information on to children and record selection @@ -1631,6 +1641,10 @@ void LLFolderViewFolder::requestArrange() void LLFolderViewFolder::toggleOpen() { + if (getName() == "Facebook Friends Tab Two") + { + llinfos << "Merov : toggleOpen, currently open is = " << isOpen() << llendl; + } setOpen(!isOpen()); } diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 03135ce580..66a183d5e5 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1224,6 +1224,7 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string) else if (cur_tab == FBCTESTTWO_TAB_NAME) { mPersonFolderViewModel.getFilter().setFilterSubString(filter); + mPersonFolderView->requestArrange(); } } diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index ba1e9d20eb..8d2191aebb 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -37,6 +37,7 @@ LLPersonFolderView::LLPersonFolderView(const Params &p) : LLFolderView(p), mConversationsEventStream("ConversationsEventsTwo") { + rename("Persons"); // For tracking! mConversationsEventStream.listen("ConversationsRefresh", boost::bind(&LLPersonFolderView::onConversationModelEvent, this, _1)); } -- cgit v1.2.3 From f5e8457e4e4fad1d823c51d86c01fdc2ae08401c Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Mon, 6 May 2013 12:12:05 -0400 Subject: BUG-2295/MAINT-2624 unexpected crash around Content-Range: header processing Not certain what the source of the short data is with one resident but I'm going to make these problems retryable as they are transport-related. Lift the retry detection into a method that should be reusable by others interested in determining what is retryable. Trace output handling on the libcurl debug callback was attrocious. Some unsafe length handling on my part was protected by a second layer of defense. Made that correct and more useful by logging actual data sizes during trace. --- indra/llcorehttp/_httpoprequest.cpp | 12 ++--- indra/llcorehttp/_httppolicy.cpp | 28 ++-------- indra/llcorehttp/httpcommon.cpp | 34 +++++++++++- indra/llcorehttp/httpcommon.h | 8 ++- indra/llcorehttp/tests/test_httprequest.hpp | 74 ++++++++++++++++++++------ indra/llcorehttp/tests/test_llcorehttp_peer.py | 13 ++++- 6 files changed, 121 insertions(+), 48 deletions(-) diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index 12eed06b10..207ed8e1e4 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -669,7 +669,7 @@ int HttpOpRequest::debugCallback(CURL * handle, curl_infotype info, char * buffe std::string safe_line; std::string tag; bool logit(false); - len = (std::min)(len, size_t(256)); // Keep things reasonable in all cases + const size_t log_len((std::min)(len, size_t(256))); // Keep things reasonable in all cases switch (info) { @@ -677,7 +677,7 @@ int HttpOpRequest::debugCallback(CURL * handle, curl_infotype info, char * buffe if (op->mTracing >= HTTP_TRACE_CURL_HEADERS) { tag = "TEXT"; - escape_libcurl_debug_data(buffer, len, true, safe_line); + escape_libcurl_debug_data(buffer, log_len, true, safe_line); logit = true; } break; @@ -686,7 +686,7 @@ int HttpOpRequest::debugCallback(CURL * handle, curl_infotype info, char * buffe if (op->mTracing >= HTTP_TRACE_CURL_HEADERS) { tag = "HEADERIN"; - escape_libcurl_debug_data(buffer, len, true, safe_line); + escape_libcurl_debug_data(buffer, log_len, true, safe_line); logit = true; } break; @@ -695,7 +695,7 @@ int HttpOpRequest::debugCallback(CURL * handle, curl_infotype info, char * buffe if (op->mTracing >= HTTP_TRACE_CURL_HEADERS) { tag = "HEADEROUT"; - escape_libcurl_debug_data(buffer, 2 * len, true, safe_line); // Goes out as one line + escape_libcurl_debug_data(buffer, log_len, true, safe_line); // Goes out as one line unlike header_in logit = true; } break; @@ -707,7 +707,7 @@ int HttpOpRequest::debugCallback(CURL * handle, curl_infotype info, char * buffe logit = true; if (op->mTracing >= HTTP_TRACE_CURL_BODIES) { - escape_libcurl_debug_data(buffer, len, false, safe_line); + escape_libcurl_debug_data(buffer, log_len, false, safe_line); } else { @@ -725,7 +725,7 @@ int HttpOpRequest::debugCallback(CURL * handle, curl_infotype info, char * buffe logit = true; if (op->mTracing >= HTTP_TRACE_CURL_BODIES) { - escape_libcurl_debug_data(buffer, len, false, safe_line); + escape_libcurl_debug_data(buffer, log_len, false, safe_line); } else { diff --git a/indra/llcorehttp/_httppolicy.cpp b/indra/llcorehttp/_httppolicy.cpp index 76c1e22431..014bd37e2e 100644 --- a/indra/llcorehttp/_httppolicy.cpp +++ b/indra/llcorehttp/_httppolicy.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2012&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2012, Linden Research, Inc. + * Copyright (C) 2012-2013, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -319,33 +319,13 @@ bool HttpPolicy::cancel(HttpHandle handle) bool HttpPolicy::stageAfterCompletion(HttpOpRequest * op) { - static const HttpStatus cant_connect(HttpStatus::EXT_CURL_EASY, CURLE_COULDNT_CONNECT); - static const HttpStatus cant_res_proxy(HttpStatus::EXT_CURL_EASY, CURLE_COULDNT_RESOLVE_PROXY); - static const HttpStatus cant_res_host(HttpStatus::EXT_CURL_EASY, CURLE_COULDNT_RESOLVE_HOST); - static const HttpStatus send_error(HttpStatus::EXT_CURL_EASY, CURLE_SEND_ERROR); - static const HttpStatus recv_error(HttpStatus::EXT_CURL_EASY, CURLE_RECV_ERROR); - static const HttpStatus upload_failed(HttpStatus::EXT_CURL_EASY, CURLE_UPLOAD_FAILED); - static const HttpStatus op_timedout(HttpStatus::EXT_CURL_EASY, CURLE_OPERATION_TIMEDOUT); - static const HttpStatus post_error(HttpStatus::EXT_CURL_EASY, CURLE_HTTP_POST_ERROR); - // Retry or finalize if (! op->mStatus) { - // If this failed, we might want to retry. Have to inspect - // the status a little more deeply for those reasons worth retrying... - if (op->mPolicyRetries < op->mPolicyRetryLimit && - ((op->mStatus.isHttpStatus() && op->mStatus.mType >= 499 && op->mStatus.mType <= 599) || - cant_connect == op->mStatus || - cant_res_proxy == op->mStatus || - cant_res_host == op->mStatus || - send_error == op->mStatus || - recv_error == op->mStatus || - upload_failed == op->mStatus || - op_timedout == op->mStatus || - post_error == op->mStatus)) + // If this failed, we might want to retry. + if (op->mPolicyRetries < op->mPolicyRetryLimit && op->mStatus.isRetryable()) { - // Okay, worth a retry. We include 499 in this test as - // it's the old 'who knows?' error from many grid services... + // Okay, worth a retry. retryOp(op); return true; // still active/ready } diff --git a/indra/llcorehttp/httpcommon.cpp b/indra/llcorehttp/httpcommon.cpp index f2fcbf77a3..0738760763 100644 --- a/indra/llcorehttp/httpcommon.cpp +++ b/indra/llcorehttp/httpcommon.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2012&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2012, Linden Research, Inc. + * Copyright (C) 2012-2013, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -116,6 +116,7 @@ std::string HttpStatus::toString() const { 415, "Unsupported Media Type" }, { 416, "Requested range not satisfiable" }, { 417, "Expectation Failed" }, + { 499, "Linden Catch-All" }, { 500, "Internal Server Error" }, { 501, "Not Implemented" }, { 502, "Bad Gateway" }, @@ -174,6 +175,37 @@ std::string HttpStatus::toString() const } return std::string("Unknown error"); } + + +// Pass true on statuses that might actually be cleared by a +// retry. Library failures, calling problems, etc. aren't +// going to be fixed by squirting bits all over the Net. +bool HttpStatus::isRetryable() const +{ + static const HttpStatus cant_connect(HttpStatus::EXT_CURL_EASY, CURLE_COULDNT_CONNECT); + static const HttpStatus cant_res_proxy(HttpStatus::EXT_CURL_EASY, CURLE_COULDNT_RESOLVE_PROXY); + static const HttpStatus cant_res_host(HttpStatus::EXT_CURL_EASY, CURLE_COULDNT_RESOLVE_HOST); + static const HttpStatus send_error(HttpStatus::EXT_CURL_EASY, CURLE_SEND_ERROR); + static const HttpStatus recv_error(HttpStatus::EXT_CURL_EASY, CURLE_RECV_ERROR); + static const HttpStatus upload_failed(HttpStatus::EXT_CURL_EASY, CURLE_UPLOAD_FAILED); + static const HttpStatus op_timedout(HttpStatus::EXT_CURL_EASY, CURLE_OPERATION_TIMEDOUT); + static const HttpStatus post_error(HttpStatus::EXT_CURL_EASY, CURLE_HTTP_POST_ERROR); + static const HttpStatus partial_file(HttpStatus::EXT_CURL_EASY, CURLE_PARTIAL_FILE); + static const HttpStatus inv_cont_range(HttpStatus::LLCORE, HE_INV_CONTENT_RANGE_HDR); + + return ((isHttpStatus() && mType >= 499 && mType <= 599) || // Include special 499 in retryables + *this == cant_connect || // Connection reset/endpoint problems + *this == cant_res_proxy || // DNS problems + *this == cant_res_host || // DNS problems + *this == send_error || // General socket problems + *this == recv_error || // General socket problems + *this == upload_failed || // Transport problem + *this == op_timedout || // Timer expired + *this == post_error || // Transport problem + *this == partial_file || // Data inconsistency in response + *this == inv_cont_range); // Short data read disagrees with content-range +} + } // end namespace LLCore diff --git a/indra/llcorehttp/httpcommon.h b/indra/llcorehttp/httpcommon.h index c0d4ec5aad..41fb5164cf 100644 --- a/indra/llcorehttp/httpcommon.h +++ b/indra/llcorehttp/httpcommon.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2012&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2012, Linden Research, Inc. + * Copyright (C) 2012-2013, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -303,6 +303,12 @@ struct HttpStatus { return mType >= type_enum_t(100) && mType <= type_enum_t(999); } + + /// Returns true if the status is one that will be retried + /// internally. Provided for external consumption for cases + /// where that logic needs to be replicated. Only applies + /// to failed statuses, successful statuses will return false. + bool isRetryable() const; }; // end struct HttpStatus diff --git a/indra/llcorehttp/tests/test_httprequest.hpp b/indra/llcorehttp/tests/test_httprequest.hpp index 16f39845bb..ff84b04070 100644 --- a/indra/llcorehttp/tests/test_httprequest.hpp +++ b/indra/llcorehttp/tests/test_httprequest.hpp @@ -2670,10 +2670,15 @@ void HttpRequestTestObjectType::test<22>() mMemTotal = GetMemTotal(); mHandlerCalls = 0; + HttpOptions * options = NULL; HttpRequest * req = NULL; try { + // options set + options = new HttpOptions(); + options->setRetries(1); // Partial_File is retryable and can timeout in here + // Get singletons created HttpRequest::createService(); @@ -2699,7 +2704,7 @@ void HttpRequestTestObjectType::test<22>() url_base + buffer, 0, 25, - NULL, + options, NULL, &handler); ensure("Valid handle returned for ranged request", handle != LLCORE_HTTP_HANDLE_INVALID); @@ -2707,18 +2712,19 @@ void HttpRequestTestObjectType::test<22>() // Run the notification pump. int count(0); - int limit(10); + int limit(30); while (count++ < limit && mHandlerCalls < test_count) { req->update(1000000); usleep(100000); } - ensure("Request executed in reasonable time", count < limit); - ensure("One handler invocation for each request", mHandlerCalls == test_count); + ensure("Request executed in reasonable time - ms1", count < limit); + ensure("One handler invocation for each request - ms1", mHandlerCalls == test_count); // ====================================== // Issue bug2295 GETs that will get a libcurl 18 (PARTIAL_FILE) // ====================================== + mHandlerCalls = 0; mStatus = HttpStatus(HttpStatus::EXT_CURL_EASY, CURLE_PARTIAL_FILE); static const int test2_count(1); for (int i(0); i < test2_count; ++i) @@ -2730,7 +2736,39 @@ void HttpRequestTestObjectType::test<22>() url_base + buffer, 0, 25, + options, NULL, + &handler); + ensure("Valid handle returned for ranged request", handle != LLCORE_HTTP_HANDLE_INVALID); + } + + // Run the notification pump. + count = 0; + limit = 30; + while (count++ < limit && mHandlerCalls < test2_count) + { + req->update(1000000); + usleep(100000); + } + ensure("Request executed in reasonable time - ms2", count < limit); + ensure("One handler invocation for each request - ms2", mHandlerCalls == test2_count); + + // ====================================== + // Issue bug2295 GETs that will get an llcorehttp HE_INV_CONTENT_RANGE_HDR status + // ====================================== + mHandlerCalls = 0; + mStatus = HttpStatus(HttpStatus::LLCORE, HE_INV_CONTENT_RANGE_HDR); + static const int test3_count(1); + for (int i(0); i < test3_count; ++i) + { + char buffer[128]; + sprintf(buffer, "/bug2295/inv_cont_range/%d/", i); + HttpHandle handle = req->requestGetByteRange(HttpRequest::DEFAULT_POLICY_ID, + 0U, + url_base + buffer, + 0, + 25, + options, NULL, &handler); ensure("Valid handle returned for ranged request", handle != LLCORE_HTTP_HANDLE_INVALID); @@ -2738,32 +2776,33 @@ void HttpRequestTestObjectType::test<22>() // Run the notification pump. count = 0; - limit = 10; - while (count++ < limit && mHandlerCalls < (test_count + test2_count)) + limit = 30; + while (count++ < limit && mHandlerCalls < test3_count) { req->update(1000000); usleep(100000); } - ensure("Request executed in reasonable time", count < limit); - ensure("One handler invocation for each request", mHandlerCalls == (test_count + test2_count)); + ensure("Request executed in reasonable time - ms3", count < limit); + ensure("One handler invocation for each request - ms3", mHandlerCalls == test3_count); // ====================================== // Okay, request a shutdown of the servicing thread // ====================================== mStatus = HttpStatus(); + mHandlerCalls = 0; HttpHandle handle = req->requestStopThread(&handler); ensure("Valid handle returned for second request", handle != LLCORE_HTTP_HANDLE_INVALID); // Run the notification pump again count = 0; - limit = 10; - while (count++ < limit && mHandlerCalls < (test_count + test2_count + 1)) + limit = 20; + while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); usleep(100000); } - ensure("Second request executed in reasonable time", count < limit); - ensure("Second handler invocation", mHandlerCalls == (test_count + test2_count + 1)); + ensure("Shutdown request executed in reasonable time", count < limit); + ensure("Shutdown handler invocation", mHandlerCalls == 1); // See that we actually shutdown the thread count = 0; @@ -2773,7 +2812,14 @@ void HttpRequestTestObjectType::test<22>() usleep(100000); } ensure("Thread actually stopped running", HttpService::isStopped()); - + + // release options + if (options) + { + options->release(); + options = NULL; + } + // release the request object delete req; req = NULL; @@ -2781,8 +2827,6 @@ void HttpRequestTestObjectType::test<22>() // Shut down service HttpRequest::destroyService(); - ensure("4 + 1 handler calls on the way out", (test_count + test2_count + 1) == mHandlerCalls); - #if defined(WIN32) // Can only do this memory test on Windows. On other platforms, // the LL logging system holds on to memory and produces what looks diff --git a/indra/llcorehttp/tests/test_llcorehttp_peer.py b/indra/llcorehttp/tests/test_llcorehttp_peer.py index 7f8f765366..8796ae57c7 100644 --- a/indra/llcorehttp/tests/test_llcorehttp_peer.py +++ b/indra/llcorehttp/tests/test_llcorehttp_peer.py @@ -35,6 +35,10 @@ import time import select import getopt from threading import Thread +try: + from cStringIO import StringIO +except ImportError: + from StringIO import StringIO from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler from SocketServer import ThreadingMixIn @@ -64,6 +68,7 @@ class TestHTTPRequestHandler(BaseHTTPRequestHandler): -- '/bug2295/00000018/0/' Generates PARTIAL_FILE (18) error in libcurl. "Content-Range: bytes 0-75/2983", "Content-Length: 76" + -- '/bug2295/inv_cont_range/0/' Generates HE_INVALID_CONTENT_RANGE error in llcorehttp. Some combinations make no sense, there's no effort to protect you from that. @@ -150,6 +155,7 @@ class TestHTTPRequestHandler(BaseHTTPRequestHandler): # appear in the body without actually getting the body. # Library needs to defend against this case. # + body = None if "/bug2295/0/" in self.path: self.send_response(206) self.send_header("Content-Range", "bytes 0-75/2983") @@ -164,6 +170,10 @@ class TestHTTPRequestHandler(BaseHTTPRequestHandler): self.send_response(206) self.send_header("Content-Range", "bytes 0-75/2983") self.send_header("Content-Length", "76") + elif "/bug2295/inv_cont_range/0/" in self.path: + self.send_response(206) + self.send_header("Content-Range", "bytes 0-75/2983") + body = "Some text, but not enough." else: # Unknown request self.send_response(400) @@ -171,7 +181,8 @@ class TestHTTPRequestHandler(BaseHTTPRequestHandler): self.reflect_headers() self.send_header("Content-type", "text/plain") self.end_headers() - # No data + if body: + self.wfile.write(body) else: # Normal response path data = data.copy() # we're going to modify -- cgit v1.2.3 From e30c0925f517b18830b7a4d520246acd98981ab3 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 6 May 2013 11:31:22 -0700 Subject: ACME-326 Populate the list with FB users who use SL but are not yet SL friends: Code cleanup --- indra/newview/llpanelpeople.cpp | 12 +++---- indra/newview/llpersonfolderview.cpp | 68 +++++++++++++++++++++--------------- indra/newview/llpersonfolderview.h | 7 ++-- 3 files changed, 49 insertions(+), 38 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index f9f4d6d1b6..56523773b8 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1664,10 +1664,10 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) } //Add to folder view - LLPersonTabModel * session_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap[mPersonFolderView->mPersonTabIDs[model_index]]); - if(session_model) + LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(model_index)); + if(person_tab_model) { - addParticipantToModel(session_model, agent_id, name); + addParticipantToModel(person_tab_model, agent_id, name); } } } @@ -1676,7 +1676,7 @@ void LLPanelPeople::addTestParticipant() { std::string suffix("Aa"); std::string prefix("Test Name"); - LLPersonTabModel * person_folder_model; + LLPersonTabModel * person_tab_model; LLUUID agentID; std::string name; S32 model_index; @@ -1696,9 +1696,9 @@ void LLPanelPeople::addTestParticipant() agentID = LLUUID(NULL); } - person_folder_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap[mPersonFolderView->mPersonTabIDs[model_index]]); + person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(model_index)); name = prefix + " " + suffix; - addParticipantToModel(person_folder_model, agentID, name); + addParticipantToModel(person_tab_model, agentID, name); // Next suffix : Aa, Ab, Ac ... Az, Ba, Bb, Bc ... Bz, Ca, Cb ... suffix[1]+=1; if (suffix[1]=='{') diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index 8f468e6814..191c7d5bcd 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -47,29 +47,6 @@ LLPersonFolderView::~LLPersonFolderView() mConversationsEventStream.stopListening("ConversationsRefresh"); } -void LLPersonFolderView::createPersonTabs() -{ - createPersonTab("SL residents you may want to friend"); - createPersonTab("Invite people you know to SL"); -} - -void LLPersonFolderView::createPersonTab(const std::string& tab_name) -{ - //Create a person tab - LLPersonTabModel* item = new LLPersonTabModel(tab_name, *mViewModel); - LLPersonTabView::Params params; - params.name = item->getDisplayName(); - params.root = this; - params.listener = item; - params.tool_tip = params.name; - LLPersonTabView * widget = LLUICtrlFactory::create(params); - widget->addToFolder(this); - - mPersonTabIDs.push_back(item->getID()); - mPersonFolderModelMap[item->getID()] = item; - mPersonFolderViewMap[item->getID()] = widget; -} - BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) { LLFolderViewItem * item = getCurSelectedItem(); @@ -97,6 +74,29 @@ BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) return LLView::handleMouseDown( x, y, mask ); } +void LLPersonFolderView::createPersonTabs() +{ + createPersonTab("SL residents you may want to friend"); + createPersonTab("Invite people you know to SL"); +} + +void LLPersonFolderView::createPersonTab(const std::string& tab_name) +{ + //Create a person tab + LLPersonTabModel* item = new LLPersonTabModel(tab_name, *mViewModel); + LLPersonTabView::Params params; + params.name = item->getDisplayName(); + params.root = this; + params.listener = item; + params.tool_tip = params.name; + LLPersonTabView * widget = LLUICtrlFactory::create(params); + widget->addToFolder(this); + + mIndexToFolderVec.push_back(item->getID()); + mPersonFolderModelMap[item->getID()] = item; + mPersonFolderViewMap[item->getID()] = widget; +} + bool LLPersonFolderView::onConversationModelEvent(const LLSD &event) { std::string type = event.get("type").asString(); @@ -105,17 +105,17 @@ bool LLPersonFolderView::onConversationModelEvent(const LLSD &event) if(type == "add_participant") { - LLPersonTabModel * person_folder_model = dynamic_cast(mPersonFolderModelMap[folder_id]); - LLPersonTabView * person_folder_view = dynamic_cast(mPersonFolderViewMap[folder_id]); + LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderModelMap[folder_id]); + LLPersonTabView * person_tab_view = dynamic_cast(mPersonFolderViewMap[folder_id]); - if(person_folder_model) + if(person_tab_model) { - LLPersonModel * person_model = person_folder_model->findParticipant(person_id); + LLPersonModel * person_model = person_tab_model->findParticipant(person_id); if(person_model) { - LLPersonView * participant_view = createConversationViewParticipant(person_model); - participant_view->addToFolder(person_folder_view); + LLPersonView * person_view = createConversationViewParticipant(person_model); + person_view->addToFolder(person_tab_view); } } } @@ -137,3 +137,13 @@ LLPersonView * LLPersonFolderView::createConversationViewParticipant(LLPersonMod return LLUICtrlFactory::create(params); } + +LLPersonTabModel * LLPersonFolderView::getPersonTabModelByIndex(const S32 index) +{ + return mPersonFolderModelMap[mIndexToFolderVec[index]]; +} + +LLPersonTabView * LLPersonFolderView::getPersonTabViewByIndex(const S32 index) +{ + return mPersonFolderViewMap[mIndexToFolderVec[index]]; +} diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h index 3f5f874e0f..3a15f59164 100644 --- a/indra/newview/llpersonfolderview.h +++ b/indra/newview/llpersonfolderview.h @@ -50,18 +50,19 @@ public: LLPersonFolderView(const Params &p); ~LLPersonFolderView(); + BOOL handleMouseDown( S32 x, S32 y, MASK mask ); void createPersonTabs(); void createPersonTab(const std::string& tab_name); - bool onConversationModelEvent(const LLSD &event); LLPersonView * createConversationViewParticipant(LLPersonModel * item); - BOOL handleMouseDown( S32 x, S32 y, MASK mask ); + LLPersonTabModel * getPersonTabModelByIndex(const S32 index); + LLPersonTabView * getPersonTabViewByIndex(const S32 index); person_folder_model_map mPersonFolderModelMap; person_folder_view_map mPersonFolderViewMap; - std::vector mPersonTabIDs; + std::vector mIndexToFolderVec; LLEventStream mConversationsEventStream; }; -- cgit v1.2.3 From f6ad5819c15b1acca1a8b6498bc56adf1c0c3ac9 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 6 May 2013 11:46:16 -0700 Subject: ACME-326 Populate the list with FB users who use SL but are not yet SL friends: Code cleanup --- indra/newview/llpanelpeople.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 56523773b8..b9afe10d84 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1663,7 +1663,7 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) model_index = 1; } - //Add to folder view + //Add to person tab model LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(model_index)); if(person_tab_model) { -- cgit v1.2.3 From c451672ee7e3bc8229a3e5cba544c93495147024 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 6 May 2013 14:22:46 -0700 Subject: ACME-338 Hide info button for FB only friends: Upon hover of FB only friends the info button and profile button are hidden. --- indra/newview/llpanelpeople.cpp | 16 ++++++++-------- indra/newview/llpersonfolderview.cpp | 19 +++++++++---------- indra/newview/llpersonfolderview.h | 16 ++++++++-------- indra/newview/llpersonmodelcommon.cpp | 5 +++-- indra/newview/llpersonmodelcommon.h | 10 +++++++++- indra/newview/llpersontabview.cpp | 20 +++++++++++++++----- indra/newview/llpersontabview.h | 8 +++++--- 7 files changed, 57 insertions(+), 37 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index b9afe10d84..f7492a51e1 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1641,7 +1641,7 @@ void LLPanelPeople::openFacebookWeb(std::string url) void LLPanelPeople::showFacebookFriends(const LLSD& friends) { mFacebookFriends->clear(); - S32 model_index; + LLPersonTabModel::tab_type tab_type; LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance(); for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) @@ -1655,16 +1655,16 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) //FB+SL but not SL friend if(agent_id.notNull() && !avatar_tracker.isBuddy(agent_id)) { - model_index = 0; + tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; } //FB only friend else { - model_index = 1; + tab_type = LLPersonTabModel::FB_ONLY_FRIEND; } //Add to person tab model - LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(model_index)); + LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(tab_type)); if(person_tab_model) { addParticipantToModel(person_tab_model, agent_id, name); @@ -1679,24 +1679,24 @@ void LLPanelPeople::addTestParticipant() LLPersonTabModel * person_tab_model; LLUUID agentID; std::string name; - S32 model_index; + LLPersonTabModel::tab_type tab_type; for(int i = 0; i < 300; ++i) { //Adds FB+SL people that aren't yet SL friends if(i < 10) { - model_index = 0; + tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; agentID = gAgent.getID(); } //Adds FB only friends else { - model_index = 1; + tab_type = LLPersonTabModel::FB_ONLY_FRIEND; agentID = LLUUID(NULL); } - person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(model_index)); + person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(tab_type)); name = prefix + " " + suffix; addParticipantToModel(person_tab_model, agentID, name); // Next suffix : Aa, Ab, Ac ... Az, Ba, Bb, Bc ... Bz, Ca, Cb ... diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index 191c7d5bcd..c22e4f3e58 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -30,7 +30,6 @@ #include "llpersonfolderview.h" #include "llpersontabview.h" -#include "llpersonmodelcommon.h" LLPersonFolderView::LLPersonFolderView(const Params &p) : @@ -76,14 +75,14 @@ BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) void LLPersonFolderView::createPersonTabs() { - createPersonTab("SL residents you may want to friend"); - createPersonTab("Invite people you know to SL"); + createPersonTab(LLPersonTabModel::FB_SL_NON_SL_FRIEND, "SL residents you may want to friend"); + createPersonTab(LLPersonTabModel::FB_ONLY_FRIEND, "Invite people you know to SL"); } -void LLPersonFolderView::createPersonTab(const std::string& tab_name) +void LLPersonFolderView::createPersonTab(LLPersonTabModel::tab_type tab_type, const std::string& tab_name) { //Create a person tab - LLPersonTabModel* item = new LLPersonTabModel(tab_name, *mViewModel); + LLPersonTabModel* item = new LLPersonTabModel(tab_type, tab_name, *mViewModel); LLPersonTabView::Params params; params.name = item->getDisplayName(); params.root = this; @@ -92,7 +91,7 @@ void LLPersonFolderView::createPersonTab(const std::string& tab_name) LLPersonTabView * widget = LLUICtrlFactory::create(params); widget->addToFolder(this); - mIndexToFolderVec.push_back(item->getID()); + mIndexToFolderMap[tab_type] = item->getID(); mPersonFolderModelMap[item->getID()] = item; mPersonFolderViewMap[item->getID()] = widget; } @@ -138,12 +137,12 @@ LLPersonView * LLPersonFolderView::createConversationViewParticipant(LLPersonMod return LLUICtrlFactory::create(params); } -LLPersonTabModel * LLPersonFolderView::getPersonTabModelByIndex(const S32 index) +LLPersonTabModel * LLPersonFolderView::getPersonTabModelByIndex(LLPersonTabModel::tab_type tab_type) { - return mPersonFolderModelMap[mIndexToFolderVec[index]]; + return mPersonFolderModelMap[mIndexToFolderMap[tab_type]]; } -LLPersonTabView * LLPersonFolderView::getPersonTabViewByIndex(const S32 index) +LLPersonTabView * LLPersonFolderView::getPersonTabViewByIndex(LLPersonTabModel::tab_type tab_type) { - return mPersonFolderViewMap[mIndexToFolderVec[index]]; + return mPersonFolderViewMap[mIndexToFolderMap[tab_type]]; } diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h index 3a15f59164..85dec6515d 100644 --- a/indra/newview/llpersonfolderview.h +++ b/indra/newview/llpersonfolderview.h @@ -27,7 +27,10 @@ #ifndef LL_LLPERSONFOLDERVIEW_H #define LL_LLPERSONFOLDERVIEW_H -class LLPersonTabModel; +#include "llevents.h" +#include "llfolderview.h" +#include "llpersonmodelcommon.h" + class LLPersonTabView; class LLPersonView; class LLPersonModel; @@ -35,9 +38,6 @@ class LLPersonModel; typedef std::map person_folder_model_map; typedef std::map person_folder_view_map; -#include "llevents.h" -#include "llfolderview.h" - class LLPersonFolderView : public LLFolderView { public: @@ -53,16 +53,16 @@ public: BOOL handleMouseDown( S32 x, S32 y, MASK mask ); void createPersonTabs(); - void createPersonTab(const std::string& tab_name); + void createPersonTab(LLPersonTabModel::tab_type tab_type, const std::string& tab_name); bool onConversationModelEvent(const LLSD &event); LLPersonView * createConversationViewParticipant(LLPersonModel * item); - LLPersonTabModel * getPersonTabModelByIndex(const S32 index); - LLPersonTabView * getPersonTabViewByIndex(const S32 index); + LLPersonTabModel * getPersonTabModelByIndex(LLPersonTabModel::tab_type tab_type); + LLPersonTabView * getPersonTabViewByIndex(LLPersonTabModel::tab_type tab_type); person_folder_model_map mPersonFolderModelMap; person_folder_view_map mPersonFolderViewMap; - std::vector mIndexToFolderVec; + std::map mIndexToFolderMap; LLEventStream mConversationsEventStream; }; diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp index 6b4c71faa2..70a24ac77a 100644 --- a/indra/newview/llpersonmodelcommon.cpp +++ b/indra/newview/llpersonmodelcommon.cpp @@ -132,8 +132,9 @@ bool LLPersonModelCommon::filter( LLFolderViewFilter& filter) // LLPersonTabModel // -LLPersonTabModel::LLPersonTabModel(std::string display_name, LLFolderViewModelInterface& root_view_model) : -LLPersonModelCommon(display_name,root_view_model) +LLPersonTabModel::LLPersonTabModel(tab_type tab_type, std::string display_name, LLFolderViewModelInterface& root_view_model) : +LLPersonModelCommon(display_name,root_view_model), +mTabType(tab_type) { } diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h index f44f619d18..7be3387564 100644 --- a/indra/newview/llpersonmodelcommon.h +++ b/indra/newview/llpersonmodelcommon.h @@ -108,7 +108,13 @@ protected: class LLPersonTabModel : public LLPersonModelCommon { public: - LLPersonTabModel(std::string display_name, LLFolderViewModelInterface& root_view_model); + enum tab_type + { + FB_SL_NON_SL_FRIEND, + FB_ONLY_FRIEND, + }; + + LLPersonTabModel(tab_type tab_type, std::string display_name, LLFolderViewModelInterface& root_view_model); LLPersonTabModel(LLFolderViewModelInterface& root_view_model); LLPointer getIcon() const { return NULL; } @@ -118,6 +124,8 @@ public: void clearParticipants(); LLPersonModel* findParticipant(const LLUUID& person_id); + tab_type mTabType; + private: }; diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index fdc024beb8..0dfd53705b 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -160,8 +160,10 @@ S32 LLPersonView::getLabelXPos() void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) { LLFolderViewItem::addToFolder(person_folder_view); - //Added item to folder, could change folder's mHasVisibleChildren flag so call arrange + //Added item to folder could change folder's mHasVisibleChildren flag so call arrange person_folder_view->requestArrange(); + + mPersonTabModel = static_cast(getParentFolder()->getViewModelItem()); } LLPersonView::~LLPersonView() @@ -191,16 +193,24 @@ BOOL LLPersonView::postBuild() void LLPersonView::onMouseEnter(S32 x, S32 y, MASK mask) { - mInfoBtn->setVisible(TRUE); - mProfileBtn->setVisible(TRUE); + if(mPersonTabModel->mTabType == LLPersonTabModel::FB_SL_NON_SL_FRIEND) + { + mInfoBtn->setVisible(TRUE); + mProfileBtn->setVisible(TRUE); + } + updateChildren(); LLFolderViewItem::onMouseEnter(x, y, mask); } void LLPersonView::onMouseLeave(S32 x, S32 y, MASK mask) { - mInfoBtn->setVisible(FALSE); - mProfileBtn->setVisible(FALSE); + if(mPersonTabModel->mTabType == LLPersonTabModel::FB_SL_NON_SL_FRIEND) + { + mInfoBtn->setVisible(FALSE); + mProfileBtn->setVisible(FALSE); + } + updateChildren(); LLFolderViewItem::onMouseLeave(x, y, mask); } diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index 9cce615167..9e5fdc3057 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -33,6 +33,8 @@ #include "lloutputmonitorctrl.h" #include "lltextbox.h" +class LLPersonTabModel; + class LLPersonTabView : public LLFolderViewFolder { @@ -104,9 +106,11 @@ protected: private: + //Short-cut to tab model + LLPersonTabModel * mPersonTabModel; + LLPointer mImageOver; LLPointer mImageSelected; - LLAvatarIconCtrl* mAvatarIcon; LLTextBox * mLastInteractionTimeTextbox; LLIconCtrl * mPermissionEditTheirsIcon; @@ -117,8 +121,6 @@ private: LLButton * mProfileBtn; LLOutputMonitorCtrl * mOutputMonitorCtrl; - - typedef enum e_avatar_item_child { ALIC_SPEAKER_INDICATOR, ALIC_PROFILE_BUTTON, -- cgit v1.2.3 From 04587bdb9d5e1653d5b19a6ca51e547180994958 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 6 May 2013 17:53:18 -0700 Subject: ACME-340 Get facebook icon from spec and add to viewer: Added a facebook icon and the icon appears only for the 'Invite people you know to SL' tab. --- indra/newview/llpersontabview.cpp | 33 +++++++++++++++++++-- indra/newview/llpersontabview.h | 2 ++ .../skins/default/textures/icons/Facebook.png | Bin 0 -> 365 bytes indra/newview/skins/default/textures/textures.xml | 2 ++ .../skins/default/xui/en/widgets/person_view.xml | 12 ++++++++ 5 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 indra/newview/skins/default/textures/icons/Facebook.png diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 0dfd53705b..6aa51febcb 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -125,6 +125,7 @@ bool LLPersonView::sChildrenWidthsInitialized = false; ChildWidthVec LLPersonView::mChildWidthVec; LLPersonView::Params::Params() : +facebook_icon("facebook_icon"), avatar_icon("avatar_icon"), last_interaction_time_textbox("last_interaction_time_textbox"), permission_edit_theirs_icon("permission_edit_theirs_icon"), @@ -140,6 +141,7 @@ LLPersonView::LLPersonView(const LLPersonView::Params& p) : LLFolderViewItem(p), mImageOver(LLUI::getUIImage("ListItem_Over")), mImageSelected(LLUI::getUIImage("ListItem_Select")), +mFacebookIcon(NULL), mAvatarIcon(NULL), mLastInteractionTimeTextbox(NULL), mPermissionEditTheirsIcon(NULL), @@ -154,7 +156,19 @@ mOutputMonitorCtrl(NULL) S32 LLPersonView::getLabelXPos() { - return getIndentation() + mAvatarIcon->getRect().getWidth() + mIconPad; + S32 label_x_pos; + + if(mAvatarIcon->getVisible()) + { + label_x_pos = getIndentation() + mAvatarIcon->getRect().getWidth() + mIconPad; + } + else + { + label_x_pos = getIndentation() + mFacebookIcon->getRect().getWidth() + mIconPad; + } + + + return label_x_pos; } void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) @@ -164,6 +178,16 @@ void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) person_folder_view->requestArrange(); mPersonTabModel = static_cast(getParentFolder()->getViewModelItem()); + + if(mPersonTabModel->mTabType == LLPersonTabModel::FB_SL_NON_SL_FRIEND) + { + mAvatarIcon->setVisible(TRUE); + } + else if(mPersonTabModel->mTabType == LLPersonTabModel::FB_ONLY_FRIEND) + { + mFacebookIcon->setVisible(TRUE); + } + } LLPersonView::~LLPersonView() @@ -295,11 +319,16 @@ void LLPersonView::drawHighlight() void LLPersonView::initFromParams(const LLPersonView::Params & params) { + LLIconCtrl::Params facebook_icon_params(params.facebook_icon()); + applyXUILayout(facebook_icon_params, this); + mFacebookIcon = LLUICtrlFactory::create(facebook_icon_params); + addChild(mFacebookIcon); + LLAvatarIconCtrl::Params avatar_icon_params(params.avatar_icon()); applyXUILayout(avatar_icon_params, this); mAvatarIcon = LLUICtrlFactory::create(avatar_icon_params); addChild(mAvatarIcon); - + LLTextBox::Params last_interaction_time_textbox(params.last_interaction_time_textbox()); applyXUILayout(last_interaction_time_textbox, this); mLastInteractionTimeTextbox = LLUICtrlFactory::create(last_interaction_time_textbox); diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index 9e5fdc3057..9839a1eaaf 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -77,6 +77,7 @@ public: struct Params : public LLInitParam::Block { Params(); + Optional facebook_icon; Optional avatar_icon; Optional last_interaction_time_textbox; Optional permission_edit_theirs_icon; @@ -111,6 +112,7 @@ private: LLPointer mImageOver; LLPointer mImageSelected; + LLIconCtrl * mFacebookIcon; LLAvatarIconCtrl* mAvatarIcon; LLTextBox * mLastInteractionTimeTextbox; LLIconCtrl * mPermissionEditTheirsIcon; diff --git a/indra/newview/skins/default/textures/icons/Facebook.png b/indra/newview/skins/default/textures/icons/Facebook.png new file mode 100644 index 0000000000..8287d56f88 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Facebook.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 5b17ef94db..18146943a5 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -199,6 +199,8 @@ with the same filename but different name + + diff --git a/indra/newview/skins/default/xui/en/widgets/person_view.xml b/indra/newview/skins/default/xui/en/widgets/person_view.xml index 4a39109f36..006437401c 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml @@ -13,6 +13,17 @@ text_pad_right="4" arrow_size="10" max_folder_item_overlap="2"> + Date: Mon, 6 May 2013 18:19:08 -0700 Subject: ACME-341 Hide the avatar icon and use the FB icon instead: Adjusted positioning of facebook icon to better match spec. --- indra/newview/skins/default/xui/en/widgets/person_view.xml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/indra/newview/skins/default/xui/en/widgets/person_view.xml b/indra/newview/skins/default/xui/en/widgets/person_view.xml index 006437401c..46c1b7ff75 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml @@ -14,16 +14,15 @@ arrow_size="10" max_folder_item_overlap="2"> + width="14" /> Date: Mon, 6 May 2013 18:31:27 -0700 Subject: ACME-275 : Fixed! Filtering on FB list works (tested with simulated data only so far) --- indra/llui/llfolderview.cpp | 5 ----- indra/llui/llfolderviewitem.cpp | 16 +--------------- indra/newview/llpersonmodelcommon.cpp | 28 ++++++++++++++++++++++++---- indra/newview/llpersonmodelcommon.h | 14 ++++++++------ 4 files changed, 33 insertions(+), 30 deletions(-) diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 679a76e26f..9cf822892e 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -1653,11 +1653,6 @@ void LLFolderView::update() BOOL is_visible = isInVisibleChain(); - if (getName() == "Persons") - { - llinfos << "Merov : update Persons, is_visible = " << is_visible << llendl; - } - // Puts folders/items in proper positions // arrange() takes the model filter flag into account and call sort() if necessary (CHUI-849) // It also handles the open/close folder animation diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 88bc0ccfd4..0c0c54c38c 100755 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -953,12 +953,6 @@ static LLFastTimer::DeclareTimer FTM_ARRANGE("Arrange"); // * Makes sure that this view and its children are the right size S32 LLFolderViewFolder::arrange( S32* width, S32* height ) { - llinfos << "Merov : LLFolderViewFolder::arrange, folder = " << getName() << llendl; - if (getName() == "Facebook Friends Tab Two") - { - llinfos << "Merov : Arranging Facebook Friends Tab Two, needs arrange = " << needsArrange() << ", is open = " << isOpen() << llendl; - } - // Sort before laying out contents // Note that we sort from the root (CHUI-849) getRoot()->getFolderViewModel()->sort(this); @@ -1115,11 +1109,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height ) BOOL LLFolderViewFolder::needsArrange() { - if (getName() != "") - { - llinfos << "Merov : needsArrange for " << getName() << ", last = " << mLastArrangeGeneration << ", current = " << getRoot()->getArrangeGeneration() << ", need = " << (mLastArrangeGeneration < getRoot()->getArrangeGeneration() ? "true" : "false") << llendl; - } - return mLastArrangeGeneration != getRoot()->getArrangeGeneration(); + return mLastArrangeGeneration < getRoot()->getArrangeGeneration(); } // Passes selection information on to children and record selection @@ -1641,10 +1631,6 @@ void LLFolderViewFolder::requestArrange() void LLFolderViewFolder::toggleOpen() { - if (getName() == "Facebook Friends Tab Two") - { - llinfos << "Merov : toggleOpen, currently open is = " << isOpen() << llendl; - } setOpen(!isOpen()); } diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp index 6b4c71faa2..9fefc17345 100644 --- a/indra/newview/llpersonmodelcommon.cpp +++ b/indra/newview/llpersonmodelcommon.cpp @@ -48,6 +48,7 @@ LLPersonModelCommon::LLPersonModelCommon(LLFolderViewModelInterface& root_view_m LLFolderViewModelItemCommon(root_view_model), mName(""), mSearchableName(""), + mPrevPassedAllFilters(false), mID(LLUUID().generateNewID()) { } @@ -103,11 +104,11 @@ bool LLPersonModelCommon::filter( LLFolderViewFilter& filter) llinfos << "Merov : LLPersonModelCommon::filter, exit, no modif" << llendl; return true; } -*/ + */ if (!mChildren.empty()) { // If the current instance has children, it's a "person folder" and always passes filters (we do not filter out empty folders) - setPassedFilter(1, -1); + setPassedFilter(1, filter.getCurrentGeneration()); // Call filter recursively on all children for (child_list_t::iterator iter = mChildren.begin(), end_iter = mChildren.end(); iter != end_iter; @@ -121,13 +122,31 @@ bool LLPersonModelCommon::filter( LLFolderViewFilter& filter) { // If there's no children, the current instance is a person and we check and set the passed filter flag on it const bool passed_filter = filter.check(this); - setPassedFilter(passed_filter, -1, filter.getStringMatchOffset(this), filter.getFilterStringSize()); + setPassedFilter(passed_filter, filter.getCurrentGeneration(), filter.getStringMatchOffset(this), filter.getFilterStringSize()); } filter.clearModified(); return true; } +void LLPersonModelCommon::setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset, std::string::size_type string_size) +{ + LLFolderViewModelItemCommon::setPassedFilter(passed, filter_generation, string_offset, string_size); + bool before = mPrevPassedAllFilters; + mPrevPassedAllFilters = passedFilter(filter_generation); + + if (before != mPrevPassedAllFilters) + { + // Need to rearrange the folder if the filtered state of the item changed + LLFolderViewFolder* parent_folder = mFolderViewItem->getParentFolder(); + if (parent_folder) + { + parent_folder->requestArrange(); + } + } +} + + // // LLPersonTabModel // @@ -217,7 +236,8 @@ LLPersonViewFilter::LLPersonViewFilter() : mEmptyLookupMessage(""), mFilterSubString(""), mName(""), - mFilterModified(FILTER_NONE) + mFilterModified(FILTER_NONE), + mCurrentGeneration(0) { } diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h index f44f619d18..1b8197cf6a 100644 --- a/indra/newview/llpersonmodelcommon.h +++ b/indra/newview/llpersonmodelcommon.h @@ -75,7 +75,7 @@ public: virtual bool filter( LLFolderViewFilter& filter); virtual bool descendantsPassedFilter(S32 filter_generation = -1) { return true; } -// virtual void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) { } + virtual void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0); virtual bool passedFilter(S32 filter_generation = -1) { return mPassedFilter; } // The action callbacks @@ -102,6 +102,7 @@ protected: std::string mName; // Name of the person std::string mSearchableName; // Name used in string matching for this person + bool mPrevPassedAllFilters; LLUUID mID; }; @@ -172,7 +173,7 @@ public: void clearModified(); const std::string& getName() const { return mName; } const std::string& getFilterText() { return mName; } - void setModified(EFilterModified behavior = FILTER_RESTART) { mFilterModified = behavior; } + void setModified(EFilterModified behavior = FILTER_RESTART) { mFilterModified = behavior; mCurrentGeneration++; } // +-------------------------------------------------------------------+ // + Time @@ -193,10 +194,10 @@ public: // +-------------------------------------------------------------------+ // + Generation // +-------------------------------------------------------------------+ - // Note : unclear if we have to take tab on generation at that point - S32 getCurrentGeneration() const { return 0; } - S32 getFirstSuccessGeneration() const { return 0; } - S32 getFirstRequiredGeneration() const { return 0; } + // Note : For the moment, we do not support restrictive filtering so all generation indexes are pointing to the current generation + S32 getCurrentGeneration() const { return mCurrentGeneration; } + S32 getFirstSuccessGeneration() const { return mCurrentGeneration; } + S32 getFirstRequiredGeneration() const { return mCurrentGeneration; } // Non Virtual Methods (i.e. specific to this class) void setFilterSubString(const std::string& string); @@ -206,6 +207,7 @@ private: std::string mEmptyLookupMessage; std::string mFilterSubString; EFilterModified mFilterModified; + S32 mCurrentGeneration; }; class LLPersonViewSort -- cgit v1.2.3 From 54de882b81083298009e3b4a3d74fa1c7255068d Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 7 May 2013 13:47:18 -0700 Subject: ACME-343 : Add Connect to Facebook menu item --- indra/newview/skins/default/xui/en/menu_viewer.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 39e777b246..9ce360415c 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -15,6 +15,13 @@ function="ShowAgentProfile" parameter="agent" /> + + + + -- cgit v1.2.3 From dbfcd6c9c5709b74365c2538ba312685b09d22bf Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 7 May 2013 17:20:33 -0500 Subject: Optimization -- don't draw glow in alpha pool unless needed --- indra/llmath/llvolume.cpp | 6 +++- indra/llprimitive/llmodel.cpp | 37 +++++++++++++++++++ indra/llprimitive/llmodel.h | 4 ++- indra/newview/lldrawpoolalpha.cpp | 3 +- indra/newview/llspatialpartition.cpp | 3 +- indra/newview/llspatialpartition.h | 5 +-- indra/newview/llviewerpartsim.cpp | 2 +- indra/newview/llviewerpartsource.cpp | 2 +- indra/newview/llvopartgroup.cpp | 70 ++++++++++++++++++++++++------------ 9 files changed, 101 insertions(+), 31 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 602f2c29e5..7751ef87ee 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -4520,7 +4520,11 @@ LLVolumeFace& LLVolumeFace::operator=(const LLVolumeFace& src) S32 tc_size = (mNumVertices*sizeof(LLVector2)+0xF) & ~0xF; LLVector4a::memcpyNonAliased16((F32*) mPositions, (F32*) src.mPositions, vert_size); - LLVector4a::memcpyNonAliased16((F32*) mNormals, (F32*) src.mNormals, vert_size); + + if (src.mNormals) + { + LLVector4a::memcpyNonAliased16((F32*) mNormals, (F32*) src.mNormals, vert_size); + } if(src.mTexCoords) { diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index ef6eb75a6b..e236f98fe6 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -1122,6 +1122,43 @@ void LLModel::getNormalizedScaleTranslation(LLVector3& scale_out, LLVector3& tra translation_out = mNormalizedTranslation; } +LLVector3 LLModel::getTransformedCenter(const LLMatrix4& mat) +{ + LLVector3 ret; + + if (!mVolumeFaces.empty()) + { + LLMatrix4a m; + m.loadu(mat); + + LLVector4a minv,maxv; + + LLVector4a t; + m.affineTransform(mVolumeFaces[0].mPositions[0], t); + minv = maxv = t; + + for (S32 i = 0; i < mVolumeFaces.size(); ++i) + { + LLVolumeFace& face = mVolumeFaces[i]; + + for (U32 j = 0; j < face.mNumVertices; ++j) + { + m.affineTransform(face.mPositions[j],t); + update_min_max(minv, maxv, t); + } + } + + minv.add(maxv); + minv.mul(0.5f); + + ret.set(minv.getF32ptr()); + } + + return ret; +} + + + void LLModel::setNumVolumeFaces(S32 count) { mVolumeFaces.resize(count); diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index 1cf528fd9f..aaafc55258 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -173,13 +173,15 @@ public: void optimizeVolumeFaces(); void offsetMesh( const LLVector3& pivotPoint ); void getNormalizedScaleTranslation(LLVector3& scale_out, LLVector3& translation_out); - + LLVector3 getTransformedCenter(const LLMatrix4& mat); + //reorder face list based on mMaterialList in this and reference so //order matches that of reference (material ordering touchup) bool matchMaterialOrder(LLModel* ref, int& refFaceCnt, int& modelFaceCnt ); bool isMaterialListSubset( LLModel* ref ); bool needToAddFaces( LLModel* ref, int& refFaceCnt, int& modelFaceCnt ); + std::vector mMaterialList; //data used for skin weights diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 6fa16825df..331744acb7 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -515,7 +515,8 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) // If this alpha mesh has glow, then draw it a second time to add the destination-alpha (=glow). Interleaving these state-changing calls could be expensive, but glow must be drawn Z-sorted with alpha. if (current_shader && draw_glow_for_this_partition && - params.mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_EMISSIVE)) + params.mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_EMISSIVE) && + (!params.mParticle || params.mHasGlow)) { static LLFastTimer::DeclareTimer FTM_RENDER_ALPHA_GLOW("Alpha Glow"); LLFastTimer t(FTM_RENDER_ALPHA_GLOW); diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 1ec56eb5f8..2a1d0d223c 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -4656,7 +4656,8 @@ LLDrawInfo::LLDrawInfo(U16 start, U16 end, U32 count, U32 offset, mDistance(0.f), mDrawMode(LLRender::TRIANGLES), mBlendFuncSrc(LLRender::BF_SOURCE_ALPHA), - mBlendFuncDst(LLRender::BF_ONE_MINUS_SOURCE_ALPHA) + mBlendFuncDst(LLRender::BF_ONE_MINUS_SOURCE_ALPHA), + mHasGlow(FALSE) { mVertexBuffer->validateRange(mStart, mEnd, mCount, mOffset); diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 08e77855c4..e9be93ce98 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -70,12 +70,12 @@ protected: public: void* operator new(size_t size) { - return ll_aligned_malloc_16(size); + return ll_aligned_malloc(size,64); } void operator delete(void* ptr) { - ll_aligned_free_16(ptr); + ll_aligned_free(ptr); } @@ -121,6 +121,7 @@ public: U32 mDrawMode; U32 mBlendFuncSrc; U32 mBlendFuncDst; + BOOL mHasGlow; struct CompareTexture { diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index 21f1d2619c..96cd43a8ab 100644 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -387,7 +387,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) } // Do glow interpolation - part->mGlow.mV[3] = (U8) (lerp(part->mStartGlow, part->mEndGlow, frac)*255.f); + part->mGlow.mV[3] = (U8) llround(lerp(part->mStartGlow, part->mEndGlow, frac)*255.f); // Set the last update time to now. part->mLastUpdateTime = cur_time; diff --git a/indra/newview/llviewerpartsource.cpp b/indra/newview/llviewerpartsource.cpp index 8c49ce646d..b6bbd6140d 100644 --- a/indra/newview/llviewerpartsource.cpp +++ b/indra/newview/llviewerpartsource.cpp @@ -313,7 +313,7 @@ void LLViewerPartSourceScript::update(const F32 dt) part->mStartGlow = mPartSysData.mPartData.mStartGlow; part->mEndGlow = mPartSysData.mPartData.mEndGlow; - part->mGlow = LLColor4U(0, 0, 0, (U8) (part->mStartGlow*255.f)); + part->mGlow = LLColor4U(0, 0, 0, (U8) llround(part->mStartGlow*255.f)); if (mPartSysData.mPattern & LLPartSysData::LL_PART_SRC_PATTERN_DROP) { diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index 53d67347d1..e5e627c1ea 100644 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -273,6 +273,10 @@ void LLVOPartGroup::getBlendFunc(S32 idx, U32& src, U32& dst) src = part->mBlendFuncSource; dst = part->mBlendFuncDest; } + else + { + llerrs << "WTF?" << llendl; + } } LLVector3 LLVOPartGroup::getCameraPosition() const @@ -670,7 +674,7 @@ void LLVOPartGroup::getGeometry(S32 idx, } else { - pglow = LLColor4U(0, 0, 0, (U8) (255.f*part.mStartGlow)); + pglow = LLColor4U(0, 0, 0, (U8) llround(255.f*part.mStartGlow)); pcolor = part.mStartColor; } } @@ -685,10 +689,13 @@ void LLVOPartGroup::getGeometry(S32 idx, *colorsp++ = color; *colorsp++ = color; - *emissivep++ = pglow; - *emissivep++ = pglow; - *emissivep++ = part.mGlow; - *emissivep++ = part.mGlow; + //if (pglow.mV[3] || part.mGlow.mV[3]) + { //only write glow if it is not zero + *emissivep++ = pglow; + *emissivep++ = pglow; + *emissivep++ = part.mGlow; + *emissivep++ = part.mGlow; + } if (!(part.mFlags & LLPartData::LL_PART_EMISSIVE_MASK)) @@ -873,8 +880,17 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) LLStrider cur_col = colorsp + geom_idx; LLStrider cur_glow = emissivep + geom_idx; + LLColor4U* start_glow = cur_glow.get(); + object->getGeometry(facep->getTEOffset(), cur_vert, cur_norm, cur_tc, cur_col, cur_glow, cur_idx); + BOOL has_glow = FALSE; + + if (cur_glow.get() != start_glow) + { + has_glow = TRUE; + } + llassert(facep->getGeomCount() == 4); llassert(facep->getIndicesCount() == 6); @@ -894,26 +910,32 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) object->getBlendFunc(facep->getTEOffset(), bf_src, bf_dst); - if (idx >= 0 && - draw_vec[idx]->mTexture == facep->getTexture() && - draw_vec[idx]->mFullbright == fullbright && - draw_vec[idx]->mBlendFuncDst == bf_dst && - draw_vec[idx]->mBlendFuncSrc == bf_src) + + if (idx >= 0) { - if (draw_vec[idx]->mEnd == facep->getGeomIndex()-1) - { - batched = true; - draw_vec[idx]->mCount += facep->getIndicesCount(); - draw_vec[idx]->mEnd += facep->getGeomCount(); - draw_vec[idx]->mVSize = llmax(draw_vec[idx]->mVSize, vsize); - } - else if (draw_vec[idx]->mStart == facep->getGeomIndex()+facep->getGeomCount()+1) + LLDrawInfo* info = draw_vec[idx]; + + if (info->mTexture == facep->getTexture() && + info->mHasGlow == has_glow && + info->mFullbright == fullbright && + info->mBlendFuncDst == bf_dst && + info->mBlendFuncSrc == bf_src) { - batched = true; - draw_vec[idx]->mCount += facep->getIndicesCount(); - draw_vec[idx]->mStart -= facep->getGeomCount(); - draw_vec[idx]->mOffset = facep->getIndicesStart(); - draw_vec[idx]->mVSize = llmax(draw_vec[idx]->mVSize, vsize); + if (draw_vec[idx]->mEnd == facep->getGeomIndex()-1) + { + batched = true; + info->mCount += facep->getIndicesCount(); + info->mEnd += facep->getGeomCount(); + info->mVSize = llmax(draw_vec[idx]->mVSize, vsize); + } + else if (draw_vec[idx]->mStart == facep->getGeomIndex()+facep->getGeomCount()+1) + { + batched = true; + info->mCount += facep->getIndicesCount(); + info->mStart -= facep->getGeomCount(); + info->mOffset = facep->getIndicesStart(); + info->mVSize = llmax(draw_vec[idx]->mVSize, vsize); + } } } @@ -932,6 +954,8 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) info->mVSize = vsize; info->mBlendFuncDst = bf_dst; info->mBlendFuncSrc = bf_src; + info->mHasGlow = has_glow; + info->mParticle = TRUE; draw_vec.push_back(info); //for alpha sorting facep->setDrawInfo(info); -- cgit v1.2.3 From 3a351c4ee548e2bce8ad0d5935377a090591621f Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Wed, 8 May 2013 05:51:28 +0000 Subject: Adding follow_redirects parameter to LLHTTPClient get/head variants. Not following redirects for facebook connect requests. --- indra/llmessage/llhttpclient.cpp | 35 +++++++++++++++++++------------- indra/llmessage/llhttpclient.h | 19 +++++++++++------ indra/llmessage/llurlrequest.cpp | 21 +++++++++++++------ indra/llmessage/llurlrequest.h | 9 ++++---- indra/newview/llpanelpeople.cpp | 15 +++++++++++--- indra/newview/tests/lltranslate_test.cpp | 4 ++-- 6 files changed, 68 insertions(+), 35 deletions(-) diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp index 3561459bb4..2d16237161 100755 --- a/indra/llmessage/llhttpclient.cpp +++ b/indra/llmessage/llhttpclient.cpp @@ -217,7 +217,8 @@ static void request( Injector* body_injector, LLCurl::ResponderPtr responder, const F32 timeout = HTTP_REQUEST_EXPIRY_SECS, - const LLSD& headers = LLSD() + const LLSD& headers = LLSD(), + bool follow_redirects = true ) { if (!LLHTTPClient::hasPump()) @@ -231,7 +232,7 @@ static void request( } LLPumpIO::chain_t chain; - LLURLRequest* req = new LLURLRequest(method, url); + LLURLRequest* req = new LLURLRequest(method, url, follow_redirects); if(!req->isValid())//failed { if (responder) @@ -334,7 +335,8 @@ void LLHTTPClient::getByteRange( S32 bytes, ResponderPtr responder, const LLSD& hdrs, - const F32 timeout) + const F32 timeout, + bool follow_redirects /* = true */) { LLSD headers = hdrs; if(offset > 0 || bytes > 0) @@ -342,37 +344,42 @@ void LLHTTPClient::getByteRange( std::string range = llformat("bytes=%d-%d", offset, offset+bytes-1); headers["Range"] = range; } - request(url,LLURLRequest::HTTP_GET, NULL, responder, timeout, headers); + request(url,LLURLRequest::HTTP_GET, NULL, responder, timeout, headers, follow_redirects); } void LLHTTPClient::head( const std::string& url, ResponderPtr responder, const LLSD& headers, - const F32 timeout) + const F32 timeout, + bool follow_redirects /* = true */) { - request(url, LLURLRequest::HTTP_HEAD, NULL, responder, timeout, headers); + request(url, LLURLRequest::HTTP_HEAD, NULL, responder, timeout, headers, follow_redirects); } -void LLHTTPClient::get(const std::string& url, ResponderPtr responder, const LLSD& headers, const F32 timeout) +void LLHTTPClient::get(const std::string& url, ResponderPtr responder, const LLSD& headers, const F32 timeout, + bool follow_redirects /* = true */) { - request(url, LLURLRequest::HTTP_GET, NULL, responder, timeout, headers); + request(url, LLURLRequest::HTTP_GET, NULL, responder, timeout, headers, follow_redirects); } -void LLHTTPClient::getHeaderOnly(const std::string& url, ResponderPtr responder, const LLSD& headers, const F32 timeout) +void LLHTTPClient::getHeaderOnly(const std::string& url, ResponderPtr responder, const LLSD& headers, + const F32 timeout, bool follow_redirects /* = true */) { - request(url, LLURLRequest::HTTP_HEAD, NULL, responder, timeout, headers); + request(url, LLURLRequest::HTTP_HEAD, NULL, responder, timeout, headers, follow_redirects); } -void LLHTTPClient::getHeaderOnly(const std::string& url, ResponderPtr responder, const F32 timeout) +void LLHTTPClient::getHeaderOnly(const std::string& url, ResponderPtr responder, const F32 timeout, + bool follow_redirects /* = true */) { - getHeaderOnly(url, responder, LLSD(), timeout); + getHeaderOnly(url, responder, LLSD(), timeout, follow_redirects); } -void LLHTTPClient::get(const std::string& url, const LLSD& query, ResponderPtr responder, const LLSD& headers, const F32 timeout) +void LLHTTPClient::get(const std::string& url, const LLSD& query, ResponderPtr responder, const LLSD& headers, + const F32 timeout, bool follow_redirects /* = true */) { LLURI uri; uri = LLURI::buildHTTP(url, LLSD::emptyArray(), query); - get(uri.asString(), responder, headers, timeout); + get(uri.asString(), responder, headers, timeout, follow_redirects); } // A simple class for managing data returned from a curl http request. diff --git a/indra/llmessage/llhttpclient.h b/indra/llmessage/llhttpclient.h index a7236ba169..5de257a4f6 100644 --- a/indra/llmessage/llhttpclient.h +++ b/indra/llmessage/llhttpclient.h @@ -63,10 +63,15 @@ public: const std::string& url, ResponderPtr, const LLSD& headers = LLSD(), - const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); - static void getByteRange(const std::string& url, S32 offset, S32 bytes, ResponderPtr, const LLSD& headers=LLSD(), const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); - static void get(const std::string& url, ResponderPtr, const LLSD& headers = LLSD(), const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); - static void get(const std::string& url, const LLSD& query, ResponderPtr, const LLSD& headers = LLSD(), const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); + const F32 timeout=HTTP_REQUEST_EXPIRY_SECS, + bool follow_redirects = true); + static void getByteRange(const std::string& url, S32 offset, S32 bytes, ResponderPtr, + const LLSD& headers=LLSD(), const F32 timeout=HTTP_REQUEST_EXPIRY_SECS, + bool follow_redirects = true); + static void get(const std::string& url, ResponderPtr, const LLSD& headers = LLSD(), + const F32 timeout=HTTP_REQUEST_EXPIRY_SECS, bool follow_redirects = true); + static void get(const std::string& url, const LLSD& query, ResponderPtr, const LLSD& headers = LLSD(), + const F32 timeout=HTTP_REQUEST_EXPIRY_SECS, bool follow_redirects = true); static void put( const std::string& url, @@ -74,8 +79,10 @@ public: ResponderPtr, const LLSD& headers = LLSD(), const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); - static void getHeaderOnly(const std::string& url, ResponderPtr, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); - static void getHeaderOnly(const std::string& url, ResponderPtr, const LLSD& headers, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); + static void getHeaderOnly(const std::string& url, ResponderPtr, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS, + bool follow_redirects = true); + static void getHeaderOnly(const std::string& url, ResponderPtr, const LLSD& headers, + const F32 timeout=HTTP_REQUEST_EXPIRY_SECS, bool follow_redirects = true); static void post( const std::string& url, diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp index 627d591839..49f8144ee7 100644 --- a/indra/llmessage/llurlrequest.cpp +++ b/indra/llmessage/llurlrequest.cpp @@ -150,16 +150,19 @@ std::string LLURLRequest::actionAsVerb(LLURLRequest::ERequestAction action) return VERBS[action]; } -LLURLRequest::LLURLRequest(LLURLRequest::ERequestAction action) : - mAction(action) +LLURLRequest::LLURLRequest(LLURLRequest::ERequestAction action, bool follow_redirects /* = true */) : + mAction(action), + mFollowRedirects(follow_redirects) { initialize(); } LLURLRequest::LLURLRequest( LLURLRequest::ERequestAction action, - const std::string& url) : - mAction(action) + const std::string& url, + bool follow_redirects /* = true */) : + mAction(action), + mFollowRedirects(follow_redirects) { initialize(); setURL(url); @@ -479,12 +482,18 @@ bool LLURLRequest::configure() case HTTP_HEAD: mDetail->mCurlRequest->setopt(CURLOPT_HEADER, 1); mDetail->mCurlRequest->setopt(CURLOPT_NOBODY, 1); - mDetail->mCurlRequest->setopt(CURLOPT_FOLLOWLOCATION, 1); + if (mFollowRedirects) + { + mDetail->mCurlRequest->setopt(CURLOPT_FOLLOWLOCATION, 1); + } rv = true; break; case HTTP_GET: mDetail->mCurlRequest->setopt(CURLOPT_HTTPGET, 1); - mDetail->mCurlRequest->setopt(CURLOPT_FOLLOWLOCATION, 1); + if (mFollowRedirects) + { + mDetail->mCurlRequest->setopt(CURLOPT_FOLLOWLOCATION, 1); + } // Set Accept-Encoding to allow response compression mDetail->mCurlRequest->setoptString(CURLOPT_ENCODING, ""); diff --git a/indra/llmessage/llurlrequest.h b/indra/llmessage/llurlrequest.h index 44d358d906..20d6e30d17 100644 --- a/indra/llmessage/llurlrequest.h +++ b/indra/llmessage/llurlrequest.h @@ -95,7 +95,7 @@ public: * * @param action One of the ERequestAction enumerations. */ - LLURLRequest(ERequestAction action); + LLURLRequest(ERequestAction action, bool follow_redirects = true); /** * @brief Constructor. @@ -103,7 +103,7 @@ public: * @param action One of the ERequestAction enumerations. * @param url The url of the request. It should already be encoded. */ - LLURLRequest(ERequestAction action, const std::string& url); + LLURLRequest(ERequestAction action, const std::string& url, bool follow_redirects = true); /** * @brief Destructor. @@ -219,10 +219,11 @@ protected: }; EState mState; ERequestAction mAction; + bool mFollowRedirects; LLURLRequestDetail* mDetail; LLIOPipe::ptr_t mCompletionCallback; - S32 mRequestTransferedBytes; - S32 mResponseTransferedBytes; + S32 mRequestTransferedBytes; + S32 mResponseTransferedBytes; static CURLcode _sslCtxCallback(CURL * curl, void *sslctx, void *param); diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index af9ecd743c..479e503ef0 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1854,14 +1854,20 @@ public: void LLPanelPeople::loadFacebookFriends() { - LLHTTPClient::get(getFacebookConnectURL("/friend"), new FacebookFriendsResponder(this)); + const bool follow_redirects=false; + const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; + LLHTTPClient::get(getFacebookConnectURL("/friend"), new FacebookFriendsResponder(this), + LLSD(), timeout, follow_redirects); } void LLPanelPeople::tryToReconnectToFacebook() { if (!mConnectedToFbc) { - LLHTTPClient::get(getFacebookConnectURL("/connection"), new FacebookConnectedResponder(this, false)); + const bool follow_redirects=false; + const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; + LLHTTPClient::get(getFacebookConnectURL("/connection"), new FacebookConnectedResponder(this, false), + LLSD(), timeout, follow_redirects); } } @@ -1895,7 +1901,10 @@ void LLPanelPeople::onLoginFbcButtonClicked() } else { - LLHTTPClient::get(getFacebookConnectURL("/connection"), new FacebookConnectedResponder(this, true)); + const bool follow_redirects=false; + const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; + LLHTTPClient::get(getFacebookConnectURL("/connection"), new FacebookConnectedResponder(this, true), + LLSD(), timeout, follow_redirects); } } diff --git a/indra/newview/tests/lltranslate_test.cpp b/indra/newview/tests/lltranslate_test.cpp index fd9527d631..8ce56326d8 100644 --- a/indra/newview/tests/lltranslate_test.cpp +++ b/indra/newview/tests/lltranslate_test.cpp @@ -308,8 +308,8 @@ void LLCurl::Responder::errorWithContent(U32, std::string const&, LLSD const&) { void LLCurl::Responder::result(LLSD const&) {} LLCurl::Responder::~Responder() {} -void LLHTTPClient::get(const std::string&, const LLSD&, ResponderPtr, const LLSD&, const F32) {} -void LLHTTPClient::get(const std::string&, LLPointer, const LLSD&, const F32) {} +void LLHTTPClient::get(const std::string&, const LLSD&, ResponderPtr, const LLSD&, const F32, bool) {} +void LLHTTPClient::get(const std::string&, LLPointer, const LLSD&, const F32, bool) {} LLBufferStream::LLBufferStream(const LLChannelDescriptors& channels, LLBufferArray* buffer) : std::iostream(&mStreamBuf), mStreamBuf(channels, buffer) {} -- cgit v1.2.3 From 7d6e3945204c05efe85eadf8a6635d0ca30e9186 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 8 May 2013 19:17:47 +0100 Subject: temporary hack for fb demo to use https://pdp15.lindenlab.com instead of going through cap server --- indra/newview/llpanelpeople.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 479e503ef0..9956888134 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1887,7 +1887,8 @@ void LLPanelPeople::disconnectFromFacebook() std::string LLPanelPeople::getFacebookConnectURL(const std::string& route) { - static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); + //static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); + static std::string sFacebookConnectUrl = "https://pdp15.lindenlab.com/fbc/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho std::string url = sFacebookConnectUrl + route; llinfos << url << llendl; return url; -- cgit v1.2.3 From 2d65482d7152b613409a071e0a117d38f350932a Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Wed, 8 May 2013 15:26:45 -0700 Subject: ACME-342 Format the PersonView so that it shows the avatar icon, SL name, FB icon, and FB name: Adjusted personview/personmodel contain a suffix which is the FB username for SL+FB users --- indra/newview/llpanelpeople.cpp | 15 ++++++++++----- indra/newview/llpersonmodelcommon.cpp | 14 ++++++++++++-- indra/newview/llpersonmodelcommon.h | 6 ++++-- indra/newview/llpersontabview.cpp | 23 ++++++++++++++++++++++- indra/newview/llpersontabview.h | 1 + 5 files changed, 49 insertions(+), 10 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 9956888134..07a1c46256 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -732,6 +732,7 @@ BOOL LLPanelPeople::postBuild() folder_view_params.view_model = &mPersonFolderViewModel; folder_view_params.root = NULL; folder_view_params.use_ellipses = false; + folder_view_params.use_label_suffix = true; folder_view_params.options_menu = "menu_conversation.xml"; folder_view_params.name = "fbcfolderview"; mPersonFolderView = LLUICtrlFactory::create(folder_view_params); @@ -1676,7 +1677,7 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) void LLPanelPeople::addTestParticipant() { std::string suffix("Aa"); - std::string prefix("Test Name"); + std::string prefix("Second Life User Name Goes Here"); LLPersonTabModel * person_tab_model; LLUUID agentID; std::string name; @@ -1717,11 +1718,15 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model LLPersonModel* person_model = NULL; LLAvatarName avatar_name; - bool avatar_name_exists = LLAvatarNameCache::get(agent_id, &avatar_name); - - std::string aggregated_name = avatar_name_exists ? name + " (" + avatar_name.getDisplayName() + ") " : name; + bool has_name = LLAvatarNameCache::get(agent_id, &avatar_name); + std::string avatar_name_string; + + if(has_name) + { + avatar_name_string = avatar_name.getDisplayName(); + } - person_model = new LLPersonModel(agent_id, aggregated_name, mPersonFolderViewModel); + person_model = new LLPersonModel(agent_id, name, avatar_name_string, mPersonFolderViewModel); person_folder_model->addParticipant(person_model); } diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp index b3424cc451..e48eddf05a 100644 --- a/indra/newview/llpersonmodelcommon.cpp +++ b/indra/newview/llpersonmodelcommon.cpp @@ -39,14 +39,24 @@ LLPersonModelCommon::LLPersonModelCommon(std::string display_name, LLFolderViewModelInterface& root_view_model) : LLFolderViewModelItemCommon(root_view_model), + mLabelSuffix(""), mID(LLUUID().generateNewID()) { renameItem(display_name); } +LLPersonModelCommon::LLPersonModelCommon(std::string display_name, std::string suffix, LLFolderViewModelInterface& root_view_model) : +LLFolderViewModelItemCommon(root_view_model), + mID(LLUUID().generateNewID()) +{ + mLabelSuffix = suffix; + renameItem(display_name); +} + LLPersonModelCommon::LLPersonModelCommon(LLFolderViewModelInterface& root_view_model) : LLFolderViewModelItemCommon(root_view_model), mName(""), + mLabelSuffix(""), mSearchableName(""), mPrevPassedAllFilters(false), mID(LLUUID().generateNewID()) @@ -212,8 +222,8 @@ LLPersonModel* LLPersonTabModel::findParticipant(const LLUUID& person_id) // LLPersonModel // -LLPersonModel::LLPersonModel(const LLUUID& agent_id, const std::string display_name, LLFolderViewModelInterface& root_view_model) : -LLPersonModelCommon(display_name,root_view_model), +LLPersonModel::LLPersonModel(const LLUUID& agent_id, const std::string display_name, const std::string suffix, LLFolderViewModelInterface& root_view_model) : +LLPersonModelCommon(display_name, suffix, root_view_model), mAgentID(agent_id) { } diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h index 5f3801874d..74598eaee0 100644 --- a/indra/newview/llpersonmodelcommon.h +++ b/indra/newview/llpersonmodelcommon.h @@ -40,6 +40,7 @@ class LLPersonModelCommon : public LLFolderViewModelItemCommon public: LLPersonModelCommon(std::string name, LLFolderViewModelInterface& root_view_model); + LLPersonModelCommon(std::string display_name, std::string suffix, LLFolderViewModelInterface& root_view_model); LLPersonModelCommon(LLFolderViewModelInterface& root_view_model); virtual ~LLPersonModelCommon(); @@ -51,7 +52,7 @@ public: virtual LLPointer getIcon() const { return NULL; } virtual LLPointer getOpenIcon() const { return getIcon(); } virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; } - virtual std::string getLabelSuffix() const { return LLStringUtil::null; } + virtual std::string getLabelSuffix() const { return mLabelSuffix; } virtual BOOL isItemRenameable() const { return TRUE; } virtual BOOL renameItem(const std::string& new_name); virtual BOOL isItemMovable( void ) const { return FALSE; } @@ -101,6 +102,7 @@ public: protected: std::string mName; // Name of the person + std::string mLabelSuffix; std::string mSearchableName; // Name used in string matching for this person bool mPrevPassedAllFilters; LLUUID mID; @@ -133,7 +135,7 @@ private: class LLPersonModel : public LLPersonModelCommon { public: - LLPersonModel(const LLUUID& agent_id, const std::string display_name, LLFolderViewModelInterface& root_view_model); + LLPersonModel(const LLUUID& agent_id, const std::string display_name, const std::string suffix, LLFolderViewModelInterface& root_view_model); LLPersonModel(LLFolderViewModelInterface& root_view_model); LLUUID getAgentID(); diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 6aa51febcb..16ebb6af90 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -182,6 +182,7 @@ void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) if(mPersonTabModel->mTabType == LLPersonTabModel::FB_SL_NON_SL_FRIEND) { mAvatarIcon->setVisible(TRUE); + mFacebookIcon->setVisible(TRUE); } else if(mPersonTabModel->mTabType == LLPersonTabModel::FB_ONLY_FRIEND) { @@ -286,7 +287,20 @@ void LLPersonView::draw() F32 right_x = 0; drawHighlight(); - drawLabel(font, text_left, y, color, right_x); + drawLabel(mLabel, font, text_left, y, color, right_x); + + if(mLabelSuffix.length()) + { + LLRect mFacebookIconRect = mFacebookIcon->getRect(); + S32 new_left = right_x + 7; + mFacebookIconRect.set(new_left, + mFacebookIconRect.mTop, + new_left + mFacebookIconRect.getWidth(), + mFacebookIconRect.mBottom); + mFacebookIcon->setRect(mFacebookIconRect); + } + + drawLabel(mLabelSuffix, font, mFacebookIcon->getRect().mRight + 7, y, color, right_x); LLView::draw(); } @@ -317,6 +331,13 @@ void LLPersonView::drawHighlight() } } +void LLPersonView::drawLabel(const std::string text, const LLFontGL * font, const F32 x, const F32 y, const LLColor4& color, F32 &right_x) +{ + font->renderUTF8(text, 0, x, y, color, + LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, + S32_MAX, getRect().getWidth() - (S32) x - mLabelPaddingRight, &right_x, TRUE); +} + void LLPersonView::initFromParams(const LLPersonView::Params & params) { LLIconCtrl::Params facebook_icon_params(params.facebook_icon()); diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index 9839a1eaaf..6f244c2794 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -104,6 +104,7 @@ protected: void draw(); void drawHighlight(); + void drawLabel(const std::string text, const LLFontGL * font, const F32 x, const F32 y, const LLColor4& color, F32 &right_x); private: -- cgit v1.2.3 From 14be8efcc6a9797d2041e56addd0897f0b4234ea Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 8 May 2013 16:53:52 -0700 Subject: ACME-348 : WIP : LLFacebookConnect refactoring --- indra/newview/CMakeLists.txt | 2 + indra/newview/llfacebookconnect.cpp | 215 ++++++++++++++++++++++++++++++++++++ indra/newview/llfacebookconnect.h | 66 +++++++++++ indra/newview/llpanelpeople.cpp | 178 ----------------------------- indra/newview/llpanelpeople.h | 4 - 5 files changed, 283 insertions(+), 182 deletions(-) create mode 100644 indra/newview/llfacebookconnect.cpp create mode 100644 indra/newview/llfacebookconnect.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 6b7fa7d842..44b1604b15 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -185,6 +185,7 @@ set(viewer_SOURCE_FILES llexpandabletextbox.cpp llexternaleditor.cpp llface.cpp + llfacebookconnect.cpp llfasttimerview.cpp llfavoritesbar.cpp llfeaturemanager.cpp @@ -769,6 +770,7 @@ set(viewer_HEADER_FILES llexpandabletextbox.h llexternaleditor.h llface.h + llfacebookconnect.h llfasttimerview.h llfavoritesbar.h llfeaturemanager.h diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp new file mode 100644 index 0000000000..1962f6fd97 --- /dev/null +++ b/indra/newview/llfacebookconnect.cpp @@ -0,0 +1,215 @@ +/** + * @file llfacebookconnect.h + * @author Merov, Cho, Gil + * @brief Connection to Facebook Service + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfacebookconnect.h" + +/////////////////////////////////////////////////////////////////////////////// +// +class LLFacebookConnectResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLFacebookConnectResponder); +public: + + virtual void completed(U32 status, const std::string& reason, const LLSD& content) + { + if (isGoodStatus(status)) + { + LL_DEBUGS("FacebookConnect") << "Connect successful. content: " << content << LL_ENDL; + + // Grab some graph data now that we are connected + LLFacebookConnect::instance().setConnected(true); + LLFacebookConnect::instance().loadFacebookFriends(); + } + else + { + LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL; + } + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// +class LLFacebookDisconnectResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLFacebookDisconnectResponder); +public: + + virtual void completed(U32 status, const std::string& reason, const LLSD& content) + { + if (isGoodStatus(status)) + { + LL_DEBUGS("FacebookConnect") << "Disconnect successful. content: " << content << LL_ENDL; + + // Hide all the facebook stuff + LLFacebookConnect::instance().setConnected(false); + LLFacebookConnect::instance().hideFacebookFriends(); + } + else + { + LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL; + } + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// +class LLFacebookConnectedResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLFacebookDisconnectResponder); +public: + + LLFacebookConnectedResponder(bool show_login_if_not_connected) : mShowLoginIfNotConnected(show_login_if_not_connected) {} + + virtual void completed(U32 status, const std::string& reason, const LLSD& content) + { + if (isGoodStatus(status)) + { + LL_DEBUGS("FacebookConnect") << "Connect successful. content: " << content << LL_ENDL; + + // Grab some graph data if already connected + LLFacebookConnect::instance().setConnected(true); + LLFacebookConnect::instance().loadFacebookFriends(); + } + else + { + LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL; + + // show the facebook login page if not connected yet + if ((status == 404) && mShowLoginIfNotConnected) + { + LLFacebookConnect::instance().connectToFacebook(); + } + } + } + +private: + bool mShowLoginIfNotConnected; +}; + +/////////////////////////////////////////////////////////////////////////////// +// +class LLFacebookFriendsResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLFacebookFriendsResponder); +public: + + virtual void completed(U32 status, const std::string& reason, const LLSD& content) + { + if (isGoodStatus(status)) + { + LL_DEBUGS("FacebookConnect") << "Getting Facebook friends successful. content: " << content << LL_ENDL; + + // Display the list of friends + LLFacebookConnect::instance().showFacebookFriends(content); + } + else + { + LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL; + } + } +}; + + +/////////////////////////////////////////////////////////////////////////////// +// +LLFacebookConnect::LLFacebookConnect() +: mConnectedToFbc(false) +{ +} + +void LLFacebookConnect::init() +{ +} + +void LLFacebookConnect::loadFacebookFriends() +{ + const bool follow_redirects=false; + const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; + LLHTTPClient::get(getFacebookConnectURL("/friend"), new FacebookFriendsResponder(this), + LLSD(), timeout, follow_redirects); +} + +void LLFacebookConnect::hideFacebookFriends() +{ + // That needs to be done in llpanelpeople... + //mFacebookFriends->clear(); +} + +void LLFacebookConnect::connectToFacebook(const std::string& auth_code) +{ + LLSD body; + if (!auth_code.empty()) + body["code"] = auth_code; + + LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new FacebookConnectResponder(this)); +} + +void LLFacebookConnect::showFacebookFriends(const LLSD& friends) +{ + /* All that needs to be rewritten to + mFacebookFriends->clear(); + LLPersonTabModel::tab_type tab_type; + LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance(); + + for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) + { + std::string name = i->second["name"].asString(); + LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); + + //add to avatar list + mFacebookFriends->addNewItem(agent_id, name, false); + + //FB+SL but not SL friend + if(agent_id.notNull() && !avatar_tracker.isBuddy(agent_id)) + { + tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; + } + //FB only friend + else + { + tab_type = LLPersonTabModel::FB_ONLY_FRIEND; + } + + //Add to person tab model + LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(tab_type)); + if(person_tab_model) + { + addParticipantToModel(person_tab_model, agent_id, name); + } + } + */ +} + + + + + + + + diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h new file mode 100644 index 0000000000..d60fdacd90 --- /dev/null +++ b/indra/newview/llfacebookconnect.h @@ -0,0 +1,66 @@ +/** + * @file llfacebookconnect.h + * @author Merov, Cho, Gil + * @brief Connection to Facebook Service + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLFACEBOOKCONNECT_H +#define LL_LLFACEBOOKCONNECT_H + +#include "llsingleton.h" + +/** + * @class LLFacebookConnect + * + * Manages authentication to, and interaction with, a web service allowing the + * the viewer to get Facebook OpenGraph data. + */ +class LLFacebookConnect : public LLSingleton +{ + LOG_CLASS(LLFacebookConnect); +public: + /* + * Performs initial setup, by requesting config data from the web service if + * it has not already been received. + */ + void init(); + + void loadFacebookFriends(); + void hideFacebookFriends(); + void connectToFacebook(const std::string& auth_code = ""); + void showFacebookFriends(const LLSD& friends); + + void setConnected(bool connected) { mConnectedToFbc = connected; } + +private: + + friend class LLSingleton; + + LLFacebookConnect(); + ~LLFacebookConnect() {}; + + bool mConnectedToFbc; +}; + +#endif // LL_LLFACEBOOKCONNECT_H diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 9956888134..ce3ae48aca 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1639,40 +1639,6 @@ void LLPanelPeople::openFacebookWeb(std::string url) LLUrlAction::openURLExternal(url); } -void LLPanelPeople::showFacebookFriends(const LLSD& friends) -{ - mFacebookFriends->clear(); - LLPersonTabModel::tab_type tab_type; - LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance(); - - for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) - { - std::string name = i->second["name"].asString(); - LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); - - //add to avatar list - mFacebookFriends->addNewItem(agent_id, name, false); - - //FB+SL but not SL friend - if(agent_id.notNull() && !avatar_tracker.isBuddy(agent_id)) - { - tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; - } - //FB only friend - else - { - tab_type = LLPersonTabModel::FB_ONLY_FRIEND; - } - - //Add to person tab model - LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(tab_type)); - if(person_tab_model) - { - addParticipantToModel(person_tab_model, agent_id, name); - } - } -} - void LLPanelPeople::addTestParticipant() { std::string suffix("Aa"); @@ -1725,141 +1691,6 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model person_folder_model->addParticipant(person_model); } -void LLPanelPeople::hideFacebookFriends() -{ - mFacebookFriends->clear(); -} - -class FacebookConnectResponder : public LLHTTPClient::Responder -{ -public: - - LLPanelPeople * mPanelPeople; - - FacebookConnectResponder(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {} - - /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) - { - if (isGoodStatus(status)) - { - llinfos << content << llendl; - - // grab some graph data now that we are connected - mPanelPeople->mConnectedToFbc = true; - mPanelPeople->loadFacebookFriends(); - } - else - { - llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl; - } - } - - /*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content) - { - if (status == 302) - { - mPanelPeople->openFacebookWeb(content["location"]); - } - } -}; - -class FacebookDisconnectResponder : public LLHTTPClient::Responder -{ -public: - - LLPanelPeople * mPanelPeople; - - FacebookDisconnectResponder(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {} - - /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) - { - if (isGoodStatus(status)) - { - llinfos << content << llendl; - - // hide all the facebook stuff - mPanelPeople->mConnectedToFbc = false; - mPanelPeople->hideFacebookFriends(); - } - else - { - llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl; - } - } -}; - -class FacebookConnectedResponder : public LLHTTPClient::Responder -{ -public: - - LLPanelPeople * mPanelPeople; - bool mShowLoginIfNotConnected; - - FacebookConnectedResponder(LLPanelPeople * panel_people, bool show_login_if_not_connected) : mPanelPeople(panel_people), mShowLoginIfNotConnected(show_login_if_not_connected) {} - - /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) - { - if (isGoodStatus(status)) - { - llinfos << content << llendl; - - // grab some graph data if already connected - mPanelPeople->mConnectedToFbc = true; - mPanelPeople->loadFacebookFriends(); - } - else - { - llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl; - - // show the facebook login page if not connected yet - if (status == 404 && mShowLoginIfNotConnected) - { - mPanelPeople->connectToFacebook(); - } - } - } -}; - -class FacebookFriendsResponder : public LLHTTPClient::Responder -{ -public: - - LLPanelPeople * mPanelPeople; - - FacebookFriendsResponder(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {} - - /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) - { - if (isGoodStatus(status)) - { - llinfos << content << llendl; - - // display the list of friends - mPanelPeople->showFacebookFriends(content); - } - else - { - llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl; - } - } - - /*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content) - { - if (status == 302) - { - mPanelPeople->openFacebookWeb(content["location"]); - } - } -}; - -void LLPanelPeople::loadFacebookFriends() -{ - const bool follow_redirects=false; - const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/friend"), new FacebookFriendsResponder(this), - LLSD(), timeout, follow_redirects); -} - void LLPanelPeople::tryToReconnectToFacebook() { if (!mConnectedToFbc) @@ -1871,15 +1702,6 @@ void LLPanelPeople::tryToReconnectToFacebook() } } -void LLPanelPeople::connectToFacebook(const std::string& auth_code) -{ - LLSD body; - if (!auth_code.empty()) - body["code"] = auth_code; - - LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new FacebookConnectResponder(this)); -} - void LLPanelPeople::disconnectFromFacebook() { LLHTTPClient::del(getFacebookConnectURL("/connection"), new FacebookDisconnectResponder(this)); diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 943d84ac1d..fa354f7ecb 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -63,13 +63,9 @@ public: static void idle(void * user_data); void openFacebookWeb(std::string url); - void showFacebookFriends(const LLSD& friends); void addTestParticipant(); void addParticipantToModel(LLPersonTabModel * session_model, const LLUUID& agent_id, const std::string& name); - void hideFacebookFriends(); - void loadFacebookFriends(); void tryToReconnectToFacebook(); - void connectToFacebook(const std::string& auth_code = ""); void disconnectFromFacebook(); std::string getFacebookConnectURL(const std::string& route = ""); -- cgit v1.2.3 From 62eda57ea1f4d3e39aa34010f7709908f24fb6e2 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 9 May 2013 10:25:21 -0700 Subject: ACME-348 : WIP : LLFacebookConnect refactorin completed. Not functional yet though. --- indra/newview/llfacebookconnect.cpp | 92 +++++++++++++++++++++++++++++++++---- indra/newview/llfacebookconnect.h | 8 +++- indra/newview/llpanelpeople.cpp | 72 +++-------------------------- indra/newview/llpanelpeople.h | 9 +--- 4 files changed, 98 insertions(+), 83 deletions(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 1962f6fd97..ec2085c2ac 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -29,6 +29,38 @@ #include "llfacebookconnect.h" +#include "llagent.h" +#include "llcallingcard.h" // for LLAvatarTracker +//#include "llcommandhandler.h" +#include "llhttpclient.h" + +/////////////////////////////////////////////////////////////////////////////// +// +/* +class LLFacebookConnectHandler : public LLCommandHandler +{ +public: + LLFacebookConnectHandler() : LLCommandHandler("fbc", UNTRUSTED_THROTTLE) { } + + bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) + { + if (tokens.size() > 0) + { + if (tokens[0].asString() == "connect") + { + if (query_map.has("code")) + { + LLFacebookConnect::instance().connectToFacebook(query_map["code"]); + } + return true; + } + } + return false; + } +}; +LLFacebookConnectHandler gFacebookConnectHandler; +*/ + /////////////////////////////////////////////////////////////////////////////// // class LLFacebookConnectResponder : public LLHTTPClient::Responder @@ -81,7 +113,7 @@ public: // class LLFacebookConnectedResponder : public LLHTTPClient::Responder { - LOG_CLASS(LLFacebookDisconnectResponder); + LOG_CLASS(LLFacebookConnectedResponder); public: LLFacebookConnectedResponder(bool show_login_if_not_connected) : mShowLoginIfNotConnected(show_login_if_not_connected) {} @@ -147,11 +179,20 @@ void LLFacebookConnect::init() { } +std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route) +{ + //static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); + static std::string sFacebookConnectUrl = "https://pdp15.lindenlab.com/fbc/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho + std::string url = sFacebookConnectUrl + route; + llinfos << url << llendl; + return url; +} + void LLFacebookConnect::loadFacebookFriends() { const bool follow_redirects=false; const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/friend"), new FacebookFriendsResponder(this), + LLHTTPClient::get(getFacebookConnectURL("/friend"), new LLFacebookFriendsResponder(), LLSD(), timeout, follow_redirects); } @@ -167,15 +208,41 @@ void LLFacebookConnect::connectToFacebook(const std::string& auth_code) if (!auth_code.empty()) body["code"] = auth_code; - LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new FacebookConnectResponder(this)); + LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new LLFacebookConnectResponder()); +} + +void LLFacebookConnect::disconnectFromFacebook() +{ + LLHTTPClient::del(getFacebookConnectURL("/connection"), new LLFacebookDisconnectResponder()); +} + +void LLFacebookConnect::tryToReconnectToFacebook() +{ + if (!mConnectedToFbc) + { + const bool follow_redirects=false; + const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; + LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(false), + LLSD(), timeout, follow_redirects); + } +} + +void LLFacebookConnect::getConnectionToFacebook() +{ + const bool follow_redirects=false; + const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; + LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(true), + LLSD(), timeout, follow_redirects); } void LLFacebookConnect::showFacebookFriends(const LLSD& friends) { - /* All that needs to be rewritten to - mFacebookFriends->clear(); - LLPersonTabModel::tab_type tab_type; + /* All that needs to be rewritten a different way */ + // FOR TESTING ONLY!! Print out the data in the log + //mFacebookFriends->clear(); + //LLPersonTabModel::tab_type tab_type; LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance(); + llinfos << "LLFacebookConnect::showFacebookFriends" << llendl; for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) { @@ -183,27 +250,32 @@ void LLFacebookConnect::showFacebookFriends(const LLSD& friends) LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); //add to avatar list - mFacebookFriends->addNewItem(agent_id, name, false); + //mFacebookFriends->addNewItem(agent_id, name, false); //FB+SL but not SL friend + bool is_SL_friend = false; if(agent_id.notNull() && !avatar_tracker.isBuddy(agent_id)) { - tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; + //tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; + is_SL_friend = false; } //FB only friend else { - tab_type = LLPersonTabModel::FB_ONLY_FRIEND; + //tab_type = LLPersonTabModel::FB_ONLY_FRIEND; + is_SL_friend = true; } + llinfos << "LLFacebookConnect : agent_id = " << agent_id << ", name = " << name << ", SL friend = " << is_SL_friend << llendl; //Add to person tab model + /* LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(tab_type)); if(person_tab_model) { addParticipantToModel(person_tab_model, agent_id, name); } + */ } - */ } diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index d60fdacd90..c42d8c8edc 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -49,9 +49,14 @@ public: void loadFacebookFriends(); void hideFacebookFriends(); void connectToFacebook(const std::string& auth_code = ""); + void disconnectFromFacebook(); + void tryToReconnectToFacebook(); + void getConnectionToFacebook(); + void showFacebookFriends(const LLSD& friends); void setConnected(bool connected) { mConnectedToFbc = connected; } + bool getConnected() { return mConnectedToFbc; } private: @@ -59,7 +64,8 @@ private: LLFacebookConnect(); ~LLFacebookConnect() {}; - + std::string getFacebookConnectURL(const std::string& route = ""); + bool mConnectedToFbc; }; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index ce3ae48aca..02a254b76c 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -54,8 +54,8 @@ #include "llcallingcard.h" // for LLAvatarTracker #include "llcallbacklist.h" #include "llerror.h" +#include "llfacebookconnect.h" #include "llfloateravatarpicker.h" -//#include "llfloaterminiinspector.h" #include "llfriendcard.h" #include "llgroupactions.h" #include "llgrouplist.h" @@ -76,7 +76,6 @@ #include "llspeakers.h" #include "llfloaterwebcontent.h" #include "llurlaction.h" -#include "llcommandhandler.h" #define FRIEND_LIST_UPDATE_TIMEOUT 0.5 #define NEARBY_LIST_UPDATE_INTERVAL 1 @@ -91,35 +90,6 @@ static const std::string FBCTEST_TAB_NAME = "fbctest_panel"; static const std::string FBCTESTTWO_TAB_NAME = "fbctesttwo_panel"; static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; -class LLFacebookConnectHandler : public LLCommandHandler -{ -public: - LLFacebookConnectHandler() : LLCommandHandler("fbc", UNTRUSTED_THROTTLE), mPanelPeople(NULL) { } - - LLPanelPeople* mPanelPeople; - - bool handle(const LLSD& tokens, const LLSD& query_map, - LLMediaCtrl* web) - { - if (tokens.size() > 0) - { - if (tokens[0].asString() == "connect") - { - if (query_map.has("code")) - { - if (mPanelPeople) - { - mPanelPeople->connectToFacebook(query_map["code"]); - mPanelPeople = NULL; - } - } - return true; - } - } - return false; - } -}; -LLFacebookConnectHandler gFacebookConnectHandler; /** Comparator for comparing avatar items by last interaction date */ class LLAvatarItemRecentComparator : public LLAvatarItemComparator @@ -577,7 +547,6 @@ private: LLPanelPeople::LLPanelPeople() : LLPanel(), - mConnectedToFbc(false), mPersonFolderView(NULL), mTryToConnectToFbc(true), mTabContainer(NULL), @@ -947,7 +916,7 @@ void LLPanelPeople::updateFbcTestList() if (mTryToConnectToFbc) { // try to reconnect to facebook! - tryToReconnectToFacebook(); + LLFacebookConnect::instance().tryToReconnectToFacebook(); // don't try again mTryToConnectToFbc = false; @@ -1633,11 +1602,12 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name) return isAccordionCollapsedByUser(getChild(name)); } +/* void LLPanelPeople::openFacebookWeb(std::string url) { - gFacebookConnectHandler.mPanelPeople = this; LLUrlAction::openURLExternal(url); } +*/ void LLPanelPeople::addTestParticipant() { @@ -1691,43 +1661,15 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model person_folder_model->addParticipant(person_model); } -void LLPanelPeople::tryToReconnectToFacebook() -{ - if (!mConnectedToFbc) - { - const bool follow_redirects=false; - const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/connection"), new FacebookConnectedResponder(this, false), - LLSD(), timeout, follow_redirects); - } -} - -void LLPanelPeople::disconnectFromFacebook() -{ - LLHTTPClient::del(getFacebookConnectURL("/connection"), new FacebookDisconnectResponder(this)); -} - -std::string LLPanelPeople::getFacebookConnectURL(const std::string& route) -{ - //static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); - static std::string sFacebookConnectUrl = "https://pdp15.lindenlab.com/fbc/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho - std::string url = sFacebookConnectUrl + route; - llinfos << url << llendl; - return url; -} - void LLPanelPeople::onLoginFbcButtonClicked() { - if (mConnectedToFbc) + if (LLFacebookConnect::instance().getConnected()) { - disconnectFromFacebook(); + LLFacebookConnect::instance().disconnectFromFacebook(); } else { - const bool follow_redirects=false; - const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/connection"), new FacebookConnectedResponder(this, true), - LLSD(), timeout, follow_redirects); + LLFacebookConnect::instance().getConnectionToFacebook(); } } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index fa354f7ecb..2f74064327 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -62,16 +62,11 @@ public: static void idle(void * user_data); - void openFacebookWeb(std::string url); +// void openFacebookWeb(std::string url); void addTestParticipant(); void addParticipantToModel(LLPersonTabModel * session_model, const LLUUID& agent_id, const std::string& name); - void tryToReconnectToFacebook(); - void disconnectFromFacebook(); - std::string getFacebookConnectURL(const std::string& route = ""); - - bool mConnectedToFbc; - bool mTryToConnectToFbc; + bool mTryToConnectToFbc; // internals class Updater; -- cgit v1.2.3 From cd8e0b92e1c8f9f8544b1011e61c21c7789b93b7 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 9 May 2013 11:10:13 -0700 Subject: Tweak to ensure more avatar rendering info is sent to the simulator --- indra/newview/llavatarrenderinfoaccountant.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 54144677f4..da4b6cf806 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -249,7 +249,7 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio { LLVOAvatar* avatar = dynamic_cast(*iter); if (avatar && - avatar->getRezzedStatus() == 2 && // Fully rezzed + avatar->getRezzedStatus() >= 2 && // Mostly rezzed (maybe without baked textures downloaded) !avatar->isDead() && // Not dead yet avatar->getObjectHost() == regionp->getHost()) // Ensure it's on the same region { -- cgit v1.2.3 From be9f71d16660e37fb058ddf05f20e6a80a272862 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 9 May 2013 15:40:02 -0500 Subject: MAINT-2647 Fix for some objects not rendering until first LoD switch/selection. --- indra/newview/lldrawable.cpp | 2 +- indra/newview/lldrawable.h | 1 - indra/newview/llviewerobject.cpp | 3 ++- indra/newview/llviewerobjectlist.cpp | 3 ++- indra/newview/pipeline.cpp | 5 ----- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 2e3a9119b8..31ab37f970 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -441,7 +441,7 @@ void LLDrawable::makeActive() } llassert(isAvatar() || isRoot() || mParent->isActive()); - } +} void LLDrawable::makeStatic(BOOL warning_enabled) diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h index 4608d16fec..4420a34fae 100644 --- a/indra/newview/lldrawable.h +++ b/indra/newview/lldrawable.h @@ -284,7 +284,6 @@ public: NEARBY_LIGHT = 0x00200000, // In gPipeline.mNearbyLightSet BUILT = 0x00400000, FORCE_INVISIBLE = 0x00800000, // stay invis until CLEAR_INVISIBLE is set (set of orphaned) - CLEAR_INVISIBLE = 0x01000000, // clear FORCE_INVISIBLE next draw frame REBUILD_SHADOW = 0x02000000, HAS_ALPHA = 0x04000000, RIGGED = 0x08000000, diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 9dc9932c86..e17b085eab 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2137,7 +2137,8 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, if (mDrawable->isState(LLDrawable::FORCE_INVISIBLE) && !mOrphaned) { // lldebugs << "Clearing force invisible: " << mID << ":" << getPCodeString() << ":" << getPositionAgent() << llendl; - mDrawable->setState(LLDrawable::CLEAR_INVISIBLE); + mDrawable->clearState(LLDrawable::FORCE_INVISIBLE); + gPipeline.markRebuild( mDrawable, LLDrawable::REBUILD_ALL, TRUE ); } } diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index fa79ac07e6..66615657d8 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -2064,8 +2064,9 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port) if (childp->mDrawable.notNull()) { // Make the drawable visible again and set the drawable parent - childp->mDrawable->setState(LLDrawable::CLEAR_INVISIBLE); + childp->mDrawable->clearState(LLDrawable::FORCE_INVISIBLE); childp->setDrawableParent(objectp->mDrawable); // LLViewerObjectList::findOrphans() + gPipeline.markRebuild( childp->mDrawable, LLDrawable::REBUILD_ALL, TRUE ); } // Make certain particles, icon and HUD aren't hidden diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 442c3ef124..16596f2574 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -3320,11 +3320,6 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera) { drawablep->setVisible(camera, NULL, FALSE); } - else if (drawablep->isState(LLDrawable::CLEAR_INVISIBLE)) - { - // clear invisible flag here to avoid single frame glitch - drawablep->clearState(LLDrawable::FORCE_INVISIBLE|LLDrawable::CLEAR_INVISIBLE); - } } if (LLViewerCamera::sCurCameraID == LLViewerCamera::CAMERA_WORLD) -- cgit v1.2.3 From 359c3d520eaf8de818081db32812387416add26a Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 9 May 2013 16:02:03 -0700 Subject: ACME-342 Format the PersonView so that it shows the avatar icon, SL name, FB icon, and FB name: Rendering now matches the UX spec. --- indra/llui/llfolderviewitem.cpp | 12 +++++++++++- indra/newview/llpanelpeople.cpp | 6 +++--- indra/newview/llpersontabview.cpp | 25 +++++++++++++------------ 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 0c0c54c38c..f061313645 100755 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -307,7 +307,12 @@ std::set LLFolderViewItem::getSelectionList() const // addToFolder() returns TRUE if it succeeds. FALSE otherwise void LLFolderViewItem::addToFolder(LLFolderViewFolder* folder) { - folder->addItem(this); + folder->addItem(this); + + // Compute indentation since parent folder changed + mIndentation = (getParentFolder()) + ? getParentFolder()->getIndentation() + mLocalIndentation + : 0; } @@ -940,6 +945,11 @@ LLFolderViewFolder::~LLFolderViewFolder( void ) void LLFolderViewFolder::addToFolder(LLFolderViewFolder* folder) { folder->addFolder(this); + + // Compute indentation since parent folder changed + mIndentation = (getParentFolder()) + ? getParentFolder()->getIndentation() + mLocalIndentation + : 0; } static LLFastTimer::DeclareTimer FTM_ARRANGE("Arrange"); diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 07a1c46256..420225f260 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -731,7 +731,7 @@ BOOL LLPanelPeople::postBuild() folder_view_params.listener = base_item; folder_view_params.view_model = &mPersonFolderViewModel; folder_view_params.root = NULL; - folder_view_params.use_ellipses = false; + folder_view_params.use_ellipses = true; folder_view_params.use_label_suffix = true; folder_view_params.options_menu = "menu_conversation.xml"; folder_view_params.name = "fbcfolderview"; @@ -1677,7 +1677,7 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) void LLPanelPeople::addTestParticipant() { std::string suffix("Aa"); - std::string prefix("Second Life User Name Goes Here"); + std::string prefix("Facebook User Name"); LLPersonTabModel * person_tab_model; LLUUID agentID; std::string name; @@ -1726,7 +1726,7 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model avatar_name_string = avatar_name.getDisplayName(); } - person_model = new LLPersonModel(agent_id, name, avatar_name_string, mPersonFolderViewModel); + person_model = new LLPersonModel(agent_id, avatar_name_string, name, mPersonFolderViewModel); person_folder_model->addParticipant(person_model); } diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 16ebb6af90..d4c73cd53f 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -173,6 +173,8 @@ S32 LLPersonView::getLabelXPos() void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) { + const LLFontGL * font = LLFontGL::getFontSansSerifSmall(); + LLFolderViewItem::addToFolder(person_folder_view); //Added item to folder could change folder's mHasVisibleChildren flag so call arrange person_folder_view->requestArrange(); @@ -183,6 +185,17 @@ void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) { mAvatarIcon->setVisible(TRUE); mFacebookIcon->setVisible(TRUE); + + S32 label_width = font->getWidth(mLabel); + F32 text_left = (F32)getLabelXPos(); + + LLRect mFacebookIconRect = mFacebookIcon->getRect(); + S32 new_left = text_left + label_width + 7; + mFacebookIconRect.set(new_left, + mFacebookIconRect.mTop, + new_left + mFacebookIconRect.getWidth(), + mFacebookIconRect.mBottom); + mFacebookIcon->setRect(mFacebookIconRect); } else if(mPersonTabModel->mTabType == LLPersonTabModel::FB_ONLY_FRIEND) { @@ -288,18 +301,6 @@ void LLPersonView::draw() drawHighlight(); drawLabel(mLabel, font, text_left, y, color, right_x); - - if(mLabelSuffix.length()) - { - LLRect mFacebookIconRect = mFacebookIcon->getRect(); - S32 new_left = right_x + 7; - mFacebookIconRect.set(new_left, - mFacebookIconRect.mTop, - new_left + mFacebookIconRect.getWidth(), - mFacebookIconRect.mBottom); - mFacebookIcon->setRect(mFacebookIconRect); - } - drawLabel(mLabelSuffix, font, mFacebookIcon->getRect().mRight + 7, y, color, right_x); LLView::draw(); -- cgit v1.2.3 From fb27eae15502cbd2a13cde018ae67f961320d0ba Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 9 May 2013 17:36:04 -0700 Subject: ACME-342 Format the PersonView so that it shows the avatar icon, SL name, FB icon, and FB name: Found a couple bugs that were causing the positioning of text to be incorrect in the 'Peope you may want to friend' tab. --- indra/llui/llfolderview.cpp | 2 +- indra/newview/llpanelpeople.cpp | 4 ++-- indra/newview/llpersontabview.cpp | 10 ++++++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 9cf822892e..20eade892d 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -185,7 +185,7 @@ LLFolderView::LLFolderView(const Params& p) mAutoOpenCandidate = NULL; mAutoOpenTimer.stop(); mKeyboardSelection = FALSE; - mIndentation = p.folder_indentation; + mIndentation = getParentFolder() ? getParentFolder()->getIndentation() + mLocalIndentation : 0; //clear label // go ahead and render root folder as usual diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 420225f260..2bdfdf6687 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1677,7 +1677,7 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) void LLPanelPeople::addTestParticipant() { std::string suffix("Aa"); - std::string prefix("Facebook User Name"); + std::string prefix("FB Name"); LLPersonTabModel * person_tab_model; LLUUID agentID; std::string name; @@ -1718,7 +1718,7 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model LLPersonModel* person_model = NULL; LLAvatarName avatar_name; - bool has_name = LLAvatarNameCache::get(agent_id, &avatar_name); + bool has_name = agent_id.notNull() ? LLAvatarNameCache::get(agent_id, &avatar_name) : false; std::string avatar_name_string; if(has_name) diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index d4c73cd53f..34ffc6ffce 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -300,8 +300,14 @@ void LLPersonView::draw() F32 right_x = 0; drawHighlight(); - drawLabel(mLabel, font, text_left, y, color, right_x); - drawLabel(mLabelSuffix, font, mFacebookIcon->getRect().mRight + 7, y, color, right_x); + if(mLabel.length()) + { + drawLabel(mLabel, font, text_left, y, color, right_x); + } + if(mLabelSuffix.length()) + { + drawLabel(mLabelSuffix, font, mFacebookIcon->getRect().mRight + 7, y, color, right_x); + } LLView::draw(); } -- cgit v1.2.3 From 5717bcf4ae74b53b515c5f13027fed4475e65c9a Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Fri, 10 May 2013 12:15:25 -0700 Subject: MAINT-2672 Make windows flex/bison inputs identical to other platforms to make bison >= 2.7 work --- indra/lscript/lscript_compile/indra.l | 8 -------- indra/lscript/lscript_compile/indra.y | 11 ----------- 2 files changed, 19 deletions(-) diff --git a/indra/lscript/lscript_compile/indra.l b/indra/lscript/lscript_compile/indra.l index ab0d31ec46..c5d11af22b 100755 --- a/indra/lscript/lscript_compile/indra.l +++ b/indra/lscript/lscript_compile/indra.l @@ -79,17 +79,9 @@ void parse_string(); #define yyfree indra_free -#if LL_DARWIN int yyparse( void ); int yylex( void ); int yyerror(const char *fmt, ...); -#else -#if defined(__cplusplus) -extern "C" { int yyparse( void ); } -extern "C" { int yylex( void ); } -extern "C" { int yyerror(const char *fmt, ...); } -#endif -#endif %} diff --git a/indra/lscript/lscript_compile/indra.y b/indra/lscript/lscript_compile/indra.y index 8df0e8ad83..a0a034d21c 100755 --- a/indra/lscript/lscript_compile/indra.y +++ b/indra/lscript/lscript_compile/indra.y @@ -2,12 +2,6 @@ #include "linden_common.h" #include "lscript_tree.h" - #if !LL_DARWIN - #ifdef __cplusplus - extern "C" { - #endif - #endif - int yylex(void); int yyparse( void ); int yyerror(const char *fmt, ...); @@ -22,11 +16,6 @@ #pragma warning( disable : 4065 ) // warning: switch statement contains 'default' but no 'case' labels #endif - #if !LL_DARWIN - #ifdef __cplusplus - } - #endif - #endif %} %union -- cgit v1.2.3 From f90d93f75da6481dc1b308dfb76dd767e7623ea5 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 10 May 2013 15:10:53 -0700 Subject: ACME-348 : WIP : Add some traces to work out the protocol (temporary) --- indra/newview/llfacebookconnect.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index ec2085c2ac..e7f039aff1 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -173,6 +173,7 @@ public: LLFacebookConnect::LLFacebookConnect() : mConnectedToFbc(false) { + llinfos << "Merov : LLFacebookConnect::LLFacebookConnect" << llendl; } void LLFacebookConnect::init() @@ -181,6 +182,7 @@ void LLFacebookConnect::init() std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route) { + llinfos << "Merov : LLFacebookConnect::getFacebookConnectURL. route = " << route << llendl; //static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); static std::string sFacebookConnectUrl = "https://pdp15.lindenlab.com/fbc/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho std::string url = sFacebookConnectUrl + route; @@ -190,6 +192,7 @@ std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route) void LLFacebookConnect::loadFacebookFriends() { + llinfos << "Merov : LLFacebookConnect::loadFacebookFriends" << llendl; const bool follow_redirects=false; const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; LLHTTPClient::get(getFacebookConnectURL("/friend"), new LLFacebookFriendsResponder(), @@ -198,12 +201,14 @@ void LLFacebookConnect::loadFacebookFriends() void LLFacebookConnect::hideFacebookFriends() { + llinfos << "Merov : LLFacebookConnect::hideFacebookFriends" << llendl; // That needs to be done in llpanelpeople... //mFacebookFriends->clear(); } void LLFacebookConnect::connectToFacebook(const std::string& auth_code) { + llinfos << "Merov : LLFacebookConnect::connectToFacebook" << llendl; LLSD body; if (!auth_code.empty()) body["code"] = auth_code; @@ -213,11 +218,13 @@ void LLFacebookConnect::connectToFacebook(const std::string& auth_code) void LLFacebookConnect::disconnectFromFacebook() { + llinfos << "Merov : LLFacebookConnect::disconnectFromFacebook" << llendl; LLHTTPClient::del(getFacebookConnectURL("/connection"), new LLFacebookDisconnectResponder()); } void LLFacebookConnect::tryToReconnectToFacebook() { + llinfos << "Merov : LLFacebookConnect::tryToReconnectToFacebook" << llendl; if (!mConnectedToFbc) { const bool follow_redirects=false; @@ -229,6 +236,7 @@ void LLFacebookConnect::tryToReconnectToFacebook() void LLFacebookConnect::getConnectionToFacebook() { + llinfos << "Merov : LLFacebookConnect::getConnectionToFacebook" << llendl; const bool follow_redirects=false; const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(true), @@ -242,7 +250,7 @@ void LLFacebookConnect::showFacebookFriends(const LLSD& friends) //mFacebookFriends->clear(); //LLPersonTabModel::tab_type tab_type; LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance(); - llinfos << "LLFacebookConnect::showFacebookFriends" << llendl; + llinfos << "Merov : LLFacebookConnect::showFacebookFriends" << llendl; for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) { @@ -257,15 +265,15 @@ void LLFacebookConnect::showFacebookFriends(const LLSD& friends) if(agent_id.notNull() && !avatar_tracker.isBuddy(agent_id)) { //tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; - is_SL_friend = false; + is_SL_friend = true; } //FB only friend else { //tab_type = LLPersonTabModel::FB_ONLY_FRIEND; - is_SL_friend = true; + is_SL_friend = false; } - llinfos << "LLFacebookConnect : agent_id = " << agent_id << ", name = " << name << ", SL friend = " << is_SL_friend << llendl; + llinfos << "Merov : LLFacebookConnect : agent_id = " << agent_id << ", name = " << name << ", SL friend = " << is_SL_friend << llendl; //Add to person tab model /* -- cgit v1.2.3 From 180dd12ed637c1f63a5013d25fbac002e1d94c93 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Fri, 10 May 2013 17:11:12 -0700 Subject: Add BuildVersion.cmake to great chain of life --- indra/cmake/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 246b9680e8..10a23ea068 100755 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -12,6 +12,7 @@ set(cmake_SOURCE_FILES Audio.cmake BerkeleyDB.cmake Boost.cmake + BuildVersion.cmake CARes.cmake CMakeCopyIfDifferent.cmake ConfigurePkgConfig.cmake -- cgit v1.2.3 From 7c4bfc8f55ebc581ddac0c2394b07b24d240d1a6 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 10 May 2013 18:25:45 -0700 Subject: ACME-348 : Completed : Facebook Connect refactored, LLPeoplePanel test list hooked correctly. --- indra/newview/llfacebookconnect.cpp | 100 ++++++++++-------------------------- indra/newview/llfacebookconnect.h | 19 ++++--- indra/newview/llpanelpeople.cpp | 54 ++++++++++++++++--- indra/newview/llpanelpeople.h | 5 +- 4 files changed, 88 insertions(+), 90 deletions(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index e7f039aff1..7f8e3afe89 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -98,9 +98,9 @@ public: { LL_DEBUGS("FacebookConnect") << "Disconnect successful. content: " << content << LL_ENDL; - // Hide all the facebook stuff + // Clear all facebook stuff LLFacebookConnect::instance().setConnected(false); - LLFacebookConnect::instance().hideFacebookFriends(); + LLFacebookConnect::instance().clearContent(); } else { @@ -156,9 +156,7 @@ public: if (isGoodStatus(status)) { LL_DEBUGS("FacebookConnect") << "Getting Facebook friends successful. content: " << content << LL_ENDL; - - // Display the list of friends - LLFacebookConnect::instance().showFacebookFriends(content); + LLFacebookConnect::instance().storeContent(content); } else { @@ -171,18 +169,14 @@ public: /////////////////////////////////////////////////////////////////////////////// // LLFacebookConnect::LLFacebookConnect() -: mConnectedToFbc(false) -{ - llinfos << "Merov : LLFacebookConnect::LLFacebookConnect" << llendl; -} - -void LLFacebookConnect::init() +: mConnectedToFbc(false), + mContent(), + mGeneration(0) { } std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route) { - llinfos << "Merov : LLFacebookConnect::getFacebookConnectURL. route = " << route << llendl; //static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); static std::string sFacebookConnectUrl = "https://pdp15.lindenlab.com/fbc/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho std::string url = sFacebookConnectUrl + route; @@ -190,25 +184,8 @@ std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route) return url; } -void LLFacebookConnect::loadFacebookFriends() -{ - llinfos << "Merov : LLFacebookConnect::loadFacebookFriends" << llendl; - const bool follow_redirects=false; - const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/friend"), new LLFacebookFriendsResponder(), - LLSD(), timeout, follow_redirects); -} - -void LLFacebookConnect::hideFacebookFriends() -{ - llinfos << "Merov : LLFacebookConnect::hideFacebookFriends" << llendl; - // That needs to be done in llpanelpeople... - //mFacebookFriends->clear(); -} - void LLFacebookConnect::connectToFacebook(const std::string& auth_code) { - llinfos << "Merov : LLFacebookConnect::connectToFacebook" << llendl; LLSD body; if (!auth_code.empty()) body["code"] = auth_code; @@ -218,13 +195,11 @@ void LLFacebookConnect::connectToFacebook(const std::string& auth_code) void LLFacebookConnect::disconnectFromFacebook() { - llinfos << "Merov : LLFacebookConnect::disconnectFromFacebook" << llendl; LLHTTPClient::del(getFacebookConnectURL("/connection"), new LLFacebookDisconnectResponder()); } void LLFacebookConnect::tryToReconnectToFacebook() { - llinfos << "Merov : LLFacebookConnect::tryToReconnectToFacebook" << llendl; if (!mConnectedToFbc) { const bool follow_redirects=false; @@ -236,54 +211,35 @@ void LLFacebookConnect::tryToReconnectToFacebook() void LLFacebookConnect::getConnectionToFacebook() { - llinfos << "Merov : LLFacebookConnect::getConnectionToFacebook" << llendl; const bool follow_redirects=false; const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(true), LLSD(), timeout, follow_redirects); } -void LLFacebookConnect::showFacebookFriends(const LLSD& friends) +void LLFacebookConnect::loadFacebookFriends() { - /* All that needs to be rewritten a different way */ - // FOR TESTING ONLY!! Print out the data in the log - //mFacebookFriends->clear(); - //LLPersonTabModel::tab_type tab_type; - LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance(); - llinfos << "Merov : LLFacebookConnect::showFacebookFriends" << llendl; - - for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) - { - std::string name = i->second["name"].asString(); - LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); - - //add to avatar list - //mFacebookFriends->addNewItem(agent_id, name, false); - - //FB+SL but not SL friend - bool is_SL_friend = false; - if(agent_id.notNull() && !avatar_tracker.isBuddy(agent_id)) - { - //tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; - is_SL_friend = true; - } - //FB only friend - else - { - //tab_type = LLPersonTabModel::FB_ONLY_FRIEND; - is_SL_friend = false; - } - llinfos << "Merov : LLFacebookConnect : agent_id = " << agent_id << ", name = " << name << ", SL friend = " << is_SL_friend << llendl; - - //Add to person tab model - /* - LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(tab_type)); - if(person_tab_model) - { - addParticipantToModel(person_tab_model, agent_id, name); - } - */ - } + const bool follow_redirects=false; + const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; + LLHTTPClient::get(getFacebookConnectURL("/friend"), new LLFacebookFriendsResponder(), + LLSD(), timeout, follow_redirects); +} + +void LLFacebookConnect::storeContent(const LLSD& content) +{ + mGeneration++; + mContent = content; +} + +const LLSD& LLFacebookConnect::getContent() const +{ + return mContent; +} + +void LLFacebookConnect::clearContent() +{ + mGeneration++; + mContent = LLSD(); } diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index c42d8c8edc..691aaa9131 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -40,24 +40,21 @@ class LLFacebookConnect : public LLSingleton { LOG_CLASS(LLFacebookConnect); public: - /* - * Performs initial setup, by requesting config data from the web service if - * it has not already been received. - */ - void init(); - - void loadFacebookFriends(); - void hideFacebookFriends(); void connectToFacebook(const std::string& auth_code = ""); void disconnectFromFacebook(); void tryToReconnectToFacebook(); void getConnectionToFacebook(); - void showFacebookFriends(const LLSD& friends); + void loadFacebookFriends(); + + void clearContent(); + void storeContent(const LLSD& content); + const LLSD& getContent() const; void setConnected(bool connected) { mConnectedToFbc = connected; } bool getConnected() { return mConnectedToFbc; } - + S32 generation() { return mGeneration; } + private: friend class LLSingleton; @@ -67,6 +64,8 @@ private: std::string getFacebookConnectURL(const std::string& route = ""); bool mConnectedToFbc; + LLSD mContent; + S32 mGeneration; }; #endif // LL_LLFACEBOOKCONNECT_H diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 02a254b76c..8648a44c55 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -555,12 +555,13 @@ LLPanelPeople::LLPanelPeople() mNearbyList(NULL), mRecentList(NULL), mGroupList(NULL), - mMiniMap(NULL) + mMiniMap(NULL), + mFacebookListGeneration(0) { mFriendListUpdater = new LLFriendListUpdater(boost::bind(&LLPanelPeople::updateFriendList, this)); mNearbyListUpdater = new LLNearbyListUpdater(boost::bind(&LLPanelPeople::updateNearbyList, this)); mRecentListUpdater = new LLRecentListUpdater(boost::bind(&LLPanelPeople::updateRecentList, this)); - mFbcTestListUpdater = new LLFbcTestListUpdater(boost::bind(&LLPanelPeople::updateFbcTestList, this)); + mFacebookListUpdater = new LLFbcTestListUpdater(boost::bind(&LLPanelPeople::updateFacebookList, this)); mButtonsUpdater = new LLButtonsUpdater(boost::bind(&LLPanelPeople::updateButtons, this)); mCommitCallbackRegistrar.add("People.loginFBC", boost::bind(&LLPanelPeople::onLoginFbcButtonClicked, this)); @@ -595,7 +596,7 @@ LLPanelPeople::~LLPanelPeople() delete mNearbyListUpdater; delete mFriendListUpdater; delete mRecentListUpdater; - delete mFbcTestListUpdater; + delete mFacebookListUpdater; if(LLVoiceClient::instanceExists()) { @@ -683,13 +684,17 @@ BOOL LLPanelPeople::postBuild() mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); + //===Temporary ======================================================================== + LLPanel * social_tab = getChild(FBCTEST_TAB_NAME); mFacebookFriends = social_tab->getChild("facebook_friends"); - social_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFbcTestListUpdater, _2)); + // Note: we use the same updater for both test lists (brute force but OK since it's temporary) + social_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFacebookListUpdater, _2)); //===Test START======================================================================== LLPanel * socialtwo_tab = getChild(FBCTESTTWO_TAB_NAME); + socialtwo_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFacebookListUpdater, _2)); //Create folder view LLPersonModelCommon* base_item = new LLPersonModelCommon(mPersonFolderViewModel); @@ -911,7 +916,7 @@ void LLPanelPeople::updateRecentList() mRecentList->setDirty(); } -void LLPanelPeople::updateFbcTestList() +void LLPanelPeople::updateFacebookList() { if (mTryToConnectToFbc) { @@ -922,8 +927,45 @@ void LLPanelPeople::updateFbcTestList() mTryToConnectToFbc = false; // stop updating - mFbcTestListUpdater->setActive(false); + mFacebookListUpdater->setActive(false); } + + if (LLFacebookConnect::instance().generation() != mFacebookListGeneration) + { + mFacebookListGeneration = LLFacebookConnect::instance().generation(); + LLSD friends = LLFacebookConnect::instance().getContent(); + + mFacebookFriends->clear(); + LLPersonTabModel::tab_type tab_type; + LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance(); + + for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) + { + std::string name = i->second["name"].asString(); + LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); + + //add to avatar list + mFacebookFriends->addNewItem(agent_id, name, false); + + //FB+SL but not SL friend + if (agent_id.notNull() && !avatar_tracker.isBuddy(agent_id)) + { + tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; + } + //FB only friend + else + { + tab_type = LLPersonTabModel::FB_ONLY_FRIEND; + } + + //Add to person tab model + LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(tab_type)); + if (person_tab_model) + { + addParticipantToModel(person_tab_model, agent_id, name); + } + } + } } void LLPanelPeople::updateButtons() diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 2f74064327..6b5514deaf 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -88,7 +88,7 @@ private: void updateFriendList(); void updateNearbyList(); void updateRecentList(); - void updateFbcTestList(); + void updateFacebookList(); bool isItemsFreeOfFriends(const uuid_vec_t& uuids); @@ -152,6 +152,7 @@ private: LLAvatarList* mRecentList; LLGroupList* mGroupList; LLSocialList* mFacebookFriends; + S32 mFacebookListGeneration; LLNetMap* mMiniMap; std::vector mSavedOriginalFilters; @@ -162,7 +163,7 @@ private: Updater* mFriendListUpdater; Updater* mNearbyListUpdater; Updater* mRecentListUpdater; - Updater* mFbcTestListUpdater; + Updater* mFacebookListUpdater; Updater* mButtonsUpdater; LLMenuButton* mFBCGearButton; LLHandle< LLFloater > mPicker; -- cgit v1.2.3 From 81ffd3fccac709a5903dd0d7572db50c50850347 Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Mon, 13 May 2013 18:32:03 -0400 Subject: Whinge reduction effort on the unit tests. Python 2.7 SocketServer library has new exception-throwing behavior when a client disconnects unannounced. Generally ignore exceptions as a result as we don't care about the server side. On HTTP trace-mode tests, spin a little faster and longer to give libcurl time to emit all the junk it wants to send us. Should reduce 'reasonable time' failures on tests <12> and <13>. --- indra/llcorehttp/tests/test_httprequest.hpp | 12 ++++----- indra/llcorehttp/tests/test_llcorehttp_peer.py | 35 +++++++++++++++++++++----- 2 files changed, 35 insertions(+), 12 deletions(-) diff --git a/indra/llcorehttp/tests/test_httprequest.hpp b/indra/llcorehttp/tests/test_httprequest.hpp index ff84b04070..e2021bac12 100644 --- a/indra/llcorehttp/tests/test_httprequest.hpp +++ b/indra/llcorehttp/tests/test_httprequest.hpp @@ -1226,11 +1226,11 @@ void HttpRequestTestObjectType::test<12>() // Run the notification pump. int count(0); - int limit(10); + int limit(200); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(10000); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -1339,8 +1339,8 @@ void HttpRequestTestObjectType::test<13>() HttpHandle handle = req->requestGetByteRange(HttpRequest::DEFAULT_POLICY_ID, 0U, url_base, - 0, - 0, + 0, + 0, opts, NULL, &handler); @@ -1352,11 +1352,11 @@ void HttpRequestTestObjectType::test<13>() // Run the notification pump. int count(0); - int limit(10); + int limit(200); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(10000); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); diff --git a/indra/llcorehttp/tests/test_llcorehttp_peer.py b/indra/llcorehttp/tests/test_llcorehttp_peer.py index 8796ae57c7..3c3af8dc75 100644 --- a/indra/llcorehttp/tests/test_llcorehttp_peer.py +++ b/indra/llcorehttp/tests/test_llcorehttp_peer.py @@ -73,6 +73,8 @@ class TestHTTPRequestHandler(BaseHTTPRequestHandler): Some combinations make no sense, there's no effort to protect you from that. """ + ignore_exceptions = (Exception,) + def read(self): # The following logic is adapted from the library module # SimpleXMLRPCServer.py. @@ -112,20 +114,29 @@ class TestHTTPRequestHandler(BaseHTTPRequestHandler): def do_GET(self, withdata=True): # Of course, don't attempt to read data. - self.answer(dict(reply="success", status=200, - reason="Your GET operation worked")) + try: + self.answer(dict(reply="success", status=200, + reason="Your GET operation worked")) + except self.ignore_exceptions, e: + print >> sys.stderr, "Exception during GET (ignoring): %s" % str(e) def do_POST(self): # Read the provided POST data. # self.answer(self.read()) - self.answer(dict(reply="success", status=200, - reason=self.read())) + try: + self.answer(dict(reply="success", status=200, + reason=self.read())) + except self.ignore_exceptions, e: + print >> sys.stderr, "Exception during POST (ignoring): %s" % str(e) def do_PUT(self): # Read the provided PUT data. # self.answer(self.read()) - self.answer(dict(reply="success", status=200, - reason=self.read())) + try: + self.answer(dict(reply="success", status=200, + reason=self.read())) + except self.ignore_exceptions, e: + print >> sys.stderr, "Exception during PUT (ignoring): %s" % str(e) def answer(self, data, withdata=True): debug("%s.answer(%s): self.path = %r", self.__class__.__name__, data, self.path) @@ -223,6 +234,17 @@ class Server(ThreadingMixIn, HTTPServer): # operation of freeport() absolutely depends on it being off. allow_reuse_address = False + # Override of BaseServer.handle_error(). Not too interested + # in errors and the default handler emits a scary traceback + # to stderr which annoys some. Disable this override to get + # default behavior which *shouldn't* cause the program to return + # a failure status. + def handle_error(self, request, client_address): + print '-'*40 + print 'Ignoring exception during processing of request from', + print client_address + print '-'*40 + if __name__ == "__main__": do_valgrind = False path_search = False @@ -249,3 +271,4 @@ if __name__ == "__main__": args = ["valgrind", "--log-file=./valgrind.log"] + args path_search = True sys.exit(run(server=Thread(name="httpd", target=httpd.serve_forever), use_path=path_search, *args)) + -- cgit v1.2.3 From b864cecd6c938b18cf05f7695f33f4da3b608a47 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 13 May 2013 16:34:52 -0700 Subject: De-bork the viewer merge, causing black in-world images. Reviewed by Kelly --- indra/llrender/llimagegl.cpp | 9 +++------ indra/llrender/llshadermgr.cpp | 2 -- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 5aef2c972e..0a0429846a 100755 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -715,12 +715,9 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips) mMipLevels = wpo2(llmax(w, h)); - if (!gGLManager.mHasFramebufferObject) - { - //use legacy mipmap generation mode - glTexParameteri(mTarget, GL_GENERATE_MIPMAP, GL_TRUE); - } - + //use legacy mipmap generation mode (note: making this condional can cause rendering issues) + glTexParameteri(mTarget, GL_GENERATE_MIPMAP, GL_TRUE); + LLImageGL::setManualImage(mTarget, 0, mFormatInternal, w, h, mFormatPrimary, mFormatType, diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 825f80a6dc..4893b1d043 100755 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -1120,8 +1120,6 @@ void LLShaderMgr::initAttribsAndUniforms() mReservedUniforms.push_back("matrixPalette"); - - mReservedUniforms.reserve(12); mReservedUniforms.push_back("screenTex"); mReservedUniforms.push_back("screenDepth"); mReservedUniforms.push_back("refTex"); -- cgit v1.2.3 From b27899ee0e035ebd4072a5e6162678f2afe81053 Mon Sep 17 00:00:00 2001 From: Geenz Date: Mon, 13 May 2013 19:39:45 -0400 Subject: Added IME input window white list. --- indra/llwindow/llappdelegate-objc.h | 4 ++++ indra/newview/SecondLife.nib | Bin 12997 -> 13009 bytes indra/newview/SecondLife.xib | 25 ++++++++++++-------- indra/newview/llappdelegate-objc.mm | 45 ++++++++++++++++++++++++++++++------ 4 files changed, 57 insertions(+), 17 deletions(-) diff --git a/indra/llwindow/llappdelegate-objc.h b/indra/llwindow/llappdelegate-objc.h index e7f6ecd5fc..be9ad4d79f 100644 --- a/indra/llwindow/llappdelegate-objc.h +++ b/indra/llwindow/llappdelegate-objc.h @@ -14,12 +14,16 @@ NSWindow *inputWindow; LLNonInlineTextView *inputView; NSTimer *frameTimer; + NSString *currentInputLanguage; } @property (assign) IBOutlet LLNSWindow *window; @property (assign) IBOutlet NSWindow *inputWindow; @property (assign) IBOutlet LLNonInlineTextView *inputView; +@property (retain) NSString *currentInputLanguage; + - (void) mainLoop; - (void) showInputWindow:(bool)show; +- (void) languageUpdated; @end diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib index 0b0ff5308b..cb289ebf09 100644 Binary files a/indra/newview/SecondLife.nib and b/indra/newview/SecondLife.nib differ diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib index fdfea49c42..c6b72485a1 100644 --- a/indra/newview/SecondLife.xib +++ b/indra/newview/SecondLife.xib @@ -2,9 +2,9 @@ 1060 - 12D78 + 12E30 3084 - 1187.37 + 1187.39 626.00 com.apple.InterfaceBuilder.CocoaPlugin @@ -329,16 +329,13 @@ - + 256 {1024, 600} - - - _NS:20 - {{0, 0}, {2560, 1440}} + {{0, 0}, {2560, 1418}} {10000000000000, 10000000000000} Second Life 128 @@ -349,7 +346,7 @@ 2 {{272, 176}, {938, 42}} -1535638528 - Window + Input Window NSPanel @@ -536,7 +533,7 @@ _NS:21 - {{0, 0}, {2560, 1440}} + {{0, 0}, {2560, 1418}} {10000000000000, 10000000000000} YES @@ -1112,7 +1109,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + @@ -1182,6 +1179,14 @@ ./Classes/LLNonInlineTextView.h + + NSLayoutConstraint + NSObject + + IBProjectSource + ./Classes/NSLayoutConstraint.h + + 0 diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 8da44fcf33..de77447006 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -8,12 +8,14 @@ #import "llappdelegate-objc.h" #include "llwindowmacosx-objc.h" +#include // Used for Text Input Services ("Safe" API - it's well supported) @implementation LLAppDelegate @synthesize window; @synthesize inputWindow; @synthesize inputView; +@synthesize currentInputLanguage; - (void)dealloc { @@ -24,12 +26,16 @@ { frameTimer = nil; + [self languageUpdated]; + if (initViewer()) { frameTimer = [NSTimer scheduledTimerWithTimeInterval:0.0 target:self selector:@selector(mainLoop) userInfo:nil repeats:YES]; } else { handleQuit(); } + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(languageUpdated) name:@"NSTextInputContextKeyboardSelectionDidChangeNotification" object:nil]; } - (void) applicationDidBecomeActive:(NSNotification *)notification @@ -67,15 +73,40 @@ - (void) showInputWindow:(bool)show { - if (show) + // How to add support for new languages with the input window: + // Simply append this array with the language code (ja for japanese, ko for korean, zh for chinese, etc.) + NSArray *authorizedLanguages = [[NSArray alloc] initWithObjects:@"ja", @"ko", @"zh-Hant", @"zh-Hans", nil]; + + if ([authorizedLanguages containsObject:currentInputLanguage]) { - NSLog(@"Showing input window."); - [inputWindow makeKeyAndOrderFront:inputWindow]; - } else { - NSLog(@"Hiding input window."); - [inputWindow orderOut:inputWindow]; - [window makeKeyAndOrderFront:window]; + if (show) + { + NSLog(@"Showing input window."); + [inputWindow makeKeyAndOrderFront:inputWindow]; + } else { + NSLog(@"Hiding input window."); + [inputWindow orderOut:inputWindow]; + [window makeKeyAndOrderFront:window]; + } } } +// This will get called multiple times by NSNotificationCenter. +// It will be called every time that the window focus changes, and every time that the input language gets changed. +// The primary use case for this selector is to update our current input language when the user, for whatever reason, changes the input language. +// This is the more elegant way of handling input language changes instead of checking every time we want to use the input window. + +- (void) languageUpdated +{ + TISInputSourceRef currentInput = TISCopyCurrentKeyboardInputSource(); + CFArrayRef languages = (CFArrayRef)TISGetInputSourceProperty(currentInput, kTISPropertyInputSourceLanguages); + +#if 1 // In the event of ever needing to add new language sources, change this to 1 and watch the terminal for "languages:" + NSLog(@"languages: %@", TISGetInputSourceProperty(currentInput, kTISPropertyInputSourceLanguages)); +#endif + + // Typically the language we want is going to be the very first result in the array. + currentInputLanguage = (NSString*)CFArrayGetValueAtIndex(languages, 0); +} + @end -- cgit v1.2.3 From dbef09a2bb629cf6001a3963f6899bcac53b7774 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 13 May 2013 18:29:28 -0700 Subject: ACME-344 : Menu hooked up. Readded the missing completedHeader() methods in responder that I mistakenly took out during the refactor. --- indra/newview/llfacebookconnect.cpp | 28 +++++++++++++++++++--- indra/newview/llfacebookconnect.h | 1 + indra/newview/llpanelpeople.cpp | 8 ------- indra/newview/llpanelpeople.h | 1 - indra/newview/llviewermenu.cpp | 19 +++++++++++++++ indra/newview/llviewermenu.h | 4 ++++ indra/newview/skins/default/xui/en/menu_viewer.xml | 2 +- 7 files changed, 50 insertions(+), 13 deletions(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 7f8e3afe89..39aa82dc7a 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -31,12 +31,13 @@ #include "llagent.h" #include "llcallingcard.h" // for LLAvatarTracker -//#include "llcommandhandler.h" +#include "llcommandhandler.h" #include "llhttpclient.h" +#include "llurlaction.h" /////////////////////////////////////////////////////////////////////////////// // -/* + class LLFacebookConnectHandler : public LLCommandHandler { public: @@ -59,7 +60,6 @@ public: } }; LLFacebookConnectHandler gFacebookConnectHandler; -*/ /////////////////////////////////////////////////////////////////////////////// // @@ -83,6 +83,15 @@ public: LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL; } } + + void completedHeader(U32 status, const std::string& reason, const LLSD& content) + { + if (status == 302) + { + LLFacebookConnect::instance().openFacebookWeb(content["location"]); + } + } + }; /////////////////////////////////////////////////////////////////////////////// @@ -163,6 +172,14 @@ public: LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL; } } + + void completedHeader(U32 status, const std::string& reason, const LLSD& content) + { + if (status == 302) + { + LLFacebookConnect::instance().openFacebookWeb(content["location"]); + } + } }; @@ -175,6 +192,11 @@ LLFacebookConnect::LLFacebookConnect() { } +void LLFacebookConnect::openFacebookWeb(std::string url) +{ + LLUrlAction::openURLExternal(url); +} + std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route) { //static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index 691aaa9131..8036c9ce3e 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -55,6 +55,7 @@ public: bool getConnected() { return mConnectedToFbc; } S32 generation() { return mGeneration; } + void openFacebookWeb(std::string url); private: friend class LLSingleton; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 542597f98b..ba7015faf5 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -75,7 +75,6 @@ #include "llsociallist.h" #include "llspeakers.h" #include "llfloaterwebcontent.h" -#include "llurlaction.h" #define FRIEND_LIST_UPDATE_TIMEOUT 0.5 #define NEARBY_LIST_UPDATE_INTERVAL 1 @@ -1645,13 +1644,6 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name) return isAccordionCollapsedByUser(getChild(name)); } -/* -void LLPanelPeople::openFacebookWeb(std::string url) -{ - LLUrlAction::openURLExternal(url); -} -*/ - void LLPanelPeople::addTestParticipant() { std::string suffix("Aa"); diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 6b5514deaf..be780bec5e 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -62,7 +62,6 @@ public: static void idle(void * user_data); -// void openFacebookWeb(std::string url); void addTestParticipant(); void addParticipantToModel(LLPersonTabModel * session_model, const LLUUID& agent_id, const std::string& name); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index beca08203f..bb9ad8c606 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -52,6 +52,7 @@ #include "lldaycyclemanager.h" #include "lldebugview.h" #include "llenvmanager.h" +#include "llfacebookconnect.h" #include "llfilepicker.h" #include "llfirstuse.h" #include "llfloaterbuy.h" @@ -5970,6 +5971,21 @@ void handle_report_abuse() LLFloaterReporter::showFromMenu(COMPLAINT_REPORT); } +void handle_facebook_connect() +{ + if (LLFacebookConnect::instance().getConnected()) + { + LLFacebookConnect::instance().disconnectFromFacebook(); + } + else + { + LLFacebookConnect::instance().getConnectionToFacebook(); + } +} + +//bool is_facebook_connected(); + + void handle_buy_currency() { LLBuyCurrencyHTML::openCurrencyFloater(); @@ -8719,4 +8735,7 @@ void initialize_menus() view_listener_t::addMenu(new LLEditableSelected(), "EditableSelected"); view_listener_t::addMenu(new LLEditableSelectedMono(), "EditableSelectedMono"); view_listener_t::addMenu(new LLToggleUIHints(), "ToggleUIHints"); + + // Facebook Connect + commit.add("Facebook.Connect", boost::bind(&handle_facebook_connect)); } diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index 143420e227..b916d95b7a 100644 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -135,6 +135,10 @@ bool enable_pay_object(); bool enable_buy_object(); bool handle_go_to(); +// Facebook Connect +void handle_facebook_connect(); +//bool is_facebook_connected(); + // Export to XML or Collada void handle_export_selected( void * ); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 9ce360415c..b34816fb14 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -19,7 +19,7 @@ label="Connect to Facebook..." name="ConnectToFacebook"> + function="Facebook.Connect" /> Date: Tue, 14 May 2013 00:53:42 -0400 Subject: Fix incorrect generation of Info.plist. Use a custom Info.plist template here. --- indra/newview/CMakeLists.txt | 25 +++++++++++++++---------- indra/newview/Info-SecondLife.plist | 30 ++++++++++++++++++++---------- 2 files changed, 35 insertions(+), 20 deletions(-) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index bf0913a06b..221d421f30 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1965,20 +1965,25 @@ if (LINUX) endif (LINUX) if (DARWIN) + # These all get set with PROPERTIES set(product "Second Life") - + set(MACOSX_BUNDLE_INFO_STRING "Second Life Viewer") + set(MACOSX_BUNDLE_ICON_FILE "secondlife.icns") + set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.secondlife.indra.viewer") + set(MACOSX_BUNDLE_LONG_VERSION_STRING "${VIEWER_CHANNEL} ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}") + set(MACOSX_BUNDLE_BUNDLE_NAME "SecondLife") + set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VIEWER_SHORT_VERSION}") + set(MACOSX_BUNDLE_BUNDLE_VERSION "${VIEWER_SHORT_VERSION}${VIEWER_MACOSX_PHASE}${VIEWER_REVISION}") + set(MACOSX_BUNDLE_COPYRIGHT "Copyright © Linden Research, Inc. 2007") + set(MACOSX_BUNDLE_NSMAIN_NIB_FILE "SecondLife.nib") + set(MACOSX_BUNDLE_NSPRINCIPAL_CLASS "NSApplication") + set_target_properties( ${VIEWER_BINARY_NAME} PROPERTIES - OUTPUT_NAME "${product}" - MACOSX_BUNDLE_INFO_STRING "Second Life Viewer" - MACOSX_BUNDLE_ICON_FILE "secondlife.icns" - MACOSX_BUNDLE_GUI_IDENTIFIER "com.secondlife.indra.viewer" - MACOSX_BUNDLE_LONG_VERSION_STRING "${VIEWER_CHANNEL} ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}" - MACOSX_BUNDLE_BUNDLE_NAME "Second Life" - MACOSX_BUNDLE_SHORT_VERSION_STRING "${VIEWER_SHORT_VERSION}" - MACOSX_BUNDLE_BUNDLE_VERSION "${VIEWER_SHORT_VERSION}${VIEWER_MACOSX_PHASE}${VIEWER_REVISION}" - MACOSX_BUNDLE_COPYRIGHT "Copyright © Linden Research, Inc. 2007" + OUTPUT_NAME "${product}" + MACOSX_BUNDLE_INFO_PLIST + "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" ) configure_file( diff --git a/indra/newview/Info-SecondLife.plist b/indra/newview/Info-SecondLife.plist index c7f1090e86..f584b61768 100755 --- a/indra/newview/Info-SecondLife.plist +++ b/indra/newview/Info-SecondLife.plist @@ -5,19 +5,33 @@ CFBundleDevelopmentRegion English CFBundleExecutable - Second Life + ${MACOSX_BUNDLE_EXECUTABLE_NAME} + CFBundleGetInfoString + ${MACOSX_BUNDLE_INFO_STRING} CFBundleIconFile - secondlife.icns + ${MACOSX_BUNDLE_ICON_FILE} CFBundleIdentifier - com.secondlife.indra.viewer + ${MACOSX_BUNDLE_GUI_IDENTIFIER} CFBundleInfoDictionaryVersion 6.0 + CFBundleLongVersionString + ${MACOSX_BUNDLE_LONG_VERSION_STRING} CFBundleName - SecondLife + ${MACOSX_BUNDLE_BUNDLE_NAME} CFBundlePackageType APPL + CFBundleShortVersionString + ${MACOSX_BUNDLE_SHORT_VERSION_STRING} CFBundleSignature ???? + CFBundleVersion + ${MACOSX_BUNDLE_BUNDLE_VERSION} + CSResourcesFileMapped + + LSRequiresCarbon + + NSHumanReadableCopyright + ${MACOSX_BUNDLE_COPYRIGHT} CFBundleDocumentTypes @@ -59,13 +73,9 @@ - CFBundleVersion - ${VIEWER_VERSION_MAJOR}.${VIEWER_VERSION_MINOR}.${VIEWER_VERSION_PATCH}.${VIEWER_VERSION_REVISION} NSPrincipalClass - NSApplication + ${MACOSX_BUNDLE_NSPRINCIPAL_CLASS} NSMainNibFile - SecondLife - CSResourcesFileMapped - + ${MACOSX_BUNDLE_NSMAIN_NIB_FILE} -- cgit v1.2.3 From 5683fe2fa332244a7e1e172021663a7d22c58e0c Mon Sep 17 00:00:00 2001 From: Geenz Date: Tue, 14 May 2013 01:05:09 -0400 Subject: Fix the viewer bundle version not being set appropriately. --- indra/newview/Info-SecondLife.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/Info-SecondLife.plist b/indra/newview/Info-SecondLife.plist index f584b61768..9b8136a827 100755 --- a/indra/newview/Info-SecondLife.plist +++ b/indra/newview/Info-SecondLife.plist @@ -25,7 +25,7 @@ CFBundleSignature ???? CFBundleVersion - ${MACOSX_BUNDLE_BUNDLE_VERSION} + ${VIEWER_VERSION_MAJOR}.${VIEWER_VERSION_MINOR}.${VIEWER_VERSION_PATCH}.${VIEWER_VERSION_REVISION} CSResourcesFileMapped LSRequiresCarbon -- cgit v1.2.3 From 8a83408185ab3aa8d05f2e13b6b8592329d4651a Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Tue, 14 May 2013 11:52:12 -0400 Subject: MAINT-2302 Tests frequently fail on Windows builds. I'm calling this the more correct fix. The httprequest tests actually talk to an HTTP server running in the Python test scaffold script. Under severe CPU competition, it may not get the cycles needed to start up and make progress. So this modifies the test to spin a little faster and dwell waiting on the server for a longer period. Hope this will be adequate to make the tests reliable. --- indra/llcorehttp/tests/test_httprequest.hpp | 245 ++++++++++++++-------------- 1 file changed, 127 insertions(+), 118 deletions(-) diff --git a/indra/llcorehttp/tests/test_httprequest.hpp b/indra/llcorehttp/tests/test_httprequest.hpp index e2021bac12..900a699887 100755 --- a/indra/llcorehttp/tests/test_httprequest.hpp +++ b/indra/llcorehttp/tests/test_httprequest.hpp @@ -45,6 +45,15 @@ using namespace LLCoreInt; +// spin/sleep waiting times for client/server exchange tests +// +// These are now fairly generous to try to get around timeout +// ('reasonable time') failures during execution on a heavily- +// loaded system where the unit test is in competition with +// other programs. +static const int LOOP_SLEEP_INTERVAL(10000); +static const int LOOP_COUNT_SHORT(500); // 5-second dwell time +static const int LOOP_COUNT_LONG(3000); // 30-second dwell time namespace { @@ -294,11 +303,11 @@ void HttpRequestTestObjectType::test<3>() // Run the notification pump. int count(0); - int limit(20); + int limit(LOOP_COUNT_SHORT); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -309,21 +318,21 @@ void HttpRequestTestObjectType::test<3>() // Run the notification pump again count = 0; - limit = 100; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -392,12 +401,12 @@ void HttpRequestTestObjectType::test<4>() // Run the notification pump. int count(0); - int limit(20); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 2) { req1->update(1000000); req2->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 2); @@ -409,22 +418,22 @@ void HttpRequestTestObjectType::test<4>() // Run the notification pump again count = 0; - limit = 100; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 3) { req1->update(1000000); req2->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 3); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -493,11 +502,11 @@ void HttpRequestTestObjectType::test<5>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_SHORT); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("NoOp notification received", mHandlerCalls == 1); @@ -569,11 +578,11 @@ void HttpRequestTestObjectType::test<6>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_SHORT); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("No notifications received", mHandlerCalls == 0); @@ -650,11 +659,11 @@ void HttpRequestTestObjectType::test<7>() // Run the notification pump. int count(0); - int limit(50); // With one retry, should fail quickish + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -666,21 +675,21 @@ void HttpRequestTestObjectType::test<7>() // Run the notification pump again count = 0; - limit = 100; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -766,11 +775,11 @@ void HttpRequestTestObjectType::test<8>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -782,21 +791,21 @@ void HttpRequestTestObjectType::test<8>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -876,11 +885,11 @@ void HttpRequestTestObjectType::test<9>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -892,21 +901,21 @@ void HttpRequestTestObjectType::test<9>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -988,11 +997,11 @@ void HttpRequestTestObjectType::test<10>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -1004,21 +1013,21 @@ void HttpRequestTestObjectType::test<10>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -1106,11 +1115,11 @@ void HttpRequestTestObjectType::test<11>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -1122,21 +1131,21 @@ void HttpRequestTestObjectType::test<11>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -1226,11 +1235,11 @@ void HttpRequestTestObjectType::test<12>() // Run the notification pump. int count(0); - int limit(200); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(10000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -1242,21 +1251,21 @@ void HttpRequestTestObjectType::test<12>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -1352,11 +1361,11 @@ void HttpRequestTestObjectType::test<13>() // Run the notification pump. int count(0); - int limit(200); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(10000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -1369,21 +1378,21 @@ void HttpRequestTestObjectType::test<13>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -1471,11 +1480,11 @@ void HttpRequestTestObjectType::test<14>() // Run the notification pump. int count(0); - int limit(50); // With one retry, should fail quickish + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -1487,21 +1496,21 @@ void HttpRequestTestObjectType::test<14>() // Run the notification pump again count = 0; - limit = 100; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -1594,11 +1603,11 @@ void HttpRequestTestObjectType::test<15>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -1611,21 +1620,21 @@ void HttpRequestTestObjectType::test<15>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -1724,11 +1733,11 @@ void HttpRequestTestObjectType::test<16>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -1764,11 +1773,11 @@ void HttpRequestTestObjectType::test<16>() // Run the notification pump. count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 2); @@ -1783,21 +1792,21 @@ void HttpRequestTestObjectType::test<16>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 3) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 3); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -1919,11 +1928,11 @@ void HttpRequestTestObjectType::test<17>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -1938,21 +1947,21 @@ void HttpRequestTestObjectType::test<17>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -2079,11 +2088,11 @@ void HttpRequestTestObjectType::test<18>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -2098,21 +2107,21 @@ void HttpRequestTestObjectType::test<18>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -2237,11 +2246,11 @@ void HttpRequestTestObjectType::test<19>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -2255,21 +2264,21 @@ void HttpRequestTestObjectType::test<19>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -2401,11 +2410,11 @@ void HttpRequestTestObjectType::test<20>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -2420,21 +2429,21 @@ void HttpRequestTestObjectType::test<20>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -2569,11 +2578,11 @@ void HttpRequestTestObjectType::test<21>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -2588,21 +2597,21 @@ void HttpRequestTestObjectType::test<21>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -2712,11 +2721,11 @@ void HttpRequestTestObjectType::test<22>() // Run the notification pump. int count(0); - int limit(30); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < test_count) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time - ms1", count < limit); ensure("One handler invocation for each request - ms1", mHandlerCalls == test_count); @@ -2744,11 +2753,11 @@ void HttpRequestTestObjectType::test<22>() // Run the notification pump. count = 0; - limit = 30; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < test2_count) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time - ms2", count < limit); ensure("One handler invocation for each request - ms2", mHandlerCalls == test2_count); @@ -2776,11 +2785,11 @@ void HttpRequestTestObjectType::test<22>() // Run the notification pump. count = 0; - limit = 30; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < test3_count) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time - ms3", count < limit); ensure("One handler invocation for each request - ms3", mHandlerCalls == test3_count); @@ -2795,21 +2804,21 @@ void HttpRequestTestObjectType::test<22>() // Run the notification pump again count = 0; - limit = 20; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Shutdown request executed in reasonable time", count < limit); ensure("Shutdown handler invocation", mHandlerCalls == 1); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); -- cgit v1.2.3 From f111b5b1135ee31434acb81d5a3e63e4812e257f Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 14 May 2013 09:24:58 -0700 Subject: Fix EOL characters --- indra/llcommon/llstringtable.h | 418 ++++++++++++++++---------------- indra/llrender/llpostprocess.h | 534 ++++++++++++++++++++--------------------- 2 files changed, 476 insertions(+), 476 deletions(-) diff --git a/indra/llcommon/llstringtable.h b/indra/llcommon/llstringtable.h index 787a046741..ff09e71677 100755 --- a/indra/llcommon/llstringtable.h +++ b/indra/llcommon/llstringtable.h @@ -1,209 +1,209 @@ -/** - * @file llstringtable.h - * @brief The LLStringTable class provides a _fast_ method for finding - * unique copies of strings. - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_STRING_TABLE_H -#define LL_STRING_TABLE_H - -#include "lldefs.h" -#include "llformat.h" -#include "llstl.h" -#include -#include - -#if LL_WINDOWS -# if (_MSC_VER >= 1300 && _MSC_VER < 1400) -# define STRING_TABLE_HASH_MAP 1 -# endif -#else -//# define STRING_TABLE_HASH_MAP 1 -#endif - -const U32 MAX_STRINGS_LENGTH = 256; - -class LL_COMMON_API LLStringTableEntry -{ -public: - LLStringTableEntry(const char *str); - ~LLStringTableEntry(); - - void incCount() { mCount++; } - BOOL decCount() { return --mCount; } - - char *mString; - S32 mCount; -}; - -class LL_COMMON_API LLStringTable -{ -public: - LLStringTable(int tablesize); - ~LLStringTable(); - - char *checkString(const char *str); - char *checkString(const std::string& str); - LLStringTableEntry *checkStringEntry(const char *str); - LLStringTableEntry *checkStringEntry(const std::string& str); - - char *addString(const char *str); - char *addString(const std::string& str); - LLStringTableEntry *addStringEntry(const char *str); - LLStringTableEntry *addStringEntry(const std::string& str); - void removeString(const char *str); - - S32 mMaxEntries; - S32 mUniqueEntries; - -#if STRING_TABLE_HASH_MAP -#if LL_WINDOWS - typedef std::hash_multimap string_hash_t; -#else - typedef __gnu_cxx::hash_multimap string_hash_t; -#endif - string_hash_t mStringHash; -#else - typedef std::list string_list_t; - typedef string_list_t * string_list_ptr_t; - string_list_ptr_t *mStringList; -#endif -}; - -extern LL_COMMON_API LLStringTable gStringTable; - -//============================================================================ - -// This class is designed to be used locally, -// e.g. as a member of an LLXmlTree -// Strings can be inserted only, then quickly looked up - -typedef const std::string* LLStdStringHandle; - -class LL_COMMON_API LLStdStringTable -{ -public: - LLStdStringTable(S32 tablesize = 0) - { - if (tablesize == 0) - { - tablesize = 256; // default - } - // Make sure tablesize is power of 2 - for (S32 i = 31; i>0; i--) - { - if (tablesize & (1<= (3<<(i-1))) - tablesize = (1<<(i+1)); - else - tablesize = (1< > string_set_t; - string_set_t* mStringList; // [mTableSize] -}; - - -#endif +/** + * @file llstringtable.h + * @brief The LLStringTable class provides a _fast_ method for finding + * unique copies of strings. + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_STRING_TABLE_H +#define LL_STRING_TABLE_H + +#include "lldefs.h" +#include "llformat.h" +#include "llstl.h" +#include +#include + +#if LL_WINDOWS +# if (_MSC_VER >= 1300 && _MSC_VER < 1400) +# define STRING_TABLE_HASH_MAP 1 +# endif +#else +//# define STRING_TABLE_HASH_MAP 1 +#endif + +const U32 MAX_STRINGS_LENGTH = 256; + +class LL_COMMON_API LLStringTableEntry +{ +public: + LLStringTableEntry(const char *str); + ~LLStringTableEntry(); + + void incCount() { mCount++; } + BOOL decCount() { return --mCount; } + + char *mString; + S32 mCount; +}; + +class LL_COMMON_API LLStringTable +{ +public: + LLStringTable(int tablesize); + ~LLStringTable(); + + char *checkString(const char *str); + char *checkString(const std::string& str); + LLStringTableEntry *checkStringEntry(const char *str); + LLStringTableEntry *checkStringEntry(const std::string& str); + + char *addString(const char *str); + char *addString(const std::string& str); + LLStringTableEntry *addStringEntry(const char *str); + LLStringTableEntry *addStringEntry(const std::string& str); + void removeString(const char *str); + + S32 mMaxEntries; + S32 mUniqueEntries; + +#if STRING_TABLE_HASH_MAP +#if LL_WINDOWS + typedef std::hash_multimap string_hash_t; +#else + typedef __gnu_cxx::hash_multimap string_hash_t; +#endif + string_hash_t mStringHash; +#else + typedef std::list string_list_t; + typedef string_list_t * string_list_ptr_t; + string_list_ptr_t *mStringList; +#endif +}; + +extern LL_COMMON_API LLStringTable gStringTable; + +//============================================================================ + +// This class is designed to be used locally, +// e.g. as a member of an LLXmlTree +// Strings can be inserted only, then quickly looked up + +typedef const std::string* LLStdStringHandle; + +class LL_COMMON_API LLStdStringTable +{ +public: + LLStdStringTable(S32 tablesize = 0) + { + if (tablesize == 0) + { + tablesize = 256; // default + } + // Make sure tablesize is power of 2 + for (S32 i = 31; i>0; i--) + { + if (tablesize & (1<= (3<<(i-1))) + tablesize = (1<<(i+1)); + else + tablesize = (1< > string_set_t; + string_set_t* mStringList; // [mTableSize] +}; + + +#endif diff --git a/indra/llrender/llpostprocess.h b/indra/llrender/llpostprocess.h index 6894505753..ce17b6693d 100755 --- a/indra/llrender/llpostprocess.h +++ b/indra/llrender/llpostprocess.h @@ -1,267 +1,267 @@ -/** - * @file llpostprocess.h - * @brief LLPostProcess class definition - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_POSTPROCESS_H -#define LL_POSTPROCESS_H - -#include -#include -#include "llgl.h" -#include "llglheaders.h" -#include "llstaticstringtable.h" - -class LLPostProcess -{ -public: - - typedef enum _QuadType { - QUAD_NORMAL, - QUAD_NOISE, - QUAD_BLOOM_EXTRACT, - QUAD_BLOOM_COMBINE - } QuadType; - - /// GLSL Shader Encapsulation Struct - typedef LLStaticStringTable glslUniforms; - - struct PostProcessTweaks : public LLSD { - inline PostProcessTweaks() : LLSD(LLSD::emptyMap()) - { - } - - inline LLSD & brightMult() { - return (*this)["brightness_multiplier"]; - } - - inline LLSD & noiseStrength() { - return (*this)["noise_strength"]; - } - - inline LLSD & noiseSize() { - return (*this)["noise_size"]; - } - - inline LLSD & extractLow() { - return (*this)["extract_low"]; - } - - inline LLSD & extractHigh() { - return (*this)["extract_high"]; - } - - inline LLSD & bloomWidth() { - return (*this)["bloom_width"]; - } - - inline LLSD & bloomStrength() { - return (*this)["bloom_strength"]; - } - - inline LLSD & brightness() { - return (*this)["brightness"]; - } - - inline LLSD & contrast() { - return (*this)["contrast"]; - } - - inline LLSD & contrastBaseR() { - return (*this)["contrast_base"][0]; - } - - inline LLSD & contrastBaseG() { - return (*this)["contrast_base"][1]; - } - - inline LLSD & contrastBaseB() { - return (*this)["contrast_base"][2]; - } - - inline LLSD & contrastBaseIntensity() { - return (*this)["contrast_base"][3]; - } - - inline LLSD & saturation() { - return (*this)["saturation"]; - } - - inline LLSD & useNightVisionShader() { - return (*this)["enable_night_vision"]; - } - - inline LLSD & useBloomShader() { - return (*this)["enable_bloom"]; - } - - inline LLSD & useColorFilter() { - return (*this)["enable_color_filter"]; - } - - - inline F32 getBrightMult() const { - return F32((*this)["brightness_multiplier"].asReal()); - } - - inline F32 getNoiseStrength() const { - return F32((*this)["noise_strength"].asReal()); - } - - inline F32 getNoiseSize() const { - return F32((*this)["noise_size"].asReal()); - } - - inline F32 getExtractLow() const { - return F32((*this)["extract_low"].asReal()); - } - - inline F32 getExtractHigh() const { - return F32((*this)["extract_high"].asReal()); - } - - inline F32 getBloomWidth() const { - return F32((*this)["bloom_width"].asReal()); - } - - inline F32 getBloomStrength() const { - return F32((*this)["bloom_strength"].asReal()); - } - - inline F32 getBrightness() const { - return F32((*this)["brightness"].asReal()); - } - - inline F32 getContrast() const { - return F32((*this)["contrast"].asReal()); - } - - inline F32 getContrastBaseR() const { - return F32((*this)["contrast_base"][0].asReal()); - } - - inline F32 getContrastBaseG() const { - return F32((*this)["contrast_base"][1].asReal()); - } - - inline F32 getContrastBaseB() const { - return F32((*this)["contrast_base"][2].asReal()); - } - - inline F32 getContrastBaseIntensity() const { - return F32((*this)["contrast_base"][3].asReal()); - } - - inline F32 getSaturation() const { - return F32((*this)["saturation"].asReal()); - } - - }; - - bool initialized; - PostProcessTweaks tweaks; - - // the map of all availible effects - LLSD mAllEffects; - -private: - LLPointer mSceneRenderTexture ; - LLPointer mNoiseTexture ; - LLPointer mTempBloomTexture ; - -public: - LLPostProcess(void); - - ~LLPostProcess(void); - - void apply(unsigned int width, unsigned int height); - void invalidate() ; - - /// Perform global initialization for this class. - static void initClass(void); - - // Cleanup of global data that's only inited once per class. - static void cleanupClass(); - - void setSelectedEffect(std::string const & effectName); - - inline std::string const & getSelectedEffect(void) const { - return mSelectedEffectName; - } - - void saveEffect(std::string const & effectName); - -private: - /// read in from file - std::string mShaderErrorString; - unsigned int screenW; - unsigned int screenH; - - float noiseTextureScale; - - /// Shader Uniforms - glslUniforms nightVisionUniforms; - glslUniforms bloomExtractUniforms; - glslUniforms bloomBlurUniforms; - glslUniforms colorFilterUniforms; - - // the name of currently selected effect in mAllEffects - // invariant: tweaks == mAllEffects[mSelectedEffectName] - std::string mSelectedEffectName; - - /// General functions - void initialize(unsigned int width, unsigned int height); - void doEffects(void); - void applyShaders(void); - bool shadersEnabled(void); - - /// Night Vision Functions - void createNightVisionShader(void); - void applyNightVisionShader(void); - - /// Bloom Functions - void createBloomShader(void); - void applyBloomShader(void); - - /// Color Filter Functions - void createColorFilterShader(void); - void applyColorFilterShader(void); - - /// OpenGL Helper Functions - void getShaderUniforms(glslUniforms & uniforms, GLhandleARB & prog); - void createTexture(LLPointer& texture, unsigned int width, unsigned int height); - void copyFrameBuffer(U32 & texture, unsigned int width, unsigned int height); - void createNoiseTexture(LLPointer& texture); - bool checkError(void); - void checkShaderError(GLhandleARB shader); - void drawOrthoQuad(unsigned int width, unsigned int height, QuadType type); - void viewOrthogonal(unsigned int width, unsigned int height); - void changeOrthogonal(unsigned int width, unsigned int height); - void viewPerspective(void); -}; - -extern LLPostProcess * gPostProcess; - - -#endif // LL_POSTPROCESS_H +/** + * @file llpostprocess.h + * @brief LLPostProcess class definition + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_POSTPROCESS_H +#define LL_POSTPROCESS_H + +#include +#include +#include "llgl.h" +#include "llglheaders.h" +#include "llstaticstringtable.h" + +class LLPostProcess +{ +public: + + typedef enum _QuadType { + QUAD_NORMAL, + QUAD_NOISE, + QUAD_BLOOM_EXTRACT, + QUAD_BLOOM_COMBINE + } QuadType; + + /// GLSL Shader Encapsulation Struct + typedef LLStaticStringTable glslUniforms; + + struct PostProcessTweaks : public LLSD { + inline PostProcessTweaks() : LLSD(LLSD::emptyMap()) + { + } + + inline LLSD & brightMult() { + return (*this)["brightness_multiplier"]; + } + + inline LLSD & noiseStrength() { + return (*this)["noise_strength"]; + } + + inline LLSD & noiseSize() { + return (*this)["noise_size"]; + } + + inline LLSD & extractLow() { + return (*this)["extract_low"]; + } + + inline LLSD & extractHigh() { + return (*this)["extract_high"]; + } + + inline LLSD & bloomWidth() { + return (*this)["bloom_width"]; + } + + inline LLSD & bloomStrength() { + return (*this)["bloom_strength"]; + } + + inline LLSD & brightness() { + return (*this)["brightness"]; + } + + inline LLSD & contrast() { + return (*this)["contrast"]; + } + + inline LLSD & contrastBaseR() { + return (*this)["contrast_base"][0]; + } + + inline LLSD & contrastBaseG() { + return (*this)["contrast_base"][1]; + } + + inline LLSD & contrastBaseB() { + return (*this)["contrast_base"][2]; + } + + inline LLSD & contrastBaseIntensity() { + return (*this)["contrast_base"][3]; + } + + inline LLSD & saturation() { + return (*this)["saturation"]; + } + + inline LLSD & useNightVisionShader() { + return (*this)["enable_night_vision"]; + } + + inline LLSD & useBloomShader() { + return (*this)["enable_bloom"]; + } + + inline LLSD & useColorFilter() { + return (*this)["enable_color_filter"]; + } + + + inline F32 getBrightMult() const { + return F32((*this)["brightness_multiplier"].asReal()); + } + + inline F32 getNoiseStrength() const { + return F32((*this)["noise_strength"].asReal()); + } + + inline F32 getNoiseSize() const { + return F32((*this)["noise_size"].asReal()); + } + + inline F32 getExtractLow() const { + return F32((*this)["extract_low"].asReal()); + } + + inline F32 getExtractHigh() const { + return F32((*this)["extract_high"].asReal()); + } + + inline F32 getBloomWidth() const { + return F32((*this)["bloom_width"].asReal()); + } + + inline F32 getBloomStrength() const { + return F32((*this)["bloom_strength"].asReal()); + } + + inline F32 getBrightness() const { + return F32((*this)["brightness"].asReal()); + } + + inline F32 getContrast() const { + return F32((*this)["contrast"].asReal()); + } + + inline F32 getContrastBaseR() const { + return F32((*this)["contrast_base"][0].asReal()); + } + + inline F32 getContrastBaseG() const { + return F32((*this)["contrast_base"][1].asReal()); + } + + inline F32 getContrastBaseB() const { + return F32((*this)["contrast_base"][2].asReal()); + } + + inline F32 getContrastBaseIntensity() const { + return F32((*this)["contrast_base"][3].asReal()); + } + + inline F32 getSaturation() const { + return F32((*this)["saturation"].asReal()); + } + + }; + + bool initialized; + PostProcessTweaks tweaks; + + // the map of all availible effects + LLSD mAllEffects; + +private: + LLPointer mSceneRenderTexture ; + LLPointer mNoiseTexture ; + LLPointer mTempBloomTexture ; + +public: + LLPostProcess(void); + + ~LLPostProcess(void); + + void apply(unsigned int width, unsigned int height); + void invalidate() ; + + /// Perform global initialization for this class. + static void initClass(void); + + // Cleanup of global data that's only inited once per class. + static void cleanupClass(); + + void setSelectedEffect(std::string const & effectName); + + inline std::string const & getSelectedEffect(void) const { + return mSelectedEffectName; + } + + void saveEffect(std::string const & effectName); + +private: + /// read in from file + std::string mShaderErrorString; + unsigned int screenW; + unsigned int screenH; + + float noiseTextureScale; + + /// Shader Uniforms + glslUniforms nightVisionUniforms; + glslUniforms bloomExtractUniforms; + glslUniforms bloomBlurUniforms; + glslUniforms colorFilterUniforms; + + // the name of currently selected effect in mAllEffects + // invariant: tweaks == mAllEffects[mSelectedEffectName] + std::string mSelectedEffectName; + + /// General functions + void initialize(unsigned int width, unsigned int height); + void doEffects(void); + void applyShaders(void); + bool shadersEnabled(void); + + /// Night Vision Functions + void createNightVisionShader(void); + void applyNightVisionShader(void); + + /// Bloom Functions + void createBloomShader(void); + void applyBloomShader(void); + + /// Color Filter Functions + void createColorFilterShader(void); + void applyColorFilterShader(void); + + /// OpenGL Helper Functions + void getShaderUniforms(glslUniforms & uniforms, GLhandleARB & prog); + void createTexture(LLPointer& texture, unsigned int width, unsigned int height); + void copyFrameBuffer(U32 & texture, unsigned int width, unsigned int height); + void createNoiseTexture(LLPointer& texture); + bool checkError(void); + void checkShaderError(GLhandleARB shader); + void drawOrthoQuad(unsigned int width, unsigned int height, QuadType type); + void viewOrthogonal(unsigned int width, unsigned int height); + void changeOrthogonal(unsigned int width, unsigned int height); + void viewPerspective(void); +}; + +extern LLPostProcess * gPostProcess; + + +#endif // LL_POSTPROCESS_H -- cgit v1.2.3 From 119e9b47f57f35e7657d4b653b73f66558b1323d Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Tue, 14 May 2013 16:56:27 -0400 Subject: SH-4190 Reactivate unit tests neutered under MAINT-3202 HttpStatus unit tests have never caused a unit test failure but they do have the word 'error' in their text descriptions which gets picked up by the log processor in TC builds. So, reactivate the tests and reform the descriptions. --- indra/llcorehttp/tests/test_httpstatus.hpp | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/indra/llcorehttp/tests/test_httpstatus.hpp b/indra/llcorehttp/tests/test_httpstatus.hpp index 887315befc..b5538528c5 100755 --- a/indra/llcorehttp/tests/test_httpstatus.hpp +++ b/indra/llcorehttp/tests/test_httpstatus.hpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2012&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2012, Linden Research, Inc. + * Copyright (C) 2012-2013, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -91,9 +91,6 @@ template <> template <> void HttpStatusTestObjectType::test<2>() { set_test_name("HttpStatus memory structure"); -#if LL_WINDOWS - skip("MAINT-2302: This frequently (though not always) fails on Windows."); -#endif // Require that an HttpStatus object can be trivially // returned as a function return value in registers. @@ -106,10 +103,7 @@ void HttpStatusTestObjectType::test<2>() template <> template <> void HttpStatusTestObjectType::test<3>() { - set_test_name("HttpStatus valid error string conversion"); -#if LL_WINDOWS - skip("MAINT-2302: This frequently (though not always) fails on Windows."); -#endif + set_test_name("HttpStatus valid status string conversion"); HttpStatus status; status.mType = HttpStatus::EXT_CURL_EASY; @@ -141,10 +135,7 @@ void HttpStatusTestObjectType::test<3>() template <> template <> void HttpStatusTestObjectType::test<4>() { - set_test_name("HttpStatus invalid error string conversion"); -#if LL_WINDOWS - skip("MAINT-2302: This frequently (though not always) fails on Windows."); -#endif + set_test_name("HttpStatus invalid status string conversion"); HttpStatus status; status.mType = HttpStatus::EXT_CURL_EASY; @@ -170,9 +161,6 @@ template <> template <> void HttpStatusTestObjectType::test<5>() { set_test_name("HttpStatus equality/inequality testing"); -#if LL_WINDOWS - skip("MAINT-2302: This frequently (though not always) fails on Windows."); -#endif // Make certain equality/inequality tests do not pass // through the bool conversion. Distinct successful @@ -193,9 +181,6 @@ template <> template <> void HttpStatusTestObjectType::test<6>() { set_test_name("HttpStatus basic HTTP status encoding"); -#if LL_WINDOWS - skip("MAINT-2302: This frequently (though not always) fails on Windows."); -#endif HttpStatus status; status.mType = 200; @@ -242,10 +227,7 @@ void HttpStatusTestObjectType::test<6>() template <> template <> void HttpStatusTestObjectType::test<7>() { - set_test_name("HttpStatus HTTP error text strings"); -#if LL_WINDOWS - skip("MAINT-2302: This frequently (though not always) fails on Windows."); -#endif + set_test_name("HttpStatus HTTP status text strings"); HttpStatus status(100, HE_REPLY_ERROR); std::string msg(status.toString()); -- cgit v1.2.3 From dd8295ab07fec9899e171a4f2ceb1298329ef7b5 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 14 May 2013 13:58:41 -0700 Subject: ACME-324 Populate list with FB only friends: Fixed a bug that was causing FB+SL friends to appear within the 'Invite people you know to Second Life' tab. --- indra/newview/llpanelpeople.cpp | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index ba7015faf5..0847878fb4 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -943,27 +943,31 @@ void LLPanelPeople::updateFacebookList() { std::string name = i->second["name"].asString(); LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); - + bool second_life_buddy = agent_id.notNull() ? avatar_tracker.isBuddy(agent_id) : false; + //add to avatar list mFacebookFriends->addNewItem(agent_id, name, false); - //FB+SL but not SL friend - if (agent_id.notNull() && !avatar_tracker.isBuddy(agent_id)) - { - tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; - } - //FB only friend - else - { - tab_type = LLPersonTabModel::FB_ONLY_FRIEND; - } - - //Add to person tab model - LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(tab_type)); - if (person_tab_model) - { - addParticipantToModel(person_tab_model, agent_id, name); - } + if(!second_life_buddy) + { + //FB+SL but not SL friend + if (agent_id.notNull()) + { + tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; + } + //FB only friend + else + { + tab_type = LLPersonTabModel::FB_ONLY_FRIEND; + } + + //Add to person tab model + LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(tab_type)); + if (person_tab_model) + { + addParticipantToModel(person_tab_model, agent_id, name); + } + } } } } -- cgit v1.2.3 From ec5bd94d59247e600f8f8702a543f99d40930d20 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 15 May 2013 11:00:00 -0700 Subject: BUG-2581 : [simon-ll-viewer-cat] Path cut, hollow and slice break planar texture mapping on prims. Credits to DaveP --- indra/llmath/llvolume.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 7751ef87ee..317d15f84e 100755 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -5604,16 +5604,16 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) LLVector4a binormal; calc_binormal_from_triangle(binormal, *mCenter, cuv, - pos[0], tc[0], - pos[1], tc[1]); + mPositions[0], mTexCoords[0], + mPositions[1], mTexCoords[1]); binormal.normalize3fast(); LLVector4a normal; LLVector4a d0, d1; - d0.setSub(*mCenter, pos[0]); - d1.setSub(*mCenter, pos[1]); + d0.setSub(*mCenter, mPositions[0]); + d1.setSub(*mCenter, mPositions[1]); if (mTypeMask & TOP_MASK) { -- cgit v1.2.3 From 435bda9df464ef7faaf8329ffa094dca9e82a6a4 Mon Sep 17 00:00:00 2001 From: JJ Linden Date: Wed, 15 May 2013 13:29:19 -0700 Subject: turned off distcc for linux builds --- BuildParams | 1 + 1 file changed, 1 insertion(+) diff --git a/BuildParams b/BuildParams index c929c2d90d..91e6471ae0 100644 --- a/BuildParams +++ b/BuildParams @@ -23,6 +23,7 @@ codeticket_since = 3.3.0-release # Override build system default toolchain # Note that this will only affect automated builds. +Linux.distcc_version = "" Linux.gcc_version = /usr/bin/gcc-4.6 Linux.cxx_version = /usr/bin/g++-4.6 -- cgit v1.2.3 From 89e1e010844708fa7a8193404cc7d2000130ed11 Mon Sep 17 00:00:00 2001 From: JJ Linden Date: Wed, 15 May 2013 22:28:51 -0700 Subject: updated BuildParams to try to fix windows build issue --- BuildParams | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BuildParams b/BuildParams index 86bad96433..f4279d303d 100755 --- a/BuildParams +++ b/BuildParams @@ -23,7 +23,7 @@ codeticket_since = 3.3.0-release # Override build system default toolchain # Note that this will only affect automated builds. -Linux.distcc_version = "" +Linux.distcc_version = Linux.gcc_version = /usr/bin/gcc-4.6 Linux.cxx_version = /usr/bin/g++-4.6 -- cgit v1.2.3 From 0cb2b30bfb239f05e1780cae5e3a7328a1474416 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 17 May 2013 11:45:06 -0700 Subject: Simple imposter AV rendering cleanup --- indra/newview/app_settings/settings.xml | 28 ++++------- indra/newview/llvoavatar.cpp | 55 +++------------------- indra/newview/llvoavatar.h | 1 - indra/newview/skins/default/xui/en/menu_viewer.xml | 9 ---- .../newview/skins/default/xui/en/notifications.xml | 39 --------------- 5 files changed, 15 insertions(+), 117 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 676ba57726..7cb45559fa 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9480,7 +9480,7 @@ RenderAutoMuteByteLimit Comment - Maximum bytes of attachments before an avatar is automatically visually muted (0 for no limit). + Maximum bytes of attachments before an avatar is rendered as a simple imposter (0 for no limit). Persist 1 Type @@ -9491,7 +9491,7 @@ RenderAutoMuteRenderCostLimit Comment - Maximum render weight before an avatar is automatically visually muted (0 to not use this limit). + Maximum render weight before an avatar is rendered as a simple imposter (0 to not use this limit). Persist 1 Type @@ -9502,7 +9502,7 @@ RenderAutoMuteSurfaceAreaLimit Comment - Maximum surface area of attachments before an avatar is automatically visually muted (0 to not use this limit). + Maximum surface area of attachments before an avatar is rendered as a simple imposter (0 to not use this limit). Persist 1 Type @@ -9510,16 +9510,16 @@ Value 0 - RenderAutoMuteEnabled + RenderAutoMuteThreshold Comment - Apply visual muting to high cost, non-friends, not in IM, or somewhat distant avatars + Threshold on the Avatar Detail slider where simple imposter mode is enabled. (less than 0 is always on, greather than 1 always off) Persist 1 Type - Boolean + F32 Value - 0 + 0.25 RenderAutoMuteLogging @@ -9531,19 +9531,7 @@ Boolean Value 0 - - RenderAutoMuteVisibilityRank - - Comment - Number of avatars to show normally for visual muting mode. - Persist - 1 - Type - U32 - Value - 0 - - + RenderAutoHideSurfaceAreaLimit Comment diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 3c25339037..4de2f4684e 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2999,11 +2999,10 @@ bool LLVOAvatar::isVisuallyMuted() if (!isSelf()) { - static LLCachedControl render_mute_enabled(gSavedSettings, "RenderAutoMuteEnabled"); + static LLCachedControl render_mute_threshold(gSavedSettings, "RenderAutoMuteThreshold"); static LLCachedControl max_attachment_bytes(gSavedSettings, "RenderAutoMuteByteLimit"); static LLCachedControl max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit"); static LLCachedControl max_render_cost(gSavedSettings, "RenderAutoMuteRenderCostLimit"); - static LLCachedControl visibility_rank(gSavedSettings, "RenderAutoMuteVisibilityRank"); if (mVisuallyMuteSetting == ALWAYS_VISUAL_MUTE) { // Always want to see this AV as an imposter @@ -3013,7 +3012,7 @@ bool LLVOAvatar::isVisuallyMuted() { // Never show as imposter muted = false; } - else if (render_mute_enabled) + else if (LLVOAvatar::sLODFactor <= render_mute_threshold) { F64 now = LLFrameTimer::getTotalSeconds(); @@ -3034,13 +3033,14 @@ bool LLVOAvatar::isVisuallyMuted() // Could be part of the grand || collection above, but yanked out to make the logic visible if (!muted) { - if (visibility_rank > 0) + if (sMaxVisible > 0) { // They are above the visibilty rank - mute them - muted = (mVisibilityRank > visibility_rank); + muted = (mVisibilityRank > sMaxVisible); } + /* Not used - always draw friends or those in IMs. Works nicely, needs UI? if (muted || // Don't mute friends or IMs - visibility_rank == 0) + sMaxVisible == 0) { muted = !(LLAvatarTracker::instance().isBuddy(getID())); if (muted) @@ -3049,6 +3049,7 @@ bool LLVOAvatar::isVisuallyMuted() muted = !gIMMgr->hasSession(session_id); } } + */ } // Save visual mute state and set interval for updating @@ -7879,8 +7880,6 @@ void LLVOAvatar::idleUpdateRenderCost() calculateUpdateRenderCost(); // Update mVisualComplexity if needed - doRenderCostNagging(max_render_cost); // Remind the user their AV is too complex - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHAME)) { std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus()); @@ -7892,46 +7891,6 @@ void LLVOAvatar::idleUpdateRenderCost() } -// Remind the user about their expensive avatar -void LLVOAvatar::doRenderCostNagging(U32 max_render_cost) -{ - if (isSelf()) - { - static S32 sOldComplexity = 0; - static F64 sLastRenderCostNagTime = 0.0; - - const F64 RENDER_NAG_INTERVAL = 60.0; - - F64 now = LLFrameTimer::getTotalSeconds(); - if (sLastRenderCostNagTime > 0.0 && - (now - sLastRenderCostNagTime) > RENDER_NAG_INTERVAL && - sOldComplexity != mVisualComplexity) - { - sOldComplexity = mVisualComplexity; - - if (max_render_cost > 0) - { //pop up notification that you have exceeded a render cost limit - if (mVisualComplexity > max_render_cost+max_render_cost/2) - { - LLNotificationsUtil::add("ExceededHighDetailRenderCost"); - sLastRenderCostNagTime = now; - } - else if (mVisualComplexity > max_render_cost) - { - LLNotificationsUtil::add("ExceededMidDetailRenderCost"); - sLastRenderCostNagTime = now; - } - else if (mVisualComplexity > max_render_cost/2) - { - LLNotificationsUtil::add("ExceededLowDetailRenderCost"); - sLastRenderCostNagTime = now; - } - } - } - } -} - - // Calculations for mVisualComplexity value void LLVOAvatar::calculateUpdateRenderCost() { diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 8862056066..afe1d56059 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -250,7 +250,6 @@ public: static void invalidateNameTags(); void addNameTagLine(const std::string& line, const LLColor4& color, S32 style, const LLFontGL* font); void idleUpdateRenderCost(); - void doRenderCostNagging(U32 max_render_cost); void calculateUpdateRenderCost(); void updateVisualComplexity() { mVisualComplexityStale = TRUE; } diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index f66272aa2e..9c8313f46c 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -547,15 +547,6 @@
- - - - - - Your avatar has become too complex to be rendered by even high performance computers. Almost all Residents will see a low detail stand in instead of your actual avatar. - - - - - - Your avatar has become too complex to be rendered by most computers. Many Residents will see a low detail stand in instead of your actual avatar. - - - - - - Your avatar has become too complex to be rendered by some computers. Some Residents will see a low detail stand in instead of your actual avatar. - - - - Date: Fri, 17 May 2013 13:38:52 -0700 Subject: ACME-275 : Fixed! Use Name and Suffix for person name for filtering and search --- indra/newview/llpersonmodelcommon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp index e48eddf05a..73239dcb8d 100644 --- a/indra/newview/llpersonmodelcommon.cpp +++ b/indra/newview/llpersonmodelcommon.cpp @@ -71,7 +71,7 @@ LLPersonModelCommon::~LLPersonModelCommon() BOOL LLPersonModelCommon::renameItem(const std::string& new_name) { mName = new_name; - mSearchableName = new_name; + mSearchableName = new_name + " " + mLabelSuffix; LLStringUtil::toUpper(mSearchableName); return TRUE; } -- cgit v1.2.3 From abdbf45aaa05f201afd9e2f6c6be87150be2c890 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 20 May 2013 11:18:12 -0700 Subject: MAINT-2616 : Updated my Intel driver and now have orange in buttons and Inventory pull down bar causing blinks to screen. Pulled in FS code, Reviewed by Kelly --- indra/llrender/llglslshader.cpp | 1 + indra/llrender/llglslshader.h | 3 ++ indra/llrender/llrender2dutils.cpp | 22 ++++++++++- .../shaders/class1/interface/solidcolorIntelV.glsl | 44 ++++++++++++++++++++++ indra/newview/llselectmgr.cpp | 10 ++++- indra/newview/llviewershadermgr.cpp | 19 ++++++++++ 6 files changed, 96 insertions(+), 3 deletions(-) create mode 100644 indra/newview/app_settings/shaders/class1/interface/solidcolorIntelV.glsl diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 298a03f32a..8a0ca95a78 100755 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -57,6 +57,7 @@ bool LLGLSLShader::sNoFixedFunction = false; //UI shader -- declared here so llui_libtest will link properly LLGLSLShader gUIProgram; LLGLSLShader gSolidColorProgram; +LLGLSLShader gSolidColorProgramIntel; BOOL shouldChange(const LLVector4& v1, const LLVector4& v2) { diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index 019d5a86d6..cd097b8e0b 100755 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -160,5 +160,8 @@ extern LLGLSLShader gSolidColorProgram; //Alpha mask shader (declared here so llappearance can access properly) extern LLGLSLShader gAlphaMaskProgram; +// Solid color Shader for Intel Graphics +extern LLGLSLShader gSolidColorProgramIntel; + #endif diff --git a/indra/llrender/llrender2dutils.cpp b/indra/llrender/llrender2dutils.cpp index d3cfbaf03a..3c6848efaa 100644 --- a/indra/llrender/llrender2dutils.cpp +++ b/indra/llrender/llrender2dutils.cpp @@ -443,7 +443,16 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex { if (LLGLSLShader::sNoFixedFunction) { - gSolidColorProgram.bind(); + // When running with a intel gfx card, do not use the solidcolor?.glsl files. Instead use a custom one + // for those cards. Passing color as a uniform and not a shader attribute + if(gGLManager.mIsIntel) + { + gSolidColorProgramIntel.bind(); + } + else + { + gSolidColorProgram.bind(); + } } else { @@ -454,7 +463,16 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex gGL.getTexUnit(0)->bind(image, true); - gGL.color4fv(color.mV); + // When running with a intel gfx card, do not use the solidcolor?.glsl files. Instead use a custom one + // for those cards. Passing color as a uniform and not a shader attribute + if( solid_color && LLGLSLShader::sNoFixedFunction && gGLManager.mIsIntel ) + { + gGL.diffuseColor4fv(color.mV); + } + else + { + gGL.color4fv(color.mV); + } const S32 NUM_VERTICES = 9 * 4; // 9 quads LLVector2 uv[NUM_VERTICES]; diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorIntelV.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorIntelV.glsl new file mode 100644 index 0000000000..dcf38c27ce --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorIntelV.glsl @@ -0,0 +1,44 @@ +/** + * @file solidcolorV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +uniform mat4 modelview_projection_matrix; + +uniform vec4 color; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + +void main() +{ + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); +// vertex_color = diffuse_color; + vertex_color = color; + vary_texcoord0 = texcoord0; +} + diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 4681efd3e5..02ace86b95 100755 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6051,7 +6051,15 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) if (shader) { //switch to "solid color" program for SH-2690 -- works around driver bug causing bad triangles when rendering silhouettes - gSolidColorProgram.bind(); + if(gGLManager.mIsIntel) + { + gSolidColorProgramIntel.bind(); + gGL.diffuseColor4fv(color.mV); + } + else + { + gSolidColorProgram.bind(); + } } gGL.matrixMode(LLRender::MM_MODELVIEW); diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 7d7889845d..ef5ccb5120 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -640,6 +640,7 @@ void LLViewerShaderMgr::unloadShaders() gTwoTextureAddProgram.unload(); gOneTextureNoColorProgram.unload(); gSolidColorProgram.unload(); + gSolidColorProgramIntel.unload(); gObjectFullbrightNoColorProgram.unload(); gObjectFullbrightNoColorWaterProgram.unload(); @@ -2703,6 +2704,24 @@ BOOL LLViewerShaderMgr::loadShadersInterface() } } + // When running with a intel gfx card, do not use the solidcolor?.glsl files. Instead use a custom one + // for those cards. Passing color as a uniform and not a shader attribute + if (success) + { + gSolidColorProgramIntel.mName = "Solid Color Shader for Intel"; + gSolidColorProgramIntel.mShaderFiles.clear(); + gSolidColorProgramIntel.mShaderFiles.push_back(make_pair("interface/solidcolorIntelV.glsl", GL_VERTEX_SHADER_ARB)); + gSolidColorProgramIntel.mShaderFiles.push_back(make_pair("interface/solidcolorF.glsl", GL_FRAGMENT_SHADER_ARB)); // The standard fragment shader is just fine. So keep it. + gSolidColorProgramIntel.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gSolidColorProgramIntel.createShader(NULL, NULL); + if (success) + { + gSolidColorProgramIntel.bind(); + gSolidColorProgramIntel.uniform1i(sTex0, 0); + gSolidColorProgramIntel.unbind(); + } + } + if (success) { gOcclusionProgram.mName = "Occlusion Shader"; -- cgit v1.2.3 From 53ed2e4ac67088dce27f4c391d3e980e2d63154b Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 20 May 2013 19:32:55 -0700 Subject: ACME-381 : Implement experimental checkin feature (used to test publish_actions permissions workflow) --- indra/newview/llfacebookconnect.cpp | 43 ++++++++++++++++++++++ indra/newview/llfacebookconnect.h | 1 + indra/newview/llpanelpeople.cpp | 13 +++++++ indra/newview/llpanelpeople.h | 1 + .../newview/skins/default/xui/en/menu_gear_fbc.xml | 7 ++++ 5 files changed, 65 insertions(+) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 39aa82dc7a..eb70cf4d10 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -94,6 +94,35 @@ public: }; +/////////////////////////////////////////////////////////////////////////////// +// +class LLFacebookPostResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLFacebookPostResponder); +public: + + virtual void completed(U32 status, const std::string& reason, const LLSD& content) + { + if (isGoodStatus(status)) + { + LL_DEBUGS("FacebookConnect") << "Post successful. content: " << content << LL_ENDL; + } + else + { + LL_WARNS("FacebookConnect") << "Failed to get a post response. reason: " << reason << " status: " << status << LL_ENDL; + } + } + + void completedHeader(U32 status, const std::string& reason, const LLSD& content) + { + if (status == 302) + { + LLFacebookConnect::instance().openFacebookWeb(content["location"]); + } + } + +}; + /////////////////////////////////////////////////////////////////////////////// // class LLFacebookDisconnectResponder : public LLHTTPClient::Responder @@ -247,6 +276,20 @@ void LLFacebookConnect::loadFacebookFriends() LLSD(), timeout, follow_redirects); } +void LLFacebookConnect::postCheckinMessage(const std::string& message, const std::string& url) +{ + // Note: We need to improve the API support to provide all the relevant data if possible + // Full set described : http://facebook-python-library.docs-library.appspot.com/facebook-python/library-manual.html + LLSD body; + if (!message.empty()) + body["message"] = message; + if (!url.empty()) + body["link"] = url; + + // Note: we can use that route for different publish action. We should be able to use the same responder. + LLHTTPClient::post(getFacebookConnectURL("/share"), body, new LLFacebookPostResponder()); +} + void LLFacebookConnect::storeContent(const LLSD& content) { mGeneration++; diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index 8036c9ce3e..f151dd95c1 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -46,6 +46,7 @@ public: void getConnectionToFacebook(); void loadFacebookFriends(); + void postCheckinMessage(const std::string& message, const std::string& url); void clearContent(); void storeContent(const LLSD& content); diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 0847878fb4..e0b1c3abba 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -76,6 +76,9 @@ #include "llspeakers.h" #include "llfloaterwebcontent.h" +#include "llagentui.h" +#include "llslurl.h" + #define FRIEND_LIST_UPDATE_TIMEOUT 0.5 #define NEARBY_LIST_UPDATE_INTERVAL 1 #define FBCTEST_LIST_UPDATE_INTERVAL 0.25 @@ -568,6 +571,7 @@ LLPanelPeople::LLPanelPeople() mCommitCallbackRegistrar.add("People.sendFBC", boost::bind(&LLPanelPeople::onFacebookAppSendClicked, this)); mCommitCallbackRegistrar.add("People.testaddFBC", boost::bind(&LLPanelPeople::onFacebookTestAddClicked, this)); mCommitCallbackRegistrar.add("People.testaddFBCFolderView", boost::bind(&LLPanelPeople::addTestParticipant, this)); + mCommitCallbackRegistrar.add("People.testFBCCheckin", boost::bind(&LLPanelPeople::onFacebookCheckinClicked, this)); mCommitCallbackRegistrar.add("People.AddFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this)); mCommitCallbackRegistrar.add("People.AddFriendWizard", boost::bind(&LLPanelPeople::onAddFriendWizButtonClicked, this)); @@ -1716,6 +1720,15 @@ void LLPanelPeople::onLoginFbcButtonClicked() } } +void LLPanelPeople::onFacebookCheckinClicked() +{ + // Get the local SLURL + LLSLURL slurl; + LLAgentUI::buildSLURL(slurl); + + LLFacebookConnect::instance().postCheckinMessage("Here I am in SL!", slurl.getSLURLString()); +} + void LLPanelPeople::onFacebookAppRequestClicked() { } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index be780bec5e..f617517392 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -123,6 +123,7 @@ private: void onFacebookAppRequestClicked(); void onFacebookAppSendClicked(); void onFacebookTestAddClicked(); + void onFacebookCheckinClicked(); bool onFriendsViewSortMenuItemCheck(const LLSD& userdata); bool onRecentViewSortMenuItemCheck(const LLSD& userdata); diff --git a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml index d73cee344b..2c341b6ecc 100644 --- a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml +++ b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml @@ -41,4 +41,11 @@ + + + \ No newline at end of file -- cgit v1.2.3 From 8a16b55bf8a87d29c116d9061d9701e8b844cc7b Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 21 May 2013 09:11:50 -0700 Subject: MAINT-2711 : Add missing LSL constants for llGetObjectDetails() to the viewer. Reviewed by Kelly --- indra/llcommon/lllslconstants.h | 18 ++++++++++++++++++ indra/lscript/lscript_compile/indra.l | 18 ++++++++++++++++++ indra/newview/app_settings/keywords.ini | 19 +++++++++++++++++++ 3 files changed, 55 insertions(+) diff --git a/indra/llcommon/lllslconstants.h b/indra/llcommon/lllslconstants.h index 9f32598e61..83fa5bc249 100755 --- a/indra/llcommon/lllslconstants.h +++ b/indra/llcommon/lllslconstants.h @@ -179,6 +179,24 @@ const S32 OBJECT_VELOCITY = 5; const S32 OBJECT_OWNER = 6; const S32 OBJECT_GROUP = 7; const S32 OBJECT_CREATOR = 8; +const S32 OBJECT_RUNNING_SCRIPT_COUNT = 9; +const S32 OBJECT_TOTAL_SCRIPT_COUNT = 10; +const S32 OBJECT_SCRIPT_MEMORY = 11; +const S32 OBJECT_SCRIPT_TIME = 12; +const S32 OBJECT_PRIM_EQUIVALENCE = 13; +const S32 OBJECT_SERVER_COST = 14; +const S32 OBJECT_STREAMING_COST = 15; +const S32 OBJECT_PHYSICS_COST = 16; +const S32 OBJECT_CHARACTER_TIME = 17; +const S32 OBJECT_ROOT = 18; +const S32 OBJECT_ATTACHED_POINT = 19; +const S32 OBJECT_PATHFINDING_TYPE = 20; +const S32 OBJECT_PHYSICS = 21; +const S32 OBJECT_PHANTOM = 22; +const S32 OBJECT_TEMP_ON_REZ = 23; +const S32 OBJECT_RENDER_WEIGHT = 24; +const S32 OBJECT_ATTACHMENT_GEOMETRY_BYTES = 25; +const S32 OBJECT_ATTACHMENT_SURFACE_AREA = 26; // llTextBox() magic token string - yes this is a hack. sue me. char const* const TEXTBOX_MAGIC_TOKEN = "!!llTextBox!!"; diff --git a/indra/lscript/lscript_compile/indra.l b/indra/lscript/lscript_compile/indra.l index c5d11af22b..e7de5b6210 100755 --- a/indra/lscript/lscript_compile/indra.l +++ b/indra/lscript/lscript_compile/indra.l @@ -273,6 +273,24 @@ int yyerror(const char *fmt, ...); "OBJECT_OWNER" { count(); yylval.ival = OBJECT_OWNER; return(INTEGER_CONSTANT); } "OBJECT_GROUP" { count(); yylval.ival = OBJECT_GROUP; return(INTEGER_CONSTANT); } "OBJECT_CREATOR" { count(); yylval.ival = OBJECT_CREATOR; return(INTEGER_CONSTANT); } +"OBJECT_RUNNING_SCRIPT_COUNT" { count(); yylval.ival = OBJECT_RUNNING_SCRIPT_COUNT; return(INTEGER_CONSTANT); } +"OBJECT_TOTAL_SCRIPT_COUNT" { count(); yylval.ival = OBJECT_TOTAL_SCRIPT_COUNT; return(INTEGER_CONSTANT); } +"OBJECT_SCRIPT_MEMORY" { count(); yylval.ival = OBJECT_SCRIPT_MEMORY; return(INTEGER_CONSTANT); } +"OBJECT_SCRIPT_TIME" { count(); yylval.ival = OBJECT_SCRIPT_TIME; return(INTEGER_CONSTANT); } +"OBJECT_PRIM_EQUIVALENCE" { count(); yylval.ival = OBJECT_PRIM_EQUIVALENCE; return(INTEGER_CONSTANT); } +"OBJECT_SERVER_COST" { count(); yylval.ival = OBJECT_SERVER_COST; return(INTEGER_CONSTANT); } +"OBJECT_STREAMING_COST" { count(); yylval.ival = OBJECT_STREAMING_COST; return(INTEGER_CONSTANT); } +"OBJECT_PHYSICS_COST" { count(); yylval.ival = OBJECT_PHYSICS_COST; return(INTEGER_CONSTANT); } +"OBJECT_CHARACTER_TIME" { count(); yylval.ival = OBJECT_CHARACTER_TIME; return(INTEGER_CONSTANT); } +"OBJECT_ROOT" { count(); yylval.ival = OBJECT_ROOT; return(INTEGER_CONSTANT); } +"OBJECT_ATTACHED_POINT" { count(); yylval.ival = OBJECT_ATTACHED_POINT; return(INTEGER_CONSTANT); } +"OBJECT_PATHFINDING_TYPE" { count(); yylval.ival = OBJECT_PATHFINDING_TYPE; return(INTEGER_CONSTANT); } +"OBJECT_PHYSICS" { count(); yylval.ival = OBJECT_PHYSICS; return(INTEGER_CONSTANT); } +"OBJECT_PHANTOM" { count(); yylval.ival = OBJECT_PHANTOM; return(INTEGER_CONSTANT); } +"OBJECT_TEMP_ON_REZ" { count(); yylval.ival = OBJECT_TEMP_ON_REZ; return(INTEGER_CONSTANT); } +"OBJECT_RENDER_WEIGHT" { count(); yylval.ival = OBJECT_RENDER_WEIGHT; return(INTEGER_CONSTANT); } +"OBJECT_ATTACHMENT_GEOMETRY_BYTES" { count(); yylval.ival = OBJECT_ATTACHMENT_GEOMETRY_BYTES; return(INTEGER_CONSTANT); } +"OBJECT_ATTACHMENT_SURFACE_AREA" { count(); yylval.ival = OBJECT_ATTACHMENT_SURFACE_AREA; return(INTEGER_CONSTANT); } "TYPE_INTEGER" { count(); yylval.ival = LST_INTEGER; return(INTEGER_CONSTANT); } "TYPE_FLOAT" { count(); yylval.ival = LST_FLOATINGPOINT; return(INTEGER_CONSTANT); } diff --git a/indra/newview/app_settings/keywords.ini b/indra/newview/app_settings/keywords.ini index 02adbc7af4..766c9a4604 100755 --- a/indra/newview/app_settings/keywords.ini +++ b/indra/newview/app_settings/keywords.ini @@ -177,6 +177,25 @@ OBJECT_VELOCITY Used with llGetObjectDetails to get an object's velocity OBJECT_OWNER Used with llGetObjectDetails to get an object's owner's key. Will be NULL_KEY if group owned OBJECT_GROUP Used with llGetObjectDetails to get an object's group's key OBJECT_CREATOR Used with llGetObjectDetails to get an object's creator's key +OBJECT_RUNNING_SCRIPT_COUNT Used with llGetObjectDetails to get the number of running scripts in an object +OBJECT_TOTAL_SCRIPT_COUNT Used with llGetObjectDetails to get the total number of scripts in an object +OBJECT_SCRIPT_MEMORY Used with llGetObjectDetails to get the total amount of script memory in an object +OBJECT_SCRIPT_TIME Used with llGetObjectDetails to get the average script time used by an object +OBJECT_PRIM_EQUIVALENCE Used with llGetObjectDetails to get the prim equivalence of an object +OBJECT_SERVER_COST Used with llGetObjectDetails to get the server cost of an object +OBJECT_STREAMING_COST Used with llGetObjectDetails to get the streaming (download) cost of an object +OBJECT_PHYSICS_COST Used with llGetObjectDetails to get the physics cost of an object +OBJECT_CHARACTER_TIME Used with llGetObjectDetails to get the pathfinding time (seconds) for an object +OBJECT_ROOT Used with llGetObjectDetails to get root ID of an object +OBJECT_ATTACHED_POINT Used with llGetObjectDetails to get attachent point where an object is attached +OBJECT_PATHFINDING_TYPE Used with llGetObjectDetails to get the pathfinding setting of an object +OBJECT_PHYSICS Used with llGetObjectDetails to determine if the object is physical or not +OBJECT_PHANTOM Used with llGetObjectDetails to determine if the object is phantom or not +OBJECT_TEMP_ON_REZ Used with llGetObjectDetails to determine if the object is temporary or not +OBJECT_RENDER_WEIGHT Used with llGetObjectDetails to return an avatar's rendering weight +OBJECT_ATTACHMENT_GEOMETRY_BYTES Used with llGetObjectDetails to return an avatar's attachment rendering geometry bytes +OBJECT_ATTACHMENT_SURFACE_AREA Used with llGetObjectDetails to return an avatar's attachment surface area + # some vehicle params VEHICLE_TYPE_NONE -- cgit v1.2.3 From 5a8c4c40aa5c2bce83f164705333af88290e4c6e Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 21 May 2013 09:14:51 -0700 Subject: Add fmod.log to .hgignore --- .hgignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgignore b/.hgignore index c845758e7c..a8a244596d 100755 --- a/.hgignore +++ b/.hgignore @@ -33,6 +33,7 @@ indra/newview/app_settings/static_*.db2 indra/newview/browser_profile indra/newview/character indra/newview/fmod.dll +indra/newview/fmod.log indra/newview/mozilla-theme indra/newview/mozilla-universal-darwin.tgz indra/newview/res/ll_icon.* -- cgit v1.2.3 From e5bdb0f0e1b3c48173e36b54da0f25c7d535df49 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 21 May 2013 13:50:49 -0700 Subject: MAINT-2676 - Set home to here - screen_home.bmp not saved. Reviewed by Kelly. --- indra/newview/llviewermessage.cpp | 52 ++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 9894ec7c07..d6ba803c46 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5938,19 +5938,42 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) } +static void process_special_alert_messages(const std::string & message) +{ + // Do special handling for alert messages. This is a legacy hack, and any actual displayed + // text should be altered in the notifications.xml files. + if ( message == "You died and have been teleported to your home location") + { + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_KILLED_COUNT); + } + else if( message == "Home position set." ) + { + // save the home location image to disk + std::string snap_filename = gDirUtilp->getLindenUserDir(); + snap_filename += gDirUtilp->getDirDelimiter(); + snap_filename += SCREEN_HOME_FILENAME; + gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE); + } +} + + + void process_agent_alert_message(LLMessageSystem* msgsystem, void** user_data) { // make sure the cursor is back to the usual default since the // alert is probably due to some kind of error. gViewerWindow->getWindow()->resetBusyCount(); + std::string message; + msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, message); + + process_special_alert_messages(message); + if (!attempt_standard_notification(msgsystem)) { BOOL modal = FALSE; msgsystem->getBOOL("AlertData", "Modal", modal); - std::string buffer; - msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, buffer); - process_alert_core(buffer, modal); + process_alert_core(message, modal); } } @@ -5965,12 +5988,15 @@ void process_alert_message(LLMessageSystem *msgsystem, void **user_data) // alert is probably due to some kind of error. gViewerWindow->getWindow()->resetBusyCount(); + std::string message; + msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, message); + + process_special_alert_messages(message); + if (!attempt_standard_notification(msgsystem)) { BOOL modal = FALSE; - std::string buffer; - msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, buffer); - process_alert_core(buffer, modal); + process_alert_core(message, modal); } } @@ -6000,20 +6026,6 @@ bool handle_special_alerts(const std::string &pAlertName) void process_alert_core(const std::string& message, BOOL modal) { - // HACK -- handle callbacks for specific alerts. It also is localized in notifications.xml - if ( message == "You died and have been teleported to your home location") - { - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_KILLED_COUNT); - } - else if( message == "Home position set." ) - { - // save the home location image to disk - std::string snap_filename = gDirUtilp->getLindenUserDir(); - snap_filename += gDirUtilp->getDirDelimiter(); - snap_filename += SCREEN_HOME_FILENAME; - gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE); - } - const std::string ALERT_PREFIX("ALERT: "); const std::string NOTIFY_PREFIX("NOTIFY: "); if (message.find(ALERT_PREFIX) == 0) -- cgit v1.2.3 From 473474b94969799d2835191072c5bca1b7d431d8 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 22 May 2013 16:51:42 -0700 Subject: Revert changes for MAINT-2616 due to licensing issues, need a full patch submitted to be acceptable --- indra/llrender/llglslshader.cpp | 1 - indra/llrender/llglslshader.h | 3 -- indra/llrender/llrender2dutils.cpp | 22 +---------- .../shaders/class1/interface/solidcolorIntelV.glsl | 44 ---------------------- indra/newview/llselectmgr.cpp | 10 +---- indra/newview/llviewershadermgr.cpp | 19 ---------- 6 files changed, 3 insertions(+), 96 deletions(-) delete mode 100644 indra/newview/app_settings/shaders/class1/interface/solidcolorIntelV.glsl diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 8a0ca95a78..298a03f32a 100755 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -57,7 +57,6 @@ bool LLGLSLShader::sNoFixedFunction = false; //UI shader -- declared here so llui_libtest will link properly LLGLSLShader gUIProgram; LLGLSLShader gSolidColorProgram; -LLGLSLShader gSolidColorProgramIntel; BOOL shouldChange(const LLVector4& v1, const LLVector4& v2) { diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index cd097b8e0b..019d5a86d6 100755 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -160,8 +160,5 @@ extern LLGLSLShader gSolidColorProgram; //Alpha mask shader (declared here so llappearance can access properly) extern LLGLSLShader gAlphaMaskProgram; -// Solid color Shader for Intel Graphics -extern LLGLSLShader gSolidColorProgramIntel; - #endif diff --git a/indra/llrender/llrender2dutils.cpp b/indra/llrender/llrender2dutils.cpp index 3c6848efaa..d3cfbaf03a 100644 --- a/indra/llrender/llrender2dutils.cpp +++ b/indra/llrender/llrender2dutils.cpp @@ -443,16 +443,7 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex { if (LLGLSLShader::sNoFixedFunction) { - // When running with a intel gfx card, do not use the solidcolor?.glsl files. Instead use a custom one - // for those cards. Passing color as a uniform and not a shader attribute - if(gGLManager.mIsIntel) - { - gSolidColorProgramIntel.bind(); - } - else - { - gSolidColorProgram.bind(); - } + gSolidColorProgram.bind(); } else { @@ -463,16 +454,7 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex gGL.getTexUnit(0)->bind(image, true); - // When running with a intel gfx card, do not use the solidcolor?.glsl files. Instead use a custom one - // for those cards. Passing color as a uniform and not a shader attribute - if( solid_color && LLGLSLShader::sNoFixedFunction && gGLManager.mIsIntel ) - { - gGL.diffuseColor4fv(color.mV); - } - else - { - gGL.color4fv(color.mV); - } + gGL.color4fv(color.mV); const S32 NUM_VERTICES = 9 * 4; // 9 quads LLVector2 uv[NUM_VERTICES]; diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorIntelV.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorIntelV.glsl deleted file mode 100644 index dcf38c27ce..0000000000 --- a/indra/newview/app_settings/shaders/class1/interface/solidcolorIntelV.glsl +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @file solidcolorV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat4 modelview_projection_matrix; - -uniform vec4 color; - -ATTRIBUTE vec3 position; -ATTRIBUTE vec4 diffuse_color; -ATTRIBUTE vec2 texcoord0; - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -void main() -{ - gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); -// vertex_color = diffuse_color; - vertex_color = color; - vary_texcoord0 = texcoord0; -} - diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 02ace86b95..4681efd3e5 100755 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6051,15 +6051,7 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) if (shader) { //switch to "solid color" program for SH-2690 -- works around driver bug causing bad triangles when rendering silhouettes - if(gGLManager.mIsIntel) - { - gSolidColorProgramIntel.bind(); - gGL.diffuseColor4fv(color.mV); - } - else - { - gSolidColorProgram.bind(); - } + gSolidColorProgram.bind(); } gGL.matrixMode(LLRender::MM_MODELVIEW); diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index ef5ccb5120..7d7889845d 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -640,7 +640,6 @@ void LLViewerShaderMgr::unloadShaders() gTwoTextureAddProgram.unload(); gOneTextureNoColorProgram.unload(); gSolidColorProgram.unload(); - gSolidColorProgramIntel.unload(); gObjectFullbrightNoColorProgram.unload(); gObjectFullbrightNoColorWaterProgram.unload(); @@ -2704,24 +2703,6 @@ BOOL LLViewerShaderMgr::loadShadersInterface() } } - // When running with a intel gfx card, do not use the solidcolor?.glsl files. Instead use a custom one - // for those cards. Passing color as a uniform and not a shader attribute - if (success) - { - gSolidColorProgramIntel.mName = "Solid Color Shader for Intel"; - gSolidColorProgramIntel.mShaderFiles.clear(); - gSolidColorProgramIntel.mShaderFiles.push_back(make_pair("interface/solidcolorIntelV.glsl", GL_VERTEX_SHADER_ARB)); - gSolidColorProgramIntel.mShaderFiles.push_back(make_pair("interface/solidcolorF.glsl", GL_FRAGMENT_SHADER_ARB)); // The standard fragment shader is just fine. So keep it. - gSolidColorProgramIntel.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; - success = gSolidColorProgramIntel.createShader(NULL, NULL); - if (success) - { - gSolidColorProgramIntel.bind(); - gSolidColorProgramIntel.uniform1i(sTex0, 0); - gSolidColorProgramIntel.unbind(); - } - } - if (success) { gOcclusionProgram.mName = "Occlusion Shader"; -- cgit v1.2.3 From 4cf16ffdfbb166fbb3fcf1d7950ca1a240c94ca1 Mon Sep 17 00:00:00 2001 From: Cinders Date: Wed, 22 May 2013 21:43:32 -0600 Subject: STORM-1888: Hide Spellchecker Settings floater when Preferences floater is closed Bonus: Correct the immediately preceding auto replace comment --- doc/contributions.txt | 1 + indra/newview/llfloaterpreference.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index 09c0d01b11..28de94f186 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -301,6 +301,7 @@ Ciaran Laval Cinder Roxley BUG-2326 STORM-1703 + STORM-1888 Clara Young Coaldust Numbers VWR-1095 diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index bbf88060c1..fde98aae9a 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -617,9 +617,12 @@ void LLFloaterPreference::cancel() // hide translation settings floater LLFloaterReg::hideInstance("prefs_translation"); - // hide translation settings floater + // hide autoreplace settings floater LLFloaterReg::hideInstance("prefs_autoreplace"); + // hide spellchecker settings folder + LLFloaterReg::hideInstance("prefs_spellchecker"); + // cancel hardware menu LLFloaterHardwareSettings* hardware_settings = LLFloaterReg::getTypedInstance("prefs_hardware_settings"); if (hardware_settings) -- cgit v1.2.3 From cda10266ae91e28f2ac60b8472d6b8592f877d65 Mon Sep 17 00:00:00 2001 From: Geenz Date: Thu, 23 May 2013 08:50:05 -0400 Subject: Only show the input window when we attempt to add marked text, *and* we can't submit marked text directly to the viewer. --- indra/llwindow/llopenglview-objc.h | 3 ++ indra/llwindow/llopenglview-objc.mm | 68 ++++++++++++++++++++++------------- indra/llwindow/llwindowmacosx-objc.h | 9 ++--- indra/llwindow/llwindowmacosx-objc.mm | 5 +++ indra/llwindow/llwindowmacosx.cpp | 42 ++++++++++------------ 5 files changed, 75 insertions(+), 52 deletions(-) diff --git a/indra/llwindow/llopenglview-objc.h b/indra/llwindow/llopenglview-objc.h index 6d0f138950..e20ea533fb 100644 --- a/indra/llwindow/llopenglview-objc.h +++ b/indra/llwindow/llopenglview-objc.h @@ -20,6 +20,7 @@ bool mHasMarkedText; unsigned int mMarkedTextLength; NSAttributedString *mMarkedText; + bool mMarkedTextAllowed; } - (id) initWithSamples:(NSUInteger)samples; - (id) initWithSamples:(NSUInteger)samples andVsync:(BOOL)vsync; @@ -42,6 +43,8 @@ - (unsigned long) getVramSize; +- (void) allowMarkedTextInput:(bool)allowed; + @end @interface LLNonInlineTextView : NSTextView diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 9d55b2c551..8ef6d4e682 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -45,6 +45,7 @@ attributedStringInfo getSegments(NSAttributedString *str) segment_standouts seg_standouts; NSRange effectiveRange; NSRange limitRange = NSMakeRange(0, [str length]); + while (limitRange.length > 0) { NSNumber *attr = [str attribute:NSUnderlineStyleAttributeName atIndex:limitRange.location longestEffectiveRange:&effectiveRange inRange:limitRange]; limitRange = NSMakeRange(NSMaxRange(effectiveRange), NSMaxRange(limitRange) - NSMaxRange(effectiveRange)); @@ -402,32 +403,40 @@ attributedStringInfo getSegments(NSAttributedString *str) - (void)setMarkedText:(id)aString selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange { - if ([aString class] == NSClassFromString(@"NSConcreteMutableAttributedString")) - { - unsigned int selected[2] = { - selectedRange.location, - selectedRange.length - }; - - unsigned int replacement[2] = { - replacementRange.location, - replacementRange.length - }; - - unichar text[[aString length]]; - [[aString mutableString] getCharacters:text range:NSMakeRange(0, [aString length])]; - attributedStringInfo segments = getSegments((NSAttributedString *)aString); - setMarkedText(text, selected, replacement, [aString length], segments); - mHasMarkedText = TRUE; - mMarkedTextLength = [aString length]; - mMarkedText = (NSAttributedString*)[aString mutableString]; - } + if (mMarkedTextAllowed) + { + if ([aString class] == NSClassFromString(@"NSConcreteMutableAttributedString")) + { + unsigned int selected[2] = { + selectedRange.location, + selectedRange.length + }; + + unsigned int replacement[2] = { + replacementRange.location, + replacementRange.length + }; + + unichar text[[aString length]]; + [[aString mutableString] getCharacters:text range:NSMakeRange(0, [aString length])]; + attributedStringInfo segments = getSegments((NSAttributedString *)aString); + setMarkedText(text, selected, replacement, [aString length], segments); + mHasMarkedText = TRUE; + mMarkedTextLength = [aString length]; + mMarkedText = (NSAttributedString*)[aString mutableString]; + } + } else { + showInputWindow(true); + } } - (void)commitCurrentPreedit { - [self insertText:mMarkedText replacementRange:NSMakeRange(0, [mMarkedText length])]; - [[self inputContext] discardMarkedText]; + if (mMarkedText) + { + [self insertText:mMarkedText]; + [[self inputContext] discardMarkedText]; + } } - (void)unmarkText @@ -452,11 +461,12 @@ attributedStringInfo getSegments(NSAttributedString *str) - (void)insertText:(id)aString replacementRange:(NSRange)replacementRange { + bool success = false; if (!mHasMarkedText) { for (NSInteger i = 0; i < [aString length]; i++) { - callUnicodeCallback([aString characterAtIndex:i], mModifiers); + success = callUnicodeCallback([aString characterAtIndex:i], mModifiers); } } else { // We may never get this point since unmarkText may be called before insertText ever gets called once we submit our text. @@ -465,10 +475,12 @@ attributedStringInfo getSegments(NSAttributedString *str) for (NSInteger i = 0; i < [aString length]; i++) { - handleUnicodeCharacter([aString characterAtIndex:i]); + success = handleUnicodeCharacter([aString characterAtIndex:i]); } mHasMarkedText = FALSE; } + + NSLog(@"Successful text input: %d", success); } - (void) insertNewline:(id)sender @@ -508,6 +520,11 @@ attributedStringInfo getSegments(NSAttributedString *str) return NO; } +- (void) allowMarkedTextInput:(bool)allowed +{ + mMarkedTextAllowed = allowed; +} + @end @implementation LLNonInlineTextView @@ -525,9 +542,10 @@ attributedStringInfo getSegments(NSAttributedString *str) - (void) insertText:(id)aString replacementRange:(NSRange)replacementRange { [glview insertText:aString replacementRange:replacementRange]; - [_window orderOut:_window]; [[self textStorage] setValue:@""]; [[self inputContext] discardMarkedText]; + [self setString:@""]; + [_window orderOut:_window]; } @end diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index 59d956d4c8..62543fa01d 100755 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -95,10 +95,10 @@ void showInputWindow(bool show); // These are all implemented in llwindowmacosx.cpp. // This is largely for easier interop between Obj-C and C++ (at least in the viewer's case due to the BOOL vs. BOOL conflict) -void callKeyUp(unsigned short key, unsigned int mask); -void callKeyDown(unsigned short key, unsigned int mask); +bool callKeyUp(unsigned short key, unsigned int mask); +bool callKeyDown(unsigned short key, unsigned int mask); void callResetKeys(); -void callUnicodeCallback(wchar_t character, unsigned int mask); +bool callUnicodeCallback(wchar_t character, unsigned int mask); void callRightMouseDown(float *pos, unsigned int mask); void callRightMouseUp(float *pos, unsigned int mask); void callLeftMouseDown(float *pos, unsigned int mask); @@ -129,13 +129,14 @@ void callHandleDragDropped(std::string url); std::basic_string getPreeditString(); void getPreeditSelectionRange(int *position, int *length); void getPreeditMarkedRange(int *position, int *length); -void handleUnicodeCharacter(wchar_t c); +bool handleUnicodeCharacter(wchar_t c); void updatePreeditor(unsigned short *str); void setPreeditMarkedRange(int position, int length); void resetPreedit(); int wstring_length(const std::basic_string & wstr, const int woffset, const int utf16_length, int *unaligned); void setMarkedText(unsigned short *text, unsigned int *selectedRange, unsigned int *replacementRange, long text_len, attributedStringInfo segments); void getPreeditLocation(float *location, unsigned int length); +void allowDirectMarkedTextInput(bool allow); NSWindowRef getMainAppWindow(); GLViewRef getGLView(); diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index 4bd65ade82..95b9cdb863 100755 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -377,6 +377,11 @@ void commitCurrentPreedit(GLViewRef glView) [(LLOpenGLView*)glView commitCurrentPreedit]; } +void allowDirectMarkedTextInput(bool allow) +{ + +} + NSWindowRef getMainAppWindow() { LLNSWindow *winRef = [(LLAppDelegate*)[[NSApplication sharedApplication] delegate] window]; diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index e1220c83f4..16fd7e3382 100755 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -204,14 +204,14 @@ LLWindowMacOSX::LLWindowMacOSX(LLWindowCallbacks* callbacks, // These functions are used as wrappers for our internal event handling callbacks. // It's a good idea to wrap these to avoid reworking more code than we need to within LLWindow. -void callKeyUp(unsigned short key, unsigned int mask) +bool callKeyUp(unsigned short key, unsigned int mask) { - gKeyboard->handleKeyUp(key, mask); + return gKeyboard->handleKeyUp(key, mask); } -void callKeyDown(unsigned short key, unsigned int mask) +bool callKeyDown(unsigned short key, unsigned int mask) { - gKeyboard->handleKeyDown(key, mask); + return gKeyboard->handleKeyDown(key, mask); } void callResetKeys() @@ -219,9 +219,9 @@ void callResetKeys() gKeyboard->resetKeys(); } -void callUnicodeCallback(wchar_t character, unsigned int mask) +bool callUnicodeCallback(wchar_t character, unsigned int mask) { - gWindowImplementation->getCallbacks()->handleUnicodeChar(character, mask); + return gWindowImplementation->getCallbacks()->handleUnicodeChar(character, mask); } void callFocus() @@ -408,12 +408,15 @@ void setPreeditMarkedRange(int position, int length) } } -void handleUnicodeCharacter(wchar_t c) +bool handleUnicodeCharacter(wchar_t c) { + bool success = false; if (gWindowImplementation->getPreeditor()) { - gWindowImplementation->getPreeditor()->handleUnicodeCharHere(c); + success = gWindowImplementation->getPreeditor()->handleUnicodeCharHere(c); } + + return success; } void resetPreedit() @@ -1033,21 +1036,7 @@ BOOL LLWindowMacOSX::setCursorPosition(const LLCoordWindow position) return result; } -/* -static void fixOrigin(void) -{ - GrafPtr port; - Rect portrect; - ::GetPort(&port); - ::GetPortBounds(port, &portrect); - if((portrect.left != 0) || (portrect.top != 0)) - { - // Mozilla sometimes changes our port origin. - ::SetOrigin(0,0); - } -} -*/ BOOL LLWindowMacOSX::getCursorPosition(LLCoordWindow *position) { float cursor_point[2]; @@ -1840,7 +1829,14 @@ void LLWindowMacOSX::allowLanguageTextInput(LLPreeditor *preeditor, BOOL b) return; } - showInputWindow(!b); + if (preeditor == NULL) { + // If we don't have a pre editor, then we can't accept direct marked text input. + // We needs an input window (which is handled internally by LLOpenGLView) + allowDirectMarkedTextInput(false); + } else { + // If we have a preeditor, then accept direct marked text input. + allowDirectMarkedTextInput(true); + } // Take care of old and new preeditors. if (preeditor != mPreeditor || !b) -- cgit v1.2.3 From 7decac40e6453b2d8822d2677b9b59300bc260cf Mon Sep 17 00:00:00 2001 From: Geenz Date: Thu, 23 May 2013 09:39:49 -0400 Subject: Override NSPanel's close method to hide the window instead of actually removing the window. --- indra/llwindow/llopenglview-objc.h | 4 ++++ indra/llwindow/llopenglview-objc.mm | 25 ++++++++++++++++++++++++- indra/newview/SecondLife.nib | Bin 13009 -> 13021 bytes indra/newview/SecondLife.xib | 14 +++++++------- 4 files changed, 35 insertions(+), 8 deletions(-) diff --git a/indra/llwindow/llopenglview-objc.h b/indra/llwindow/llopenglview-objc.h index e20ea533fb..5309dea664 100644 --- a/indra/llwindow/llopenglview-objc.h +++ b/indra/llwindow/llopenglview-objc.h @@ -47,6 +47,10 @@ @end +@interface LLUserInputWindow : NSPanel + +@end + @interface LLNonInlineTextView : NSTextView { LLOpenGLView *glview; diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 8ef6d4e682..17e8c3e3cc 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -527,6 +527,15 @@ attributedStringInfo getSegments(NSAttributedString *str) @end +@implementation LLUserInputWindow + +- (void) close +{ + [self orderOut:self]; +} + +@end + @implementation LLNonInlineTextView - (void) setGLView:(LLOpenGLView *)view @@ -536,16 +545,30 @@ attributedStringInfo getSegments(NSAttributedString *str) - (void) insertText:(id)insertString { + [[self inputContext] discardMarkedText]; + [self setString:@""]; + [_window orderOut:_window]; [self insertText:insertString replacementRange:NSMakeRange(0, 0)]; } - (void) insertText:(id)aString replacementRange:(NSRange)replacementRange { [glview insertText:aString replacementRange:replacementRange]; +} + +- (void) insertNewline:(id)sender +{ [[self textStorage] setValue:@""]; [[self inputContext] discardMarkedText]; [self setString:@""]; - [_window orderOut:_window]; +} + +- (void)doCommandBySelector:(SEL)aSelector +{ + if (aSelector == @selector(insertNewline:)) + { + [self insertNewline:self]; + } } @end diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib index cb289ebf09..a5f2717167 100644 Binary files a/indra/newview/SecondLife.nib and b/indra/newview/SecondLife.nib differ diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib index c6b72485a1..e5736f76a4 100644 --- a/indra/newview/SecondLife.xib +++ b/indra/newview/SecondLife.xib @@ -2,7 +2,7 @@ 1060 - 12E30 + 12E52 3084 1187.39 626.00 @@ -335,7 +335,7 @@ {1024, 600} _NS:20 - {{0, 0}, {2560, 1418}} + {{0, 0}, {2560, 1440}} {10000000000000, 10000000000000} Second Life 128 @@ -347,7 +347,7 @@ {{272, 176}, {938, 42}} -1535638528 Input Window - NSPanel + LLUserInputWindow @@ -533,7 +533,7 @@ _NS:21 - {{0, 0}, {2560, 1418}} + {{0, 0}, {2560, 1440}} {10000000000000, 10000000000000} YES @@ -1180,11 +1180,11 @@ - NSLayoutConstraint - NSObject + LLUserInputWindow + NSPanel IBProjectSource - ./Classes/NSLayoutConstraint.h + ./Classes/LLUserInputWindow.h -- cgit v1.2.3 From ff291257886badc495d04d59f78cfc9858964702 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 29 May 2013 01:31:48 +0100 Subject: updated postCheckinMessage to use new parameters and new route path --- indra/newview/llfacebookconnect.cpp | 20 +++++++++++++------- indra/newview/llfacebookconnect.h | 2 +- indra/newview/llpanelpeople.cpp | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index eb70cf4d10..86da748f0f 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -276,18 +276,24 @@ void LLFacebookConnect::loadFacebookFriends() LLSD(), timeout, follow_redirects); } -void LLFacebookConnect::postCheckinMessage(const std::string& message, const std::string& url) +void LLFacebookConnect::postCheckinMessage(const std::string& message, const std::string& link, const std::string& name, const std::string& caption, const std::string& description, const std::string& picture) { - // Note: We need to improve the API support to provide all the relevant data if possible - // Full set described : http://facebook-python-library.docs-library.appspot.com/facebook-python/library-manual.html - LLSD body; + LLSD body; if (!message.empty()) body["message"] = message; - if (!url.empty()) - body["link"] = url; + if (!link.empty()) + body["link"] = link; + if (!name.empty()) + body["name"] = name; + if (!caption.empty()) + body["caption"] = caption; + if (!description.empty()) + body["description"] = description; + if (!picture.empty()) + body["picture"] = picture; // Note: we can use that route for different publish action. We should be able to use the same responder. - LLHTTPClient::post(getFacebookConnectURL("/share"), body, new LLFacebookPostResponder()); + LLHTTPClient::post(getFacebookConnectURL("/share/wall"), body, new LLFacebookPostResponder()); } void LLFacebookConnect::storeContent(const LLSD& content) diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index f151dd95c1..8886630222 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -46,7 +46,7 @@ public: void getConnectionToFacebook(); void loadFacebookFriends(); - void postCheckinMessage(const std::string& message, const std::string& url); + void postCheckinMessage(const std::string& message, const std::string& link, const std::string& name, const std::string& caption, const std::string& description, const std::string& picture); void clearContent(); void storeContent(const LLSD& content); diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index e0b1c3abba..69b6bdf737 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1726,7 +1726,7 @@ void LLPanelPeople::onFacebookCheckinClicked() LLSLURL slurl; LLAgentUI::buildSLURL(slurl); - LLFacebookConnect::instance().postCheckinMessage("Here I am in SL!", slurl.getSLURLString()); + LLFacebookConnect::instance().postCheckinMessage("Here I am in SL!", slurl.getSLURLString(), slurl.getRegion(), "", "", ""); } void LLPanelPeople::onFacebookAppRequestClicked() -- cgit v1.2.3 From e72a9ebf638db2197920115be57493a40d54d2b6 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Wed, 29 May 2013 17:04:42 -0700 Subject: ACME-433 Add a new tab to the bottom of the friends list --- indra/newview/skins/default/xui/en/panel_people.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 9bab2ccb0b..bc6b82e328 100755 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -365,6 +365,23 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M top="0" width="307" /> + + + Date: Thu, 30 May 2013 17:03:54 -0700 Subject: ACME-434 When tab becomes visible, pull suggested friends data. --- indra/newview/llpanelpeople.cpp | 34 ++++++++++++++++++++++++++++++++++ indra/newview/llpanelpeople.h | 2 ++ 2 files changed, 36 insertions(+) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 69b6bdf737..785de6e9c9 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -652,8 +652,11 @@ BOOL LLPanelPeople::postBuild() // updater is active only if panel is visible to user. friends_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFriendListUpdater, _2)); friends_tab->setVisibleCallback(boost::bind(&LLPanelPeople::removePicker, this)); + friends_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFacebookListUpdater, _2)); + mOnlineFriendList = friends_tab->getChild("avatars_online"); mAllFriendList = friends_tab->getChild("avatars_all"); + mSuggestedFriends = friends_tab->getChild("suggested_friends"); mOnlineFriendList->setNoItemsCommentText(getString("no_friends_online")); mOnlineFriendList->setShowIcons("FriendsListShowIcons"); mOnlineFriendList->showPermissions("FriendsListShowPermissions"); @@ -895,6 +898,35 @@ void LLPanelPeople::updateFriendList() //update trash and other buttons according to a selected item updateButtons(); showFriendsAccordionsIfNeeded(); + + updateSuggestedFriendList(); +} + +void LLPanelPeople::updateSuggestedFriendList() +{ + const LLAvatarTracker& av_tracker = LLAvatarTracker::instance(); + uuid_vec_t& suggested_friends = mSuggestedFriends->getIDs(); + suggested_friends.clear(); + + //Add suggested friends + LLSD friends = LLFacebookConnect::instance().getContent(); + for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) + { + std::string name = i->second["name"].asString(); + LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); + bool second_life_buddy = agent_id.notNull() ? av_tracker.isBuddy(agent_id) : false; + + if(!second_life_buddy) + { + //FB+SL but not SL friend + if (agent_id.notNull()) + { + suggested_friends.push_back(agent_id); + } + } + } + + mSuggestedFriends->setDirty(true, true); } void LLPanelPeople::updateNearbyList() @@ -973,6 +1005,8 @@ void LLPanelPeople::updateFacebookList() } } } + + updateSuggestedFriendList(); } } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index f617517392..9cfa6b7cd2 100755 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -85,6 +85,7 @@ private: // methods indirectly called by the updaters void updateFriendListHelpText(); void updateFriendList(); + void updateSuggestedFriendList(); void updateNearbyList(); void updateRecentList(); void updateFacebookList(); @@ -148,6 +149,7 @@ private: LLTabContainer* mTabContainer; LLAvatarList* mOnlineFriendList; LLAvatarList* mAllFriendList; + LLAvatarList* mSuggestedFriends; LLAvatarList* mNearbyList; LLAvatarList* mRecentList; LLGroupList* mGroupList; -- cgit v1.2.3 From 7e2a20308ec3a1d3306a5260461b4c1b5a5314a5 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 31 May 2013 14:55:38 -0700 Subject: ACME-435 Only show the 'People you may want to friend' tab when it is populated. --- indra/newview/llpanelpeople.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 785de6e9c9..22fbbf0c0e 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -830,7 +830,7 @@ void LLPanelPeople::updateFriendListHelpText() // Seems sometimes all_friends can be empty because of issue with Inventory loading (clear cache, slow connection...) // So, lets check all lists to avoid overlapping the text with online list. See EXT-6448. - bool any_friend_exists = mAllFriendList->filterHasMatches() || mOnlineFriendList->filterHasMatches(); + bool any_friend_exists = mAllFriendList->filterHasMatches() || mOnlineFriendList->filterHasMatches() || mSuggestedFriends->filterHasMatches(); no_friends_text->setVisible(!any_friend_exists); if (no_friends_text->getVisible()) { @@ -897,9 +897,8 @@ void LLPanelPeople::updateFriendList() mAllFriendList->setDirty(true, !mAllFriendList->filterHasMatches()); //update trash and other buttons according to a selected item updateButtons(); - showFriendsAccordionsIfNeeded(); - updateSuggestedFriendList(); + showFriendsAccordionsIfNeeded(); } void LLPanelPeople::updateSuggestedFriendList() @@ -926,7 +925,9 @@ void LLPanelPeople::updateSuggestedFriendList() } } - mSuggestedFriends->setDirty(true, true); + //Force a refresh when there aren't any filter matches (prevent displaying content that shouldn't display) + mSuggestedFriends->setDirty(true, !mSuggestedFriends->filterHasMatches()); + showFriendsAccordionsIfNeeded(); } void LLPanelPeople::updateNearbyList() @@ -1007,6 +1008,7 @@ void LLPanelPeople::updateFacebookList() } updateSuggestedFriendList(); + showFriendsAccordionsIfNeeded(); } } @@ -1230,9 +1232,11 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string) mOnlineFriendList->setNameFilter(filter); mAllFriendList->setNameFilter(filter); + mSuggestedFriends->setNameFilter(filter); setAccordionCollapsedByUser("tab_online", false); setAccordionCollapsedByUser("tab_all", false); + setAccordionCollapsedByUser("tab_suggested_friends", false); showFriendsAccordionsIfNeeded(); // restore accordion tabs state _after_ all manipulations @@ -1623,6 +1627,7 @@ void LLPanelPeople::showFriendsAccordionsIfNeeded() // Expand and show accordions if needed, else - hide them showAccordion("tab_online", mOnlineFriendList->filterHasMatches()); showAccordion("tab_all", mAllFriendList->filterHasMatches()); + showAccordion("tab_suggested_friends", mSuggestedFriends->filterHasMatches()); // Rearrange accordions LLAccordionCtrl* accordion = getChild("friends_accordion"); -- cgit v1.2.3 From 9497a70eb2b3d47d1bfd83ff34bb60d8f490644d Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 31 May 2013 17:53:36 -0700 Subject: ACME-436 Update the list of Suggested Friends when new data arrives --- indra/newview/skins/default/xui/en/panel_people.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index bc6b82e328..c21d2abdd7 100755 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -371,6 +371,7 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M name="tab_suggested_friends" title="People you may want to friend"> Date: Sat, 1 Jun 2013 01:55:40 +0100 Subject: added LLFacebookConnect::sharePhoto() for ACME-467 --- indra/newview/llfacebookconnect.cpp | 11 ++++++++++- indra/newview/llfacebookconnect.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 86da748f0f..5013a5cb40 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -211,7 +211,6 @@ public: } }; - /////////////////////////////////////////////////////////////////////////////// // LLFacebookConnect::LLFacebookConnect() @@ -296,6 +295,16 @@ void LLFacebookConnect::postCheckinMessage(const std::string& message, const std LLHTTPClient::post(getFacebookConnectURL("/share/wall"), body, new LLFacebookPostResponder()); } +void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::string& caption) +{ + LLSD body; + body["image"] = image_url; + body["caption"] = caption; + + // Note: we can use that route for different publish action. We should be able to use the same responder. + LLHTTPClient::post(getFacebookConnectURL("/share/photo"), body, new LLFacebookPostResponder()); +} + void LLFacebookConnect::storeContent(const LLSD& content) { mGeneration++; diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index 8886630222..faa60b0f34 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -47,6 +47,7 @@ public: void loadFacebookFriends(); void postCheckinMessage(const std::string& message, const std::string& link, const std::string& name, const std::string& caption, const std::string& description, const std::string& picture); + void sharePhoto(const std::string& image_url, const std::string& caption); void clearContent(); void storeContent(const LLSD& content); -- cgit v1.2.3 From 0c0f4edb0026b1695655512ebed3a5508919a9b7 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 31 May 2013 18:13:01 -0700 Subject: ACME-484 Add a right click menu to the 'Suggested Friends' tab --- indra/newview/llpanelpeople.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 22fbbf0c0e..2a14978a95 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -689,6 +689,7 @@ BOOL LLPanelPeople::postBuild() mRecentList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); + mSuggestedFriends->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); //===Temporary ======================================================================== -- cgit v1.2.3 From e17b9de293084da0de0ce12290c9ae1939184337 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 31 May 2013 19:07:09 -0700 Subject: ACME-453, ACME-455, ACME-456, ACME-465 : Duplicate and tweak the Snapshot Profile UI to create the Snapshot Facebook UI --- indra/newview/CMakeLists.txt | 1 + indra/newview/llpanelsnapshotfacebook.cpp | 101 +++++++++++ indra/newview/llpanelsnapshotoptions.cpp | 7 + indra/newview/skins/default/textures/textures.xml | 1 + .../default/textures/toolbar_icons/facebook.png | Bin 0 -> 1180 bytes .../skins/default/xui/en/floater_snapshot.xml | 24 ++- .../default/xui/en/panel_snapshot_facebook.xml | 199 +++++++++++++++++++++ .../default/xui/en/panel_snapshot_options.xml | 23 ++- 8 files changed, 351 insertions(+), 5 deletions(-) create mode 100755 indra/newview/llpanelsnapshotfacebook.cpp create mode 100755 indra/newview/skins/default/textures/toolbar_icons/facebook.png create mode 100755 indra/newview/skins/default/xui/en/panel_snapshot_facebook.xml diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 477600ca01..f01c2f714d 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -434,6 +434,7 @@ set(viewer_SOURCE_FILES llpanelprimmediacontrols.cpp llpanelprofile.cpp llpanelsnapshot.cpp + llpanelsnapshotfacebook.cpp llpanelsnapshotinventory.cpp llpanelsnapshotlocal.cpp llpanelsnapshotoptions.cpp diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp new file mode 100755 index 0000000000..50c5b62fe7 --- /dev/null +++ b/indra/newview/llpanelsnapshotfacebook.cpp @@ -0,0 +1,101 @@ +/** + * @file llpanelsnapshotfacebook.cpp + * @brief Posts a snapshot to the resident Facebook account. + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +// libs +#include "llcombobox.h" +#include "llfloaterreg.h" +#include "llpanel.h" +#include "llspinctrl.h" + +// newview +#include "llfloatersnapshot.h" +#include "llpanelsnapshot.h" +#include "llsidetraypanelcontainer.h" +#include "llwebprofile.h" + +/** + * Posts a snapshot to the resident Facebook account. + */ +class LLPanelSnapshotFacebook +: public LLPanelSnapshot +{ + LOG_CLASS(LLPanelSnapshotFacebook); + +public: + LLPanelSnapshotFacebook(); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + +private: + /*virtual*/ std::string getWidthSpinnerName() const { return "facebook_snapshot_width"; } + /*virtual*/ std::string getHeightSpinnerName() const { return "facebook_snapshot_height"; } + /*virtual*/ std::string getAspectRatioCBName() const { return "facebook_keep_aspect_check"; } + /*virtual*/ std::string getImageSizeComboName() const { return "facebook_size_combo"; } + /*virtual*/ std::string getImageSizePanelName() const { return "facebook_image_size_lp"; } + /*virtual*/ LLFloaterSnapshot::ESnapshotFormat getImageFormat() const { return LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG; } + /*virtual*/ void updateControls(const LLSD& info); + + void onSend(); +}; + +static LLRegisterPanelClassWrapper panel_class("llpanelsnapshotfacebook"); + +LLPanelSnapshotFacebook::LLPanelSnapshotFacebook() +{ + mCommitCallbackRegistrar.add("PostToFacebook.Send", boost::bind(&LLPanelSnapshotFacebook::onSend, this)); + mCommitCallbackRegistrar.add("PostToFacebook.Cancel", boost::bind(&LLPanelSnapshotFacebook::cancel, this)); +} + +// virtual +BOOL LLPanelSnapshotFacebook::postBuild() +{ + return LLPanelSnapshot::postBuild(); +} + +// virtual +void LLPanelSnapshotFacebook::onOpen(const LLSD& key) +{ + LLPanelSnapshot::onOpen(key); +} + +// virtual +void LLPanelSnapshotFacebook::updateControls(const LLSD& info) +{ + const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true; + getChild("post_btn")->setEnabled(have_snapshot); +} + +void LLPanelSnapshotFacebook::onSend() +{ + std::string caption = getChild("caption")->getValue().asString(); + bool add_location = getChild("add_location_cb")->getValue().asBoolean(); + + LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location); + LLFloaterSnapshot::postSave(); +} diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp index 554fabe5b3..14953f3cf9 100755 --- a/indra/newview/llpanelsnapshotoptions.cpp +++ b/indra/newview/llpanelsnapshotoptions.cpp @@ -51,6 +51,7 @@ private: void updateUploadCost(); void openPanel(const std::string& panel_name); void onSaveToProfile(); + void onSaveToFacebook(); void onSaveToEmail(); void onSaveToInventory(); void onSaveToComputer(); @@ -60,6 +61,7 @@ static LLRegisterPanelClassWrapper panel_class("llpanels LLPanelSnapshotOptions::LLPanelSnapshotOptions() { + mCommitCallbackRegistrar.add("Snapshot.SaveToFacebook", boost::bind(&LLPanelSnapshotOptions::onSaveToFacebook, this)); mCommitCallbackRegistrar.add("Snapshot.SaveToProfile", boost::bind(&LLPanelSnapshotOptions::onSaveToProfile, this)); mCommitCallbackRegistrar.add("Snapshot.SaveToEmail", boost::bind(&LLPanelSnapshotOptions::onSaveToEmail, this)); mCommitCallbackRegistrar.add("Snapshot.SaveToInventory", boost::bind(&LLPanelSnapshotOptions::onSaveToInventory, this)); @@ -99,6 +101,11 @@ void LLPanelSnapshotOptions::openPanel(const std::string& panel_name) LLFloaterSnapshot::postPanelSwitch(); } +void LLPanelSnapshotOptions::onSaveToFacebook() +{ + openPanel("panel_snapshot_facebook"); +} + void LLPanelSnapshotOptions::onSaveToProfile() { openPanel("panel_snapshot_profile"); diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 18146943a5..a0b46bab0b 100755 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -567,6 +567,7 @@ with the same filename but different name + diff --git a/indra/newview/skins/default/textures/toolbar_icons/facebook.png b/indra/newview/skins/default/textures/toolbar_icons/facebook.png new file mode 100755 index 0000000000..32fe2bf8ac Binary files /dev/null and b/indra/newview/skins/default/textures/toolbar_icons/facebook.png differ diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml index 49d64767cc..e8e7fb77c1 100755 --- a/indra/newview/skins/default/xui/en/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml @@ -21,7 +21,11 @@ Sending Email + name="facebook_progress_str"> + Posting to Facebook + + Posting + name="facebook_succeeded_str"> + Image uploaded + + Image uploaded + name="facebook_failed_str"> + Failed to upload image to your Facebook timeline. + + Failed to upload image to your Profile Feed. + + + + + Post to my Facebook timeline + + + + + + + + + + + + + + + + + + Caption: + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml index d2f29ade44..8cf5bfb426 100755 --- a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml @@ -5,6 +5,25 @@ layout="topleft" name="panel_snapshot_options" width="490"> + -- cgit v1.2.3 From 8420e8d5db1b9987f57fa542d81e450f54aec16f Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 3 Jun 2013 15:53:34 -0700 Subject: Fix build --- indra/newview/llmeshrepository.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index b30576171e..83b7cae347 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1237,7 +1237,6 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat } mPendingLOD.erase(iter); } - } } return true; -- cgit v1.2.3 From 6bf2dad1cc8df2769a0833786bc16eea96649d6d Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 4 Jun 2013 14:05:13 -0700 Subject: ACME-484: Right-click menu only has 'Add Friend' and 'View Profile' options. Also multi-select is disabled. --- indra/newview/llpanelpeople.cpp | 2 +- indra/newview/llpanelpeoplemenus.cpp | 33 ++++++++++++++++++++++ indra/newview/llpanelpeoplemenus.h | 13 +++++++++ .../newview/skins/default/xui/en/panel_people.xml | 1 - 4 files changed, 47 insertions(+), 2 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 2a14978a95..5bc645bcfd 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -689,7 +689,7 @@ BOOL LLPanelPeople::postBuild() mRecentList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); - mSuggestedFriends->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); + mSuggestedFriends->setContextMenu(&LLPanelPeopleMenus::gSuggestedFriendsContextMenu); //===Temporary ======================================================================== diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index 49f7361c4a..313056f06a 100755 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -47,6 +47,7 @@ namespace LLPanelPeopleMenus PeopleContextMenu gPeopleContextMenu; NearbyPeopleContextMenu gNearbyPeopleContextMenu; +SuggestedFriendsContextMenu gSuggestedFriendsContextMenu; //== PeopleContextMenu =============================================================== @@ -301,4 +302,36 @@ void NearbyPeopleContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags) hide_context_entries(menu, items, disabled_items); } +//== SuggestedFriendsContextMenu =============================================================== + +LLContextMenu* SuggestedFriendsContextMenu::createMenu() +{ + // set up the callbacks for all of the avatar menu items + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; + LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; + LLContextMenu* menu; + + // Set up for one person selected menu + const LLUUID& id = mUUIDs.front(); + registrar.add("Avatar.Profile", boost::bind(&LLAvatarActions::showProfile, id)); + registrar.add("Avatar.AddFriend", boost::bind(&LLAvatarActions::requestFriendshipDialog, id)); + + // create the context menu from the XUI + menu = createFromFile("menu_people_nearby.xml"); + buildContextMenu(*menu, 0x0); + + return menu; +} + +void SuggestedFriendsContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags) +{ + menuentry_vec_t items; + menuentry_vec_t disabled_items; + + items.push_back(std::string("view_profile")); + items.push_back(std::string("add_friend")); + + hide_context_entries(menu, items, disabled_items); +} + } // namespace LLPanelPeopleMenus diff --git a/indra/newview/llpanelpeoplemenus.h b/indra/newview/llpanelpeoplemenus.h index 0a1dcef303..5367eca0d3 100755 --- a/indra/newview/llpanelpeoplemenus.h +++ b/indra/newview/llpanelpeoplemenus.h @@ -58,8 +58,21 @@ protected: /*virtual*/ void buildContextMenu(class LLMenuGL& menu, U32 flags); }; +/** + * Menu used in the suggested friends list. + */ +class SuggestedFriendsContextMenu : public PeopleContextMenu +{ +public: + /*virtual*/ LLContextMenu * createMenu(); + +protected: + /*virtual*/ void buildContextMenu(class LLMenuGL& menu, U32 flags); +}; + extern PeopleContextMenu gPeopleContextMenu; extern NearbyPeopleContextMenu gNearbyPeopleContextMenu; +extern SuggestedFriendsContextMenu gSuggestedFriendsContextMenu; } // namespace LLPanelPeopleMenus diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index c21d2abdd7..451095c7d8 100755 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -377,7 +377,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M height="173" layout="topleft" left="0" - multi_select="true" name="suggested_friends" show_permissions_granted="true" top="0" -- cgit v1.2.3 From f3a72799b01ad2449ae24e86169b994c696c1b4a Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 5 Jun 2013 01:03:33 +0100 Subject: added call to sharePhoto() with placeholder image for ACME-467 --- indra/newview/llpanelsnapshotfacebook.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp index 50c5b62fe7..200c64f16b 100755 --- a/indra/newview/llpanelsnapshotfacebook.cpp +++ b/indra/newview/llpanelsnapshotfacebook.cpp @@ -38,6 +38,8 @@ #include "llsidetraypanelcontainer.h" #include "llwebprofile.h" +#include "llfacebookconnect.h" + /** * Posts a snapshot to the resident Facebook account. */ @@ -98,4 +100,7 @@ void LLPanelSnapshotFacebook::onSend() LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location); LLFloaterSnapshot::postSave(); + + // test with a placeholder image, until we can figure out a way to grab the uploaded image url + LLFacebookConnect::instance().sharePhoto("http://fc02.deviantart.net/fs43/i/2009/125/a/9/Future_of_Frog_by_axcho.jpg", caption); } -- cgit v1.2.3 From abcb3e85628712da4d61fda6e68bb86a29e1f965 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 4 Jun 2013 18:39:41 -0700 Subject: ACME-471: Once connected to facebook, a user can use the 'Check in to Facebook' button under the 'Me' menu to make a check in post to Facebook --- indra/newview/llfacebookconnect.cpp | 18 +++++++++++++++++ indra/newview/llfacebookconnect.h | 1 + indra/newview/llviewermenu.cpp | 23 ++++++++++++++++++++++ indra/newview/llviewermenu.h | 4 +++- indra/newview/skins/default/xui/en/menu_viewer.xml | 6 ++++++ 5 files changed, 51 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 5013a5cb40..668ba04406 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -275,6 +275,24 @@ void LLFacebookConnect::loadFacebookFriends() LLSD(), timeout, follow_redirects); } +void LLFacebookConnect::postCheckin(const std::string& location, const std::string& name, const std::string& description, const std::string& image, const std::string& message) +{ + LLSD body; + if (!location.empty()) + body["location"] = location; + if (!name.empty()) + body["name"] = name; + if (!description.empty()) + body["description"] = description; + if (!image.empty()) + body["image"] = image; + if (!message.empty()) + body["message"] = message; + + // Note: we can use that route for different publish action. We should be able to use the same responder. + LLHTTPClient::post(getFacebookConnectURL("/share/checkin"), body, new LLFacebookPostResponder()); +} + void LLFacebookConnect::postCheckinMessage(const std::string& message, const std::string& link, const std::string& name, const std::string& caption, const std::string& description, const std::string& picture) { LLSD body; diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index faa60b0f34..2dba182267 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -46,6 +46,7 @@ public: void getConnectionToFacebook(); void loadFacebookFriends(); + void postCheckin(const std::string& location, const std::string& name, const std::string& description, const std::string& picture, const std::string& message); void postCheckinMessage(const std::string& message, const std::string& link, const std::string& name, const std::string& caption, const std::string& description, const std::string& picture); void sharePhoto(const std::string& image_url, const std::string& caption); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index bb9ad8c606..eb100a3f9b 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -45,6 +45,7 @@ #include "llagent.h" #include "llagentaccess.h" #include "llagentcamera.h" +#include "llagentui.h" #include "llagentwearables.h" #include "llagentpilot.h" #include "llcompilequeue.h" @@ -5983,6 +5984,26 @@ void handle_facebook_connect() } } +void handle_facebook_checkin() +{ + + // Get the location SLURL + LLSLURL slurl; + LLAgentUI::buildSLURL(slurl); + std::string slurl_string = slurl.getSLURLString(); + + //Get the location name + LLViewerParcelMgr * parcel = LLViewerParcelMgr::getInstance(); + std::string parcel_string = parcel->getAgentParcelName(); + + //Get the location description + LLVector3 agent_pos = gAgent.getPositionAgent(); + std::string description; + LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_FULL, agent_pos); + + LLFacebookConnect::instance().postCheckin(slurl_string, parcel_string, description, "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDL4jdC_vCh0ow-QCXZjN-WNojEXWiz0APEa6Qhpl8cxawjkoC7w", ""); +} + //bool is_facebook_connected(); @@ -8738,4 +8759,6 @@ void initialize_menus() // Facebook Connect commit.add("Facebook.Connect", boost::bind(&handle_facebook_connect)); + // Facebook Checkin + commit.add("Facebook.Checkin", boost::bind(&handle_facebook_checkin)); } diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index b916d95b7a..9c3f13f843 100755 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -137,7 +137,9 @@ bool handle_go_to(); // Facebook Connect void handle_facebook_connect(); -//bool is_facebook_connected(); + +//Facebook Checkin +void handle_facebook_checkin(); // Export to XML or Collada void handle_export_selected( void * ); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index b34816fb14..5061842c7f 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -21,6 +21,12 @@ + + + Date: Wed, 5 Jun 2013 00:32:15 -0700 Subject: ACME-471: In last commit was not using the correct name and location. Now using the proper name and location. --- indra/newview/llviewermenu.cpp | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index eb100a3f9b..bd5a37876f 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5992,16 +5992,40 @@ void handle_facebook_checkin() LLAgentUI::buildSLURL(slurl); std::string slurl_string = slurl.getSLURLString(); - //Get the location name + std::string region_name = gAgent.getRegion()->getName(); + + //Get the parcel name LLViewerParcelMgr * parcel = LLViewerParcelMgr::getInstance(); - std::string parcel_string = parcel->getAgentParcelName(); + std::string parcel_title = parcel->getAgentParcelName(); + + //Create the location + LLVector3 agent_pos_region = gAgent.getPositionAgent(); + S32 pos_x = S32(agent_pos_region.mV[VX]); + S32 pos_y = S32(agent_pos_region.mV[VY]); + S32 pos_z = S32(agent_pos_region.mV[VZ]); + + // Round the numbers based on the velocity + F32 velocity_mag_sq = gAgent.getVelocity().magVecSquared(); + + const F32 FLY_CUTOFF = 6.f; // meters/sec + const F32 FLY_CUTOFF_SQ = FLY_CUTOFF * FLY_CUTOFF; + const F32 WALK_CUTOFF = 1.5f; // meters/sec + const F32 WALK_CUTOFF_SQ = WALK_CUTOFF * WALK_CUTOFF; + + if (velocity_mag_sq > FLY_CUTOFF_SQ) + { + pos_x -= pos_x % 4; + pos_y -= pos_y % 4; + } + else if (velocity_mag_sq > WALK_CUTOFF_SQ) + { + pos_x -= pos_x % 2; + pos_y -= pos_y % 2; + } - //Get the location description - LLVector3 agent_pos = gAgent.getPositionAgent(); - std::string description; - LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_FULL, agent_pos); + std::string description = llformat("%s (%d, %d, %d)", parcel_title.c_str(), pos_x, pos_y, pos_z); - LLFacebookConnect::instance().postCheckin(slurl_string, parcel_string, description, "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDL4jdC_vCh0ow-QCXZjN-WNojEXWiz0APEa6Qhpl8cxawjkoC7w", ""); + LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDL4jdC_vCh0ow-QCXZjN-WNojEXWiz0APEa6Qhpl8cxawjkoC7w", ""); } //bool is_facebook_connected(); -- cgit v1.2.3 From ec52db8d0c4099dd5e3b476f7b44a4ebda7cb676 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 5 Jun 2013 17:32:10 -0400 Subject: STORM-1838 Slowly reappling changes to work with CHUI --- indra/newview/llavataractions.cpp | 1 + indra/newview/llconversationloglist.cpp | 1 + indra/newview/llconversationmodel.cpp | 1 + indra/newview/llfloaterimcontainer.cpp | 4 ++++ indra/newview/llpanelpeoplemenus.cpp | 13 ++++++++++++- indra/newview/llpanelpeoplemenus.h | 1 + indra/newview/skins/default/xui/en/menu_conversation.xml | 9 +++++++++ indra/newview/skins/default/xui/en/menu_people_nearby.xml | 9 +++++++++ 8 files changed, 38 insertions(+), 1 deletion(-) diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 45992b8c83..285e70c8ea 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -443,6 +443,7 @@ void LLAvatarActions::teleport_request_callback(const LLSD& notification, const // static void LLAvatarActions::teleportRequest(const LLUUID& id) { +llwarns << "DBG " << llendl; std::string name; gCacheName->getFullName(id, name); gCacheName->cleanFullName(name); diff --git a/indra/newview/llconversationloglist.cpp b/indra/newview/llconversationloglist.cpp index 5ab108b39f..cf9c9b3415 100644 --- a/indra/newview/llconversationloglist.cpp +++ b/indra/newview/llconversationloglist.cpp @@ -311,6 +311,7 @@ void LLConversationLogList::onCustomAction(const LLSD& userdata) } else if ("offer_teleport" == command_name) { +llwarns << "DBG " << llendl; LLAvatarActions::offerTeleport(selected_conversation_participant_id); } else if("add_friend" == command_name) diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index c74ce24872..b0aaa21ec9 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -132,6 +132,7 @@ void LLConversationItem::buildParticipantMenuOptions(menuentry_vec_t& items, U32 items.push_back(std::string("view_profile")); items.push_back(std::string("im")); items.push_back(std::string("offer_teleport")); + items.push_back(std::string("request_teleport")); items.push_back(std::string("voice_call")); items.push_back(std::string("chat_history")); items.push_back(std::string("separator_chat_history")); diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 5e0cd8ef78..65155041f0 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1007,6 +1007,10 @@ void LLFloaterIMContainer::doToParticipants(const std::string& command, uuid_vec { LLAvatarActions::offerTeleport(selectedIDS); } + else if ("request_teleport" == command) + { + LLAvatarActions::teleportRequest(selectedIDS.front()); + } else if ("voice_call" == command) { LLAvatarActions::startCall(userID); diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index a68772a35d..ddc92f439b 100644 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -74,7 +74,7 @@ LLContextMenu* PeopleContextMenu::createMenu() registrar.add("Avatar.Pay", boost::bind(&LLAvatarActions::pay, id)); registrar.add("Avatar.BlockUnblock", boost::bind(&LLAvatarActions::toggleBlock, id)); registrar.add("Avatar.InviteToGroup", boost::bind(&LLAvatarActions::inviteToGroup, id)); - registrar.add("Avatar.TeleportRequest", boost::bind(&LLAvatarActions::teleportRequest, id)); + registrar.add("Avatar.TeleportRequest", boost::bind(&PeopleContextMenu::requestTeleport, this)); registrar.add("Avatar.Calllog", boost::bind(&LLAvatarActions::viewChatHistory, id)); enable_registrar.add("Avatar.EnableItem", boost::bind(&PeopleContextMenu::enableContextMenuItem, this, _2)); @@ -126,6 +126,7 @@ void PeopleContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags) items.push_back(std::string("view_profile")); items.push_back(std::string("im")); items.push_back(std::string("offer_teleport")); + items.push_back(std::string("request_teleport")); items.push_back(std::string("voice_call")); items.push_back(std::string("chat_history")); items.push_back(std::string("separator_chat_history")); @@ -256,10 +257,19 @@ bool PeopleContextMenu::checkContextMenuItem(const LLSD& userdata) return false; } +void PeopleContextMenu::requestTeleport() +{ + // boost::bind cannot recognize overloaded method LLAvatarActions::teleportRequest(), + // so we have to use a wrapper. +llwarns << "DBG " << llendl; + LLAvatarActions::teleportRequest(mUUIDs.front()); +} + void PeopleContextMenu::offerTeleport() { // boost::bind cannot recognize overloaded method LLAvatarActions::offerTeleport(), // so we have to use a wrapper. +llwarns << "DBG " << llendl; LLAvatarActions::offerTeleport(mUUIDs); } @@ -285,6 +295,7 @@ void NearbyPeopleContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags) items.push_back(std::string("view_profile")); items.push_back(std::string("im")); items.push_back(std::string("offer_teleport")); + items.push_back(std::string("request_teleport")); items.push_back(std::string("voice_call")); items.push_back(std::string("chat_history")); items.push_back(std::string("separator_chat_history")); diff --git a/indra/newview/llpanelpeoplemenus.h b/indra/newview/llpanelpeoplemenus.h index 0a1dcef303..abf5fa05e4 100644 --- a/indra/newview/llpanelpeoplemenus.h +++ b/indra/newview/llpanelpeoplemenus.h @@ -47,6 +47,7 @@ private: bool enableContextMenuItem(const LLSD& userdata); bool checkContextMenuItem(const LLSD& userdata); void offerTeleport(); + void requestTeleport(); }; /** diff --git a/indra/newview/skins/default/xui/en/menu_conversation.xml b/indra/newview/skins/default/xui/en/menu_conversation.xml index 5a13ef0a59..c2c15023c5 100644 --- a/indra/newview/skins/default/xui/en/menu_conversation.xml +++ b/indra/newview/skins/default/xui/en/menu_conversation.xml @@ -46,6 +46,15 @@ + + + + + + + + + + Date: Wed, 5 Jun 2013 14:45:11 -0700 Subject: ACME-471: Code cleanup, instead of duplicating code from LLAgentUI::buildLocationString, now calling LLAgentUI::buildLocationString with a flag to perform a similar operation. --- indra/newview/llagentui.cpp | 10 ++++++++++ indra/newview/llagentui.h | 1 + indra/newview/llviewermenu.cpp | 33 ++------------------------------- 3 files changed, 13 insertions(+), 31 deletions(-) diff --git a/indra/newview/llagentui.cpp b/indra/newview/llagentui.cpp index b9ec304b7e..125f911e0d 100755 --- a/indra/newview/llagentui.cpp +++ b/indra/newview/llagentui.cpp @@ -130,6 +130,11 @@ BOOL LLAgentUI::buildLocationString(std::string& str, ELocationFormat fmt,const sim_access_string.empty() ? "" : " - ", sim_access_string.c_str()); break; + case LOCATION_FORMAT_NORMAL_COORDS: + buffer = llformat("%s (%d, %d, %d)", + region_name.c_str(), + pos_x, pos_y, pos_z); + break; } } else @@ -164,6 +169,11 @@ BOOL LLAgentUI::buildLocationString(std::string& str, ELocationFormat fmt,const sim_access_string.empty() ? "" : " - ", sim_access_string.c_str()); break; + case LOCATION_FORMAT_NORMAL_COORDS: + buffer = llformat("%s (%d, %d, %d)", + parcel_name.c_str(), + pos_x, pos_y, pos_z); + break; } } str = buffer; diff --git a/indra/newview/llagentui.h b/indra/newview/llagentui.h index dda5dc1fd1..bb48dad14c 100755 --- a/indra/newview/llagentui.h +++ b/indra/newview/llagentui.h @@ -35,6 +35,7 @@ public: enum ELocationFormat { LOCATION_FORMAT_NORMAL, // Parcel + LOCATION_FORMAT_NORMAL_COORDS, // Parcel (x, y, z) LOCATION_FORMAT_LANDMARK, // Parcel, Region LOCATION_FORMAT_NO_MATURITY, // Parcel, Region (x, y, z) LOCATION_FORMAT_NO_COORDS, // Parcel, Region - Maturity diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index bd5a37876f..471db8d8fc 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5993,37 +5993,8 @@ void handle_facebook_checkin() std::string slurl_string = slurl.getSLURLString(); std::string region_name = gAgent.getRegion()->getName(); - - //Get the parcel name - LLViewerParcelMgr * parcel = LLViewerParcelMgr::getInstance(); - std::string parcel_title = parcel->getAgentParcelName(); - - //Create the location - LLVector3 agent_pos_region = gAgent.getPositionAgent(); - S32 pos_x = S32(agent_pos_region.mV[VX]); - S32 pos_y = S32(agent_pos_region.mV[VY]); - S32 pos_z = S32(agent_pos_region.mV[VZ]); - - // Round the numbers based on the velocity - F32 velocity_mag_sq = gAgent.getVelocity().magVecSquared(); - - const F32 FLY_CUTOFF = 6.f; // meters/sec - const F32 FLY_CUTOFF_SQ = FLY_CUTOFF * FLY_CUTOFF; - const F32 WALK_CUTOFF = 1.5f; // meters/sec - const F32 WALK_CUTOFF_SQ = WALK_CUTOFF * WALK_CUTOFF; - - if (velocity_mag_sq > FLY_CUTOFF_SQ) - { - pos_x -= pos_x % 4; - pos_y -= pos_y % 4; - } - else if (velocity_mag_sq > WALK_CUTOFF_SQ) - { - pos_x -= pos_x % 2; - pos_y -= pos_y % 2; - } - - std::string description = llformat("%s (%d, %d, %d)", parcel_title.c_str(), pos_x, pos_y, pos_z); + std::string description; + LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_NORMAL_COORDS, gAgent.getPositionAgent()); LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDL4jdC_vCh0ow-QCXZjN-WNojEXWiz0APEa6Qhpl8cxawjkoC7w", ""); } -- cgit v1.2.3 From 64f4246f17b8270870fae84eca26e18a567a2174 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Wed, 5 Jun 2013 14:54:10 -0700 Subject: ACME-471: Code cleanup, just moving some code. --- indra/newview/llagentui.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/indra/newview/llagentui.cpp b/indra/newview/llagentui.cpp index 125f911e0d..3410a37890 100755 --- a/indra/newview/llagentui.cpp +++ b/indra/newview/llagentui.cpp @@ -112,6 +112,11 @@ BOOL LLAgentUI::buildLocationString(std::string& str, ELocationFormat fmt,const case LOCATION_FORMAT_NORMAL: buffer = llformat("%s", region_name.c_str()); break; + case LOCATION_FORMAT_NORMAL_COORDS: + buffer = llformat("%s (%d, %d, %d)", + region_name.c_str(), + pos_x, pos_y, pos_z); + break; case LOCATION_FORMAT_NO_COORDS: buffer = llformat("%s%s%s", region_name.c_str(), @@ -130,11 +135,6 @@ BOOL LLAgentUI::buildLocationString(std::string& str, ELocationFormat fmt,const sim_access_string.empty() ? "" : " - ", sim_access_string.c_str()); break; - case LOCATION_FORMAT_NORMAL_COORDS: - buffer = llformat("%s (%d, %d, %d)", - region_name.c_str(), - pos_x, pos_y, pos_z); - break; } } else @@ -148,6 +148,11 @@ BOOL LLAgentUI::buildLocationString(std::string& str, ELocationFormat fmt,const case LOCATION_FORMAT_NORMAL: buffer = llformat("%s, %s", parcel_name.c_str(), region_name.c_str()); break; + case LOCATION_FORMAT_NORMAL_COORDS: + buffer = llformat("%s (%d, %d, %d)", + parcel_name.c_str(), + pos_x, pos_y, pos_z); + break; case LOCATION_FORMAT_NO_MATURITY: buffer = llformat("%s, %s (%d, %d, %d)", parcel_name.c_str(), @@ -169,11 +174,6 @@ BOOL LLAgentUI::buildLocationString(std::string& str, ELocationFormat fmt,const sim_access_string.empty() ? "" : " - ", sim_access_string.c_str()); break; - case LOCATION_FORMAT_NORMAL_COORDS: - buffer = llformat("%s (%d, %d, %d)", - parcel_name.c_str(), - pos_x, pos_y, pos_z); - break; } } str = buffer; -- cgit v1.2.3 From faf99f2e1c88f281836c555d9fa6886d45f13751 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 5 Jun 2013 15:43:31 -0700 Subject: ACME-485 : Temporary facebook.png icon for the snapshot panel --- .../skins/default/textures/toolbar_icons/facebook.png | Bin 1180 -> 2974 bytes 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 indra/newview/skins/default/textures/toolbar_icons/facebook.png diff --git a/indra/newview/skins/default/textures/toolbar_icons/facebook.png b/indra/newview/skins/default/textures/toolbar_icons/facebook.png old mode 100755 new mode 100644 index 32fe2bf8ac..b960b834dc Binary files a/indra/newview/skins/default/textures/toolbar_icons/facebook.png and b/indra/newview/skins/default/textures/toolbar_icons/facebook.png differ -- cgit v1.2.3 From 4d162e1ec2cd716f40666056bb9e2710958e3360 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 5 Jun 2013 23:52:34 +0100 Subject: added callback to post photo with actual image url --- indra/newview/llpanelsnapshotfacebook.cpp | 13 +++++++-- indra/newview/llwebprofile.cpp | 48 ++++++++++++++++++++++++------- indra/newview/llwebprofile.h | 5 ++-- 3 files changed, 52 insertions(+), 14 deletions(-) diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp index 200c64f16b..954941274a 100755 --- a/indra/newview/llpanelsnapshotfacebook.cpp +++ b/indra/newview/llpanelsnapshotfacebook.cpp @@ -64,6 +64,7 @@ private: /*virtual*/ void updateControls(const LLSD& info); void onSend(); + void onImageUploaded(const std::string& image_url, const std::string& caption); }; static LLRegisterPanelClassWrapper panel_class("llpanelsnapshotfacebook"); @@ -98,9 +99,17 @@ void LLPanelSnapshotFacebook::onSend() std::string caption = getChild("caption")->getValue().asString(); bool add_location = getChild("add_location_cb")->getValue().asBoolean(); - LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location); + LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location, boost::bind(&LLPanelSnapshotFacebook::onImageUploaded, this, _1, _2)); LLFloaterSnapshot::postSave(); // test with a placeholder image, until we can figure out a way to grab the uploaded image url - LLFacebookConnect::instance().sharePhoto("http://fc02.deviantart.net/fs43/i/2009/125/a/9/Future_of_Frog_by_axcho.jpg", caption); + //LLFacebookConnect::instance().sharePhoto("http://fc02.deviantart.net/fs43/i/2009/125/a/9/Future_of_Frog_by_axcho.jpg", caption); +} + +void LLPanelSnapshotFacebook::onImageUploaded(const std::string& image_url, const std::string& caption) +{ + if (!image_url.empty()) + { + LLFacebookConnect::instance().sharePhoto(image_url, caption); + } } diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp index 641f338f2c..4bc4724753 100755 --- a/indra/newview/llwebprofile.cpp +++ b/indra/newview/llwebprofile.cpp @@ -62,8 +62,8 @@ class LLWebProfileResponders::ConfigResponder : public LLHTTPClient::Responder LOG_CLASS(LLWebProfileResponders::ConfigResponder); public: - ConfigResponder(LLPointer imagep) - : mImagep(imagep) + ConfigResponder(LLPointer imagep, const std::string& caption, LLWebProfile::image_url_callback_t cb) + : mImagep(imagep), mImageCaption(caption), mImageCallback(cb) { } @@ -113,11 +113,13 @@ public: // Do the actual image upload using the configuration. LL_DEBUGS("Snapshots") << "Got upload config, POSTing image to " << upload_url << ", config=[" << config << "]" << llendl; - LLWebProfile::post(mImagep, config, upload_url); + LLWebProfile::post(mImagep, config, upload_url, mImageCaption, mImageCallback); } private: LLPointer mImagep; + std::string mImageCaption; + LLWebProfile::image_url_callback_t mImageCallback; }; /////////////////////////////////////////////////////////////////////////////// @@ -127,6 +129,22 @@ class LLWebProfileResponders::PostImageRedirectResponder : public LLHTTPClient:: LOG_CLASS(LLWebProfileResponders::PostImageRedirectResponder); public: + PostImageRedirectResponder(const std::string& caption, LLWebProfile::image_url_callback_t cb) + : mImageCaption(caption), mImageCallback(cb) + { + } + + /*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content) + { + if (status == 200) + { + std::string image_url = content.get("Location"); + llinfos << "Image uploaded to " << image_url << llendl; + if (!mImageCallback.empty() && !image_url.empty()) + mImageCallback(image_url, mImageCaption); + } + } + /*virtual*/ void completedRaw( U32 status, const std::string& reason, @@ -148,9 +166,10 @@ public: LL_DEBUGS("Snapshots") << "Uploading image succeeded. Response: [" << body << "]" << llendl; LLWebProfile::reportImageUploadStatus(true); } - + private: - LLPointer mImagep; + std::string mImageCaption; + LLWebProfile::image_url_callback_t mImageCallback; }; @@ -161,6 +180,11 @@ class LLWebProfileResponders::PostImageResponder : public LLHTTPClient::Responde LOG_CLASS(LLWebProfileResponders::PostImageResponder); public: + PostImageResponder(const std::string& caption, LLWebProfile::image_url_callback_t cb) + : mImageCaption(caption), mImageCallback(cb) + { + } + /*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content) { // Viewer seems to fail to follow a 303 redirect on POST request @@ -172,7 +196,7 @@ public: headers["Cookie"] = LLWebProfile::getAuthCookie(); const std::string& redir_url = content["location"]; LL_DEBUGS("Snapshots") << "Got redirection URL: " << redir_url << llendl; - LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder, headers); + LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder(mImageCaption, mImageCallback), headers); } else { @@ -188,6 +212,10 @@ public: const LLIOPipe::buffer_ptr_t& buffer) { } + +private: + std::string mImageCaption; + LLWebProfile::image_url_callback_t mImageCallback; }; /////////////////////////////////////////////////////////////////////////////// @@ -197,7 +225,7 @@ std::string LLWebProfile::sAuthCookie; LLWebProfile::status_callback_t LLWebProfile::mStatusCallback; // static -void LLWebProfile::uploadImage(LLPointer image, const std::string& caption, bool add_location) +void LLWebProfile::uploadImage(LLPointer image, const std::string& caption, bool add_location, LLWebProfile::image_url_callback_t cb) { // Get upload configuration data. std::string config_url(getProfileURL(LLStringUtil::null) + "snapshots/s3_upload_config"); @@ -207,7 +235,7 @@ void LLWebProfile::uploadImage(LLPointer image, const std::str LL_DEBUGS("Snapshots") << "Requesting " << config_url << llendl; LLSD headers = LLViewerMedia::getHeaders(); headers["Cookie"] = getAuthCookie(); - LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image), headers); + LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image, caption, cb), headers); } // static @@ -218,7 +246,7 @@ void LLWebProfile::setAuthCookie(const std::string& cookie) } // static -void LLWebProfile::post(LLPointer image, const LLSD& config, const std::string& url) +void LLWebProfile::post(LLPointer image, const LLSD& config, const std::string& url, const std::string& caption, LLWebProfile::image_url_callback_t cb) { if (dynamic_cast(image.get()) == 0) { @@ -284,7 +312,7 @@ void LLWebProfile::post(LLPointer image, const LLSD& config, c memcpy(data, body.str().data(), size); // Send request, successful upload will trigger posting metadata. - LLHTTPClient::postRaw(url, data, size, new LLWebProfileResponders::PostImageResponder(), headers); + LLHTTPClient::postRaw(url, data, size, new LLWebProfileResponders::PostImageResponder(caption, cb), headers); } // static diff --git a/indra/newview/llwebprofile.h b/indra/newview/llwebprofile.h index 10279bffac..c1c0c23540 100755 --- a/indra/newview/llwebprofile.h +++ b/indra/newview/llwebprofile.h @@ -48,8 +48,9 @@ class LLWebProfile public: typedef boost::function status_callback_t; + typedef boost::function image_url_callback_t; - static void uploadImage(LLPointer image, const std::string& caption, bool add_location); + static void uploadImage(LLPointer image, const std::string& caption, bool add_location, image_url_callback_t cb = image_url_callback_t()); static void setAuthCookie(const std::string& cookie); static void setImageUploadResultCallback(status_callback_t cb) { mStatusCallback = cb; } @@ -58,7 +59,7 @@ private: friend class LLWebProfileResponders::PostImageResponder; friend class LLWebProfileResponders::PostImageRedirectResponder; - static void post(LLPointer image, const LLSD& config, const std::string& url); + static void post(LLPointer image, const LLSD& config, const std::string& url, const std::string& caption, image_url_callback_t cb); static void reportImageUploadStatus(bool ok); static std::string getAuthCookie(); -- cgit v1.2.3 From 9232d919c8571743d9f5c899b80e2807f131f4d3 Mon Sep 17 00:00:00 2001 From: Cho Date: Thu, 6 Jun 2013 00:09:59 +0100 Subject: removed unnecessary passing of image caption --- indra/newview/llpanelsnapshotfacebook.cpp | 6 +++--- indra/newview/llwebprofile.cpp | 27 ++++++++++++--------------- indra/newview/llwebprofile.h | 4 ++-- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp index 954941274a..9bea5aa796 100755 --- a/indra/newview/llpanelsnapshotfacebook.cpp +++ b/indra/newview/llpanelsnapshotfacebook.cpp @@ -64,7 +64,7 @@ private: /*virtual*/ void updateControls(const LLSD& info); void onSend(); - void onImageUploaded(const std::string& image_url, const std::string& caption); + void onImageUploaded(const std::string& caption, const std::string& image_url); }; static LLRegisterPanelClassWrapper panel_class("llpanelsnapshotfacebook"); @@ -99,14 +99,14 @@ void LLPanelSnapshotFacebook::onSend() std::string caption = getChild("caption")->getValue().asString(); bool add_location = getChild("add_location_cb")->getValue().asBoolean(); - LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location, boost::bind(&LLPanelSnapshotFacebook::onImageUploaded, this, _1, _2)); + LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location, boost::bind(&LLPanelSnapshotFacebook::onImageUploaded, this, caption, _1)); LLFloaterSnapshot::postSave(); // test with a placeholder image, until we can figure out a way to grab the uploaded image url //LLFacebookConnect::instance().sharePhoto("http://fc02.deviantart.net/fs43/i/2009/125/a/9/Future_of_Frog_by_axcho.jpg", caption); } -void LLPanelSnapshotFacebook::onImageUploaded(const std::string& image_url, const std::string& caption) +void LLPanelSnapshotFacebook::onImageUploaded(const std::string& caption, const std::string& image_url) { if (!image_url.empty()) { diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp index 4bc4724753..6923724de2 100755 --- a/indra/newview/llwebprofile.cpp +++ b/indra/newview/llwebprofile.cpp @@ -62,8 +62,8 @@ class LLWebProfileResponders::ConfigResponder : public LLHTTPClient::Responder LOG_CLASS(LLWebProfileResponders::ConfigResponder); public: - ConfigResponder(LLPointer imagep, const std::string& caption, LLWebProfile::image_url_callback_t cb) - : mImagep(imagep), mImageCaption(caption), mImageCallback(cb) + ConfigResponder(LLPointer imagep, LLWebProfile::image_url_callback_t cb) + : mImagep(imagep), mImageCallback(cb) { } @@ -113,12 +113,11 @@ public: // Do the actual image upload using the configuration. LL_DEBUGS("Snapshots") << "Got upload config, POSTing image to " << upload_url << ", config=[" << config << "]" << llendl; - LLWebProfile::post(mImagep, config, upload_url, mImageCaption, mImageCallback); + LLWebProfile::post(mImagep, config, upload_url, mImageCallback); } private: LLPointer mImagep; - std::string mImageCaption; LLWebProfile::image_url_callback_t mImageCallback; }; @@ -129,8 +128,8 @@ class LLWebProfileResponders::PostImageRedirectResponder : public LLHTTPClient:: LOG_CLASS(LLWebProfileResponders::PostImageRedirectResponder); public: - PostImageRedirectResponder(const std::string& caption, LLWebProfile::image_url_callback_t cb) - : mImageCaption(caption), mImageCallback(cb) + PostImageRedirectResponder(LLWebProfile::image_url_callback_t cb) + : mImageCallback(cb) { } @@ -141,7 +140,7 @@ public: std::string image_url = content.get("Location"); llinfos << "Image uploaded to " << image_url << llendl; if (!mImageCallback.empty() && !image_url.empty()) - mImageCallback(image_url, mImageCaption); + mImageCallback(image_url); } } @@ -168,7 +167,6 @@ public: } private: - std::string mImageCaption; LLWebProfile::image_url_callback_t mImageCallback; }; @@ -180,8 +178,8 @@ class LLWebProfileResponders::PostImageResponder : public LLHTTPClient::Responde LOG_CLASS(LLWebProfileResponders::PostImageResponder); public: - PostImageResponder(const std::string& caption, LLWebProfile::image_url_callback_t cb) - : mImageCaption(caption), mImageCallback(cb) + PostImageResponder(LLWebProfile::image_url_callback_t cb) + : mImageCallback(cb) { } @@ -196,7 +194,7 @@ public: headers["Cookie"] = LLWebProfile::getAuthCookie(); const std::string& redir_url = content["location"]; LL_DEBUGS("Snapshots") << "Got redirection URL: " << redir_url << llendl; - LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder(mImageCaption, mImageCallback), headers); + LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder(mImageCallback), headers); } else { @@ -214,7 +212,6 @@ public: } private: - std::string mImageCaption; LLWebProfile::image_url_callback_t mImageCallback; }; @@ -235,7 +232,7 @@ void LLWebProfile::uploadImage(LLPointer image, const std::str LL_DEBUGS("Snapshots") << "Requesting " << config_url << llendl; LLSD headers = LLViewerMedia::getHeaders(); headers["Cookie"] = getAuthCookie(); - LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image, caption, cb), headers); + LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image, cb), headers); } // static @@ -246,7 +243,7 @@ void LLWebProfile::setAuthCookie(const std::string& cookie) } // static -void LLWebProfile::post(LLPointer image, const LLSD& config, const std::string& url, const std::string& caption, LLWebProfile::image_url_callback_t cb) +void LLWebProfile::post(LLPointer image, const LLSD& config, const std::string& url, LLWebProfile::image_url_callback_t cb) { if (dynamic_cast(image.get()) == 0) { @@ -312,7 +309,7 @@ void LLWebProfile::post(LLPointer image, const LLSD& config, c memcpy(data, body.str().data(), size); // Send request, successful upload will trigger posting metadata. - LLHTTPClient::postRaw(url, data, size, new LLWebProfileResponders::PostImageResponder(caption, cb), headers); + LLHTTPClient::postRaw(url, data, size, new LLWebProfileResponders::PostImageResponder(cb), headers); } // static diff --git a/indra/newview/llwebprofile.h b/indra/newview/llwebprofile.h index c1c0c23540..63dccf80af 100755 --- a/indra/newview/llwebprofile.h +++ b/indra/newview/llwebprofile.h @@ -48,7 +48,7 @@ class LLWebProfile public: typedef boost::function status_callback_t; - typedef boost::function image_url_callback_t; + typedef boost::function image_url_callback_t; static void uploadImage(LLPointer image, const std::string& caption, bool add_location, image_url_callback_t cb = image_url_callback_t()); static void setAuthCookie(const std::string& cookie); @@ -59,7 +59,7 @@ private: friend class LLWebProfileResponders::PostImageResponder; friend class LLWebProfileResponders::PostImageRedirectResponder; - static void post(LLPointer image, const LLSD& config, const std::string& url, const std::string& caption, image_url_callback_t cb); + static void post(LLPointer image, const LLSD& config, const std::string& url, image_url_callback_t cb); static void reportImageUploadStatus(bool ok); static std::string getAuthCookie(); -- cgit v1.2.3 From 58177c83b0a81aae363bccc0e5ac2312b083341d Mon Sep 17 00:00:00 2001 From: Cho Date: Thu, 6 Jun 2013 00:17:33 +0100 Subject: uncommented the placeholder image upload --- indra/newview/llpanelsnapshotfacebook.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp index 9bea5aa796..56b1f921b9 100755 --- a/indra/newview/llpanelsnapshotfacebook.cpp +++ b/indra/newview/llpanelsnapshotfacebook.cpp @@ -103,7 +103,7 @@ void LLPanelSnapshotFacebook::onSend() LLFloaterSnapshot::postSave(); // test with a placeholder image, until we can figure out a way to grab the uploaded image url - //LLFacebookConnect::instance().sharePhoto("http://fc02.deviantart.net/fs43/i/2009/125/a/9/Future_of_Frog_by_axcho.jpg", caption); + LLFacebookConnect::instance().sharePhoto("http://fc02.deviantart.net/fs43/i/2009/125/a/9/Future_of_Frog_by_axcho.jpg", caption); } void LLPanelSnapshotFacebook::onImageUploaded(const std::string& caption, const std::string& image_url) -- cgit v1.2.3 From cf5cf32ebf3a8eccbaa9e8c092fd23b357a68727 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Wed, 5 Jun 2013 16:31:32 -0700 Subject: ACME-471: Now using the actual map top-down image for the checked in location. --- indra/newview/llviewermenu.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 471db8d8fc..e8c7e0cfdc 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5995,8 +5995,12 @@ void handle_facebook_checkin() std::string region_name = gAgent.getRegion()->getName(); std::string description; LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_NORMAL_COORDS, gAgent.getPositionAgent()); + LLVector3d center_agent = gAgent.getRegion()->getCenterGlobal(); + int x_pos = center_agent[0] / 256.0; + int y_pos = center_agent[1] / 256.0; + std::string locationMap = llformat("http://map.secondlife.com/map-1-%d-%d-objects.jpg", x_pos, y_pos); - LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDL4jdC_vCh0ow-QCXZjN-WNojEXWiz0APEa6Qhpl8cxawjkoC7w", ""); + LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, locationMap, ""); } //bool is_facebook_connected(); -- cgit v1.2.3 From ba90e388855f99ec5b3f1991f2437f616a5d9e62 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 5 Jun 2013 19:40:33 -0700 Subject: ACME-464 : WIP : Make the menu Connect to FB only connect and be disabled if the user is already connected --- indra/newview/llpanelsnapshotfacebook.cpp | 3 ++- indra/newview/llviewermenu.cpp | 17 +++++++++-------- indra/newview/skins/default/xui/en/menu_viewer.xml | 2 ++ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp index 200c64f16b..27abbfa456 100755 --- a/indra/newview/llpanelsnapshotfacebook.cpp +++ b/indra/newview/llpanelsnapshotfacebook.cpp @@ -90,7 +90,8 @@ void LLPanelSnapshotFacebook::onOpen(const LLSD& key) void LLPanelSnapshotFacebook::updateControls(const LLSD& info) { const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true; - getChild("post_btn")->setEnabled(have_snapshot); + const bool is_connected = LLFacebookConnect::instance().getConnected(); + getChild("post_btn")->setEnabled(have_snapshot && is_connected); } void LLPanelSnapshotFacebook::onSend() diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 471db8d8fc..bc2e13d77e 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5974,16 +5974,18 @@ void handle_report_abuse() void handle_facebook_connect() { - if (LLFacebookConnect::instance().getConnected()) - { - LLFacebookConnect::instance().disconnectFromFacebook(); - } - else + if (!LLFacebookConnect::instance().getConnected()) { LLFacebookConnect::instance().getConnectionToFacebook(); } } +bool enable_facebook_connect() +{ + // The menu item will be disabled if we are already connected + return !LLFacebookConnect::instance().getConnected(); +} + void handle_facebook_checkin() { @@ -5999,9 +6001,6 @@ void handle_facebook_checkin() LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDL4jdC_vCh0ow-QCXZjN-WNojEXWiz0APEa6Qhpl8cxawjkoC7w", ""); } -//bool is_facebook_connected(); - - void handle_buy_currency() { LLBuyCurrencyHTML::openCurrencyFloater(); @@ -8754,6 +8753,8 @@ void initialize_menus() // Facebook Connect commit.add("Facebook.Connect", boost::bind(&handle_facebook_connect)); + enable.add("Facebook.EnableConnect", boost::bind(&enable_facebook_connect)); + // Facebook Checkin commit.add("Facebook.Checkin", boost::bind(&handle_facebook_checkin)); } diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 5061842c7f..e67350722d 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -20,6 +20,8 @@ name="ConnectToFacebook"> + Date: Thu, 6 Jun 2013 16:34:24 -0400 Subject: STORM-1838 Added teleport request to conversation log. Added xml to have message appear in IM window, if open. Code cleanup. --- indra/newview/llavataractions.cpp | 1 - indra/newview/llconversationloglist.cpp | 5 ++++- indra/newview/llpanelpeoplemenus.cpp | 2 -- indra/newview/skins/default/xui/en/menu_conversation.xml | 2 -- .../skins/default/xui/en/menu_conversation_log_gear.xml | 10 ++++++++++ indra/newview/skins/default/xui/en/notifications.xml | 1 + 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 285e70c8ea..45992b8c83 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -443,7 +443,6 @@ void LLAvatarActions::teleport_request_callback(const LLSD& notification, const // static void LLAvatarActions::teleportRequest(const LLUUID& id) { -llwarns << "DBG " << llendl; std::string name; gCacheName->getFullName(id, name); gCacheName->cleanFullName(name); diff --git a/indra/newview/llconversationloglist.cpp b/indra/newview/llconversationloglist.cpp index cf9c9b3415..44212298cf 100644 --- a/indra/newview/llconversationloglist.cpp +++ b/indra/newview/llconversationloglist.cpp @@ -311,9 +311,12 @@ void LLConversationLogList::onCustomAction(const LLSD& userdata) } else if ("offer_teleport" == command_name) { -llwarns << "DBG " << llendl; LLAvatarActions::offerTeleport(selected_conversation_participant_id); } + else if ("request_teleport" == command_name) + { + LLAvatarActions::teleportRequest(selected_conversation_participant_id); + } else if("add_friend" == command_name) { if (!LLAvatarActions::isFriend(selected_conversation_participant_id)) diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index ddc92f439b..0b2bf1d2c8 100644 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -261,7 +261,6 @@ void PeopleContextMenu::requestTeleport() { // boost::bind cannot recognize overloaded method LLAvatarActions::teleportRequest(), // so we have to use a wrapper. -llwarns << "DBG " << llendl; LLAvatarActions::teleportRequest(mUUIDs.front()); } @@ -269,7 +268,6 @@ void PeopleContextMenu::offerTeleport() { // boost::bind cannot recognize overloaded method LLAvatarActions::offerTeleport(), // so we have to use a wrapper. -llwarns << "DBG " << llendl; LLAvatarActions::offerTeleport(mUUIDs); } diff --git a/indra/newview/skins/default/xui/en/menu_conversation.xml b/indra/newview/skins/default/xui/en/menu_conversation.xml index c2c15023c5..d8eb2f0ffd 100644 --- a/indra/newview/skins/default/xui/en/menu_conversation.xml +++ b/indra/newview/skins/default/xui/en/menu_conversation.xml @@ -46,7 +46,6 @@ - - + + + + [NAME_SLURL] is requesting to be teleported to your location. [MESSAGE] -- cgit v1.2.3 From d233d8836b610b5e5ca76a1e3bb4d63dc3592e66 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Thu, 6 Jun 2013 17:16:00 -0400 Subject: STORM-1838 Remove incorrect XML menu text --- indra/newview/skins/default/xui/en/menu_people_nearby.xml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby.xml b/indra/newview/skins/default/xui/en/menu_people_nearby.xml index 80e8e59076..f12226ebeb 100644 --- a/indra/newview/skins/default/xui/en/menu_people_nearby.xml +++ b/indra/newview/skins/default/xui/en/menu_people_nearby.xml @@ -143,15 +143,4 @@ function="Avatar.EnableItem" parameter="can_block" /> - - - - - -- cgit v1.2.3 From 4163603a1118a9c1e220e56f22e757d162932ebe Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 6 Jun 2013 15:06:52 -0700 Subject: ACME-464 : WIP : Post in the snapshot Panel correctly disabled / enabled according to FB connection status --- indra/newview/llpanelsnapshotfacebook.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp index b434741538..faeabf0a07 100755 --- a/indra/newview/llpanelsnapshotfacebook.cpp +++ b/indra/newview/llpanelsnapshotfacebook.cpp @@ -55,6 +55,7 @@ public: /*virtual*/ void onOpen(const LLSD& key); private: + /*virtual*/ void updateCustomResControls(); ///< Show/hide facebook custom controls /*virtual*/ std::string getWidthSpinnerName() const { return "facebook_snapshot_width"; } /*virtual*/ std::string getHeightSpinnerName() const { return "facebook_snapshot_height"; } /*virtual*/ std::string getAspectRatioCBName() const { return "facebook_keep_aspect_check"; } @@ -84,6 +85,7 @@ BOOL LLPanelSnapshotFacebook::postBuild() // virtual void LLPanelSnapshotFacebook::onOpen(const LLSD& key) { + updateControls(key); LLPanelSnapshot::onOpen(key); } @@ -95,6 +97,13 @@ void LLPanelSnapshotFacebook::updateControls(const LLSD& info) getChild("post_btn")->setEnabled(have_snapshot && is_connected); } +// virtual +void LLPanelSnapshotFacebook::updateCustomResControls() +{ + const bool is_connected = LLFacebookConnect::instance().getConnected(); + getChild("post_btn")->setEnabled(is_connected); +} + void LLPanelSnapshotFacebook::onSend() { std::string caption = getChild("caption")->getValue().asString(); -- cgit v1.2.3 From 8511385a5407181ced7bb226d4054185c597d05e Mon Sep 17 00:00:00 2001 From: Simon Linden Date: Thu, 6 Jun 2013 18:16:44 -0700 Subject: MAINT-2764 : Planar texture mapping with bumpiness and path cut breaks under forward rendering. Will get Dave P to review --- indra/newview/llvovolume.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 00a109546e..98943b194e 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4268,8 +4268,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) U32 bump_count = 0; U32 simple_count = 0; U32 alpha_count = 0; - - U32 useage = group->mSpatialPartition->mBufferUsage; @@ -4709,15 +4707,15 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) bump_mask |= LLVertexBuffer::MAP_BINORMAL; genDrawInfo(group, simple_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, simple_faces, simple_count, FALSE, TRUE); genDrawInfo(group, fullbright_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, fullbright_faces, fullbright_count, FALSE, TRUE); - genDrawInfo(group, bump_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, bump_faces, bump_count, FALSE, FALSE); + genDrawInfo(group, bump_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, bump_faces, bump_count, FALSE, TRUE); genDrawInfo(group, alpha_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, alpha_faces, alpha_count, TRUE, TRUE); } else { - genDrawInfo(group, simple_mask, simple_faces, simple_count); - genDrawInfo(group, fullbright_mask, fullbright_faces, fullbright_count); + genDrawInfo(group, simple_mask, simple_faces, simple_count, FALSE, FALSE); + genDrawInfo(group, fullbright_mask, fullbright_faces, fullbright_count, FALSE, FALSE); genDrawInfo(group, bump_mask, bump_faces, bump_count, FALSE, FALSE); - genDrawInfo(group, alpha_mask, alpha_faces, alpha_count, TRUE); + genDrawInfo(group, alpha_mask, alpha_faces, alpha_count, TRUE, FALSE); } -- cgit v1.2.3 From bee5369b2f2fc0208b1a0645c2702ed1cea43c55 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 6 Jun 2013 20:08:46 -0700 Subject: ACME-464 : Fixed : We connect to FB when bringing up the Upload to FB Snapshot panel --- indra/newview/llfloatersnapshot.cpp | 12 +++++++++++- indra/newview/llpanelsnapshotfacebook.cpp | 5 +++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index d8d62e5bbb..8405d8aeec 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -37,6 +37,7 @@ #include "llcriticaldamp.h" #include "llfloaterperms.h" #include "llui.h" +#include "llfacebookconnect.h" #include "llfocusmgr.h" #include "llbutton.h" #include "llcombobox.h" @@ -2245,7 +2246,16 @@ void LLFloaterSnapshot::update() { changed |= LLSnapshotLivePreview::onIdle(*iter); } - if(changed) + + // We need to pool on facebook connection as it might change any time + static bool s_facebook_connected = false; + if (LLFacebookConnect::instance().getConnected() != s_facebook_connected) + { + s_facebook_connected = LLFacebookConnect::instance().getConnected(); + changed = true; + } + + if (changed) { lldebugs << "changed" << llendl; inst->impl.updateControls(inst); diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp index faeabf0a07..7c8fc044c0 100755 --- a/indra/newview/llpanelsnapshotfacebook.cpp +++ b/indra/newview/llpanelsnapshotfacebook.cpp @@ -85,6 +85,10 @@ BOOL LLPanelSnapshotFacebook::postBuild() // virtual void LLPanelSnapshotFacebook::onOpen(const LLSD& key) { + if (!LLFacebookConnect::instance().getConnected()) + { + LLFacebookConnect::instance().getConnectionToFacebook(); + } updateControls(key); LLPanelSnapshot::onOpen(key); } @@ -100,6 +104,7 @@ void LLPanelSnapshotFacebook::updateControls(const LLSD& info) // virtual void LLPanelSnapshotFacebook::updateCustomResControls() { + LLPanelSnapshot::updateCustomResControls(); const bool is_connected = LLFacebookConnect::instance().getConnected(); getChild("post_btn")->setEnabled(is_connected); } -- cgit v1.2.3 From 5020579a07eca7a719f70b2ae7fde40a2522f124 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 7 Jun 2013 12:34:57 -0700 Subject: ACME-470: Adjusting 'Check in to Facebook' text to 'Check in to Facebook...' --- indra/newview/skins/default/xui/en/menu_viewer.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 5061842c7f..97cd01123f 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -22,7 +22,7 @@ function="Facebook.Connect" /> -- cgit v1.2.3 From 54e879cc22ec342f57cec23d38ba269b83489111 Mon Sep 17 00:00:00 2001 From: Cho Date: Sat, 8 Jun 2013 00:48:46 +0100 Subject: added Facebook status update feature for ACME-502, ACME-503, and ACME-504 --- indra/newview/llfacebookconnect.cpp | 9 +++++++++ indra/newview/llfacebookconnect.h | 3 ++- indra/newview/llnotificationscripthandler.cpp | 3 +++ indra/newview/llviewermenu.cpp | 20 ++++++++++++++++++++ indra/newview/llviewermenu.h | 5 ++++- indra/newview/skins/default/xui/en/menu_viewer.xml | 8 +++++++- .../newview/skins/default/xui/en/notifications.xml | 21 +++++++++++++++++++++ 7 files changed, 66 insertions(+), 3 deletions(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 668ba04406..79e8d98668 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -323,6 +323,15 @@ void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::stri LLHTTPClient::post(getFacebookConnectURL("/share/photo"), body, new LLFacebookPostResponder()); } +void LLFacebookConnect::updateStatus(const std::string& message) +{ + LLSD body; + body["message"] = message; + + // Note: we can use that route for different publish action. We should be able to use the same responder. + LLHTTPClient::post(getFacebookConnectURL("/share/wall"), body, new LLFacebookPostResponder()); +} + void LLFacebookConnect::storeContent(const LLSD& content) { mGeneration++; diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index 2dba182267..58e2707ba3 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -49,6 +49,7 @@ public: void postCheckin(const std::string& location, const std::string& name, const std::string& description, const std::string& picture, const std::string& message); void postCheckinMessage(const std::string& message, const std::string& link, const std::string& name, const std::string& caption, const std::string& description, const std::string& picture); void sharePhoto(const std::string& image_url, const std::string& caption); + void updateStatus(const std::string& message); void clearContent(); void storeContent(const LLSD& content); @@ -69,7 +70,7 @@ private: bool mConnectedToFbc; LLSD mContent; - S32 mGeneration; + S32 mGeneration; }; #endif // LL_LLFACEBOOKCONNECT_H diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp index 08c98e4f28..2854962922 100755 --- a/indra/newview/llnotificationscripthandler.cpp +++ b/indra/newview/llnotificationscripthandler.cpp @@ -35,6 +35,9 @@ #include "llnotificationmanager.h" #include "llnotifications.h" #include "llscriptfloater.h" +#include "llfacebookconnect.h" +#include "llavatarname.h" +#include "llavatarnamecache.h" using namespace LLNotificationsUI; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 1bfa5ac2d1..67460c4bc6 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -6005,6 +6005,23 @@ void handle_facebook_checkin() LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, locationMap, ""); } +bool handle_facebook_status_callback(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) + { + std::string message = response["message"].asString(); + if (!message.empty()) + LLFacebookConnect::instance().updateStatus(message); + } + return false; +} + +void handle_facebook_status() +{ + LLNotificationsUtil::add("FacebookUpdateStatus", LLSD(), LLSD(), boost::bind(&handle_facebook_status_callback, _1, _2)); +} + void handle_buy_currency() { LLBuyCurrencyHTML::openCurrencyFloater(); @@ -8761,4 +8778,7 @@ void initialize_menus() // Facebook Checkin commit.add("Facebook.Checkin", boost::bind(&handle_facebook_checkin)); + + // Facebook Status Update + commit.add("Facebook.UpdateStatus", boost::bind(&handle_facebook_status)); } diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index 9c3f13f843..e71beef10d 100755 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -138,9 +138,12 @@ bool handle_go_to(); // Facebook Connect void handle_facebook_connect(); -//Facebook Checkin +// Facebook Checkin void handle_facebook_checkin(); +// Facebook Status Update +void handle_facebook_status(); + // Export to XML or Collada void handle_export_selected( void * ); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index e67350722d..2b2ac8c079 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -28,7 +28,13 @@ name="CheckinToFacebook"> - + + + + + + What's on your mind? (asks Facebook) + confirm +
+ + +
+ + + +
- - - + name="place_panel"/> + -- cgit v1.2.3 From 824a5c65f57ae0fa2cce99ade156341fcf8daf5a Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 20 Jun 2013 17:58:27 -0700 Subject: ACME-584: Adjusted name of a couple XUI elements. --- indra/newview/skins/default/xui/en/floater_social.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml index 2b382215d1..d446e0c0f6 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -47,7 +47,7 @@ name="stack1" top="8"> + label="button_container" + help_topic="button_container" + name="button_container"/> + + Date: Sat, 22 Jun 2013 01:32:15 +0100 Subject: tweaked numbers to look more like mockup for ACME-568 --- indra/newview/skins/default/xui/en/floater_social.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml index 378841b1a6..c49749840b 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -37,14 +37,14 @@ height="16" left="9" name="caption_label" - top_pad="12" + top_pad="18" type="string"> What's on your mind?
-- cgit v1.2.3 From 9debe1787f966efd6c25ffc43a3a77553aca107a Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sat, 22 Jun 2013 11:49:36 -0700 Subject: ACME-497 : All xml work for the Checkin feature --- indra/newview/llfloatersocial.cpp | 5 + indra/newview/llfloatersocial.h | 1 + .../skins/default/xui/en/floater_social.xml | 112 ++++++++++++++++++++- 3 files changed, 115 insertions(+), 3 deletions(-) diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index fe9cfa592b..4a3efe4a2d 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -31,5 +31,10 @@ LLFloaterSocial::LLFloaterSocial(const LLSD& key) : LLFloater(key) { + mCommitCallbackRegistrar.add("SocialSharing.Cancel", boost::bind(&LLFloaterSocial::onCancel, this)); +} +void LLFloaterSocial::onCancel() +{ + closeFloater(); } diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index b120fe5804..f65c0dcf5d 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -34,6 +34,7 @@ class LLFloaterSocial : public LLFloater { public: LLFloaterSocial(const LLSD& key); + void onCancel(); }; #endif // LL_LLFLOATERSOCIAL_H diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml index d446e0c0f6..2909da295d 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -283,18 +283,124 @@ top_delta="0" width="100"> + function="SocialSharing.Cancel" /> + name="place_panel"> + + + + Say something about where you are: + + + + + + + + + + + Include overhead view of location + + + + + + + + -- cgit v1.2.3 From 27bd181a6d07b191d674870039b2801713c554f1 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sun, 23 Jun 2013 12:15:21 -0700 Subject: ACME-497 : Working implementation of Checkin though couple of bugs to fix and no visible map in the UI --- indra/newview/llfloatersocial.cpp | 65 +++++++++++++++++++++- indra/newview/llfloatersocial.h | 10 ++++ .../skins/default/xui/en/floater_social.xml | 5 +- 3 files changed, 77 insertions(+), 3 deletions(-) diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index f6fc55927e..cca966bb9a 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -29,11 +29,25 @@ #include "llfloatersocial.h" +#include "llagent.h" #include "llagentui.h" +#include "llfacebookconnect.h" #include "llfloaterreg.h" #include "llslurl.h" +#include "llviewerregion.h" +#include "llviewercontrol.h" -static LLRegisterPanelClassWrapper panel_class("llsocialphotopanel"); +static LLRegisterPanelClassWrapper t_panel_photo("llsocialphotopanel"); +static LLRegisterPanelClassWrapper t_panel_checkin("llsocialcheckinpanel"); + +std::string get_map_url() +{ + LLVector3d center_agent = gAgent.getRegion()->getCenterGlobal(); + int x_pos = center_agent[0] / 256.0; + int y_pos = center_agent[1] / 256.0; + std::string map_url = gSavedSettings.getString("CurrentMapServerURL") + llformat("map-1-%d-%d-objects.jpg", x_pos, y_pos); + return map_url; +} LLSocialPhotoPanel::LLSocialPhotoPanel() { @@ -60,6 +74,55 @@ void LLSocialPhotoPanel::onSend() } +LLSocialCheckinPanel::LLSocialCheckinPanel() : + mMapUrl("") +{ + mCommitCallbackRegistrar.add("SocialSharing.SendCheckin", boost::bind(&LLSocialCheckinPanel::onSend, this)); +} + +/*virtual*/ +void LLSocialCheckinPanel::setVisible(BOOL visible) +{ + if (visible) + { + mMapUrl = get_map_url(); + } + LLPanel::setVisible(visible); +} + +void LLSocialCheckinPanel::onSend() +{ + // Get the location SLURL + LLSLURL slurl; + LLAgentUI::buildSLURL(slurl); + std::string slurl_string = slurl.getSLURLString(); + + // Get the region name + std::string region_name = gAgent.getRegion()->getName(); + + // Get the region description + std::string description; + LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_NORMAL_COORDS, gAgent.getPositionAgent()); + + + // Optionally add the region map view + bool add_map_view = getChild("add_place_view_cb")->getValue().asBoolean(); + std::string map_url = (add_map_view ? mMapUrl : ""); + + // Get the caption + std::string caption = getChild("place_caption")->getValue().asString(); + + // Post all that to Facebook + LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, map_url, caption); + + // Close the floater once "Post" has been pushed + LLFloater* floater = getParentByType(); + if (floater) + { + floater->closeFloater(); + } +} + LLFloaterSocial::LLFloaterSocial(const LLSD& key) : LLFloater(key) { diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index a8c83fb364..aee7f2f060 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -36,6 +36,16 @@ class LLSocialPhotoPanel : public LLPanel void onSend(); }; +class LLSocialCheckinPanel : public LLPanel +{ +public: + LLSocialCheckinPanel(); + void onSend(); + /*virtual*/ void setVisible(BOOL visible); +private: + std::string mMapUrl; +}; + class LLFloaterSocial : public LLFloater { public: diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml index d57bc157cd..f99044b233 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -71,7 +71,7 @@ top_delta="0" width="100"> + function="SocialSharing.Cancel" /> + function="SocialSharing.SendCheckin" /> - - - + + + -- cgit v1.2.3 From 68fa34965daa5bd65aea5cb1f4dc4554e7d9f70f Mon Sep 17 00:00:00 2001 From: Cho Date: Tue, 25 Jun 2013 00:26:10 +0100 Subject: made status update actually post to Facebook, for ACME-569 and ACME-573 --- indra/newview/llfloatersocial.cpp | 18 ++++++++++++++++++ indra/newview/llfloatersocial.h | 7 +++++++ indra/newview/skins/default/xui/en/floater_social.xml | 5 +++-- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 361d54f696..dd4f4f03d9 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -37,6 +37,7 @@ #include "llviewerregion.h" #include "llviewercontrol.h" +static LLRegisterPanelClassWrapper t_panel_status("llsocialstatuspanel"); static LLRegisterPanelClassWrapper t_panel_photo("llsocialphotopanel"); static LLRegisterPanelClassWrapper t_panel_checkin("llsocialcheckinpanel"); @@ -53,6 +54,23 @@ std::string get_map_url() return map_url; } +LLSocialStatusPanel::LLSocialStatusPanel() +{ + mCommitCallbackRegistrar.add("SocialSharing.SendStatus", boost::bind(&LLSocialStatusPanel::onSend, this)); +} + +void LLSocialStatusPanel::onSend() +{ + std::string message = getChild("message")->getValue().asString(); + LLFacebookConnect::instance().updateStatus(message); + + LLFloater* floater = getParentByType(); + if (floater) + { + floater->closeFloater(); + } +} + LLSocialPhotoPanel::LLSocialPhotoPanel() { mCommitCallbackRegistrar.add("PostToFacebook.Send", boost::bind(&LLSocialPhotoPanel::onSend, this)); diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index aee7f2f060..561aefa111 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -29,6 +29,13 @@ #include "llfloater.h" +class LLSocialStatusPanel : public LLPanel +{ +public: + LLSocialStatusPanel(); + void onSend(); +}; + class LLSocialPhotoPanel : public LLPanel { public: diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml index fc26ba5842..15e105f67d 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -23,6 +23,7 @@ height="430" halign="center"> @@ -60,7 +61,7 @@ top_pad="18" width="100"> + function="SocialSharing.SendStatus" /> - - + help_topic="panel_social_status" + name="panel_social_status"/> - - - - - - - - - - - [SIZE] KB - - - - - Succeeded - - - - - Failed - - - - - Working - - - - - - + help_topic="panel_social_photo" + name="panel_social_photo"/> - - - - Say something about where you are: - - - - - - - - - - - Include overhead view of location - - - - - - - - + help_topic="panel_social_place" + name="panel_social_place"/> -- cgit v1.2.3 From fc05dc5114785368e37e325fdb429fed7cd3c363 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 27 Jun 2013 16:52:53 -0700 Subject: ACME-630 Adding missing files --- .../skins/default/xui/en/panel_social_photo.xml | 254 +++++++++++++++++++++ .../skins/default/xui/en/panel_social_place.xml | 108 +++++++++ .../skins/default/xui/en/panel_social_status.xml | 50 ++++ 3 files changed, 412 insertions(+) create mode 100644 indra/newview/skins/default/xui/en/panel_social_photo.xml create mode 100644 indra/newview/skins/default/xui/en/panel_social_place.xml create mode 100644 indra/newview/skins/default/xui/en/panel_social_status.xml diff --git a/indra/newview/skins/default/xui/en/panel_social_photo.xml b/indra/newview/skins/default/xui/en/panel_social_photo.xml new file mode 100644 index 0000000000..e6742b0ea7 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_social_photo.xml @@ -0,0 +1,254 @@ + + + + + + + + + + + + [SIZE] KB + + + + + Succeeded + + + + + Failed + + + + + Working + + + + + + \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_social_place.xml b/indra/newview/skins/default/xui/en/panel_social_place.xml new file mode 100644 index 0000000000..30b48d9bb1 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_social_place.xml @@ -0,0 +1,108 @@ + + + + + Say something about where you are: + + + + + + + + + + + Include overhead view of location + + + + + + + + \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_social_status.xml b/indra/newview/skins/default/xui/en/panel_social_status.xml new file mode 100644 index 0000000000..ae199e7e38 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_social_status.xml @@ -0,0 +1,50 @@ + + + What's on your mind? + + + + + + \ No newline at end of file -- cgit v1.2.3 From 0e50cbc2edacdecf32071c97c2ce5349db5ef5e9 Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 28 Jun 2013 01:21:14 +0100 Subject: made it optional to autoconnect in LLFacebookConnect::getConnectionToFacebook() for ACME-648 --- indra/newview/llfacebookconnect.cpp | 18 +++++++++++++----- indra/newview/llfacebookconnect.h | 2 +- indra/newview/llfloatersocial.cpp | 2 +- indra/newview/llpanelpeople.cpp | 2 +- indra/newview/llpanelsnapshotfacebook.cpp | 2 +- indra/newview/llviewermenu.cpp | 2 +- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index cf0f554149..52268daa36 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -201,9 +201,9 @@ class LLFacebookConnectedResponder : public LLHTTPClient::Responder LOG_CLASS(LLFacebookConnectedResponder); public: - LLFacebookConnectedResponder() + LLFacebookConnectedResponder(bool auto_connect) : mAutoConnect(auto_connect) { - LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS); + LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS); } virtual void completed(U32 status, const std::string& reason, const LLSD& content) @@ -223,7 +223,14 @@ public: // show the facebook login page if not connected yet if (status == 404) { - LLFacebookConnect::instance().connectToFacebook(); + if (mAutoConnect) + { + LLFacebookConnect::instance().connectToFacebook(); + } + else + { + LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED); + } } else { @@ -234,6 +241,7 @@ public: } private: + bool mAutoConnect; }; /////////////////////////////////////////////////////////////////////////////// @@ -304,13 +312,13 @@ void LLFacebookConnect::disconnectFromFacebook() LLHTTPClient::del(getFacebookConnectURL("/connection"), new LLFacebookDisconnectResponder()); } -void LLFacebookConnect::getConnectionToFacebook() +void LLFacebookConnect::getConnectionToFacebook(bool auto_connect) { if ((mConnectionState == FB_NOT_CONNECTED) || (mConnectionState == FB_CONNECTION_FAILED)) { const bool follow_redirects=false; const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(), + LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(auto_connect), LLSD(), timeout, follow_redirects); } } diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index a19b6fbb98..c54da8e3f3 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -54,7 +54,7 @@ public: void connectToFacebook(const std::string& auth_code = ""); // Initiate the complete FB connection. Please use getConnectionToFacebook() in normal use. void disconnectFromFacebook(); // Disconnect from the FBC service. - void getConnectionToFacebook(); // Check if an access token is available on the FBC service. If not, call connectToFacebook(). + void getConnectionToFacebook(bool auto_connect = false); // Check if an access token is available on the FBC service. If not, call connectToFacebook(). void loadFacebookFriends(); void postCheckin(const std::string& location, const std::string& name, const std::string& description, const std::string& picture, const std::string& message); diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 8d026471dc..35761d5cc8 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -516,7 +516,7 @@ void LLFloaterSocial::onCancel() BOOL LLFloaterSocial::postBuild() { // Initiate a connection to Facebook (getConnectionToFacebook() handles the already connected state) - LLFacebookConnect::instance().getConnectionToFacebook(); + LLFacebookConnect::instance().getConnectionToFacebook(true); // Keep tab of the Photo Panel mSocialPhotoPanel = static_cast(getChild("panel_social_photo")); return LLFloater::postBuild(); diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index b6b72800f9..92391f0537 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1683,7 +1683,7 @@ void LLPanelPeople::onLoginFbcButtonClicked() } else { - LLFacebookConnect::instance().getConnectionToFacebook(); + LLFacebookConnect::instance().getConnectionToFacebook(true); } } diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp index 0a76bc3b9d..94fbb986c0 100755 --- a/indra/newview/llpanelsnapshotfacebook.cpp +++ b/indra/newview/llpanelsnapshotfacebook.cpp @@ -89,7 +89,7 @@ void LLPanelSnapshotFacebook::onOpen(const LLSD& key) { if (!LLFacebookConnect::instance().isConnected()) { - LLFacebookConnect::instance().getConnectionToFacebook(); + LLFacebookConnect::instance().getConnectionToFacebook(true); } updateControls(key); LLPanelSnapshot::onOpen(key); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index df2da12045..47787e2687 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5957,7 +5957,7 @@ void handle_facebook_connect() { if (!LLFacebookConnect::instance().isConnected()) { - LLFacebookConnect::instance().getConnectionToFacebook(); + LLFacebookConnect::instance().getConnectionToFacebook(true); } } -- cgit v1.2.3 From 06f0e4161b3c735678f9ace02d659cc838afc1d8 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 27 Jun 2013 18:30:27 -0700 Subject: ACME-629 Clean up names of variables and functions used in the Facebook photo panel --- indra/newview/llfloatersocial.cpp | 385 +++++++++++++++++++------------------- indra/newview/llfloatersocial.h | 39 ++-- 2 files changed, 214 insertions(+), 210 deletions(-) diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 35761d5cc8..dfc9024d54 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -64,6 +64,10 @@ std::string get_map_url() return map_url; } +/////////////////////////// +//LLSocialStatusPanel////// +/////////////////////////// + LLSocialStatusPanel::LLSocialStatusPanel() : mMessageTextEditor(NULL), mPostStatusButton(NULL) @@ -108,12 +112,21 @@ void LLSocialStatusPanel::onSend() } } +/////////////////////////// +//LLSocialPhotoPanel/////// +/////////////////////////// + LLSocialPhotoPanel::LLSocialPhotoPanel() : +mSnapshotPanel(NULL), +mResolutionComboBox(NULL), mRefreshBtn(NULL), mRefreshLabel(NULL), mSucceessLblPanel(NULL), mFailureLblPanel(NULL), -mThumbnailPlaceholder(NULL) +mThumbnailPlaceholder(NULL), +mCaptionTextBox(NULL), +mLocationCheckbox(NULL), +mPostButton(NULL) { mCommitCallbackRegistrar.add("PostToFacebook.Send", boost::bind(&LLSocialPhotoPanel::onSend, this)); } @@ -129,179 +142,21 @@ LLSocialPhotoPanel::~LLSocialPhotoPanel() BOOL LLSocialPhotoPanel::postBuild() { setVisibleCallback(boost::bind(&LLSocialPhotoPanel::onVisibilityChange, this, _2)); - - mPostButton = getChild("post_btn"); + + mSnapshotPanel = getChild("snapshot_panel"); mResolutionComboBox = getChild("resolution_combobox"); - mResolutionComboBox->setCommitCallback(boost::bind(&LLSocialPhotoPanel::onResolutionComboCommit, this)); + mResolutionComboBox->setCommitCallback(boost::bind(&LLSocialPhotoPanel::updateResolution, this, TRUE)); mRefreshBtn = getChild("new_snapshot_btn"); childSetAction("new_snapshot_btn", boost::bind(&LLSocialPhotoPanel::onClickNewSnapshot, this)); mRefreshLabel = getChild("refresh_lbl"); mSucceessLblPanel = getChild("succeeded_panel"); mFailureLblPanel = getChild("failed_panel"); mThumbnailPlaceholder = getChild("thumbnail_placeholder"); - - return LLPanel::postBuild(); -} - -void LLSocialPhotoPanel::onResolutionComboCommit() -{ - LLFloaterSocial* instance = LLFloaterReg::findTypedInstance("social"); - updateResolution(mResolutionComboBox, instance); -} - -void LLSocialPhotoPanel::onClickNewSnapshot() -{ - LLSnapshotLivePreview* previewp = static_cast(mPreviewHandle.get()); - //LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; - if (previewp /*&& view*/) - { - //view->impl.setStatus(Impl::STATUS_READY); - lldebugs << "updating snapshot" << llendl; - previewp->updateSnapshot(TRUE); - } -} - -void LLSocialPhotoPanel::updateResolution(LLUICtrl* ctrl, void* data, BOOL do_update) -{ - LLComboBox* combobox = (LLComboBox*)ctrl; - LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; - - if (!view || !combobox) - { - llassert(view && combobox); - return; - } - - std::string sdstring = combobox->getSelectedValue(); - LLSD sdres; - std::stringstream sstream(sdstring); - LLSDSerialize::fromNotation(sdres, sstream, sdstring.size()); - - S32 width = sdres[0]; - S32 height = sdres[1]; - - LLSnapshotLivePreview * previewp = static_cast(mPreviewHandle.get()); - if (previewp && combobox->getCurrentIndex() >= 0) - { - S32 original_width = 0 , original_height = 0 ; - previewp->getSize(original_width, original_height) ; - - if (width == 0 || height == 0) - { - // take resolution from current window size - lldebugs << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << llendl; - previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); - } - else - { - // use the resolution from the selected pre-canned drop-down choice - lldebugs << "Setting preview res selected from combo: " << width << "x" << height << llendl; - previewp->setSize(width, height); - } - - checkAspectRatio(width); - - previewp->getSize(width, height); - - if(original_width != width || original_height != height) - { - previewp->setSize(width, height); - - // hide old preview as the aspect ratio could be wrong - lldebugs << "updating thumbnail" << llendl; - - previewp->updateSnapshot(FALSE, TRUE); - if(do_update) - { - lldebugs << "Will update controls" << llendl; - updateControls(); - setNeedRefresh(true); - } - } - - } -} - -void LLSocialPhotoPanel::setNeedRefresh(bool need) -{ - mRefreshLabel->setVisible(need); - mNeedRefresh = need; -} - -void LLSocialPhotoPanel::checkAspectRatio(S32 index) -{ - LLSnapshotLivePreview *previewp = getPreviewView() ; - - BOOL keep_aspect = FALSE; - - if (0 == index) // current window size - { - keep_aspect = TRUE; - } - else // predefined resolution - { - keep_aspect = FALSE; - } - - if (previewp) - { - previewp->mKeepAspectRatio = keep_aspect; - } -} - -LLSnapshotLivePreview* LLSocialPhotoPanel::getPreviewView() -{ - LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)mPreviewHandle.get(); - return previewp; -} - -void LLSocialPhotoPanel::updateControls() -{ - LLSnapshotLivePreview* previewp = getPreviewView(); - BOOL got_bytes = previewp && previewp->getDataSize() > 0; - BOOL got_snap = previewp && previewp->getSnapshotUpToDate(); - LLSnapshotLivePreview::ESnapshotType shot_type = previewp->getSnapshotType(); - - // *TODO: Separate maximum size for Web images from postcards - lldebugs << "Is snapshot up-to-date? " << got_snap << llendl; - - LLLocale locale(LLLocale::USER_LOCALE); - std::string bytes_string; - if (got_snap) - { - LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 ); - } - - //getChild("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : getString("unknown")); - getChild("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : "unknown"); - getChild("file_size_label")->setColor( - shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD - && got_bytes - && previewp->getDataSize() > MAX_POSTCARD_DATASIZE ? LLUIColor(LLColor4::red) : LLUIColorTable::instance().getColor( "LabelTextColor" )); - - LLComboBox* combo = getChild("resolution_combobox"); - LLFloaterSocial* instance = LLFloaterReg::findTypedInstance("social"); - updateResolution(combo, instance, FALSE); -} - -void LLSocialPhotoPanel::onVisibilityChange(const LLSD& new_visibility) -{ - bool visible = new_visibility.asBoolean(); - if (visible && !mPreviewHandle.get()) - { - LLRect full_screen_rect = getRootView()->getRect(); - LLSnapshotLivePreview::Params p; - p.rect(full_screen_rect); - LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p); - mPreviewHandle = previewp->getHandle(); - - previewp->setSnapshotType(previewp->SNAPSHOT_WEB); - previewp->setSnapshotFormat(LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG); - //previewp->setSnapshotQuality(98); - previewp->setThumbnailPlaceholderRect(getThumbnailPlaceholderRect()); + mCaptionTextBox = getChild("caption"); + mLocationCheckbox = getChild("add_location_cb"); + mPostButton = getChild("post_btn"); - updateControls(); - } + return LLPanel::postBuild(); } void LLSocialPhotoPanel::draw() @@ -313,7 +168,7 @@ void LLSocialPhotoPanel::draw() if(previewp && previewp->getThumbnailImage()) { bool working = false; //impl.getStatus() == Impl::STATUS_WORKING; - const LLRect& thumbnail_rect = getThumbnailPlaceholderRect(); + const LLRect& thumbnail_rect = mThumbnailPlaceholder->getRect(); const S32 thumbnail_w = previewp->getThumbnailWidth(); const S32 thumbnail_h = previewp->getThumbnailHeight(); @@ -325,8 +180,7 @@ void LLSocialPhotoPanel::draw() S32 offset_x = thumbnail_rect.mLeft + local_offset_x; S32 offset_y = thumbnail_rect.mBottom + local_offset_y; - LLUICtrl * snapshot_panel = getChild("snapshot_panel"); - snapshot_panel->localPointToOtherView(offset_x, offset_y, &offset_x, &offset_y, gFloaterView->getParentFloater(this)); + mSnapshotPanel->localPointToOtherView(offset_x, offset_y, &offset_x, &offset_y, getParentByType()); gGL.matrixMode(LLRender::MM_MODELVIEW); // Apply floater transparency to the texture unless the floater is focused. @@ -373,20 +227,57 @@ void LLSocialPhotoPanel::draw() gGL.pushUIMatrix(); S32 x_pos; S32 y_pos; - snapshot_panel->localPointToOtherView(thumbnail_rect.mLeft, thumbnail_rect.mBottom, &x_pos, &y_pos, gFloaterView->getParentFloater(this)); - + mSnapshotPanel->localPointToOtherView(thumbnail_rect.mLeft, thumbnail_rect.mBottom, &x_pos, &y_pos, getParentByType()); + LLUI::translate((F32) x_pos, (F32) y_pos); mThumbnailPlaceholder->draw(); gGL.popUIMatrix(); } - mPostButton->setEnabled(LLFacebookConnect::instance().isConnected()); + mPostButton->setEnabled(LLFacebookConnect::instance().isConnected()); +} + +LLSnapshotLivePreview* LLSocialPhotoPanel::getPreviewView() +{ + LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)mPreviewHandle.get(); + return previewp; +} + +void LLSocialPhotoPanel::onVisibilityChange(const LLSD& new_visibility) +{ + bool visible = new_visibility.asBoolean(); + if (visible && !mPreviewHandle.get()) + { + LLRect full_screen_rect = getRootView()->getRect(); + LLSnapshotLivePreview::Params p; + p.rect(full_screen_rect); + LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p); + mPreviewHandle = previewp->getHandle(); + + previewp->setSnapshotType(previewp->SNAPSHOT_WEB); + previewp->setSnapshotFormat(LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG); + //previewp->setSnapshotQuality(98); + previewp->setThumbnailPlaceholderRect(mThumbnailPlaceholder->getRect()); + + updateControls(); + } +} + +void LLSocialPhotoPanel::onClickNewSnapshot() +{ + LLSnapshotLivePreview* previewp = getPreviewView(); + if (previewp) + { + //setStatus(Impl::STATUS_READY); + lldebugs << "updating snapshot" << llendl; + previewp->updateSnapshot(TRUE); + } } void LLSocialPhotoPanel::onSend() { - std::string caption = getChild("caption")->getValue().asString(); - bool add_location = getChild("add_location_cb")->getValue().asBoolean(); + std::string caption = mCaptionTextBox->getValue().asString(); + bool add_location = mLocationCheckbox->getValue().asBoolean(); if (add_location) { @@ -399,7 +290,6 @@ void LLSocialPhotoPanel::onSend() } LLSnapshotLivePreview* previewp = getPreviewView(); - LLFacebookConnect::instance().sharePhoto(previewp->getFormattedImage(), caption); updateControls(); @@ -411,6 +301,122 @@ void LLSocialPhotoPanel::onSend() } } +void LLSocialPhotoPanel::updateControls() +{ + LLSnapshotLivePreview* previewp = getPreviewView(); + BOOL got_bytes = previewp && previewp->getDataSize() > 0; + BOOL got_snap = previewp && previewp->getSnapshotUpToDate(); + LLSnapshotLivePreview::ESnapshotType shot_type = previewp->getSnapshotType(); + + // *TODO: Separate maximum size for Web images from postcards + lldebugs << "Is snapshot up-to-date? " << got_snap << llendl; + + LLLocale locale(LLLocale::USER_LOCALE); + std::string bytes_string; + if (got_snap) + { + LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 ); + } + + //getChild("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : getString("unknown")); <---uses localized string + getChild("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : "unknown"); + getChild("file_size_label")->setColor( + shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD + && got_bytes + && previewp->getDataSize() > MAX_POSTCARD_DATASIZE ? LLUIColor(LLColor4::red) : LLUIColorTable::instance().getColor( "LabelTextColor" )); + + updateResolution(FALSE); +} + +void LLSocialPhotoPanel::updateResolution(BOOL do_update) +{ + LLComboBox* combobox = static_cast(mResolutionComboBox); + + std::string sdstring = combobox->getSelectedValue(); + LLSD sdres; + std::stringstream sstream(sdstring); + LLSDSerialize::fromNotation(sdres, sstream, sdstring.size()); + + S32 width = sdres[0]; + S32 height = sdres[1]; + + LLSnapshotLivePreview * previewp = static_cast(mPreviewHandle.get()); + if (previewp && combobox->getCurrentIndex() >= 0) + { + S32 original_width = 0 , original_height = 0 ; + previewp->getSize(original_width, original_height) ; + + if (width == 0 || height == 0) + { + // take resolution from current window size + lldebugs << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << llendl; + previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); + } + else + { + // use the resolution from the selected pre-canned drop-down choice + lldebugs << "Setting preview res selected from combo: " << width << "x" << height << llendl; + previewp->setSize(width, height); + } + + checkAspectRatio(width); + + previewp->getSize(width, height); + + if(original_width != width || original_height != height) + { + previewp->setSize(width, height); + + // hide old preview as the aspect ratio could be wrong + lldebugs << "updating thumbnail" << llendl; + + previewp->updateSnapshot(FALSE, TRUE); + if(do_update) + { + lldebugs << "Will update controls" << llendl; + updateControls(); + setNeedRefresh(true); + } + } + + } +} + +void LLSocialPhotoPanel::checkAspectRatio(S32 index) +{ + LLSnapshotLivePreview *previewp = getPreviewView() ; + + BOOL keep_aspect = FALSE; + + if (0 == index) // current window size + { + keep_aspect = TRUE; + } + else // predefined resolution + { + keep_aspect = FALSE; + } + + if (previewp) + { + previewp->mKeepAspectRatio = keep_aspect; + } +} + +void LLSocialPhotoPanel::setNeedRefresh(bool need) +{ + mRefreshLabel->setVisible(need); + mNeedRefresh = need; +} + +LLUICtrl* LLSocialPhotoPanel::getRefreshBtn() +{ + return mRefreshBtn; +} + +//////////////////////// +//LLSocialCheckinPanel// +//////////////////////// LLSocialCheckinPanel::LLSocialCheckinPanel() : mMapUrl(""), @@ -501,6 +507,9 @@ void LLSocialCheckinPanel::onSend() } } +//////////////////////// +//LLFloaterSocial/////// +//////////////////////// LLFloaterSocial::LLFloaterSocial(const LLSD& key) : LLFloater(key), mSocialPhotoPanel(NULL) @@ -522,15 +531,9 @@ BOOL LLFloaterSocial::postBuild() return LLFloater::postBuild(); } -/*virtual*/ -void LLFloaterSocial::draw() -{ - LLFloater::draw(); -} - void LLFloaterSocial::onOpen(const LLSD& key) { - LLSnapshotLivePreview* preview = static_cast(mSocialPhotoPanel->mPreviewHandle.get()); + LLSnapshotLivePreview* preview = mSocialPhotoPanel->getPreviewView(); if(preview) { lldebugs << "opened, updating snapshot" << llendl; @@ -541,14 +544,13 @@ void LLFloaterSocial::onOpen(const LLSD& key) // static void LLFloaterSocial::preUpdate() { - // FIXME: duplicated code LLFloaterSocial* instance = LLFloaterReg::findTypedInstance("social"); if (instance) { - // Disable the send/post/save buttons until snapshot is ready. + //Will set file size text to 'unknown' instance->mSocialPhotoPanel->updateControls(); - // Force hiding the "Refresh to save" hint because we know we've just started refresh. + //Hides the refresh text instance->mSocialPhotoPanel->setNeedRefresh(false); } } @@ -556,21 +558,22 @@ void LLFloaterSocial::preUpdate() // static void LLFloaterSocial::postUpdate() { - // FIXME: duplicated code LLFloaterSocial* instance = LLFloaterReg::findTypedInstance("social"); if (instance) { - // Enable the send/post/save buttons. + //Will set the file size text instance->mSocialPhotoPanel->updateControls(); - // We've just done refresh. + //Hides the refresh text instance->mSocialPhotoPanel->setNeedRefresh(false); // The refresh button is initially hidden. We show it after the first update, - // i.e. when preview appears. - if (!instance->mSocialPhotoPanel->mRefreshBtn->getVisible()) + // i.e. after snapshot is taken + LLUICtrl * refresh_button = instance->mSocialPhotoPanel->getRefreshBtn(); + + if (!refresh_button->getVisible()) { - instance->mSocialPhotoPanel->mRefreshBtn->setVisible(true); + refresh_button->setVisible(true); } } diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index 6675a990f4..95ba688430 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -50,37 +50,40 @@ private: class LLSocialPhotoPanel : public LLPanel { - public: +public: LLSocialPhotoPanel(); ~LLSocialPhotoPanel(); BOOL postBuild(); void draw(); - void onSend(); - const LLRect& getThumbnailPlaceholderRect() { return mThumbnailPlaceholder->getRect(); } - void onResolutionComboCommit(); + LLSnapshotLivePreview* getPreviewView(); + void onVisibilityChange(const LLSD& new_visibility); void onClickNewSnapshot(); + void onSend(); - LLHandle mPreviewHandle; - - void updateResolution(LLUICtrl* ctrl, void* data, BOOL do_update = TRUE); - void setNeedRefresh(bool need); + void updateControls(); + void updateResolution(BOOL do_update); void checkAspectRatio(S32 index); - LLSnapshotLivePreview* getPreviewView(); + void setNeedRefresh(bool need); + LLUICtrl* getRefreshBtn(); - void updateControls(); - void onVisibilityChange(const LLSD& new_visibility); +private: + + LLHandle mPreviewHandle; + LLUICtrl * mSnapshotPanel; LLUICtrl * mResolutionComboBox; - LLUICtrl *mRefreshBtn, *mRefreshLabel; - LLUICtrl *mSucceessLblPanel, *mFailureLblPanel; - LLUICtrl* mThumbnailPlaceholder; + LLUICtrl * mRefreshBtn; + LLUICtrl * mRefreshLabel; + LLUICtrl * mSucceessLblPanel; + LLUICtrl * mFailureLblPanel; + LLUICtrl * mThumbnailPlaceholder; + LLUICtrl * mCaptionTextBox; + LLUICtrl * mLocationCheckbox; + LLUICtrl * mPostButton; bool mNeedRefresh; - -private: - LLUICtrl* mPostButton; }; class LLSocialCheckinPanel : public LLPanel @@ -108,8 +111,6 @@ public: BOOL postBuild(); void onCancel(); void onOpen(const LLSD& key); - /*virtual*/ void draw(); - static void preUpdate(); static void postUpdate(); -- cgit v1.2.3 From 5f397fa58352fb58d79b72148904f925416f4978 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 28 Jun 2013 13:29:11 -0400 Subject: NORSPEC-206: read RenderMaterialsCapability throttle rate per second from simulator --- indra/newview/llmaterialmgr.cpp | 24 +++++++++++++----------- indra/newview/llmaterialmgr.h | 3 +++ indra/newview/llviewerregion.cpp | 32 ++++++++++++++++++++++++++++++++ indra/newview/llviewerregion.h | 8 ++++++++ 4 files changed, 56 insertions(+), 11 deletions(-) diff --git a/indra/newview/llmaterialmgr.cpp b/indra/newview/llmaterialmgr.cpp index ad9958546c..96dd402d84 100644 --- a/indra/newview/llmaterialmgr.cpp +++ b/indra/newview/llmaterialmgr.cpp @@ -543,11 +543,9 @@ void LLMaterialMgr::onIdle(void*) instancep->processGetAllQueue(); } - static LLFrameTimer mPutTimer; - if ( (!instancep->mPutQueue.empty()) && (mPutTimer.hasExpired()) ) + if (!instancep->mPutQueue.empty()) { instancep->processPutQueue(); - mPutTimer.resetWithExpiry(MATERIALS_PUT_THROTTLE_SECS); } } @@ -564,14 +562,14 @@ void LLMaterialMgr::processGetQueue() continue; } - const LLViewerRegion* regionp = LLWorld::instance().getRegionFromID(region_id); + LLViewerRegion* regionp = LLWorld::instance().getRegionFromID(region_id); if (!regionp) { LL_WARNS("Materials") << "Unknown region with id " << region_id.asString() << LL_ENDL; mGetQueue.erase(itRegionQueue); continue; } - else if (!regionp->capabilitiesReceived()) + else if (!regionp->capabilitiesReceived() || regionp->materialsCapThrottled()) { continue; } @@ -628,6 +626,7 @@ void LLMaterialMgr::processGetQueue() LL_DEBUGS("Materials") << "POSTing to region '" << regionp->getName() << "' at '"<< capURL << " for " << materialsData.size() << " materials." << "\ndata: " << ll_pretty_print_sd(materialsData) << LL_ENDL; LLHTTPClient::post(capURL, postData, materialsResponder); + regionp->resetMaterialsCapThrottle(); } } @@ -646,7 +645,7 @@ void LLMaterialMgr::processGetAllQueue() clearGetQueues(region_id); // Invalidates region_id continue; } - else if (!regionp->capabilitiesReceived()) + else if (!regionp->capabilitiesReceived() || regionp->materialsCapThrottled()) { continue; } @@ -663,6 +662,7 @@ void LLMaterialMgr::processGetAllQueue() LL_DEBUGS("Materials") << "GET all for region " << region_id << "url " << capURL << LL_ENDL; LLHTTPClient::ResponderPtr materialsResponder = new LLMaterialsResponder("GET", capURL, boost::bind(&LLMaterialMgr::onGetAllResponse, this, _1, _2, *itRegion)); LLHTTPClient::get(capURL, materialsResponder); + regionp->resetMaterialsCapThrottle(); mGetAllPending.insert(std::pair(region_id, LLFrameTimer::getTotalSeconds())); mGetAllQueue.erase(itRegion); // Invalidates region_id } @@ -670,7 +670,7 @@ void LLMaterialMgr::processGetAllQueue() void LLMaterialMgr::processPutQueue() { - typedef std::map regionput_request_map; + typedef std::map regionput_request_map; regionput_request_map requests; put_queue_t::iterator loopQueue = mPutQueue.begin(); @@ -687,13 +687,13 @@ void LLMaterialMgr::processPutQueue() } else { - const LLViewerRegion* regionp = objectp->getRegion(); + LLViewerRegion* regionp = objectp->getRegion(); if ( !regionp ) { LL_WARNS("Materials") << "Object region is NULL" << LL_ENDL; mPutQueue.erase(itQueue); } - else if ( regionp->capabilitiesReceived()) + else if ( regionp->capabilitiesReceived() && !regionp->materialsCapThrottled()) { LLSD& facesData = requests[regionp]; @@ -722,11 +722,12 @@ void LLMaterialMgr::processPutQueue() for (regionput_request_map::const_iterator itRequest = requests.begin(); itRequest != requests.end(); ++itRequest) { - std::string capURL = itRequest->first->getCapability(MATERIALS_CAPABILITY_NAME); + LLViewerRegion* regionp = itRequest->first; + std::string capURL = regionp->getCapability(MATERIALS_CAPABILITY_NAME); if (capURL.empty()) { LL_WARNS("Materials") << "Capability '" << MATERIALS_CAPABILITY_NAME - << "' is not defined on region '" << itRequest->first->getName() << "'" << LL_ENDL; + << "' is not defined on region '" << regionp->getName() << "'" << LL_ENDL; continue; } @@ -749,6 +750,7 @@ void LLMaterialMgr::processPutQueue() LL_DEBUGS("Materials") << "put for " << itRequest->second.size() << " faces to region " << itRequest->first->getName() << LL_ENDL; LLHTTPClient::ResponderPtr materialsResponder = new LLMaterialsResponder("PUT", capURL, boost::bind(&LLMaterialMgr::onPutResponse, this, _1, _2)); LLHTTPClient::put(capURL, putData, materialsResponder); + regionp->resetMaterialsCapThrottle(); } else { diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h index e83f1f4e01..2836019c27 100644 --- a/indra/newview/llmaterialmgr.h +++ b/indra/newview/llmaterialmgr.h @@ -126,6 +126,9 @@ protected: material_map_t mMaterials; U32 getMaxEntries(const LLViewerRegion* regionp); + + LLFrameTimer mCapThrottleTimer; + F32 getThrottleIntervalSecs(const LLUUID& region_id); }; #endif // LL_LLMATERIALMGR_H diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index a4f6340d9e..0f8decc643 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1944,3 +1944,35 @@ bool LLViewerRegion::dynamicPathfindingEnabled() const mSimulatorFeatures["DynamicPathfindingEnabled"].asBoolean()); } +void LLViewerRegion::resetMaterialsCapThrottle() +{ + F32 requests_per_sec = 1.0f; // original default; + if ( mSimulatorFeatures.has("RenderMaterialsCapability") + && mSimulatorFeatures["RenderMaterialsCapability"].isReal() ) + { + requests_per_sec = mSimulatorFeatures["RenderMaterialsCapability"].asReal(); + if ( requests_per_sec != 0.0f ) + { + requests_per_sec = 1.0f; + LL_WARNS("Materials") + << "region '" << getName() + << "' returned zero for RenderMaterialsCapability; using default " + << requests_per_sec << " per second" + << LL_ENDL; + } + LL_DEBUGS_ONCE("Materials") << "region '" << getName() + << "' RenderMaterialsCapability " << requests_per_sec + << LL_ENDL; + } + else + { + LL_DEBUGS("Materials") + << "region '" << getName() + << "' did not return RenderMaterialsCapability, using default " + << requests_per_sec << " per second" + << LL_ENDL; + } + + mMaterialsCapThrottleTimer.resetWithExpiry( 1.0f / requests_per_sec ); +} + diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 031159183b..a3db7f5ac7 100755 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -43,6 +43,7 @@ #include "llcapabilityprovider.h" #include "m4math.h" // LLMatrix4 #include "llhttpclient.h" +#include "llframetimer.h" // Surface id's #define LAND 1 @@ -342,6 +343,10 @@ public: void getNeighboringRegionsStatus( std::vector& regions ); const LLViewerRegionImpl * getRegionImpl() const { return mImpl; } LLViewerRegionImpl * getRegionImplNC() { return mImpl; } + + // implements the materials capability throttle + bool materialsCapThrottled() const { return !mMaterialsCapThrottleTimer.hasExpired(); } + void resetMaterialsCapThrottle(); public: struct CompareDistance @@ -434,6 +439,9 @@ private: BOOL mReleaseNotesRequested; LLSD mSimulatorFeatures; + + // the materials capability throttle + LLFrameTimer mMaterialsCapThrottleTimer; }; inline BOOL LLViewerRegion::getRegionProtocol(U64 protocol) const -- cgit v1.2.3 From 7d17bbe132cf0f799b703bba978d48d44a1377c4 Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 28 Jun 2013 19:26:07 +0100 Subject: removed unused Me menu items for ACME-637 --- indra/newview/llfloatersocial.cpp | 2 +- indra/newview/llviewermenu.cpp | 60 ---------------------- indra/newview/llviewermenu.h | 9 ---- indra/newview/skins/default/xui/en/menu_viewer.xml | 20 -------- .../newview/skins/default/xui/en/notifications.xml | 21 -------- .../default/xui/en/panel_snapshot_facebook.xml | 4 +- 6 files changed, 3 insertions(+), 113 deletions(-) diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index dfc9024d54..d6c00b7c86 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -128,7 +128,7 @@ mCaptionTextBox(NULL), mLocationCheckbox(NULL), mPostButton(NULL) { - mCommitCallbackRegistrar.add("PostToFacebook.Send", boost::bind(&LLSocialPhotoPanel::onSend, this)); + mCommitCallbackRegistrar.add("SocialSharing.SendPhoto", boost::bind(&LLSocialPhotoPanel::onSend, this)); } LLSocialPhotoPanel::~LLSocialPhotoPanel() diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 47787e2687..137eeb6a99 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5953,56 +5953,6 @@ void handle_report_abuse() LLFloaterReporter::showFromMenu(COMPLAINT_REPORT); } -void handle_facebook_connect() -{ - if (!LLFacebookConnect::instance().isConnected()) - { - LLFacebookConnect::instance().getConnectionToFacebook(true); - } -} - -bool enable_facebook_connect() -{ - // The menu item will be disabled if we are already connected - return !LLFacebookConnect::instance().isConnected(); -} - -void handle_facebook_checkin() -{ - - // Get the location SLURL - LLSLURL slurl; - LLAgentUI::buildSLURL(slurl); - std::string slurl_string = slurl.getSLURLString(); - - std::string region_name = gAgent.getRegion()->getName(); - std::string description; - LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_NORMAL_COORDS, gAgent.getPositionAgent()); - LLVector3d center_agent = gAgent.getRegion()->getCenterGlobal(); - int x_pos = center_agent[0] / 256.0; - int y_pos = center_agent[1] / 256.0; - std::string locationMap = llformat("http://map.secondlife.com/map-1-%d-%d-objects.jpg", x_pos, y_pos); - - LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, locationMap, ""); -} - -bool handle_facebook_status_callback(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (option == 0) - { - std::string message = response["message"].asString(); - if (!message.empty()) - LLFacebookConnect::instance().updateStatus(message); - } - return false; -} - -void handle_facebook_status() -{ - LLNotificationsUtil::add("FacebookUpdateStatus", LLSD(), LLSD(), boost::bind(&handle_facebook_status_callback, _1, _2)); -} - void handle_buy_currency() { LLBuyCurrencyHTML::openCurrencyFloater(); @@ -8801,14 +8751,4 @@ void initialize_menus() view_listener_t::addMenu(new LLEditableSelected(), "EditableSelected"); view_listener_t::addMenu(new LLEditableSelectedMono(), "EditableSelectedMono"); view_listener_t::addMenu(new LLToggleUIHints(), "ToggleUIHints"); - - // Facebook Connect - commit.add("Facebook.Connect", boost::bind(&handle_facebook_connect)); - enable.add("Facebook.EnableConnect", boost::bind(&enable_facebook_connect)); - - // Facebook Checkin - commit.add("Facebook.Checkin", boost::bind(&handle_facebook_checkin)); - - // Facebook Status Update - commit.add("Facebook.UpdateStatus", boost::bind(&handle_facebook_status)); } diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index e71beef10d..143420e227 100755 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -135,15 +135,6 @@ bool enable_pay_object(); bool enable_buy_object(); bool handle_go_to(); -// Facebook Connect -void handle_facebook_connect(); - -// Facebook Checkin -void handle_facebook_checkin(); - -// Facebook Status Update -void handle_facebook_status(); - // Export to XML or Collada void handle_export_selected( void * ); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 733eb16c54..6da4b3d234 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -15,26 +15,6 @@ function="ShowAgentProfile" parameter="agent" /> - - - - - - - - - - diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 5f4869e110..c8911e47e8 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -10135,25 +10135,4 @@ Cannot create large prims that intersect other players. Please re-try when othe yestext="OK"/> - - What's on your mind? (asks Facebook) - confirm -
- - -
-- cgit v1.2.3 From 7df863265f6f536aeae84dceab9140fb4465213c Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 28 Jun 2013 13:32:01 -0500 Subject: NORSPEC-290 Shader optimization WIP -- remove a couple normalizes, pows, and divides from various lighting functions. --- indra/llrender/llrender.cpp | 2 +- .../shaders/class1/deferred/alphaF.glsl | 51 +++-- .../shaders/class1/deferred/alphaNonIndexedF.glsl | 150 ------------- .../class1/deferred/alphaNonIndexedNoColorF.glsl | 92 -------- .../shaders/class1/deferred/alphaSkinnedV.glsl | 136 ------------ .../shaders/class1/deferred/alphaV.glsl | 37 +--- .../class1/deferred/avatarAlphaNoColorV.glsl | 10 +- .../shaders/class1/deferred/avatarAlphaV.glsl | 153 ------------- .../shaders/class1/deferred/materialF.glsl | 8 +- .../shaders/class1/lighting/lightFuncV.glsl | 2 +- .../shaders/class1/objects/previewV.glsl | 4 +- .../shaders/class2/deferred/alphaNonIndexedF.glsl | 235 -------------------- .../class2/deferred/alphaNonIndexedNoColorF.glsl | 242 --------------------- .../shaders/class2/deferred/alphaSkinnedV.glsl | 156 ------------- .../shaders/class2/deferred/alphaV.glsl | 224 ------------------- .../shaders/class2/deferred/avatarAlphaV.glsl | 153 ------------- indra/newview/pipeline.cpp | 4 +- 17 files changed, 46 insertions(+), 1613 deletions(-) delete mode 100755 indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl delete mode 100755 indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl delete mode 100755 indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl delete mode 100755 indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl delete mode 100755 indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl delete mode 100755 indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl delete mode 100755 indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl delete mode 100755 indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl delete mode 100755 indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index b22ad60750..c4585936ee 100755 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -1150,7 +1150,7 @@ void LLRender::syncLightState() position[i] = light->mPosition; direction[i] = light->mSpotDirection; - attenuation[i].set(light->mLinearAtten, light->mQuadraticAtten, light->mSpecular.mV[3]); + attenuation[i].set(1.f/light->mLinearAtten, light->mQuadraticAtten, light->mSpecular.mV[3]); diffuse[i].set(light->mDiffuse.mV); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index 143af0576c..af3f362208 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -61,6 +61,7 @@ VARYING vec3 vary_directional; VARYING vec3 vary_fragcoord; VARYING vec3 vary_position; VARYING vec3 vary_pointlight_col; +VARYING vec3 vary_pointlight_col_linear; VARYING vec2 vary_texcoord0; VARYING vec3 vary_norm; @@ -82,7 +83,7 @@ vec3 calcDirectionalLight(vec3 n, vec3 l) return vec3(a,a,a); } -vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) { //get light vector vec3 lv = lp.xyz-v; @@ -92,14 +93,14 @@ vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float float da = 0.0; - if (d > 0.0 && la > 0.0 && fa > 0.0) +// if (d > 0.0 && la > 0.0 && fa > 0.0) { //normalize light vector - lv = normalize(lv); + lv /= d; //distance attenuation - float dist = d/la; - da = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0); + float dist = d*la; + da = clamp(1.0-(dist+fa-1.0)/fa, 0.0, 1.0); da *= da; da *= 2.0; @@ -112,7 +113,7 @@ vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float da *= max(dot(n, lv), 0.0); } - return vec3(da,da,da); + return da; } #if HAS_SHADOW @@ -138,6 +139,25 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc) void main() { +#ifdef USE_INDEXED_TEX + vec4 diff = diffuseLookup(vary_texcoord0.xy); +#else + vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy); +#endif + +#ifdef USE_VERTEX_COLOR + float vertex_color_alpha = vertex_color.a; +#else + float vertex_color_alpha = 1.0; +#endif + + float alpha = vertex_color_alpha*diff.a; + + vec4 gamma_diff = diff; + + diff.rgb = pow(diff.rgb, vec3(2.2f, 2.2f, 2.2f)); + + vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; frag *= screen_res; @@ -210,21 +230,6 @@ void main() } #endif -#ifdef USE_INDEXED_TEX - vec4 diff = diffuseLookup(vary_texcoord0.xy); -#else - vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy); -#endif - vec4 gamma_diff = diff; - - diff.rgb = pow(diff.rgb, vec3(2.2f, 2.2f, 2.2f)); - -#ifdef USE_VERTEX_COLOR - float vertex_color_alpha = vertex_color.a; -#else - float vertex_color_alpha = 1.0; -#endif - vec3 normal = vary_norm; vec3 l = light_position[0].xyz; @@ -243,6 +248,7 @@ void main() color.rgb = scaleSoftClip(color.rgb); + //convert to linear space color.rgb = pow(color.rgb, vec3(2.2)); col = vec4(0,0,0,0); @@ -257,8 +263,9 @@ void main() LIGHT_LOOP(6) LIGHT_LOOP(7) - color.rgb += diff.rgb * pow(vary_pointlight_col, vec3(2.2)) * col.rgb; + color.rgb += diff.rgb * vary_pointlight_col_linear * col.rgb; + //convert to gamma space color.rgb = pow(color.rgb, vec3(1.0/2.2)); frag_color = color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl deleted file mode 100755 index 2ce44d599f..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl +++ /dev/null @@ -1,150 +0,0 @@ -/** - * @file alphaF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#extension GL_ARB_texture_rectangle : enable - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif - -uniform sampler2DRect depthMap; -uniform sampler2D diffuseMap; - - -uniform vec2 screen_res; - -vec3 atmosLighting(vec3 light); -vec3 scaleSoftClip(vec3 light); - -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_position; -VARYING vec3 vary_pointlight_col; -VARYING vec2 vary_texcoord0; -VARYING vec4 vertex_color; -VARYING vec3 vary_norm; - -uniform mat4 inv_proj; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -vec3 calcDirectionalLight(vec3 n, vec3 l) -{ - float a = pow(max(dot(n,l),0.0), 0.7); - return vec3(a,a,a); -} - -vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(pow(dot(n, lv), 0.7), 0.0); - } - - return vec3(da,da,da); -} - -vec4 getPosition(vec2 pos_screen) -{ - float depth = texture2DRect(depthMap, pos_screen.xy).a; - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -void main() -{ - vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; - frag *= screen_res; - - vec4 pos = vec4(vary_position, 1.0); - - vec4 diff= texture2D(diffuseMap,vary_texcoord0.xy); - - vec3 n = vary_norm; - vec3 l = light_position[0].xyz; - vec3 dlight = calcDirectionalLight(n, l); - dlight = dlight * vary_directional.rgb * vary_pointlight_col; - - vec4 col = vec4(vary_ambient + dlight, vertex_color.a); - vec4 color = diff * col; - - color.rgb = atmosLighting(color.rgb); - - color.rgb = scaleSoftClip(color.rgb); - vec3 light_col = vec3(0,0,0); - - #define LIGHT_LOOP(i) \ - light_col += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, vary_norm, light_position[i], light_direction[i], light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z); - - LIGHT_LOOP(1) - LIGHT_LOOP(2) - LIGHT_LOOP(3) - LIGHT_LOOP(4) - LIGHT_LOOP(5) - LIGHT_LOOP(6) - LIGHT_LOOP(7) - - color.rgb += diff.rgb * vary_pointlight_col * light_col; - - color.rgb = pow(color.rgb, vec3(1.0/2.2)); - - frag_color = color; - //frag_color = vec4(1,0,1,1); - //frag_color = vec4(1,0,1,1)*shadow; - -} - diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl deleted file mode 100755 index 1113a9845b..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl +++ /dev/null @@ -1,92 +0,0 @@ -/** - * @file alphaNonIndexedNoColorF.glsl - * - * $LicenseInfo:firstyear=2005&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2005, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#extension GL_ARB_texture_rectangle : enable - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif - -uniform float minimum_alpha; - -uniform sampler2DRect depthMap; -uniform sampler2D diffuseMap; - -uniform vec2 screen_res; - -vec3 atmosLighting(vec3 light); -vec3 scaleSoftClip(vec3 light); - -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_position; -VARYING vec3 vary_pointlight_col; -VARYING vec2 vary_texcoord0; - -uniform mat4 inv_proj; - -vec4 getPosition(vec2 pos_screen) -{ - float depth = texture2DRect(depthMap, pos_screen.xy).a; - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -void main() -{ - vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; - frag *= screen_res; - - vec4 pos = vec4(vary_position, 1.0); - - vec4 diff= texture2D(diffuseMap,vary_texcoord0.xy); - - if (diff.a < minimum_alpha) - { - discard; - } - - vec4 col = vec4(vary_ambient + vary_directional.rgb, 1.0); - vec4 color = diff * col; - - - color.rgb = atmosLighting(color.rgb); - - color.rgb = scaleSoftClip(color.rgb); - - color.rgb += diff.rgb * vary_pointlight_col.rgb; - - frag_color = color; -} - diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl deleted file mode 100755 index 5f93986f1d..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl +++ /dev/null @@ -1,136 +0,0 @@ -/** - * @file alphaSkinnedV.glsl - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat4 projection_matrix; -uniform mat4 modelview_matrix; - -ATTRIBUTE vec3 position; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec4 diffuse_color; -ATTRIBUTE vec2 texcoord0; - -mat4 getObjectSkinnedTransform(); -void calcAtmospherics(vec3 inPositionEye); - -float calcDirectionalLight(vec3 n, vec3 l); - -vec3 atmosAmbient(vec3 light); -vec3 atmosAffectDirectionalLight(float lightIntensity); - -VARYING vec3 vary_position; -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_pointlight_col; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -VARYING vec3 vary_norm; - -uniform float near_clip; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -float calcDirectionalLight(vec3 n, vec3 l) -{ - float a = max(dot(n,l),0.0); - return a; -} - -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(dot(n, lv), 0.0); - } - - return da; -} - -void main() -{ - vary_texcoord0 = texcoord0; - - vec4 pos; - vec3 norm; - - mat4 trans = getObjectSkinnedTransform(); - trans = modelview_matrix * trans; - - pos = trans * vec4(position.xyz, 1.0); - - norm = position.xyz + normal.xyz; - norm = normalize(( trans*vec4(norm, 1.0) ).xyz-pos.xyz); - vary_norm = norm; - vec4 frag_pos = projection_matrix * pos; - gl_Position = frag_pos; - - vary_position = pos.xyz; - - calcAtmospherics(pos.xyz); - - //vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); - vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a); - vary_pointlight_col = diffuse_color.rgb; - col.rgb = vec3(0,0,0); - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - - vary_ambient = col.rgb*diffuse_color.rgb; - vary_directional.rgb = atmosAffectDirectionalLight(1); - - col.rgb = col.rgb*diffuse_color.rgb; - - vertex_color = col; - - - - vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip); -} - - diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl index 9d3ba564cd..cc63baa422 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl @@ -68,6 +68,7 @@ VARYING vec3 vary_directional; VARYING vec3 vary_fragcoord; VARYING vec3 vary_position; VARYING vec3 vary_pointlight_col; +VARYING vec3 vary_pointlight_col_linear; #ifdef USE_VERTEX_COLOR VARYING vec4 vertex_color; @@ -79,43 +80,8 @@ VARYING vec3 vary_norm; uniform float near_clip; -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - uniform vec3 sun_dir; -vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(dot(n, lv), 0.0); - } - - return vec3(da,da,da); -} - void main() { vec4 pos; @@ -181,6 +147,7 @@ void main() vary_pointlight_col = diff; + vary_pointlight_col_linear = pow(diff, vec3(2.2)); col.rgb = vec3(0,0,0); diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaNoColorV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaNoColorV.glsl index c8ddefac26..145cf524d4 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaNoColorV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaNoColorV.glsl @@ -71,18 +71,18 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa vec3 lv = lp.xyz-v; //get distance - float d = dot(lv,lv); + float d = length(lv); float da = 0.0; - if (d > 0.0 && la > 0.0 && fa > 0.0) + //if (d > 0.0 && la > 0.0 && fa > 0.0) { //normalize light vector - lv = normalize(lv); + lv /= d; //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); + float dist = d*la; + da = clamp(1.0-(dist-1.0+fa)/fa, 0.0, 1.0); // spotlight coefficient. float spot = max(dot(-ln, lv), is_pointlight); diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl deleted file mode 100755 index d6149fcc32..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl +++ /dev/null @@ -1,153 +0,0 @@ -/** - * @file avatarAlphaV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat4 projection_matrix; - -ATTRIBUTE vec3 position; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec2 texcoord0; - -vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); -mat4 getSkinnedTransform(); -void calcAtmospherics(vec3 inPositionEye); - -float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); - -vec3 atmosAmbient(vec3 light); -vec3 atmosAffectDirectionalLight(float lightIntensity); -vec3 scaleDownLight(vec3 light); -vec3 scaleUpLight(vec3 light); - -VARYING vec3 vary_position; -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_pointlight_col; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - - -uniform float near_clip; - -uniform vec4 color; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -float calcDirectionalLight(vec3 n, vec3 l) -{ - float a = max(dot(n,l),0.0); - return a; -} - -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(dot(n, lv), 0.0); - } - - return da; -} - -void main() -{ - vary_texcoord0 = texcoord0; - - vec4 pos; - vec3 norm; - - mat4 trans = getSkinnedTransform(); - vec4 pos_in = vec4(position.xyz, 1.0); - pos.x = dot(trans[0], pos_in); - pos.y = dot(trans[1], pos_in); - pos.z = dot(trans[2], pos_in); - pos.w = 1.0; - - norm.x = dot(trans[0].xyz, normal); - norm.y = dot(trans[1].xyz, normal); - norm.z = dot(trans[2].xyz, normal); - norm = normalize(norm); - - vec4 frag_pos = projection_matrix * pos; - gl_Position = frag_pos; - - vary_position = pos.xyz; - - calcAtmospherics(pos.xyz); - - vec4 col = vec4(0.0, 0.0, 0.0, 1.0); - - // Collect normal lights - col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z); - col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z); - col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z); - col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z); - col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z); - col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z); - - vary_pointlight_col = col.rgb*color.rgb; - - col.rgb = vec3(0,0,0); - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - - vary_ambient = col.rgb*color.rgb; - vary_directional = color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), 0.0)); - - col.rgb = col.rgb * color.rgb; - - vertex_color = col; - - - - vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip); -} - - diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl index 53ade8ea64..27bb43110b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl @@ -133,14 +133,14 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe vec3 col = vec3(0,0,0); - if (d > 0.0 && la > 0.0 && fa > 0.0) + //if (d > 0.0 && la > 0.0 && fa > 0.0) { //normalize light vector - lv = normalize(lv); + lv /= d; //distance attenuation - float dist = d/la; - float dist_atten = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0); + float dist = d*la; + float dist_atten = clamp(1.0-(dist-1.0+fa)/fa, 0.0, 1.0); dist_atten *= dist_atten; dist_atten *= 2.0; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl index a9288b3df6..dc0b989e34 100755 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl @@ -45,7 +45,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa lv *= 1.0/d; //distance attenuation - float da = clamp(1.0/(la * d), 0.0, 1.0); + float da = clamp(1.0/(1.f/la * d), 0.0, 1.0); // spotlight coefficient. float spot = max(dot(-ln, lv), is_pointlight); diff --git a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl index 7f3f84398b..c325a236d7 100755 --- a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl @@ -91,8 +91,8 @@ void main() // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += light_diffuse[1].rgb * calcDirectionalLight(norm, light_position[1].xyz); - col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].z); - col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].z); + col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], 1.f/light_attenuation[2].x, light_attenuation[2].z); + col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], 1.f/light_attenuation[3].x, light_attenuation[3].z); vertex_color = col*color; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl deleted file mode 100755 index 9670d59399..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl +++ /dev/null @@ -1,235 +0,0 @@ -/** - * @file alphaF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#extension GL_ARB_texture_rectangle : enable - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif - -uniform sampler2DShadow shadowMap0; -uniform sampler2DShadow shadowMap1; -uniform sampler2DShadow shadowMap2; -uniform sampler2DShadow shadowMap3; -uniform sampler2DRect depthMap; -uniform sampler2D diffuseMap; - -uniform mat4 shadow_matrix[6]; -uniform vec4 shadow_clip; -uniform vec2 screen_res; - -vec3 atmosLighting(vec3 light); -vec3 scaleSoftClip(vec3 light); - -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_position; -VARYING vec3 vary_pointlight_col; -VARYING vec2 vary_texcoord0; -VARYING vec4 vertex_color; -VARYING vec3 vary_norm; - -uniform vec2 shadow_res; -uniform float shadow_bias; - -uniform mat4 inv_proj; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -vec3 calcDirectionalLight(vec3 n, vec3 l) -{ - float a = pow(max(dot(n,l),0.0), 0.7); - return vec3(a,a,a); -} - -vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(pow(dot(n, lv), 0.7), 0.0); - } - - return vec3(da,da,da); -} - -vec4 getPosition(vec2 pos_screen) -{ - float depth = texture2DRect(depthMap, pos_screen.xy).a; - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos.xyz /= pos.w; - pos.w = 1.0; - return pos; -} - -float pcfShadow(sampler2DShadow shadowMap, vec4 stc) -{ - stc.xyz /= stc.w; - stc.z += shadow_bias; - - stc.x = floor(stc.x*shadow_res.x + fract(stc.y*12345))/shadow_res.x; // add some chaotic jitter to X sample pos according to Y to disguise the snapping going on here - - float cs = shadow2D(shadowMap, stc.xyz).x; - float shadow = cs; - - shadow += shadow2D(shadowMap, stc.xyz+vec3(2.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x; - shadow += shadow2D(shadowMap, stc.xyz+vec3(1.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x; - shadow += shadow2D(shadowMap, stc.xyz+vec3(-1.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x; - shadow += shadow2D(shadowMap, stc.xyz+vec3(-2.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x; - - return shadow*0.2; -} - - -void main() -{ - vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; - frag *= screen_res; - - float shadow = 0.0; - vec4 pos = vec4(vary_position, 1.0); - - vec4 spos = pos; - - if (spos.z > -shadow_clip.w) - { - vec4 lpos; - - vec4 near_split = shadow_clip*-0.75; - vec4 far_split = shadow_clip*-1.25; - vec4 transition_domain = near_split-far_split; - float weight = 0.0; - - if (spos.z < near_split.z) - { - lpos = shadow_matrix[3]*spos; - - float w = 1.0; - w -= max(spos.z-far_split.z, 0.0)/transition_domain.z; - shadow += pcfShadow(shadowMap3, lpos)*w; - weight += w; - shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); - } - - if (spos.z < near_split.y && spos.z > far_split.z) - { - lpos = shadow_matrix[2]*spos; - - float w = 1.0; - w -= max(spos.z-far_split.y, 0.0)/transition_domain.y; - w -= max(near_split.z-spos.z, 0.0)/transition_domain.z; - shadow += pcfShadow(shadowMap2, lpos)*w; - weight += w; - } - - if (spos.z < near_split.x && spos.z > far_split.y) - { - lpos = shadow_matrix[1]*spos; - - float w = 1.0; - w -= max(spos.z-far_split.x, 0.0)/transition_domain.x; - w -= max(near_split.y-spos.z, 0.0)/transition_domain.y; - shadow += pcfShadow(shadowMap1, lpos)*w; - weight += w; - } - - if (spos.z > far_split.x) - { - lpos = shadow_matrix[0]*spos; - - float w = 1.0; - w -= max(near_split.x-spos.z, 0.0)/transition_domain.x; - - shadow += pcfShadow(shadowMap0, lpos)*w; - weight += w; - } - - - shadow /= weight; - - } - else - { - shadow = 1.0; - } - vec3 n = vary_norm; - vec3 l = light_position[0].xyz; - vec3 dlight = calcDirectionalLight(n, l); - dlight = dlight * vary_directional.rgb * vary_pointlight_col; - vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy); - - vec4 col = vec4(vary_ambient + dlight*shadow, vertex_color.a); - vec4 color = diff * col; - - color.rgb = atmosLighting(color.rgb); - - color.rgb = scaleSoftClip(color.rgb); - vec3 light_col = vec3(0,0,0); - - #define LIGHT_LOOP(i) \ - light_col += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, vary_norm, light_position[i], light_direction[i], light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z); - - LIGHT_LOOP(1) - LIGHT_LOOP(2) - LIGHT_LOOP(3) - LIGHT_LOOP(4) - LIGHT_LOOP(5) - LIGHT_LOOP(6) - LIGHT_LOOP(7) - - color.rgb += diff.rgb * vary_pointlight_col * light_col; - - frag_color = color; -} - diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl deleted file mode 100755 index fae279fba0..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl +++ /dev/null @@ -1,242 +0,0 @@ -/** - * @file alphaNonIndexedNoColorF.glsl - * - * $LicenseInfo:firstyear=2005&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2005, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#extension GL_ARB_texture_rectangle : enable - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif - -uniform float minimum_alpha; - -uniform sampler2DShadow shadowMap0; -uniform sampler2DShadow shadowMap1; -uniform sampler2DShadow shadowMap2; -uniform sampler2DShadow shadowMap3; -uniform sampler2DRect depthMap; -uniform sampler2D diffuseMap; - -uniform mat4 shadow_matrix[6]; -uniform vec4 shadow_clip; -uniform vec2 screen_res; - -vec3 atmosLighting(vec3 light); -vec3 scaleSoftClip(vec3 light); - -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_position; -VARYING vec3 vary_pointlight_col; -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_norm; - -uniform vec2 shadow_res; - -uniform float shadow_bias; - -uniform mat4 inv_proj; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -vec3 calcDirectionalLight(vec3 n, vec3 l) -{ - float a = pow(max(dot(n,l),0.0), 0.7); - return vec3(a, a, a); -} - -vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(pow(dot(n, lv), 0.7), 0.0); - } - - return vec3(da,da,da); -} - -vec4 getPosition(vec2 pos_screen) -{ - float depth = texture2DRect(depthMap, pos_screen.xy).a; - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos.xyz /= pos.w; - pos.w = 1.0; - return pos; -} - -float pcfShadow(sampler2DShadow shadowMap, vec4 stc) -{ - stc.xyz /= stc.w; - stc.z += shadow_bias; - - stc.x = floor(stc.x*shadow_res.x + fract(stc.y*12345))/shadow_res.x; // add some chaotic jitter to X sample pos according to Y to disguise the snapping going on here - float cs = shadow2D(shadowMap, stc.xyz).x; - - float shadow = cs; - - shadow += shadow2D(shadowMap, stc.xyz+vec3(2.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x; - shadow += shadow2D(shadowMap, stc.xyz+vec3(1.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x; - shadow += shadow2D(shadowMap, stc.xyz+vec3(-1.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x; - shadow += shadow2D(shadowMap, stc.xyz+vec3(-2.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x; - - return shadow*0.2; -} - - -void main() -{ - vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; - frag *= screen_res; - - float shadow = 0.0; - vec4 pos = vec4(vary_position, 1.0); - - vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy); - - if (diff.a < minimum_alpha) - { - discard; - } - - vec4 spos = pos; - - if (spos.z > -shadow_clip.w) - { - vec4 lpos; - - vec4 near_split = shadow_clip*-0.75; - vec4 far_split = shadow_clip*-1.25; - vec4 transition_domain = near_split-far_split; - float weight = 0.0; - - if (spos.z < near_split.z) - { - lpos = shadow_matrix[3]*spos; - - float w = 1.0; - w -= max(spos.z-far_split.z, 0.0)/transition_domain.z; - shadow += pcfShadow(shadowMap3, lpos)*w; - weight += w; - shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); - } - - if (spos.z < near_split.y && spos.z > far_split.z) - { - lpos = shadow_matrix[2]*spos; - - float w = 1.0; - w -= max(spos.z-far_split.y, 0.0)/transition_domain.y; - w -= max(near_split.z-spos.z, 0.0)/transition_domain.z; - shadow += pcfShadow(shadowMap2, lpos)*w; - weight += w; - } - - if (spos.z < near_split.x && spos.z > far_split.y) - { - lpos = shadow_matrix[1]*spos; - - float w = 1.0; - w -= max(spos.z-far_split.x, 0.0)/transition_domain.x; - w -= max(near_split.y-spos.z, 0.0)/transition_domain.y; - shadow += pcfShadow(shadowMap1, lpos)*w; - weight += w; - } - - if (spos.z > far_split.x) - { - lpos = shadow_matrix[0]*spos; - - float w = 1.0; - w -= max(near_split.x-spos.z, 0.0)/transition_domain.x; - - shadow += pcfShadow(shadowMap0, lpos)*w; - weight += w; - } - - - shadow /= weight; - } - else - { - shadow = 1.0; - } - vec3 n = vary_norm; - vec3 l = light_position[0].xyz; - vec3 dlight = calcDirectionalLight(n, l); - dlight = dlight * vary_directional.rgb * vary_pointlight_col; - - vec4 col = vec4(vary_ambient + dlight*shadow, 1.0); - vec4 color = diff * col; - - color.rgb = atmosLighting(color.rgb); - - color.rgb = scaleSoftClip(color.rgb); - vec3 light_col = vec3(0,0,0); - - #define LIGHT_LOOP(i) \ - light_col += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, vary_norm, light_position[i], light_direction[i], light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z); - - LIGHT_LOOP(1) - LIGHT_LOOP(2) - LIGHT_LOOP(3) - LIGHT_LOOP(4) - LIGHT_LOOP(5) - LIGHT_LOOP(6) - LIGHT_LOOP(7) - - color.rgb += diff.rgb * vary_pointlight_col * light_col; - - frag_color = color; -} - diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl deleted file mode 100755 index 7f4d82ecc6..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl +++ /dev/null @@ -1,156 +0,0 @@ -/** - * @file alphaSkinnedV.glsl - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat4 projection_matrix; -uniform mat4 texture_matrix0; -uniform mat4 modelview_matrix; -uniform mat4 modelview_projection_matrix; - -ATTRIBUTE vec3 position; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec4 diffuse_color; -ATTRIBUTE vec2 texcoord0; - -vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); -void calcAtmospherics(vec3 inPositionEye); - -float calcDirectionalLight(vec3 n, vec3 l); -mat4 getObjectSkinnedTransform(); -vec3 atmosAmbient(vec3 light); -vec3 atmosAffectDirectionalLight(float lightIntensity); -vec3 scaleDownLight(vec3 light); -vec3 scaleUpLight(vec3 light); - -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_position; -VARYING vec3 vary_pointlight_col; - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_norm; - -uniform float near_clip; -uniform float shadow_offset; -uniform float shadow_bias; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -float calcDirectionalLight(vec3 n, vec3 l) -{ - float a = max(dot(n,l),0.0); - return a; -} - -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ -//get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(dot(n, lv), 0.0); - } - - return da; -} - -void main() -{ - vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; - - mat4 mat = getObjectSkinnedTransform(); - - mat = modelview_matrix * mat; - - vec3 pos = (mat*vec4(position, 1.0)).xyz; - - gl_Position = projection_matrix * vec4(pos, 1.0); - - vec4 n = vec4(position, 1.0); - n.xyz += normal.xyz; - n.xyz = (mat*n).xyz; - n.xyz = normalize(n.xyz-pos.xyz); - - vec3 norm = n.xyz; - vary_norm = norm; - - float dp_directional_light = max(0.0, dot(norm, light_position[0].xyz)); - vary_position = pos.xyz + light_position[0].xyz * (1.0-dp_directional_light)*shadow_offset; - - calcAtmospherics(pos.xyz); - - //vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); - vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a); - - // Collect normal lights - col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z); - col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z); - col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z); - col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z); - col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z); - col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z); - - vary_pointlight_col = col.rgb*diffuse_color.rgb; - - col.rgb = vec3(0,0,0); - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - - vary_ambient = col.rgb*diffuse_color.rgb; - vary_directional.rgb = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a))); - - col.rgb = min(col.rgb*diffuse_color.rgb, 1.0); - - vertex_color = col; - - - - pos.xyz = (modelview_projection_matrix * vec4(position.xyz, 1.0)).xyz; - vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); - -} - diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl deleted file mode 100755 index 13c6ffc607..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl +++ /dev/null @@ -1,224 +0,0 @@ -/** - * @file alphaV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat3 normal_matrix; -uniform mat4 texture_matrix0; -uniform mat4 projection_matrix; -uniform mat4 modelview_matrix; -uniform mat4 modelview_projection_matrix; - -ATTRIBUTE vec3 position; - -#ifdef USE_INDEXED_TEX -void passTextureIndex(); -#endif - -ATTRIBUTE vec3 normal; - -#ifdef USE_VERTEX_COLOR -ATTRIBUTE vec4 diffuse_color; -#endif - -ATTRIBUTE vec2 texcoord0; - -#ifdef HAS_SKIN -mat4 getObjectSkinnedTransform(); -#else -#ifdef IS_AVATAR_SKIN -mat4 getSkinnedTransform(); -#endif -#endif - -vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); -void calcAtmospherics(vec3 inPositionEye); - -vec3 calcDirectionalLight(vec3 n, vec3 l); - -vec3 atmosAmbient(vec3 light); -vec3 atmosAffectDirectionalLight(float lightIntensity); -vec3 scaleDownLight(vec3 light); -vec3 scaleUpLight(vec3 light); - -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_position; -VARYING vec3 vary_pointlight_col; - -#ifdef USE_VERTEX_COLOR -VARYING vec4 vertex_color; -#endif - -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_norm; - -uniform float near_clip; -uniform float shadow_offset; -uniform float shadow_bias; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -uniform vec3 sun_dir; - -vec3 calcDirectionalLight(vec3 n, vec3 l) -{ - float a = max(dot(n,l),0.0); - return vec3(a,a,a); -} - -vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(dot(n, lv), 0.0); - } - - return vec3(da,da,da); -} - -void main() -{ - vec4 pos; - vec3 norm; - - //transform vertex -#ifdef HAS_SKIN - mat4 trans = getObjectSkinnedTransform(); - trans = modelview_matrix * trans; - - pos = trans * vec4(position.xyz, 1.0); - - norm = position.xyz + normal.xyz; - norm = normalize((trans * vec4(norm, 1.0)).xyz - pos.xyz); - vec4 frag_pos = projection_matrix * pos; - gl_Position = frag_pos; -#else - -#ifdef IS_AVATAR_SKIN - mat4 trans = getSkinnedTransform(); - vec4 pos_in = vec4(position.xyz, 1.0); - pos.x = dot(trans[0], pos_in); - pos.y = dot(trans[1], pos_in); - pos.z = dot(trans[2], pos_in); - pos.w = 1.0; - - norm.x = dot(trans[0].xyz, normal); - norm.y = dot(trans[1].xyz, normal); - norm.z = dot(trans[2].xyz, normal); - norm = normalize(norm); - - vec4 frag_pos = projection_matrix * pos; - gl_Position = frag_pos; -#else - norm = normalize(normal_matrix * normal); - vec4 vert = vec4(position.xyz, 1.0); - pos = (modelview_matrix * vert); - gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); -#endif - -#endif - -#ifdef USE_INDEXED_TEX - passTextureIndex(); - vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; -#else - vary_texcoord0 = texcoord0; -#endif - - vary_norm = norm; - float dp_directional_light = max(0.0, dot(norm, light_position[0].xyz)); - vary_position = pos.xyz + light_position[0].xyz * (1.0-dp_directional_light)*shadow_offset; - - calcAtmospherics(pos.xyz); - -#ifndef USE_VERTEX_COLOR - vec4 diffuse_color = vec4(1,1,1,1); -#endif - - //vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); - vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a); - - vec3 dff = pow(diffuse_color.rgb, vec3(2.2f,2.2f,2.2f)); - - vary_pointlight_col = dff; - - col.rgb = vec3(0,0,0); - - // Add windlight lights - col.rgb = atmosAmbient(col.rgb); - - float ambient = min(abs(dot(norm.xyz, sun_dir.xyz)), 1.0); - ambient *= 0.5; - ambient *= ambient; - ambient = (1.0-ambient); - - col.rgb *= ambient; - - vary_directional.rgb = atmosAffectDirectionalLight(1.0f); - vary_ambient = col.rgb*dff; - - col.rgb = col.rgb*dff; - -#ifdef USE_VERTEX_COLOR - vertex_color = col; -#endif - -#ifdef HAS_SKIN - vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip); -#else - -#ifdef IS_AVATAR_SKIN - vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); -#else - pos = modelview_projection_matrix * vert; - vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); -#endif - -#endif - -} diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl deleted file mode 100755 index 44aaa98b97..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl +++ /dev/null @@ -1,153 +0,0 @@ -/** - * @file avatarAlphaV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat4 projection_matrix; - -ATTRIBUTE vec3 position; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec2 texcoord0; - -vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); -mat4 getSkinnedTransform(); -void calcAtmospherics(vec3 inPositionEye); - -float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); - -vec3 atmosAmbient(vec3 light); -vec3 atmosAffectDirectionalLight(float lightIntensity); -vec3 scaleDownLight(vec3 light); -vec3 scaleUpLight(vec3 light); - -VARYING vec3 vary_position; -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_pointlight_col; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -uniform vec4 color; - -uniform float near_clip; -uniform float shadow_offset; -uniform float shadow_bias; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -float calcDirectionalLight(vec3 n, vec3 l) -{ - float a = max(dot(n,l),0.0); - return a; -} - -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(dot(n, lv), 0.0); - } - - return da; -} - -void main() -{ - vary_texcoord0 = texcoord0; - - vec4 pos; - vec3 norm; - - mat4 trans = getSkinnedTransform(); - vec4 pos_in = vec4(position.xyz, 1.0); - pos.x = dot(trans[0], pos_in); - pos.y = dot(trans[1], pos_in); - pos.z = dot(trans[2], pos_in); - pos.w = 1.0; - - norm.x = dot(trans[0].xyz, normal); - norm.y = dot(trans[1].xyz, normal); - norm.z = dot(trans[2].xyz, normal); - norm = normalize(norm); - - gl_Position = projection_matrix * pos; - - float dp_directional_light = max(0.0, dot(norm, light_position[0].xyz)); - vary_position = pos.xyz + light_position[0].xyz * (1.0-dp_directional_light)*shadow_offset; - - calcAtmospherics(pos.xyz); - - vec4 col = vec4(0.0, 0.0, 0.0, 1.0); - - // Collect normal lights - col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z); - col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z); - col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z); - col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z); - col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z); - col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z); - - vary_pointlight_col = col.rgb*color.rgb; - - col.rgb = vec3(0,0,0); - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - - vary_ambient = col.rgb*color.rgb; - vary_directional = atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), 0.0)); - - col.rgb = col.rgb*color.rgb; - - vertex_color = col; - - - vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); -} - - diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 231508e253..7072c95c3e 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2710,14 +2710,14 @@ void LLPipeline::downsampleDepthBuffer(LLRenderTarget& source, LLRenderTarget& d { shader = &gDownsampleDepthRectProgram; shader->bind(); - shader->uniform2f("delta", 1.f, 1.f); + shader->uniform2f(sDelta, 1.f, 1.f); shader->uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, source.getWidth(), source.getHeight()); } else { shader = &gDownsampleDepthProgram; shader->bind(); - shader->uniform2f("delta", 1.f/source.getWidth(), 1.f/source.getHeight()); + shader->uniform2f(sDelta, 1.f/source.getWidth(), 1.f/source.getHeight()); shader->uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, 1.f, 1.f); } -- cgit v1.2.3 From 89ae19e57edc9abfd300b17caf2719d7794dabf9 Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 28 Jun 2013 20:19:17 +0100 Subject: removed old error popups and added better logging for ACME-653 --- indra/newview/llfacebookconnect.cpp | 29 ++++++---------------- .../newview/skins/default/xui/en/notifications.xml | 11 -------- 2 files changed, 8 insertions(+), 32 deletions(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 52268daa36..dc450aab7a 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -41,19 +41,12 @@ // Local functions -void prompt_user_for_error(U32 status, const std::string& reason, const std::string& code, const std::string& description) +void log_facebook_connect_error(const std::string& request, U32 status, const std::string& reason, const std::string& code, const std::string& description) { - // Note: 302 (redirect) is *not* an error that warrants prompting the user + // Note: 302 (redirect) is *not* an error that warrants logging if (status != 302) { - LLSD args(LLSD::emptyMap()); - std::stringstream msg; - msg << status; - args["STATUS"] = msg.str(); - args["REASON"] = reason; - args["CODE"] = code; - args["DESCRIPTION"] = description; - LLNotificationsUtil::add("FacebookCannotConnect", args); + LL_WARNS("FacebookConnect") << request << " request failed with a " << status << " " << reason << ". Reason: " << code << "(" << description << ")" << LL_ENDL; } } @@ -113,8 +106,7 @@ public: else { LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_FAILED); - prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description")); - LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL; + log_facebook_connect_error("Connect", status, reason, content.get("error_code"), content.get("error_description")); } } @@ -147,8 +139,7 @@ public: } else { - prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description")); - LL_WARNS("FacebookConnect") << "Failed to get a post response. reason: " << reason << " status: " << status << LL_ENDL; + log_facebook_connect_error("Share", status, reason, content.get("error_code"), content.get("error_description")); } if (mShareCallback) @@ -188,8 +179,7 @@ public: } else { - prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description")); - LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL; + log_facebook_connect_error("Disconnect", status, reason, content.get("error_code"), content.get("error_description")); } } }; @@ -218,8 +208,6 @@ public: } else { - LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL; - // show the facebook login page if not connected yet if (status == 404) { @@ -235,7 +223,7 @@ public: else { LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_FAILED); - prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description")); + log_facebook_connect_error("Connected", status, reason, content.get("error_code"), content.get("error_description")); } } } @@ -261,8 +249,7 @@ public: } else { - prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description")); - LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL; + log_facebook_connect_error("Friends", status, reason, content.get("error_code"), content.get("error_description")); } } diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index c8911e47e8..1f20d3ab58 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -5439,17 +5439,6 @@ This day cycle file references a missing sky file: [SKY]. Sorry, the settings couldn't be applied to the region. Leaving the region and then returning may help rectify the problem. The reason given was: [FAIL_REASON]
- -Connection to Facebook failed. Reason: [STATUS] [REASON] ([CODE] - [DESCRIPTION]) - - - Date: Fri, 28 Jun 2013 16:18:08 -0400 Subject: move reading of the sim features to LLViewerRegion for consistency, a couple of minor cleanups --- indra/newview/llmaterialmgr.cpp | 23 ++--------------------- indra/newview/llmaterialmgr.h | 5 ----- indra/newview/llviewerregion.cpp | 12 ++++++++++++ indra/newview/llviewerregion.h | 1 + 4 files changed, 15 insertions(+), 26 deletions(-) diff --git a/indra/newview/llmaterialmgr.cpp b/indra/newview/llmaterialmgr.cpp index 96dd402d84..658fea944d 100644 --- a/indra/newview/llmaterialmgr.cpp +++ b/indra/newview/llmaterialmgr.cpp @@ -50,9 +50,7 @@ #define MATERIALS_CAP_MATERIAL_FIELD "Material" #define MATERIALS_CAP_OBJECT_ID_FIELD "ID" #define MATERIALS_CAP_MATERIAL_ID_FIELD "MaterialID" -#define SIM_FEATURE_MAX_MATERIALS_PER_TRANSACTION "MaxMaterialsPerTransaction" -#define MATERIALS_DEFAULT_MAX_ENTRIES 50 #define MATERIALS_GET_TIMEOUT (60.f * 20) #define MATERIALS_POST_TIMEOUT (60.f * 5) #define MATERIALS_PUT_THROTTLE_SECS 1.f @@ -592,7 +590,7 @@ void LLMaterialMgr::processGetQueue() LLSD materialsData = LLSD::emptyArray(); material_queue_t& materials = itRegionQueue->second; - U32 max_entries = getMaxEntries(regionp); + U32 max_entries = regionp->getMaxMaterialsPerTransaction(); material_queue_t::iterator loopMaterial = materials.begin(); while ( (materials.end() != loopMaterial) && (materialsData.size() < max_entries) ) { @@ -698,7 +696,7 @@ void LLMaterialMgr::processPutQueue() LLSD& facesData = requests[regionp]; facematerial_map_t& face_map = itQueue->second; - U32 max_entries = getMaxEntries(regionp); + U32 max_entries = regionp->getMaxMaterialsPerTransaction(); facematerial_map_t::iterator itFace = face_map.begin(); while ( (face_map.end() != itFace) && (facesData.size() < max_entries) ) { @@ -785,20 +783,3 @@ void LLMaterialMgr::onRegionRemoved(LLViewerRegion* regionp) // Put doesn't need clearing: objects that can't be found will clean up in processPutQueue() } -U32 LLMaterialMgr::getMaxEntries(const LLViewerRegion* regionp) -{ - LLSD sim_features; - regionp->getSimulatorFeatures(sim_features); - U32 max_entries; - if ( sim_features.has( SIM_FEATURE_MAX_MATERIALS_PER_TRANSACTION ) - && sim_features[ SIM_FEATURE_MAX_MATERIALS_PER_TRANSACTION ].isInteger()) - { - max_entries = sim_features[ SIM_FEATURE_MAX_MATERIALS_PER_TRANSACTION ].asInteger(); - } - else - { - max_entries = MATERIALS_DEFAULT_MAX_ENTRIES; - } - return max_entries; -} - diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h index 2836019c27..e317a791ad 100644 --- a/indra/newview/llmaterialmgr.h +++ b/indra/newview/llmaterialmgr.h @@ -124,11 +124,6 @@ protected: put_queue_t mPutQueue; material_map_t mMaterials; - - U32 getMaxEntries(const LLViewerRegion* regionp); - - LLFrameTimer mCapThrottleTimer; - F32 getThrottleIntervalSecs(const LLUUID& region_id); }; #endif // LL_LLMATERIALMGR_H diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 0f8decc643..b541a35111 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1976,3 +1976,15 @@ void LLViewerRegion::resetMaterialsCapThrottle() mMaterialsCapThrottleTimer.resetWithExpiry( 1.0f / requests_per_sec ); } +U32 LLViewerRegion::getMaxMaterialsPerTransaction() const +{ + U32 max_entries = 50; // original hard coded default + if ( mSimulatorFeatures.has( "MaxMaterialsPerTransaction" ) + && mSimulatorFeatures[ "MaxMaterialsPerTransaction" ].isInteger()) + { + max_entries = mSimulatorFeatures[ "MaxMaterialsPerTransaction" ].asInteger(); + } + return max_entries; +} + + diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index a3db7f5ac7..109baccf9a 100755 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -348,6 +348,7 @@ public: bool materialsCapThrottled() const { return !mMaterialsCapThrottleTimer.hasExpired(); } void resetMaterialsCapThrottle(); + U32 getMaxMaterialsPerTransaction() const; public: struct CompareDistance { -- cgit v1.2.3 From db5aba55b1d51f083dd61781c32c57c0b986909a Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 28 Jun 2013 13:48:44 -0700 Subject: ACME-638: Removed LLSocialList class and FBC Test tab in the People panel. --- indra/newview/CMakeLists.txt | 2 - indra/newview/llpanelpeople.cpp | 32 ----- indra/newview/llpanelpeople.h | 2 - indra/newview/llsociallist.cpp | 154 --------------------- indra/newview/llsociallist.h | 102 -------------- .../newview/skins/default/xui/en/panel_people.xml | 95 ------------- 6 files changed, 387 deletions(-) delete mode 100644 indra/newview/llsociallist.cpp delete mode 100644 indra/newview/llsociallist.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index a5ad2e4d4e..f593375aed 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -513,7 +513,6 @@ set(viewer_SOURCE_FILES llsky.cpp llslurl.cpp llsnapshotlivepreview.cpp - llsociallist.cpp llspatialpartition.cpp llspeakers.cpp llspeakingindicatormanager.cpp @@ -1092,7 +1091,6 @@ set(viewer_HEADER_FILES llsky.h llslurl.h llsnapshotlivepreview.h - llsociallist.h llspatialpartition.h llspeakers.h llspeakingindicatormanager.h diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 92391f0537..d3493373f6 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -72,7 +72,6 @@ #include "llviewermenu.h" // for gMenuHolder #include "llvoiceclient.h" #include "llworld.h" -#include "llsociallist.h" #include "llspeakers.h" #include "llfloaterwebcontent.h" @@ -87,7 +86,6 @@ static const std::string FRIENDS_TAB_NAME = "friends_panel"; static const std::string GROUP_TAB_NAME = "groups_panel"; static const std::string RECENT_TAB_NAME = "recent_panel"; static const std::string BLOCKED_TAB_NAME = "blocked_panel"; // blocked avatars -static const std::string FBCTEST_TAB_NAME = "fbctest_panel"; static const std::string FBCTESTTWO_TAB_NAME = "fbctesttwo_panel"; static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; @@ -528,7 +526,6 @@ LLPanelPeople::LLPanelPeople() mCommitCallbackRegistrar.add("People.loginFBC", boost::bind(&LLPanelPeople::onLoginFbcButtonClicked, this)); mCommitCallbackRegistrar.add("People.requestFBC", boost::bind(&LLPanelPeople::onFacebookAppRequestClicked, this)); mCommitCallbackRegistrar.add("People.sendFBC", boost::bind(&LLPanelPeople::onFacebookAppSendClicked, this)); - mCommitCallbackRegistrar.add("People.testaddFBC", boost::bind(&LLPanelPeople::onFacebookTestAddClicked, this)); mCommitCallbackRegistrar.add("People.testaddFBCFolderView", boost::bind(&LLPanelPeople::addTestParticipant, this)); mCommitCallbackRegistrar.add("People.AddFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this)); @@ -648,13 +645,6 @@ BOOL LLPanelPeople::postBuild() mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); mSuggestedFriends->setContextMenu(&LLPanelPeopleMenus::gSuggestedFriendsContextMenu); - //===Temporary ======================================================================== - - LLPanel * social_tab = getChild(FBCTEST_TAB_NAME); - mFacebookFriends = social_tab->getChild("facebook_friends"); - // Note: we use the same updater for both test lists (brute force but OK since it's temporary) - social_tab->setVisibleCallback(boost::bind(&LLPanelPeople::updateFacebookList, this, _2)); - //===Test START======================================================================== LLPanel * socialtwo_tab = getChild(FBCTESTTWO_TAB_NAME); @@ -1025,8 +1015,6 @@ LLUUID LLPanelPeople::getCurrentItemID() const if (cur_tab == BLOCKED_TAB_NAME) return LLUUID::null; // FIXME? - if (cur_tab == FBCTEST_TAB_NAME) - return LLUUID::null; if (cur_tab == FBCTESTTWO_TAB_NAME) return LLUUID::null; @@ -1054,8 +1042,6 @@ void LLPanelPeople::getCurrentItemIDs(uuid_vec_t& selected_uuids) const mGroupList->getSelectedUUIDs(selected_uuids); else if (cur_tab == BLOCKED_TAB_NAME) selected_uuids.clear(); // FIXME? - else if (cur_tab == FBCTEST_TAB_NAME) - return; else if (cur_tab == FBCTESTTWO_TAB_NAME) return; else @@ -1695,22 +1681,4 @@ void LLPanelPeople::onFacebookAppSendClicked() { } -static LLFastTimer::DeclareTimer FTM_AVATAR_LIST_TEST("avatar list test"); - -void LLPanelPeople::onFacebookTestAddClicked() -{ - LLFastTimer _(FTM_AVATAR_LIST_TEST); - - mFacebookFriends->clear(); - - LL_INFOS("LLPanelPeople") << "start adding 300 users" << LL_ENDL; - - for(int i = 0; i < 300; ++i) - { - mFacebookFriends->addNewItem(LLUUID(), "Test", false); - } - - LL_INFOS("LLPanelPeople") << "finished adding 300 users" << LL_ENDL; -} - // EOF diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 1cd2a05e91..cbfd74a2a0 100755 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -35,7 +35,6 @@ #include "llvoiceclient.h" class LLAvatarList; -class LLAvatarListSocial; class LLAvatarName; class LLFilterEditor; class LLGroupList; @@ -123,7 +122,6 @@ private: void onLoginFbcButtonClicked(); void onFacebookAppRequestClicked(); void onFacebookAppSendClicked(); - void onFacebookTestAddClicked(); bool onFriendsViewSortMenuItemCheck(const LLSD& userdata); bool onRecentViewSortMenuItemCheck(const LLSD& userdata); diff --git a/indra/newview/llsociallist.cpp b/indra/newview/llsociallist.cpp deleted file mode 100644 index 9f827cf04f..0000000000 --- a/indra/newview/llsociallist.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/** -* @file llsociallist.cpp -* @brief Implementation of llsociallist -* @author Gilbert@lindenlab.com -* -* $LicenseInfo:firstyear=2013&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2013, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ - - -#include "llviewerprecompiledheaders.h" - -#include "llsociallist.h" - -#include "llavataractions.h" -#include "llfloaterreg.h" -#include "llavatariconctrl.h" -#include "llavatarnamecache.h" -#include "lloutputmonitorctrl.h" -#include "lltextutil.h" - -static LLDefaultChildRegistry::Register r("social_list"); - -LLSocialList::LLSocialList(const Params&p) : LLFlatListViewEx(p) -{ - -} - -LLSocialList::~LLSocialList() -{ - -} - -void LLSocialList::draw() -{ - LLFlatListView::draw(); -} - -void LLSocialList::refresh() -{ - -} - -void LLSocialList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos) -{ - LLSocialListItem * item = new LLSocialListItem(); - LLAvatarName avatar_name; - bool has_avatar_name = id.notNull() && LLAvatarNameCache::get(id, &avatar_name); - - item->mAvatarId = id; - if(id.notNull()) - { - item->mIcon->setValue(id); - } - - item->setName(has_avatar_name ? name + " (" + avatar_name.getDisplayName() + ")" : name, mNameFilter); - addItem(item, id, pos); -} - -LLSocialListItem::LLSocialListItem() -{ - buildFromFile("panel_avatar_list_item.xml"); -} - -LLSocialListItem::~LLSocialListItem() -{ - -} - -BOOL LLSocialListItem::postBuild() -{ - mIcon = getChild("avatar_icon"); - mLabelTextBox = getChild("avatar_name"); - - mLastInteractionTime = getChild("last_interaction"); - mIconPermissionOnline = getChild("permission_online_icon"); - mIconPermissionMap = getChild("permission_map_icon"); - mIconPermissionEditMine = getChild("permission_edit_mine_icon"); - mIconPermissionEditTheirs = getChild("permission_edit_theirs_icon"); - mSpeakingIndicator = getChild("speaking_indicator"); - mInfoBtn = getChild("info_btn"); - mProfileBtn = getChild("profile_btn"); - - mLastInteractionTime->setVisible(false); - mIconPermissionOnline->setVisible(false); - mIconPermissionMap->setVisible(false); - mIconPermissionEditMine->setVisible(false); - mIconPermissionEditTheirs->setVisible(false); - mSpeakingIndicator->setVisible(false); - mInfoBtn->setVisible(false); - mProfileBtn->setVisible(false); - - mInfoBtn->setClickedCallback(boost::bind(&LLSocialListItem::onInfoBtnClick, this)); - mProfileBtn->setClickedCallback(boost::bind(&LLSocialListItem::onProfileBtnClick, this)); - - return TRUE; -} - -void LLSocialListItem::setName(const std::string& name, const std::string& highlight) -{ - mLabel = name; - LLTextUtil::textboxSetHighlightedVal(mLabelTextBox, mLabelTextBoxStyle, name, highlight); -} - -void LLSocialListItem::setValue(const LLSD& value) -{ - getChildView("selected_icon")->setVisible( value["selected"]); -} - -void LLSocialListItem::onMouseEnter(S32 x, S32 y, MASK mask) -{ - getChildView("hovered_icon")->setVisible( true); - mInfoBtn->setVisible(true); - mProfileBtn->setVisible(true); - - LLPanel::onMouseEnter(x, y, mask); -} - -void LLSocialListItem::onMouseLeave(S32 x, S32 y, MASK mask) -{ - getChildView("hovered_icon")->setVisible( false); - mInfoBtn->setVisible(false); - mProfileBtn->setVisible(false); - - LLPanel::onMouseLeave(x, y, mask); -} - -void LLSocialListItem::onInfoBtnClick() -{ - LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", mAvatarId)); -} - -void LLSocialListItem::onProfileBtnClick() -{ - LLAvatarActions::showProfile(mAvatarId); -} diff --git a/indra/newview/llsociallist.h b/indra/newview/llsociallist.h deleted file mode 100644 index bc667fc400..0000000000 --- a/indra/newview/llsociallist.h +++ /dev/null @@ -1,102 +0,0 @@ -/** -* @file llsociallist.h -* @brief Header file for llsociallist -* @author Gilbert@lindenlab.com -* -* $LicenseInfo:firstyear=2013&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2013, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ -#ifndef LL_LLSOCIALLIST_H -#define LL_LLSOCIALLIST_H - -#include "llflatlistview.h" -#include "llstyle.h" - - -/** - * Generic list of avatars. - * - * Updates itself when it's dirty, using optional name filter. - * To initiate update, modify the UUID list and call setDirty(). - * - * @see getIDs() - * @see setDirty() - * @see setNameFilter() - */ - -class LLAvatarIconCtrl; -class LLIconCtrl; -class LLOutputMonitorCtrl; - -class LLSocialList : public LLFlatListViewEx -{ -public: - - struct Params : public LLInitParam::Block - { - }; - - LLSocialList(const Params&p); - virtual ~LLSocialList(); - - virtual void draw(); - void refresh(); - void addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos = ADD_BOTTOM); - - - - std::string mNameFilter; -}; - -class LLSocialListItem : public LLPanel -{ - public: - LLSocialListItem(); - ~LLSocialListItem(); - - BOOL postBuild(); - void setName(const std::string& name, const std::string& highlight = LLStringUtil::null); - void setValue(const LLSD& value); - void onMouseEnter(S32 x, S32 y, MASK mask); - void onMouseLeave(S32 x, S32 y, MASK mask); - void onInfoBtnClick(); - void onProfileBtnClick(); - - LLUUID mAvatarId; - - LLTextBox * mLabelTextBox; - std::string mLabel; - LLStyle::Params mLabelTextBoxStyle; - - - LLAvatarIconCtrl * mIcon; - LLTextBox * mLastInteractionTime; - LLIconCtrl * mIconPermissionOnline; - LLIconCtrl * mIconPermissionMap; - LLIconCtrl * mIconPermissionEditMine; - LLIconCtrl * mIconPermissionEditTheirs; - LLOutputMonitorCtrl * mSpeakingIndicator; - LLButton * mInfoBtn; - LLButton * mProfileBtn; -}; - - -#endif // LL_LLSOCIALLIST_H diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 451095c7d8..76124148a0 100755 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -651,101 +651,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M right="-1" /> - - - - - - - - - - - - - - - Date: Fri, 28 Jun 2013 14:06:29 -0700 Subject: ACME-638: Removing non-used variable --- indra/newview/llpanelpeople.h | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index cbfd74a2a0..55c2c3cdae 100755 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -150,7 +150,6 @@ private: LLAvatarList* mNearbyList; LLAvatarList* mRecentList; LLGroupList* mGroupList; - LLSocialList* mFacebookFriends; S32 mFacebookListGeneration; LLNetMap* mMiniMap; -- cgit v1.2.3 From db8422f7841ab875c9dc636e10ae5993216d4a5b Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 28 Jun 2013 22:31:18 +0100 Subject: made sure photo preview is only generated when photo tab is visible for ACME-649 --- indra/newview/llfloatersocial.cpp | 48 ++++++++++++++++++++------------------- indra/newview/llfloatersocial.h | 1 - 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index d6c00b7c86..4660644969 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -246,20 +246,32 @@ LLSnapshotLivePreview* LLSocialPhotoPanel::getPreviewView() void LLSocialPhotoPanel::onVisibilityChange(const LLSD& new_visibility) { bool visible = new_visibility.asBoolean(); - if (visible && !mPreviewHandle.get()) + if (visible) { - LLRect full_screen_rect = getRootView()->getRect(); - LLSnapshotLivePreview::Params p; - p.rect(full_screen_rect); - LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p); - mPreviewHandle = previewp->getHandle(); - - previewp->setSnapshotType(previewp->SNAPSHOT_WEB); - previewp->setSnapshotFormat(LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG); - //previewp->setSnapshotQuality(98); - previewp->setThumbnailPlaceholderRect(mThumbnailPlaceholder->getRect()); - - updateControls(); + if (mPreviewHandle.get()) + { + LLSnapshotLivePreview* preview = getPreviewView(); + if(preview) + { + lldebugs << "opened, updating snapshot" << llendl; + preview->updateSnapshot(TRUE); + } + } + else + { + LLRect full_screen_rect = getRootView()->getRect(); + LLSnapshotLivePreview::Params p; + p.rect(full_screen_rect); + LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p); + mPreviewHandle = previewp->getHandle(); + + previewp->setSnapshotType(previewp->SNAPSHOT_WEB); + previewp->setSnapshotFormat(LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG); + //previewp->setSnapshotQuality(98); + previewp->setThumbnailPlaceholderRect(mThumbnailPlaceholder->getRect()); + + updateControls(); + } } } @@ -531,16 +543,6 @@ BOOL LLFloaterSocial::postBuild() return LLFloater::postBuild(); } -void LLFloaterSocial::onOpen(const LLSD& key) -{ - LLSnapshotLivePreview* preview = mSocialPhotoPanel->getPreviewView(); - if(preview) - { - lldebugs << "opened, updating snapshot" << llendl; - preview->updateSnapshot(TRUE); - } -} - // static void LLFloaterSocial::preUpdate() { diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index 95ba688430..89b9e2016a 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -110,7 +110,6 @@ public: LLFloaterSocial(const LLSD& key); BOOL postBuild(); void onCancel(); - void onOpen(const LLSD& key); static void preUpdate(); static void postUpdate(); -- cgit v1.2.3 From 1c7a7fe2d1c3f9399a6248551b7b2a8a7e68afdd Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 28 Jun 2013 23:08:03 +0100 Subject: removed FB photo sharing from snapshot floater for ACME-639 --- indra/newview/CMakeLists.txt | 1 - indra/newview/llpanelsnapshotfacebook.cpp | 139 -------------- indra/newview/llpanelsnapshotoptions.cpp | 7 - .../skins/default/xui/en/floater_snapshot.xml | 6 - .../default/xui/en/panel_snapshot_facebook.xml | 199 --------------------- .../default/xui/en/panel_snapshot_options.xml | 19 -- 6 files changed, 371 deletions(-) delete mode 100755 indra/newview/llpanelsnapshotfacebook.cpp delete mode 100755 indra/newview/skins/default/xui/en/panel_snapshot_facebook.xml diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f593375aed..3d6d315454 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -438,7 +438,6 @@ set(viewer_SOURCE_FILES llpanelprimmediacontrols.cpp llpanelprofile.cpp llpanelsnapshot.cpp - llpanelsnapshotfacebook.cpp llpanelsnapshotinventory.cpp llpanelsnapshotlocal.cpp llpanelsnapshotoptions.cpp diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp deleted file mode 100755 index 94fbb986c0..0000000000 --- a/indra/newview/llpanelsnapshotfacebook.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/** - * @file llpanelsnapshotfacebook.cpp - * @brief Posts a snapshot to the resident Facebook account. - * - * $LicenseInfo:firstyear=2013&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2013, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -// libs -#include "llcombobox.h" -#include "llfloaterreg.h" -#include "llpanel.h" -#include "llspinctrl.h" - -// newview -#include "llfloatersnapshot.h" -#include "llpanelsnapshot.h" -#include "llsidetraypanelcontainer.h" -#include "llwebprofile.h" - -#include "llfacebookconnect.h" -#include "llslurl.h" -#include "llagentui.h" - -/** - * Posts a snapshot to the resident Facebook account. - */ -class LLPanelSnapshotFacebook -: public LLPanelSnapshot -{ - LOG_CLASS(LLPanelSnapshotFacebook); - -public: - LLPanelSnapshotFacebook(); - - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& key); - -private: - /*virtual*/ void updateCustomResControls(); ///< Show/hide facebook custom controls - /*virtual*/ std::string getWidthSpinnerName() const { return "facebook_snapshot_width"; } - /*virtual*/ std::string getHeightSpinnerName() const { return "facebook_snapshot_height"; } - /*virtual*/ std::string getAspectRatioCBName() const { return "facebook_keep_aspect_check"; } - /*virtual*/ std::string getImageSizeComboName() const { return "facebook_size_combo"; } - /*virtual*/ std::string getImageSizePanelName() const { return "facebook_image_size_lp"; } - /*virtual*/ LLFloaterSnapshot::ESnapshotFormat getImageFormat() const { return LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG; } - /*virtual*/ void updateControls(const LLSD& info); - - void onSend(); - void onImageUploaded(const std::string& caption, const std::string& image_url); -}; - -static LLRegisterPanelClassWrapper panel_class("llpanelsnapshotfacebook"); - -LLPanelSnapshotFacebook::LLPanelSnapshotFacebook() -{ - mCommitCallbackRegistrar.add("PostToFacebook.Send", boost::bind(&LLPanelSnapshotFacebook::onSend, this)); - mCommitCallbackRegistrar.add("PostToFacebook.Cancel", boost::bind(&LLPanelSnapshotFacebook::cancel, this)); -} - -// virtual -BOOL LLPanelSnapshotFacebook::postBuild() -{ - return LLPanelSnapshot::postBuild(); -} - -// virtual -void LLPanelSnapshotFacebook::onOpen(const LLSD& key) -{ - if (!LLFacebookConnect::instance().isConnected()) - { - LLFacebookConnect::instance().getConnectionToFacebook(true); - } - updateControls(key); - LLPanelSnapshot::onOpen(key); -} - -// virtual -void LLPanelSnapshotFacebook::updateControls(const LLSD& info) -{ - const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true; - const bool is_connected = LLFacebookConnect::instance().isConnected(); - getChild("post_btn")->setEnabled(have_snapshot && is_connected); -} - -// virtual -void LLPanelSnapshotFacebook::updateCustomResControls() -{ - LLPanelSnapshot::updateCustomResControls(); - const bool is_connected = LLFacebookConnect::instance().isConnected(); - getChild("post_btn")->setEnabled(is_connected); -} - -void LLPanelSnapshotFacebook::onSend() -{ - std::string caption = getChild("caption")->getValue().asString(); - bool add_location = getChild("add_location_cb")->getValue().asBoolean(); - - if (add_location) - { - LLSLURL slurl; - LLAgentUI::buildSLURL(slurl); - if (caption.empty()) - caption = slurl.getSLURLString(); - else - caption = caption + " " + slurl.getSLURLString(); - } - LLFacebookConnect::instance().sharePhoto(LLFloaterSnapshot::getImageData(), caption); - //LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location, boost::bind(&LLPanelSnapshotFacebook::onImageUploaded, this, caption, _1)); - LLFloaterSnapshot::postSave(); -} - -void LLPanelSnapshotFacebook::onImageUploaded(const std::string& caption, const std::string& image_url) -{ - if (!image_url.empty()) - { - LLFacebookConnect::instance().sharePhoto(image_url, caption); - } -} diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp index 14953f3cf9..554fabe5b3 100755 --- a/indra/newview/llpanelsnapshotoptions.cpp +++ b/indra/newview/llpanelsnapshotoptions.cpp @@ -51,7 +51,6 @@ private: void updateUploadCost(); void openPanel(const std::string& panel_name); void onSaveToProfile(); - void onSaveToFacebook(); void onSaveToEmail(); void onSaveToInventory(); void onSaveToComputer(); @@ -61,7 +60,6 @@ static LLRegisterPanelClassWrapper panel_class("llpanels LLPanelSnapshotOptions::LLPanelSnapshotOptions() { - mCommitCallbackRegistrar.add("Snapshot.SaveToFacebook", boost::bind(&LLPanelSnapshotOptions::onSaveToFacebook, this)); mCommitCallbackRegistrar.add("Snapshot.SaveToProfile", boost::bind(&LLPanelSnapshotOptions::onSaveToProfile, this)); mCommitCallbackRegistrar.add("Snapshot.SaveToEmail", boost::bind(&LLPanelSnapshotOptions::onSaveToEmail, this)); mCommitCallbackRegistrar.add("Snapshot.SaveToInventory", boost::bind(&LLPanelSnapshotOptions::onSaveToInventory, this)); @@ -101,11 +99,6 @@ void LLPanelSnapshotOptions::openPanel(const std::string& panel_name) LLFloaterSnapshot::postPanelSwitch(); } -void LLPanelSnapshotOptions::onSaveToFacebook() -{ - openPanel("panel_snapshot_facebook"); -} - void LLPanelSnapshotOptions::onSaveToProfile() { openPanel("panel_snapshot_profile"); diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml index e8e7fb77c1..853c209bca 100755 --- a/indra/newview/skins/default/xui/en/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml @@ -268,12 +268,6 @@ left="0" name="panel_snapshot_options" top="0" /> - - - - - Post to my Facebook timeline - - - - - - - - - - - - - - - - - - Caption: - - - - - - - - - diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml index 8cf5bfb426..61c8c971c2 100755 --- a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml @@ -5,25 +5,6 @@ layout="topleft" name="panel_snapshot_options" width="490"> - - - - - - -- cgit v1.2.3 From 3325c8ecb3eec0a126ef4b7be338ed5a2f8a8ee8 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 28 Jun 2013 17:15:55 -0700 Subject: ACME-629: Posting a photo to facebook works again. The post button callback was not being called due to a name change. --- indra/newview/skins/default/xui/en/panel_social_photo.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/panel_social_photo.xml b/indra/newview/skins/default/xui/en/panel_social_photo.xml index e6742b0ea7..fc86349235 100644 --- a/indra/newview/skins/default/xui/en/panel_social_photo.xml +++ b/indra/newview/skins/default/xui/en/panel_social_photo.xml @@ -236,7 +236,7 @@ name="post_btn" width="100"> + function="SocialSharing.SendPhoto" /> - + + + \ No newline at end of file -- cgit v1.2.3 From 1dbabed6b5bac8a0fcc1d9a70522eb726e01bae7 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 3 Jul 2013 23:42:02 +0100 Subject: made listeners more robust in llfloatersocial.cpp for ACME-665 --- indra/newview/llfloatersocial.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 57b6cccd32..67a9f0c742 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -103,6 +103,7 @@ void LLSocialStatusPanel::onSend() } else { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialStatusPanel"); // just in case it is already listening LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialStatusPanel", boost::bind(&LLSocialStatusPanel::onFacebookConnectStateChange, this, _1)); LLFacebookConnect::instance().checkConnectionToFacebook(true); } @@ -310,6 +311,7 @@ void LLSocialPhotoPanel::onSend() } else { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialPhotoPanel"); // just in case it is already listening LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialPhotoPanel", boost::bind(&LLSocialPhotoPanel::onFacebookConnectStateChange, this, _1)); LLFacebookConnect::instance().checkConnectionToFacebook(true); } @@ -535,6 +537,7 @@ void LLSocialCheckinPanel::onSend() } else { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel"); // just in case it is already listening LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialCheckinPanel", boost::bind(&LLSocialCheckinPanel::onFacebookConnectStateChange, this, _1)); LLFacebookConnect::instance().checkConnectionToFacebook(true); } -- cgit v1.2.3 From ad8aeecb8331ca68eef9a12536c80a4658885ccb Mon Sep 17 00:00:00 2001 From: Cho Date: Thu, 4 Jul 2013 01:29:54 +0100 Subject: Added auto-connect upon 404 from a POST in LLFacebookConnect, and added FB_POSTED state, for ACME-667 --- indra/newview/llfacebookconnect.cpp | 6 ++++- indra/newview/llfacebookconnect.h | 5 ++-- indra/newview/llfloatersocial.cpp | 51 ++++++++++++++++++++++++------------- 3 files changed, 41 insertions(+), 21 deletions(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 30fb63084b..07204531de 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -145,7 +145,11 @@ public: toast_user_for_success(); LL_DEBUGS("FacebookConnect") << "Post successful. content: " << content << LL_ENDL; - LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED); + LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_POSTED); + } + else if (status == 404) + { + LLFacebookConnect::instance().connectToFacebook(); } else { diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index ddff87385e..b37c713ae5 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -50,7 +50,8 @@ public: FB_CONNECTED = 2, FB_CONNECTION_FAILED = 3, FB_POSTING = 4, - FB_POST_FAILED = 5 + FB_POSTED = 5, + FB_POST_FAILED = 6 }; typedef boost::function share_callback_t; @@ -76,7 +77,7 @@ public: const LLSD& getContent() const; void setConnectionState(EConnectionState connection_state); - bool isConnected() { return ((mConnectionState == FB_CONNECTED) || (mConnectionState == FB_POSTING)); } + bool isConnected() { return ((mConnectionState == FB_CONNECTED) || (mConnectionState == FB_POSTING) || (mConnectionState == FB_POSTED)); } EConnectionState getConnectionState() { return mConnectionState; } S32 generation() { return mGeneration; } diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 67a9f0c742..eb3ceaf96e 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -96,6 +96,9 @@ void LLSocialStatusPanel::draw() void LLSocialStatusPanel::onSend() { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialStatusPanel"); // just in case it is already listening + LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialStatusPanel", boost::bind(&LLSocialStatusPanel::onFacebookConnectStateChange, this, _1)); + // Connect to Facebook if necessary and then post if (LLFacebookConnect::instance().isConnected()) { @@ -103,19 +106,21 @@ void LLSocialStatusPanel::onSend() } else { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialStatusPanel"); // just in case it is already listening - LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialStatusPanel", boost::bind(&LLSocialStatusPanel::onFacebookConnectStateChange, this, _1)); LLFacebookConnect::instance().checkConnectionToFacebook(true); } } bool LLSocialStatusPanel::onFacebookConnectStateChange(const LLSD& data) { - if (data.get("enum").asInteger() == LLFacebookConnect::FB_CONNECTED) + switch (data.get("enum").asInteger()) { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialStatusPanel"); - - sendStatus(); + case LLFacebookConnect::FB_CONNECTED: + sendStatus(); + break; + + case LLFacebookConnect::FB_POSTED: + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialStatusPanel"); + break; } return false; @@ -304,6 +309,9 @@ void LLSocialPhotoPanel::onClickNewSnapshot() void LLSocialPhotoPanel::onSend() { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialPhotoPanel"); // just in case it is already listening + LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialPhotoPanel", boost::bind(&LLSocialPhotoPanel::onFacebookConnectStateChange, this, _1)); + // Connect to Facebook if necessary and then post if (LLFacebookConnect::instance().isConnected()) { @@ -311,19 +319,21 @@ void LLSocialPhotoPanel::onSend() } else { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialPhotoPanel"); // just in case it is already listening - LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialPhotoPanel", boost::bind(&LLSocialPhotoPanel::onFacebookConnectStateChange, this, _1)); LLFacebookConnect::instance().checkConnectionToFacebook(true); } } bool LLSocialPhotoPanel::onFacebookConnectStateChange(const LLSD& data) { - if (data.get("enum").asInteger() == LLFacebookConnect::FB_CONNECTED) + switch (data.get("enum").asInteger()) { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialPhotoPanel"); - - sendPhoto(); + case LLFacebookConnect::FB_CONNECTED: + sendPhoto(); + break; + + case LLFacebookConnect::FB_POSTED: + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialPhotoPanel"); + break; } return false; @@ -530,6 +540,9 @@ void LLSocialCheckinPanel::draw() void LLSocialCheckinPanel::onSend() { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel"); // just in case it is already listening + LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialCheckinPanel", boost::bind(&LLSocialCheckinPanel::onFacebookConnectStateChange, this, _1)); + // Connect to Facebook if necessary and then post if (LLFacebookConnect::instance().isConnected()) { @@ -537,19 +550,21 @@ void LLSocialCheckinPanel::onSend() } else { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel"); // just in case it is already listening - LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialCheckinPanel", boost::bind(&LLSocialCheckinPanel::onFacebookConnectStateChange, this, _1)); LLFacebookConnect::instance().checkConnectionToFacebook(true); } } bool LLSocialCheckinPanel::onFacebookConnectStateChange(const LLSD& data) { - if (data.get("enum").asInteger() == LLFacebookConnect::FB_CONNECTED) + switch (data.get("enum").asInteger()) { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel"); - - sendCheckin(); + case LLFacebookConnect::FB_CONNECTED: + sendCheckin(); + break; + + case LLFacebookConnect::FB_POSTED: + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel"); + break; } return false; -- cgit v1.2.3 From fd4262541946770515ce8a486dd3a69245365def Mon Sep 17 00:00:00 2001 From: Cho Date: Thu, 4 Jul 2013 02:01:51 +0100 Subject: Close floater and clear text upon FB_POSTED for ACME-668 --- indra/newview/llfloatersocial.cpp | 38 ++++++++++++++++++++++++++++++++++++++ indra/newview/llfloatersocial.h | 3 +++ 2 files changed, 41 insertions(+) diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index eb3ceaf96e..2ecadcfaf6 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -120,6 +120,7 @@ bool LLSocialStatusPanel::onFacebookConnectStateChange(const LLSD& data) case LLFacebookConnect::FB_POSTED: LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialStatusPanel"); + clearAndClose(); break; } @@ -135,6 +136,17 @@ void LLSocialStatusPanel::sendStatus() } } +void LLSocialStatusPanel::clearAndClose() +{ + mMessageTextEditor->setValue(""); + + LLFloater* floater = getParentByType(); + if (floater) + { + floater->closeFloater(); + } +} + /////////////////////////// //LLSocialPhotoPanel/////// /////////////////////////// @@ -333,6 +345,7 @@ bool LLSocialPhotoPanel::onFacebookConnectStateChange(const LLSD& data) case LLFacebookConnect::FB_POSTED: LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialPhotoPanel"); + clearAndClose(); break; } @@ -365,6 +378,17 @@ void LLSocialPhotoPanel::sendPhoto() updateControls(); } +void LLSocialPhotoPanel::clearAndClose() +{ + mCaptionTextBox->setValue(""); + + LLFloater* floater = getParentByType(); + if (floater) + { + floater->closeFloater(); + } +} + void LLSocialPhotoPanel::updateControls() { LLSnapshotLivePreview* previewp = getPreviewView(); @@ -564,6 +588,7 @@ bool LLSocialCheckinPanel::onFacebookConnectStateChange(const LLSD& data) case LLFacebookConnect::FB_POSTED: LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel"); + clearAndClose(); break; } @@ -595,6 +620,17 @@ void LLSocialCheckinPanel::sendCheckin() LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, map_url, caption); } +void LLSocialCheckinPanel::clearAndClose() +{ + getChild("place_caption")->setValue(""); + + LLFloater* floater = getParentByType(); + if (floater) + { + floater->closeFloater(); + } +} + //////////////////////// //LLFloaterSocial/////// //////////////////////// @@ -680,6 +716,8 @@ void LLFloaterSocial::draw() mStatusLoadingIndicator->setVisible(true); break; case LLFacebookConnect::FB_CONNECTED: + break; + case LLFacebookConnect::FB_POSTED: break; case LLFacebookConnect::FB_CONNECTION_FAILED: case LLFacebookConnect::FB_POST_FAILED: diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index e37facbbce..5e1ee6be0e 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -45,6 +45,7 @@ public: bool onFacebookConnectStateChange(const LLSD& data); void sendStatus(); + void clearAndClose(); private: LLUICtrl* mMessageTextEditor; @@ -67,6 +68,7 @@ public: bool onFacebookConnectStateChange(const LLSD& data); void sendPhoto(); + void clearAndClose(); void updateControls(); void updateResolution(BOOL do_update); @@ -101,6 +103,7 @@ public: bool onFacebookConnectStateChange(const LLSD& data); void sendCheckin(); + void clearAndClose(); private: std::string mMapUrl; -- cgit v1.2.3 From 85824ebc0931d4ac89e375b35dbccd1295746e31 Mon Sep 17 00:00:00 2001 From: Cho Date: Thu, 4 Jul 2013 02:13:47 +0100 Subject: Removed share callbacks from LLFacebookConnect --- indra/newview/llfacebookconnect.cpp | 19 +++---------------- indra/newview/llfacebookconnect.h | 7 ------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 07204531de..816947827c 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -133,11 +133,6 @@ public: LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_POSTING); } - LLFacebookShareResponder(LLFacebookConnect::share_callback_t cb) : mShareCallback(cb) - { - LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_POSTING); - } - virtual void completed(U32 status, const std::string& reason, const LLSD& content) { if (isGoodStatus(status)) @@ -156,11 +151,6 @@ public: LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_POST_FAILED); log_facebook_connect_error("Share", status, reason, content.get("error_code"), content.get("error_description")); } - - if (mShareCallback) - { - mShareCallback(isGoodStatus(status)); - } } void completedHeader(U32 status, const std::string& reason, const LLSD& content) @@ -170,9 +160,6 @@ public: LLFacebookConnect::instance().openFacebookWeb(content["location"]); } } - -private: - LLFacebookConnect::share_callback_t mShareCallback; }; /////////////////////////////////////////////////////////////////////////////// @@ -346,7 +333,7 @@ void LLFacebookConnect::postCheckin(const std::string& location, const std::stri body["message"] = message; // Note: we can use that route for different publish action. We should be able to use the same responder. - LLHTTPClient::post(getFacebookConnectURL("/share/checkin"), body, new LLFacebookShareResponder(mPostCheckinCallback)); + LLHTTPClient::post(getFacebookConnectURL("/share/checkin"), body, new LLFacebookShareResponder()); } void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::string& caption) @@ -409,7 +396,7 @@ void LLFacebookConnect::sharePhoto(LLPointer image, const std: memcpy(data, body.str().data(), size); // Note: we can use that route for different publish action. We should be able to use the same responder. - LLHTTPClient::postRaw(getFacebookConnectURL("/share/photo"), data, size, new LLFacebookShareResponder(mSharePhotoCallback), headers); + LLHTTPClient::postRaw(getFacebookConnectURL("/share/photo"), data, size, new LLFacebookShareResponder(), headers); } void LLFacebookConnect::updateStatus(const std::string& message) @@ -418,7 +405,7 @@ void LLFacebookConnect::updateStatus(const std::string& message) body["message"] = message; // Note: we can use that route for different publish action. We should be able to use the same responder. - LLHTTPClient::post(getFacebookConnectURL("/share/wall"), body, new LLFacebookShareResponder(mUpdateStatusCallback)); + LLHTTPClient::post(getFacebookConnectURL("/share/wall"), body, new LLFacebookShareResponder()); } void LLFacebookConnect::storeContent(const LLSD& content) diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index b37c713ae5..a06e53b90e 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -54,7 +54,6 @@ public: FB_POST_FAILED = 6 }; - typedef boost::function share_callback_t; typedef boost::function content_updated_callback_t; void connectToFacebook(const std::string& auth_code = ""); // Initiate the complete FB connection. Please use checkConnectionToFacebook() in normal use. @@ -67,9 +66,6 @@ public: void sharePhoto(LLPointer image, const std::string& caption); void updateStatus(const std::string& message); - void setPostCheckinCallback(share_callback_t cb) { mPostCheckinCallback = cb; } - void setSharePhotoCallback(share_callback_t cb) { mSharePhotoCallback = cb; } - void setUpdateStatusCallback(share_callback_t cb) { mUpdateStatusCallback = cb; } void setContentUpdatedCallback(content_updated_callback_t cb) { mContentUpdatedCallback = cb;} void clearContent(); @@ -94,9 +90,6 @@ private: LLSD mContent; S32 mGeneration; - share_callback_t mPostCheckinCallback; - share_callback_t mSharePhotoCallback; - share_callback_t mUpdateStatusCallback; content_updated_callback_t mContentUpdatedCallback; static boost::scoped_ptr sStateWatcher; -- cgit v1.2.3 From f7a1f7b784fff0579e4d1fecd8265d0f960bd7f4 Mon Sep 17 00:00:00 2001 From: Cho Date: Thu, 4 Jul 2013 02:43:09 +0100 Subject: Replaced content change callback with an event in LLFacebookConnect for ACME-648 (more or less) --- indra/newview/llfacebookconnect.cpp | 15 ++------------- indra/newview/llfacebookconnect.h | 7 +------ indra/newview/llpanelpeople.cpp | 10 +++++++--- indra/newview/llpanelpeople.h | 2 +- 4 files changed, 11 insertions(+), 23 deletions(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 816947827c..30ebedca25 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -41,6 +41,7 @@ #include "llevents.h" boost::scoped_ptr LLFacebookConnect::sStateWatcher(new LLEventStream("FacebookConnectState")); +boost::scoped_ptr LLFacebookConnect::sContentWatcher(new LLEventStream("FacebookConnectContent")); // Local functions void log_facebook_connect_error(const std::string& request, U32 status, const std::string& reason, const std::string& code, const std::string& description) @@ -413,10 +414,7 @@ void LLFacebookConnect::storeContent(const LLSD& content) mGeneration++; mContent = content; - if(mContentUpdatedCallback) - { - mContentUpdatedCallback(); - } + sContentWatcher->post(content); } const LLSD& LLFacebookConnect::getContent() const @@ -441,12 +439,3 @@ void LLFacebookConnect::setConnectionState(LLFacebookConnect::EConnectionState c mConnectionState = connection_state; } - - - - - - - - - diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index a06e53b90e..7b6eb3644f 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -54,8 +54,6 @@ public: FB_POST_FAILED = 6 }; - typedef boost::function content_updated_callback_t; - void connectToFacebook(const std::string& auth_code = ""); // Initiate the complete FB connection. Please use checkConnectionToFacebook() in normal use. void disconnectFromFacebook(); // Disconnect from the FBC service. void checkConnectionToFacebook(bool auto_connect = false); // Check if an access token is available on the FBC service. If not, call connectToFacebook(). @@ -66,8 +64,6 @@ public: void sharePhoto(LLPointer image, const std::string& caption); void updateStatus(const std::string& message); - void setContentUpdatedCallback(content_updated_callback_t cb) { mContentUpdatedCallback = cb;} - void clearContent(); void storeContent(const LLSD& content); const LLSD& getContent() const; @@ -90,9 +86,8 @@ private: LLSD mContent; S32 mGeneration; - content_updated_callback_t mContentUpdatedCallback; - static boost::scoped_ptr sStateWatcher; + static boost::scoped_ptr sContentWatcher; }; #endif // LL_LLFACEBOOKCONNECT_H diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 8c8cad0743..766335c982 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -781,7 +781,7 @@ void LLPanelPeople::updateFriendList() showFriendsAccordionsIfNeeded(); } -void LLPanelPeople::updateSuggestedFriendList() +bool LLPanelPeople::updateSuggestedFriendList() { if (LLFacebookConnect::instance().generation() != mFacebookListGeneration) { @@ -814,6 +814,8 @@ void LLPanelPeople::updateSuggestedFriendList() mSuggestedFriends->setDirty(true, !mSuggestedFriends->filterHasMatches()); showFriendsAccordionsIfNeeded(); } + + return false; } void LLPanelPeople::updateNearbyList() @@ -855,7 +857,8 @@ void LLPanelPeople::updateFacebookList(bool visible) { if (visible) { - LLFacebookConnect::instance().setContentUpdatedCallback(boost::bind(&LLPanelPeople::updateSuggestedFriendList, this)); + LLEventPumps::instance().obtain("FacebookConnectContent").stopListening("LLPanelPeople"); // just in case it is already listening + LLEventPumps::instance().obtain("FacebookConnectContent").listen("LLPanelPeople", boost::bind(&LLPanelPeople::updateSuggestedFriendList, this)); if (mTryToConnectToFbc) { @@ -866,6 +869,7 @@ void LLPanelPeople::updateFacebookList(bool visible) } else { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLPanelPeople"); // just in case it is already listening LLEventPumps::instance().obtain("FacebookConnectState").listen("LLPanelPeople", boost::bind(&LLPanelPeople::onConnectedToFacebook, this, _1)); LLFacebookConnect::instance().checkConnectionToFacebook(); } @@ -878,7 +882,7 @@ void LLPanelPeople::updateFacebookList(bool visible) } else { - LLFacebookConnect::instance().setContentUpdatedCallback(NULL); + LLEventPumps::instance().obtain("FacebookConnectContent").stopListening("LLPanelPeople"); } } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index c6ee7b8165..b746835dfb 100755 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -76,7 +76,7 @@ private: // methods indirectly called by the updaters void updateFriendListHelpText(); void updateFriendList(); - void updateSuggestedFriendList(); + bool updateSuggestedFriendList(); void updateNearbyList(); void updateRecentList(); void updateFacebookList(bool visible); -- cgit v1.2.3 From 6e8b353575f670e50267cb172860a3f8da1dbbd0 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 3 Jul 2013 19:29:42 -0700 Subject: ACME-626 : Simplify the preview drawing code and positioning --- indra/newview/llfloatersocial.cpp | 53 ++-------------------- .../skins/default/xui/en/floater_social.xml | 3 -- .../skins/default/xui/en/panel_social_photo.xml | 53 +++++++++------------- 3 files changed, 27 insertions(+), 82 deletions(-) diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index a0dbb7ea95..fce9d1b28f 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -178,76 +178,33 @@ void LLSocialPhotoPanel::draw() { LLSnapshotLivePreview * previewp = static_cast(mPreviewHandle.get()); - LLPanel::draw(); - - if(previewp && previewp->getThumbnailImage()) + if (previewp && previewp->getThumbnailImage()) { - bool working = false; //impl.getStatus() == Impl::STATUS_WORKING; const LLRect& thumbnail_rect = mThumbnailPlaceholder->getRect(); + const LLRect& snapshot_rect = mSnapshotPanel->getRect(); const S32 thumbnail_w = previewp->getThumbnailWidth(); const S32 thumbnail_h = previewp->getThumbnailHeight(); // calc preview offset within the preview rect const S32 local_offset_x = (thumbnail_rect.getWidth() - thumbnail_w) / 2 ; - const S32 local_offset_y = (thumbnail_rect.getHeight() - thumbnail_h) / 2 ; // preview y pos within the preview rect // calc preview offset within the floater rect S32 offset_x = thumbnail_rect.mLeft + local_offset_x; - S32 offset_y = thumbnail_rect.mBottom + local_offset_y; + S32 offset_y = thumbnail_rect.mBottom - (snapshot_rect.mTop - thumbnail_rect.mTop); mSnapshotPanel->localPointToOtherView(offset_x, offset_y, &offset_x, &offset_y, getParentByType()); gGL.matrixMode(LLRender::MM_MODELVIEW); // Apply floater transparency to the texture unless the floater is focused. F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency(); - LLColor4 color = working ? LLColor4::grey4 : LLColor4::white; + LLColor4 color = LLColor4::white; gl_draw_scaled_image(offset_x, offset_y, thumbnail_w, thumbnail_h, previewp->getThumbnailImage(), color % alpha); previewp->drawPreviewRect(offset_x, offset_y) ; - - // Draw some controls on top of the preview thumbnail. - static const S32 PADDING = 5; - static const S32 REFRESH_LBL_BG_HEIGHT = 32; - - // Reshape and position the posting result message panels at the top of the thumbnail. - // Do this regardless of current posting status (finished or not) to avoid flicker - // when the result message is displayed for the first time. - // if (impl.getStatus() == Impl::STATUS_FINISHED) - { - LLRect result_lbl_rect = mSucceessLblPanel->getRect(); - const S32 result_lbl_h = result_lbl_rect.getHeight(); - result_lbl_rect.setLeftTopAndSize(local_offset_x, local_offset_y + thumbnail_h, thumbnail_w - 1, result_lbl_h); - mSucceessLblPanel->reshape(result_lbl_rect.getWidth(), result_lbl_h); - mSucceessLblPanel->setRect(result_lbl_rect); - mFailureLblPanel->reshape(result_lbl_rect.getWidth(), result_lbl_h); - mFailureLblPanel->setRect(result_lbl_rect); - } - - // Position the refresh button in the bottom left corner of the thumbnail. - mRefreshBtn->setOrigin(local_offset_x + PADDING, local_offset_y + PADDING); - - if (mNeedRefresh) - { - // Place the refresh hint text to the right of the refresh button. - const LLRect& refresh_btn_rect = mRefreshBtn->getRect(); - mRefreshLabel->setOrigin(refresh_btn_rect.mLeft + refresh_btn_rect.getWidth() + PADDING, refresh_btn_rect.mBottom); - - // Draw the refresh hint background. - LLRect refresh_label_bg_rect(offset_x, offset_y + REFRESH_LBL_BG_HEIGHT, offset_x + thumbnail_w - 1, offset_y); - gl_rect_2d(refresh_label_bg_rect, LLColor4::white % 0.9f, TRUE); - } - - gGL.pushUIMatrix(); - S32 x_pos; - S32 y_pos; - mSnapshotPanel->localPointToOtherView(thumbnail_rect.mLeft, thumbnail_rect.mBottom, &x_pos, &y_pos, getParentByType()); - - LLUI::translate((F32) x_pos, (F32) y_pos); - mThumbnailPlaceholder->draw(); - gGL.popUIMatrix(); } + LLPanel::draw(); } LLSnapshotLivePreview* LLSocialPhotoPanel::getPreviewView() diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml index 3ce6841a3a..40800c87e6 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -36,9 +36,6 @@ filename="panel_social_photo.xml" class="llsocialphotopanel" follows="all" - background_visible="true" - bg_alpha_color="DkGray" - bg_opaque_color="DkGray" label="PHOTO" help_topic="panel_social_photo" name="panel_social_photo"/> diff --git a/indra/newview/skins/default/xui/en/panel_social_photo.xml b/indra/newview/skins/default/xui/en/panel_social_photo.xml index c15b2f02d4..72e5286fe6 100644 --- a/indra/newview/skins/default/xui/en/panel_social_photo.xml +++ b/indra/newview/skins/default/xui/en/panel_social_photo.xml @@ -1,15 +1,15 @@ [SIZE] KB
- + width="24" /> + visible="false"> Working + + Refreshing... + Comment (optional): @@ -114,9 +118,9 @@ initial_value="true" label="Include location in posting" name="add_location_cb" - left="6" + left="9" height="16" - top_pad="5"/> + top_pad="8"/> + height="181"> Say something about where you are: + height="186"> + + + height="367"> What's on your mind? Date: Mon, 15 Jul 2013 08:40:17 -0700 Subject: NORSPEC-291 WIP materials working underwater and in reflection and dis passes, not gamma correct, needs cleanup --- indra/newview/pipeline.cpp | 75 +++++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 34 deletions(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 4e1eb4d8ad..e5ea7d0381 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -124,7 +124,7 @@ // Expensive and currently broken... // -#define MATERIALS_IN_REFLECTIONS 0 +#define MATERIALS_IN_REFLECTIONS 1 bool gShiftFrame = false; @@ -1239,8 +1239,23 @@ void LLPipeline::createGLBuffers() if (LLPipeline::sWaterReflections) { //water reflection texture U32 res = (U32) llmax(gSavedSettings.getS32("RenderWaterRefResolution"), 512); - - mWaterRef.allocate(res,res,GL_RGBA,TRUE,FALSE); + +#if MATERIALS_IN_REFLECTIONS + if (LLPipeline::sRenderDeferred) + { + mWaterRef.allocate(res,res,GL_SRGB8_ALPHA8,TRUE,FALSE); + } + else +#endif + mWaterRef.allocate(res,res,GL_RGBA,TRUE,FALSE); + +#if MATERIALS_IN_REFLECTIONS + if (LLPipeline::sRenderDeferred) + { + mWaterDis.allocate(res,res,GL_SRGB8_ALPHA8,TRUE,FALSE,LLTexUnit::TT_TEXTURE, true); + } + else +#endif //always use FBO for mWaterDis so it can be used for avatar texture bakes mWaterDis.allocate(res,res,GL_RGBA,TRUE,FALSE,LLTexUnit::TT_TEXTURE, true); } @@ -8152,7 +8167,8 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRen { LLFastTimer t(FTM_BIND_DEFERRED); - LLRenderTarget* render_target = alternative_target ? alternative_target : &mScreen; + (void)alternative_target; + //LLRenderTarget* render_target = alternative_target ? alternative_target : &mScreen; if (noise_map == 0xFFFFFFFF) { @@ -8221,11 +8237,11 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRen channel = shader.enableTexture(LLShaderMgr::DEFERRED_LIGHT, mDeferredLight.getUsage()); if (channel > -1) { - if (light_index > 0) + /*if (light_index > 0) { render_target->bindTexture(0, channel); } - else + else*/ { mDeferredLight.bindTexture(0, channel); } @@ -9112,8 +9128,8 @@ void LLPipeline::renderDeferredLightingToRT(LLRenderTarget* target) target->bindTarget(); //clear color buffer here - zeroing alpha (glow) is important or it will accumulate against sky - //glClearColor(0,1,0,0); - //target->clear(GL_COLOR_BUFFER_BIT); + glClearColor(0,0,0,0); + target->clear(GL_COLOR_BUFFER_BIT); if (RenderDeferredAtmospheric) { //apply sunlight contribution @@ -9431,7 +9447,7 @@ void LLPipeline::renderDeferredLightingToRT(LLRenderTarget* target) gGL.setColorMask(true, true); } - target->flush(); + /*target->flush(); //gamma correct lighting gGL.matrixMode(LLRender::MM_PROJECTION); @@ -9488,7 +9504,7 @@ void LLPipeline::renderDeferredLightingToRT(LLRenderTarget* target) gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.popMatrix(); - target->bindTarget(); + target->bindTarget();*/ { //render non-deferred geometry (alpha, fullbright, glow) LLGLDisable blend(GL_BLEND); @@ -9522,7 +9538,7 @@ void LLPipeline::renderDeferredLightingToRT(LLRenderTarget* target) popRenderTypeMask(); } - target->flush(); + //target->flush(); } void LLPipeline::setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep) @@ -9833,12 +9849,14 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) #if MATERIALS_IN_REFLECTIONS if (LLPipeline::sRenderDeferred) { - gGL.setColorMask(true, true); + mWaterRef.flush(); + + gPipeline.grabReferences(result); gPipeline.mDeferredScreen.bindTarget(); + gGL.setColorMask(true, true); glClearColor(0,0,0,0); gPipeline.mDeferredScreen.clear(); - LLGLDepthTest d(GL_FALSE,GL_FALSE); renderGeomDeferred(camera); } else @@ -9891,8 +9909,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) #if MATERIALS_IN_REFLECTIONS if (LLPipeline::sRenderDeferred) - { - LLGLDepthTest d(GL_FALSE,GL_FALSE); + { renderGeomDeferred(camera); } else @@ -9907,11 +9924,6 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) if (LLPipeline::sRenderDeferred) { gPipeline.mDeferredScreen.flush(); - gPipeline.mWaterRef.copyContents(gPipeline.mDeferredScreen, - 0, 0, gPipeline.mDeferredScreen.getWidth(), gPipeline.mDeferredScreen.getHeight(), - 0, 0, gPipeline.mWaterRef.getWidth(), gPipeline.mWaterRef.getHeight(), - 0, GL_NEAREST); - mWaterRef.flush(); renderDeferredLightingToRT(&mWaterRef); } #endif @@ -9971,26 +9983,20 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) gGL.setColorMask(true, true); mWaterDis.clear(); + + gGL.setColorMask(true, false); #if MATERIALS_IN_REFLECTIONS + mWaterDis.flush(); if (LLPipeline::sRenderDeferred) - { - + { gPipeline.mDeferredScreen.bindTarget(); gGL.setColorMask(true, true); - glClearColor(1,0,1,0); + glClearColor(0,0,0,0); gPipeline.mDeferredScreen.clear(); - - renderGeomDeferred(camera); - - gPipeline.mDeferredScreen.flush(); - - mWaterDis.copyContents(gPipeline.mDeferredScreen, - 0, 0, gPipeline.mDeferredScreen.getWidth(), gPipeline.mDeferredScreen.getHeight(), - 0, 0, gPipeline.mWaterDis.getWidth(), gPipeline.mWaterDis.getHeight(), - 0, GL_NEAREST); - mWaterDis.flush(); + gPipeline.grabReferences(result); + renderGeomDeferred(camera); } else #endif @@ -10000,7 +10006,8 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) #if MATERIALS_IN_REFLECTIONS if (LLPipeline::sRenderDeferred) - { + { + gPipeline.mDeferredScreen.flush(); renderDeferredLightingToRT(&mWaterDis); } #endif -- cgit v1.2.3 From a09d1ac79ab2172de11d6a3e08965ee6e2f5537a Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 15 Jul 2013 11:49:31 -0700 Subject: NORSPEC-291 WIP clean-up and make materials rendering underwater a runtime setting --- indra/newview/app_settings/settings.xml | 11 +++ indra/newview/pipeline.cpp | 169 ++++++-------------------------- indra/newview/pipeline.h | 3 +- 3 files changed, 42 insertions(+), 141 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index ebb01fb330..2d3b32159a 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9621,6 +9621,17 @@ Value 1 + RenderWaterMaterials + + Comment + Water planar reflections include materials rendering. + Persist + 1 + Type + S32 + Value + 0 + RenderWaterMipNormal Comment diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index e5ea7d0381..ad082b5c74 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -122,7 +122,7 @@ //#define DEBUG_INDICES #endif -// Expensive and currently broken... +// Expensive // #define MATERIALS_IN_REFLECTIONS 1 @@ -1236,28 +1236,26 @@ void LLPipeline::createGLBuffers() updateRenderDeferred(); + bool materials_in_water = gSavedSettings.getS32("RenderWaterMaterials"); + if (LLPipeline::sWaterReflections) { //water reflection texture U32 res = (U32) llmax(gSavedSettings.getS32("RenderWaterRefResolution"), 512); -#if MATERIALS_IN_REFLECTIONS - if (LLPipeline::sRenderDeferred) + // Set up SRGB targets if we're doing deferred-path reflection rendering + // + if (LLPipeline::sRenderDeferred && materials_in_water) { mWaterRef.allocate(res,res,GL_SRGB8_ALPHA8,TRUE,FALSE); + //always use FBO for mWaterDis so it can be used for avatar texture bakes + mWaterDis.allocate(res,res,GL_SRGB8_ALPHA8,TRUE,FALSE,LLTexUnit::TT_TEXTURE, true); } else -#endif - mWaterRef.allocate(res,res,GL_RGBA,TRUE,FALSE); - -#if MATERIALS_IN_REFLECTIONS - if (LLPipeline::sRenderDeferred) { - mWaterDis.allocate(res,res,GL_SRGB8_ALPHA8,TRUE,FALSE,LLTexUnit::TT_TEXTURE, true); + mWaterRef.allocate(res,res,GL_RGBA,TRUE,FALSE); + //always use FBO for mWaterDis so it can be used for avatar texture bakes + mWaterDis.allocate(res,res,GL_RGBA,TRUE,FALSE,LLTexUnit::TT_TEXTURE, true); } - else -#endif - //always use FBO for mWaterDis so it can be used for avatar texture bakes - mWaterDis.allocate(res,res,GL_RGBA,TRUE,FALSE,LLTexUnit::TT_TEXTURE, true); } mHighlight.allocate(256,256,GL_RGBA, FALSE, FALSE); @@ -4666,103 +4664,6 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera) gGL.setColorMask(true, false); } -void LLPipeline::renderGeomDeferredToRT(LLCamera& camera) -{ - LLAppViewer::instance()->pingMainloopTimeout("Pipeline:RenderGeomDeferred"); - - LLFastTimer t(FTM_RENDER_GEOMETRY); - LLFastTimer t2(FTM_DEFERRED_POOLS); - - LLGLEnable cull(GL_CULL_FACE); - - LLGLEnable stencil(GL_STENCIL_TEST); - glStencilFunc(GL_ALWAYS, 1, 0xFFFFFFFF); - stop_glerror(); - glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); - stop_glerror(); - - for (pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ++iter) - { - LLDrawPool *poolp = *iter; - if (hasRenderType(poolp->getType())) - { - poolp->prerender(); - } - } - - LLGLEnable multisample(RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0); - - LLVertexBuffer::unbind(); - - LLGLState::checkStates(); - LLGLState::checkTextureChannels(); - LLGLState::checkClientArrays(); - - U32 cur_type = 0; - - gGL.setColorMask(true, true); - - pool_set_t::iterator iter1 = mPools.begin(); - - while ( iter1 != mPools.end() ) - { - LLDrawPool *poolp = *iter1; - - cur_type = poolp->getType(); - - pool_set_t::iterator iter2 = iter1; - if (hasRenderType(poolp->getType()) && poolp->getNumDeferredPasses() > 0) - { - LLFastTimer t(FTM_DEFERRED_POOLRENDER); - - gGLLastMatrix = NULL; - gGL.loadMatrix(gGLModelView); - - for( S32 i = 0; i < poolp->getNumDeferredPasses(); i++ ) - { - LLVertexBuffer::unbind(); - poolp->beginDeferredPass(i); - for (iter2 = iter1; iter2 != mPools.end(); iter2++) - { - LLDrawPool *p = *iter2; - if (p->getType() != cur_type) - { - break; - } - - if ( !p->getSkipRenderFlag() ) { p->renderDeferred(i); } - } - poolp->endDeferredPass(i); - LLVertexBuffer::unbind(); - - if (gDebugGL || gDebugPipeline) - { - LLGLState::checkStates(); - } - } - } - else - { - // Skip all pools of this type - for (iter2 = iter1; iter2 != mPools.end(); iter2++) - { - LLDrawPool *p = *iter2; - if (p->getType() != cur_type) - { - break; - } - } - } - iter1 = iter2; - stop_glerror(); - } - - gGLLastMatrix = NULL; - gGL.loadMatrix(gGLModelView); - - gGL.setColorMask(true, false); -} - void LLPipeline::renderGeomPostDeferred(LLCamera& camera, bool do_occlusion) { LLFastTimer t(FTM_POST_DEFERRED_POOLS); @@ -8163,13 +8064,10 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) static LLFastTimer::DeclareTimer FTM_BIND_DEFERRED("Bind Deferred"); -void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRenderTarget* alternative_target, U32 noise_map) +void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, U32 noise_map) { LLFastTimer t(FTM_BIND_DEFERRED); - (void)alternative_target; - //LLRenderTarget* render_target = alternative_target ? alternative_target : &mScreen; - if (noise_map == 0xFFFFFFFF) { noise_map = mNoiseMap; @@ -8237,11 +8135,11 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRen channel = shader.enableTexture(LLShaderMgr::DEFERRED_LIGHT, mDeferredLight.getUsage()); if (channel > -1) { - /*if (light_index > 0) + if (light_index > 0) { - render_target->bindTexture(0, channel); + mScreen.bindTexture(0, channel); } - else*/ + else { mDeferredLight.bindTexture(0, channel); } @@ -9076,7 +8974,7 @@ void LLPipeline::renderDeferredLightingToRT(LLRenderTarget* target) mDeferredLight.bindTarget(); { //paint shadow/SSAO light map (direct lighting lightmap) LLFastTimer ftm(FTM_SUN_SHADOW); - bindDeferredShader(gDeferredSunProgram, 0, target); + bindDeferredShader(gDeferredSunProgram); mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); glClearColor(1,1,1,1); mDeferredLight.clear(GL_COLOR_BUFFER_BIT); @@ -9134,7 +9032,7 @@ void LLPipeline::renderDeferredLightingToRT(LLRenderTarget* target) if (RenderDeferredAtmospheric) { //apply sunlight contribution LLFastTimer ftm(FTM_ATMOSPHERICS); - bindDeferredShader(gDeferredSoftenProgram,0,target); + bindDeferredShader(gDeferredSoftenProgram); { LLGLDepthTest depth(GL_FALSE); LLGLDisable blend(GL_BLEND); @@ -9195,7 +9093,7 @@ void LLPipeline::renderDeferredLightingToRT(LLRenderTarget* target) LLVertexBuffer::unbind(); { - bindDeferredShader(gDeferredLightProgram, 0, target); + bindDeferredShader(gDeferredLightProgram); if (mCubeVB.isNull()) { @@ -9303,7 +9201,7 @@ void LLPipeline::renderDeferredLightingToRT(LLRenderTarget* target) if (!spot_lights.empty()) { LLGLDepthTest depth(GL_TRUE, GL_FALSE); - bindDeferredShader(gDeferredSpotLightProgram,0, target); + bindDeferredShader(gDeferredSpotLightProgram); mCubeVB->setBuffer(LLVertexBuffer::MAP_VERTEX); @@ -9384,7 +9282,7 @@ void LLPipeline::renderDeferredLightingToRT(LLRenderTarget* target) if (count == max_count || fullscreen_lights.empty()) { U32 idx = count-1; - bindDeferredShader(gDeferredMultiLightProgram[idx],0, target); + bindDeferredShader(gDeferredMultiLightProgram[idx]); gDeferredMultiLightProgram[idx].uniform1i(LLShaderMgr::MULTI_LIGHT_COUNT, count); gDeferredMultiLightProgram[idx].uniform4fv(LLShaderMgr::MULTI_LIGHT, count, (GLfloat*) light); gDeferredMultiLightProgram[idx].uniform4fv(LLShaderMgr::MULTI_LIGHT_COL, count, (GLfloat*) col); @@ -9398,7 +9296,7 @@ void LLPipeline::renderDeferredLightingToRT(LLRenderTarget* target) unbindDeferredShader(gDeferredMultiLightProgram[0]); - bindDeferredShader(gDeferredMultiSpotLightProgram, 0, target); + bindDeferredShader(gDeferredMultiSpotLightProgram); gDeferredMultiSpotLightProgram.enableTexture(LLShaderMgr::DEFERRED_PROJECTION); @@ -9787,6 +9685,8 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) water_clip = 1; } + bool materials_in_water = gSavedSettings.getS32("RenderWaterMaterials"); + if (!LLViewerCamera::getInstance()->cameraUnderWater()) { //generate planar reflection map @@ -9846,8 +9746,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) updateCull(camera, result); stateSort(camera, result); -#if MATERIALS_IN_REFLECTIONS - if (LLPipeline::sRenderDeferred) + if (LLPipeline::sRenderDeferred && materials_in_water) { mWaterRef.flush(); @@ -9860,7 +9759,6 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) renderGeomDeferred(camera); } else -#endif { renderGeom(camera, TRUE); } @@ -9907,26 +9805,22 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) gPipeline.grabReferences(ref_result); LLGLUserClipPlane clip_plane(plane, mat, projection); -#if MATERIALS_IN_REFLECTIONS - if (LLPipeline::sRenderDeferred) + if (LLPipeline::sRenderDeferred && materials_in_water) { renderGeomDeferred(camera); } else -#endif { renderGeom(camera); } } } -#if MATERIALS_IN_REFLECTIONS - if (LLPipeline::sRenderDeferred) + if (LLPipeline::sRenderDeferred && materials_in_water) { gPipeline.mDeferredScreen.flush(); renderDeferredLightingToRT(&mWaterRef); } -#endif gPipeline.popRenderTypeMask(); } @@ -9987,10 +9881,10 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) gGL.setColorMask(true, false); -#if MATERIALS_IN_REFLECTIONS - mWaterDis.flush(); - if (LLPipeline::sRenderDeferred) + + if (LLPipeline::sRenderDeferred && materials_in_water) { + mWaterDis.flush(); gPipeline.mDeferredScreen.bindTarget(); gGL.setColorMask(true, true); glClearColor(0,0,0,0); @@ -9999,18 +9893,15 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) renderGeomDeferred(camera); } else -#endif { renderGeom(camera); } -#if MATERIALS_IN_REFLECTIONS - if (LLPipeline::sRenderDeferred) + if (LLPipeline::sRenderDeferred && materials_in_water) { gPipeline.mDeferredScreen.flush(); renderDeferredLightingToRT(&mWaterDis); } -#endif } mWaterDis.flush(); diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 8764616fba..36b293b998 100755 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -281,10 +281,9 @@ public: void renderGeom(LLCamera& camera, BOOL forceVBOUpdate = FALSE); void renderGeomDeferred(LLCamera& camera); - void renderGeomDeferredToRT(LLCamera& camera); void renderGeomPostDeferred(LLCamera& camera, bool do_occlusion=true); void renderGeomShadow(LLCamera& camera); - void bindDeferredShader(LLGLSLShader& shader, U32 light_index = 0, LLRenderTarget* alternative_target = NULL, U32 noise_map = 0xFFFFFFFF); + void bindDeferredShader(LLGLSLShader& shader, U32 light_index = 0, U32 noise_map = 0xFFFFFFFF); void setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep); void unbindDeferredShader(LLGLSLShader& shader); -- cgit v1.2.3 From cc18896faf3944a4725fe4c705db5e8c0370f8c2 Mon Sep 17 00:00:00 2001 From: Cinders Date: Mon, 15 Jul 2013 14:24:29 -0600 Subject: STORM-1951: Only toast when we should, honor show_toast notification param --- indra/newview/llnotificationscripthandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp index 08c98e4f28..56ed1044e9 100755 --- a/indra/newview/llnotificationscripthandler.cpp +++ b/indra/newview/llnotificationscripthandler.cpp @@ -87,7 +87,7 @@ bool LLScriptHandler::processNotification(const LLNotificationPtr& notification) { LLScriptFloaterManager::getInstance()->onAddNotification(notification->getID()); } - else + else if (notification->canShowToast()) { LLToastPanel* notify_box = LLToastPanel::buidPanelFromNotification(notification); -- cgit v1.2.3 From e12b6caaa0596eae2fad43636663dd4e14a1949c Mon Sep 17 00:00:00 2001 From: Cinders Date: Mon, 15 Jul 2013 14:24:59 -0600 Subject: Remove trivial duplicate ; at the end of a line --- indra/newview/llviewermessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ace16396db..a71ccce89b 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -6895,7 +6895,7 @@ bool handle_lure_callback(const LLSD& notification, const LLSD& response) std::string target_name; gCacheName->getFullName(target_id, target_name); // for im log filenames LLSD args; - args["TO_NAME"] = LLSLURL("agent", target_id, "displayname").getSLURLString();; + args["TO_NAME"] = LLSLURL("agent", target_id, "displayname").getSLURLString(); LLSD payload; -- cgit v1.2.3 From a540ae81c42f1c7be87bda73d060b7ba8eaa0654 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 15 Jul 2013 13:46:01 -0700 Subject: NORSPEC-291 first attempt at gamma correction of materials in reflections --- .../shaders/class1/deferred/underWaterF.glsl | 22 +++++++++++++++- .../shaders/class1/deferred/waterF.glsl | 29 +++++++++++++++++++++- 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl index c160b38cfe..938947bbce 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl @@ -56,6 +56,26 @@ VARYING vec4 refCoord; VARYING vec4 littleWave; VARYING vec4 view; +vec3 srgb_to_linear(vec3 cs) +{ + +/* { cs / 12.92, cs <= 0.04045 + cl = { + { ((cs + 0.055)/1.055)^2.4, cs > 0.04045*/ + + return pow((cs+vec3(0.055))/vec3(1.055), vec3(2.4)); +} + +vec3 linear_to_srgb(vec3 cl) +{ + /*{ 0.0, 0 <= cl + { 12.92 * c, 0 < cl < 0.0031308 + cs = { 1.055 * cl^0.41666 - 0.055, 0.0031308 <= cl < 1 + { 1.0, cl >= 1*/ + + return 1.055 * pow(cl, vec3(0.41666)) - 0.055; +} + vec2 encode_normal(vec3 n) { float f = sqrt(8 * n.z + 8); @@ -114,7 +134,7 @@ void main() vec4 fb = texture2D(screenTex, distort); - frag_data[0] = vec4(fb.rgb, 0.5); // diffuse + frag_data[0] = vec4(linear_to_srgb(fb.rgb), 1.0); // diffuse frag_data[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec frag_data[2] = vec4(encode_normal(wavef), 0.0, 0.0); // normalxyz, displace } diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index daa2fb390a..17288873c8 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -67,6 +67,26 @@ VARYING vec4 littleWave; VARYING vec4 view; VARYING vec4 vary_position; +vec3 srgb_to_linear(vec3 cs) +{ + +/* { cs / 12.92, cs <= 0.04045 + cl = { + { ((cs + 0.055)/1.055)^2.4, cs > 0.04045*/ + + return pow((cs+vec3(0.055))/vec3(1.055), vec3(2.4)); +} + +vec3 linear_to_srgb(vec3 cl) +{ + /*{ 0.0, 0 <= cl + { 12.92 * c, 0 < cl < 0.0031308 + cs = { 1.055 * cl^0.41666 - 0.055, 0.0031308 <= cl < 1 + { 1.0, cl >= 1*/ + + return 1.055 * pow(cl, vec3(0.41666)) - 0.055; +} + vec2 encode_normal(vec3 n) { float f = sqrt(8 * n.z + 8); @@ -116,6 +136,10 @@ void main() vec2 refvec3 = distort+refdistort3/dmod_scale; vec4 refcol3 = texture2D(refTex, refvec3); + refcol1.rgb = srgb_to_linear(refcol1.rgb); + refcol2.rgb = srgb_to_linear(refcol2.rgb); + refcol3.rgb = srgb_to_linear(refcol3.rgb); + vec4 refcol = refcol1 + refcol2 + refcol3; float df1 = df.x + df.y + df.z; refcol *= df1 * 0.333; @@ -131,6 +155,9 @@ void main() vec2 refvec4 = distort+refdistort4/dmod; float dweight = min(dist2*blurMultiplier, 1.0); vec4 baseCol = texture2D(refTex, refvec4); + + baseCol.rgb = srgb_to_linear(baseCol.rgb); + refcol = mix(baseCol*df2, refcol, dweight); //get specular component @@ -165,7 +192,7 @@ void main() //wavef = normalize(wavef); vec3 screenspacewavef = (norm_mat*vec4(wavef, 1.0)).xyz; - frag_data[0] = vec4(color.rgb, 0.5); // diffuse + frag_data[0] = vec4(linear_to_srgb(color.rgb), 0.5); // diffuse frag_data[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec frag_data[2] = vec4(encode_normal(screenspacewavef), 0.0, 0.0); // normalxyz, displace } -- cgit v1.2.3 From 61e5164a41faf5d56919377ea00a6166b772a5a1 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 15 Jul 2013 16:06:34 -0700 Subject: ACME-680 Create the Account tab --- indra/newview/skins/default/xui/en/floater_social.xml | 6 ++++++ indra/newview/skins/default/xui/en/panel_social_account.xml | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100644 indra/newview/skins/default/xui/en/panel_social_account.xml diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml index 65f738de1f..7f52a8c0da 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -57,6 +57,12 @@ label="PLACE" help_topic="panel_social_place" name="panel_social_place"/> + + + + + + \ No newline at end of file -- cgit v1.2.3 From 2c5b265e3988c3d3f036ec9df6bd18bf86fc84f8 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Mon, 15 Jul 2013 16:31:32 -0700 Subject: MAINT-2849 FIX Certain streams that play with FMod do not play with FModEx --- indra/llaudio/llstreamingaudio_fmodex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llaudio/llstreamingaudio_fmodex.cpp b/indra/llaudio/llstreamingaudio_fmodex.cpp index 42f30aa1c4..266fa2f57b 100644 --- a/indra/llaudio/llstreamingaudio_fmodex.cpp +++ b/indra/llaudio/llstreamingaudio_fmodex.cpp @@ -310,7 +310,7 @@ LLAudioStreamManagerFMODEX::LLAudioStreamManagerFMODEX(FMOD::System *system, con { mInternetStreamURL = url; - FMOD_RESULT result = mSystem->createStream(url.c_str(), FMOD_2D | FMOD_NONBLOCKING | FMOD_IGNORETAGS, 0, &mInternetStream); + FMOD_RESULT result = mSystem->createStream(url.c_str(), FMOD_2D | FMOD_NONBLOCKING | FMOD_MPEGSEARCH | FMOD_IGNORETAGS, 0, &mInternetStream); if (result!= FMOD_OK) { -- cgit v1.2.3 From 9988e4739f2af029732c66d0bc5f03e6f43c5685 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 15 Jul 2013 17:16:09 -0700 Subject: ACME-725 Add the connected text, 'Connect...' button, 'User another account...' button and 'Disconnect' button --- .../skins/default/xui/en/panel_social_account.xml | 61 +++++++++++++++++++++- 1 file changed, 59 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_social_account.xml b/indra/newview/skins/default/xui/en/panel_social_account.xml index d1f188fbc8..639e601f9d 100644 --- a/indra/newview/skins/default/xui/en/panel_social_account.xml +++ b/indra/newview/skins/default/xui/en/panel_social_account.xml @@ -4,7 +4,64 @@ layout="topleft" name="panel_social_account"> - + + You are connected to Facebook as: + + + [secondlife:/// Philippe Bossut] + + - \ No newline at end of file + + + + -- cgit v1.2.3 From 749eef31fa7b33438e1e110faf584512d75338a4 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 15 Jul 2013 17:38:38 -0700 Subject: NORSPEC-265 WIP imposters work in non-deferred and ALM but are forward-only render --- indra/newview/lldrawpoolavatar.cpp | 8 +++++++- indra/newview/pipeline.cpp | 20 +++++++++++++------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 59c9cf5a83..87e9071c4d 100755 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -681,12 +681,16 @@ void LLDrawPoolAvatar::beginDeferredImpostor() LLVOAvatar::sNumVisibleAvatars = 0; } +#if DEFERRED_IMPOSTORS sVertexProgram = &gDeferredImpostorProgram; specular_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::SPECULAR_MAP); normal_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::DEFERRED_NORMAL); sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); - +#else + sVertexProgram = &gImpostorProgram; + sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); +#endif sVertexProgram->bind(); sVertexProgram->setMinimumAlpha(0.01f); } @@ -1248,6 +1252,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) if (impostor) { +#if DEFERRED_IMPOSTORS if (LLPipeline::sRenderDeferred && !LLPipeline::sReflectionRender && avatarp->mImpostor.isComplete()) { if (normal_channel > -1) @@ -1259,6 +1264,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) avatarp->mImpostor.bindTexture(1, specular_channel); } } +#endif avatarp->renderImpostor(LLColor4U(255,255,255,255), sDiffuseChannel); } return; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index ad082b5c74..fc79f1c31f 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -11254,7 +11254,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) S32 occlusion = sUseOcclusion; sUseOcclusion = 0; - sReflectionRender = sRenderDeferred ? FALSE : TRUE; + //sReflectionRender = sRenderDeferred ? FALSE : TRUE; sShadowRender = TRUE; sImpostorRender = TRUE; @@ -11351,25 +11351,27 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) LLFastTimer t(FTM_IMPOSTOR_ALLOCATE); avatar->mImpostor.allocate(resX,resY,GL_RGBA,TRUE,FALSE); +#if DEFERRED_IMPOSTORS if (LLPipeline::sRenderDeferred) { addDeferredAttachments(avatar->mImpostor); } - +#endif + gGL.getTexUnit(0)->bind(&avatar->mImpostor); gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); } - else if(resX != avatar->mImpostor.getWidth() || - resY != avatar->mImpostor.getHeight()) + else if(resX != avatar->mImpostor.getWidth() || resY != avatar->mImpostor.getHeight()) { LLFastTimer t(FTM_IMPOSTOR_RESIZE); avatar->mImpostor.resize(resX,resY,GL_RGBA); } - avatar->mImpostor.bindTarget(); + avatar->mImpostor.bindTarget(); } +#if DEFERRED_IMPOSTORS if (LLPipeline::sRenderDeferred) { avatar->mImpostor.clear(); @@ -11377,20 +11379,24 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) renderGeomPostDeferred(camera); } else - { +#endif + { LLGLEnable scissor(GL_SCISSOR_TEST); - glScissor(0, 0, resX, resY); + glScissor(0, 0, resX, resY); avatar->mImpostor.clear(); renderGeom(camera); } { //create alpha mask based on depth buffer (grey out if muted) LLFastTimer t(FTM_IMPOSTOR_BACKGROUND); + +#if DEFERRED_IMPOSTORS if (LLPipeline::sRenderDeferred) { GLuint buff = GL_COLOR_ATTACHMENT0; glDrawBuffersARB(1, &buff); } +#endif LLGLDisable blend(GL_BLEND); -- cgit v1.2.3 From d76e6e2337142e3e819fcf757f396b3089e97e71 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 16 Jul 2013 06:10:05 -0700 Subject: NORSPEC-240 make alpha-masked fullbright objs use fullbright alpha mask rendering --- .../shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl | 2 +- indra/newview/llvovolume.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl index 59d109b886..8525e13333 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl @@ -50,7 +50,7 @@ void main() { discard; } - + frag_data[0] = vec4(col.rgb, 0.0); frag_data[1] = vec4(0,0,0,0); vec3 nvn = normalize(vary_normal); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index b545e99a32..8ed6a08aae 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4604,7 +4604,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (mode == LLMaterial::DIFFUSE_ALPHA_MODE_MASK && te->getColor().mV[3] >= 0.999f) { - pool->addRiggedFace(facep, fullbright ? LLDrawPoolAvatar::RIGGED_FULLBRIGHT : LLDrawPoolAvatar::RIGGED_SIMPLE); + pool->addRiggedFace(facep, fullbright ? LLDrawPoolAvatar::RIGGED_FULLBRIGHT_ALPHA_MASK : LLDrawPoolAvatar::RIGGED_ALPHA_MASK); } else if (is_alpha || (te->getColor().mV[3] < 0.999f)) { @@ -5390,7 +5390,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: { if (te->getColor().mV[3] >= 0.999f) { - material_pass = true; + registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK); } else { -- cgit v1.2.3 From f0f30c976bba99842cf0451621e14c690ef3ceae Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 16 Jul 2013 06:26:02 -0700 Subject: NORSPEC-240 revert part of change causing regression in non-ALM rendering --- indra/newview/llvovolume.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 8ed6a08aae..3d6c5398d5 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4604,7 +4604,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (mode == LLMaterial::DIFFUSE_ALPHA_MODE_MASK && te->getColor().mV[3] >= 0.999f) { - pool->addRiggedFace(facep, fullbright ? LLDrawPoolAvatar::RIGGED_FULLBRIGHT_ALPHA_MASK : LLDrawPoolAvatar::RIGGED_ALPHA_MASK); + pool->addRiggedFace(facep, fullbright ? LLDrawPoolAvatar::RIGGED_FULLBRIGHT : LLDrawPoolAvatar::RIGGED_SIMPLE); } else if (is_alpha || (te->getColor().mV[3] < 0.999f)) { -- cgit v1.2.3 From f618b7d5cc84a83739a8ac6c3eea7d0a7d4f22cd Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 16 Jul 2013 10:25:06 -0700 Subject: NORSPEC-293 WIP fix fullbrightF order of ops to match non-deferred with fullbright+glow+texcolor --- indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl index ec25f52ef5..33c07a6e08 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl @@ -69,8 +69,8 @@ void main() vec4 color = texture2D(diffuseMap, vary_texcoord0.xy); #endif - color.rgb = srgb_to_linear(color.rgb); color.rgb *= vertex_color.rgb; + color.rgb = srgb_to_linear(color.rgb); color.rgb = fullbrightAtmosTransport(color.rgb); color.rgb = fullbrightScaleSoftClip(color.rgb); -- cgit v1.2.3 From 1587999b0329c76d108fcd1efe2d3fb768043e9e Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 16 Jul 2013 12:03:42 -0700 Subject: Add info to vert buffer warnings to track down fullbright alpha mask crasher --- indra/llrender/llvertexbuffer.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 01541026b1..b1ef6e0576 100755 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -2239,7 +2239,32 @@ void LLVertexBuffer::setBuffer(U32 data_mask) if ((data_mask & required_mask) != required_mask) { - llwarns << "Shader consumption mismatches data provision." << llendl; + + U32 unsatisfied_mask = (required_mask & ~data_mask); + U32 i = 0; + + while (i < 15) + { + switch ((unsatisfied_mask & (1 << i))) + { + case MAP_VERTEX: llinfos << "Missing vert pos" << llendl; break; + case MAP_NORMAL: llinfos << "Missing normals" << llendl; break; + case MAP_TEXCOORD0: llinfos << "Missing TC 0" << llendl; break; + case MAP_TEXCOORD1: llinfos << "Missing TC 1" << llendl; break; + case MAP_TEXCOORD2: llinfos << "Missing TC 2" << llendl; break; + case MAP_TEXCOORD3: llinfos << "Missing TC 3" << llendl; break; + case MAP_COLOR: llinfos << "Missing vert color" << llendl; break; + case MAP_EMISSIVE: llinfos << "Missing emissive" << llendl; break; + case MAP_TANGENT: llinfos << "Missing tangent" << llendl; break; + case MAP_WEIGHT: llinfos << "Missing weight" << llendl; break; + case MAP_WEIGHT4: llinfos << "Missing weightx4" << llendl; break; + case MAP_CLOTHWEIGHT: llinfos << "Missing clothweight" << llendl; break; + case MAP_TEXTURE_INDEX: llinfos << "Missing tex index" << llendl; break; + default: llinfos << "Missing who effin knows" << llendl; + } + } + + llerrs << "Shader consumption mismatches data provision." << llendl; } } } -- cgit v1.2.3 From fdea8c66de408a2054bbe86b1967cea11409c313 Mon Sep 17 00:00:00 2001 From: Cho Date: Tue, 16 Jul 2013 22:15:14 +0100 Subject: switched FB auth to in-viewer browser for ACME-733 --- indra/newview/llfacebookconnect.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 0d11658d07..cf77dd365b 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -40,6 +40,9 @@ #include "lltrans.h" #include "llevents.h" +#include "llfloaterwebcontent.h" +#include "llfloaterreg.h" + boost::scoped_ptr LLFacebookConnect::sStateWatcher(new LLEventStream("FacebookConnectState")); boost::scoped_ptr LLFacebookConnect::sContentWatcher(new LLEventStream("FacebookConnectContent")); @@ -274,7 +277,12 @@ LLFacebookConnect::LLFacebookConnect() void LLFacebookConnect::openFacebookWeb(std::string url) { - LLUrlAction::openURLExternal(url); + // Open the URL in an internal browser window without navigation UI + LLFloaterWebContent::Params p; + p.url(url).show_chrome(false); + LLFloaterReg::showInstance("web_content", p); + + //LLUrlAction::openURLExternal(url); } std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route) -- cgit v1.2.3 From 3d6a98d845c871377a52fc924ce06329db34a776 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 17 Jul 2013 02:59:40 +0100 Subject: created floater_fbc_web for ACME-734 and ACME-735 --- indra/newview/llfacebookconnect.cpp | 12 ++++++++++-- indra/newview/llviewerfloaterreg.cpp | 2 +- indra/newview/skins/default/xui/en/floater_fbc_web.xml | 9 +++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/floater_fbc_web.xml diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index cf77dd365b..ac92fc6ed5 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -52,7 +52,7 @@ void log_facebook_connect_error(const std::string& request, U32 status, const st // Note: 302 (redirect) is *not* an error that warrants logging if (status != 302) { - LL_WARNS("FacebookConnect") << request << " request failed with a " << status << " " << reason << ". Reason: " << code << "(" << description << ")" << LL_ENDL; + LL_WARNS("FacebookConnect") << request << " request failed with a " << status << " " << reason << ". Reason: " << code << " (" << description << ")" << LL_ENDL; } } @@ -76,10 +76,18 @@ public: { if (tokens[0].asString() == "connect") { + // connect to facebook if (query_map.has("code")) { LLFacebookConnect::instance().connectToFacebook(query_map["code"], query_map.get("state")); } + + // this command probably came from the fbc_web browser, so close it + LLFloater* fbc_web = LLFloaterReg::getInstance("fbc_web"); + if (fbc_web) + { + fbc_web->closeFloater(); + } return true; } } @@ -280,7 +288,7 @@ void LLFacebookConnect::openFacebookWeb(std::string url) // Open the URL in an internal browser window without navigation UI LLFloaterWebContent::Params p; p.url(url).show_chrome(false); - LLFloaterReg::showInstance("web_content", p); + LLFloaterReg::showInstance("fbc_web", p); //LLUrlAction::openURLExternal(url); } diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 69bda2c11c..4ce049df03 100755 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -313,7 +313,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("my_profile", "floater_my_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebProfile::create); LLFloaterReg::add("profile", "floater_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebProfile::create); LLFloaterReg::add("how_to", "floater_how_to.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create); - + LLFloaterReg::add("fbc_web", "floater_fbc_web.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create); LLFloaterUIPreviewUtil::registerFloater(); LLFloaterReg::add("upload_anim_bvh", "floater_animation_bvh_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build, "upload"); diff --git a/indra/newview/skins/default/xui/en/floater_fbc_web.xml b/indra/newview/skins/default/xui/en/floater_fbc_web.xml new file mode 100644 index 0000000000..0d35e22a19 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_fbc_web.xml @@ -0,0 +1,9 @@ + + -- cgit v1.2.3 From 9aeb3b48d77ce9e22445b4bca23d36f651bb9395 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 17 Jul 2013 08:03:09 -0700 Subject: NORSPEC-291 fix materials underwater, disable attempt at materials in reflect/distort RTs --- .../app_settings/shaders/class1/deferred/waterF.glsl | 2 +- indra/newview/pipeline.cpp | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index 17288873c8..46d5b9b612 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -192,7 +192,7 @@ void main() //wavef = normalize(wavef); vec3 screenspacewavef = (norm_mat*vec4(wavef, 1.0)).xyz; - frag_data[0] = vec4(linear_to_srgb(color.rgb), 0.5); // diffuse + frag_data[0] = vec4(color.rgb, 0.5); // diffuse frag_data[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec frag_data[2] = vec4(encode_normal(screenspacewavef), 0.0, 0.0); // normalxyz, displace } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index fc79f1c31f..d88cb30887 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -122,9 +122,9 @@ //#define DEBUG_INDICES #endif -// Expensive +// Expensive and currently broken // -#define MATERIALS_IN_REFLECTIONS 1 +#define MATERIALS_IN_REFLECTIONS 0 bool gShiftFrame = false; @@ -1236,7 +1236,11 @@ void LLPipeline::createGLBuffers() updateRenderDeferred(); - bool materials_in_water = gSavedSettings.getS32("RenderWaterMaterials"); + bool materials_in_water = false; + +#if MATERIALS_IN_REFLECTIONS + materials_in_water = gSavedSettings.getS32("RenderWaterMaterials"); +#endif if (LLPipeline::sWaterReflections) { //water reflection texture @@ -9685,7 +9689,11 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) water_clip = 1; } - bool materials_in_water = gSavedSettings.getS32("RenderWaterMaterials"); + bool materials_in_water = false; + +#if MATERIALS_IN_REFLECTIONS + materials_in_water = gSavedSettings.getS32("RenderWaterMaterials"); +#endif if (!LLViewerCamera::getInstance()->cameraUnderWater()) { //generate planar reflection map -- cgit v1.2.3 From 0160491f888917d830ca3d827cc1f28f07363fed Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 17 Jul 2013 10:29:02 -0700 Subject: NORSPEC-291 put back conversion to srgb in deferred water shader --- indra/newview/app_settings/shaders/class1/deferred/waterF.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index 46d5b9b612..17288873c8 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -192,7 +192,7 @@ void main() //wavef = normalize(wavef); vec3 screenspacewavef = (norm_mat*vec4(wavef, 1.0)).xyz; - frag_data[0] = vec4(color.rgb, 0.5); // diffuse + frag_data[0] = vec4(linear_to_srgb(color.rgb), 0.5); // diffuse frag_data[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec frag_data[2] = vec4(encode_normal(screenspacewavef), 0.0, 0.0); // normalxyz, displace } -- cgit v1.2.3 From 095c53fa060b3d336b408e8b87f30518c8db36cd Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Wed, 17 Jul 2013 17:50:54 -0700 Subject: ACME-731 Create the llsocialaccountpanel class to handle input/feedback. --- indra/newview/llfloatersocial.cpp | 77 ++++++++++++++++++++++ indra/newview/llfloatersocial.h | 23 +++++++ .../skins/default/xui/en/floater_social.xml | 1 + .../skins/default/xui/en/panel_social_account.xml | 20 +++--- 4 files changed, 113 insertions(+), 8 deletions(-) diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index c8c203fc25..66624f6355 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -48,6 +48,7 @@ static LLRegisterPanelClassWrapper t_panel_status("llsocialstatuspanel"); static LLRegisterPanelClassWrapper t_panel_photo("llsocialphotopanel"); static LLRegisterPanelClassWrapper t_panel_checkin("llsocialcheckinpanel"); +static LLRegisterPanelClassWrapper t_panel_account("llsocialaccountpanel"); const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte const std::string DEFAULT_CHECKIN_ICON_URL = "http://logok.org/wp-content/uploads/2010/07/podcastlogo1.jpg"; @@ -609,6 +610,82 @@ void LLSocialCheckinPanel::clearAndClose() } } +/////////////////////////// +//LLSocialAccountPanel////// +/////////////////////////// + +LLSocialAccountPanel::LLSocialAccountPanel() : +mAccountCaptionLabel(NULL), +mAccountNameLabel(NULL), +mPanelButtons(NULL), +mConnectButton(NULL), +mUseAnotherAccountButton(NULL), +mDisconnectButton(NULL) +{ + mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLSocialAccountPanel::onConnect, this)); + mCommitCallbackRegistrar.add("SocialSharing.UseAnotherAccount", boost::bind(&LLSocialAccountPanel::onUseAnotherAccount, this)); + mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLSocialAccountPanel::onDisconnect, this)); +} + +BOOL LLSocialAccountPanel::postBuild() +{ + mAccountCaptionLabel = getChild("account_caption_label"); + mAccountNameLabel = getChild("account_name_label"); + mPanelButtons = getChild("panel_buttons"); + mConnectButton = getChild("connect_btn"); + mUseAnotherAccountButton = getChild("use_another_account_btn"); + mDisconnectButton = getChild("disconnect_btn"); + + hideConnectButton(); + + return LLPanel::postBuild(); +} + +void LLSocialAccountPanel::showConnectButton() +{ + if(!mConnectButton->getVisible()) + { + mConnectButton->setVisible(TRUE); + LLRect mLayoutStackRect = mPanelButtons->getRect(); + F32 deltaTopPadding = mConnectButton->getRect().mBottom - mUseAnotherAccountButton->getRect().mTop; + mLayoutStackRect.translate(0, -(mConnectButton->getRect().getHeight() + deltaTopPadding)); + mPanelButtons->setRect(mLayoutStackRect); + + mUseAnotherAccountButton->setVisible(FALSE); + mDisconnectButton->setVisible(FALSE); + } +} + +void LLSocialAccountPanel::hideConnectButton() +{ + if(mConnectButton->getVisible()) + { + mConnectButton->setVisible(FALSE); + LLRect mLayoutStackRect = mPanelButtons->getRect(); + F32 deltaTopPadding = mConnectButton->getRect().mBottom - mUseAnotherAccountButton->getRect().mTop; + mLayoutStackRect.translate(0, mConnectButton->getRect().getHeight() + deltaTopPadding); + mPanelButtons->setRect(mLayoutStackRect); + + mUseAnotherAccountButton->setVisible(TRUE); + mDisconnectButton->setVisible(TRUE); + } +} + +void LLSocialAccountPanel::onConnect() +{ + hideConnectButton(); +} + +void LLSocialAccountPanel::onUseAnotherAccount() +{ + +} + +void LLSocialAccountPanel::onDisconnect() +{ + showConnectButton(); +} + //////////////////////// //LLFloaterSocial/////// //////////////////////// diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index f1deeb423d..cdd8a71b79 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -115,6 +115,29 @@ private: bool mMapCheckBoxValue; }; +class LLSocialAccountPanel : public LLPanel +{ +public: + LLSocialAccountPanel(); + BOOL postBuild(); + +private: + void onConnect(); + void onUseAnotherAccount(); + void onDisconnect(); + + void showConnectButton(); + void hideConnectButton(); + + LLTextBox * mAccountCaptionLabel; + LLTextBox * mAccountNameLabel; + LLUICtrl * mPanelButtons; + LLUICtrl * mConnectButton; + LLUICtrl * mUseAnotherAccountButton; + LLUICtrl * mDisconnectButton; +}; + + class LLFloaterSocial : public LLFloater { public: diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml index 7f52a8c0da..eb209eb314 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -59,6 +59,7 @@ name="panel_social_place"/> [secondlife:/// Philippe Bossut] + + + -- cgit v1.2.3 From 8712086a4bcf1f0f7527a916baafc9e65667e4e8 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Thu, 18 Jul 2013 06:37:22 -0700 Subject: NORSPEC-314 work-around mystery mac GeForce crash from new shader for nspec 295 --- indra/newview/lldrawpoolsimple.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index e219769a0c..87fbeaf2c0 100755 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -633,8 +633,15 @@ void LLDrawPoolFullbrightAlphaMask::beginPostDeferredPass(S32 pass) } else { +#if LL_DARWIN + // the OS X 10.6.8 GeForce driver is a real POS + // this is a work-around for NORSPEC-314 + gObjectFullbrightAlphaMaskProgram.bind(); + gObjectFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f); +#else gDeferredFullbrightAlphaMaskProgram.bind(); gDeferredFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f); +#endif } } @@ -654,7 +661,11 @@ void LLDrawPoolFullbrightAlphaMask::endPostDeferredPass(S32 pass) } else { +#if LL_DARWIN + gObjectFullbrightAlphaMaskProgram.unbind(); +#else gDeferredFullbrightAlphaMaskProgram.unbind(); +#endif } LLRenderPass::endRenderPass(pass); } -- cgit v1.2.3 From b2e2282e988ab8c7d989d8554a41fda8b8c6e691 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 18 Jul 2013 16:13:14 -0700 Subject: ACME-727 Display 'Not connected to Facebook' when the user does not have a FB token --- indra/newview/llfloatersocial.cpp | 60 ++++++++++++++++++++-- indra/newview/llfloatersocial.h | 2 + .../skins/default/xui/en/panel_social_account.xml | 15 ++++-- 3 files changed, 70 insertions(+), 7 deletions(-) diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 66624f6355..d64e4273f4 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -625,6 +625,8 @@ mDisconnectButton(NULL) mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLSocialAccountPanel::onConnect, this)); mCommitCallbackRegistrar.add("SocialSharing.UseAnotherAccount", boost::bind(&LLSocialAccountPanel::onUseAnotherAccount, this)); mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLSocialAccountPanel::onDisconnect, this)); + + setVisibleCallback(boost::bind(&LLSocialAccountPanel::onVisibilityChange, this, _2)); } BOOL LLSocialAccountPanel::postBuild() @@ -636,9 +638,61 @@ BOOL LLSocialAccountPanel::postBuild() mUseAnotherAccountButton = getChild("use_another_account_btn"); mDisconnectButton = getChild("disconnect_btn"); + return LLPanel::postBuild(); +} + +void LLSocialAccountPanel::onVisibilityChange(const LLSD& new_visibility) +{ + bool visible = new_visibility.asBoolean(); + + if(visible) + { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialAccountPanel"); + LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialAccountPanel", boost::bind(&LLSocialAccountPanel::onFacebookConnectStateChange, this, _1)); + + if(LLFacebookConnect::instance().isConnected()) + { hideConnectButton(); + mAccountCaptionLabel->setText(getString("facebook_connected")); + mAccountNameLabel->setText(std::string("[secondlife:/// Philippe Bossut]")); - return LLPanel::postBuild(); + } + else + { + mAccountCaptionLabel->setText(getString("facebook_disconnected")); + mAccountNameLabel->setText(std::string("")); + LLFacebookConnect::instance().checkConnectionToFacebook(); + } + } + else + { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialAccountPanel"); + } +} + +bool LLSocialAccountPanel::onFacebookConnectStateChange(const LLSD& data) +{ + + switch (data.get("enum").asInteger()) + { + case LLFacebookConnect::FB_CONNECTED: + case LLFacebookConnect::FB_POSTING: + case LLFacebookConnect::FB_POSTED: + case LLFacebookConnect::FB_POST_FAILED: + mAccountCaptionLabel->setText(getString("facebook_connected")); + mAccountNameLabel->setText(std::string("[secondlife:/// Philippe Bossut]")); + hideConnectButton(); + break; + case LLFacebookConnect::FB_NOT_CONNECTED: + case LLFacebookConnect::FB_CONNECTION_IN_PROGRESS: + case LLFacebookConnect::FB_CONNECTION_FAILED: + mAccountCaptionLabel->setText(getString("facebook_disconnected")); + mAccountNameLabel->setText(std::string("")); + showConnectButton(); + break; + } + + return false; } void LLSocialAccountPanel::showConnectButton() @@ -673,7 +727,7 @@ void LLSocialAccountPanel::hideConnectButton() void LLSocialAccountPanel::onConnect() { - hideConnectButton(); + LLFacebookConnect::instance().checkConnectionToFacebook(true); } void LLSocialAccountPanel::onUseAnotherAccount() @@ -683,7 +737,7 @@ void LLSocialAccountPanel::onUseAnotherAccount() void LLSocialAccountPanel::onDisconnect() { - showConnectButton(); + LLFacebookConnect::instance().disconnectFromFacebook(); } //////////////////////// diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index cdd8a71b79..48245e34ea 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -122,6 +122,8 @@ public: BOOL postBuild(); private: + void onVisibilityChange(const LLSD& new_visibility); + bool onFacebookConnectStateChange(const LLSD& data); void onConnect(); void onUseAnotherAccount(); void onDisconnect(); diff --git a/indra/newview/skins/default/xui/en/panel_social_account.xml b/indra/newview/skins/default/xui/en/panel_social_account.xml index 838a9ba064..470e0848d2 100644 --- a/indra/newview/skins/default/xui/en/panel_social_account.xml +++ b/indra/newview/skins/default/xui/en/panel_social_account.xml @@ -3,7 +3,12 @@ width="304" layout="topleft" name="panel_social_account"> - + + - You are connected to Facebook as: + Not connected to Facebook. + width="210" + visible="false"> @@ -64,7 +70,8 @@ height="23" label="Disconnect" name="disconnect_btn" - width="210"> + width="210" + visible="false"> -- cgit v1.2.3 From 03563fcaa17c0af776c49baaa59421921603cddd Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 18 Jul 2013 16:23:11 -0700 Subject: ACME-728: When the 'Disconnect' button is clicked the fbc-service disconnect route should be called --- indra/newview/llfloatersocial.cpp | 30 ++++++++++++++++++------------ indra/newview/llfloatersocial.h | 2 ++ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index d64e4273f4..e61d86c474 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -652,15 +652,11 @@ void LLSocialAccountPanel::onVisibilityChange(const LLSD& new_visibility) if(LLFacebookConnect::instance().isConnected()) { - hideConnectButton(); - mAccountCaptionLabel->setText(getString("facebook_connected")); - mAccountNameLabel->setText(std::string("[secondlife:/// Philippe Bossut]")); - + showConnectedLayout(); } else { - mAccountCaptionLabel->setText(getString("facebook_disconnected")); - mAccountNameLabel->setText(std::string("")); + showDisconnectedLayout(); LLFacebookConnect::instance().checkConnectionToFacebook(); } } @@ -679,16 +675,12 @@ bool LLSocialAccountPanel::onFacebookConnectStateChange(const LLSD& data) case LLFacebookConnect::FB_POSTING: case LLFacebookConnect::FB_POSTED: case LLFacebookConnect::FB_POST_FAILED: - mAccountCaptionLabel->setText(getString("facebook_connected")); - mAccountNameLabel->setText(std::string("[secondlife:/// Philippe Bossut]")); - hideConnectButton(); + showConnectedLayout(); break; case LLFacebookConnect::FB_NOT_CONNECTED: case LLFacebookConnect::FB_CONNECTION_IN_PROGRESS: case LLFacebookConnect::FB_CONNECTION_FAILED: - mAccountCaptionLabel->setText(getString("facebook_disconnected")); - mAccountNameLabel->setText(std::string("")); - showConnectButton(); + showDisconnectedLayout(); break; } @@ -725,6 +717,20 @@ void LLSocialAccountPanel::hideConnectButton() } } +void LLSocialAccountPanel::showDisconnectedLayout() +{ + mAccountCaptionLabel->setText(getString("facebook_disconnected")); + mAccountNameLabel->setText(std::string("")); + showConnectButton(); +} + +void LLSocialAccountPanel::showConnectedLayout() +{ + mAccountCaptionLabel->setText(getString("facebook_connected")); + mAccountNameLabel->setText(std::string("[secondlife:/// Philippe Bossut]")); + hideConnectButton(); +} + void LLSocialAccountPanel::onConnect() { LLFacebookConnect::instance().checkConnectionToFacebook(true); diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index 48245e34ea..e49445a39f 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -130,6 +130,8 @@ private: void showConnectButton(); void hideConnectButton(); + void showDisconnectedLayout(); + void showConnectedLayout(); LLTextBox * mAccountCaptionLabel; LLTextBox * mAccountNameLabel; -- cgit v1.2.3 From 16709a9bef3ebf24c60eac29f7c5cb743e855da1 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 18 Jul 2013 21:05:41 -0700 Subject: ACME-734 : WIP : Implemented changes for https URL in the address bar and added options to web floater to hide history and disable buttons --- indra/newview/llfacebookconnect.cpp | 6 ++- indra/newview/llfloaterwebcontent.cpp | 43 +++++++++++++++++----- indra/newview/llfloaterwebcontent.h | 5 +++ .../skins/default/xui/en/floater_web_content.xml | 20 +++++++++- 4 files changed, 61 insertions(+), 13 deletions(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index ac92fc6ed5..eb9b93161c 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -287,7 +287,11 @@ void LLFacebookConnect::openFacebookWeb(std::string url) { // Open the URL in an internal browser window without navigation UI LLFloaterWebContent::Params p; - p.url(url).show_chrome(false); + p.url(url).show_chrome(true); + p.url(url).allow_address_entry(false); + p.url(url).allow_back_forward_navigation(false); + p.url(url).save_url_history(false); + p.url(url).trusted_content(true); LLFloaterReg::showInstance("fbc_web", p); //LLUrlAction::openURLExternal(url); diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 3fe2518de6..92dbbb402d 100755 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -46,7 +46,9 @@ LLFloaterWebContent::_Params::_Params() id("id"), window_class("window_class", "web_content"), show_chrome("show_chrome", true), - allow_address_entry("allow_address_entry", true), + allow_address_entry("allow_address_entry", true), + allow_back_forward_navigation("allow_back_forward_navigation", true), + save_url_history("save_url_history", true), preferred_media_size("preferred_media_size"), trusted_content("trusted_content", false), show_page_title("show_page_title", true) @@ -58,6 +60,7 @@ LLFloaterWebContent::LLFloaterWebContent( const Params& params ) mWebBrowser(NULL), mAddressCombo(NULL), mSecureLockIcon(NULL), + mSecurePrefix(NULL), mStatusBarText(NULL), mStatusBarProgress(NULL), mBtnBack(NULL), @@ -65,7 +68,9 @@ LLFloaterWebContent::LLFloaterWebContent( const Params& params ) mBtnReload(NULL), mBtnStop(NULL), mUUID(params.id()), - mShowPageTitle(params.show_page_title) + mShowPageTitle(params.show_page_title), + mAllowNavigation(true), + mSaveURLHistory(true) { mCommitCallbackRegistrar.add( "WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this )); mCommitCallbackRegistrar.add( "WebContent.Forward", boost::bind( &LLFloaterWebContent::onClickForward, this )); @@ -97,7 +102,8 @@ BOOL LLFloaterWebContent::postBuild() // cache image for secure browsing mSecureLockIcon = getChild< LLIconCtrl >("media_secure_lock_flag"); - + mSecurePrefix = getChild< LLTextBox >( "secured_prefix" ); + // initialize the URL history using the system URL History manager initializeURLHistory(); @@ -243,6 +249,8 @@ void LLFloaterWebContent::open_media(const Params& p) getChild("status_bar")->setVisible(p.show_chrome); getChild("nav_controls")->setVisible(p.show_chrome); bool address_entry_enabled = p.allow_address_entry && !p.trusted_content; + mAllowNavigation = p.allow_back_forward_navigation; + mSaveURLHistory = p.save_url_history; getChildView("address")->setEnabled(address_entry_enabled); getChildView("popexternal")->setEnabled(address_entry_enabled); @@ -295,8 +303,8 @@ void LLFloaterWebContent::onClose(bool app_quitting) void LLFloaterWebContent::draw() { // this is asynchronous so we need to keep checking - mBtnBack->setEnabled( mWebBrowser->canNavigateBack() ); - mBtnForward->setEnabled( mWebBrowser->canNavigateForward() ); + mBtnBack->setEnabled( mWebBrowser->canNavigateBack() && mAllowNavigation); + mBtnForward->setEnabled( mWebBrowser->canNavigateForward() && mAllowNavigation); LLFloater::draw(); } @@ -344,16 +352,28 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent mStatusBarText->setText( end_str ); // decide if secure browsing icon should be displayed - std::string prefix = std::string("https://"); + std::string prefix = std::string("https://"); std::string test_prefix = mCurrentURL.substr(0, prefix.length()); LLStringUtil::toLower(test_prefix); - if(test_prefix == prefix) + if (test_prefix == prefix) { mSecureLockIcon->setVisible(true); + mSecurePrefix->setVisible(true); + // Hack : we suppress the "https" prefix and move the text a bit + // to make space for the lock icon and the green "https" text. + // However, so not to confuse the list management, we're not adding + // that hacked url to the history. The full url is already in there. + std::string url = mCurrentURL; + url.replace(0,5,""); + url = " " + url; + mAddressCombo->remove( url ); + mAddressCombo->add( url ); + mAddressCombo->selectByValue( url ); } else { mSecureLockIcon->setVisible(false); + mSecurePrefix->setVisible(false); } } else if(event == MEDIA_EVENT_CLOSE_REQUEST) @@ -399,9 +419,12 @@ void LLFloaterWebContent::set_current_url(const std::string& url) { mCurrentURL = url; - // serialize url history into the system URL History manager - LLURLHistory::removeURL("browser", mCurrentURL); - LLURLHistory::addURL("browser", mCurrentURL); + LLURLHistory::removeURL("browser", mCurrentURL); + if (mSaveURLHistory) + { + // serialize url history into the system URL History manager + LLURLHistory::addURL("browser", mCurrentURL); + } mAddressCombo->remove( mCurrentURL ); mAddressCombo->add( mCurrentURL ); diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h index cfc87e9015..b416328e93 100755 --- a/indra/newview/llfloaterwebcontent.h +++ b/indra/newview/llfloaterwebcontent.h @@ -54,6 +54,8 @@ public: id; Optional show_chrome, allow_address_entry, + allow_back_forward_navigation, + save_url_history, trusted_content, show_page_title; Optional preferred_media_size; @@ -97,6 +99,7 @@ protected: LLMediaCtrl* mWebBrowser; LLComboBox* mAddressCombo; LLIconCtrl* mSecureLockIcon; + LLTextBox* mSecurePrefix; LLTextBox* mStatusBarText; LLProgressBar* mStatusBarProgress; @@ -108,6 +111,8 @@ protected: std::string mCurrentURL; std::string mUUID; bool mShowPageTitle; + bool mAllowNavigation; + bool mSaveURLHistory; }; #endif // LL_LLFLOATERWEBCONTENT_H diff --git a/indra/newview/skins/default/xui/en/floater_web_content.xml b/indra/newview/skins/default/xui/en/floater_web_content.xml index cea10adca8..a1563dc9ae 100755 --- a/indra/newview/skins/default/xui/en/floater_web_content.xml +++ b/indra/newview/skins/default/xui/en/floater_web_content.xml @@ -125,14 +125,30 @@ + + https + - - + - + + + [https://support.secondlife.com/ Learn more.] + -- cgit v1.2.3 From 1abafdc8b5bf0197b2a3586737d461140e07e994 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 2 Aug 2013 14:42:03 -0700 Subject: Switching SLShareHost to pdp location --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 832610c72c..20919adc76 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3465,7 +3465,7 @@ Type String Value - http://int.fbc.aditi.lindenlab.com + http://pdp15.lindenlab.com FastCacheFetchEnabled -- cgit v1.2.3 From 56b54aaf2954765f68c4fbe843495fdcdb918744 Mon Sep 17 00:00:00 2001 From: Cho Date: Sat, 3 Aug 2013 01:42:31 +0100 Subject: made checkin use a placeholder location URL when the given SLURL is not valid --- indra/newview/llfloatersocial.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 4cbc9c0218..eb9a7d2400 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -53,6 +53,7 @@ static LLRegisterPanelClassWrapper t_panel_checkin("llsoci static LLRegisterPanelClassWrapper t_panel_account("llsocialaccountpanel"); const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte +const std::string DEFAULT_CHECKIN_LOCATION_URL = "http://maps.secondlife.com/"; const std::string DEFAULT_CHECKIN_ICON_URL = "http://logok.org/wp-content/uploads/2010/07/podcastlogo1.jpg"; std::string get_map_url() @@ -582,6 +583,13 @@ void LLSocialCheckinPanel::sendCheckin() LLSLURL slurl; LLAgentUI::buildSLURL(slurl); std::string slurl_string = slurl.getSLURLString(); + + // Use a valid http:// URL if the scheme is secondlife:// + LLURI slurl_uri(slurl_string); + if (slurl_uri.scheme() == LLSLURL::SLURL_SECONDLIFE_SCHEME) + { + slurl_string = DEFAULT_CHECKIN_LOCATION_URL; + } // Get the region name std::string region_name = gAgent.getRegion()->getName(); -- cgit v1.2.3 From a4bad4ba21787c6895368f5eb5cda7c3881d57da Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 2 Aug 2013 18:58:37 -0700 Subject: ACME-744: Temporary solution. The internal browser was not setting keyboard focus properly...as to why an investigation is needed. For now explicly setting keyboard focus to the internal browser after it is displayed. --- indra/newview/llfacebookconnect.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index e4ac2a4960..560208c31e 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -333,7 +333,9 @@ void LLFacebookConnect::openFacebookWeb(std::string url) p.url(url).allow_address_entry(false); p.url(url).allow_back_forward_navigation(false); p.url(url).trusted_content(true); - LLFloaterReg::showInstance("fbc_web", p); + LLFloater *floater = LLFloaterReg::showInstance("fbc_web", p); + //TODO Gil: Hack to give the focus to the web browser to show cursor, will fix + gFocusMgr.setKeyboardFocus( floater ); //LLUrlAction::openURLExternal(url); } -- cgit v1.2.3 From 35278461964653fc032995afdc366f096c937a14 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 2 Aug 2013 19:25:10 -0700 Subject: ACME-796 : Do not flip the fbc state to failure while connecting through web browser. Handle the dismiss case as best as possible. --- indra/newview/llfacebookconnect.cpp | 2 +- indra/newview/llfloatersocial.cpp | 6 +++++- indra/newview/llfloaterwebcontent.cpp | 11 +++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index e4ac2a4960..98fd8b1d7b 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -122,7 +122,7 @@ public: // Grab some graph data now that we are connected LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED); } - else + else if (status != 302) { LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_FAILED); log_facebook_connect_error("Connect", status, reason, content.get("error_code"), content.get("error_description")); diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index eb9a7d2400..59db93f4b2 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -684,8 +684,12 @@ void LLSocialAccountPanel::onVisibilityChange(const LLSD& new_visibility) else { showDisconnectedLayout(); - LLFacebookConnect::instance().checkConnectionToFacebook(); } + if ((LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_NOT_CONNECTED) || + (LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_CONNECTION_FAILED)) + { + LLFacebookConnect::instance().checkConnectionToFacebook(); + } } else { diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index e81055f7b1..9d703d2752 100755 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -29,6 +29,7 @@ #include "llcombobox.h" #include "lliconctrl.h" #include "llfloaterreg.h" +#include "llfacebookconnect.h" #include "lllayoutstack.h" #include "llpluginclassmedia.h" #include "llprogressbar.h" @@ -293,6 +294,16 @@ void LLFloaterWebContent::onOpen(const LLSD& key) //virtual void LLFloaterWebContent::onClose(bool app_quitting) { + // If we close the web browsing window showing the facebook login, we need to signal to this object that the connection will not happen + LLFloater* fbc_web = LLFloaterReg::getInstance("fbc_web"); + if (fbc_web == this) + { + if (!LLFacebookConnect::instance().isConnected()) + { + LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_FAILED); + } + } + LLViewerMedia::proxyWindowClosed(mUUID); destroy(); } -- cgit v1.2.3 From 14c7108ca3f646a8f7fd0d024ca200919bbf79bf Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Sat, 3 Aug 2013 06:52:56 -0700 Subject: NORSPEC-304 NORSPEC-334 NORSPEC-336 fix black glow overdraw without breaking glow --- indra/newview/lldrawpoolalpha.cpp | 5 +---- indra/newview/llvovolume.cpp | 5 ++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 1cc81fa863..237579cec5 100755 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -545,10 +545,7 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) emissive_shader->bind(); - U32 final_mask = params.mFullbright ? (mask | LLVertexBuffer::MAP_EMISSIVE) - : ((mask & ~LLVertexBuffer::MAP_COLOR) | LLVertexBuffer::MAP_EMISSIVE); - - params.mVertexBuffer->setBuffer(final_mask); + params.mVertexBuffer->setBuffer((mask & ~LLVertexBuffer::MAP_COLOR) | LLVertexBuffer::MAP_EMISSIVE); // do the actual drawing, again params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 406591046f..3eb5b19de5 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4881,7 +4881,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (emissive) { //emissive faces are present, include emissive byte to preserve batching simple_mask = simple_mask | LLVertexBuffer::MAP_EMISSIVE; - alpha_mask = alpha_mask | LLVertexBuffer::MAP_EMISSIVE; + + // doing this seems to cause NORSPEC-304 + //alpha_mask = alpha_mask | LLVertexBuffer::MAP_EMISSIVE; + bump_mask = bump_mask | LLVertexBuffer::MAP_EMISSIVE; fullbright_mask = fullbright_mask | LLVertexBuffer::MAP_EMISSIVE; norm_mask = norm_mask | LLVertexBuffer::MAP_EMISSIVE; -- cgit v1.2.3 From 9557926fff5992276811c1b1d9aa371ede9004a8 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Sat, 3 Aug 2013 08:25:03 -0700 Subject: NORSPEC-332 fix fullbright tex indexing fail --- indra/newview/lldrawpoolalpha.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 237579cec5..fca4492fbb 100755 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -529,7 +529,7 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) } } - params.mVertexBuffer->setBuffer(mask & ~(params.mFullbright ? (LLVertexBuffer::MAP_TEXTURE_INDEX | LLVertexBuffer::MAP_TANGENT | LLVertexBuffer::MAP_TEXCOORD1 | LLVertexBuffer::MAP_TEXCOORD2) : 0)); + params.mVertexBuffer->setBuffer(mask & ~(params.mFullbright ? (LLVertexBuffer::MAP_TANGENT | LLVertexBuffer::MAP_TEXCOORD1 | LLVertexBuffer::MAP_TEXCOORD2) : 0)); params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); -- cgit v1.2.3 From 938ad0c640a72dc7ee8bf39ad138e6d84d1d0a1e Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Sun, 4 Aug 2013 05:21:34 -0700 Subject: NORSPEC-305 -NORSPEC-335 fix scale and HUD anim regression from materials changes in CL 28424 --- indra/newview/llviewerobject.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 6f7b2f40e6..f29a00e4c4 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4410,12 +4410,10 @@ S32 LLViewerObject::setTEMaterialParams(const U8 te, const LLMaterialPtr pMateri void LLViewerObject::refreshMaterials() { - setChanged(ALL_CHANGED); + setChanged(TEXTURE); if (mDrawable.notNull()) { gPipeline.markTextured(mDrawable); - gPipeline.markRebuild(mDrawable,LLDrawable::REBUILD_ALL); - dirtySpatialGroup(TRUE); } } -- cgit v1.2.3 From 08e429e27df488cb8740eb82f3fb10d5011e6f5d Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 5 Aug 2013 06:23:13 -0700 Subject: NORSPEC-285 NORSPEC-293 NORSPEC-298 fix ighting diffs between alpha/non/ALM/non-ALM --- .../shaders/class1/deferred/alphaF.glsl | 48 ++++++--- .../shaders/class1/deferred/materialF.glsl | 108 ++++++++++++--------- .../class1/deferred/postDeferredGammaCorrect.glsl | 22 ++++- .../shaders/class1/deferred/softenLightF.glsl | 10 +- 4 files changed, 125 insertions(+), 63 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index d11f67ee58..d0c7cc9dde 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -133,6 +133,23 @@ vec3 linear_to_srgb(vec3 cl) } +vec2 encode_normal(vec3 n) +{ + float f = sqrt(8 * n.z + 8); + return n.xy / f + 0.5; +} + +vec3 decode_normal (vec2 enc) +{ + vec2 fenc = enc*4-2; + float f = dot(fenc,fenc); + float g = sqrt(1-f/4); + vec3 n; + n.xy = fenc*g; + n.z = 1-f/2; + return n; +} + vec3 calcDirectionalLight(vec3 n, vec3 l) { float a = max(dot(n,l),0.0); @@ -527,33 +544,42 @@ void main() vec3 norm = vary_norm; calcAtmospherics(pos.xyz, 1.0); - - float da =dot(norm.xyz, sun_dir.xyz); + + vec2 abnormal = encode_normal(norm.xyz); + norm.xyz = decode_normal(abnormal.xy); + + float da = dot(norm.xyz, sun_dir.xyz); + float final_da = da; final_da = min(final_da, shadow); - final_da = max(final_da, final_alpha); final_da = max(final_da, 0.0f); + final_da = min(final_da, 1.0f); + final_da = pow(final_da, 1.0/1.3); vec4 color = vec4(0,0,0,0); color.rgb = atmosAmbient(color.rgb); color.a = final_alpha; - float ambient = min(abs(dot(norm.xyz, sun_dir.xyz)), 1.0); + float ambient = abs(da); ambient *= 0.5; ambient *= ambient; ambient = (1.0-ambient); color.rgb *= ambient; - color.rgb += atmosAffectDirectionalLight(pow(final_da, 1.0/1.3)); + color.rgb += atmosAffectDirectionalLight(final_da); color.rgb *= gamma_diff.rgb; - color.rgb = mix(atmosLighting(color.rgb), fullbrightAtmosTransport(color.rgb), diff.a); - color.rgb = mix(scaleSoftClip(color.rgb), fullbrightScaleSoftClip(color.rgb), diff.a); + color.rgb = mix(diff.rgb, color.rgb, final_alpha); + + color.rgb = atmosLighting(color.rgb); + color.rgb = scaleSoftClip(color.rgb); vec4 light = vec4(0,0,0,0); - + + color.rgb = srgb_to_linear(color.rgb); + #define LIGHT_LOOP(i) light.rgb += calcPointLightOrSpotLight(light_diffuse[i].rgb, diff.rgb, pos.xyz, norm, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z); LIGHT_LOOP(1) @@ -566,11 +592,11 @@ void main() // keep it linear // - color.rgb = srgb_to_linear(color.rgb) + light.rgb; + color.rgb += light.rgb; - // ramp directly to display gamma as we're POST-deferred + // straight to display gamma, we're post-deferred // - color.rgb = pow(color.rgb,vec3(display_gamma)); + color.rgb = linear_to_srgb(color.rgb); #ifdef WATER_FOG color = applyWaterFogDeferred(pos.xyz, color); diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl index b3ae81d494..8202b4978f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl @@ -29,6 +29,44 @@ #define DIFFUSE_ALPHA_MODE_EMISSIVE 3 uniform float emissive_brightness; +uniform float display_gamma; + +vec3 srgb_to_linear(vec3 cs) +{ + vec3 low_range = cs / vec3(12.92); + vec3 high_range = pow((cs+vec3(0.055))/vec3(1.055), vec3(2.4)); + bvec3 lte = lessThanEqual(cs,vec3(0.04045)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lte.r ? low_range.r : high_range.r; + result.g = lte.g ? low_range.g : high_range.g; + result.b = lte.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lte); +#endif + +} + +vec3 linear_to_srgb(vec3 cl) +{ + cl = clamp(cl, vec3(0), vec3(1)); + vec3 low_range = cl * 12.92; + vec3 high_range = 1.055 * pow(cl, vec3(0.41666)) - 0.055; + bvec3 lt = lessThan(cl,vec3(0.0031308)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lt.r ? low_range.r : high_range.r; + result.g = lt.g ? low_range.g : high_range.g; + result.b = lt.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lt); +#endif + +} #if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND) @@ -114,43 +152,6 @@ uniform vec3 light_direction[8]; uniform vec3 light_attenuation[8]; uniform vec3 light_diffuse[8]; -vec3 srgb_to_linear(vec3 cs) -{ - vec3 low_range = cs / vec3(12.92); - vec3 high_range = pow((cs+vec3(0.055))/vec3(1.055), vec3(2.4)); - bvec3 lte = lessThanEqual(cs,vec3(0.04045)); - -#ifdef OLD_SELECT - vec3 result; - result.r = lte.r ? low_range.r : high_range.r; - result.g = lte.g ? low_range.g : high_range.g; - result.b = lte.b ? low_range.b : high_range.b; - return result; -#else - return mix(high_range, low_range, lte); -#endif - -} - -vec3 linear_to_srgb(vec3 cl) -{ - cl = clamp(cl, vec3(0), vec3(1)); - vec3 low_range = cl * 12.92; - vec3 high_range = 1.055 * pow(cl, vec3(0.41666)) - 0.055; - bvec3 lt = lessThan(cl,vec3(0.0031308)); - -#ifdef OLD_SELECT - vec3 result; - result.r = lt.r ? low_range.r : high_range.r; - result.g = lt.g ? low_range.g : high_range.g; - result.b = lt.b ? low_range.b : high_range.b; - return result; -#else - return mix(high_range, low_range, lt); -#endif - -} - #ifdef WATER_FOG uniform vec4 waterPlane; uniform vec4 waterFogColor; @@ -571,6 +572,9 @@ void main() norm.xyz = tnorm; norm.xyz = normalize(norm.xyz); + vec2 abnormal = encode_normal(norm.xyz); + norm.xyz = decode_normal(abnormal.xy); + vec4 final_color = diffcol; #if (DIFFUSE_ALPHA_MODE != DIFFUSE_ALPHA_MODE_EMISSIVE) @@ -666,7 +670,7 @@ void main() vec4 diffuse = final_color; float envIntensity = final_normal.z; - vec3 col = vec3(0.0f,0.0f,0.0f); + vec3 col = vec3(0.0f,0.0f,0.0f); float bloom = 0.0; calcAtmospherics(pos.xyz, 1.0); @@ -674,23 +678,28 @@ void main() vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); float da =dot(norm.xyz, sun_dir.xyz); + float final_da = da; final_da = min(final_da, shadow); - final_da = max(final_da, diffuse.a); + //final_da = max(final_da, diffuse.a); final_da = max(final_da, 0.0f); + final_da = min(final_da, 1.0f); + final_da = pow(final_da, 1.0/1.3); col.rgb = atmosAmbient(col); - float ambient = min(abs(dot(norm.xyz, sun_dir.xyz)), 1.0); + float ambient = min(abs(da), 1.0); ambient *= 0.5; ambient *= ambient; ambient = (1.0-ambient); col.rgb *= ambient; - col.rgb = col.rgb + atmosAffectDirectionalLight(pow(final_da, 1.0/1.3)); + col.rgb = col.rgb + atmosAffectDirectionalLight(final_da); + col.rgb *= gamma_diff.rgb; + float glare = 0.0; if (spec.a > 0.0) // specular reflection @@ -711,7 +720,8 @@ void main() col += spec_contrib; } - col = mix(col.rgb, gamma_diff.rgb, diffuse.a); + + col = mix(col.rgb, diffcol.rgb, diffuse.a); if (envIntensity > 0.0) { @@ -729,15 +739,20 @@ void main() glare += cur_glare; } - col = mix(atmosLighting(col), fullbrightAtmosTransport(col), diffuse.a); - col = mix(scaleSoftClip(col), fullbrightScaleSoftClip(col), diffuse.a); + //col = mix(atmosLighting(col), fullbrightAtmosTransport(col), diffuse.a); + //col = mix(scaleSoftClip(col), fullbrightScaleSoftClip(col), diffuse.a); + + col = atmosLighting(col); + col = scaleSoftClip(col); //convert to linear space before adding local lights col = srgb_to_linear(col); vec3 npos = normalize(-pos.xyz); - #define LIGHT_LOOP(i) col.rgb = col.rgb + calcPointLightOrSpotLight(light_diffuse[i].rgb, npos, diffuse.rgb, final_specular, pos.xyz, norm.xyz, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z, glare); + vec3 light = vec3(0,0,0); + + #define LIGHT_LOOP(i) light.rgb += calcPointLightOrSpotLight(light_diffuse[i].rgb, npos, diffuse.rgb, final_specular, pos.xyz, norm.xyz, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z, glare); LIGHT_LOOP(1) LIGHT_LOOP(2) @@ -747,13 +762,14 @@ void main() LIGHT_LOOP(6) LIGHT_LOOP(7) + col.rgb += light.rgb; + glare = min(glare, 1.0); float al = max(diffcol.a,glare)*vertex_color.a; //convert to gamma space for display on screen col.rgb = linear_to_srgb(col.rgb); - #ifdef WATER_FOG vec4 temp = applyWaterFogDeferred(pos, vec4(col.rgb, al)); col.rgb = temp.rgb; diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl index 89530f4082..4e2f98aa29 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl @@ -38,12 +38,30 @@ VARYING vec2 vary_fragcoord; uniform float display_gamma; -vec3 linear_to_srgb(vec3 cl); +vec3 linear_to_srgb(vec3 cl) +{ + cl = clamp(cl, vec3(0), vec3(1)); + vec3 low_range = cl * 12.92; + vec3 high_range = 1.055 * pow(cl, vec3(0.41666)) - 0.055; + bvec3 lt = lessThan(cl,vec3(0.0031308)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lt.r ? low_range.r : high_range.r; + result.g = lt.g ? low_range.g : high_range.g; + result.b = lt.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lt); +#endif + +} + void main() { vec4 diff = texture2DRect(diffuseRect, vary_fragcoord); - diff.rgb = pow(diff.rgb,vec3(display_gamma)); + diff.rgb = linear_to_srgb(diff.rgb); frag_color = diff; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 0febbcd6e0..ebe5e57bb7 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -98,7 +98,6 @@ vec3 srgb_to_linear(vec3 cs) vec3 linear_to_srgb(vec3 cl) { - cl = clamp(cl, vec3(0), vec3(1)); vec3 low_range = cl * 12.92; vec3 high_range = 1.055 * pow(cl, vec3(0.41666)) - 0.055; bvec3 lt = lessThan(cl,vec3(0.0031308)); @@ -392,8 +391,11 @@ void main() float envIntensity = norm.z; norm.xyz = decode_normal(norm.xy); // unpack norm - float da = max(dot(norm.xyz, sun_dir.xyz), 0.0); - da = pow(da, 1.0/1.3); + float da = dot(norm.xyz, sun_dir.xyz); + + float final_da = max(0.0,da); + final_da = min(final_da, 1.0f); + final_da = pow(final_da, 1.0/1.3); vec4 diffuse = texture2DRect(diffuseRect, tc); @@ -414,7 +416,7 @@ void main() col.rgb *= ambient; - col += atmosAffectDirectionalLight(max(min(da, 1.0), 0.0)); + col += atmosAffectDirectionalLight(final_da); col *= diffuse.rgb; -- cgit v1.2.3 From b75213b39ad7456d04d3e1644f2116853ead0da0 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 5 Aug 2013 11:19:54 -0400 Subject: open-185: remove duplicate gperftools entry in autobuild.xml --- autobuild.xml | 36 ------------------------------------ doc/contributions.txt | 1 + 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 628d3f6883..e13536c3b3 100755 --- a/autobuild.xml +++ b/autobuild.xml @@ -879,42 +879,6 @@ - gperftools - - license - bsd - license_file - LICENSES/gperftools.txt - name - gperftools - platforms - - linux - - archive - - hash - 8aedfdcf670348c18a9991ae1b384a61 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-perftools/rev/262672/arch/Linux/installer/gperftools-2.0-linux-20120727.tar.bz2 - - name - linux - - windows - - archive - - hash - f62841804acb91e1309603a84f3f0ce8 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-perftools/rev/262672/arch/CYGWIN/installer/gperftools-2.0-windows-20120727.tar.bz2 - - name - windows - - - gstreamer license diff --git a/doc/contributions.txt b/doc/contributions.txt index 72096a0ab7..18e8ba0189 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -300,6 +300,7 @@ Christopher Organiser Ciaran Laval Cinder Roxley BUG-2326 + OPEN-185 STORM-1703 STORM-1958 STORM-1951 -- cgit v1.2.3 From 614ee255c6ed782138daecbc8aa886fb0f4e93e2 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 5 Aug 2013 09:12:41 -0700 Subject: NORSPEC-336 intentionally rebreak 304 to fix glow while we find a fix that works for both --- indra/newview/llvovolume.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 3eb5b19de5..5dc59197ca 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4880,11 +4880,8 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (emissive) { //emissive faces are present, include emissive byte to preserve batching - simple_mask = simple_mask | LLVertexBuffer::MAP_EMISSIVE; - - // doing this seems to cause NORSPEC-304 - //alpha_mask = alpha_mask | LLVertexBuffer::MAP_EMISSIVE; - + simple_mask = simple_mask | LLVertexBuffer::MAP_EMISSIVE; + alpha_mask = alpha_mask | LLVertexBuffer::MAP_EMISSIVE; bump_mask = bump_mask | LLVertexBuffer::MAP_EMISSIVE; fullbright_mask = fullbright_mask | LLVertexBuffer::MAP_EMISSIVE; norm_mask = norm_mask | LLVertexBuffer::MAP_EMISSIVE; -- cgit v1.2.3 From fe69b4049bdbdf36a179ccc28a2f253af13e61c5 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Mon, 5 Aug 2013 10:16:17 -0700 Subject: NORSPEC-304 NORSPEC-336 another attempt as resolving black glow overdraw without breaking glow (even for alpha-blended) faces --- indra/newview/lldrawpoolalpha.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index fca4492fbb..b5d37ba5cc 100755 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -128,14 +128,22 @@ void LLDrawPoolAlpha::beginPostDeferredPass(S32 pass) gObjectFullbrightAlphaMaskProgram.setMinimumAlpha(0.33f); } - if (LLPipeline::sUnderWaterRender) - { - emissive_shader = &gObjectEmissiveWaterProgram; - } - else - { - emissive_shader = &gObjectEmissiveProgram; - } + + if (LLPipeline::sRenderDeferred) + { + emissive_shader = &gDeferredEmissiveProgram; + } + else + { + if (LLPipeline::sUnderWaterRender) + { + emissive_shader = &gObjectEmissiveWaterProgram; + } + else + { + emissive_shader = &gObjectEmissiveProgram; + } + } deferred_render = TRUE; if (mVertexShaderLevel > 0) -- cgit v1.2.3 From d9d1d2722737069618e15eac2f33ac4600c357ba Mon Sep 17 00:00:00 2001 From: Cho Date: Mon, 5 Aug 2013 19:04:08 +0100 Subject: changed wording of learn more link for ACME-797 --- indra/newview/skins/default/xui/en/panel_social_account.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_social_account.xml b/indra/newview/skins/default/xui/en/panel_social_account.xml index 957d117d9d..882e410bdb 100644 --- a/indra/newview/skins/default/xui/en/panel_social_account.xml +++ b/indra/newview/skins/default/xui/en/panel_social_account.xml @@ -65,11 +65,11 @@ length="1" follows="top|left" height="16" - left="3" + left="0" name="account_learn_more_label" - top_pad="5" + top_pad="20" type="string"> - [https://support.secondlife.com/ Learn more.] + [https://support.secondlife.com/ Learn about posting to Facebook] -- cgit v1.2.3 From efba897e45b5065619bbe0e1451a40b6391e503c Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 5 Aug 2013 15:38:43 -0400 Subject: correct coding standards problems --- indra/llwindow/llopenglview-objc.h | 2 +- indra/newview/CMakeLists.txt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/llwindow/llopenglview-objc.h b/indra/llwindow/llopenglview-objc.h index 71149f8561..41837b1eb4 100644 --- a/indra/llwindow/llopenglview-objc.h +++ b/indra/llwindow/llopenglview-objc.h @@ -107,4 +107,4 @@ @end -#endif \ No newline at end of file +#endif diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index df70cd21f1..b81b4a14bd 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1990,9 +1990,9 @@ if (DARWIN) set_target_properties( ${VIEWER_BINARY_NAME} PROPERTIES - OUTPUT_NAME "${product}" - MACOSX_BUNDLE_INFO_PLIST - "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" + OUTPUT_NAME "${product}" + MACOSX_BUNDLE_INFO_PLIST + "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" ) configure_file( -- cgit v1.2.3 From c7342bc6c0950add28918159935b8001c4ad2dc8 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 6 Aug 2013 10:27:18 -0700 Subject: ACME-744: Adjusted comment to be more clear --- indra/newview/llfacebookconnect.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 645f62579d..ad776b2d1a 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -334,7 +334,10 @@ void LLFacebookConnect::openFacebookWeb(std::string url) p.url(url).allow_back_forward_navigation(false); p.url(url).trusted_content(true); LLFloater *floater = LLFloaterReg::showInstance("fbc_web", p); - //TODO Gil: Hack to give the focus to the web browser to show cursor, will fix + //the internal web browser has a bug that prevents it from gaining focus unless a mouse event occurs first (it seems). + //So when showing the internal web browser, set focus to it's containing floater "fbc_web". When a mouse event + //occurs on the "webbrowser" panel part of the floater, a mouse cursor will properly show and the "webbrowser" will gain focus. + //fbc_web floater contains the "webbrowser" panel. JIRA: ACME-744 gFocusMgr.setKeyboardFocus( floater ); //LLUrlAction::openURLExternal(url); -- cgit v1.2.3 From 5b400d50e1f25667e2c865d85fd93546ffe7f96f Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 6 Aug 2013 14:16:46 -0700 Subject: NORSPEC-322 NORSPEC-342 fix issues with black impostors and missing alpha attachments on impostors --- .../shaders/class1/deferred/impostorF.glsl | 31 +++++++++++++++++++--- indra/newview/lldrawpoolalpha.cpp | 9 +++++-- indra/newview/lldrawpoolavatar.cpp | 21 +++------------ indra/newview/pipeline.cpp | 21 +++++++-------- 4 files changed, 48 insertions(+), 34 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl index bc0719cb82..d52744103f 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl @@ -38,6 +38,31 @@ uniform sampler2D specularMap; VARYING vec2 vary_texcoord0; +vec2 encode_normal(vec3 n) +{ + float f = sqrt(8 * n.z + 8); + return n.xy / f + 0.5; +} + +vec3 linear_to_srgb(vec3 cl) +{ + cl = clamp(cl, vec3(0), vec3(1)); + vec3 low_range = cl * 12.92; + vec3 high_range = 1.055 * pow(cl, vec3(0.41666)) - 0.055; + bvec3 lt = lessThan(cl,vec3(0.0031308)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lt.r ? low_range.r : high_range.r; + result.g = lt.g ? low_range.g : high_range.g; + result.b = lt.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lt); +#endif + +} + void main() { vec4 col = texture2D(diffuseMap, vary_texcoord0.xy); @@ -47,7 +72,7 @@ void main() discard; } - frag_data[0] = vec4(col.rgb, col.a * 0.005); - frag_data[1] = texture2D(specularMap, vary_texcoord0.xy); - frag_data[2] = vec4(texture2D(normalMap, vary_texcoord0.xy).xyz, 0.0); + frag_data[0] = vec4(linear_to_srgb(col.rgb), col.a); + frag_data[1] = vec4(texture2D(specularMap, vary_texcoord0.xy)); + frag_data[2] = vec4(texture2D(normalMap, vary_texcoord0.xy).xy,0,0); } diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index b5d37ba5cc..60e22c08dc 100755 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -224,8 +224,13 @@ void LLDrawPoolAlpha::render(S32 pass) gGL.setColorMask(true, true); } - LLGLDepthTest depth(GL_TRUE, LLDrawPoolWater::sSkipScreenCopy || - (deferred_render && pass == 1) ? GL_TRUE : GL_FALSE); + bool write_depth = LLDrawPoolWater::sSkipScreenCopy + || (deferred_render && pass == 1) + // we want depth written so that rendered alpha will + // contribute to the alpha mask used for impostors + || LLPipeline::sImpostorRender; + + LLGLDepthTest depth(GL_TRUE, write_depth ? GL_TRUE : GL_FALSE); if (deferred_render && pass == 1) { diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index e2a23ef56f..9434b51685 100755 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -505,7 +505,7 @@ S32 LLDrawPoolAvatar::getNumDeferredPasses() { if (LLPipeline::sImpostorRender) { - return 3; + return 19; } else { @@ -690,28 +690,15 @@ void LLDrawPoolAvatar::beginDeferredImpostor() LLVOAvatar::sNumVisibleAvatars = 0; } -#if DEFERRED_IMPOSTORS sVertexProgram = &gDeferredImpostorProgram; - - specular_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::SPECULAR_MAP); - normal_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::DEFERRED_NORMAL); - sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); -#else - sVertexProgram = &gImpostorProgram; - sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); -#endif - sVertexProgram->bind(); + gPipeline.bindDeferredShader(*sVertexProgram); sVertexProgram->setMinimumAlpha(0.01f); } void LLDrawPoolAvatar::endDeferredImpostor() { sShaderLevel = mVertexShaderLevel; - sVertexProgram->disableTexture(LLViewerShaderMgr::DEFERRED_NORMAL); - sVertexProgram->disableTexture(LLViewerShaderMgr::SPECULAR_MAP); - sVertexProgram->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP); - sVertexProgram->unbind(); - gGL.getTexUnit(0)->activate(); + gPipeline.unbindDeferredShader(*sVertexProgram); } void LLDrawPoolAvatar::beginDeferredRigid() @@ -1268,7 +1255,6 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) if (impostor) { -#if DEFERRED_IMPOSTORS if (LLPipeline::sRenderDeferred && !LLPipeline::sReflectionRender && avatarp->mImpostor.isComplete()) { if (normal_channel > -1) @@ -1280,7 +1266,6 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) avatarp->mImpostor.bindTexture(1, specular_channel); } } -#endif avatarp->renderImpostor(LLColor4U(255,255,255,255), sDiffuseChannel); } return; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 9aa375767b..29b7e30655 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -11358,15 +11358,18 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) if (!avatar->mImpostor.isComplete()) { LLFastTimer t(FTM_IMPOSTOR_ALLOCATE); - avatar->mImpostor.allocate(resX,resY,GL_RGBA,TRUE,FALSE); + -#if DEFERRED_IMPOSTORS if (LLPipeline::sRenderDeferred) { + avatar->mImpostor.allocate(resX,resY,GL_SRGB8_ALPHA8,TRUE,FALSE); addDeferredAttachments(avatar->mImpostor); } -#endif - + else + { + avatar->mImpostor.allocate(resX,resY,GL_RGBA,TRUE,FALSE); + } + gGL.getTexUnit(0)->bind(&avatar->mImpostor); gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -11374,38 +11377,34 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) else if(resX != avatar->mImpostor.getWidth() || resY != avatar->mImpostor.getHeight()) { LLFastTimer t(FTM_IMPOSTOR_RESIZE); - avatar->mImpostor.resize(resX,resY,GL_RGBA); + avatar->mImpostor.resize(resX,resY,LLPipeline::sRenderDeferred ? GL_SRGB8_ALPHA8 : GL_RGBA); } avatar->mImpostor.bindTarget(); } -#if DEFERRED_IMPOSTORS if (LLPipeline::sRenderDeferred) { - avatar->mImpostor.clear(); + avatar->mImpostor.clear(); renderGeomDeferred(camera); renderGeomPostDeferred(camera); } else -#endif { LLGLEnable scissor(GL_SCISSOR_TEST); glScissor(0, 0, resX, resY); avatar->mImpostor.clear(); renderGeom(camera); } - + { //create alpha mask based on depth buffer (grey out if muted) LLFastTimer t(FTM_IMPOSTOR_BACKGROUND); -#if DEFERRED_IMPOSTORS if (LLPipeline::sRenderDeferred) { GLuint buff = GL_COLOR_ATTACHMENT0; glDrawBuffersARB(1, &buff); } -#endif LLGLDisable blend(GL_BLEND); -- cgit v1.2.3 From 3e08ccf6abb6f6ca7f1fa2fc6e80fd6589203f28 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 6 Aug 2013 17:12:32 -0700 Subject: ACME-801: Adding a suggested friend as a friend does not remove them from the suggested friend list --- indra/newview/llfacebookconnect.cpp | 5 +---- indra/newview/llfacebookconnect.h | 2 -- indra/newview/llpanelpeople.cpp | 42 ++++++++++++++++--------------------- indra/newview/llpanelpeople.h | 1 - 4 files changed, 19 insertions(+), 31 deletions(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index ad776b2d1a..bdc17773d7 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -320,8 +320,7 @@ LLFacebookConnect::LLFacebookConnect() : mConnectionState(FB_NOT_CONNECTED), mConnected(false), mInfo(), - mContent(), - mGeneration(0) + mContent() { } @@ -506,7 +505,6 @@ const LLSD& LLFacebookConnect::getInfo() const void LLFacebookConnect::storeContent(const LLSD& content) { - mGeneration++; mContent = content; sContentWatcher->post(content); @@ -519,7 +517,6 @@ const LLSD& LLFacebookConnect::getContent() const void LLFacebookConnect::clearContent() { - mGeneration++; mContent = LLSD(); } diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index b9afd181e9..0f005cbe24 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -78,7 +78,6 @@ public: bool isConnected() { return mConnected; } bool isTransactionOngoing() { return ((mConnectionState == FB_CONNECTION_IN_PROGRESS) || (mConnectionState == FB_POSTING) || (mConnectionState == FB_DISCONNECTING)); } EConnectionState getConnectionState() { return mConnectionState; } - S32 generation() { return mGeneration; } void openFacebookWeb(std::string url); @@ -93,7 +92,6 @@ private: BOOL mConnected; LLSD mInfo; LLSD mContent; - S32 mGeneration; static boost::scoped_ptr sStateWatcher; static boost::scoped_ptr sInfoWatcher; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index f1ee76f733..1786f73a8b 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -510,8 +510,7 @@ LLPanelPeople::LLPanelPeople() mNearbyList(NULL), mRecentList(NULL), mGroupList(NULL), - mMiniMap(NULL), - mFacebookListGeneration(0) + mMiniMap(NULL) { mFriendListUpdater = new LLFriendListUpdater(boost::bind(&LLPanelPeople::updateFriendList, this)); mNearbyListUpdater = new LLNearbyListUpdater(boost::bind(&LLPanelPeople::updateNearbyList, this)); @@ -783,36 +782,31 @@ void LLPanelPeople::updateFriendList() bool LLPanelPeople::updateSuggestedFriendList() { - if (LLFacebookConnect::instance().generation() != mFacebookListGeneration) - { - mFacebookListGeneration = LLFacebookConnect::instance().generation(); + const LLAvatarTracker& av_tracker = LLAvatarTracker::instance(); + uuid_vec_t& suggested_friends = mSuggestedFriends->getIDs(); + suggested_friends.clear(); - const LLAvatarTracker& av_tracker = LLAvatarTracker::instance(); - uuid_vec_t& suggested_friends = mSuggestedFriends->getIDs(); - suggested_friends.clear(); + //Add suggested friends + LLSD friends = LLFacebookConnect::instance().getContent(); + for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i) + { + LLUUID agent_id = (*i).asUUID(); + bool second_life_buddy = agent_id.notNull() ? av_tracker.isBuddy(agent_id) : false; - //Add suggested friends - LLSD friends = LLFacebookConnect::instance().getContent(); - for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i) + if(!second_life_buddy) { - LLUUID agent_id = (*i).asUUID(); - bool second_life_buddy = agent_id.notNull() ? av_tracker.isBuddy(agent_id) : false; - - if(!second_life_buddy) + //FB+SL but not SL friend + if (agent_id.notNull()) { - //FB+SL but not SL friend - if (agent_id.notNull()) - { - suggested_friends.push_back(agent_id); - } + suggested_friends.push_back(agent_id); } } - - //Force a refresh when there aren't any filter matches (prevent displaying content that shouldn't display) - mSuggestedFriends->setDirty(true, !mSuggestedFriends->filterHasMatches()); - showFriendsAccordionsIfNeeded(); } + //Force a refresh when there aren't any filter matches (prevent displaying content that shouldn't display) + mSuggestedFriends->setDirty(true, !mSuggestedFriends->filterHasMatches()); + showFriendsAccordionsIfNeeded(); + return false; } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index b746835dfb..c7141f36ee 100755 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -140,7 +140,6 @@ private: LLAvatarList* mNearbyList; LLAvatarList* mRecentList; LLGroupList* mGroupList; - S32 mFacebookListGeneration; LLNetMap* mMiniMap; std::vector mSavedOriginalFilters; -- cgit v1.2.3 From 83fa549b56826f55f0f30244dbceda77a8a5dbfe Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Tue, 6 Aug 2013 18:02:26 -0700 Subject: NORSPEC-322 NORSPEC-342 WIP fix black deferred impostors, lighting bugs remain --- indra/newview/lldrawpoolavatar.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 9434b51685..9dbc85d121 100755 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -691,6 +691,9 @@ void LLDrawPoolAvatar::beginDeferredImpostor() } sVertexProgram = &gDeferredImpostorProgram; + specular_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::SPECULAR_MAP); + normal_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::DEFERRED_NORMAL); + sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); gPipeline.bindDeferredShader(*sVertexProgram); sVertexProgram->setMinimumAlpha(0.01f); } @@ -698,7 +701,12 @@ void LLDrawPoolAvatar::beginDeferredImpostor() void LLDrawPoolAvatar::endDeferredImpostor() { sShaderLevel = mVertexShaderLevel; + sVertexProgram->disableTexture(LLViewerShaderMgr::DEFERRED_NORMAL); + sVertexProgram->disableTexture(LLViewerShaderMgr::SPECULAR_MAP); + sVertexProgram->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP); gPipeline.unbindDeferredShader(*sVertexProgram); + sVertexProgram = NULL; + sDiffuseChannel = 0; } void LLDrawPoolAvatar::beginDeferredRigid() -- cgit v1.2.3 From bfe2377a9a3061094e3c1fa10bb0afed06cac709 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 7 Aug 2013 08:42:35 -0700 Subject: NORSPEC-342 WIP fix issues with skimpy clothes getting too skimpy in impostors --- .../shaders/class1/deferred/impostorF.glsl | 20 ++++++++++++--- indra/newview/lldrawpoolalpha.cpp | 2 +- indra/newview/pipeline.cpp | 29 +++++++++++++++++++++- indra/newview/pipeline.h | 1 + 4 files changed, 47 insertions(+), 5 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl index d52744103f..d1eaabf901 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl @@ -38,6 +38,17 @@ uniform sampler2D specularMap; VARYING vec2 vary_texcoord0; +vec3 decode_normal (vec2 enc) +{ + vec2 fenc = enc*4-2; + float f = dot(fenc,fenc); + float g = sqrt(1-f/4); + vec3 n; + n.xy = fenc*g; + n.z = 1-f/2; + return n; +} + vec2 encode_normal(vec3 n) { float f = sqrt(8 * n.z + 8); @@ -72,7 +83,10 @@ void main() discard; } - frag_data[0] = vec4(linear_to_srgb(col.rgb), col.a); - frag_data[1] = vec4(texture2D(specularMap, vary_texcoord0.xy)); - frag_data[2] = vec4(texture2D(normalMap, vary_texcoord0.xy).xy,0,0); + vec4 norm = texture2D(normalMap, vary_texcoord0.xy); + vec4 spec = texture2D(specularMap, vary_texcoord0.xy); + + frag_data[0] = vec4(col.rgb, col.a); + frag_data[1] = spec; + frag_data[2] = vec4(norm.xy,0,0); } diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 60e22c08dc..8b2cbb1b9d 100755 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -228,7 +228,7 @@ void LLDrawPoolAlpha::render(S32 pass) || (deferred_render && pass == 1) // we want depth written so that rendered alpha will // contribute to the alpha mask used for impostors - || LLPipeline::sImpostorRender; + || LLPipeline::sImpostorRenderAlphaDepthPass; LLGLDepthTest depth(GL_TRUE, write_depth ? GL_TRUE : GL_FALSE); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 29b7e30655..9378c89eb7 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -379,6 +379,7 @@ BOOL LLPipeline::sWaterReflections = FALSE; BOOL LLPipeline::sRenderGlow = FALSE; BOOL LLPipeline::sReflectionRender = FALSE; BOOL LLPipeline::sImpostorRender = FALSE; +BOOL LLPipeline::sImpostorRenderAlphaDepthPass = FALSE; BOOL LLPipeline::sUnderWaterRender = FALSE; BOOL LLPipeline::sTextureBindTest = FALSE; BOOL LLPipeline::sRenderFrameTest = FALSE; @@ -11387,14 +11388,40 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) { avatar->mImpostor.clear(); renderGeomDeferred(camera); + + renderGeomPostDeferred(camera); + + // Shameless hack time: render it all again, + // this time writing the depth + // values we need to generate the alpha mask below + // while preserving the alpha-sorted color rendering + // from the previous pass + // + sImpostorRenderAlphaDepthPass = true; + // depth-only here... + // + gGL.setColorMask(false,false); renderGeomPostDeferred(camera); + sImpostorRenderAlphaDepthPass = false; } else - { + { LLGLEnable scissor(GL_SCISSOR_TEST); glScissor(0, 0, resX, resY); avatar->mImpostor.clear(); renderGeom(camera); + + // Shameless hack time: render it all again, + // this time writing the depth + // values we need to generate the alpha mask below + // while preserving the alpha-sorted color rendering + // from the previous pass + // + sImpostorRenderAlphaDepthPass = true; + // depth-only here... + // + gGL.setColorMask(false,false); + renderGeom(camera); } { //create alpha mask based on depth buffer (grey out if muted) diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 36b293b998..5e68524067 100755 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -588,6 +588,7 @@ public: static BOOL sPickAvatar; static BOOL sReflectionRender; static BOOL sImpostorRender; + static BOOL sImpostorRenderAlphaDepthPass; static BOOL sUnderWaterRender; static BOOL sRenderGlow; static BOOL sTextureBindTest; -- cgit v1.2.3 From f3952f9a8dc368c991d9aaac174bfee5a0dd90e9 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 7 Aug 2013 13:35:08 -0700 Subject: NORSPEC-329 fix mangling of diffuse alpha mode by material edits when only one face really has alpha --- indra/newview/llpanelface.h | 15 ++++++++++++++- indra/newview/llviewerobject.cpp | 24 ++++++++++++++++++++++++ indra/newview/llviewerobject.h | 2 ++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 834ad9e14c..06a45644d0 100755 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -255,7 +255,20 @@ private: // Determine correct alpha mode for current diffuse texture // (i.e. does it have an alpha channel that makes alpha mode useful) // - U8 default_alpha_mode = (_panel->isAlpha() ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : LLMaterial::DIFFUSE_ALPHA_MODE_NONE); + // _panel->isAlpha() "lies" when one face has alpha and the rest do not (NORSPEC-329) + // need to get per-face answer to this question for sane alpha mode retention on updates. + // + U8 default_alpha_mode = object->isImageAlphaBlended(face) ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : LLMaterial::DIFFUSE_ALPHA_MODE_NONE; + + if (!current_material.isNull()) + { + default_alpha_mode = current_material->getDiffuseAlphaMode(); + } + + // Insure we don't inherit the default of blend by accident... + // this will be stomped by a legit request to change the alpha mode by the apply() below + // + new_material->setDiffuseAlphaMode(default_alpha_mode); // Do "It"! // diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index f29a00e4c4..0070240803 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4517,6 +4517,30 @@ LLViewerTexture *LLViewerObject::getTEImage(const U8 face) const } +bool LLViewerObject::isImageAlphaBlended(const U8 te) const +{ + LLViewerTexture* image = getTEImage(te); + LLGLenum format = image ? image->getPrimaryFormat() : GL_RGB; + switch (format) + { + case GL_RGBA: + case GL_ALPHA: + { + return true; + } + break; + + case GL_RGB: break; + default: + { + llwarns << "Unexpected tex format in LLViewerObject::isImageAlphaBlended...returning no alpha." << llendl; + } + break; + } + + return false; +} + LLViewerTexture *LLViewerObject::getTENormalMap(const U8 face) const { // llassert(mTEImages); diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index ea0d55cda5..16f1f403d3 100755 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -339,6 +339,8 @@ public: LLViewerTexture *getTENormalMap(const U8 te) const; LLViewerTexture *getTESpecularMap(const U8 te) const; + bool isImageAlphaBlended(const U8 te) const; + void fitFaceTexture(const U8 face); void sendTEUpdate() const; // Sends packed representation of all texture entry information -- cgit v1.2.3 From e156e3ff32469d5efdfd4fb96969b8cc4bc056b8 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 7 Aug 2013 15:37:53 -0700 Subject: NORSPEC-343 protect against edits that would set non-alpha faces to diffuse alpha mode blend --- indra/newview/llpanelface.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 06a45644d0..86642e5635 100755 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -258,7 +258,8 @@ private: // _panel->isAlpha() "lies" when one face has alpha and the rest do not (NORSPEC-329) // need to get per-face answer to this question for sane alpha mode retention on updates. // - U8 default_alpha_mode = object->isImageAlphaBlended(face) ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : LLMaterial::DIFFUSE_ALPHA_MODE_NONE; + bool is_alpha_face = object->isImageAlphaBlended(face); + U8 default_alpha_mode = is_alpha_face ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : LLMaterial::DIFFUSE_ALPHA_MODE_NONE; if (!current_material.isNull()) { @@ -278,6 +279,11 @@ private: LLUUID new_normal_map_id = new_material->getNormalID(); LLUUID new_spec_map_id = new_material->getSpecularID(); + if ((new_alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND) && !is_alpha_face) + { + new_alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE; + } + bool is_default_blend_mode = (new_alpha_mode == default_alpha_mode); bool is_need_material = !is_default_blend_mode || !new_normal_map_id.isNull() || !new_spec_map_id.isNull(); -- cgit v1.2.3 From 9167198312ac98f02640ecc3c445fa721413febd Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 7 Aug 2013 16:12:29 -0700 Subject: ACME-814 : Disable Post in Photo panel while the preview is processing --- indra/newview/llfloatersocial.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 59db93f4b2..937f76648d 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -205,8 +205,8 @@ void LLSocialPhotoPanel::draw() { LLSnapshotLivePreview * previewp = static_cast(mPreviewHandle.get()); + // Enable interaction only if no transaction with the service is on-going (prevent duplicated posts) bool no_ongoing_connection = !(LLFacebookConnect::instance().isTransactionOngoing()); - mPostButton->setEnabled(no_ongoing_connection); mCancelButton->setEnabled(no_ongoing_connection); mCaptionTextBox->setEnabled(no_ongoing_connection); mResolutionComboBox->setEnabled(no_ongoing_connection); @@ -247,6 +247,9 @@ void LLSocialPhotoPanel::draw() // Update the visibility of the working (computing preview) label mWorkingLabel->setVisible(!(previewp && previewp->getSnapshotUpToDate())); + // Enable Post if we have a preview to send and no on going connection being processed + mPostButton->setEnabled(no_ongoing_connection && (previewp && previewp->getSnapshotUpToDate())); + // Draw the rest of the panel on top of it LLPanel::draw(); } -- cgit v1.2.3 From 79686b6974bb07063f2ff470d4ff0cfd38ac8847 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Wed, 7 Aug 2013 16:30:27 -0700 Subject: NORSPEC-342 fix alpha objects appearing black in impostor images --- indra/newview/lldrawpoolalpha.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 8b2cbb1b9d..ba83c95518 100755 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -548,7 +548,8 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); // If this alpha mesh has glow, then draw it a second time to add the destination-alpha (=glow). Interleaving these state-changing calls could be expensive, but glow must be drawn Z-sorted with alpha. - if (current_shader && + if (current_shader && + !LLPipeline::sImpostorRender && draw_glow_for_this_partition && params.mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_EMISSIVE)) { -- cgit v1.2.3 From 9c1b45b16763d452a3c9175186217d005a9cfd2b Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 7 Aug 2013 17:23:23 -0700 Subject: NORSPEC-343 fix oversight and actually apply override to new material when no alpha is present --- indra/newview/llpanelface.h | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 86642e5635..562d293d56 100755 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -282,6 +282,7 @@ private: if ((new_alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND) && !is_alpha_face) { new_alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE; + new_material->setDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_NONE); } bool is_default_blend_mode = (new_alpha_mode == default_alpha_mode); -- cgit v1.2.3 From 77baf98d12c75621f8b1d69824abf01b9aa260f7 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 7 Aug 2013 18:45:50 -0700 Subject: ACME-820 : Let checkin checkbox be available and swap tile map / default tile when toggling --- indra/newview/llfloatersocial.cpp | 11 +++++------ indra/newview/llfloatersocial.h | 2 +- .../default/textures/icons/map_placeholder.jpg | Bin 25641 -> 12931 bytes .../skins/default/xui/en/panel_social_place.xml | 13 ++++++++++++- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 937f76648d..66a586b16b 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -499,8 +499,8 @@ BOOL LLSocialCheckinPanel::postBuild() mMessageTextEditor = getChild("place_caption"); mMapLoadingIndicator = getChild("map_loading_indicator"); mMapPlaceholder = getChild("map_placeholder"); + mMapDefault = getChild("map_default"); mMapCheckBox = getChild("add_place_view_cb"); - mMapCheckBoxValue = mMapCheckBox->get(); return LLPanel::postBuild(); } @@ -511,6 +511,7 @@ void LLSocialCheckinPanel::draw() mPostButton->setEnabled(no_ongoing_connection); mCancelButton->setEnabled(no_ongoing_connection); mMessageTextEditor->setEnabled(no_ongoing_connection); + mMapCheckBox->setEnabled(no_ongoing_connection); std::string map_url = get_map_url(); // Did we change location? @@ -524,9 +525,6 @@ void LLSocialCheckinPanel::draw() // In the meantime, put the "loading" indicator on, hide the tile map and disable the checkbox mMapLoadingIndicator->setVisible(true); mMapPlaceholder->setVisible(false); - mMapCheckBoxValue = mMapCheckBox->get(); - mMapCheckBox->set(false); - mMapCheckBox->setEnabled(false); } // Are we done loading the map tile? if (mReloadingMapTexture && mMapTexture->isFullyLoaded()) @@ -540,9 +538,10 @@ void LLSocialCheckinPanel::draw() // Now hide the loading indicator, bring the tile in view and reenable the checkbox with its previous value mMapLoadingIndicator->setVisible(false); mMapPlaceholder->setVisible(true); - mMapCheckBox->setEnabled(no_ongoing_connection); - mMapCheckBox->set(mMapCheckBoxValue); } + // Show the default icon if that's the checkbox value (the real one...) + // This will hide/show the loading indicator and/or tile underneath + mMapDefault->setVisible(!(mMapCheckBox->get())); LLPanel::draw(); } diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index e7ad9ac12e..bbe07c9704 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -110,9 +110,9 @@ private: LLUICtrl* mMessageTextEditor; LLUICtrl* mMapLoadingIndicator; LLIconCtrl* mMapPlaceholder; + LLIconCtrl* mMapDefault; LLCheckBoxCtrl* mMapCheckBox; bool mReloadingMapTexture; - bool mMapCheckBoxValue; }; class LLSocialAccountPanel : public LLPanel diff --git a/indra/newview/skins/default/textures/icons/map_placeholder.jpg b/indra/newview/skins/default/textures/icons/map_placeholder.jpg index 0cb86c58d3..57204e2261 100644 Binary files a/indra/newview/skins/default/textures/icons/map_placeholder.jpg and b/indra/newview/skins/default/textures/icons/map_placeholder.jpg differ diff --git a/indra/newview/skins/default/xui/en/panel_social_place.xml b/indra/newview/skins/default/xui/en/panel_social_place.xml index b53a41487a..13e94f6998 100644 --- a/indra/newview/skins/default/xui/en/panel_social_place.xml +++ b/indra/newview/skins/default/xui/en/panel_social_place.xml @@ -71,9 +71,20 @@ visible="true" name="map_placeholder"> + + Date: Thu, 8 Aug 2013 18:57:27 -0700 Subject: ACME-821 : Use 128x128 png for the default tile icon instead of 300x300 jpg --- .../skins/default/textures/icons/map_placeholder.jpg | Bin 12931 -> 0 bytes .../skins/default/textures/icons/map_placeholder.png | Bin 0 -> 7694 bytes indra/newview/skins/default/textures/textures.xml | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 indra/newview/skins/default/textures/icons/map_placeholder.jpg create mode 100644 indra/newview/skins/default/textures/icons/map_placeholder.png diff --git a/indra/newview/skins/default/textures/icons/map_placeholder.jpg b/indra/newview/skins/default/textures/icons/map_placeholder.jpg deleted file mode 100644 index 57204e2261..0000000000 Binary files a/indra/newview/skins/default/textures/icons/map_placeholder.jpg and /dev/null differ diff --git a/indra/newview/skins/default/textures/icons/map_placeholder.png b/indra/newview/skins/default/textures/icons/map_placeholder.png new file mode 100644 index 0000000000..31e457aa75 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/map_placeholder.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 4100849f6f..94c187e21a 100755 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -326,7 +326,7 @@ with the same filename but different name - + -- cgit v1.2.3 From fff55ee5d057aeb50b0c7f096ede659ee71bb25e Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 9 Aug 2013 13:21:25 -0700 Subject: ACME-800: Posted to Facebook notifications persist in the open_notifications.xml file per user --- indra/newview/skins/default/xui/en/notifications.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index a3592bce4a..46ebdcff54 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -5995,7 +5995,6 @@ Please select at least one type of content to search (General, Moderate, or Adul [MESSAGE] -- cgit v1.2.3 From 481abb13812214d7d5f1124f8eb80f1cc1b08c19 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 9 Aug 2013 18:31:10 -0700 Subject: ACME 824: Suggested Friends do not repopulate if you disconnect and reconnect to Facebook API in same viewer session --- indra/newview/llfacebookconnect.cpp | 47 ++++++++++++++++++++++++++++--------- indra/newview/llfacebookconnect.h | 6 ++++- indra/newview/llpanelpeople.cpp | 34 +++++++++++++-------------- 3 files changed, 58 insertions(+), 29 deletions(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index bdc17773d7..5551acff0d 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -197,9 +197,11 @@ public: { LL_DEBUGS("FacebookConnect") << "Disconnect successful. content: " << content << LL_ENDL; - // Clear all facebook stuff - LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED); + // Clear data + LLFacebookConnect::instance().clearInfo(); LLFacebookConnect::instance().clearContent(); + //Notify state change + LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED); } else { @@ -320,7 +322,9 @@ LLFacebookConnect::LLFacebookConnect() : mConnectionState(FB_NOT_CONNECTED), mConnected(false), mInfo(), - mContent() + mContent(), + mRefreshInfo(false), + mRefreshContent(false) { } @@ -388,18 +392,24 @@ void LLFacebookConnect::checkConnectionToFacebook(bool auto_connect) void LLFacebookConnect::loadFacebookInfo() { - const bool follow_redirects = false; - const F32 timeout = HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/info"), new LLFacebookInfoResponder(), - LLSD(), timeout, follow_redirects); + if(mRefreshInfo) + { + const bool follow_redirects = false; + const F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + LLHTTPClient::get(getFacebookConnectURL("/info"), new LLFacebookInfoResponder(), + LLSD(), timeout, follow_redirects); + } } void LLFacebookConnect::loadFacebookFriends() { - const bool follow_redirects = false; - const F32 timeout = HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/friends"), new LLFacebookFriendsResponder(), - LLSD(), timeout, follow_redirects); + if(mRefreshContent) + { + const bool follow_redirects = false; + const F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + LLHTTPClient::get(getFacebookConnectURL("/friends"), new LLFacebookFriendsResponder(), + LLSD(), timeout, follow_redirects); + } } void LLFacebookConnect::postCheckin(const std::string& location, const std::string& name, const std::string& description, const std::string& image, const std::string& message) @@ -495,6 +505,8 @@ void LLFacebookConnect::updateStatus(const std::string& message) void LLFacebookConnect::storeInfo(const LLSD& info) { mInfo = info; + mRefreshInfo = false; + sInfoWatcher->post(info); } @@ -503,9 +515,15 @@ const LLSD& LLFacebookConnect::getInfo() const return mInfo; } +void LLFacebookConnect::clearInfo() +{ + mInfo = LLSD(); +} + void LLFacebookConnect::storeContent(const LLSD& content) { mContent = content; + mRefreshContent = false; sContentWatcher->post(content); } @@ -520,11 +538,18 @@ void LLFacebookConnect::clearContent() mContent = LLSD(); } +void LLFacebookConnect::setDataDirty() +{ + mRefreshInfo = true; + mRefreshContent = true; +} + void LLFacebookConnect::setConnectionState(LLFacebookConnect::EConnectionState connection_state) { if(connection_state == FB_CONNECTED) { setConnected(true); + setDataDirty(); } else if(connection_state == FB_NOT_CONNECTED) { diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index 0f005cbe24..77c26842de 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -69,9 +69,11 @@ public: void storeInfo(const LLSD& info); const LLSD& getInfo() const; - void clearContent(); + void clearInfo(); void storeContent(const LLSD& content); const LLSD& getContent() const; + void clearContent(); + void setDataDirty(); void setConnectionState(EConnectionState connection_state); void setConnected(bool connected); @@ -92,6 +94,8 @@ private: BOOL mConnected; LLSD mInfo; LLSD mContent; + bool mRefreshInfo; + bool mRefreshContent; static boost::scoped_ptr sStateWatcher; static boost::scoped_ptr sInfoWatcher; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 1786f73a8b..72953ec6d3 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -835,12 +835,16 @@ void LLPanelPeople::updateRecentList() bool LLPanelPeople::onConnectedToFacebook(const LLSD& data) { - if (data.get("enum").asInteger() == LLFacebookConnect::FB_CONNECTED) - { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLPanelPeople"); + LLSD::Integer connection_state = data.get("enum").asInteger(); + if (connection_state == LLFacebookConnect::FB_CONNECTED) + { LLFacebookConnect::instance().loadFacebookFriends(); } + else if(connection_state == LLFacebookConnect::FB_NOT_CONNECTED) + { + updateSuggestedFriendList(); + }; return false; } @@ -852,21 +856,16 @@ void LLPanelPeople::updateFacebookList(bool visible) LLEventPumps::instance().obtain("FacebookConnectContent").stopListening("LLPanelPeople"); // just in case it is already listening LLEventPumps::instance().obtain("FacebookConnectContent").listen("LLPanelPeople", boost::bind(&LLPanelPeople::updateSuggestedFriendList, this)); - if (mTryToConnectToFbc) - { - // try to reconnect to facebook! - if (LLFacebookConnect::instance().isConnected()) - { - LLFacebookConnect::instance().loadFacebookFriends(); - } - else - { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLPanelPeople"); // just in case it is already listening - LLEventPumps::instance().obtain("FacebookConnectState").listen("LLPanelPeople", boost::bind(&LLPanelPeople::onConnectedToFacebook, this, _1)); - LLFacebookConnect::instance().checkConnectionToFacebook(); - } + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLPanelPeople"); // just in case it is already listening + LLEventPumps::instance().obtain("FacebookConnectState").listen("LLPanelPeople", boost::bind(&LLPanelPeople::onConnectedToFacebook, this, _1)); - // don't try again + if (LLFacebookConnect::instance().isConnected()) + { + LLFacebookConnect::instance().loadFacebookFriends(); + } + else if(mTryToConnectToFbc) + { + LLFacebookConnect::instance().checkConnectionToFacebook(); mTryToConnectToFbc = false; } @@ -874,6 +873,7 @@ void LLPanelPeople::updateFacebookList(bool visible) } else { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLPanelPeople"); LLEventPumps::instance().obtain("FacebookConnectContent").stopListening("LLPanelPeople"); } } -- cgit v1.2.3 From e34f088104af64bf4468ff0d2f525a898f531bfb Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Sun, 11 Aug 2013 08:49:05 -0700 Subject: NORSPEC-341 fix issues with water reflection coloring and abnormals --- .../shaders/class1/deferred/waterF.glsl | 33 +++++++--------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index d49ff72cf0..72c46e240d 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -153,16 +153,12 @@ void main() vec2 refvec3 = distort+refdistort3/dmod_scale; vec4 refcol3 = texture2D(refTex, refvec3); - refcol1.rgb = srgb_to_linear(refcol1.rgb); - refcol2.rgb = srgb_to_linear(refcol2.rgb); - refcol3.rgb = srgb_to_linear(refcol3.rgb); - vec4 refcol = refcol1 + refcol2 + refcol3; float df1 = df.x + df.y + df.z; refcol *= df1 * 0.333; vec3 wavef = (wave1 + wave2 * 0.4 + wave3 * 0.6) * 0.5; - //wavef.z *= max(-viewVec.z, 0.1); + wavef.z *= max(-viewVec.z, 0.1); wavef = normalize(wavef); float df2 = dot(viewVec, wavef) * fresnelScale+fresnelOffset; @@ -173,15 +169,13 @@ void main() float dweight = min(dist2*blurMultiplier, 1.0); vec4 baseCol = texture2D(refTex, refvec4); - baseCol.rgb = srgb_to_linear(baseCol.rgb); - refcol = mix(baseCol*df2, refcol, dweight); //get specular component - //float spec = clamp(dot(lightDir, (reflect(viewVec,wavef))),0.0,1.0); + float spec = clamp(dot(lightDir, (reflect(viewVec,wavef))),0.0,1.0); //harden specular - //spec = pow(spec, 128.0); + spec = pow(spec, 128.0); //figure out distortion vector (ripply) vec2 distort2 = distort+wavef.xy*refScale/max(dmod*df1, 1.0); @@ -192,24 +186,17 @@ void main() // Note we actually want to use just df1, but multiplying by 0.999999 gets around an nvidia compiler bug color.rgb = mix(fb.rgb, refcol.rgb, df1 * 0.99999); - float shadow = 1.0; vec4 pos = vary_position; - - //vec3 nz = texture2D(noiseMap, gl_FragCoord.xy/128.0).xyz; - vec4 spos = pos; - //spec *= shadow; - //color.rgb += spec * specular; - + color.rgb += spec * specular; + color.rgb = atmosTransport(color.rgb); color.rgb = scaleSoftClip(color.rgb); - color.a = sunAngle2; + color.a = spec * sunAngle2; - //wavef.z *= 0.1f; - //wavef = normalize(wavef); - vec3 screenspacewavef = (norm_mat*vec4(wavef, 1.0)).xyz; + vec3 screenspacewavef = normalize((norm_mat*vec4(wavef, 1.0)).xyz); - frag_data[0] = vec4(color.rgb, color.a); // diffuse - frag_data[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec - frag_data[2] = vec4(encode_normal(screenspacewavef.xyz*0.5+0.5), screenspacewavef.z * 0.16, 0.0);// normalxyz, env intensity + frag_data[0] = vec4(color.rgb, color); // diffuse + frag_data[1] = vec4(0); // speccolor, spec + frag_data[2] = vec4(encode_normal(screenspacewavef.xyz*0.5+0.5), 0.05, 0);// normalxy, 0, 0 } -- cgit v1.2.3 From 61129c73c97accf297943d6bc5beea3c09579084 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 12 Aug 2013 10:12:09 -0700 Subject: NORSPEC-346 fix knock-on causing alpha mask edits to cause materials to get removed and revert to alpha blend --- indra/newview/llpanelface.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 562d293d56..46b3375f64 100755 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -259,8 +259,13 @@ private: // need to get per-face answer to this question for sane alpha mode retention on updates. // bool is_alpha_face = object->isImageAlphaBlended(face); - U8 default_alpha_mode = is_alpha_face ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : LLMaterial::DIFFUSE_ALPHA_MODE_NONE; + // need to keep this original answer for valid comparisons in logic below + // + U8 original_default_alpha_mode = is_alpha_face ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : LLMaterial::DIFFUSE_ALPHA_MODE_NONE; + + U8 default_alpha_mode = original_default_alpha_mode; + if (!current_material.isNull()) { default_alpha_mode = current_material->getDiffuseAlphaMode(); @@ -285,7 +290,7 @@ private: new_material->setDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_NONE); } - bool is_default_blend_mode = (new_alpha_mode == default_alpha_mode); + bool is_default_blend_mode = (new_alpha_mode == original_default_alpha_mode); bool is_need_material = !is_default_blend_mode || !new_normal_map_id.isNull() || !new_spec_map_id.isNull(); if (!is_need_material) -- cgit v1.2.3 From 91c9cc4c33f68f4f39e23763317a76ccb573c38b Mon Sep 17 00:00:00 2001 From: dolphin Date: Mon, 12 Aug 2013 11:09:05 -0700 Subject: Save SL NVAPI profile only when changes have been made. --- indra/newview/llappviewerwin32.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 3cf3c739d9..80a80f4298 100755 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -172,21 +172,20 @@ void ll_nvapi_init(NvDRSSessionHandle hSession) nvapi_error(status); return; } + + // (5) Now we apply (or save) our changes to the system + status = NvAPI_DRS_SaveSettings(hSession); + if (status != NVAPI_OK) + { + nvapi_error(status); + return; + } } else if (status != NVAPI_OK) { nvapi_error(status); return; } - - - - // (5) Now we apply (or save) our changes to the system - status = NvAPI_DRS_SaveSettings(hSession); - if (status != NVAPI_OK) - { - nvapi_error(status); - } } //#define DEBUGGING_SEH_FILTER 1 -- cgit v1.2.3 From 51dfcb9c67f7c3464bf3640adfdd87a061f60390 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 12 Aug 2013 15:55:25 -0700 Subject: NORSPEC-342 WIP MATBUG-347 make impostor rendering not contribute to depth for mostly-transparent buffer pixels, aka hair in ALM only --- .../shaders/class1/deferred/alphaF.glsl | 19 +++++++++-- .../shaders/class1/deferred/impostorF.glsl | 2 ++ indra/newview/lldrawpoolalpha.cpp | 11 +++++-- indra/newview/lldrawpoolavatar.cpp | 8 ++--- indra/newview/llviewershadermgr.cpp | 37 ++++++++++++++++++++++ indra/newview/llviewershadermgr.h | 1 + indra/newview/pipeline.cpp | 5 +++ 7 files changed, 74 insertions(+), 9 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index d0c7cc9dde..f35ff25dcb 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -531,6 +531,19 @@ void main() vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy); #endif +#if FOR_IMPOSTOR + vec4 color; + color.rgb = diff.rgb; + color.a = diff.a; + + // Insure we don't pollute depth with invis pixels in impostor rendering + // + if (color.a < 0.01) + { + discard; + } +#else + #ifdef USE_VERTEX_COLOR float final_alpha = diff.a * vertex_color.a; diff.rgb *= vertex_color.rgb; @@ -538,6 +551,7 @@ void main() float final_alpha = diff.a; #endif + vec4 gamma_diff = diff; diff.rgb = srgb_to_linear(diff.rgb); @@ -567,11 +581,10 @@ void main() ambient = (1.0-ambient); color.rgb *= ambient; - color.rgb += atmosAffectDirectionalLight(final_da); color.rgb *= gamma_diff.rgb; - color.rgb = mix(diff.rgb, color.rgb, final_alpha); + //color.rgb = mix(diff.rgb, color.rgb, final_alpha); color.rgb = atmosLighting(color.rgb); color.rgb = scaleSoftClip(color.rgb); @@ -600,6 +613,8 @@ void main() #ifdef WATER_FOG color = applyWaterFogDeferred(pos.xyz, color); +#endif + #endif frag_color = color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl index d1eaabf901..506323fdce 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl @@ -86,6 +86,8 @@ void main() vec4 norm = texture2D(normalMap, vary_texcoord0.xy); vec4 spec = texture2D(specularMap, vary_texcoord0.xy); + col.rgb = linear_to_srgb(col.rgb); + frag_data[0] = vec4(col.rgb, col.a); frag_data[1] = spec; frag_data[2] = vec4(norm.xy,0,0); diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index ba83c95518..a8010d17d6 100755 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -93,7 +93,12 @@ void LLDrawPoolAlpha::beginPostDeferredPass(S32 pass) if (pass == 0) { - if (LLPipeline::sUnderWaterRender) + if (LLPipeline::sImpostorRender) + { + simple_shader = &gDeferredAlphaImpostorProgram; + fullbright_shader = &gDeferredFullbrightProgram; + } + else if (LLPipeline::sUnderWaterRender) { simple_shader = &gDeferredAlphaWaterProgram; fullbright_shader = &gDeferredFullbrightWaterProgram; @@ -116,7 +121,7 @@ void LLDrawPoolAlpha::beginPostDeferredPass(S32 pass) simple_shader->uniform1f(LLShaderMgr::DISPLAY_GAMMA, (gamma > 0.1f) ? 1.0f / gamma : (1.0f/2.2f)); } - else + else if (!LLPipeline::sImpostorRender) { //update depth buffer sampler gPipeline.mScreen.flush(); @@ -156,7 +161,7 @@ void LLDrawPoolAlpha::beginPostDeferredPass(S32 pass) void LLDrawPoolAlpha::endPostDeferredPass(S32 pass) { - if (pass == 1) + if (pass == 1 && !LLPipeline::sImpostorRender) { gPipeline.mDeferredDepth.flush(); gPipeline.mScreen.bindTarget(); diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 9dbc85d121..8b1e934224 100755 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -691,7 +691,7 @@ void LLDrawPoolAvatar::beginDeferredImpostor() } sVertexProgram = &gDeferredImpostorProgram; - specular_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::SPECULAR_MAP); + specular_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::SPECULAR_MAP); normal_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::DEFERRED_NORMAL); sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); gPipeline.bindDeferredShader(*sVertexProgram); @@ -701,12 +701,12 @@ void LLDrawPoolAvatar::beginDeferredImpostor() void LLDrawPoolAvatar::endDeferredImpostor() { sShaderLevel = mVertexShaderLevel; - sVertexProgram->disableTexture(LLViewerShaderMgr::DEFERRED_NORMAL); + sVertexProgram->disableTexture(LLViewerShaderMgr::DEFERRED_NORMAL); sVertexProgram->disableTexture(LLViewerShaderMgr::SPECULAR_MAP); sVertexProgram->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP); gPipeline.unbindDeferredShader(*sVertexProgram); - sVertexProgram = NULL; - sDiffuseChannel = 0; + sVertexProgram = NULL; + sDiffuseChannel = 0; } void LLDrawPoolAvatar::beginDeferredRigid() diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 264655029a..b2f7949388 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -197,6 +197,7 @@ LLGLSLShader gDeferredShadowAlphaMaskProgram; LLGLSLShader gDeferredAvatarShadowProgram; LLGLSLShader gDeferredAttachmentShadowProgram; LLGLSLShader gDeferredAlphaProgram; +LLGLSLShader gDeferredAlphaImpostorProgram; LLGLSLShader gDeferredAlphaWaterProgram; LLGLSLShader gDeferredAvatarEyesProgram; LLGLSLShader gDeferredFullbrightProgram; @@ -304,6 +305,8 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gDeferredMaterialWaterProgram[9+LLMaterial::SHADER_COUNT]); mShaderList.push_back(&gDeferredMaterialWaterProgram[13+LLMaterial::SHADER_COUNT]); mShaderList.push_back(&gDeferredAlphaProgram); + mShaderList.push_back(&gDeferredAlphaProgram); + mShaderList.push_back(&gDeferredAlphaImpostorProgram); mShaderList.push_back(&gDeferredAlphaWaterProgram); mShaderList.push_back(&gDeferredSkinnedAlphaProgram); mShaderList.push_back(&gDeferredFullbrightProgram); @@ -1531,6 +1534,40 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAlphaProgram.mFeatures.hasLighting = true; } + if (success) + { + gDeferredAlphaImpostorProgram.mName = "Deferred Alpha Shader"; + + gDeferredAlphaImpostorProgram.mFeatures.calculatesLighting = false; + gDeferredAlphaImpostorProgram.mFeatures.hasLighting = false; + gDeferredAlphaImpostorProgram.mFeatures.isAlphaLighting = true; + gDeferredAlphaImpostorProgram.mFeatures.disableTextureIndex = true; //hack to disable auto-setup of texture channels + if (mVertexShaderLevel[SHADER_DEFERRED] < 1) + { + gDeferredAlphaImpostorProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; + } + else + { //shave off some texture units for shadow maps + gDeferredAlphaImpostorProgram.mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels - 6, 1); + } + + gDeferredAlphaImpostorProgram.mShaderFiles.clear(); + gDeferredAlphaImpostorProgram.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredAlphaImpostorProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAlphaImpostorProgram.addPermutation("USE_INDEXED_TEX", "1"); + gDeferredAlphaImpostorProgram.addPermutation("HAS_SHADOW", mVertexShaderLevel[SHADER_DEFERRED] > 1 ? "1" : "0"); + gDeferredAlphaImpostorProgram.addPermutation("USE_VERTEX_COLOR", "1"); + gDeferredAlphaImpostorProgram.addPermutation("FOR_IMPOSTOR", "1"); + + gDeferredAlphaImpostorProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + + success = gDeferredAlphaImpostorProgram.createShader(NULL, NULL); + + // Hack + gDeferredAlphaImpostorProgram.mFeatures.calculatesLighting = true; + gDeferredAlphaImpostorProgram.mFeatures.hasLighting = true; + } + if (success) { gDeferredAlphaWaterProgram.mName = "Deferred Alpha Underwater Shader"; diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index 5fa9b82170..08c1ce6911 100755 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -364,6 +364,7 @@ extern LLGLSLShader gDeferredPostGammaCorrectProgram; extern LLGLSLShader gDeferredAvatarShadowProgram; extern LLGLSLShader gDeferredAttachmentShadowProgram; extern LLGLSLShader gDeferredAlphaProgram; +extern LLGLSLShader gDeferredAlphaImpostorProgram; extern LLGLSLShader gDeferredFullbrightProgram; extern LLGLSLShader gDeferredFullbrightAlphaMaskProgram; extern LLGLSLShader gDeferredAlphaWaterProgram; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 9378c89eb7..31baf4188b 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -11402,7 +11402,9 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) // gGL.setColorMask(false,false); renderGeomPostDeferred(camera); + sImpostorRenderAlphaDepthPass = false; + } else { @@ -11418,10 +11420,13 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) // from the previous pass // sImpostorRenderAlphaDepthPass = true; + // depth-only here... // gGL.setColorMask(false,false); renderGeom(camera); + + sImpostorRenderAlphaDepthPass = false; } { //create alpha mask based on depth buffer (grey out if muted) -- cgit v1.2.3 From a43a762c0ddf3ecac2056b36d0ede1f99e71231e Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 12 Aug 2013 17:22:47 -0700 Subject: NORSPEC-342 fix blocky hair in ALM from writing depth for transparent pixels in impostor rendering --- indra/newview/lldrawpoolalpha.cpp | 8 +++++++- indra/newview/lldrawpoolsimple.cpp | 6 +++++- indra/newview/llviewershadermgr.cpp | 25 +++++++++++++++++++++++++ indra/newview/llviewershadermgr.h | 1 + 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index a8010d17d6..5ebc58fb7d 100755 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -181,7 +181,13 @@ void LLDrawPoolAlpha::beginRenderPass(S32 pass) { LLFastTimer t(FTM_RENDER_ALPHA); - if (LLPipeline::sUnderWaterRender) + if (LLPipeline::sImpostorRender) + { + simple_shader = &gObjectSimpleImpostorProgram; + fullbright_shader = &gObjectFullbrightProgram; + emissive_shader = &gObjectEmissiveProgram; + } + else if (LLPipeline::sUnderWaterRender) { simple_shader = &gObjectSimpleWaterProgram; fullbright_shader = &gObjectFullbrightWaterProgram; diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index aee9d19d19..8926f64c64 100755 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -156,7 +156,11 @@ void LLDrawPoolSimple::beginRenderPass(S32 pass) { LLFastTimer t(FTM_RENDER_SIMPLE); - if (LLPipeline::sUnderWaterRender) + if (LLPipeline::sImpostorRender) + { + simple_shader = &gObjectSimpleImpostorProgram; + } + else if (LLPipeline::sUnderWaterRender) { simple_shader = &gObjectSimpleWaterProgram; } diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index b2f7949388..995eb599b8 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -83,6 +83,7 @@ LLGLSLShader gAlphaMaskProgram; //object shaders LLGLSLShader gObjectSimpleProgram; +LLGLSLShader gObjectSimpleImpostorProgram; LLGLSLShader gObjectPreviewProgram; LLGLSLShader gObjectSimpleWaterProgram; LLGLSLShader gObjectSimpleAlphaMaskProgram; @@ -237,6 +238,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gWaterProgram); mShaderList.push_back(&gAvatarEyeballProgram); mShaderList.push_back(&gObjectSimpleProgram); + mShaderList.push_back(&gObjectSimpleImpostorProgram); mShaderList.push_back(&gObjectPreviewProgram); mShaderList.push_back(&gImpostorProgram); mShaderList.push_back(&gObjectFullbrightNoColorProgram); @@ -729,6 +731,7 @@ void LLViewerShaderMgr::unloadShaders() gObjectFullbrightNoColorProgram.unload(); gObjectFullbrightNoColorWaterProgram.unload(); gObjectSimpleProgram.unload(); + gObjectSimpleImpostorProgram.unload(); gObjectPreviewProgram.unload(); gImpostorProgram.unload(); gObjectSimpleAlphaMaskProgram.unload(); @@ -2020,6 +2023,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightNoColorProgram.unload(); gObjectFullbrightNoColorWaterProgram.unload(); gObjectSimpleProgram.unload(); + gObjectSimpleImpostorProgram.unload(); gObjectPreviewProgram.unload(); gImpostorProgram.unload(); gObjectSimpleAlphaMaskProgram.unload(); @@ -2440,6 +2444,27 @@ BOOL LLViewerShaderMgr::loadShadersObject() success = gObjectSimpleProgram.createShader(NULL, NULL); } + if (success) + { + gObjectSimpleImpostorProgram.mName = "Simple Impostor Shader"; + gObjectSimpleImpostorProgram.mFeatures.calculatesLighting = true; + gObjectSimpleImpostorProgram.mFeatures.calculatesAtmospherics = true; + gObjectSimpleImpostorProgram.mFeatures.hasGamma = true; + gObjectSimpleImpostorProgram.mFeatures.hasAtmospherics = true; + gObjectSimpleImpostorProgram.mFeatures.hasLighting = true; + gObjectSimpleImpostorProgram.mFeatures.mIndexedTextureChannels = 0; + // force alpha mask version of lighting so we can weed out + // transparent pixels from impostor temp buffer + // + gObjectSimpleImpostorProgram.mFeatures.hasAlphaMask = true; + gObjectSimpleImpostorProgram.mShaderFiles.clear(); + gObjectSimpleImpostorProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectSimpleImpostorProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectSimpleImpostorProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + + success = gObjectSimpleImpostorProgram.createShader(NULL, NULL); + } + if (success) { gObjectSimpleWaterProgram.mName = "Simple Water Shader"; diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index 08c1ce6911..e4684c19d5 100755 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -242,6 +242,7 @@ extern LLGLSLShader gOneTextureNoColorProgram; //object shaders extern LLGLSLShader gObjectSimpleProgram; +extern LLGLSLShader gObjectSimpleImpostorProgram; extern LLGLSLShader gObjectPreviewProgram; extern LLGLSLShader gObjectSimpleAlphaMaskProgram; extern LLGLSLShader gObjectSimpleWaterProgram; -- cgit v1.2.3 From e586f0325f23363e0223162f4643c7c4c1dfe4a4 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 12 Aug 2013 17:45:11 -0700 Subject: NORSPEC-342 tweak shader to work on mac og glsl --- indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index f35ff25dcb..d1abebf84c 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -531,7 +531,7 @@ void main() vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy); #endif -#if FOR_IMPOSTOR +#ifdef FOR_IMPOSTOR vec4 color; color.rgb = diff.rgb; color.a = diff.a; -- cgit v1.2.3 From d0e964289ec9888686619c4edd756edd622ca214 Mon Sep 17 00:00:00 2001 From: Cho Date: Tue, 13 Aug 2013 01:47:20 +0100 Subject: added read_from_master parameter for ACME-829 --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llfacebookconnect.cpp | 35 +++++++++++++++++++++------------ indra/newview/llfacebookconnect.h | 3 ++- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 20919adc76..bebd1fd9e8 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3465,7 +3465,7 @@ Type String Value - http://pdp15.lindenlab.com + FastCacheFetchEnabled diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 5551acff0d..0a4fefbd24 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -119,7 +119,6 @@ public: { LL_DEBUGS("FacebookConnect") << "Connect successful. content: " << content << LL_ENDL; - // Grab some graph data now that we are connected LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED); } else if (status != 302) @@ -324,7 +323,8 @@ LLFacebookConnect::LLFacebookConnect() mInfo(), mContent(), mRefreshInfo(false), - mRefreshContent(false) + mRefreshContent(false), + mReadFromMaster(false) { } @@ -346,7 +346,7 @@ void LLFacebookConnect::openFacebookWeb(std::string url) //LLUrlAction::openURLExternal(url); } -std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route) +std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route, bool include_read_from_master) { static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); @@ -363,6 +363,10 @@ std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route) //End removable part std::string url = sFacebookConnectUrl + route; + if (include_read_from_master && mReadFromMaster) + { + url += "?read_from_master=true"; + } return url; } @@ -384,10 +388,10 @@ void LLFacebookConnect::disconnectFromFacebook() void LLFacebookConnect::checkConnectionToFacebook(bool auto_connect) { - const bool follow_redirects = false; - const F32 timeout = HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(auto_connect), - LLSD(), timeout, follow_redirects); + const bool follow_redirects = false; + const F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + LLHTTPClient::get(getFacebookConnectURL("/connection", true), new LLFacebookConnectedResponder(auto_connect), + LLSD(), timeout, follow_redirects); } void LLFacebookConnect::loadFacebookInfo() @@ -396,7 +400,7 @@ void LLFacebookConnect::loadFacebookInfo() { const bool follow_redirects = false; const F32 timeout = HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/info"), new LLFacebookInfoResponder(), + LLHTTPClient::get(getFacebookConnectURL("/info", true), new LLFacebookInfoResponder(), LLSD(), timeout, follow_redirects); } } @@ -407,7 +411,7 @@ void LLFacebookConnect::loadFacebookFriends() { const bool follow_redirects = false; const F32 timeout = HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/friends"), new LLFacebookFriendsResponder(), + LLHTTPClient::get(getFacebookConnectURL("/friends", true), new LLFacebookFriendsResponder(), LLSD(), timeout, follow_redirects); } } @@ -427,7 +431,7 @@ void LLFacebookConnect::postCheckin(const std::string& location, const std::stri body["message"] = message; // Note: we can use that route for different publish action. We should be able to use the same responder. - LLHTTPClient::post(getFacebookConnectURL("/share/checkin"), body, new LLFacebookShareResponder()); + LLHTTPClient::post(getFacebookConnectURL("/share/checkin", true), body, new LLFacebookShareResponder()); } void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::string& caption) @@ -437,7 +441,7 @@ void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::stri body["caption"] = caption; // Note: we can use that route for different publish action. We should be able to use the same responder. - LLHTTPClient::post(getFacebookConnectURL("/share/photo"), body, new LLFacebookShareResponder()); + LLHTTPClient::post(getFacebookConnectURL("/share/photo", true), body, new LLFacebookShareResponder()); } void LLFacebookConnect::sharePhoto(LLPointer image, const std::string& caption) @@ -490,7 +494,7 @@ void LLFacebookConnect::sharePhoto(LLPointer image, const std: memcpy(data, body.str().data(), size); // Note: we can use that route for different publish action. We should be able to use the same responder. - LLHTTPClient::postRaw(getFacebookConnectURL("/share/photo"), data, size, new LLFacebookShareResponder(), headers); + LLHTTPClient::postRaw(getFacebookConnectURL("/share/photo", true), data, size, new LLFacebookShareResponder(), headers); } void LLFacebookConnect::updateStatus(const std::string& message) @@ -499,7 +503,7 @@ void LLFacebookConnect::updateStatus(const std::string& message) body["message"] = message; // Note: we can use that route for different publish action. We should be able to use the same responder. - LLHTTPClient::post(getFacebookConnectURL("/share/wall"), body, new LLFacebookShareResponder()); + LLHTTPClient::post(getFacebookConnectURL("/share/wall", true), body, new LLFacebookShareResponder()); } void LLFacebookConnect::storeInfo(const LLSD& info) @@ -548,6 +552,7 @@ void LLFacebookConnect::setConnectionState(LLFacebookConnect::EConnectionState c { if(connection_state == FB_CONNECTED) { + mReadFromMaster = true; setConnected(true); setDataDirty(); } @@ -555,6 +560,10 @@ void LLFacebookConnect::setConnectionState(LLFacebookConnect::EConnectionState c { setConnected(false); } + else if(connection_state == FB_POSTED) + { + mReadFromMaster = false; + } if (mConnectionState != connection_state) { diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index 77c26842de..a77ac24167 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -88,7 +88,7 @@ private: LLFacebookConnect(); ~LLFacebookConnect() {}; - std::string getFacebookConnectURL(const std::string& route = ""); + std::string getFacebookConnectURL(const std::string& route = "", bool include_read_from_master = false); EConnectionState mConnectionState; BOOL mConnected; @@ -96,6 +96,7 @@ private: LLSD mContent; bool mRefreshInfo; bool mRefreshContent; + bool mReadFromMaster; static boost::scoped_ptr sStateWatcher; static boost::scoped_ptr sInfoWatcher; -- cgit v1.2.3 From abc2abf45dbe69daa0130ad823ca7184acc9d8df Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 12 Aug 2013 20:26:33 -0700 Subject: ACME-820 : Use the LL hosted default image for the default map tile in checkin --- indra/newview/llfloatersocial.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 66a586b16b..4c17d9e40d 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -54,7 +54,7 @@ static LLRegisterPanelClassWrapper t_panel_account("llsoci const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte const std::string DEFAULT_CHECKIN_LOCATION_URL = "http://maps.secondlife.com/"; -const std::string DEFAULT_CHECKIN_ICON_URL = "http://logok.org/wp-content/uploads/2010/07/podcastlogo1.jpg"; +const std::string DEFAULT_CHECKIN_ICON_URL = "http://map.secondlife.com.s3.amazonaws.com/map_placeholder.png"; std::string get_map_url() { -- cgit v1.2.3 From 5fb214a37fd68cf6f9b33206a7952db3351e05b5 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 13 Aug 2013 20:30:07 -0700 Subject: NORSPEC-342 fix the invisi-feet --- indra/newview/pipeline.cpp | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 31baf4188b..314a2ae295 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -11240,26 +11240,32 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) } else { - andRenderTypeMask(LLPipeline::RENDER_TYPE_VOLUME, - LLPipeline::RENDER_TYPE_AVATAR, - LLPipeline::RENDER_TYPE_BUMP, - LLPipeline::RENDER_TYPE_GRASS, - LLPipeline::RENDER_TYPE_SIMPLE, - LLPipeline::RENDER_TYPE_FULLBRIGHT, - LLPipeline::RENDER_TYPE_ALPHA, - LLPipeline::RENDER_TYPE_INVISIBLE, - LLPipeline::RENDER_TYPE_PASS_SIMPLE, - LLPipeline::RENDER_TYPE_PASS_ALPHA, - LLPipeline::RENDER_TYPE_PASS_ALPHA_MASK, - LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT, - LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK, - LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_SHINY, - LLPipeline::RENDER_TYPE_PASS_SHINY, - LLPipeline::RENDER_TYPE_PASS_INVISIBLE, - LLPipeline::RENDER_TYPE_PASS_INVISI_SHINY, - END_RENDER_TYPES); + andRenderTypeMask(LLPipeline::RENDER_TYPE_ALPHA, + LLPipeline::RENDER_TYPE_FULLBRIGHT, + LLPipeline::RENDER_TYPE_VOLUME, + LLPipeline::RENDER_TYPE_GLOW, + LLPipeline::RENDER_TYPE_BUMP, + LLPipeline::RENDER_TYPE_PASS_SIMPLE, + LLPipeline::RENDER_TYPE_PASS_ALPHA, + LLPipeline::RENDER_TYPE_PASS_ALPHA_MASK, + LLPipeline::RENDER_TYPE_PASS_BUMP, + LLPipeline::RENDER_TYPE_PASS_POST_BUMP, + LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT, + LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK, + LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_SHINY, + LLPipeline::RENDER_TYPE_PASS_GLOW, + LLPipeline::RENDER_TYPE_PASS_GRASS, + LLPipeline::RENDER_TYPE_PASS_SHINY, + LLPipeline::RENDER_TYPE_PASS_INVISIBLE, + LLPipeline::RENDER_TYPE_PASS_INVISI_SHINY, + LLPipeline::RENDER_TYPE_AVATAR, + LLPipeline::RENDER_TYPE_ALPHA_MASK, + LLPipeline::RENDER_TYPE_FULLBRIGHT_ALPHA_MASK, + LLPipeline::RENDER_TYPE_INVISIBLE, + LLPipeline::RENDER_TYPE_ALPHA, + END_RENDER_TYPES); } - + S32 occlusion = sUseOcclusion; sUseOcclusion = 0; -- cgit v1.2.3 From 55c36ab7dbee9463c3df72d60cdc882cdeb69b9d Mon Sep 17 00:00:00 2001 From: Arun Bapu Date: Wed, 14 Aug 2013 11:35:06 -0700 Subject: Fix for NORSPEC 271 - Transparent prims in Materials Viewer are incorrectly affecting depth of field by modifying the depth buffer --- indra/newview/lldrawpoolalpha.cpp | 27 ++++++++++++++++++++++----- indra/newview/lldrawpoolalpha.h | 2 +- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index ba83c95518..9c510d360f 100755 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -100,7 +100,7 @@ void LLDrawPoolAlpha::beginPostDeferredPass(S32 pass) } else { - simple_shader = &gDeferredAlphaProgram; + simple_shader = &gDeferredAlphaProgram; fullbright_shader = &gDeferredFullbrightProgram; } @@ -276,11 +276,11 @@ void LLDrawPoolAlpha::render(S32 pass) if (mVertexShaderLevel > 0) { - renderAlpha(getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX | LLVertexBuffer::MAP_TANGENT | LLVertexBuffer::MAP_TEXCOORD1 | LLVertexBuffer::MAP_TEXCOORD2); + renderAlpha(getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX | LLVertexBuffer::MAP_TANGENT | LLVertexBuffer::MAP_TEXCOORD1 | LLVertexBuffer::MAP_TEXCOORD2, pass); } else { - renderAlpha(getVertexDataMask()); + renderAlpha(getVertexDataMask(), pass); } gGL.setColorMask(true, false); @@ -352,7 +352,7 @@ void LLDrawPoolAlpha::renderAlphaHighlight(U32 mask) } } -void LLDrawPoolAlpha::renderAlpha(U32 mask) +void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass) { BOOL initialized_lighting = FALSE; BOOL light_enabled = TRUE; @@ -385,6 +385,23 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) continue; } + // Fix for bug - NORSPEC-271 + // If the face is more than 90% transparent, then don't update the Depth buffer for Dof + // We don't want the nearly invisible objects to cause of DoF effects + if(pass == 1) + { + LLFace* face = params.mFace; + if(face) + { + const LLTextureEntry* tep = face->getTextureEntry(); + if(tep) + { + if(tep->getColor().mV[3] < 0.1f) + continue; + } + } + } + LLRenderPass::applyModelMatrix(params); LLMaterial* mat = NULL; @@ -548,7 +565,7 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); // If this alpha mesh has glow, then draw it a second time to add the destination-alpha (=glow). Interleaving these state-changing calls could be expensive, but glow must be drawn Z-sorted with alpha. - if (current_shader && + if (current_shader && !LLPipeline::sImpostorRender && draw_glow_for_this_partition && params.mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_EMISSIVE)) diff --git a/indra/newview/lldrawpoolalpha.h b/indra/newview/lldrawpoolalpha.h index 43122218ed..d064a3a324 100755 --- a/indra/newview/lldrawpoolalpha.h +++ b/indra/newview/lldrawpoolalpha.h @@ -63,7 +63,7 @@ public: /*virtual*/ void prerender(); void renderGroupAlpha(LLSpatialGroup* group, U32 type, U32 mask, BOOL texture = TRUE); - void renderAlpha(U32 mask); + void renderAlpha(U32 mask, S32 pass); void renderAlphaHighlight(U32 mask); static BOOL sShowDebugAlpha; -- cgit v1.2.3 From 4595978d59d905bc9ef95efd759eac8cb62b57c3 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 14 Aug 2013 20:02:31 +0100 Subject: removed momentary error message upon connecting to Facebook --- indra/newview/llfacebookconnect.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 0a4fefbd24..abfacdb93c 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -81,18 +81,18 @@ public: { if (tokens[0].asString() == "connect") { - // connect to facebook - if (query_map.has("code")) - { - LLFacebookConnect::instance().connectToFacebook(query_map["code"], query_map.get("state")); - } - // this command probably came from the fbc_web browser, so close it LLFloater* fbc_web = LLFloaterReg::getInstance("fbc_web"); if (fbc_web) { fbc_web->closeFloater(); } + + // connect to facebook + if (query_map.has("code")) + { + LLFacebookConnect::instance().connectToFacebook(query_map["code"], query_map.get("state")); + } return true; } } -- cgit v1.2.3 From 8f4a481610f64fc37b00fae1c71f57ece3972d8f Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 14 Aug 2013 16:31:50 -0700 Subject: NORSPEC-342 add simple pass type to things rendered for impostors to fix missing shoes/belts/handbags/cigarettecases/etc --- indra/newview/pipeline.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 314a2ae295..bade7a9f52 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -11262,7 +11262,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) LLPipeline::RENDER_TYPE_ALPHA_MASK, LLPipeline::RENDER_TYPE_FULLBRIGHT_ALPHA_MASK, LLPipeline::RENDER_TYPE_INVISIBLE, - LLPipeline::RENDER_TYPE_ALPHA, + LLPipeline::RENDER_TYPE_SIMPLE, END_RENDER_TYPES); } -- cgit v1.2.3 From 141c34cff46a7f2be868df45aa1a8de7b95fa4a4 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 15 Aug 2013 08:00:47 -0700 Subject: NORSPEC-342 NORSPEC-352 make impostor alpha shader use vertex alpha to remedy unsightly blemishes, boxes, and the occasional extra wing. --- indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index d1abebf84c..cd7a76db28 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -534,11 +534,17 @@ void main() #ifdef FOR_IMPOSTOR vec4 color; color.rgb = diff.rgb; - color.a = diff.a; + +#ifdef USE_VERTEX_COLOR + float final_alpha = diff.a * vertex_color.a; + diff.rgb *= vertex_color.rgb; +#else + float final_alpha = diff.a; +#endif // Insure we don't pollute depth with invis pixels in impostor rendering // - if (color.a < 0.01) + if (final_alpha < 0.01) { discard; } -- cgit v1.2.3 From dc63061714b0872a123ca769cd3683ab233c9915 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 15 Aug 2013 09:37:54 -0700 Subject: NORSPEC-352 for non-ALM rendering, make lighting shader with alpha masking obey vertex alpha --- indra/llrender/llrendertarget.cpp | 2 +- .../newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index 09ef780424..a011e81b99 100755 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -113,7 +113,7 @@ void LLRenderTarget::resize(U32 resx, U32 resy, U32 color_fmt) sBytesAllocated += pix_diff*4; } } - + bool LLRenderTarget::allocate(U32 resx, U32 resy, U32 color_fmt, bool depth, bool stencil, LLTexUnit::eTextureType usage, bool use_fbo, S32 samples) { diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl index eaaa7b208d..cad5b9ff04 100755 --- a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl @@ -41,13 +41,13 @@ void default_lighting() { vec4 color = diffuseLookup(vary_texcoord0.xy); + color *= vertex_color; + if (color.a < minimum_alpha) { discard; } - color.rgb *= vertex_color.rgb; - color.rgb = atmosLighting(color.rgb); color.rgb = scaleSoftClip(color.rgb); -- cgit v1.2.3 From 80256fdbf5fe444c177be793b12d0da58ce2b608 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 15 Aug 2013 10:07:41 -0700 Subject: NORSPEC-349 make render targets use original formats when resizing impostors and fix alpha for deferred impostor shader --- indra/llrender/llrendertarget.cpp | 6 ++++-- indra/llrender/llrendertarget.h | 2 +- indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl | 2 +- indra/newview/pipeline.cpp | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index a011e81b99..731e0bc2b3 100755 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -79,7 +79,7 @@ LLRenderTarget::~LLRenderTarget() release(); } -void LLRenderTarget::resize(U32 resx, U32 resy, U32 color_fmt) +void LLRenderTarget::resize(U32 resx, U32 resy) { //for accounting, get the number of pixels added/subtracted S32 pix_diff = (resx*resy)-(mResX*mResY); @@ -87,10 +87,12 @@ void LLRenderTarget::resize(U32 resx, U32 resy, U32 color_fmt) mResX = resx; mResY = resy; + llassert(mInternalFormat.size() == mTex.size()); + for (U32 i = 0; i < mTex.size(); ++i) { //resize color attachments gGL.getTexUnit(0)->bindManual(mUsage, mTex[i]); - LLImageGL::setManualImage(LLTexUnit::getInternalType(mUsage), 0, color_fmt, mResX, mResY, GL_RGBA, GL_UNSIGNED_BYTE, NULL, false); + LLImageGL::setManualImage(LLTexUnit::getInternalType(mUsage), 0, mInternalFormat[i], mResX, mResY, GL_RGBA, GL_UNSIGNED_BYTE, NULL, false); sBytesAllocated += pix_diff*4; } diff --git a/indra/llrender/llrendertarget.h b/indra/llrender/llrendertarget.h index 66a9874a6b..336441661c 100755 --- a/indra/llrender/llrendertarget.h +++ b/indra/llrender/llrendertarget.h @@ -79,7 +79,7 @@ public: // CAUTION: if the GL runs out of memory attempting to resize, this render target will be undefined // DO NOT use for screen space buffers or for scratch space for an image that might be uploaded // DO use for render targets that resize often and aren't likely to ruin someone's day if they break - void resize(U32 resx, U32 resy, U32 color_fmt); + void resize(U32 resx, U32 resy); //add color buffer attachment //limit of 4 color attachments per render target diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl index 506323fdce..f8fdde43f9 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl @@ -88,7 +88,7 @@ void main() col.rgb = linear_to_srgb(col.rgb); - frag_data[0] = vec4(col.rgb, col.a); + frag_data[0] = vec4(col.rgb, 0.0); frag_data[1] = spec; frag_data[2] = vec4(norm.xy,0,0); } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index bade7a9f52..1ca4115a5e 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -11384,7 +11384,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) else if(resX != avatar->mImpostor.getWidth() || resY != avatar->mImpostor.getHeight()) { LLFastTimer t(FTM_IMPOSTOR_RESIZE); - avatar->mImpostor.resize(resX,resY,LLPipeline::sRenderDeferred ? GL_SRGB8_ALPHA8 : GL_RGBA); + avatar->mImpostor.resize(resX,resY); } avatar->mImpostor.bindTarget(); -- cgit v1.2.3 From 62011c2871bdb09b92c56d2959eed64ba6ec3e1f Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 19 Aug 2013 12:56:04 -0700 Subject: Fix merge issues from genBBoxes optimizations fighting with genBBoxes optimizations and missing statics --- indra/llmath/llvolume.cpp | 157 +++++++++++++++++++++---------------------- indra/newview/llface.cpp | 98 ++++++++++----------------- indra/newview/llface.h | 3 +- indra/newview/llvovolume.cpp | 2 +- indra/newview/pipeline.cpp | 2 + indra/newview/pipeline.h | 4 +- 6 files changed, 119 insertions(+), 147 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index ad0ca618a0..a030d889af 100755 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -136,6 +136,82 @@ BOOL LLLineSegmentBoxIntersect(const F32* start, const F32* end, const F32* cent return true; } +// Finds tangent vec based on three vertices with texture coordinates. +// Fills in dummy values if the triangle has degenerate texture coordinates. +void calc_tangent_from_triangle( + LLVector4a& normal, + LLVector4a& tangent_out, + const LLVector4a& v1, + const LLVector2& w1, + const LLVector4a& v2, + const LLVector2& w2, + const LLVector4a& v3, + const LLVector2& w3) +{ + const F32* v1ptr = v1.getF32ptr(); + const F32* v2ptr = v2.getF32ptr(); + const F32* v3ptr = v3.getF32ptr(); + + float x1 = v2ptr[0] - v1ptr[0]; + float x2 = v3ptr[0] - v1ptr[0]; + float y1 = v2ptr[1] - v1ptr[1]; + float y2 = v3ptr[1] - v1ptr[1]; + float z1 = v2ptr[2] - v1ptr[2]; + float z2 = v3ptr[2] - v1ptr[2]; + + float s1 = w2.mV[0] - w1.mV[0]; + float s2 = w3.mV[0] - w1.mV[0]; + float t1 = w2.mV[1] - w1.mV[1]; + float t2 = w3.mV[1] - w1.mV[1]; + + F32 rd = s1*t2-s2*t1; + + float r = ((rd*rd) > FLT_EPSILON) ? 1.0F / rd : 1024.f; //some made up large ratio for division by zero + + llassert(llfinite(r)); + llassert(!llisnan(r)); + + LLVector4a sdir( + (t2 * x1 - t1 * x2) * r, + (t2 * y1 - t1 * y2) * r, + (t2 * z1 - t1 * z2) * r); + + LLVector4a tdir( + (s1 * x2 - s2 * x1) * r, + (s1 * y2 - s2 * y1) * r, + (s1 * z2 - s2 * z1) * r); + + LLVector4a n = normal; + LLVector4a t = sdir; + + LLVector4a ncrosst; + ncrosst.setCross3(n,t); + + // Gram-Schmidt orthogonalize + n.mul(n.dot3(t).getF32()); + + LLVector4a tsubn; + tsubn.setSub(t,n); + + if (tsubn.dot3(tsubn).getF32() > F_APPROXIMATELY_ZERO) + { + tsubn.normalize3fast_checked(); + + // Calculate handedness + F32 handedness = ncrosst.dot3(tdir).getF32() < 0.f ? -1.f : 1.f; + + tsubn.getF32ptr()[3] = handedness; + + tangent_out = tsubn; + } + else + { + // degenerate, make up a value + // + tangent_out.set(0,0,1,1); + } + +} // intersect test between triangle vert0, vert1, vert2 and a ray from orig in direction dir. @@ -5908,10 +5984,10 @@ void LLVolumeFace::cacheOptimize() wght = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); } - LLVector4a* binorm = NULL; + LLVector4a* tangent = NULL; if (mTangents) { - binorm = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); + tangent = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); } //allocate mapping of old indices to new indices @@ -7277,83 +7353,6 @@ void calc_binormal_from_triangle(LLVector4a& binormal, } } -// Finds binormal based on three vertices with texture coordinates. -// Fills in dummy values if the triangle has degenerate texture coordinates. -void calc_tangent_from_triangle( - LLVector4a& normal, - LLVector4a& tangent_out, - const LLVector4a& v1, - const LLVector2& w1, - const LLVector4a& v2, - const LLVector2& w2, - const LLVector4a& v3, - const LLVector2& w3) -{ - const F32* v1ptr = v1.getF32ptr(); - const F32* v2ptr = v2.getF32ptr(); - const F32* v3ptr = v3.getF32ptr(); - - float x1 = v2ptr[0] - v1ptr[0]; - float x2 = v3ptr[0] - v1ptr[0]; - float y1 = v2ptr[1] - v1ptr[1]; - float y2 = v3ptr[1] - v1ptr[1]; - float z1 = v2ptr[2] - v1ptr[2]; - float z2 = v3ptr[2] - v1ptr[2]; - - float s1 = w2.mV[0] - w1.mV[0]; - float s2 = w3.mV[0] - w1.mV[0]; - float t1 = w2.mV[1] - w1.mV[1]; - float t2 = w3.mV[1] - w1.mV[1]; - - F32 rd = s1*t2-s2*t1; - - float r = ((rd*rd) > FLT_EPSILON) ? 1.0F / rd : 1024.f; //some made up large ratio for division by zero - - llassert(llfinite(r)); - llassert(!llisnan(r)); - - LLVector4a sdir( - (t2 * x1 - t1 * x2) * r, - (t2 * y1 - t1 * y2) * r, - (t2 * z1 - t1 * z2) * r); - - LLVector4a tdir( - (s1 * x2 - s2 * x1) * r, - (s1 * y2 - s2 * y1) * r, - (s1 * z2 - s2 * z1) * r); - - LLVector4a n = normal; - LLVector4a t = sdir; - - LLVector4a ncrosst; - ncrosst.setCross3(n,t); - - // Gram-Schmidt orthogonalize - n.mul(n.dot3(t).getF32()); - - LLVector4a tsubn; - tsubn.setSub(t,n); - - if (tsubn.dot3(tsubn).getF32() > F_APPROXIMATELY_ZERO) - { - tsubn.normalize3fast_checked(); - - // Calculate handedness - F32 handedness = ncrosst.dot3(tdir).getF32() < 0.f ? -1.f : 1.f; - - tsubn.getF32ptr()[3] = handedness; - - tangent_out = tsubn; - } - else - { - // degenerate, make up a value - // - tangent_out.set(0,0,1,1); - } - -} - //adapted from Lengyel, Eric. Computing Tangent Space Basis Vectors for an Arbitrary Mesh. Terathon Software 3D Graphics Library, 2001. http://www.terathon.com/code/tangent.html void CalculateTangentArray(U32 vertexCount, const LLVector4a *vertex, const LLVector4a *normal, const LLVector2 *texcoord, U32 triangleCount, const U16* index_array, LLVector4a *tangent) diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 700b31f8d3..53e5b55b89 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -768,7 +768,7 @@ bool less_than_max_mag(const LLVector4a& vec) } BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f, - const LLMatrix4& mat_vert_in, const LLMatrix3& mat_normal_in, BOOL global_volume) + const LLMatrix4& mat_vert_in, BOOL global_volume) { //get bounding box if (mDrawablep->isState(LLDrawable::REBUILD_VOLUME | LLDrawable::REBUILD_POSITION | LLDrawable::REBUILD_RIGGED)) @@ -777,10 +777,6 @@ BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f, LLMatrix4a mat_vert; mat_vert.loadu(mat_vert_in); - LLMatrix4a mat_normal; - mat_normal.loadu(mat_normal_in); - - //VECTORIZE THIS LLVector4a min,max; if (f >= volume.getNumVolumeFaces()) @@ -797,95 +793,69 @@ BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f, llassert(less_than_max_mag(max)); //min, max are in volume space, convert to drawable render space - LLVector4a center; - LLVector4a t; - t.setAdd(min, max); - t.mul(0.5f); - mat_vert.affineTransform(t, center); - LLVector4a size; - size.setSub(max, min); - size.mul(0.5f); - llassert(less_than_max_mag(min)); - llassert(less_than_max_mag(max)); + //get 8 corners of bounding box + LLVector4Logical mask[6]; - if (!global_volume) + for (U32 i = 0; i < 6; ++i) { - //VECTORIZE THIS - LLVector4a scale; - scale.load3(mDrawablep->getVObj()->getScale().mV); - size.mul(scale); + mask[i].clear(); } - mat_normal.mMatrix[0].normalize3fast(); - mat_normal.mMatrix[1].normalize3fast(); - mat_normal.mMatrix[2].normalize3fast(); + mask[0].setElement<2>(); //001 + mask[1].setElement<1>(); //010 + mask[2].setElement<1>(); //011 + mask[2].setElement<2>(); + mask[3].setElement<0>(); //100 + mask[4].setElement<0>(); //101 + mask[4].setElement<2>(); + mask[5].setElement<0>(); //110 + mask[5].setElement<1>(); - LLVector4a v[4]; + LLVector4a v[8]; - //get 4 corners of bounding box - mat_normal.rotate(size,v[0]); + v[6] = min; + v[7] = max; - //VECTORIZE THIS - LLVector4a scale; - - scale.set(-1.f, -1.f, 1.f); - scale.mul(size); - mat_normal.rotate(scale, v[1]); + for (U32 i = 0; i < 6; ++i) + { + v[i].setSelectWithMask(mask[i], min, max); + } - scale.set(1.f, -1.f, -1.f); - scale.mul(size); - mat_normal.rotate(scale, v[2]); + LLVector4a tv[8]; - scale.set(-1.f, 1.f, -1.f); - scale.mul(size); - mat_normal.rotate(scale, v[3]); + //transform bounding box into drawable space + for (U32 i = 0; i < 8; ++i) + { + mat_vert.affineTransform(v[i], tv[i]); + } + //find bounding box LLVector4a& newMin = mExtents[0]; LLVector4a& newMax = mExtents[1]; - newMin = newMax = center; - - llassert(less_than_max_mag(center)); + newMin = newMax = tv[0]; - for (U32 i = 0; i < 4; i++) + for (U32 i = 1; i < 8; ++i) { - LLVector4a delta; - delta.setAbs(v[i]); - LLVector4a min; - min.setSub(center, delta); - LLVector4a max; - max.setAdd(center, delta); - - newMin.setMin(newMin,min); - newMax.setMax(newMax,max); - - llassert(less_than_max_mag(newMin)); - llassert(less_than_max_mag(newMax)); + newMin.setMin(newMin, tv[i]); + newMax.setMax(newMax, tv[i]); } if (!mDrawablep->isActive()) - { + { // Shift position for region LLVector4a offset; offset.load3(mDrawablep->getRegion()->getOriginAgent().mV); newMin.add(offset); newMax.add(offset); - - llassert(less_than_max_mag(newMin)); - llassert(less_than_max_mag(newMax)); } + LLVector4a t; t.setAdd(newMin, newMax); t.mul(0.5f); - llassert(less_than_max_mag(t)); - - //VECTORIZE THIS mCenterLocal.set(t.getF32ptr()); - llassert(less_than_max_mag(newMin)); - llassert(less_than_max_mag(newMax)); - t.setSub(newMax,newMin); mBoundingSphereRadius = t.getLength3().getF32()*0.5f; diff --git a/indra/newview/llface.h b/indra/newview/llface.h index 763634a3ab..66b5f13740 100755 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -194,8 +194,7 @@ public: void setSize(S32 numVertices, S32 num_indices = 0, bool align = false); - BOOL genVolumeBBoxes(const LLVolume &volume, S32 f, - const LLMatrix4& mat, BOOL global_volume = FALSE); + BOOL genVolumeBBoxes(const LLVolume &volume, S32 f,const LLMatrix4& mat, BOOL global_volume = FALSE); void init(LLDrawable* drawablep, LLViewerObject* objp); void destroy(); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 113bdd2ce3..33b26494de 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1458,7 +1458,7 @@ BOOL LLVOVolume::genBBoxes(BOOL force_global) continue; } res &= face->genVolumeBBoxes(*volume, i, - mRelativeXform, mRelativeXformInvTrans, + mRelativeXform, /*mRelativeXformInvTrans,*/ (mVolumeImpl && mVolumeImpl->isVolumeGlobal()) || force_global); if (rebuild) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index c4286e73eb..8be7b2ab53 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -169,6 +169,7 @@ S32 LLPipeline::RenderGlowIterations; F32 LLPipeline::RenderGlowWidth; F32 LLPipeline::RenderGlowStrength; BOOL LLPipeline::RenderDepthOfField; +BOOL LLPipeline::RenderDepthOfFieldInEditMode; F32 LLPipeline::CameraFocusTransitionTime; F32 LLPipeline::CameraFNumber; F32 LLPipeline::CameraFocalLength; @@ -379,6 +380,7 @@ BOOL LLPipeline::sWaterReflections = FALSE; BOOL LLPipeline::sRenderGlow = FALSE; BOOL LLPipeline::sReflectionRender = FALSE; BOOL LLPipeline::sImpostorRender = FALSE; +BOOL LLPipeline::sImpostorRenderAlphaDepthPass = FALSE; BOOL LLPipeline::sUnderWaterRender = FALSE; BOOL LLPipeline::sTextureBindTest = FALSE; BOOL LLPipeline::sRenderFrameTest = FALSE; diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index f0bebbe20d..fbbcf8f06d 100755 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -295,7 +295,8 @@ public: void unbindDeferredShader(LLGLSLShader& shader); void renderDeferredLighting(); - + void renderDeferredLightingToRT(LLRenderTarget* target); + void generateWaterReflection(LLCamera& camera); void generateSunShadow(LLCamera& camera); void generateHighlight(LLCamera& camera); @@ -594,6 +595,7 @@ public: static BOOL sPickAvatar; static BOOL sReflectionRender; static BOOL sImpostorRender; + static BOOL sImpostorRenderAlphaDepthPass; static BOOL sUnderWaterRender; static BOOL sRenderGlow; static BOOL sTextureBindTest; -- cgit v1.2.3 From 8675ed0491efee860ac1b2d1d5fe88d150768217 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 19 Aug 2013 16:04:28 -0700 Subject: Fix merge regressions from missed changes to LoD updates --- indra/llrender/llvertexbuffer.cpp | 28 ---------------------------- indra/newview/lldrawpoolalpha.cpp | 3 +-- indra/newview/lldrawpoolavatar.cpp | 10 ++++++++++ indra/newview/llvovolume.cpp | 7 +++++++ 4 files changed, 18 insertions(+), 30 deletions(-) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index fd7b846928..6a7cec3bad 100755 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -2209,39 +2209,11 @@ void LLVertexBuffer::bindForFeedback(U32 channel, U32 type, U32 index, U32 count #endif } -void DumpComponents(U32 mask) -{ - llinfos << - ((mask & LLVertexBuffer::MAP_VERTEX) ? "vertex:" : " ") << - ((mask & LLVertexBuffer::MAP_NORMAL) ? "norms:" : " ") << - ((mask & LLVertexBuffer::MAP_TEXCOORD0) ? "TC0:" : " ") << - ((mask & LLVertexBuffer::MAP_TEXCOORD1) ? "TC1:" : " ") << - ((mask & LLVertexBuffer::MAP_TEXCOORD2) ? "TC2:" : " ") << - ((mask & LLVertexBuffer::MAP_TEXCOORD3) ? "TC3:" : " ") << - ((mask & LLVertexBuffer::MAP_COLOR) ? "color:" : " ") << - ((mask & LLVertexBuffer::MAP_EMISSIVE) ? "emissive:" : " ") << - ((mask & LLVertexBuffer::MAP_TANGENT) ? "tangents" : " ") << llendl; -} - // Set for rendering void LLVertexBuffer::setBuffer(U32 data_mask) { flush(); - if((getTypeMask() & data_mask) != data_mask) - { - if (gDebugGL) - { - // Dump info about what was missing - // - DumpComponents(data_mask & ~getTypeMask()); - llwarns << "Missing VB stream components. ^^" << llendl; - } - // Make sure we don't write checks we can't cash below... - // - data_mask = (data_mask & getTypeMask()); - } - //set up pointers if the data mask is different ... bool setup = (sLastMask != data_mask); diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 500fad4f78..e4ebfea665 100755 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -399,7 +399,7 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass) // Fix for bug - NORSPEC-271 // If the face is more than 90% transparent, then don't update the Depth buffer for Dof // We don't want the nearly invisible objects to cause of DoF effects - if(pass == 1) + if(pass == 1 && !LLPipeline::sImpostorRender) { LLFace* face = params.mFace; if(face) @@ -577,7 +577,6 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass) // If this alpha mesh has glow, then draw it a second time to add the destination-alpha (=glow). Interleaving these state-changing calls could be expensive, but glow must be drawn Z-sorted with alpha. if (current_shader && - !LLPipeline::sImpostorRender && draw_glow_for_this_partition && params.mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_EMISSIVE)) { diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 120920a4b0..66bbc6819b 100755 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -136,6 +136,16 @@ void LLDrawPoolAvatar::prerender() { sBufferUsage = GL_STREAM_DRAW_ARB; } + + if (!mDrawFace.empty()) + { + const LLFace *facep = mDrawFace[0]; + if (facep && facep->getDrawable()) + { + LLVOAvatar* avatarp = (LLVOAvatar *)facep->getDrawable()->getVObj().get(); + updateRiggedVertexBuffers(avatarp); + } + } } LLMatrix4& LLDrawPoolAvatar::getModelView() diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 33b26494de..6b3611b796 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4863,7 +4863,14 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (is_rigged) { + if (!drawablep->isState(LLDrawable::RIGGED)) + { drawablep->setState(LLDrawable::RIGGED); + + //first time this is drawable is being marked as rigged, + // do another LoD update to use avatar bounding box + vobj->updateLOD(); + } } else { -- cgit v1.2.3 From 10419d802f88e7636a6ca45c6025b7e19b3ca3c7 Mon Sep 17 00:00:00 2001 From: mberezhnoy Date: Wed, 21 Aug 2013 17:44:39 +0300 Subject: MAINT-3020 ([CHUI] Torn off nearby chat is no longer visible after exiting mouselook) --- indra/newview/llfloaterimcontainer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 4591b80ac4..836a455a67 100755 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -674,13 +674,18 @@ void LLFloaterIMContainer::setVisible(BOOL visible) void LLFloaterIMContainer::getDetachedConversationFloaters(floater_list_t& floaters) { typedef conversations_widgets_map::value_type conv_pair; + LLFloaterIMNearbyChat *nearby_chat = LLFloaterReg::findTypedInstance("nearby_chat"); + BOOST_FOREACH(conv_pair item, mConversationsWidgets) { LLConversationViewSession* widget = dynamic_cast(item.second); if (widget) { LLFloater* session_floater = widget->getSessionFloater(); - if (session_floater && session_floater->isDetachedAndNotMinimized()) + + // Exclude nearby chat from output, as it should be handled separately + if (session_floater && session_floater->isDetachedAndNotMinimized() + && session_floater != nearby_chat) { floaters.push_back(session_floater); } -- cgit v1.2.3 From be07694b9cc8d2203cfedc777bcb00021dfa91a1 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 22 Aug 2013 00:51:15 +0200 Subject: MAINT-2773: Disable texture animation doesn't work --- doc/contributions.txt | 1 + indra/newview/llviewerobjectlist.cpp | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index 7712f16ade..caeda19496 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -176,6 +176,7 @@ Ansariel Hiller STORM-1713 STORM-1899 MAINT-2368 + MAINT-2773 Aralara Rajal Ardy Lay STORM-859 diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 66615657d8..b4e287c446 100755 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -954,15 +954,17 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) objectp = *idle_iter; llassert(objectp->isActive()); objectp->idleUpdate(agent, world, frame_time); - - } + } //update flexible objects LLVolumeImplFlexible::updateClass(); //update animated textures - LLViewerTextureAnim::updateClass(); - } + if (gAnimateTextures) + { + LLViewerTextureAnim::updateClass(); + } + } -- cgit v1.2.3 From 19726783cddb0ac3d34a510c083976e6f9661b49 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Fri, 23 Aug 2013 14:44:46 -0700 Subject: MAINT-3046 make LLNotifications clear out vecs of LLNotificationChannelPtr so singleton cleanup doesn't do things it really ought not do --- indra/llcommon/llinitparam.h | 3 ++- indra/llcommon/llinstancetracker.h | 1 + indra/llui/llnotifications.cpp | 6 +++++- indra/llui/llnotifications.h | 7 +++++++ indra/newview/llappviewer.cpp | 2 ++ 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h index ae836645b9..b3b56321d3 100755 --- a/indra/llcommon/llinitparam.h +++ b/indra/llcommon/llinitparam.h @@ -1952,7 +1952,7 @@ namespace LLInitParam class Mandatory : public TypedParam { typedef TypedParam super_t; - typedef Mandatory self_t; + typedef Mandatory self_t; typedef typename super_t::value_t value_t; typedef typename super_t::default_value_t default_value_t; @@ -1980,6 +1980,7 @@ namespace LLInitParam static bool validate(const Param* p) { // valid only if provided + llassert(p); return static_cast(p)->isProvided(); } diff --git a/indra/llcommon/llinstancetracker.h b/indra/llcommon/llinstancetracker.h index 361182380a..7ef7d101db 100755 --- a/indra/llcommon/llinstancetracker.h +++ b/indra/llcommon/llinstancetracker.h @@ -212,6 +212,7 @@ private: } void remove_() { + if (getMap_().find(mInstanceKey) != getMap_().end()) getMap_().erase(mInstanceKey); } diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 1789f003b9..0a79f2f588 100755 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -1125,7 +1125,7 @@ LLNotificationChannel::LLNotificationChannel(const Params& p) mName(p.name.isProvided() ? p.name : LLUUID::generateNewID().asString()) { BOOST_FOREACH(const std::string& source, p.sources) -{ + { connectToChannel(source); } } @@ -1209,6 +1209,10 @@ LLNotifications::LLNotifications() LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Notification.Show", boost::bind(&LLNotifications::addFromCallback, this, _2)); } +void LLNotifications::clear() +{ + mDefaultChannels.clear(); +} // The expiration channel gets all notifications that are cancelled bool LLNotifications::expirationFilter(LLNotificationPtr pNotification) diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index cd3728305e..3b620084ee 100755 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -874,6 +874,13 @@ class LLNotifications : friend class LLSingleton; public: + + // Needed to clear up RefCounted things prior to actual destruction + // as the singleton nature of the class makes them do "bad things" + // on at least Mac, if not all 3 platforms + // + void clear(); + // load all notification descriptions from file // calling more than once will overwrite existing templates // but never delete a template diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 1874cba4a4..75595f502f 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1614,6 +1614,8 @@ bool LLAppViewer::cleanup() //ditch LLVOAvatarSelf instance gAgentAvatarp = NULL; + LLNotifications::instance().clear(); + // workaround for DEV-35406 crash on shutdown LLEventPumps::instance().reset(); -- cgit v1.2.3 From f638fc803dbd53985253237efb12b1707f42d49d Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 23 Aug 2013 17:34:30 -0700 Subject: MAINT-3046 fix test regression from debug llassert accidentally checked in with crash fix --- indra/llcommon/llinitparam.h | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h index b3b56321d3..03ab0fb67f 100755 --- a/indra/llcommon/llinitparam.h +++ b/indra/llcommon/llinitparam.h @@ -1980,7 +1980,6 @@ namespace LLInitParam static bool validate(const Param* p) { // valid only if provided - llassert(p); return static_cast(p)->isProvided(); } -- cgit v1.2.3 From 6c45b3677ee06cd58056447a4b7b45fa78df8b74 Mon Sep 17 00:00:00 2001 From: Cho Date: Sat, 24 Aug 2013 02:15:08 +0100 Subject: added Google Analytics query parameters to URLs for FBC photos and checkins for ACME-854 --- indra/newview/llfloatersocial.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 4c17d9e40d..2a74c8e3ea 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -55,6 +55,8 @@ static LLRegisterPanelClassWrapper t_panel_account("llsoci const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte const std::string DEFAULT_CHECKIN_LOCATION_URL = "http://maps.secondlife.com/"; const std::string DEFAULT_CHECKIN_ICON_URL = "http://map.secondlife.com.s3.amazonaws.com/map_placeholder.png"; +const std::string DEFAULT_CHECKIN_QUERY_PARAMETERS = "?sourceid=slshare_checkin&utm_source=facebook&utm_medium=checkin&utm_campaign=slshare"; +const std::string DEFAULT_PHOTO_QUERY_PARAMETERS = "?sourceid=slshare_photo&utm_source=facebook&utm_medium=photo&utm_campaign=slshare"; std::string get_map_url() { @@ -345,12 +347,19 @@ void LLSocialPhotoPanel::sendPhoto() bool add_location = mLocationCheckbox->getValue().asBoolean(); if (add_location) { + // Get the SLURL for the location LLSLURL slurl; LLAgentUI::buildSLURL(slurl); + std::string slurl_string = slurl.getSLURLString(); + + // Add query parameters so Google Analytics can track incoming clicks! + slurl_string += DEFAULT_PHOTO_QUERY_PARAMETERS; + + // Add it to the caption (pretty crude, but we don't have a better option with photos) if (caption.empty()) - caption = slurl.getSLURLString(); + caption = slurl_string; else - caption = caption + " " + slurl.getSLURLString(); + caption = caption + " " + slurl_string; } // Get the image @@ -592,6 +601,9 @@ void LLSocialCheckinPanel::sendCheckin() { slurl_string = DEFAULT_CHECKIN_LOCATION_URL; } + + // Add query parameters so Google Analytics can track incoming clicks! + slurl_string += DEFAULT_CHECKIN_QUERY_PARAMETERS; // Get the region name std::string region_name = gAgent.getRegion()->getName(); -- cgit v1.2.3 From f46e07c14c11ffd26c0cf0794992d7c08d16fcd4 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Mon, 26 Aug 2013 10:16:11 -0700 Subject: MAINT-1453 ifdef around windows-only work-around to restore 8x and 16x AA modes on Mac --- indra/newview/llfloaterhardwaresettings.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp index 664f7d4fd6..792a2a5d25 100755 --- a/indra/newview/llfloaterhardwaresettings.cpp +++ b/indra/newview/llfloaterhardwaresettings.cpp @@ -151,12 +151,17 @@ BOOL LLFloaterHardwareSettings::postBuild() { childSetAction("OK", onBtnOK, this); +// Don't do this on Mac as their braindead GL versioning +// sets this when 8x and 16x are indeed available +// +#if !LL_DARWIN if (gGLManager.mIsIntel || gGLManager.mGLVersion < 3.f) { //remove FSAA settings above "4x" LLComboBox* combo = getChild("fsaa"); combo->remove("8x"); combo->remove("16x"); } +#endif refresh(); center(); -- cgit v1.2.3 From ecc4f2357df4cc139aa4e6a6a22f1ac5460f6871 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 26 Aug 2013 16:42:31 -0400 Subject: remove unused --logevents command line option because new validation causes unmapped options to be errors --- indra/newview/app_settings/cmd_line.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/indra/newview/app_settings/cmd_line.xml b/indra/newview/app_settings/cmd_line.xml index 789a07fbe2..a9f6079630 100755 --- a/indra/newview/app_settings/cmd_line.xml +++ b/indra/newview/app_settings/cmd_line.xml @@ -177,14 +177,6 @@ UserLoginInfo - logevents - - desc - Log ui events for later playback - map-to - LogEvents - - logmetrics desc -- cgit v1.2.3 From a4e74449857c57bf67104087015560baa69789ab Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 26 Aug 2013 16:43:03 -0400 Subject: correct merge error in llupdatechecker.cpp --- .../viewer_components/updater/llupdatechecker.cpp | 39 +++------------------- 1 file changed, 5 insertions(+), 34 deletions(-) diff --git a/indra/viewer_components/updater/llupdatechecker.cpp b/indra/viewer_components/updater/llupdatechecker.cpp index 3e170e44f4..abdace979a 100755 --- a/indra/viewer_components/updater/llupdatechecker.cpp +++ b/indra/viewer_components/updater/llupdatechecker.cpp @@ -149,40 +149,11 @@ void LLUpdateChecker::Implementation::completed(U32 status, server_error += content["error_text"].asString(); } - if (status == 404) - { - if (mProtocol == sProtocolVersion) - { - mProtocol = sLegacyProtocolVersion; - std::string retryUrl = buildUrl(mUrlBase, mChannel, mVersion, mPlatform, mPlatformVersion, mUniqueId, mWillingToTest); - - LL_WARNS("UpdaterService") - << "update response using " << sProtocolVersion - << " was HTTP 404 (" << server_error - << "); retry with legacy protocol " << mProtocol - << "\n at " << retryUrl - << LL_ENDL; - - mHttpClient.get(retryUrl, this); - } - else - { - LL_WARNS("UpdaterService") - << "update response using " << sLegacyProtocolVersion - << " was 404 (" << server_error - << "); request failed" - << LL_ENDL; - mClient.error(reason); - } - } - else - { - LL_WARNS("UpdaterService") << "response error " << status - << " " << reason - << " (" << server_error << ")" - << LL_ENDL; - mClient.error(reason); - } + LL_WARNS("UpdaterService") << "response error " << status + << " " << reason + << " (" << server_error << ")" + << LL_ENDL; + mClient.error(reason); } else { -- cgit v1.2.3 From 3f5e6280dbee3414d464a96a8d9d037c30adb123 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 26 Aug 2013 14:16:28 -0700 Subject: Tweak MAINT-3046 fix for faster remove_() performance --- indra/llcommon/llinstancetracker.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/indra/llcommon/llinstancetracker.h b/indra/llcommon/llinstancetracker.h index 7ef7d101db..55187d8325 100755 --- a/indra/llcommon/llinstancetracker.h +++ b/indra/llcommon/llinstancetracker.h @@ -212,8 +212,11 @@ private: } void remove_() { - if (getMap_().find(mInstanceKey) != getMap_().end()) - getMap_().erase(mInstanceKey); + typename InstanceMap::iterator iter = getMap_().find(mInstanceKey); + if (iter != getMap_().end()) + { + getMap_().erase(iter); + } } private: -- cgit v1.2.3 From 7614589adcf796e889c7d1d4ccda56a4b9353d31 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 27 Aug 2013 16:31:36 -0400 Subject: MAINT-3074: Remove warning log that kills FPS --- indra/llui/llview.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 9a42fc637b..262d9335c0 100755 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -995,7 +995,6 @@ BOOL LLView::handleUnicodeChar(llwchar uni_char, BOOL called_from_parent) BOOL LLView::handleUnicodeCharHere(llwchar uni_char ) { - llwarns << "LLView::handleUnicodeCharHere - about to return false - key is not being handled - a class somewhere should implement this method" << llendl; return FALSE; } -- cgit v1.2.3 From 306b2d810effdc677194f4db26c906a59e7386ff Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 27 Aug 2013 16:27:19 -0400 Subject: Fix coding style fails --- indra/llui/llview.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 262d9335c0..20015dca1a 100755 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -760,15 +760,15 @@ LLView* LLView::childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDA if ((viewp->*method)( local_x, local_y, extra ) || (allow_mouse_block && viewp->blockMouseEvent( local_x, local_y ))) { - lldebugs << "LLView::childrenHandleMouseEvent calling updatemouseeventinfo - local_x|global x "<< local_x << " " << x << "local/global y " << local_y << " " << y << llendl; - lldebugs << "LLView::childrenHandleMouseEvent getPathname for viewp result: " << viewp->getPathname() << "for this view: " << getPathname() << llendl; + lldebugs << "LLView::childrenHandleMouseEvent calling updatemouseeventinfo - local_x|global x "<< local_x << " " << x << "local/global y " << local_y << " " << y << llendl; + lldebugs << "LLView::childrenHandleMouseEvent getPathname for viewp result: " << viewp->getPathname() << "for this view: " << getPathname() << llendl; - LLViewerEventRecorder::instance().updateMouseEventInfo(x,y,-55,-55,getPathname()); + LLViewerEventRecorder::instance().updateMouseEventInfo(x,y,-55,-55,getPathname()); - // This is NOT event recording related - viewp->logMouseEvent(); + // This is NOT event recording related + viewp->logMouseEvent(); - return viewp; + return viewp; } } return NULL; @@ -936,7 +936,8 @@ BOOL LLView::handleKey(KEY key, MASK mask, BOOL called_from_parent) // For event logging we don't care which widget handles it // So we capture the key at the end of this function once we know if it was handled handled = handleKeyHere( key, mask ); - if (handled) { + if (handled) + { llwarns << "Key handled by " << getName() << llendl; } } @@ -985,7 +986,8 @@ BOOL LLView::handleUnicodeChar(llwchar uni_char, BOOL called_from_parent) handled = mParentView->handleUnicodeChar(uni_char, FALSE); } - if (handled) { + if (handled) + { LLViewerEventRecorder::instance().logKeyUnicodeEvent(uni_char); } @@ -1018,21 +1020,16 @@ BOOL LLView::hasMouseCapture() BOOL LLView::handleMouseUp(S32 x, S32 y, MASK mask) { - - LLView* r = childrenHandleMouseUp( x, y, mask ); return (r!=NULL); - } BOOL LLView::handleMouseDown(S32 x, S32 y, MASK mask) { - LLView* r= childrenHandleMouseDown(x, y, mask ); return (r!=NULL); - } BOOL LLView::handleDoubleClick(S32 x, S32 y, MASK mask) -- cgit v1.2.3 From dc54af030e8f60b2b871be901664ffae1fc934e9 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 27 Aug 2013 14:57:43 -0700 Subject: MAINT-3065 : Avatar render info's 'geometry' stat is unpredictable for linked objects Removed "geometry" and "surface" Reviewed by Kelly --- indra/llcommon/lllslconstants.h | 2 -- indra/lscript/lscript_compile/indra.l | 2 -- indra/newview/app_settings/keywords.ini | 2 -- indra/newview/llavatarrenderinfoaccountant.cpp | 31 +++++--------------------- indra/newview/llvoavatar.cpp | 2 -- indra/newview/llvoavatar.h | 6 ----- 6 files changed, 5 insertions(+), 40 deletions(-) diff --git a/indra/llcommon/lllslconstants.h b/indra/llcommon/lllslconstants.h index efa66390e8..926ce32d75 100755 --- a/indra/llcommon/lllslconstants.h +++ b/indra/llcommon/lllslconstants.h @@ -208,8 +208,6 @@ const S32 OBJECT_PHYSICS = 21; const S32 OBJECT_PHANTOM = 22; const S32 OBJECT_TEMP_ON_REZ = 23; const S32 OBJECT_RENDER_WEIGHT = 24; -const S32 OBJECT_ATTACHMENT_GEOMETRY_BYTES = 25; -const S32 OBJECT_ATTACHMENT_SURFACE_AREA = 26; // llTextBox() magic token string - yes this is a hack. sue me. char const* const TEXTBOX_MAGIC_TOKEN = "!!llTextBox!!"; diff --git a/indra/lscript/lscript_compile/indra.l b/indra/lscript/lscript_compile/indra.l index 8ed5f99a89..88dfc2e9f3 100755 --- a/indra/lscript/lscript_compile/indra.l +++ b/indra/lscript/lscript_compile/indra.l @@ -290,8 +290,6 @@ int yyerror(const char *fmt, ...); "OBJECT_PHANTOM" { count(); yylval.ival = OBJECT_PHANTOM; return(INTEGER_CONSTANT); } "OBJECT_TEMP_ON_REZ" { count(); yylval.ival = OBJECT_TEMP_ON_REZ; return(INTEGER_CONSTANT); } "OBJECT_RENDER_WEIGHT" { count(); yylval.ival = OBJECT_RENDER_WEIGHT; return(INTEGER_CONSTANT); } -"OBJECT_ATTACHMENT_GEOMETRY_BYTES" { count(); yylval.ival = OBJECT_ATTACHMENT_GEOMETRY_BYTES; return(INTEGER_CONSTANT); } -"OBJECT_ATTACHMENT_SURFACE_AREA" { count(); yylval.ival = OBJECT_ATTACHMENT_SURFACE_AREA; return(INTEGER_CONSTANT); } "TYPE_INTEGER" { count(); yylval.ival = LST_INTEGER; return(INTEGER_CONSTANT); } "TYPE_FLOAT" { count(); yylval.ival = LST_FLOATINGPOINT; return(INTEGER_CONSTANT); } diff --git a/indra/newview/app_settings/keywords.ini b/indra/newview/app_settings/keywords.ini index ef3c319da6..5ff8408943 100755 --- a/indra/newview/app_settings/keywords.ini +++ b/indra/newview/app_settings/keywords.ini @@ -195,8 +195,6 @@ OBJECT_PHYSICS Used with llGetObjectDetails to determine if the object is phy OBJECT_PHANTOM Used with llGetObjectDetails to determine if the object is phantom or not OBJECT_TEMP_ON_REZ Used with llGetObjectDetails to determine if the object is temporary or not OBJECT_RENDER_WEIGHT Used with llGetObjectDetails to return an avatar's rendering weight -OBJECT_ATTACHMENT_GEOMETRY_BYTES Used with llGetObjectDetails to return an avatar's attachment rendering geometry bytes -OBJECT_ATTACHMENT_SURFACE_AREA Used with llGetObjectDetails to return an avatar's attachment surface area # some vehicle params diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 2a4ec6d320..89c1b2a186 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -46,8 +46,6 @@ static const std::string KEY_AGENTS = "agents"; // map static const std::string KEY_WEIGHT = "weight"; // integer -static const std::string KEY_GEOMETRY = "geometry"; // integer -static const std::string KEY_SURFACE = "surface"; // float static const std::string KEY_IDENTIFIER = "identifier"; static const std::string KEY_MESSAGE = "message"; @@ -125,14 +123,6 @@ public: { ((LLVOAvatar *) avatarp)->setReportedVisualComplexity(agent_info_map[KEY_WEIGHT].asInteger()); } - if (agent_info_map.has(KEY_GEOMETRY)) - { - ((LLVOAvatar *) avatarp)->setReportedAttachmentGeometryBytes(agent_info_map[KEY_GEOMETRY].asInteger()); - } - if (agent_info_map.has(KEY_SURFACE)) - { - ((LLVOAvatar *) avatarp)->setReportedAttachmentSurfaceArea((F32) agent_info_map[KEY_SURFACE].asReal()); - } } report_iter++; } @@ -259,24 +249,13 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio if (avatar->getVisualComplexity() > 0) { info[KEY_WEIGHT] = avatar->getVisualComplexity(); - } - if (avatar->getAttachmentGeometryBytes() >= 0) - { - info[KEY_GEOMETRY] = (S32) avatar->getAttachmentGeometryBytes(); - } - if (avatar->getAttachmentSurfaceArea() >= 0.f) - { - info[KEY_SURFACE] = avatar->getAttachmentSurfaceArea(); - } - if (info.size() > 0) - { agents[avatar->getID().asString()] = info; - } - if (logRenderInfo()) - { - llinfos << "Sending avatar render info for " << avatar->getID() - << ": " << info << llendl; + if (logRenderInfo()) + { + llinfos << "Sending avatar render info for " << avatar->getID() + << ": " << info << llendl; + } } } iter++; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 0ffd8ad119..6a504e10c4 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -670,8 +670,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mAttachmentGeometryBytes(-1), mAttachmentSurfaceArea(-1.f), mReportedVisualComplexity(-1), - mReportedAttachmentGeometryBytes(-1), - mReportedAttachmentSurfaceArea(-1.f), mTurning(FALSE), mLastSkeletonSerialNum( 0 ), mIsSitting(FALSE), diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index be2d69a41a..295175133c 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -259,10 +259,6 @@ public: S32 getReportedVisualComplexity() { return mReportedVisualComplexity; }; // Numbers as reported by the SL server void setReportedVisualComplexity(S32 value) { mReportedVisualComplexity = value; }; - S32 getReportedAttachmentGeometryBytes() { return mReportedAttachmentGeometryBytes; }; //number of bytes in attached geometry - void setReportedAttachmentGeometryBytes(S32 value) { mReportedAttachmentGeometryBytes = value; }; - F32 getReportedAttachmentSurfaceArea() { return mReportedAttachmentSurfaceArea; }; //estimated surface area of attachments - void setReportedAttachmentSurfaceArea(F32 value) { mReportedAttachmentSurfaceArea = value; }; S32 getUpdatePeriod() { return mUpdatePeriod; }; const LLColor4 & getMutedAVColor() { return mMutedAVColor; }; @@ -416,8 +412,6 @@ public: F32 mAttachmentSurfaceArea; //estimated surface area of attachments S32 mReportedVisualComplexity; // Numbers as reported by the SL server - S32 mReportedAttachmentGeometryBytes; //number of bytes in attached geometry - F32 mReportedAttachmentSurfaceArea; //estimated surface area of attachments private: bool shouldAlphaMask(); -- cgit v1.2.3 From d8f700d6ac68388d021e923efa5d89e7d5852bd5 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 28 Aug 2013 09:14:29 -0700 Subject: NORSPEC-355 NORSPEC-356 replaced llerrs with asserts to avoid crashes from false alarms in release --- indra/newview/lldrawable.cpp | 8 +++++++- indra/newview/llviewertexturelist.cpp | 16 ++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 2a333157f2..9682f38227 100755 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -132,10 +132,16 @@ void LLDrawable::destroy() sNumZombieDrawables--; } + // Attempt to catch violations of this in debug, + // knowing that some false alarms may result + // + llassert(!LLSpatialGroup::sNoDelete); + + /* cannot be guaranteed and causes crashes on false alarms if (LLSpatialGroup::sNoDelete) { llerrs << "Illegal deletion of LLDrawable!" << llendl; - } + }*/ std::for_each(mFaces.begin(), mFaces.end(), DeletePointer()); mFaces.clear(); diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index d9f3548a29..487a06949a 100755 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -562,11 +562,11 @@ void LLViewerTextureList::addImageToList(LLViewerFetchedTexture *image) llassert(image); if (image->isInImageList()) { - llerrs << "LLViewerTextureList::addImageToList - Image already in list" << llendl; + llinfos << "LLViewerTextureList::addImageToList - Image already in list" << llendl; } if((mImageList.insert(image)).second != true) { - llerrs << "Error happens when insert image to mImageList!" << llendl ; + llinfos << "Error happens when insert image to mImageList!" << llendl ; } image->setInImageList(TRUE) ; @@ -585,32 +585,32 @@ void LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *image) { llinfos << "Image is not in mUUIDMap!" << llendl ; } - llerrs << "LLViewerTextureList::removeImageFromList - Image not in list" << llendl; + llinfos << "LLViewerTextureList::removeImageFromList - Image not in list" << llendl; } S32 count = mImageList.erase(image) ; + llassert(count == 1); if(count != 1) { - llinfos << image->getID() << llendl ; - llerrs << "Error happens when remove image from mImageList: " << count << llendl ; + llinfos << image->getID() << " removed with non-one count of " << count << llendl; } image->setInImageList(FALSE) ; } void LLViewerTextureList::addImage(LLViewerFetchedTexture *new_image) -{ +{ if (!new_image) { - llwarning("No image to add to image list", 0); return; } + llassert(new_image); LLUUID image_id = new_image->getID(); LLViewerFetchedTexture *image = findImage(image_id); if (image) { - llwarns << "Image with ID " << image_id << " already in list" << llendl; + llinfos << "Image with ID " << image_id << " already in list" << llendl; } sNumImages++; -- cgit v1.2.3 From ef7826a930071f1829fe81d12da75b048159acc7 Mon Sep 17 00:00:00 2001 From: Maestro Linden Date: Wed, 28 Aug 2013 23:49:53 +0000 Subject: MAINT-2506 Fix typo in PERMISSION_SILENT_ESTATE_MANAGEMENT keyword. Reviewed by Kelly. --- indra/newview/app_settings/keywords.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/keywords.ini b/indra/newview/app_settings/keywords.ini index 5ff8408943..ad843bca14 100755 --- a/indra/newview/app_settings/keywords.ini +++ b/indra/newview/app_settings/keywords.ini @@ -94,7 +94,7 @@ PERMISSION_CHANGE_LINKS Passed to llRequestPermissions library function to req PERMISSION_TRACK_CAMERA Passed to llRequestPermissions library function to request permission to track agent's camera PERMISSION_CONTROL_CAMERA Passed to llRequestPermissions library function to request permission to change agent's camera PERMISSION_TELEPORT Passed to llRequestPermissions library function to request permission to teleport agent -SCRIPT_PERMISSION_SILENT_ESTATE_MANAGEMENT Passed to llRequestPermissions library function to request permission to silently modify estate access lists +PERMISSION_SILENT_ESTATE_MANAGEMENT Passed to llRequestPermissions library function to request permission to silently modify estate access lists PERMISSION_OVERRIDE_ANIMATIONS Passed to llRequestPermissions library function to request permission to override animations on agent PERMISSION_RETURN_OBJECTS Passed to llRequestPermissions library function to request permission to return objects -- cgit v1.2.3 From f37023a060fcf3d4b094028bf6244c1dc749aa1a Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Thu, 29 Aug 2013 12:11:41 +0300 Subject: MAINT-3048 FIXED Don't block IMs from Lindens even when "Only friends and groups can call or IM me" is set --- indra/newview/llimview.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 9e23755d73..2e53effcac 100755 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -2670,7 +2670,8 @@ void LLIMMgr::addMessage( name_is_setted = true; } bool skip_message = false; - if (gSavedSettings.getBOOL("VoiceCallsFriendsOnly")) + bool from_linden = LLMuteList::getInstance()->isLinden(from); + if (gSavedSettings.getBOOL("VoiceCallsFriendsOnly") && !from_linden) { // Evaluate if we need to skip this message when that setting is true (default is false) skip_message = (LLAvatarTracker::instance().getBuddyInfo(other_participant_id) == NULL); // Skip non friends... @@ -2716,7 +2717,7 @@ void LLIMMgr::addMessage( // Logically it would make more sense to reject the session sooner, in another area of the // code, but the session has to be established inside the server before it can be left. - if (LLMuteList::getInstance()->isMuted(other_participant_id) && !LLMuteList::getInstance()->isLinden(from)) + if (LLMuteList::getInstance()->isMuted(other_participant_id) && !from_linden) { llwarns << "Leaving IM session from initiating muted resident " << from << llendl; if(!gIMMgr->leaveSession(new_session_id)) -- cgit v1.2.3 From 3364614f8b3c61a369760b4effc2ed9382be75f9 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 29 Aug 2013 09:27:12 -0400 Subject: add "Settings" logging tag to make debugging settings loading easier --- indra/llxml/llcontrol.cpp | 31 ++++++++++++++++--------------- indra/newview/llappviewer.cpp | 22 +++++++++++----------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp index 16f2290787..97fad7feb0 100755 --- a/indra/llxml/llcontrol.cpp +++ b/indra/llxml/llcontrol.cpp @@ -391,7 +391,7 @@ LLControlVariable* LLControlGroup::declareControl(const std::string& name, eCont } else { - llwarns << "Control named " << name << " already exists, ignoring new declaration." << llendl; + LL_WARNS("Settings") << "Control named " << name << " already exists, ignoring new declaration." << LL_ENDL; } return existing_control; } @@ -630,14 +630,14 @@ U32 LLControlGroup::loadFromFileLegacy(const std::string& filename, BOOL require if (!xml_controls.parseFile(filename)) { - llwarns << "Unable to open control file " << filename << llendl; + LL_WARNS("Settings") << "Unable to open control file " << filename << LL_ENDL; return 0; } LLXmlTreeNode* rootp = xml_controls.getRoot(); if (!rootp || !rootp->hasAttribute("version")) { - llwarns << "No valid settings header found in control file " << filename << llendl; + LL_WARNS("Settings") << "No valid settings header found in control file " << filename << LL_ENDL; return 0; } @@ -650,7 +650,7 @@ U32 LLControlGroup::loadFromFileLegacy(const std::string& filename, BOOL require // Check file version if (version != CURRENT_VERSION) { - llinfos << filename << " does not appear to be a version " << CURRENT_VERSION << " controls file" << llendl; + LL_INFOS("Settings") << filename << " does not appear to be a version " << CURRENT_VERSION << " controls file" << LL_ENDL; return 0; } @@ -668,7 +668,7 @@ U32 LLControlGroup::loadFromFileLegacy(const std::string& filename, BOOL require if (!name.empty()) { //read in to end of line - llwarns << "LLControlGroup::loadFromFile() : Trying to set \"" << name << "\", setting doesn't exist." << llendl; + LL_WARNS("Settings") << "LLControlGroup::loadFromFile() : Trying to set \"" << name << "\", setting doesn't exist." << LL_ENDL; } child_nodep = rootp->getNextChild(); continue; @@ -822,7 +822,7 @@ U32 LLControlGroup::saveToFile(const std::string& filename, BOOL nondefault_only LLControlVariable* control = iter->second; if (!control) { - llwarns << "Tried to save invalid control: " << iter->first << llendl; + LL_WARNS("Settings") << "Tried to save invalid control: " << iter->first << LL_ENDL; } else if( control->shouldSave(nondefault_only) ) { @@ -838,12 +838,12 @@ U32 LLControlGroup::saveToFile(const std::string& filename, BOOL nondefault_only { LLSDSerialize::toPrettyXML(settings, file); file.close(); - llinfos << "Saved to " << filename << llendl; + LL_INFOS("Settings") << "Saved to " << filename << LL_ENDL; } else { // This is a warning because sometime we want to use settings files which can't be written... - llwarns << "Unable to open settings file: " << filename << llendl; + LL_WARNS("Settings") << "Unable to open settings file: " << filename << LL_ENDL; return 0; } return num_saved; @@ -856,14 +856,14 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v infile.open(filename); if(!infile.is_open()) { - llwarns << "Cannot find file " << filename << " to load." << llendl; + LL_WARNS("Settings") << "Cannot find file " << filename << " to load." << LL_ENDL; return 0; } if (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXML(settings, infile)) { infile.close(); - llwarns << "Unable to parse LLSD control file " << filename << ". Trying Legacy Method." << llendl; + LL_WARNS("Settings") << "Unable to parse LLSD control file " << filename << ". Trying Legacy Method." << LL_ENDL; return loadFromFileLegacy(filename, TRUE, TYPE_STRING); } @@ -976,6 +976,7 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v ++validitems; } + LL_DEBUGS("Settings") << "Loaded " << validitems << " settings from " << filename << LL_ENDL; return validitems; } @@ -1012,7 +1013,7 @@ void main() BOOL_CONTROL baz; U32 count = gGlobals.loadFromFile("controls.ini"); - llinfos << "Loaded " << count << " controls" << llendl; + LL_INFOS("Settings") << "Loaded " << count << " controls" << LL_ENDL; // test insertion foo = new LLControlVariable("gFoo", 5.f, 1.f, 20.f); @@ -1273,19 +1274,19 @@ LLColor4 convert_from_llsd(const LLSD& sd, eControlType type, const st LLColor4 color(sd); if (color.mV[VRED] < 0.f || color.mV[VRED] > 1.f) { - llwarns << "Color " << control_name << " red value out of range: " << color << llendl; + LL_WARNS("Settings") << "Color " << control_name << " red value out of range: " << color << LL_ENDL; } else if (color.mV[VGREEN] < 0.f || color.mV[VGREEN] > 1.f) { - llwarns << "Color " << control_name << " green value out of range: " << color << llendl; + LL_WARNS("Settings") << "Color " << control_name << " green value out of range: " << color << LL_ENDL; } else if (color.mV[VBLUE] < 0.f || color.mV[VBLUE] > 1.f) { - llwarns << "Color " << control_name << " blue value out of range: " << color << llendl; + LL_WARNS("Settings") << "Color " << control_name << " blue value out of range: " << color << LL_ENDL; } else if (color.mV[VALPHA] < 0.f || color.mV[VALPHA] > 1.f) { - llwarns << "Color " << control_name << " alpha value out of range: " << color << llendl; + LL_WARNS("Settings") << "Color " << control_name << " alpha value out of range: " << color << LL_ENDL; } return LLColor4(sd); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 338558c937..8a7c24c5b5 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2227,13 +2227,13 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, BOOST_FOREACH(const SettingsFile& file, group.files) { - llinfos << "Attempting to load settings for the group " << file.name() - << " - from location " << location_key << llendl; + LL_INFOS("Settings") << "Attempting to load settings for the group " << file.name() + << " - from location " << location_key << LL_ENDL; LLControlGroup* settings_group = LLControlGroup::getInstance(file.name); if(!settings_group) { - llwarns << "No matching settings group for name " << file.name() << llendl; + LL_WARNS("Settings") << "No matching settings group for name " << file.name() << LL_ENDL; continue; } @@ -2262,7 +2262,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, if(settings_group->loadFromFile(full_settings_path, set_defaults, file.persistent)) { // success! - llinfos << "Loaded settings file " << full_settings_path << llendl; + LL_INFOS("Settings") << "Loaded settings file " << full_settings_path << LL_ENDL; } else { // failed to load @@ -2276,7 +2276,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, // only complain if we actually have a filename at this point if (!full_settings_path.empty()) { - llinfos << "Cannot load " << full_settings_path << " - No settings found." << llendl; + LL_INFOS("Settings") << "Cannot load " << full_settings_path << " - No settings found." << LL_ENDL; } } } @@ -2435,8 +2435,8 @@ bool LLAppViewer::initConfiguration() gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, clp.getOption("settings")[0]); gSavedSettings.setString("ClientSettingsFile", user_settings_filename); - llinfos << "Using command line specified settings filename: " - << user_settings_filename << llendl; + LL_INFOS("Settings") << "Using command line specified settings filename: " + << user_settings_filename << LL_ENDL; } // - load overrides from user_settings @@ -2452,8 +2452,8 @@ bool LLAppViewer::initConfiguration() { std::string session_settings_filename = clp.getOption("sessionsettings")[0]; gSavedSettings.setString("SessionSettingsFile", session_settings_filename); - llinfos << "Using session settings filename: " - << session_settings_filename << llendl; + LL_INFOS("Settings") << "Using session settings filename: " + << session_settings_filename << LL_ENDL; } loadSettingsFromDirectory("Session"); @@ -2461,8 +2461,8 @@ bool LLAppViewer::initConfiguration() { std::string user_session_settings_filename = clp.getOption("usersessionsettings")[0]; gSavedSettings.setString("UserSessionSettingsFile", user_session_settings_filename); - llinfos << "Using user session settings filename: " - << user_session_settings_filename << llendl; + LL_INFOS("Settings") << "Using user session settings filename: " + << user_session_settings_filename << LL_ENDL; } loadSettingsFromDirectory("UserSession"); -- cgit v1.2.3 From ea305b74d124aedf64afbb89d2b3685dae49bed9 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 29 Aug 2013 12:56:20 -0400 Subject: remove refresh of search attributes from draw method in About Land floater; does not seem to be needed and slows things down --- indra/newview/llfloaterland.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index f6d4f9a605..ba9fbbc84e 100755 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2092,7 +2092,6 @@ void LLPanelLandOptions::refresh() // virtual void LLPanelLandOptions::draw() { - refreshSearch(); // Is this necessary? JC LLPanel::draw(); } -- cgit v1.2.3 From 357ded33cf48247ce0a305419f9e42c87e19062d Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 29 Aug 2013 12:06:46 -0700 Subject: removing test code --- indra/newview/llparticipantlist.cpp | 15 --------------- indra/newview/llparticipantlist.h | 1 - 2 files changed, 16 deletions(-) diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index b5c9f4a310..ee6893907e 100755 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -404,21 +404,6 @@ void LLParticipantList::addAvatarIDExceptAgent(const LLUUID& avatar_id) static LLFastTimer::DeclareTimer FTM_FOLDERVIEW_TEST("add test avatar agents"); - -void LLParticipantList::addTestAvatarAgents() -{ - LLFastTimer _(FTM_FOLDERVIEW_TEST); - - LL_INFOS("LLParticipantList") << "start adding 300 users" << LL_ENDL; - - for(int i = 0; i < 300; ++i) - { - addAvatarIDExceptAgent(LLUUID().generateNewID()); - } - - LL_INFOS("LLParticipantList") << "finished adding 300 users" << LL_ENDL; -} - void LLParticipantList::adjustParticipant(const LLUUID& speaker_id) { LLPointer speakerp = mSpeakerMgr->findSpeaker(speaker_id); diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h index 936e289c08..3a3ae76604 100755 --- a/indra/newview/llparticipantlist.h +++ b/indra/newview/llparticipantlist.h @@ -50,7 +50,6 @@ public: * @param[in] avatar_id - Avatar UUID to be added into the list */ void addAvatarIDExceptAgent(const LLUUID& avatar_id); - void addTestAvatarAgents(); /** * Refreshes the participant list. -- cgit v1.2.3 From d43a302eaf1b0ca521d4b865e39a8d849da5d5b8 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 29 Aug 2013 16:51:59 -0400 Subject: MAINT-3075: don't display the target user name as a SLURL in the RequestTeleport dialog --- indra/newview/llavataractions.cpp | 9 ++++++++- indra/newview/skins/default/xui/en/notifications.xml | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 5f1f57f550..70cc48f12b 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -445,7 +445,14 @@ void LLAvatarActions::teleportRequest(const LLUUID& id) { LLSD notification; notification["uuid"] = id; - notification["NAME_SLURL"] = LLSLURL("agent", id, "about").getSLURLString(); + LLAvatarName av_name; + if (!LLAvatarNameCache::get(id, &av_name)) + { + // unlikely ... they just picked this name from somewhere... + LLAvatarNameCache::get(id, boost::bind(&LLAvatarActions::teleportRequest, id)); + return; // reinvoke this when the name resolves + } + notification["NAME"] = av_name.getCompleteName(); LLSD payload; diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 9ed9a6f409..fce21b403b 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4073,7 +4073,7 @@ Join me in [REGION] icon="alertmodal.tga" name="TeleportRequestPrompt" type="alertmodal"> -Request a teleport to [NAME_SLURL] with the following message +Request a teleport to [NAME] with the following message confirm -- cgit v1.2.3 From ed828365b8a5371b1deadaa8cc1c2f1fdf729227 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 29 Aug 2013 16:05:49 -0700 Subject: ACME-866 User receives error when hitting Disconnect in Facebook floater, if access token was cleared manually on backend: Problem was that when the user was already disconnected the Facebook connection state was not being set to disconnected. --- indra/newview/llfacebookconnect.cpp | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index abfacdb93c..451c0f5767 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -190,17 +190,28 @@ public: LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_DISCONNECTING); } + void setUserDisconnected() + { + // Clear data + LLFacebookConnect::instance().clearInfo(); + LLFacebookConnect::instance().clearContent(); + //Notify state change + LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED); + } + virtual void completed(U32 status, const std::string& reason, const LLSD& content) { - if (isGoodStatus(status)) + if (isGoodStatus(status)) { LL_DEBUGS("FacebookConnect") << "Disconnect successful. content: " << content << LL_ENDL; - - // Clear data - LLFacebookConnect::instance().clearInfo(); - LLFacebookConnect::instance().clearContent(); - //Notify state change - LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED); + setUserDisconnected(); + + } + //User not found so already disconnected + else if(status == 404) + { + LL_DEBUGS("FacebookConnect") << "Already disconnected. content: " << content << LL_ENDL; + setUserDisconnected(); } else { -- cgit v1.2.3 From cacefaf2fc1b95557aca62dc69dbe3744c6424b0 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 30 Aug 2013 15:55:20 -0500 Subject: MAINT-2811 Fix for infinite loop on octree code during teleport. --- indra/llmath/llvolume.cpp | 30 +++++++++++++++++++----------- indra/newview/llviewermenu.cpp | 2 -- indra/newview/llviewerpartsim.cpp | 4 ++++ indra/newview/llviewerpartsim.h | 4 ++++ indra/newview/llvopartgroup.cpp | 21 +++++++++++++-------- 5 files changed, 40 insertions(+), 21 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 773995cb86..0c329c69b2 100755 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -802,6 +802,7 @@ BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detai { // Scale by 4 to generate proper tex coords. mProfile[i].mul(scale); + llassert(mProfile[i].isFinite3()); } if (hollow) @@ -839,6 +840,7 @@ BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detai { // Scale by 3 to generate proper tex coords. mProfile[i].mul(scale); + llassert(mProfile[i].isFinite3()); } if (path_open) @@ -989,6 +991,7 @@ BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detai { mOpen = FALSE; mProfile.push_back(mProfile[0]); + llassert(mProfile[0].isFinite3()); mTotal++; } } @@ -2127,7 +2130,7 @@ BOOL LLVolume::generate() { rot_mat.rotate(*profile++, tmp); dst->setAdd(tmp,offset); - llassert(less_than_max_mag(*dst)); + llassert(dst->isFinite3()); ++dst; } } @@ -2840,6 +2843,8 @@ void LLVolume::sculptGeneratePlaceholder() p[1] = (F32)(sin(F_PI * v) * sin(2.0 * F_PI * u) * RADIUS); p[2] = (F32)(cos(F_PI * v) * RADIUS); + llassert(pt.isFinite3()); + } line += sizeT; } @@ -2927,6 +2932,8 @@ void LLVolume::sculptGenerateMapVertices(U16 sculpt_width, U16 sculpt_height, S8 LLVector4a scale(-1.f,1,1,1); pt.mul(scale); } + + llassert(pt.isFinite3()); } line += sizeT; @@ -5552,12 +5559,14 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) tc->mV[0] = (*p)[0]+0.5f; tc->mV[1] = (*p)[1]+0.5f; - llassert(less_than_max_mag(*src)); + llassert(src->isFinite3()); update_min_max(min,max,*src); update_min_max(min_uv, max_uv, *tc); *pos = *src; + llassert(pos->isFinite3()); + ++p; ++tc; ++src; @@ -5577,11 +5586,13 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) tc->mV[0] = (*p)[0]+0.5f; tc->mV[1] = 0.5f - (*p)[1]; - llassert(less_than_max_mag(*src)); + llassert(src->isFinite3()); update_min_max(min,max,*src); update_min_max(min_uv, max_uv, *tc); *pos = *src; + + llassert(pos->isFinite3()); ++p; ++tc; @@ -6468,8 +6479,11 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) // mQ = { 0, a[X]*b[Y] - a[Y]*b[X], a[Z]*b[X] - a[X]*b[Z], a[Y]*b[Z] - a[Z]*b[Y] } vector1 = _mm_sub_ps( vector2, _mm_mul_ps( amQ, bmQ )); + llassert(v1.isFinite3()); + v1.store4a((F32*) output); + output++; idx += 3; } @@ -6498,14 +6512,8 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) n1.add(c); n2.add(c); - llassert(llfinite(c.getF32ptr()[0])); - llassert(llfinite(c.getF32ptr()[1])); - llassert(llfinite(c.getF32ptr()[2])); - - llassert(!llisnan(c.getF32ptr()[0])); - llassert(!llisnan(c.getF32ptr()[1])); - llassert(!llisnan(c.getF32ptr()[2])); - + llassert(c.isFinite3()); + //even out quad contributions switch (i%2+1) { diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 33d4b65d4a..c6c1090f45 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -1073,8 +1073,6 @@ class LLAdvancedCheckInfoDisplay : public view_listener_t U32 info_display = info_display_from_string( userdata.asString() ); bool new_value = false; - LL_INFOS("ViewerMenu") << "check " << userdata.asString() << LL_ENDL; - if ( info_display != 0 ) { new_value = LLPipeline::toggleRenderDebugControl( (void*)info_display ); diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index 96cd43a8ab..163c90019f 100755 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -160,7 +160,11 @@ LLViewerPartGroup::LLViewerPartGroup(const LLVector3 ¢er_agent, const F32 bo } mVOPartGroupp->setViewerPartGroup(this); mVOPartGroupp->setPositionAgent(getCenterAgent()); + + mBoxSide = box_side; + F32 scale = box_side * 0.5f; + mVOPartGroupp->setScale(LLVector3(scale,scale,scale)); //gPipeline.addObject(mVOPartGroupp); diff --git a/indra/newview/llviewerpartsim.h b/indra/newview/llviewerpartsim.h index 095de2060c..2daa07ed8c 100755 --- a/indra/newview/llviewerpartsim.h +++ b/indra/newview/llviewerpartsim.h @@ -105,6 +105,9 @@ public: void shift(const LLVector3 &offset); + F32 getBoxRadius() { return mBoxRadius; } + F32 getBoxSide() { return mBoxSide; } + typedef std::vector part_list_t; part_list_t mParticles; @@ -125,6 +128,7 @@ public: protected: LLVector3 mCenterAgent; F32 mBoxRadius; + F32 mBoxSide; LLVector3 mMinObjPos; LLVector3 mMaxObjPos; diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index a65de0c047..1630b5d484 100755 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -176,24 +176,28 @@ BOOL LLVOPartGroup::isActive() const F32 LLVOPartGroup::getBinRadius() { - return mScale.mV[0]*2.f; + return mViewerPartGroupp->getBoxSide(); } void LLVOPartGroup::updateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) { const LLVector3& pos_agent = getPositionAgent(); - newMin.load3( (pos_agent - mScale).mV); - newMax.load3( (pos_agent + mScale).mV); + LLVector4a scale; + LLVector4a p; + + p.load3(pos_agent.mV); + + scale.splat(mScale.mV[0]+mViewerPartGroupp->getBoxSide()*0.5f); + + newMin.setSub(p, scale); + newMax.setAdd(p,scale); llassert(newMin.isFinite3()); llassert(newMax.isFinite3()); - LLVector4a pos; - pos.load3(pos_agent.mV); - - llassert(pos.isFinite3()); - mDrawable->setPositionGroup(pos); + llassert(p.isFinite3()); + mDrawable->setPositionGroup(p); } void LLVOPartGroup::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) @@ -459,6 +463,7 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable) } //record max scale (used to stretch bounding box for visibility culling) + mScale.set(max_scale, max_scale, max_scale); mDrawable->movePartition(); -- cgit v1.2.3 From a0244eb6f9b4b9de5c7831f770ac508f9c0f378a Mon Sep 17 00:00:00 2001 From: mberezhnoy Date: Wed, 4 Sep 2013 09:20:33 +0300 Subject: MAINT-3073 ([CHUIBUG](You) feature is irritating, especially for emotes) --- indra/newview/llchathistory.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index af3c6eff11..43a733f918 100755 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -898,20 +898,10 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL LLStyle::Params link_params(body_message_params); link_params.overwriteFrom(LLStyleMap::instance().lookupAgent(chat.mFromID)); - if (from_me) - { std::string localized_name; - bool is_localized = LLTrans::findString(localized_name, "AgentNameSubst"); - mEditor->appendText((is_localized? localized_name:"(You)") + delimiter, - prependNewLineState, link_params); - prependNewLineState = false; - } - else - { // Add link to avatar's inspector and delimiter to message. - mEditor->appendText(std::string(link_params.link_href) + delimiter, - prependNewLineState, link_params); - prependNewLineState = false; - } + mEditor->appendText(std::string(link_params.link_href) + delimiter, + prependNewLineState, link_params); + prependNewLineState = false; } else { -- cgit v1.2.3 From e5597b83cf20b444d070316ffbbc13d33b4dcf2b Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Tue, 3 Sep 2013 20:24:49 +0300 Subject: CHUI-836 FIXED [CHUIBUG]Opening chat history from the conversation log sometimes crashes the viewer --- indra/newview/llfloaterconversationpreview.cpp | 39 +++++++++----------------- indra/newview/llfloaterconversationpreview.h | 3 +- 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp index b570de14aa..7d2f151e0b 100755 --- a/indra/newview/llfloaterconversationpreview.cpp +++ b/indra/newview/llfloaterconversationpreview.cpp @@ -43,14 +43,15 @@ LLFloaterConversationPreview::LLFloaterConversationPreview(const LLSD& session_i mCurrentPage(0), mPageSize(gSavedSettings.getS32("ConversationHistoryPageSize")), mAccountName(session_id[LL_FCP_ACCOUNT_NAME]), - mCompleteName(session_id[LL_FCP_COMPLETE_NAME]) + mCompleteName(session_id[LL_FCP_COMPLETE_NAME]), + mMutex(NULL) { } BOOL LLFloaterConversationPreview::postBuild() { mChatHistory = getChild("chat_history"); - LLLoadHistoryThread::setLoadEndSignal(boost::bind(&LLFloaterConversationPreview::SetPages, this, _1, _2)); + LLLoadHistoryThread::setLoadEndSignal(boost::bind(&LLFloaterConversationPreview::setPages, this, _1, _2)); const LLConversation* conv = LLConversationLog::instance().getConversation(mSessionID); std::string name; @@ -95,14 +96,15 @@ BOOL LLFloaterConversationPreview::postBuild() return LLFloater::postBuild(); } -void LLFloaterConversationPreview::SetPages(std::list& messages, const std::string& file_name) +void LLFloaterConversationPreview::setPages(std::list& messages,const std::string& file_name) { if(file_name == mChatHistoryFileName) { + // additional protection to avoid changes of mMessages in setPages() + LLMutexLock lock(&mMutex); mMessages = messages; + mCurrentPage = (mMessages.size() ? (mMessages.size() - 1) / mPageSize : 0); - - mCurrentPage = mMessages.size() / mPageSize; mPageSpinner->setEnabled(true); mPageSpinner->setMaxValue(mCurrentPage+1); mPageSpinner->set(mCurrentPage+1); @@ -110,10 +112,9 @@ void LLFloaterConversationPreview::SetPages(std::list& messages, const std std::string total_page_num = llformat("/ %d", mCurrentPage+1); getChild("page_num_label")->setValue(total_page_num); mChatHistoryLoaded = true; - } - } + void LLFloaterConversationPreview::draw() { if(mChatHistoryLoaded) @@ -131,32 +132,21 @@ void LLFloaterConversationPreview::onOpen(const LLSD& key) void LLFloaterConversationPreview::showHistory() { - if (!mMessages.size()) + // additional protection to avoid changes of mMessages in setPages() + LLMutexLock lock(&mMutex); + + if (!mMessages.size() || mCurrentPage * mPageSize >= mMessages.size()) { return; } mChatHistory->clear(); - std::ostringstream message; std::list::const_iterator iter = mMessages.begin(); + std::advance(iter, mCurrentPage * mPageSize); - int delta = 0; - if (mCurrentPage) - { - int remainder = mMessages.size() % mPageSize; - delta = (remainder == 0) ? 0 : (mPageSize - remainder); - } - - std::advance(iter, (mCurrentPage * mPageSize) - delta); - - for (int msg_num = 0; (iter != mMessages.end() && msg_num < mPageSize); ++iter, ++msg_num) + for (int msg_num = 0; iter != mMessages.end() && msg_num < mPageSize; ++iter, ++msg_num) { - if (iter->size() == 0) - { - continue; - } - LLSD msg = *iter; LLUUID from_id = LLUUID::null; @@ -200,7 +190,6 @@ void LLFloaterConversationPreview::showHistory() mChatHistory->appendMessage(chat,chat_args); } - } void LLFloaterConversationPreview::onMoreHistoryBtnClick() diff --git a/indra/newview/llfloaterconversationpreview.h b/indra/newview/llfloaterconversationpreview.h index 389f3dfd09..f8796127ba 100755 --- a/indra/newview/llfloaterconversationpreview.h +++ b/indra/newview/llfloaterconversationpreview.h @@ -42,7 +42,7 @@ public: virtual ~LLFloaterConversationPreview(){}; virtual BOOL postBuild(); - void SetPages(std::list& messages,const std::string& file_name); + void setPages(std::list& messages,const std::string& file_name); virtual void draw(); virtual void onOpen(const LLSD& key); @@ -51,6 +51,7 @@ private: void onMoreHistoryBtnClick(); void showHistory(); + LLMutex mMutex; LLSpinCtrl* mPageSpinner; LLChatHistory* mChatHistory; LLUUID mSessionID; -- cgit v1.2.3 From 5172d4edac75fbca2209279ffd8a837cfe99434d Mon Sep 17 00:00:00 2001 From: Nicky Date: Tue, 3 Sep 2013 13:50:35 -0400 Subject: OPEN-187: Properly cleanup all allocated OpenSSL structures. --- doc/contributions.txt | 1 + indra/newview/llsechandler_basic.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/doc/contributions.txt b/doc/contributions.txt index a6d522de2f..17c38ce343 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -924,6 +924,7 @@ Nicky Dasmijn BUG-2432 BUG-3605 CHUIBUG-197 + OPEN-187 Nicky Perian OPEN-1 STORM-1087 diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp index 928d26646b..c4d5450e2b 100755 --- a/indra/newview/llsechandler_basic.cpp +++ b/indra/newview/llsechandler_basic.cpp @@ -207,6 +207,7 @@ LLSD _basic_constraints_ext(X509* cert) } } + BASIC_CONSTRAINTS_free( bs ); } return result; } @@ -268,6 +269,8 @@ LLSD _ext_key_usage_ext(X509* cert) ASN1_OBJECT_free(usage); } } + + EXTENDED_KEY_USAGE_free( eku ); } return result; } @@ -280,6 +283,8 @@ LLSD _subject_key_identifier_ext(X509 *cert) if(skeyid) { result = cert_string_from_octet_string(skeyid); + + ASN1_OCTET_STRING_free( skeyid ); } return result; } @@ -300,6 +305,9 @@ LLSD _authority_key_identifier_ext(X509* cert) { result[CERT_AUTHORITY_KEY_IDENTIFIER_SERIAL] = cert_string_from_asn1_integer(akeyid->serial); } + + + AUTHORITY_KEYID_free( akeyid ); } // we ignore the issuer name in the authority key identifier, we check the issue name via @@ -1049,6 +1057,8 @@ void LLBasicCertificateStore::validate(int validation_policy, throw LLInvalidCertificate((*current_cert)); } std::string sha1_hash((const char *)cert_x509->sha1_hash, SHA_DIGEST_LENGTH); + X509_free( cert_x509 ); + cert_x509 = NULL; t_cert_cache::iterator cache_entry = mTrustedCertCache.find(sha1_hash); if(cache_entry != mTrustedCertCache.end()) { -- cgit v1.2.3 From 3ba9cf20486ac80276f262c57a9280dc875504eb Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 3 Sep 2013 19:11:20 -0700 Subject: ACME-789: Remove SLShareHost setting from settings.xml --- indra/newview/app_settings/settings.xml | 11 ----------- indra/newview/llfacebookconnect.cpp | 15 --------------- 2 files changed, 26 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 098693eb98..b199929d91 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3533,17 +3533,6 @@ Value 0 - SLShareHost - - Comment - Host for contacting SL FB services - Persist - 1 - Type - String - Value - - FastCacheFetchEnabled Comment diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 451c0f5767..9c70757278 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -32,7 +32,6 @@ #include "llagent.h" #include "llcallingcard.h" // for LLAvatarTracker #include "llcommandhandler.h" -#include "llcontrol.h" #include "llhttpclient.h" #include "llnotificationsutil.h" #include "llurlaction.h" @@ -49,8 +48,6 @@ boost::scoped_ptr LLFacebookConnect::sStateWatcher(new LLEventStrea boost::scoped_ptr LLFacebookConnect::sInfoWatcher(new LLEventStream("FacebookConnectInfo")); boost::scoped_ptr LLFacebookConnect::sContentWatcher(new LLEventStream("FacebookConnectContent")); -extern LLControlGroup gSavedSettings; - // Local functions void log_facebook_connect_error(const std::string& request, U32 status, const std::string& reason, const std::string& code, const std::string& description) { @@ -360,18 +357,6 @@ void LLFacebookConnect::openFacebookWeb(std::string url) std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route, bool include_read_from_master) { static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); - - //*TODO : Remove this code along with extern and llcontrol.h header - std::string host = gSavedSettings.getString("SLShareHost"); - if (!host.empty()) - { - sFacebookConnectUrl = host + "/fbc/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho - } - else - { - sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); - } - //End removable part std::string url = sFacebookConnectUrl + route; if (include_read_from_master && mReadFromMaster) -- cgit v1.2.3 From cedc571e4b4f887af352e2561e5c4d31ea6982f6 Mon Sep 17 00:00:00 2001 From: dmitrykproductengine Date: Wed, 4 Sep 2013 13:09:35 +0300 Subject: MAINT-3095 FIXED Viewer crashes after opening Nearby chat history, if it is empty --- indra/newview/llfloaterconversationpreview.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp index b570de14aa..7cb313af33 100755 --- a/indra/newview/llfloaterconversationpreview.cpp +++ b/indra/newview/llfloaterconversationpreview.cpp @@ -126,7 +126,10 @@ void LLFloaterConversationPreview::draw() void LLFloaterConversationPreview::onOpen(const LLSD& key) { - showHistory(); + if(mChatHistoryLoaded) + { + showHistory(); + } } void LLFloaterConversationPreview::showHistory() -- cgit v1.2.3 From 5ffdeb4e0c560bbc3469cf9119509f71c3cf1231 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Wed, 4 Sep 2013 10:44:26 -0700 Subject: MAINT-3016 FIX Viewer freeze... by reverting fix for MAINT-2849 (certain streams do not play) - freeze more important than no play --- indra/llaudio/llstreamingaudio_fmodex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llaudio/llstreamingaudio_fmodex.cpp b/indra/llaudio/llstreamingaudio_fmodex.cpp index 266fa2f57b..42f30aa1c4 100644 --- a/indra/llaudio/llstreamingaudio_fmodex.cpp +++ b/indra/llaudio/llstreamingaudio_fmodex.cpp @@ -310,7 +310,7 @@ LLAudioStreamManagerFMODEX::LLAudioStreamManagerFMODEX(FMOD::System *system, con { mInternetStreamURL = url; - FMOD_RESULT result = mSystem->createStream(url.c_str(), FMOD_2D | FMOD_NONBLOCKING | FMOD_MPEGSEARCH | FMOD_IGNORETAGS, 0, &mInternetStream); + FMOD_RESULT result = mSystem->createStream(url.c_str(), FMOD_2D | FMOD_NONBLOCKING | FMOD_IGNORETAGS, 0, &mInternetStream); if (result!= FMOD_OK) { -- cgit v1.2.3 From 2108e9de5bb93d60a040ff385f50552ceed9b076 Mon Sep 17 00:00:00 2001 From: "katharine@exodusviewer.com" Date: Wed, 4 Sep 2013 16:37:33 -0400 Subject: OPEN-149: fix documentation of LLColor4 constructor for F32 vector --- doc/contributions.txt | 1 + indra/llmath/v4color.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index c377de8513..b2df058614 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -688,6 +688,7 @@ Kagehi Kohn Kaimen Takahe Katharine Berry STORM-1900 + OPEN-149 Keklily Longfall Ken Lavender Ken March diff --git a/indra/llmath/v4color.h b/indra/llmath/v4color.h index b047f86e6e..8c8c315808 100755 --- a/indra/llmath/v4color.h +++ b/indra/llmath/v4color.h @@ -50,7 +50,7 @@ class LLColor4 LLColor4(F32 r, F32 g, F32 b); // Initializes LLColor4 to (r, g, b, 1) LLColor4(F32 r, F32 g, F32 b, F32 a); // Initializes LLColor4 to (r. g, b, a) LLColor4(U32 clr); // Initializes LLColor4 to (r=clr>>24, etc)) - LLColor4(const F32 *vec); // Initializes LLColor4 to (vec[0]. vec[1], vec[2], 1) + LLColor4(const F32 *vec); // Initializes LLColor4 to (vec[0]. vec[1], vec[2], vec[3]) LLColor4(const LLColor3 &vec, F32 a = 1.f); // Initializes LLColor4 to (vec, a) explicit LLColor4(const LLSD& sd); explicit LLColor4(const LLColor4U& color4u); // "explicit" to avoid automatic conversion -- cgit v1.2.3 From 035ab9f3747dc555148b17b87888fcf60ccc0114 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 5 Sep 2013 11:41:19 -0400 Subject: open-183: improve local build number generation to account for multiple heads --- indra/cmake/BuildVersion.cmake | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/indra/cmake/BuildVersion.cmake b/indra/cmake/BuildVersion.cmake index af2063ce6d..e4b63dc7cb 100755 --- a/indra/cmake/BuildVersion.cmake +++ b/indra/cmake/BuildVersion.cmake @@ -16,22 +16,26 @@ if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/n else (DEFINED ENV{revision}) find_program(MERCURIAL hg) - if (DEFINED MERCURIAL) + find_program(WORDCOUNT wc) + find_program(SED sed) + if (DEFINED MERCURIAL AND DEFINED WORDCOUNT AND DEFINED SED) execute_process( - COMMAND ${MERCURIAL} log -r tip --template "{rev}" + COMMAND ${MERCURIAL} log -r tip:0 --template '\\n' + COMMAND ${WORDCOUNT} -l + COMMAND ${SED} "s/ //g" OUTPUT_VARIABLE VIEWER_VERSION_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE ) if ("${VIEWER_VERSION_REVISION}" MATCHES "^[0-9]+$") message("Revision (from hg) ${VIEWER_VERSION_REVISION}") else ("${VIEWER_VERSION_REVISION}" MATCHES "^[0-9]+$") + message("Revision not set (repository not found?); using 0") set(VIEWER_VERSION_REVISION 0 ) - message("Revision not set, repository not found, using ${VIEWER_VERSION_REVISION}") endif ("${VIEWER_VERSION_REVISION}" MATCHES "^[0-9]+$") - else (DEFINED MERCURIAL) + else (DEFINED MERCURIAL AND DEFINED WORDCOUNT AND DEFINED SED) + message("Revision not set: 'hg', 'wc' or 'sed' not found; using 0") set(VIEWER_VERSION_REVISION 0) - message("Revision not set, 'hg' not found (${MERCURIAL}), using ${VIEWER_VERSION_REVISION}") - endif (DEFINED MERCURIAL) + endif (DEFINED MERCURIAL AND DEFINED WORDCOUNT AND DEFINED SED) endif (DEFINED ENV{revision}) message("Building '${VIEWER_CHANNEL}' Version ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}") else ( EXISTS ${VIEWER_VERSION_BASE_FILE} ) -- cgit v1.2.3 From 8dc273b942ca3bae7469dcbaf7bab171b889eea1 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 5 Sep 2013 15:18:58 -0400 Subject: correct some doc strings in the autobuild config file --- autobuild.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index e047d4d686..3ffe77451f 100755 --- a/autobuild.xml +++ b/autobuild.xml @@ -1965,11 +1965,11 @@ package_description description - Spell checking dictionaries + Second Life Viewer license - various open + LGPL name - dictionaries + Second Life Viewer platforms common -- cgit v1.2.3 From a3be9d3467c068f8ed0d4f1c98484d132b1f1a5f Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 5 Sep 2013 17:30:23 -0700 Subject: NORSPEC-360 fix issues with mip selection and TCs in projector fake env reflection --- .../app_settings/shaders/class1/deferred/multiSpotLightF.glsl | 9 +++------ .../app_settings/shaders/class2/deferred/multiSpotLightF.glsl | 8 +++----- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index ed68e38891..86f9f227d5 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -310,14 +310,11 @@ void main() vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds; vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); - + stc /= stc.w; if (stc.z > 0.0) { - stc.xy /= stc.w; - - float fatten = clamp(envIntensity*envIntensity+envIntensity*0.5, 0.25, 1.0); + float fatten = clamp(envIntensity*envIntensity+envIntensity*0.25, 0.25, 1.0); - //stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); if (stc.x < 1.0 && @@ -325,7 +322,7 @@ void main() stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod-envIntensity*proj_lod).rgb*spec.rgb; + col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod).rgb*spec.rgb; } } } diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index df750d3cec..ed3458963d 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -333,14 +333,12 @@ void main() vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds; vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); + stc /= stc.w; if (stc.z > 0.0) { - stc.xy /= stc.w; - - float fatten = clamp(envIntensity*envIntensity+envIntensity*0.5, 0.25, 1.0); + float fatten = clamp(envIntensity*envIntensity+envIntensity*0.25, 0.25, 1.0); - //stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); if (stc.x < 1.0 && @@ -348,7 +346,7 @@ void main() stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod-envIntensity*proj_lod).rgb*shadow*spec.rgb; + col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod).rgb*shadow*spec.rgb; } } } -- cgit v1.2.3 From 980802e46859dc31f14d20e558a4e955e6976f48 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 5 Sep 2013 22:06:16 -0400 Subject: STORM-1552: detect, ignore, and delete invalid feature and gpu table files --- indra/newview/gpu_table.txt | 1 + indra/newview/llfeaturemanager.cpp | 115 ++++++++++++++++++++++++++----------- indra/newview/llfeaturemanager.h | 15 +++-- scripts/gpu_table_tester | 4 ++ 4 files changed, 97 insertions(+), 38 deletions(-) diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt index 122577b132..23a065caff 100755 --- a/indra/newview/gpu_table.txt +++ b/indra/newview/gpu_table.txt @@ -1,3 +1,4 @@ +//GPU_TABLE - that token on line 1 tags this as a gpu table file // // Categorizes graphics chips into various classes by name // diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 9d292ce7bb..6158a778d3 100755 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -261,7 +261,7 @@ BOOL LLFeatureManager::maskFeatures(const std::string& name) return maskList(*maskp); } -BOOL LLFeatureManager::loadFeatureTables() +bool LLFeatureManager::loadFeatureTables() { // *TODO - if I or anyone else adds something else to the skipped list // make this data driven. Put it in the feature table and parse it @@ -302,28 +302,36 @@ BOOL LLFeatureManager::loadFeatureTables() // use HTTP table if it exists std::string path; + bool parse_ok = false; if (gDirUtilp->fileExists(http_path)) { - path = http_path; + parse_ok = parseFeatureTable(http_path); + if (!parse_ok) + { + // the HTTP table failed to parse, so delete it + LLFile::remove(http_path); + LL_WARNS("RenderInit") << "Removed invalid feature table '" << http_path << "'" << LL_ENDL; + } } - else + + if (!parse_ok) { - path = app_path; + parse_ok = parseFeatureTable(app_path); } - - return parseFeatureTable(path); + return parse_ok; } -BOOL LLFeatureManager::parseFeatureTable(std::string filename) +bool LLFeatureManager::parseFeatureTable(std::string filename) { - llinfos << "Looking for feature table in " << filename << llendl; + LL_INFOS("RenderInit") << "Attempting to parse feature table from " << filename << LL_ENDL; llifstream file; std::string name; U32 version; + cleanupFeatureTables(); // in case an earlier attempt left partial results file.open(filename); /*Flawfinder: ignore*/ if (!file) @@ -338,13 +346,14 @@ BOOL LLFeatureManager::parseFeatureTable(std::string filename) if (name != "version") { LL_WARNS("RenderInit") << filename << " does not appear to be a valid feature table!" << LL_ENDL; - return FALSE; + return false; } mTableVersion = version; - + LLFeatureList *flp = NULL; - while (file >> name) + bool parse_ok = true; + while (file >> name && parse_ok) { char buffer[MAX_STRING]; /*Flawfinder: ignore*/ @@ -357,39 +366,58 @@ BOOL LLFeatureManager::parseFeatureTable(std::string filename) if (name == "list") { + LL_DEBUGS("RenderInit") << "Before new list" << std::endl; if (flp) { - //flp->dump(); + flp->dump(); } + else + { + LL_CONT << "No current list"; + } + LL_CONT << LL_ENDL; + // It's a new mask, create it. file >> name; - if (mMaskList.count(name)) + if (!mMaskList.count(name)) { - LL_ERRS("RenderInit") << "Overriding mask " << name << ", this is invalid!" << LL_ENDL; + flp = new LLFeatureList(name); + mMaskList[name] = flp; + } + else + { + LL_WARNS("RenderInit") << "Overriding mask " << name << ", this is invalid!" << LL_ENDL; + parse_ok = false; } - - flp = new LLFeatureList(name); - mMaskList[name] = flp; } else { if (!flp) { - LL_ERRS("RenderInit") << "Specified parameter before keyword!" << LL_ENDL; - return FALSE; + S32 available; + F32 recommended; + file >> available >> recommended; + flp->addFeature(name, available, recommended); + } + else + { + LL_WARNS("RenderInit") << "Specified parameter before keyword!" << LL_ENDL; + parse_ok = false; } - S32 available; - F32 recommended; - file >> available >> recommended; - flp->addFeature(name, available, recommended); } } file.close(); - return TRUE; + if (!parse_ok) + { + LL_WARNS("RenderInit") << "Discarding feature table data from " << filename << LL_ENDL; + cleanupFeatureTables(); + } + + return parse_ok; } -void LLFeatureManager::loadGPUClass() +bool LLFeatureManager::loadGPUClass() { // defaults mGPUClass = GPU_CLASS_UNKNOWN; @@ -407,29 +435,49 @@ void LLFeatureManager::loadGPUClass() // use HTTP table if it exists std::string path; + bool parse_ok = false; if (gDirUtilp->fileExists(http_path)) { - path = http_path; + parse_ok = parseGPUTable(http_path); + if (!parse_ok) + { + // the HTTP table failed to parse, so delete it + LLFile::remove(http_path); + LL_WARNS("RenderInit") << "Removed invalid gpu table '" << http_path << "'" << LL_ENDL; + } } - else + + if (!parse_ok) { - path = app_path; + parse_ok = parseGPUTable(app_path); } - parseGPUTable(path); + return parse_ok; // indicates that the file parsed correctly, not that the gpu was recognized } -void LLFeatureManager::parseGPUTable(std::string filename) +bool LLFeatureManager::parseGPUTable(std::string filename) { llifstream file; - + + LL_INFOS("RenderInit") << "Attempting to parse GPU table from " << filename << LL_ENDL; file.open(filename); - if (!file) + if (file) + { + const char recognizer[] = "//GPU_TABLE"; + char first_line[MAX_STRING]; + file.getline(first_line, MAX_STRING); + if (0 != strncmp(first_line, recognizer, strlen(recognizer))) + { + LL_WARNS("RenderInit") << "Invalid GPU table: " << filename << "!" << LL_ENDL; + return false; + } + } + else { LL_WARNS("RenderInit") << "Unable to open GPU table: " << filename << "!" << LL_ENDL; - return; + return false; } std::string rawRenderer = gGLManager.getRawGLString(); @@ -556,6 +604,7 @@ void LLFeatureManager::parseGPUTable(std::string filename) #if LL_DARWIN // never go over "Mid" settings by default on OS X mGPUClass = llmin(mGPUClass, GPU_CLASS_2); #endif + return true; } // responder saves table into file diff --git a/indra/newview/llfeaturemanager.h b/indra/newview/llfeaturemanager.h index 3b8d251236..95141b241d 100755 --- a/indra/newview/llfeaturemanager.h +++ b/indra/newview/llfeaturemanager.h @@ -75,7 +75,7 @@ public: void setFeatureAvailable(const std::string& name, const BOOL available); void setRecommendedLevel(const std::string& name, const F32 level); - BOOL loadFeatureList(LLFILE *fp); + bool loadFeatureList(LLFILE *fp); BOOL maskList(LLFeatureList &mask); @@ -114,7 +114,7 @@ public: void maskCurrentList(const std::string& name); // Mask the current feature list with the named list - BOOL loadFeatureTables(); + bool loadFeatureTables(); EGPUClass getGPUClass() { return mGPUClass; } std::string& getGPUString() { return mGPUString; } @@ -157,9 +157,14 @@ public: void fetchHTTPTables(); protected: - void loadGPUClass(); - BOOL parseFeatureTable(std::string filename); - void parseGPUTable(std::string filename); + bool loadGPUClass(); + + bool parseFeatureTable(std::string filename); + ///< @returns TRUE is file parsed correctly, FALSE if not + + bool parseGPUTable(std::string filename); + ///< @returns true if file parsed correctly, false if not - does not reflect whether or not the gpu was recognized + void initBaseMask(); diff --git a/scripts/gpu_table_tester b/scripts/gpu_table_tester index 9bc958636d..0fe3e9e8f7 100755 --- a/scripts/gpu_table_tester +++ b/scripts/gpu_table_tester @@ -73,6 +73,10 @@ die "Must specify a --gpu-table value" open(GPUS, "<$GpuTable") || die "Failed to open gpu table '$GpuTable':\n\t$!\n"; +my $FirstLine = ; +die "First line of gpu table does not begin with '//GPU_TABLE'" + unless $FirstLine =~ m|^//GPU_TABLE|; + # Parse the GPU table into these tables, indexed by the name my %NameLine; # name -> line number on which a given name was found (catches duplicate names) my %RecognizerLine; # name -> line number on which a given name was found (catches duplicate names) -- cgit v1.2.3 From fcdd0e578ca1ac7b025c5583df1c42bd286b07af Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 6 Sep 2013 10:04:41 -0700 Subject: ACME-903: Link the 'Learn about posting to Facebook' text to the proper KB article --- indra/newview/skins/default/xui/en/panel_social_account.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/panel_social_account.xml b/indra/newview/skins/default/xui/en/panel_social_account.xml index 882e410bdb..d7235396fe 100644 --- a/indra/newview/skins/default/xui/en/panel_social_account.xml +++ b/indra/newview/skins/default/xui/en/panel_social_account.xml @@ -69,7 +69,7 @@ name="account_learn_more_label" top_pad="20" type="string"> - [https://support.secondlife.com/ Learn about posting to Facebook] + [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share/ta-p/2149711 Learn about posting to Facebook] -- cgit v1.2.3 From 40762b76436fb4259e59b92640384004b14c0b0d Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Fri, 6 Sep 2013 20:16:52 +0300 Subject: MAINT-3110 FIXED new crash in LLNotificationsUI::LLHandlerUtil::logToIMP2P --- indra/newview/llnotificationhandlerutil.cpp | 35 ++++++++++++++++------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index eb4601a469..ef4d735616 100755 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -125,24 +125,29 @@ void log_name_callback(const std::string& full_name, const std::string& from_nam // static void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_file_only) { - LLUUID from_id = notification->getPayload()["from_id"]; + if (!gCacheName) + { + return; + } - if (from_id.isNull()) - { - // Normal behavior for system generated messages, don't spam. - // llwarns << " from_id for notification " << notification->getName() << " is null " << llendl; - return; - } + LLUUID from_id = notification->getPayload()["from_id"]; - if(to_file_only) - { - gCacheName->get(from_id, false, boost::bind(&log_name_callback, _2, "", notification->getMessage(), LLUUID())); - } - else - { - gCacheName->get(from_id, false, boost::bind(&log_name_callback, _2, INTERACTIVE_SYSTEM_FROM, notification->getMessage(), from_id)); - } + if (from_id.isNull()) + { + // Normal behavior for system generated messages, don't spam. + // llwarns << " from_id for notification " << notification->getName() << " is null " << llendl; + return; + } + + if(to_file_only) + { + gCacheName->get(from_id, false, boost::bind(&log_name_callback, _2, "", notification->getMessage(), LLUUID())); } + else + { + gCacheName->get(from_id, false, boost::bind(&log_name_callback, _2, INTERACTIVE_SYSTEM_FROM, notification->getMessage(), from_id)); + } +} // static void LLHandlerUtil::logGroupNoticeToIMGroup( -- cgit v1.2.3 From bf22b7150d2884fb68982764cd6a122d9c23909a Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 6 Sep 2013 18:26:21 -0700 Subject: ACME-905 : Get the FacebookConnect cap each time we need it (it's not that much) --- indra/newview/llfacebookconnect.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 9c70757278..611d18d6d6 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -356,9 +356,9 @@ void LLFacebookConnect::openFacebookWeb(std::string url) std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route, bool include_read_from_master) { - static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); - - std::string url = sFacebookConnectUrl + route; + std::string url = gAgent.getRegion()->getCapability("FacebookConnect"); + url += route; + if (include_read_from_master && mReadFromMaster) { url += "?read_from_master=true"; -- cgit v1.2.3 From 36dea0dad802158a0e546220163f4461fbd3e204 Mon Sep 17 00:00:00 2001 From: "maxim@mnikolenko" Date: Mon, 9 Sep 2013 12:45:51 +0300 Subject: MAINT-3048 FIXED Show actual message instead of "Only friends and groups can call..." for Lindens. --- indra/newview/llviewermessage.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 151a7c6213..c38af1f990 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2361,7 +2361,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) BOOL is_owned_by_me = FALSE; BOOL is_friend = (LLAvatarTracker::instance().getBuddyInfo(from_id) == NULL) ? false : true; BOOL accept_im_from_only_friend = gSavedSettings.getBOOL("VoiceCallsFriendsOnly"); - + BOOL is_linden = chat.mSourceType != CHAT_SOURCE_OBJECT && + LLMuteList::getInstance()->isLinden(name); + chat.mMuted = is_muted; chat.mFromID = from_id; chat.mFromName = name; @@ -2461,7 +2463,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL; bool mute_im = is_muted; - if(accept_im_from_only_friend&&!is_friend) + if(accept_im_from_only_friend && !is_friend && !is_linden) { if (!gIMMgr->isNonFriendSessionNotified(session_id)) { -- cgit v1.2.3 From 93df4ff2fea7378ab5b5ac069c2fec808ec5027b Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 9 Sep 2013 09:24:46 -0700 Subject: NORSPEC-362 address video mem leak on windows on maximize --- indra/newview/pipeline.cpp | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 8be7b2ab53..b4e59909db 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -796,14 +796,22 @@ void LLPipeline::resizeScreenTexture() GLuint resX = gViewerWindow->getWorldViewWidthRaw(); GLuint resY = gViewerWindow->getWorldViewHeightRaw(); - if (!allocateScreenBuffer(resX,resY)) - { //FAILSAFE: screen buffer allocation failed, disable deferred rendering if it's enabled - //NOTE: if the session closes successfully after this call, deferred rendering will be - // disabled on future sessions - if (LLPipeline::sRenderDeferred) + if ((resX != mScreen.getWidth()) || (resY != mScreen.getHeight())) + { + releaseScreenBuffers(); + if (!allocateScreenBuffer(resX,resY)) { - gSavedSettings.setBOOL("RenderDeferred", FALSE); - LLPipeline::refreshCachedSettings(); +#if PROBABLE_FALSE_DISABLES_OF_ALM_HERE + //FAILSAFE: screen buffer allocation failed, disable deferred rendering if it's enabled + //NOTE: if the session closes successfully after this call, deferred rendering will be + // disabled on future sessions + if (LLPipeline::sRenderDeferred) + { + gSavedSettings.setBOOL("RenderDeferred", FALSE); + LLPipeline::refreshCachedSettings(); + + } +#endif } } } @@ -1193,7 +1201,8 @@ void LLPipeline::releaseGLBuffers() mWaterRef.release(); mWaterDis.release(); - + mHighlight.release(); + for (U32 i = 0; i < 3; i++) { mGlow[i].release(); @@ -1223,12 +1232,12 @@ void LLPipeline::releaseScreenBuffers() mDeferredScreen.release(); mDeferredDepth.release(); mDeferredLight.release(); - - mHighlight.release(); + mOcclusionDepth.release(); for (U32 i = 0; i < 6; i++) { mShadow[i].release(); + mShadowOcclusion[i].release(); } } -- cgit v1.2.3 From 938e201d8f6517c7b8a39954dedb0f3c0e9bfb6d Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 9 Sep 2013 14:45:03 -0400 Subject: Added tag 3.6.5-release for changeset bf6d45304601 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index e33fd73874..2e94290c50 100755 --- a/.hgtags +++ b/.hgtags @@ -464,3 +464,4 @@ f6741d5fe8d632651424484df0fe0cb4a01e9fbe 3.6.2-release fe4f7c5e9fd27e09d03deb1cc9ab3e5093f6309e 3.6.3-release 83357f31d8dbf048a8bfdc323f363bf4d588aca1 CHOP-951-a 91ed595b716f14f07409595b734fda891a59379e 3.6.4-release +bf6d453046011a11de2643fac610cc5258650f82 3.6.5-release -- cgit v1.2.3 From 55ae6a7962cdc9a9d7d087fbc529d30db9c37013 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 9 Sep 2013 14:47:01 -0400 Subject: increment viewer version to 3.6.6 --- indra/newview/VIEWER_VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index d15b8b06fa..4f2c1d15f6 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -3.6.5 +3.6.6 -- cgit v1.2.3 From eaf287cc20efbad97fba17a65efd57eeba0f7278 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 9 Sep 2013 13:36:34 -0700 Subject: ACME-906 : Clean up xml from overzealous background color and opacity settings --- indra/newview/skins/default/xui/en/floater_social.xml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml index 39df777d1b..426c5507e4 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -1,5 +1,4 @@ - @@ -30,9 +26,6 @@ tab_min_width="70" tab_height="30" tab_position="top" - background_visible="true" - bg_opaque_color="DkGray" - bg_alpha_color="DkGray_66" top="7" height="437" halign="center"> @@ -68,9 +61,6 @@ Date: Tue, 10 Sep 2013 14:35:53 -0400 Subject: remove llversionviewer.h (incorrectly re-created in a merge) --- indra/llcommon/llversionviewer.h | 41 ---------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 indra/llcommon/llversionviewer.h diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h deleted file mode 100644 index 6a5ff314e4..0000000000 --- a/indra/llcommon/llversionviewer.h +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @file llversionviewer.h - * @brief - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLVERSIONVIEWER_H -#define LL_LLVERSIONVIEWER_H - -const S32 LL_VERSION_MAJOR = 3; -const S32 LL_VERSION_MINOR = 4; -const S32 LL_VERSION_PATCH = 6; -const S32 LL_VERSION_BUILD = 0; - -const char * const LL_CHANNEL = "Second Life Developer"; - -#if LL_DARWIN -const char * const LL_VERSION_BUNDLE_ID = "com.secondlife.indra.viewer"; -#endif - -#endif -- cgit v1.2.3 From bd0a8c7ee9f446a544fe27851d2d6b558545d772 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Wed, 11 Sep 2013 00:41:10 +0300 Subject: MAINT-3128 FIXED Advanced graphical settings are not changing when dragging "Quality and Speed" slider --- indra/newview/llfeaturemanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 6158a778d3..c47618e1ec 100755 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -392,7 +392,7 @@ bool LLFeatureManager::parseFeatureTable(std::string filename) } else { - if (!flp) + if (flp) { S32 available; F32 recommended; -- cgit v1.2.3 From 5b7da1998a95ccf545ff3b5a38a62e79ee00e1bb Mon Sep 17 00:00:00 2001 From: Cinder Biscuits Date: Tue, 10 Sep 2013 22:12:18 +0000 Subject: BUG-3848: send_agent_resume() was not being called after snapshot. --- indra/newview/llfilepicker.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index b26d520557..c151b51c23 100755 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -857,6 +857,8 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename) success = false; } + send_agent_resume(); + // Account for the fact that the app has been stalled. LLFrameTimer::updateFrameTime(); return success; -- cgit v1.2.3 From f4d2e21f4fdf6953cfa375bd716b1458e3de14e8 Mon Sep 17 00:00:00 2001 From: ZaiLynch Date: Wed, 11 Sep 2013 12:17:22 -0400 Subject: Changing shortcut to toggle preference floater --- doc/contributions.txt | 1 + indra/newview/skins/default/xui/en/menu_viewer.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index f33cf36ec2..404103cf91 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -1365,6 +1365,7 @@ YongYong Francois Zak Westminster Zai Lynch VWR-19505 + STORM-1902 Zana Kohime Zaren Alexander Zarkonnen Decosta diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index dabfc4eebd..0e95a9d9a9 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -180,7 +180,7 @@ name="Preferences" shortcut="control|P"> Date: Wed, 11 Sep 2013 15:15:34 -0700 Subject: FIX INTL-123 translation of Viewer Set36 for 9 languages (changed and new files) --- .../newview/skins/default/xui/de/floater_about.xml | 4 +- .../skins/default/xui/de/floater_bulk_perms.xml | 7 +- .../skins/default/xui/de/floater_goto_line.xml | 7 ++ .../skins/default/xui/de/floater_im_session.xml | 12 +-- .../default/xui/de/floater_pathfinding_console.xml | 2 +- .../skins/default/xui/de/menu_attachment_other.xml | 2 + .../skins/default/xui/de/menu_attachment_self.xml | 2 + .../skins/default/xui/de/menu_avatar_other.xml | 2 + .../skins/default/xui/de/menu_avatar_self.xml | 2 + .../skins/default/xui/de/menu_conversation.xml | 1 + indra/newview/skins/default/xui/de/menu_land.xml | 1 + indra/newview/skins/default/xui/de/menu_login.xml | 8 +- .../skins/default/xui/de/menu_mute_particle.xml | 5 + indra/newview/skins/default/xui/de/menu_object.xml | 5 +- .../skins/default/xui/de/menu_url_agent.xml | 1 + .../skins/default/xui/de/menu_url_objectim.xml | 1 + indra/newview/skins/default/xui/de/menu_viewer.xml | 15 ++- .../newview/skins/default/xui/de/notifications.xml | 71 +++++++++++-- .../newview/skins/default/xui/de/panel_people.xml | 3 + .../default/xui/de/panel_preferences_chat.xml | 44 +++++--- .../default/xui/de/panel_preferences_graphics1.xml | 2 +- .../default/xui/de/panel_preferences_setup.xml | 1 + .../skins/default/xui/de/panel_script_ed.xml | 1 + .../skins/default/xui/de/panel_tools_texture.xml | 116 +++++++++++++++++++++ .../newview/skins/default/xui/de/role_actions.xml | 2 +- indra/newview/skins/default/xui/de/strings.xml | 36 +++++++ .../newview/skins/default/xui/es/floater_about.xml | 4 +- .../skins/default/xui/es/floater_bulk_perms.xml | 7 +- .../skins/default/xui/es/floater_goto_line.xml | 7 ++ .../skins/default/xui/es/floater_im_session.xml | 12 +-- .../default/xui/es/floater_pathfinding_console.xml | 2 +- .../skins/default/xui/es/menu_attachment_other.xml | 2 + .../skins/default/xui/es/menu_attachment_self.xml | 2 + .../skins/default/xui/es/menu_avatar_other.xml | 2 + .../skins/default/xui/es/menu_avatar_self.xml | 2 + .../skins/default/xui/es/menu_conversation.xml | 1 + indra/newview/skins/default/xui/es/menu_land.xml | 1 + indra/newview/skins/default/xui/es/menu_login.xml | 8 +- .../skins/default/xui/es/menu_mute_particle.xml | 5 + indra/newview/skins/default/xui/es/menu_object.xml | 5 +- .../skins/default/xui/es/menu_url_agent.xml | 1 + .../skins/default/xui/es/menu_url_objectim.xml | 1 + indra/newview/skins/default/xui/es/menu_viewer.xml | 14 ++- .../newview/skins/default/xui/es/notifications.xml | 87 ++++++++++++---- .../newview/skins/default/xui/es/panel_people.xml | 3 + .../default/xui/es/panel_preferences_chat.xml | 70 +++++++------ .../default/xui/es/panel_preferences_graphics1.xml | 2 +- .../default/xui/es/panel_preferences_setup.xml | 1 + .../skins/default/xui/es/panel_script_ed.xml | 1 + .../skins/default/xui/es/panel_tools_texture.xml | 116 +++++++++++++++++++++ .../newview/skins/default/xui/es/role_actions.xml | 2 +- indra/newview/skins/default/xui/es/strings.xml | 36 +++++++ .../newview/skins/default/xui/fr/floater_about.xml | 2 + .../skins/default/xui/fr/floater_bulk_perms.xml | 7 +- .../skins/default/xui/fr/floater_goto_line.xml | 7 ++ .../skins/default/xui/fr/floater_im_session.xml | 12 +-- .../default/xui/fr/floater_pathfinding_console.xml | 2 +- .../skins/default/xui/fr/menu_attachment_other.xml | 2 + .../skins/default/xui/fr/menu_attachment_self.xml | 2 + .../skins/default/xui/fr/menu_avatar_other.xml | 2 + .../skins/default/xui/fr/menu_avatar_self.xml | 2 + .../skins/default/xui/fr/menu_conversation.xml | 1 + indra/newview/skins/default/xui/fr/menu_land.xml | 1 + indra/newview/skins/default/xui/fr/menu_login.xml | 8 +- .../skins/default/xui/fr/menu_mute_particle.xml | 5 + indra/newview/skins/default/xui/fr/menu_object.xml | 5 +- .../skins/default/xui/fr/menu_url_agent.xml | 1 + .../skins/default/xui/fr/menu_url_objectim.xml | 1 + indra/newview/skins/default/xui/fr/menu_viewer.xml | 14 ++- .../newview/skins/default/xui/fr/notifications.xml | 73 ++++++++++--- .../newview/skins/default/xui/fr/panel_people.xml | 3 + .../default/xui/fr/panel_preferences_chat.xml | 46 +++++--- .../default/xui/fr/panel_preferences_graphics1.xml | 2 +- .../default/xui/fr/panel_preferences_setup.xml | 1 + .../skins/default/xui/fr/panel_script_ed.xml | 1 + .../skins/default/xui/fr/panel_tools_texture.xml | 116 +++++++++++++++++++++ .../newview/skins/default/xui/fr/role_actions.xml | 2 +- indra/newview/skins/default/xui/fr/strings.xml | 36 +++++++ .../newview/skins/default/xui/it/floater_about.xml | 4 +- .../skins/default/xui/it/floater_bulk_perms.xml | 7 +- .../skins/default/xui/it/floater_goto_line.xml | 7 ++ .../skins/default/xui/it/floater_im_session.xml | 12 +-- .../default/xui/it/floater_pathfinding_console.xml | 2 +- .../skins/default/xui/it/menu_attachment_other.xml | 2 + .../skins/default/xui/it/menu_attachment_self.xml | 2 + .../skins/default/xui/it/menu_avatar_other.xml | 2 + .../skins/default/xui/it/menu_avatar_self.xml | 2 + .../skins/default/xui/it/menu_conversation.xml | 1 + indra/newview/skins/default/xui/it/menu_land.xml | 1 + indra/newview/skins/default/xui/it/menu_login.xml | 8 +- .../skins/default/xui/it/menu_mute_particle.xml | 5 + indra/newview/skins/default/xui/it/menu_object.xml | 5 +- .../skins/default/xui/it/menu_url_agent.xml | 1 + .../skins/default/xui/it/menu_url_objectim.xml | 1 + indra/newview/skins/default/xui/it/menu_viewer.xml | 14 ++- .../newview/skins/default/xui/it/notifications.xml | 79 +++++++++++--- .../newview/skins/default/xui/it/panel_people.xml | 3 + .../default/xui/it/panel_preferences_chat.xml | 40 ++++--- .../default/xui/it/panel_preferences_graphics1.xml | 2 +- .../default/xui/it/panel_preferences_setup.xml | 1 + .../skins/default/xui/it/panel_script_ed.xml | 1 + .../skins/default/xui/it/panel_tools_texture.xml | 116 +++++++++++++++++++++ .../newview/skins/default/xui/it/role_actions.xml | 2 +- indra/newview/skins/default/xui/it/strings.xml | 36 +++++++ .../newview/skins/default/xui/ja/floater_about.xml | 4 +- .../skins/default/xui/ja/floater_bulk_perms.xml | 7 +- .../skins/default/xui/ja/floater_goto_line.xml | 7 ++ .../skins/default/xui/ja/floater_im_session.xml | 12 +-- .../default/xui/ja/floater_pathfinding_console.xml | 2 +- .../skins/default/xui/ja/menu_attachment_other.xml | 2 + .../skins/default/xui/ja/menu_attachment_self.xml | 2 + .../skins/default/xui/ja/menu_avatar_other.xml | 2 + .../skins/default/xui/ja/menu_avatar_self.xml | 2 + .../skins/default/xui/ja/menu_conversation.xml | 1 + indra/newview/skins/default/xui/ja/menu_land.xml | 1 + indra/newview/skins/default/xui/ja/menu_login.xml | 8 +- .../skins/default/xui/ja/menu_mute_particle.xml | 5 + indra/newview/skins/default/xui/ja/menu_object.xml | 5 +- .../skins/default/xui/ja/menu_url_agent.xml | 1 + .../skins/default/xui/ja/menu_url_objectim.xml | 1 + indra/newview/skins/default/xui/ja/menu_viewer.xml | 14 ++- .../newview/skins/default/xui/ja/notifications.xml | 87 ++++++++++++---- .../newview/skins/default/xui/ja/panel_people.xml | 3 + .../default/xui/ja/panel_preferences_chat.xml | 84 ++++++++------- .../default/xui/ja/panel_preferences_graphics1.xml | 2 +- .../default/xui/ja/panel_preferences_setup.xml | 1 + .../skins/default/xui/ja/panel_script_ed.xml | 1 + .../skins/default/xui/ja/panel_tools_texture.xml | 116 +++++++++++++++++++++ .../newview/skins/default/xui/ja/role_actions.xml | 4 +- indra/newview/skins/default/xui/ja/strings.xml | 36 +++++++ .../newview/skins/default/xui/pt/floater_about.xml | 4 +- .../skins/default/xui/pt/floater_bulk_perms.xml | 7 +- .../skins/default/xui/pt/floater_goto_line.xml | 7 ++ .../skins/default/xui/pt/floater_im_session.xml | 12 +-- .../default/xui/pt/floater_pathfinding_console.xml | 2 +- .../skins/default/xui/pt/menu_attachment_other.xml | 2 + .../skins/default/xui/pt/menu_attachment_self.xml | 2 + .../skins/default/xui/pt/menu_avatar_other.xml | 2 + .../skins/default/xui/pt/menu_avatar_self.xml | 2 + .../skins/default/xui/pt/menu_conversation.xml | 1 + indra/newview/skins/default/xui/pt/menu_land.xml | 1 + indra/newview/skins/default/xui/pt/menu_login.xml | 8 +- .../skins/default/xui/pt/menu_mute_particle.xml | 5 + indra/newview/skins/default/xui/pt/menu_object.xml | 5 +- .../skins/default/xui/pt/menu_url_agent.xml | 1 + .../skins/default/xui/pt/menu_url_objectim.xml | 1 + indra/newview/skins/default/xui/pt/menu_viewer.xml | 14 ++- .../newview/skins/default/xui/pt/notifications.xml | 83 ++++++++++++--- .../newview/skins/default/xui/pt/panel_people.xml | 3 + .../default/xui/pt/panel_preferences_chat.xml | 66 +++++++----- .../default/xui/pt/panel_preferences_graphics1.xml | 2 +- .../default/xui/pt/panel_preferences_setup.xml | 1 + .../skins/default/xui/pt/panel_script_ed.xml | 1 + .../skins/default/xui/pt/panel_tools_texture.xml | 116 +++++++++++++++++++++ .../newview/skins/default/xui/pt/role_actions.xml | 2 +- indra/newview/skins/default/xui/pt/strings.xml | 36 +++++++ .../newview/skins/default/xui/ru/floater_about.xml | 2 + .../skins/default/xui/ru/floater_bulk_perms.xml | 7 +- .../skins/default/xui/ru/floater_goto_line.xml | 7 ++ .../skins/default/xui/ru/floater_im_session.xml | 12 +-- .../default/xui/ru/floater_pathfinding_console.xml | 2 +- .../skins/default/xui/ru/menu_attachment_other.xml | 2 + .../skins/default/xui/ru/menu_attachment_self.xml | 2 + .../skins/default/xui/ru/menu_avatar_other.xml | 2 + .../skins/default/xui/ru/menu_avatar_self.xml | 2 + .../skins/default/xui/ru/menu_conversation.xml | 1 + indra/newview/skins/default/xui/ru/menu_land.xml | 1 + indra/newview/skins/default/xui/ru/menu_login.xml | 8 +- .../skins/default/xui/ru/menu_mute_particle.xml | 5 + indra/newview/skins/default/xui/ru/menu_object.xml | 5 +- .../skins/default/xui/ru/menu_url_agent.xml | 1 + .../skins/default/xui/ru/menu_url_objectim.xml | 1 + indra/newview/skins/default/xui/ru/menu_viewer.xml | 16 +-- .../newview/skins/default/xui/ru/notifications.xml | 61 +++++++++-- .../newview/skins/default/xui/ru/panel_people.xml | 3 + .../default/xui/ru/panel_preferences_chat.xml | 38 ++++--- .../default/xui/ru/panel_preferences_graphics1.xml | 2 +- .../default/xui/ru/panel_preferences_setup.xml | 1 + .../skins/default/xui/ru/panel_script_ed.xml | 1 + .../skins/default/xui/ru/panel_tools_texture.xml | 116 +++++++++++++++++++++ .../newview/skins/default/xui/ru/role_actions.xml | 2 +- indra/newview/skins/default/xui/ru/strings.xml | 36 +++++++ .../newview/skins/default/xui/tr/floater_about.xml | 2 + .../skins/default/xui/tr/floater_bulk_perms.xml | 7 +- .../skins/default/xui/tr/floater_goto_line.xml | 7 ++ .../skins/default/xui/tr/floater_im_session.xml | 12 +-- .../default/xui/tr/floater_pathfinding_console.xml | 2 +- .../skins/default/xui/tr/menu_attachment_other.xml | 2 + .../skins/default/xui/tr/menu_attachment_self.xml | 2 + .../skins/default/xui/tr/menu_avatar_other.xml | 2 + .../skins/default/xui/tr/menu_avatar_self.xml | 2 + .../skins/default/xui/tr/menu_conversation.xml | 1 + indra/newview/skins/default/xui/tr/menu_land.xml | 1 + indra/newview/skins/default/xui/tr/menu_login.xml | 8 +- .../skins/default/xui/tr/menu_mute_particle.xml | 5 + indra/newview/skins/default/xui/tr/menu_object.xml | 5 +- .../skins/default/xui/tr/menu_url_agent.xml | 1 + .../skins/default/xui/tr/menu_url_objectim.xml | 1 + indra/newview/skins/default/xui/tr/menu_viewer.xml | 14 ++- .../newview/skins/default/xui/tr/notifications.xml | 65 ++++++++++-- .../newview/skins/default/xui/tr/panel_people.xml | 3 + .../default/xui/tr/panel_preferences_chat.xml | 44 +++++--- .../default/xui/tr/panel_preferences_graphics1.xml | 2 +- .../default/xui/tr/panel_preferences_setup.xml | 1 + .../skins/default/xui/tr/panel_script_ed.xml | 1 + .../skins/default/xui/tr/panel_tools_texture.xml | 116 +++++++++++++++++++++ .../newview/skins/default/xui/tr/role_actions.xml | 2 +- indra/newview/skins/default/xui/tr/strings.xml | 36 +++++++ .../newview/skins/default/xui/zh/floater_about.xml | 2 + .../skins/default/xui/zh/floater_bulk_perms.xml | 7 +- .../skins/default/xui/zh/floater_goto_line.xml | 7 ++ .../skins/default/xui/zh/floater_im_session.xml | 12 +-- .../default/xui/zh/floater_pathfinding_console.xml | 2 +- .../skins/default/xui/zh/menu_attachment_other.xml | 2 + .../skins/default/xui/zh/menu_attachment_self.xml | 2 + .../skins/default/xui/zh/menu_avatar_other.xml | 2 + .../skins/default/xui/zh/menu_avatar_self.xml | 2 + .../skins/default/xui/zh/menu_conversation.xml | 1 + indra/newview/skins/default/xui/zh/menu_land.xml | 1 + indra/newview/skins/default/xui/zh/menu_login.xml | 8 +- .../skins/default/xui/zh/menu_mute_particle.xml | 5 + indra/newview/skins/default/xui/zh/menu_object.xml | 5 +- .../skins/default/xui/zh/menu_url_agent.xml | 1 + .../skins/default/xui/zh/menu_url_objectim.xml | 1 + indra/newview/skins/default/xui/zh/menu_viewer.xml | 14 ++- .../newview/skins/default/xui/zh/notifications.xml | 57 +++++++++- .../newview/skins/default/xui/zh/panel_people.xml | 3 + .../default/xui/zh/panel_preferences_chat.xml | 46 +++++--- .../default/xui/zh/panel_preferences_graphics1.xml | 2 +- .../default/xui/zh/panel_preferences_setup.xml | 1 + .../skins/default/xui/zh/panel_script_ed.xml | 1 + .../skins/default/xui/zh/panel_tools_texture.xml | 116 +++++++++++++++++++++ .../newview/skins/default/xui/zh/role_actions.xml | 2 +- indra/newview/skins/default/xui/zh/strings.xml | 36 +++++++ 234 files changed, 2788 insertions(+), 483 deletions(-) create mode 100644 indra/newview/skins/default/xui/de/floater_goto_line.xml create mode 100644 indra/newview/skins/default/xui/de/menu_mute_particle.xml create mode 100644 indra/newview/skins/default/xui/de/panel_tools_texture.xml create mode 100644 indra/newview/skins/default/xui/es/floater_goto_line.xml create mode 100644 indra/newview/skins/default/xui/es/menu_mute_particle.xml create mode 100644 indra/newview/skins/default/xui/es/panel_tools_texture.xml create mode 100644 indra/newview/skins/default/xui/fr/floater_goto_line.xml create mode 100644 indra/newview/skins/default/xui/fr/menu_mute_particle.xml create mode 100644 indra/newview/skins/default/xui/fr/panel_tools_texture.xml create mode 100644 indra/newview/skins/default/xui/it/floater_goto_line.xml create mode 100644 indra/newview/skins/default/xui/it/menu_mute_particle.xml create mode 100644 indra/newview/skins/default/xui/it/panel_tools_texture.xml create mode 100644 indra/newview/skins/default/xui/ja/floater_goto_line.xml create mode 100644 indra/newview/skins/default/xui/ja/menu_mute_particle.xml create mode 100644 indra/newview/skins/default/xui/ja/panel_tools_texture.xml create mode 100644 indra/newview/skins/default/xui/pt/floater_goto_line.xml create mode 100644 indra/newview/skins/default/xui/pt/menu_mute_particle.xml create mode 100644 indra/newview/skins/default/xui/pt/panel_tools_texture.xml create mode 100644 indra/newview/skins/default/xui/ru/floater_goto_line.xml create mode 100644 indra/newview/skins/default/xui/ru/menu_mute_particle.xml create mode 100644 indra/newview/skins/default/xui/ru/panel_tools_texture.xml create mode 100644 indra/newview/skins/default/xui/tr/floater_goto_line.xml create mode 100644 indra/newview/skins/default/xui/tr/menu_mute_particle.xml create mode 100644 indra/newview/skins/default/xui/tr/panel_tools_texture.xml create mode 100644 indra/newview/skins/default/xui/zh/floater_goto_line.xml create mode 100644 indra/newview/skins/default/xui/zh/menu_mute_particle.xml create mode 100644 indra/newview/skins/default/xui/zh/panel_tools_texture.xml diff --git a/indra/newview/skins/default/xui/de/floater_about.xml b/indra/newview/skins/default/xui/de/floater_about.xml index 5245467183..bc0eae7c5d 100755 --- a/indra/newview/skins/default/xui/de/floater_about.xml +++ b/indra/newview/skins/default/xui/de/floater_about.xml @@ -8,7 +8,9 @@ Kompiliert mit [COMPILER] version [COMPILER_VERSION] - Sie befinden sich in [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] in [REGION] auf <nolink>[HOSTNAME]</nolink> ([HOSTIP]) + Sie befinden sich an [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] in [REGION] auf <nolink>[HOSTNAME]</nolink> ([HOSTIP]) +SLURL: <nolink>[SLURL]</nolink> +(globale Koordinaten [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] diff --git a/indra/newview/skins/default/xui/de/floater_bulk_perms.xml b/indra/newview/skins/default/xui/de/floater_bulk_perms.xml index 8f99fc933c..27a74c874e 100755 --- a/indra/newview/skins/default/xui/de/floater_bulk_perms.xml +++ b/indra/newview/skins/default/xui/de/floater_bulk_perms.xml @@ -1,5 +1,5 @@ - + Auswahl enthält keinen Inhalt, der bearbeitet werden kann. @@ -33,7 +33,7 @@ - \ No newline at end of file + -- cgit v1.2.3 From 0e116741a050ca1525a4faa2696b5c318d31bc06 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 10 Oct 2013 18:00:11 -0500 Subject: MAINT-2968 Fix for crash on AMD hardware running current drivers. --- indra/llappearance/lltexlayer.cpp | 5 +- indra/llrender/llcubemap.cpp | 2 +- indra/llrender/llimagegl.cpp | 127 +++++------------------------------ indra/llrender/llimagegl.h | 11 +-- indra/llrender/llrendertarget.cpp | 8 +-- indra/llrender/llvertexbuffer.cpp | 22 ++---- indra/llrender/llvertexbuffer.h | 4 -- indra/newview/llspatialpartition.cpp | 31 +++++---- indra/newview/llvoavatar.cpp | 6 +- indra/newview/llvoavatarself.cpp | 2 +- indra/newview/pipeline.cpp | 12 ++-- 11 files changed, 56 insertions(+), 174 deletions(-) diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index f951a982e5..a3a8616864 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -1123,7 +1123,10 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height) // *TODO: Is this correct? //gPipeline.disableLights(); stop_glerror(); - glDisable(GL_LIGHTING); + if (!LLGLSLShader::sNoFixedFunction) + { + glDisable(GL_LIGHTING); + } stop_glerror(); bool use_shaders = LLGLSLShader::sNoFixedFunction; diff --git a/indra/llrender/llcubemap.cpp b/indra/llrender/llcubemap.cpp index 362452d837..45a3b18179 100755 --- a/indra/llrender/llcubemap.cpp +++ b/indra/llrender/llcubemap.cpp @@ -81,7 +81,7 @@ void LLCubeMap::initGL() { U32 texname = 0; - LLImageGL::generateTextures(LLTexUnit::TT_CUBE_MAP, GL_RGB8, 1, &texname); + LLImageGL::generateTextures(1, &texname); for (int i = 0; i < 6; i++) { diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 6a37d31415..ab875141c5 100755 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -54,8 +54,6 @@ S32 LLImageGL::sGlobalTextureMemoryInBytes = 0; S32 LLImageGL::sBoundTextureMemoryInBytes = 0; S32 LLImageGL::sCurBoundTextureMemory = 0; S32 LLImageGL::sCount = 0; -LLImageGL::dead_texturelist_t LLImageGL::sDeadTextureList[LLTexUnit::TT_NONE]; -U32 LLImageGL::sCurTexName = 1; BOOL LLImageGL::sGlobalUseAnisotropic = FALSE; F32 LLImageGL::sLastFrameTime = 0.f; @@ -716,7 +714,12 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips) mMipLevels = wpo2(llmax(w, h)); //use legacy mipmap generation mode (note: making this condional can cause rendering issues) - glTexParameteri(mTarget, GL_GENERATE_MIPMAP, GL_TRUE); + // -- but making it not conditional triggers deprecation warnings when core profile is enabled + // (some rendering issues while core profile is enabled are acceptable at this point in time) + if (!LLRender::sGLCoreProfile) + { + glTexParameteri(mTarget, GL_GENERATE_MIPMAP, GL_TRUE); + } LLImageGL::setManualImage(mTarget, 0, mFormatInternal, w, h, @@ -1084,95 +1087,19 @@ BOOL LLImageGL::setSubImageFromFrameBuffer(S32 fb_x, S32 fb_y, S32 x_pos, S32 y_ // static static LLFastTimer::DeclareTimer FTM_GENERATE_TEXTURES("generate textures"); -void LLImageGL::generateTextures(LLTexUnit::eTextureType type, U32 format, S32 numTextures, U32 *textures) +void LLImageGL::generateTextures(S32 numTextures, U32 *textures) { LLFastTimer t(FTM_GENERATE_TEXTURES); - bool empty = true; - - if (LLRender::sGLCoreProfile) - { - switch (format) - { - case GL_LUMINANCE8: format = GL_RGB8; break; - case GL_LUMINANCE8_ALPHA8: - case GL_ALPHA8: format = GL_RGBA8; break; - } - } - - dead_texturelist_t::iterator iter = sDeadTextureList[type].find(format); - - if (iter != sDeadTextureList[type].end()) - { - empty = iter->second.empty(); - } - - for (S32 i = 0; i < numTextures; ++i) - { - if (!empty) - { - textures[i] = iter->second.front(); - iter->second.pop_front(); - empty = iter->second.empty(); - } - else - { - textures[i] = sCurTexName++; - } - } + glGenTextures(numTextures, textures); } // static -void LLImageGL::deleteTextures(LLTexUnit::eTextureType type, U32 format, S32 mip_levels, S32 numTextures, U32 *textures, bool immediate) +void LLImageGL::deleteTextures(S32 numTextures, U32 *textures) { if (gGLManager.mInited) { - switch (format) - { - case 0: - - // We get ARB errors in debug when attempting to use glTexImage2D with these deprecated pix formats - // - case GL_LUMINANCE8: - case GL_INTENSITY8: - case GL_ALPHA8: - glDeleteTextures(numTextures, textures); - break; - - default: - { - if (type == LLTexUnit::TT_CUBE_MAP || mip_levels == -1) - { //unknown internal format or unknown number of mip levels, not safe to reuse - glDeleteTextures(numTextures, textures); - } - else - { - for (S32 i = 0; i < numTextures; ++i) - { //remove texture from VRAM by setting its size to zero - - for (S32 j = 0; j <= mip_levels; j++) - { - gGL.getTexUnit(0)->bindManual(type, textures[i]); - U32 internal_type = LLTexUnit::getInternalType(type); - glTexImage2D(internal_type, j, format, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); - stop_glerror(); - } - - llassert(std::find(sDeadTextureList[type][format].begin(), - sDeadTextureList[type][format].end(), textures[i]) == - sDeadTextureList[type][format].end()); - - sDeadTextureList[type][format].push_back(textures[i]); - } - } + glDeleteTextures(numTextures, textures); } - break; - } - } - - /*if (immediate) - { - LLImageGL::deleteDeadTextures(); - }*/ } // static @@ -1300,11 +1227,11 @@ BOOL LLImageGL::createGLTexture() if(mTexName) { - LLImageGL::deleteTextures(mBindTarget, mFormatInternal, mMipLevels, 1, (reinterpret_cast(&mTexName))) ; + LLImageGL::deleteTextures(1, (reinterpret_cast(&mTexName))) ; } - LLImageGL::generateTextures(mBindTarget, mFormatInternal, 1, &mTexName); + LLImageGL::generateTextures(1, &mTexName); stop_glerror(); if (!mTexName) { @@ -1419,7 +1346,7 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_ } else { - LLImageGL::generateTextures(mBindTarget, mFormatInternal, 1, &mTexName); + LLImageGL::generateTextures(1, &mTexName); stop_glerror(); { llverify(gGL.getTexUnit(0)->bind(this)); @@ -1464,7 +1391,7 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_ { sGlobalTextureMemoryInBytes -= mTextureMemory; - LLImageGL::deleteTextures(mBindTarget, mFormatInternal, mMipLevels, 1, &old_name); + LLImageGL::deleteTextures(1, &old_name); stop_glerror(); } @@ -1593,30 +1520,6 @@ void LLImageGL::deleteDeadTextures() { bool reset = false; - /*while (!sDeadTextureList.empty()) - { - GLuint tex = sDeadTextureList.front(); - sDeadTextureList.pop_front(); - for (int i = 0; i < gGLManager.mNumTextureImageUnits; i++) - { - LLTexUnit* tex_unit = gGL.getTexUnit(i); - - if (tex_unit && tex_unit->getCurrTexture() == tex) - { - tex_unit->unbind(tex_unit->getCurrType()); - stop_glerror(); - - if (i > 0) - { - reset = true; - } - } - } - - glDeleteTextures(1, &tex); - stop_glerror(); - }*/ - if (reset) { gGL.getTexUnit(0)->activate(); @@ -1633,7 +1536,7 @@ void LLImageGL::destroyGLTexture() mTextureMemory = 0; } - LLImageGL::deleteTextures(mBindTarget, mFormatInternal, mMipLevels, 1, &mTexName); + LLImageGL::deleteTextures(1, &mTexName); mCurrentDiscardLevel = -1 ; //invalidate mCurrentDiscardLevel. mTexName = 0; mGLTextureCreated = FALSE ; diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index 57a052b258..0c62dd0d33 100755 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -45,16 +45,9 @@ class LLImageGL : public LLRefCount { friend class LLTexUnit; public: - static U32 sCurTexName; - - //previously used but now available texture names - // sDeadTextureList[][] - typedef std::map > dead_texturelist_t; - static dead_texturelist_t sDeadTextureList[LLTexUnit::TT_NONE]; - // These 2 functions replace glGenTextures() and glDeleteTextures() - static void generateTextures(LLTexUnit::eTextureType type, U32 format, S32 numTextures, U32 *textures); - static void deleteTextures(LLTexUnit::eTextureType type, U32 format, S32 mip_levels, S32 numTextures, U32 *textures, bool immediate = false); + static void generateTextures(S32 numTextures, U32 *textures); + static void deleteTextures(S32 numTextures, U32 *textures); static void deleteDeadTextures(); // Size calculation diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index 353e61105a..b82b370d6e 100755 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -194,7 +194,7 @@ bool LLRenderTarget::addColorAttachment(U32 color_fmt) } U32 tex; - LLImageGL::generateTextures(mUsage, color_fmt, 1, &tex); + LLImageGL::generateTextures(1, &tex); gGL.getTexUnit(0)->bindManual(mUsage, tex); stop_glerror(); @@ -280,7 +280,7 @@ bool LLRenderTarget::allocateDepth() } else { - LLImageGL::generateTextures(mUsage, GL_DEPTH_COMPONENT24, 1, &mDepth); + LLImageGL::generateTextures(1, &mDepth); gGL.getTexUnit(0)->bindManual(mUsage, mDepth); U32 internal_type = LLTexUnit::getInternalType(mUsage); @@ -357,7 +357,7 @@ void LLRenderTarget::release() } else { - LLImageGL::deleteTextures(mUsage, 0, 0, 1, &mDepth, true); + LLImageGL::deleteTextures(1, &mDepth); stop_glerror(); } mDepth = 0; @@ -389,7 +389,7 @@ void LLRenderTarget::release() if (mTex.size() > 0) { sBytesAllocated -= mResX*mResY*4*mTex.size(); - LLImageGL::deleteTextures(mUsage, mInternalFormat[0], 0, mTex.size(), &mTex[0], true); + LLImageGL::deleteTextures(mTex.size(), &mTex[0]); mTex.clear(); mInternalFormat.clear(); } diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index f168b3af14..e6f20cd40e 100755 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -91,7 +91,6 @@ LLVBOPool LLVertexBuffer::sDynamicIBOPool(GL_DYNAMIC_DRAW_ARB, GL_ELEMENT_ARRAY_ U32 LLVBOPool::sBytesPooled = 0; U32 LLVBOPool::sIndexBytesPooled = 0; -U32 LLVBOPool::sCurGLName = 1; std::list LLVertexBuffer::sAvailableVAOName; U32 LLVertexBuffer::sCurVAOName = 1; @@ -125,16 +124,8 @@ U32 LLVBOPool::genBuffer() { U32 ret = 0; - if (mGLNamePool.empty()) - { - ret = sCurGLName++; - } - else - { - ret = mGLNamePool.front(); - mGLNamePool.pop_front(); - } - + glGenBuffersARB(1, &ret); + return ret; } @@ -146,12 +137,9 @@ void LLVBOPool::deleteBuffer(U32 name) glBindBufferARB(mType, name); glBufferDataARB(mType, 0, NULL, mUsage); - - llassert(std::find(mGLNamePool.begin(), mGLNamePool.end(), name) == mGLNamePool.end()); - - mGLNamePool.push_back(name); - glBindBufferARB(mType, 0); + + glDeleteBuffersARB(1, &name); } } @@ -1333,7 +1321,7 @@ void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create) //actually allocate space for the vertex buffer if using VBO mapping flush(); - if (gGLManager.mHasVertexArrayObject && useVBOs() && (LLRender::sGLCoreProfile || sUseVAO)) + if (gGLManager.mHasVertexArrayObject && useVBOs() && sUseVAO) { #if GL_ARB_vertex_array_object mGLArray = getVAOName(); diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index de58207c23..619a0cec46 100755 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -57,8 +57,6 @@ public: static U32 sBytesPooled; static U32 sIndexBytesPooled; - static U32 sCurGLName; - LLVBOPool(U32 vboUsage, U32 vboType); const U32 mUsage; @@ -86,8 +84,6 @@ public: volatile U8* mClientData; }; - std::list mGLNamePool; - typedef std::list record_list_t; std::vector mFreeList; std::vector mMissCount; diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index d7ae897604..768c9d069f 100755 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -89,28 +89,17 @@ class LLOcclusionQueryPool : public LLGLNamePool public: LLOcclusionQueryPool() { - mCurQuery = 1; + } protected: - std::list mAvailableName; - GLuint mCurQuery; - virtual GLuint allocateName() { GLuint ret = 0; - if (!mAvailableName.empty()) - { - ret = mAvailableName.front(); - mAvailableName.pop_front(); - } - else - { - ret = mCurQuery++; - } - + glGenQueriesARB(1, &ret); + return ret; } @@ -119,8 +108,7 @@ protected: #if LL_TRACK_PENDING_OCCLUSION_QUERIES LLSpatialGroup::sPendingQueries.erase(name); #endif - llassert(std::find(mAvailableName.begin(), mAvailableName.end(), name) == mAvailableName.end()); - mAvailableName.push_back(name); + glDeleteQueriesARB(1, &name); } }; @@ -4133,6 +4121,11 @@ void renderAvatarCollisionVolumes(LLVOAvatar* avatar) avatar->renderCollisionVolumes(); } +void renderAvatarJoints(LLVOAvatar* avatar) +{ + avatar->renderJoints(); +} + void renderAgentTarget(LLVOAvatar* avatar) { // render these for self only (why, i don't know) @@ -4290,6 +4283,11 @@ public: renderAvatarCollisionVolumes(avatar); } + if (avatar && gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_AVATAR_JOINTS)) + { + renderAvatarJoints(avatar); + } + if (avatar && gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_AGENT_TARGET)) { renderAgentTarget(avatar); @@ -4573,6 +4571,7 @@ void LLSpatialPartition::renderDebug() LLPipeline::RENDER_DEBUG_TEXTURE_ANIM | LLPipeline::RENDER_DEBUG_RAYCAST | LLPipeline::RENDER_DEBUG_AVATAR_VOLUME | + LLPipeline::RENDER_DEBUG_AVATAR_JOINTS | LLPipeline::RENDER_DEBUG_AGENT_TARGET | //LLPipeline::RENDER_DEBUG_BUILD_QUEUE | LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA | diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index d449efb7e7..fe035a0a7f 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -934,7 +934,7 @@ void LLVOAvatar::deleteLayerSetCaches(bool clearAll) } if (mBakedTextureDatas[i].mMaskTexName) { - LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, 0, -1, 1, (GLuint*)&(mBakedTextureDatas[i].mMaskTexName)); + LLImageGL::deleteTextures(1, (GLuint*)&(mBakedTextureDatas[i].mMaskTexName)); mBakedTextureDatas[i].mMaskTexName = 0 ; } } @@ -7272,7 +7272,7 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerFetchedTexture } U32 gl_name; - LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, GL_ALPHA8, 1, &gl_name ); + LLImageGL::generateTextures(1, &gl_name ); stop_glerror(); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, gl_name); @@ -7309,7 +7309,7 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerFetchedTexture maskData->mLastDiscardLevel = discard_level; if (self->mBakedTextureDatas[baked_index].mMaskTexName) { - LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, 0, -1, 1, &(self->mBakedTextureDatas[baked_index].mMaskTexName)); + LLImageGL::deleteTextures(1, &(self->mBakedTextureDatas[baked_index].mMaskTexName)); } self->mBakedTextureDatas[baked_index].mMaskTexName = gl_name; found_texture_id = true; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 15628d5ab2..9ce99444d9 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -3066,7 +3066,7 @@ void LLVOAvatarSelf::deleteScratchTextures() namep; namep = sScratchTexNames.getNextData() ) { - LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, 0, -1, 1, (U32 *)namep ); + LLImageGL::deleteTextures(1, (U32 *)namep ); stop_glerror(); } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index b0c73d0304..5da8a78b1b 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1198,13 +1198,13 @@ void LLPipeline::releaseGLBuffers() if (mNoiseMap) { - LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, GL_RGB16F_ARB, 0, 1, &mNoiseMap); + LLImageGL::deleteTextures(1, &mNoiseMap); mNoiseMap = 0; } if (mTrueNoiseMap) { - LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, GL_RGB16F_ARB, 0, 1, &mTrueNoiseMap); + LLImageGL::deleteTextures(1, &mTrueNoiseMap); mTrueNoiseMap = 0; } @@ -1229,7 +1229,7 @@ void LLPipeline::releaseLUTBuffers() { if (mLightFunc) { - LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, GL_R16F, 0, 1, &mLightFunc); + LLImageGL::deleteTextures(1, &mLightFunc); mLightFunc = 0; } } @@ -1323,7 +1323,7 @@ void LLPipeline::createGLBuffers() noise[i].mV[2] = ll_frand()*scaler+1.f-scaler/2.f; } - LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, GL_RGB16F_ARB, 1, &mNoiseMap); + LLImageGL::generateTextures(1, &mNoiseMap); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mNoiseMap); LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_RGB16F_ARB, noiseRes, noiseRes, GL_RGB, GL_FLOAT, noise, false); @@ -1339,7 +1339,7 @@ void LLPipeline::createGLBuffers() noise[i] = ll_frand()*2.0-1.0; } - LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, GL_RGB16F_ARB, 1, &mTrueNoiseMap); + LLImageGL::generateTextures(1, &mTrueNoiseMap); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mTrueNoiseMap); LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_RGB16F_ARB, noiseRes, noiseRes, GL_RGB,GL_FLOAT, noise, false); gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT); @@ -1452,7 +1452,7 @@ void LLPipeline::createLUTBuffers() // pix_format = GL_R32F; #endif - LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, pix_format, 1, &mLightFunc); + LLImageGL::generateTextures(1, &mLightFunc); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mLightFunc); LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, pix_format, lightResX, lightResY, GL_RED, GL_FLOAT, ls, false); //LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_UNSIGNED_BYTE, lightResX, lightResY, GL_RED, GL_UNSIGNED_BYTE, ls, false); -- cgit v1.2.3 From 929311869b028bcb34ad94a84f1c844fcd108f40 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 11 Oct 2013 17:10:26 -0500 Subject: MAINT-2968 Transplant cleanup. --- indra/newview/lldrawpoolavatar.cpp | 2 +- indra/newview/llspatialpartition.cpp | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index ba8c449c3d..f622d5a63a 100755 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -697,7 +697,7 @@ void LLDrawPoolAvatar::beginDeferredImpostor() specular_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::SPECULAR_MAP); normal_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::DEFERRED_NORMAL); sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); - gPipeline.bindDeferredShader(*sVertexProgram); + sVertexProgram->bind(); sVertexProgram->setMinimumAlpha(0.01f); } diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 768c9d069f..00eb0c1ab1 100755 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -4121,11 +4121,6 @@ void renderAvatarCollisionVolumes(LLVOAvatar* avatar) avatar->renderCollisionVolumes(); } -void renderAvatarJoints(LLVOAvatar* avatar) -{ - avatar->renderJoints(); -} - void renderAgentTarget(LLVOAvatar* avatar) { // render these for self only (why, i don't know) @@ -4283,11 +4278,6 @@ public: renderAvatarCollisionVolumes(avatar); } - if (avatar && gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_AVATAR_JOINTS)) - { - renderAvatarJoints(avatar); - } - if (avatar && gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_AGENT_TARGET)) { renderAgentTarget(avatar); @@ -4571,7 +4561,6 @@ void LLSpatialPartition::renderDebug() LLPipeline::RENDER_DEBUG_TEXTURE_ANIM | LLPipeline::RENDER_DEBUG_RAYCAST | LLPipeline::RENDER_DEBUG_AVATAR_VOLUME | - LLPipeline::RENDER_DEBUG_AVATAR_JOINTS | LLPipeline::RENDER_DEBUG_AGENT_TARGET | //LLPipeline::RENDER_DEBUG_BUILD_QUEUE | LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA | -- cgit v1.2.3 From 9ca1358d4223bb81902080ec8871d6e6f539153a Mon Sep 17 00:00:00 2001 From: "oz@lindenlab.com" Date: Wed, 16 Oct 2013 17:14:18 -0400 Subject: Added tag 3.6.8-release for changeset d40c66e41074 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index d993cb70b9..2efe658de2 100755 --- a/.hgtags +++ b/.hgtags @@ -466,3 +466,4 @@ fe4f7c5e9fd27e09d03deb1cc9ab3e5093f6309e 3.6.3-release 91ed595b716f14f07409595b734fda891a59379e 3.6.4-release bf6d453046011a11de2643fac610cc5258650f82 3.6.5-release ae457ece77001767ae9613148c495e7b98cc0f4a 3.6.7-release +d40c66e410741de7e90b1ed6dac28dd8a2d7e1f6 3.6.8-release -- cgit v1.2.3 From c7057c141c38492bfdc2bfe9d82de97a7364f01b Mon Sep 17 00:00:00 2001 From: "oz@lindenlab.com" Date: Wed, 16 Oct 2013 17:16:25 -0400 Subject: increment viewer version to 3.6.9 --- indra/newview/VIEWER_VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index 424e1794de..cff2619cfb 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -3.6.8 +3.6.9 -- cgit v1.2.3 From 76908954b93708e80f115b1d4348d398748788db Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 23 Oct 2013 11:52:24 -0400 Subject: Added tag 3.6.9-release for changeset 70eda3721d36 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 2efe658de2..c81c919d1a 100755 --- a/.hgtags +++ b/.hgtags @@ -467,3 +467,4 @@ fe4f7c5e9fd27e09d03deb1cc9ab3e5093f6309e 3.6.3-release bf6d453046011a11de2643fac610cc5258650f82 3.6.5-release ae457ece77001767ae9613148c495e7b98cc0f4a 3.6.7-release d40c66e410741de7e90b1ed6dac28dd8a2d7e1f6 3.6.8-release +70eda3721d36df3e00730629c42a1304e5bc65b8 3.6.9-release -- cgit v1.2.3 From ea1e1b0925b386cf83178539b8eae9e25c573548 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 23 Oct 2013 12:15:35 -0400 Subject: increment viewer version to 3.6.10 --- indra/newview/VIEWER_VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index cff2619cfb..c47e8b5872 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -3.6.9 +3.6.10 -- cgit v1.2.3