V3 merge part 1 / 2.
This commit is contained in:
@@ -1948,6 +1948,7 @@ LLGLState::LLGLState(LLGLenum state, S32 enabled) :
|
||||
case GL_COLOR_MATERIAL:
|
||||
case GL_FOG:
|
||||
case GL_LINE_STIPPLE:
|
||||
case GL_POLYGON_STIPPLE:
|
||||
mState = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ BOOL LLGLSLShader::createShader(vector<string> * attributes,
|
||||
}
|
||||
|
||||
static const LLCachedControl<bool> no_texture_indexing("ShyotlUseLegacyTextureBatching",false);
|
||||
if (gGLManager.mGLVersion < 3.1f || no_texture_indexing)
|
||||
if ((gGLManager.mGLSLVersionMajor < 2 && gGLManager.mGLSLVersionMinor < 3) || no_texture_indexing)
|
||||
{ //attachShaderFeatures may have set the number of indexed texture channels, so set to 1 again
|
||||
mFeatures.mIndexedTextureChannels = llmin(mFeatures.mIndexedTextureChannels, 1);
|
||||
}
|
||||
|
||||
@@ -1986,6 +1986,7 @@ BOOL LLImageGL::getMask(const LLVector2 &tc)
|
||||
|
||||
void LLImageGL::setCategory(S32 category)
|
||||
{
|
||||
#if 0 //turn this off temporarily because it is not in use now.
|
||||
if(!gAuditTexture)
|
||||
{
|
||||
return ;
|
||||
@@ -2006,6 +2007,7 @@ void LLImageGL::setCategory(S32 category)
|
||||
mCategory = -1 ;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//for debug use
|
||||
|
||||
@@ -1208,20 +1208,15 @@ void LLVertexBuffer::updateNumVerts(S32 nverts)
|
||||
|
||||
llassert(nverts >= 0);
|
||||
|
||||
if (nverts >= 65535)
|
||||
if (nverts > 65536)
|
||||
{
|
||||
// <FS:ND> FIRE-5077; Just print an info if there are more than 0xFFFF, for now just so there is a message in the logs where in older version #vertices would have been capped.
|
||||
|
||||
// llwarns << "Vertex buffer overflow!" << llendl;
|
||||
// nverts = 65535;
|
||||
llinfos << "More vertices than 65535 (#" << nverts << ")" <<llendl;
|
||||
|
||||
// </FS:ND>
|
||||
llwarns << "Vertex buffer overflow!" << llendl;
|
||||
nverts = 65536;
|
||||
}
|
||||
|
||||
S32 needed_size = calcOffsets(mTypeMask, mOffsets, nverts);
|
||||
U32 needed_size = (U32)calcOffsets(mTypeMask, mOffsets, nverts);
|
||||
|
||||
if (needed_size > mSize || needed_size <= mSize/2)
|
||||
if (needed_size > (U32)mSize || needed_size <= (U32)mSize/2)
|
||||
{
|
||||
createGLBuffer(needed_size);
|
||||
}
|
||||
@@ -1237,9 +1232,9 @@ void LLVertexBuffer::updateNumIndices(S32 nindices)
|
||||
|
||||
llassert(nindices >= 0);
|
||||
|
||||
S32 needed_size = sizeof(U16) * nindices;
|
||||
U32 needed_size = sizeof(U16) * (U32)nindices;
|
||||
|
||||
if (needed_size > mIndicesSize || needed_size <= mIndicesSize/2)
|
||||
if (needed_size > (U32)mIndicesSize || needed_size <= (U32)mIndicesSize/2)
|
||||
{
|
||||
createGLIndices(needed_size);
|
||||
}
|
||||
@@ -1255,21 +1250,11 @@ void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create)
|
||||
|
||||
stop_glerror();
|
||||
|
||||
// <FS:ND> FIRE-5077; Just print an info if there are more than 0xFFFF, for now just so there is a message in the logs where in older version #vertices would have been capped.
|
||||
|
||||
// if (nverts < 0 || nindices < 0 ||
|
||||
// nverts > 65536)
|
||||
// {
|
||||
// llerrs << "Bad vertex buffer allocation: " << nverts << " : " << nindices << llendl;
|
||||
// }
|
||||
|
||||
if( nverts < 0 || nindices < 0 )
|
||||
llerrs << "Bad vertex buffer allocation: " << nverts << " : " << nindices << llendl;
|
||||
|
||||
if( nverts > 0xFFFF )
|
||||
llinfos << "More vertices than 65535 (#" << nverts << ")" <<llendl;
|
||||
|
||||
// </FS:ND>
|
||||
if (nverts < 0 || nindices < 0 ||
|
||||
nverts > 65536)
|
||||
{
|
||||
llwarns << "Bad vertex buffer allocation: " << nverts << " : " << nindices << llendl;
|
||||
}
|
||||
|
||||
updateNumVerts(nverts);
|
||||
updateNumIndices(nindices);
|
||||
@@ -2303,10 +2288,10 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask)
|
||||
stop_glerror();
|
||||
volatile U8* base = useVBOs() ? (U8*) mAlignedOffset : mMappedData;
|
||||
|
||||
/*if ((data_mask & mTypeMask) != data_mask)
|
||||
if (gDebugGL && ((data_mask & mTypeMask) != data_mask))
|
||||
{
|
||||
llerrs << "LLVertexBuffer::setupVertexBuffer missing required components for supplied data mask." << llendl;
|
||||
}*/
|
||||
}
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
|
||||
@@ -5085,6 +5085,17 @@
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>EnableGestureSounds</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Play sounds from gestures</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>EnableMouselook</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
||||
@@ -138,7 +138,7 @@ LLChatBar::~LLChatBar()
|
||||
BOOL LLChatBar::postBuild()
|
||||
{
|
||||
childSetAction("History", toggleChatHistory, this);
|
||||
childSetCommitCallback("Say", onClickSay, this);
|
||||
getChild<LLUICtrl>("Say")->setCommitCallback(boost::bind(&LLChatBar::onClickSay, this, _1));
|
||||
|
||||
// attempt to bind to an existing combo box named gesture
|
||||
setGestureCombo(getChild<LLComboBox>( "Gesture"));
|
||||
@@ -249,7 +249,8 @@ void LLChatBar::refreshGestures()
|
||||
// collect list of unique gestures
|
||||
std::map <std::string, BOOL> unique;
|
||||
LLGestureMgr::item_map_t::const_iterator it;
|
||||
for (it = LLGestureMgr::instance().getActiveGestures().begin(); it != LLGestureMgr::instance().getActiveGestures().end(); ++it)
|
||||
const LLGestureMgr::item_map_t& active_gestures = LLGestureMgr::instance().getActiveGestures();
|
||||
for (it = active_gestures.begin(); it != active_gestures.end(); ++it)
|
||||
{
|
||||
LLMultiGesture* gesture = (*it).second;
|
||||
if (gesture)
|
||||
@@ -330,8 +331,7 @@ void LLChatBar::setGestureCombo(LLComboBox* combo)
|
||||
mGestureCombo = combo;
|
||||
if (mGestureCombo)
|
||||
{
|
||||
mGestureCombo->setCommitCallback(onCommitGesture);
|
||||
mGestureCombo->setCallbackUserData(this);
|
||||
mGestureCombo->setCommitCallback(boost::bind(&LLChatBar::onCommitGesture, this, _1));
|
||||
|
||||
// now register observer since we have a place to put the results
|
||||
mObserver = new LLChatBarGestureObserver(this);
|
||||
@@ -637,19 +637,19 @@ void LLChatBar::onInputEditorGainFocus()
|
||||
}
|
||||
|
||||
// static
|
||||
void LLChatBar::onClickSay( LLUICtrl* ctrl, void* userdata )
|
||||
void LLChatBar::onClickSay( LLUICtrl* ctrl )
|
||||
{
|
||||
std::string cmd = ctrl->getValue().asString();
|
||||
e_chat_type chat_type = CHAT_TYPE_NORMAL;
|
||||
if (ctrl->getValue().asString() == "shout")
|
||||
if (cmd == "shout")
|
||||
{
|
||||
chat_type = CHAT_TYPE_SHOUT;
|
||||
}
|
||||
else if (ctrl->getValue().asString() == "whisper")
|
||||
else if (cmd == "whisper")
|
||||
{
|
||||
chat_type = CHAT_TYPE_WHISPER;
|
||||
}
|
||||
LLChatBar* self = (LLChatBar*) userdata;
|
||||
self->sendChat(chat_type);
|
||||
sendChat(chat_type);
|
||||
}
|
||||
|
||||
void LLChatBar::sendChatFromViewer(const std::string &utf8text, EChatType type, BOOL animate)
|
||||
@@ -861,11 +861,9 @@ void really_send_chat_from_viewer(const std::string& utf8_out_text, EChatType ty
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
void LLChatBar::onCommitGesture(LLUICtrl* ctrl, void* data)
|
||||
void LLChatBar::onCommitGesture(LLUICtrl* ctrl)
|
||||
{
|
||||
LLChatBar* self = (LLChatBar*)data;
|
||||
LLCtrlListInterface* gestures = self->mGestureCombo ? self->mGestureCombo->getListInterface() : NULL;
|
||||
LLCtrlListInterface* gestures = mGestureCombo ? mGestureCombo->getListInterface() : NULL;
|
||||
if (gestures)
|
||||
{
|
||||
S32 index = gestures->getFirstSelectedIndex();
|
||||
@@ -885,14 +883,14 @@ void LLChatBar::onCommitGesture(LLUICtrl* ctrl, void* data)
|
||||
if (!revised_text.empty())
|
||||
{
|
||||
// Don't play nodding animation
|
||||
self->sendChatFromViewer(revised_text, CHAT_TYPE_NORMAL, FALSE);
|
||||
sendChatFromViewer(revised_text, CHAT_TYPE_NORMAL, FALSE);
|
||||
}
|
||||
}
|
||||
self->mGestureLabelTimer.start();
|
||||
if (self->mGestureCombo != NULL)
|
||||
mGestureLabelTimer.start();
|
||||
if (mGestureCombo != NULL)
|
||||
{
|
||||
// free focus back to chat bar
|
||||
self->mGestureCombo->setFocus(FALSE);
|
||||
mGestureCombo->setFocus(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -82,14 +82,14 @@ public:
|
||||
LLWString stripChannelNumber(const LLWString &mesg, S32* channel);
|
||||
|
||||
// callbacks
|
||||
static void onClickSay( LLUICtrl*, void* userdata );
|
||||
void onClickSay(LLUICtrl* ctrl);
|
||||
|
||||
static void onTabClick( void* userdata );
|
||||
static void onInputEditorKeystroke(LLLineEditor* caller, void* userdata);
|
||||
static void onInputEditorFocusLost();
|
||||
static void onInputEditorGainFocus();
|
||||
|
||||
static void onCommitGesture(LLUICtrl* ctrl, void* data);
|
||||
void onCommitGesture(LLUICtrl* ctrl);
|
||||
|
||||
static void startChat(const char* line);
|
||||
static void stopChat();
|
||||
|
||||
@@ -121,8 +121,6 @@ LLDrawPool *LLDrawPoolAvatar::instancePool()
|
||||
return new LLDrawPoolAvatar();
|
||||
}
|
||||
|
||||
BOOL gRenderAvatar = TRUE;
|
||||
|
||||
S32 LLDrawPoolAvatar::getVertexShaderLevel() const
|
||||
{
|
||||
return (S32) LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_AVATAR);
|
||||
@@ -1056,13 +1054,6 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!gRenderAvatar)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (mDrawFace.empty() && !single_avatar)
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -187,8 +187,8 @@ bool LLEnvManagerNew::useRegionSettings()
|
||||
bool LLEnvManagerNew::useWaterPreset(const std::string& name)
|
||||
{
|
||||
LL_DEBUGS("Windlight") << "Displaying water preset " << name << LL_ENDL;
|
||||
LLWaterParamManager* water_mgr = LLWaterParamManager::getInstance();
|
||||
bool rslt = water_mgr->getParamSet(name, water_mgr->mCurParams);
|
||||
LLWaterParamManager& water_mgr = LLWaterParamManager::instance();
|
||||
bool rslt = water_mgr.getParamSet(name, water_mgr.mCurParams);
|
||||
llassert(rslt == true);
|
||||
return rslt;
|
||||
}
|
||||
@@ -196,30 +196,30 @@ bool LLEnvManagerNew::useWaterPreset(const std::string& name)
|
||||
bool LLEnvManagerNew::useWaterParams(const LLSD& params)
|
||||
{
|
||||
LL_DEBUGS("Windlight") << "Displaying water params" << LL_ENDL;
|
||||
LLWaterParamManager::getInstance()->mCurParams.setAll(params);
|
||||
LLWaterParamManager::instance().mCurParams.setAll(params);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LLEnvManagerNew::useSkyPreset(const std::string& name, bool interpolate /*= false*/)
|
||||
{
|
||||
LLWLParamManager* sky_mgr = LLWLParamManager::getInstance();
|
||||
LLWLParamManager& sky_mgr = LLWLParamManager::instance();
|
||||
LLWLParamSet param_set;
|
||||
|
||||
if (!sky_mgr->getParamSet(LLWLParamKey(name, LLEnvKey::SCOPE_LOCAL), param_set))
|
||||
if (!sky_mgr.getParamSet(LLWLParamKey(name, LLEnvKey::SCOPE_LOCAL), param_set))
|
||||
{
|
||||
llwarns << "No sky preset named " << name << llendl;
|
||||
return false;
|
||||
}
|
||||
|
||||
LL_DEBUGS("Windlight") << "Displaying sky preset " << name << LL_ENDL;
|
||||
sky_mgr->applySkyParams(param_set.getAll(), interpolate);
|
||||
sky_mgr.applySkyParams(param_set.getAll(), interpolate);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LLEnvManagerNew::useSkyParams(const LLSD& params)
|
||||
{
|
||||
LL_DEBUGS("Windlight") << "Displaying sky params" << LL_ENDL;
|
||||
LLWLParamManager::getInstance()->applySkyParams(params);
|
||||
LLWLParamManager::instance().applySkyParams(params);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ bool LLEnvManagerNew::useDayCycle(const std::string& name, LLEnvKey::EScope scop
|
||||
}
|
||||
}
|
||||
|
||||
bool rslt = LLWLParamManager::getInstance()->applyDayCycleParams(params, scope);
|
||||
bool rslt = LLWLParamManager::instance().applyDayCycleParams(params, scope);
|
||||
llassert(rslt == true);
|
||||
return rslt;
|
||||
}
|
||||
@@ -251,7 +251,7 @@ bool LLEnvManagerNew::useDayCycle(const std::string& name, LLEnvKey::EScope scop
|
||||
bool LLEnvManagerNew::useDayCycleParams(const LLSD& params, LLEnvKey::EScope scope, F32 time /* = 0.5*/)
|
||||
{
|
||||
LL_DEBUGS("Windlight") << "Displaying day cycle params" << LL_ENDL;
|
||||
return LLWLParamManager::getInstance()->applyDayCycleParams(params, scope);
|
||||
return LLWLParamManager::instance().applyDayCycleParams(params, scope);
|
||||
}
|
||||
|
||||
void LLEnvManagerNew::setUseRegionSettings(bool val, bool interpolate /*= false*/)
|
||||
@@ -366,7 +366,7 @@ void LLEnvManagerNew::dumpPresets()
|
||||
LL_DEBUGS("Windlight") << " - " << region_name << LL_ENDL;
|
||||
}
|
||||
LLWaterParamManager::preset_name_list_t water_presets;
|
||||
LLWaterParamManager::getInstance()->getPresetNames(water_presets);
|
||||
LLWaterParamManager::instance().getPresetNames(water_presets);
|
||||
for (LLWaterParamManager::preset_name_list_t::const_iterator it = water_presets.begin(); it != water_presets.end(); ++it)
|
||||
{
|
||||
LL_DEBUGS("Windlight") << " - " << *it << LL_ENDL;
|
||||
@@ -375,7 +375,7 @@ void LLEnvManagerNew::dumpPresets()
|
||||
// Dump sky presets.
|
||||
LL_DEBUGS("Windlight") << "Skies:" << LL_ENDL;
|
||||
LLWLParamManager::preset_key_list_t sky_preset_keys;
|
||||
LLWLParamManager::getInstance()->getPresetKeys(sky_preset_keys);
|
||||
LLWLParamManager::instance().getPresetKeys(sky_preset_keys);
|
||||
for (LLWLParamManager::preset_key_list_t::const_iterator it = sky_preset_keys.begin(); it != sky_preset_keys.end(); ++it)
|
||||
{
|
||||
std::string preset_name = it->name;
|
||||
@@ -492,7 +492,7 @@ void LLEnvManagerNew::onRegionSettingsResponse(const LLSD& content)
|
||||
mCachedRegionPrefs = new_settings;
|
||||
|
||||
// Load region sky presets.
|
||||
LLWLParamManager::getInstance()->refreshRegionPresets();
|
||||
LLWLParamManager::instance().refreshRegionPresets();
|
||||
|
||||
bool bOverridden = M7WindlightInterface::getInstance()->hasOverride();
|
||||
|
||||
@@ -563,7 +563,7 @@ void LLEnvManagerNew::updateSkyFromPrefs(bool interpolate /*= false*/)
|
||||
|
||||
void LLEnvManagerNew::updateWaterFromPrefs(bool interpolate)
|
||||
{
|
||||
LLWaterParamManager* water_mgr = LLWaterParamManager::getInstance();
|
||||
LLWaterParamManager& water_mgr = LLWaterParamManager::instance();
|
||||
LLSD target_water_params;
|
||||
|
||||
// Determine new water settings based on user prefs.
|
||||
@@ -571,7 +571,7 @@ void LLEnvManagerNew::updateWaterFromPrefs(bool interpolate)
|
||||
{
|
||||
// Fall back to default water.
|
||||
LLWaterParamSet default_water;
|
||||
water_mgr->getParamSet("Default", default_water);
|
||||
water_mgr.getParamSet("Default", default_water);
|
||||
target_water_params = default_water.getAll();
|
||||
}
|
||||
|
||||
@@ -594,10 +594,10 @@ void LLEnvManagerNew::updateWaterFromPrefs(bool interpolate)
|
||||
std::string water = getWaterPresetName();
|
||||
LL_DEBUGS("Windlight") << "Applying water preset [" << water << "]" << LL_ENDL;
|
||||
LLWaterParamSet params;
|
||||
if (!water_mgr->getParamSet(water, params))
|
||||
if (!water_mgr.getParamSet(water, params))
|
||||
{
|
||||
llwarns << "No water preset named " << water << ", falling back to defaults" << llendl;
|
||||
water_mgr->getParamSet("Default", params);
|
||||
water_mgr.getParamSet("Default", params);
|
||||
|
||||
// *TODO: Fix user preferences accordingly.
|
||||
}
|
||||
@@ -605,7 +605,7 @@ void LLEnvManagerNew::updateWaterFromPrefs(bool interpolate)
|
||||
}
|
||||
|
||||
// Sync water with user prefs.
|
||||
water_mgr->applyParams(target_water_params, interpolate);
|
||||
water_mgr.applyParams(target_water_params, interpolate);
|
||||
}
|
||||
|
||||
void LLEnvManagerNew::updateManagersFromPrefs(bool interpolate)
|
||||
|
||||
@@ -1740,9 +1740,9 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
||||
}
|
||||
}
|
||||
|
||||
// <FS:ND> FS-5132 Only use color strider if face has colors.
|
||||
// if (rebuild_color)
|
||||
if (rebuild_color && mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_COLOR) )
|
||||
// <FS:ND> FS-5132 Only use color strider if face has colors.
|
||||
// if (rebuild_color)
|
||||
if (rebuild_color && mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_COLOR) )
|
||||
// </FS:ND>
|
||||
{
|
||||
LLFastTimer t(FTM_FACE_GEOM_COLOR);
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "llviewerinventory.h"
|
||||
|
||||
class LLMultiGesture;
|
||||
class LLGestureListener;
|
||||
class LLGestureStep;
|
||||
class LLUUID;
|
||||
class LLVFS;
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file llgroupmgr.cpp
|
||||
* @brief LLGroupMgr class implementation
|
||||
*
|
||||
* $LicenseInfo:firstyear=2004&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2004-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
@@ -55,11 +49,20 @@
|
||||
#include "llfloatergroupinfo.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#if LL_MSVC
|
||||
#pragma warning( disable : 4265 ) // "class has virtual functions, but destructor is not virtual"
|
||||
#endif
|
||||
#include "lltrans.h"
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
#if LL_MSVC
|
||||
#pragma warning(push)
|
||||
// disable boost::lexical_cast warning
|
||||
#pragma warning (disable:4702)
|
||||
#endif
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#if LL_MSVC
|
||||
#pragma warning(pop) // Restore all warnings to the previous state
|
||||
#endif
|
||||
|
||||
const U32 MAX_CACHED_GROUPS = 10;
|
||||
|
||||
@@ -153,7 +156,7 @@ LLGroupRoleData::~LLGroupRoleData()
|
||||
{
|
||||
}
|
||||
|
||||
S32 LLGroupRoleData::getMembersInRole(std::vector<LLUUID> members,
|
||||
S32 LLGroupRoleData::getMembersInRole(uuid_vec_t members,
|
||||
BOOL needs_sort)
|
||||
{
|
||||
if (mRoleID.isNull())
|
||||
@@ -177,8 +180,8 @@ S32 LLGroupRoleData::getMembersInRole(std::vector<LLUUID> members,
|
||||
|
||||
// Return the number of members in the intersection.
|
||||
S32 max_size = llmin( members.size(), mMemberIDs.size() );
|
||||
std::vector<LLUUID> in_role( max_size );
|
||||
std::vector<LLUUID>::iterator in_role_end;
|
||||
uuid_vec_t in_role( max_size );
|
||||
uuid_vec_t::iterator in_role_end;
|
||||
in_role_end = std::set_intersection(mMemberIDs.begin(), mMemberIDs.end(),
|
||||
members.begin(), members.end(),
|
||||
in_role.begin());
|
||||
@@ -193,7 +196,7 @@ void LLGroupRoleData::addMember(const LLUUID& member)
|
||||
|
||||
bool LLGroupRoleData::removeMember(const LLUUID& member)
|
||||
{
|
||||
std::vector<LLUUID>::iterator it = std::find(mMemberIDs.begin(),mMemberIDs.end(),member);
|
||||
uuid_vec_t::iterator it = std::find(mMemberIDs.begin(),mMemberIDs.end(),member);
|
||||
|
||||
if (it != mMemberIDs.end())
|
||||
{
|
||||
@@ -850,6 +853,14 @@ void LLGroupMgr::addObserver(LLGroupMgrObserver* observer)
|
||||
mObservers.insert(std::pair<LLUUID, LLGroupMgrObserver*>(observer->getID(), observer));
|
||||
}
|
||||
|
||||
void LLGroupMgr::addObserver(const LLUUID& group_id, LLParticularGroupObserver* observer)
|
||||
{
|
||||
if(group_id.notNull() && observer)
|
||||
{
|
||||
mParticularObservers[group_id].insert(observer);
|
||||
}
|
||||
}
|
||||
|
||||
void LLGroupMgr::removeObserver(LLGroupMgrObserver* observer)
|
||||
{
|
||||
if (!observer)
|
||||
@@ -872,6 +883,23 @@ void LLGroupMgr::removeObserver(LLGroupMgrObserver* observer)
|
||||
}
|
||||
}
|
||||
|
||||
void LLGroupMgr::removeObserver(const LLUUID& group_id, LLParticularGroupObserver* observer)
|
||||
{
|
||||
if(group_id.isNull() || !observer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
observer_map_t::iterator obs_it = mParticularObservers.find(group_id);
|
||||
if(obs_it == mParticularObservers.end())
|
||||
return;
|
||||
|
||||
obs_it->second.erase(observer);
|
||||
|
||||
if (obs_it->second.size() == 0)
|
||||
mParticularObservers.erase(obs_it);
|
||||
}
|
||||
|
||||
LLGroupMgrGroupData* LLGroupMgr::getGroupData(const LLUUID& id)
|
||||
{
|
||||
group_map_t::iterator gi = mGroups.find(id);
|
||||
@@ -891,7 +919,7 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data)
|
||||
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id );
|
||||
if (gAgent.getID() != agent_id)
|
||||
{
|
||||
llwarns << "Got group properties reply for another agent!" << llendl;
|
||||
llwarns << "Got group members reply for another agent!" << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -902,9 +930,9 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data)
|
||||
msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_RequestID, request_id);
|
||||
|
||||
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->createGroupData(group_id);
|
||||
if (group_datap->mMemberRequestID != request_id)
|
||||
if (!group_datap || (group_datap->mMemberRequestID != request_id))
|
||||
{
|
||||
llwarns << "processGroupMembersReply: Received incorrect (stale?) request id" << llendl;
|
||||
llwarns << "processGroupMembersReply: Received incorrect (stale?) group or request id" << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1061,7 +1089,7 @@ void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data)
|
||||
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id );
|
||||
if (gAgent.getID() != agent_id)
|
||||
{
|
||||
llwarns << "Got group properties reply for another agent!" << llendl;
|
||||
llwarns << "Got group role data reply for another agent!" << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1071,14 +1099,14 @@ void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data)
|
||||
LLUUID request_id;
|
||||
msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_RequestID, request_id);
|
||||
|
||||
LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->createGroupData(group_id);
|
||||
if (group_data->mRoleDataRequestID != request_id)
|
||||
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->createGroupData(group_id);
|
||||
if (!group_datap || (group_datap->mRoleDataRequestID != request_id))
|
||||
{
|
||||
llwarns << "processGroupRoleDataReply: Received incorrect (stale?) request id" << llendl;
|
||||
llwarns << "processGroupPropertiesReply: Received incorrect (stale?) group or request id" << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
msg->getS32(_PREHASH_GroupData, "RoleCount", group_data->mRoleCount );
|
||||
msg->getS32(_PREHASH_GroupData, "RoleCount", group_datap->mRoleCount );
|
||||
|
||||
std::string name;
|
||||
std::string title;
|
||||
@@ -1101,22 +1129,22 @@ void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data)
|
||||
|
||||
lldebugs << "Adding role data: " << name << " {" << role_id << "}" << llendl;
|
||||
LLGroupRoleData* rd = new LLGroupRoleData(role_id,name,title,desc,powers,member_count);
|
||||
group_data->mRoles[role_id] = rd;
|
||||
group_datap->mRoles[role_id] = rd;
|
||||
}
|
||||
|
||||
if (group_data->mRoles.size() == (U32)group_data->mRoleCount)
|
||||
if (group_datap->mRoles.size() == (U32)group_datap->mRoleCount)
|
||||
{
|
||||
group_data->mRoleDataComplete = TRUE;
|
||||
group_data->mRoleDataRequestID.setNull();
|
||||
group_datap->mRoleDataComplete = TRUE;
|
||||
group_datap->mRoleDataRequestID.setNull();
|
||||
// We don't want to make role-member data requests until we have all the role data
|
||||
if (group_data->mPendingRoleMemberRequest)
|
||||
if (group_datap->mPendingRoleMemberRequest)
|
||||
{
|
||||
group_data->mPendingRoleMemberRequest = FALSE;
|
||||
LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(group_data->mID);
|
||||
group_datap->mPendingRoleMemberRequest = FALSE;
|
||||
LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(group_datap->mID);
|
||||
}
|
||||
}
|
||||
|
||||
group_data->mChanged = TRUE;
|
||||
group_datap->mChanged = TRUE;
|
||||
#if SHY_MOD //Group title script access
|
||||
gGroupRoleChanger.CheckUpdateRole(group_id,group_data->mRoles);
|
||||
#endif //shy_mod
|
||||
@@ -1131,7 +1159,7 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data)
|
||||
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id );
|
||||
if (gAgent.getID() != agent_id)
|
||||
{
|
||||
llwarns << "Got group properties reply for another agent!" << llendl;
|
||||
llwarns << "Got group role members reply for another agent!" << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1144,11 +1172,10 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data)
|
||||
U32 total_pairs;
|
||||
msg->getU32(_PREHASH_AgentData, "TotalPairs", total_pairs);
|
||||
|
||||
LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->createGroupData(group_id);
|
||||
|
||||
if (group_data->mRoleMembersRequestID != request_id)
|
||||
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->createGroupData(group_id);
|
||||
if (!group_datap || (group_datap->mRoleMembersRequestID != request_id))
|
||||
{
|
||||
llwarns << "processGroupRoleMembersReply: Received incorrect (stale?) role member request id" << llendl;
|
||||
llwarns << "processGroupRoleMembersReply: Received incorrect (stale?) group or request id" << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1173,15 +1200,15 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data)
|
||||
if (role_id.notNull() && member_id.notNull() )
|
||||
{
|
||||
rd = NULL;
|
||||
ri = group_data->mRoles.find(role_id);
|
||||
if (ri != group_data->mRoles.end())
|
||||
ri = group_datap->mRoles.find(role_id);
|
||||
if (ri != group_datap->mRoles.end())
|
||||
{
|
||||
rd = ri->second;
|
||||
}
|
||||
|
||||
md = NULL;
|
||||
mi = group_data->mMembers.find(member_id);
|
||||
if (mi != group_data->mMembers.end())
|
||||
mi = group_datap->mMembers.find(member_id);
|
||||
if (mi != group_datap->mMembers.end())
|
||||
{
|
||||
md = mi->second;
|
||||
}
|
||||
@@ -1200,21 +1227,21 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data)
|
||||
}
|
||||
}
|
||||
|
||||
group_data->mReceivedRoleMemberPairs += num_blocks;
|
||||
group_datap->mReceivedRoleMemberPairs += num_blocks;
|
||||
}
|
||||
|
||||
if (group_data->mReceivedRoleMemberPairs == total_pairs)
|
||||
if (group_datap->mReceivedRoleMemberPairs == total_pairs)
|
||||
{
|
||||
// Add role data for the 'everyone' role to all members
|
||||
LLGroupRoleData* everyone = group_data->mRoles[LLUUID::null];
|
||||
LLGroupRoleData* everyone = group_datap->mRoles[LLUUID::null];
|
||||
if (!everyone)
|
||||
{
|
||||
llwarns << "Everyone role not found!" << llendl;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (LLGroupMgrGroupData::member_list_t::iterator mi = group_data->mMembers.begin();
|
||||
mi != group_data->mMembers.end(); ++mi)
|
||||
for (LLGroupMgrGroupData::member_list_t::iterator mi = group_datap->mMembers.begin();
|
||||
mi != group_datap->mMembers.end(); ++mi)
|
||||
{
|
||||
LLGroupMemberData* data = mi->second;
|
||||
if (data)
|
||||
@@ -1224,11 +1251,11 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data)
|
||||
}
|
||||
}
|
||||
|
||||
group_data->mRoleMemberDataComplete = TRUE;
|
||||
group_data->mRoleMembersRequestID.setNull();
|
||||
group_datap->mRoleMemberDataComplete = TRUE;
|
||||
group_datap->mRoleMembersRequestID.setNull();
|
||||
}
|
||||
|
||||
group_data->mChanged = TRUE;
|
||||
group_datap->mChanged = TRUE;
|
||||
LLGroupMgr::getInstance()->notifyObservers(GC_ROLE_MEMBER_DATA);
|
||||
}
|
||||
|
||||
@@ -1246,15 +1273,13 @@ void LLGroupMgr::processGroupTitlesReply(LLMessageSystem* msg, void** data)
|
||||
|
||||
LLUUID group_id;
|
||||
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_GroupID, group_id );
|
||||
|
||||
LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->createGroupData(group_id);
|
||||
|
||||
LLUUID request_id;
|
||||
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_RequestID, request_id);
|
||||
|
||||
if (group_data->mTitlesRequestID != request_id)
|
||||
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->createGroupData(group_id);
|
||||
if (!group_datap || (group_datap->mTitlesRequestID != request_id))
|
||||
{
|
||||
llwarns << "processGroupTitlesReply: Received incorrect (stale?) title request id" << llendl;
|
||||
llwarns << "processGroupTitlesReply: Received incorrect (stale?) group" << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1271,11 +1296,11 @@ void LLGroupMgr::processGroupTitlesReply(LLMessageSystem* msg, void** data)
|
||||
if (!title.mTitle.empty())
|
||||
{
|
||||
lldebugs << "LLGroupMgr adding title: " << title.mTitle << ", " << title.mRoleID << ", " << (title.mSelected ? 'Y' : 'N') << llendl;
|
||||
group_data->mTitles.push_back(title);
|
||||
group_datap->mTitles.push_back(title);
|
||||
}
|
||||
}
|
||||
|
||||
group_data->mChanged = TRUE;
|
||||
group_datap->mChanged = TRUE;
|
||||
LLGroupMgr::getInstance()->notifyObservers(GC_TITLES);
|
||||
}
|
||||
|
||||
@@ -1418,6 +1443,18 @@ void LLGroupMgr::notifyObservers(LLGroupChange gc)
|
||||
oi->second->changed(gc);
|
||||
}
|
||||
gi->second->mChanged = FALSE;
|
||||
|
||||
|
||||
// notify LLParticularGroupObserver
|
||||
observer_map_t::iterator obs_it = mParticularObservers.find(group_id);
|
||||
if(obs_it == mParticularObservers.end())
|
||||
return;
|
||||
|
||||
observer_set_t& obs = obs_it->second;
|
||||
for (observer_set_t::iterator ob_it = obs.begin(); ob_it != obs.end(); ++ob_it)
|
||||
{
|
||||
(*ob_it)->changed(group_id, gc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1747,15 +1784,17 @@ void LLGroupMgr::sendGroupMemberInvites(const LLUUID& group_id, std::map<LLUUID,
|
||||
|
||||
//static
|
||||
void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id,
|
||||
std::vector<LLUUID>& member_ids)
|
||||
uuid_vec_t& member_ids)
|
||||
{
|
||||
bool start_message = true;
|
||||
LLMessageSystem* msg = gMessageSystem;
|
||||
|
||||
|
||||
|
||||
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->getGroupData(group_id);
|
||||
if (!group_datap) return;
|
||||
|
||||
for (std::vector<LLUUID>::iterator it = member_ids.begin();
|
||||
for (uuid_vec_t::iterator it = member_ids.begin();
|
||||
it != member_ids.end(); ++it)
|
||||
{
|
||||
LLUUID& ejected_member_id = (*it);
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file llgroupmgr.h
|
||||
* @brief Manager for aggregating all client knowledge for specific groups
|
||||
*
|
||||
* $LicenseInfo:firstyear=2004&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2004-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
@@ -45,6 +39,7 @@ class LLGroupMgrObserver
|
||||
{
|
||||
public:
|
||||
LLGroupMgrObserver(const LLUUID& id) : mID(id){};
|
||||
LLGroupMgrObserver() : mID(LLUUID::null){};
|
||||
virtual ~LLGroupMgrObserver(){};
|
||||
virtual void changed(LLGroupChange gc) = 0;
|
||||
const LLUUID& getID() { return mID; }
|
||||
@@ -52,6 +47,13 @@ protected:
|
||||
LLUUID mID;
|
||||
};
|
||||
|
||||
class LLParticularGroupObserver
|
||||
{
|
||||
public:
|
||||
virtual ~LLParticularGroupObserver(){}
|
||||
virtual void changed(const LLUUID& group_id, LLGroupChange gc) = 0;
|
||||
};
|
||||
|
||||
class LLGroupRoleData;
|
||||
|
||||
class LLGroupMemberData
|
||||
@@ -131,8 +133,8 @@ public:
|
||||
|
||||
const LLUUID& getID() const { return mRoleID; }
|
||||
|
||||
const std::vector<LLUUID>& getRoleMembers() const { return mMemberIDs; }
|
||||
S32 getMembersInRole(std::vector<LLUUID> members, BOOL needs_sort = TRUE);
|
||||
const uuid_vec_t& getRoleMembers() const { return mMemberIDs; }
|
||||
S32 getMembersInRole(uuid_vec_t members, BOOL needs_sort = TRUE);
|
||||
S32 getTotalMembersInRole() { return mMemberIDs.size(); }
|
||||
|
||||
LLRoleData getRoleData() const { return mRoleData; }
|
||||
@@ -142,10 +144,10 @@ public:
|
||||
bool removeMember(const LLUUID& member);
|
||||
void clearMembers();
|
||||
|
||||
const std::vector<LLUUID>::const_iterator getMembersBegin() const
|
||||
const uuid_vec_t::const_iterator getMembersBegin() const
|
||||
{ return mMemberIDs.begin(); }
|
||||
|
||||
const std::vector<LLUUID>::const_iterator getMembersEnd() const
|
||||
const uuid_vec_t::const_iterator getMembersEnd() const
|
||||
{ return mMemberIDs.end(); }
|
||||
|
||||
|
||||
@@ -156,7 +158,7 @@ protected:
|
||||
LLUUID mRoleID;
|
||||
LLRoleData mRoleData;
|
||||
|
||||
std::vector<LLUUID> mMemberIDs;
|
||||
uuid_vec_t mMemberIDs;
|
||||
S32 mMemberCount;
|
||||
|
||||
private:
|
||||
@@ -304,7 +306,9 @@ public:
|
||||
~LLGroupMgr();
|
||||
|
||||
void addObserver(LLGroupMgrObserver* observer);
|
||||
void addObserver(const LLUUID& group_id, LLParticularGroupObserver* observer);
|
||||
void removeObserver(LLGroupMgrObserver* observer);
|
||||
void removeObserver(const LLUUID& group_id, LLParticularGroupObserver* observer);
|
||||
LLGroupMgrGroupData* getGroupData(const LLUUID& id);
|
||||
|
||||
void sendGroupPropertiesRequest(const LLUUID& group_id);
|
||||
@@ -329,7 +333,7 @@ public:
|
||||
static void sendGroupMemberJoin(const LLUUID& group_id);
|
||||
static void sendGroupMemberInvites(const LLUUID& group_id, std::map<LLUUID,LLUUID>& role_member_pairs);
|
||||
static void sendGroupMemberEjects(const LLUUID& group_id,
|
||||
std::vector<LLUUID>& member_ids);
|
||||
uuid_vec_t& member_ids);
|
||||
|
||||
void cancelGroupRoleChanges(const LLUUID& group_id);
|
||||
|
||||
@@ -353,13 +357,19 @@ public:
|
||||
|
||||
private:
|
||||
void notifyObservers(LLGroupChange gc);
|
||||
void notifyObserver(const LLUUID& group_id, LLGroupChange gc);
|
||||
void addGroup(LLGroupMgrGroupData* group_datap);
|
||||
LLGroupMgrGroupData* createGroupData(const LLUUID &id);
|
||||
|
||||
typedef std::multimap<LLUUID,LLGroupMgrObserver*> observer_multimap_t;
|
||||
observer_multimap_t mObservers;
|
||||
|
||||
typedef std::map<LLUUID, LLGroupMgrGroupData*> group_map_t;
|
||||
group_map_t mGroups;
|
||||
|
||||
typedef std::set<LLParticularGroupObserver*> observer_set_t;
|
||||
typedef std::map<LLUUID,observer_set_t> observer_map_t;
|
||||
observer_map_t mParticularObservers;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
#include "llviewerjoint.h"
|
||||
#include "llviewerobject.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "llviewershadermgr.h"
|
||||
#include "llvoavatarself.h"
|
||||
#include "llworld.h"
|
||||
#include "llui.h"
|
||||
@@ -1662,17 +1663,28 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal,
|
||||
LLQuaternion grid_rotation,
|
||||
LLColor4 inner_color)
|
||||
{
|
||||
if (!gSavedSettings.getBOOL("GridCrossSections"))
|
||||
if (!gSavedSettings.getBOOL("GridCrossSections") || !LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
|
||||
|
||||
|
||||
U32 types[] = { LLRenderPass::PASS_SIMPLE, LLRenderPass::PASS_ALPHA, LLRenderPass::PASS_FULLBRIGHT, LLRenderPass::PASS_SHINY };
|
||||
U32 num_types = LL_ARRAY_SIZE(types);
|
||||
|
||||
GLuint stencil_mask = 0xFFFFFFFF;
|
||||
//stencil in volumes
|
||||
|
||||
gGL.flush();
|
||||
|
||||
if (shader)
|
||||
{
|
||||
gClipProgram.bind();
|
||||
}
|
||||
|
||||
{
|
||||
glStencilMask(stencil_mask);
|
||||
glClearStencil(1);
|
||||
@@ -1683,6 +1695,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal,
|
||||
glStencilFunc(GL_ALWAYS, 0, stencil_mask);
|
||||
gGL.setColorMask(false, false);
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
|
||||
gGL.diffuseColor4f(1,1,1,1);
|
||||
|
||||
//setup clip plane
|
||||
@@ -1692,10 +1705,12 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal,
|
||||
normal = -normal;
|
||||
}
|
||||
F32 d = -(selection_center * normal);
|
||||
F64 plane[] = { normal.mV[0], normal.mV[1], normal.mV[2], d };
|
||||
LLGLEnable clip(GL_CLIP_PLANE0);
|
||||
glClipPlane(GL_CLIP_PLANE0, plane);
|
||||
glh::vec4f plane(normal.mV[0], normal.mV[1], normal.mV[2], d );
|
||||
|
||||
gGL.getModelviewMatrix().inverse().mult_vec_matrix(plane);
|
||||
|
||||
gClipProgram.uniform4fv("clip_plane", 1, plane.v);
|
||||
|
||||
BOOL particles = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES);
|
||||
BOOL clouds = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS);
|
||||
|
||||
@@ -1746,6 +1761,11 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal,
|
||||
F32 sz = mGridSizeMeters;
|
||||
F32 tiles = sz;
|
||||
|
||||
if (shader)
|
||||
{
|
||||
shader->bind();
|
||||
}
|
||||
|
||||
//draw volume/plane intersections
|
||||
{
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
|
||||
@@ -756,7 +756,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time)
|
||||
const F32 area_for_max_settings = 0.0;
|
||||
const F32 area_for_min_settings = 1400.0;
|
||||
const F32 area_for_this_setting = area_for_max_settings + (area_for_min_settings-area_for_max_settings)*(1.0-lod_factor);
|
||||
const F32 pixel_area = (F32) sqrt(mCharacter->getPixelArea());
|
||||
const F32 pixel_area = sqrtf(mCharacter->getPixelArea());
|
||||
|
||||
const BOOL is_self = (dynamic_cast<LLVOAvatarSelf *>(mCharacter) != NULL);
|
||||
if ((pixel_area > area_for_this_setting) || is_self)
|
||||
|
||||
@@ -327,7 +327,7 @@ void LLPreviewGesture::setMinimized(BOOL minimize)
|
||||
|
||||
bool LLPreviewGesture::handleSaveChangesDialog(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
S32 option = LLNotification::getSelectedOption(notification, response);
|
||||
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
switch(option)
|
||||
{
|
||||
case 0: // "Yes"
|
||||
@@ -701,7 +701,7 @@ void LLPreviewGesture::refresh()
|
||||
{
|
||||
// If previewing or item is incomplete, all controls are disabled
|
||||
LLViewerInventoryItem* item = (LLViewerInventoryItem*)getItem();
|
||||
bool is_complete = (item && item->isComplete()) ? true : false;
|
||||
bool is_complete = (item && item->isFinished()) ? true : false;
|
||||
if (mPreviewGesture || !is_complete)
|
||||
{
|
||||
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file llresourcedata.h
|
||||
* @brief Tracking object for uploads.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2006-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
@@ -44,6 +38,7 @@ struct LLResourceData
|
||||
U32 mNextOwnerPerm;
|
||||
S32 mExpectedUploadCost;
|
||||
void *mUserData;
|
||||
static const S8 INVALID_LOCATION = -2;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1747,6 +1747,7 @@ bool idle_startup()
|
||||
set_startup_status(0.4f, LLTrans::getString("LoginRequestSeedCapGrant"), gAgent.mMOTD);
|
||||
}
|
||||
}
|
||||
display_startup();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -2432,10 +2433,9 @@ bool idle_startup()
|
||||
item_ids.push_back(item_id);
|
||||
}
|
||||
}
|
||||
|
||||
LLGestureInventoryFetchObserver* fetch = new LLGestureInventoryFetchObserver(item_ids);
|
||||
// deletes itself when done
|
||||
gInventory.addObserver(fetch);
|
||||
// no need to add gesture to inventory observer, it's already made in constructor
|
||||
LLGestureMgr::instance().setFetchIDs(item_ids);
|
||||
LLGestureMgr::instance().startFetch();
|
||||
}
|
||||
}
|
||||
gDisplaySwapBuffers = TRUE;
|
||||
@@ -2646,10 +2646,11 @@ bool idle_startup()
|
||||
LLViewerParcelMedia::loadDomainFilterList();
|
||||
|
||||
// Let the map know about the inventory.
|
||||
if(gFloaterWorldMap)
|
||||
LLFloaterWorldMap* floater_world_map = gFloaterWorldMap;
|
||||
if(floater_world_map)
|
||||
{
|
||||
gFloaterWorldMap->observeInventory(&gInventory);
|
||||
gFloaterWorldMap->observeFriends();
|
||||
floater_world_map->observeInventory(&gInventory);
|
||||
floater_world_map->observeFriends();
|
||||
}
|
||||
|
||||
// Start the AO now that settings have loaded and login successful -- MC
|
||||
@@ -2735,332 +2736,6 @@ bool idle_startup()
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool process_login_success_response(std::string& password)
|
||||
{
|
||||
LLSD response = LLUserAuth::getInstance()->getResponse();
|
||||
|
||||
std::string text(response["udp_blacklist"]);
|
||||
if(!text.empty())
|
||||
{
|
||||
apply_udp_blacklist(text);
|
||||
}
|
||||
|
||||
// unpack login data needed by the application
|
||||
text = response["agent_id"].asString();
|
||||
if(!text.empty()) gAgentID.set(text);
|
||||
gDebugInfo["AgentID"] = text;
|
||||
|
||||
text = response["session_id"].asString();
|
||||
if(!text.empty()) gAgentSessionID.set(text);
|
||||
gDebugInfo["SessionID"] = text;
|
||||
|
||||
text = response["secure_session_id"].asString();
|
||||
if(!text.empty()) gAgent.mSecureSessionID.set(text);
|
||||
|
||||
std::string firstname;
|
||||
std::string lastname;
|
||||
text = response["first_name"].asString();
|
||||
if(!text.empty())
|
||||
{
|
||||
// Remove quotes from string. Login.cgi sends these to force
|
||||
// names that look like numbers into strings.
|
||||
firstname.assign(text);
|
||||
LLStringUtil::replaceChar(firstname, '"', ' ');
|
||||
LLStringUtil::trim(firstname);
|
||||
}
|
||||
text = response["last_name"].asString();
|
||||
if(!text.empty()) lastname.assign(text);
|
||||
gSavedSettings.setString("FirstName", firstname);
|
||||
gSavedSettings.setString("LastName", lastname);
|
||||
// <edit>
|
||||
gFullName = utf8str_tolower(firstname + " " + lastname);
|
||||
// </edit>
|
||||
|
||||
if (gSavedSettings.getBOOL("RememberPassword"))
|
||||
{
|
||||
// Successful login means the password is valid, so save it.
|
||||
LLStartUp::savePasswordToDisk(password);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Don't leave password from previous session sitting around
|
||||
// during this login session.
|
||||
LLStartUp::deletePasswordFromDisk();
|
||||
password.assign(""); // clear the password so it isn't saved to login history either
|
||||
}
|
||||
|
||||
{
|
||||
// Save the login history data to disk
|
||||
std::string history_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "saved_logins_sg2.xml");
|
||||
|
||||
LLSavedLogins history_data = LLSavedLogins::loadFile(history_file);
|
||||
std::string grid_nick = gHippoGridManager->getConnectedGrid()->getGridName();
|
||||
history_data.deleteEntry(firstname, lastname, grid_nick);
|
||||
if (gSavedSettings.getBOOL("RememberLogin"))
|
||||
{
|
||||
LLSavedLoginEntry login_entry(firstname, lastname, password, grid_nick);
|
||||
history_data.addEntry(login_entry);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Clear the old-style login data as well
|
||||
gSavedSettings.setString("FirstName", std::string(""));
|
||||
gSavedSettings.setString("LastName", std::string(""));
|
||||
}
|
||||
|
||||
LLSavedLogins::saveFile(history_data, history_file);
|
||||
}
|
||||
|
||||
// this is their actual ability to access content
|
||||
text = response["agent_access_max"].asString();
|
||||
if (!text.empty())
|
||||
{
|
||||
// agent_access can be 'A', 'M', and 'PG'.
|
||||
gAgent.setMaturity(text[0]);
|
||||
}
|
||||
|
||||
// this is the value of their preference setting for that content
|
||||
// which will always be <= agent_access_max
|
||||
text = response["agent_region_access"].asString();
|
||||
if (!text.empty())
|
||||
{
|
||||
U32 preferredMaturity = (U32)LLAgent::convertTextToMaturity(text[0]);
|
||||
|
||||
gSavedSettings.setU32("PreferredMaturity", preferredMaturity);
|
||||
}
|
||||
// During the AO transition, this flag will be true. Then the flag will
|
||||
// go away. After the AO transition, this code and all the code that
|
||||
// uses it can be deleted.
|
||||
text = response["ao_transition"].asString();
|
||||
if (!text.empty())
|
||||
{
|
||||
if (text == "1")
|
||||
{
|
||||
gAgent.setAOTransition();
|
||||
}
|
||||
}
|
||||
|
||||
text = response["start_location"].asString();
|
||||
if(!text.empty())
|
||||
{
|
||||
gAgentStartLocation.assign(text);
|
||||
}
|
||||
|
||||
text = response["circuit_code"].asString();
|
||||
if(!text.empty())
|
||||
{
|
||||
gMessageSystem->mOurCircuitCode = strtoul(text.c_str(), NULL, 10);
|
||||
}
|
||||
std::string sim_ip_str = response["sim_ip"];
|
||||
std::string sim_port_str = response["sim_port"];
|
||||
if(!sim_ip_str.empty() && !sim_port_str.empty())
|
||||
{
|
||||
U32 sim_port = strtoul(sim_port_str.c_str(), NULL, 10);
|
||||
gFirstSim.set(sim_ip_str, sim_port);
|
||||
if (gFirstSim.isOk())
|
||||
{
|
||||
gMessageSystem->enableCircuit(gFirstSim, TRUE);
|
||||
}
|
||||
}
|
||||
std::string region_x_str = response["region_x"];
|
||||
std::string region_y_str = response["region_y"];
|
||||
if(!region_x_str.empty() && !region_y_str.empty())
|
||||
{
|
||||
U32 region_x = strtoul(region_x_str.c_str(), NULL, 10);
|
||||
U32 region_y = strtoul(region_y_str.c_str(), NULL, 10);
|
||||
gFirstSimHandle = to_region_handle(region_x, region_y);
|
||||
}
|
||||
|
||||
const std::string look_at_str = response["look_at"];
|
||||
if (!look_at_str.empty())
|
||||
{
|
||||
size_t len = look_at_str.size();
|
||||
LLMemoryStream mstr((U8*)look_at_str.c_str(), len);
|
||||
LLSD sd = LLSDSerialize::fromNotation(mstr, len);
|
||||
gAgentStartLookAt = ll_vector3_from_sd(sd);
|
||||
}
|
||||
|
||||
text = response["seed_capability"].asString();
|
||||
if (!text.empty()) gFirstSimSeedCap = text;
|
||||
|
||||
text = response["seconds_since_epoch"].asString();
|
||||
if(!text.empty())
|
||||
{
|
||||
U32 server_utc_time = strtoul(text.c_str(), NULL, 10);
|
||||
if(server_utc_time)
|
||||
{
|
||||
time_t now = time(NULL);
|
||||
gUTCOffset = (server_utc_time - now);
|
||||
}
|
||||
}
|
||||
|
||||
std::string home_location = response["home"];
|
||||
if(!home_location.empty())
|
||||
{
|
||||
size_t len = home_location.size();
|
||||
LLMemoryStream mstr((U8*)home_location.c_str(), len);
|
||||
LLSD sd = LLSDSerialize::fromNotation(mstr, len);
|
||||
S32 region_x = sd["region_handle"][0].asInteger();
|
||||
S32 region_y = sd["region_handle"][1].asInteger();
|
||||
U64 region_handle = to_region_handle(region_x, region_y);
|
||||
LLVector3 position = ll_vector3_from_sd(sd["position"]);
|
||||
gAgent.setHomePosRegion(region_handle, position);
|
||||
}
|
||||
|
||||
gAgent.mMOTD.assign(response["message"]);
|
||||
|
||||
// Options...
|
||||
// Each 'option' is an array of submaps.
|
||||
// It appears that we only ever use the first element of the array.
|
||||
LLUUID inv_root_folder_id = response["inventory-root"][0]["folder_id"];
|
||||
if(inv_root_folder_id.notNull())
|
||||
{
|
||||
gInventory.setRootFolderID(inv_root_folder_id);
|
||||
//gInventory.mock(gAgent.getInventoryRootID());
|
||||
}
|
||||
|
||||
LLSD login_flags = response["login-flags"][0];
|
||||
if(login_flags.size())
|
||||
{
|
||||
std::string flag = login_flags["ever_logged_in"];
|
||||
if(!flag.empty())
|
||||
{
|
||||
gAgent.setFirstLogin((flag == "N") ? TRUE : FALSE);
|
||||
}
|
||||
|
||||
/* Flag is currently ignored by the viewer.
|
||||
flag = login_flags["stipend_since_login"];
|
||||
if(flag == "Y")
|
||||
{
|
||||
stipend_since_login = true;
|
||||
}
|
||||
*/
|
||||
|
||||
flag = login_flags["gendered"].asString();
|
||||
if(flag == "Y")
|
||||
{
|
||||
gAgent.setGenderChosen(TRUE);
|
||||
}
|
||||
|
||||
flag = login_flags["daylight_savings"].asString();
|
||||
if(flag == "Y")
|
||||
{
|
||||
gPacificDaylightTime = (flag == "Y");
|
||||
}
|
||||
}
|
||||
std::string map_server_url = response["map-server-url"];
|
||||
if(!map_server_url.empty())
|
||||
{
|
||||
gSavedSettings.setString("MapServerURL", map_server_url);
|
||||
LLWorldMap::gotMapServerURL(true);
|
||||
}
|
||||
// Initial outfit for the user.
|
||||
LLSD initial_outfit = response["initial-outfit"][0];
|
||||
if(initial_outfit.size())
|
||||
{
|
||||
std::string flag = initial_outfit["folder_name"];
|
||||
if(!flag.empty())
|
||||
{
|
||||
// Initial outfit is a folder in your inventory,
|
||||
// must be an exact folder-name match.
|
||||
sInitialOutfit = flag;
|
||||
}
|
||||
|
||||
flag = initial_outfit["gender"].asString();
|
||||
if(!flag.empty())
|
||||
{
|
||||
sInitialOutfitGender = flag;
|
||||
}
|
||||
}
|
||||
|
||||
LLSD global_textures = response["global-textures"][0];
|
||||
if(global_textures.size())
|
||||
{
|
||||
// Extract sun and moon texture IDs. These are used
|
||||
// in the LLVOSky constructor, but I can't figure out
|
||||
// how to pass them in. JC
|
||||
LLUUID id = global_textures["sun_texture_id"];
|
||||
if(id.notNull())
|
||||
{
|
||||
gSunTextureID = id;
|
||||
}
|
||||
|
||||
id = global_textures["moon_texture_id"];
|
||||
if(id.notNull())
|
||||
{
|
||||
gMoonTextureID = id;
|
||||
}
|
||||
|
||||
id = global_textures["cloud_texture_id"];
|
||||
if(id.notNull())
|
||||
{
|
||||
gCloudTextureID = id;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Override grid info with anything sent in the login response
|
||||
std::string tmp = response["gridname"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setGridName(tmp);
|
||||
tmp = response["loginuri"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginUri(tmp);
|
||||
tmp = response["welcome"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp);
|
||||
tmp = response["loginpage"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp);
|
||||
tmp = response["economy"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp);
|
||||
tmp = response["helperuri"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp);
|
||||
tmp = response["about"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp);
|
||||
tmp = response["website"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp);
|
||||
tmp = response["help"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp);
|
||||
tmp = response["support"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp);
|
||||
tmp = response["register"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp);
|
||||
tmp = response["account"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp);
|
||||
tmp = response["password"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setPasswordUrl(tmp);
|
||||
tmp = response["search"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSearchUrl(tmp);
|
||||
tmp = response["currency"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setCurrencySymbol(tmp);
|
||||
tmp = response["real_currency"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRealCurrencySymbol(tmp);
|
||||
tmp = response["directory_fee"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setDirectoryFee(atoi(tmp.c_str()));
|
||||
tmp = response["max_groups"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setMaxAgentGroups(atoi(tmp.c_str()));
|
||||
tmp = response["max-agent-groups"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setMaxAgentGroups(atoi(tmp.c_str()));
|
||||
tmp = response["VoiceConnector"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setVoiceConnector(tmp);
|
||||
gHippoGridManager->saveFile();
|
||||
gHippoLimits->setLimits();
|
||||
|
||||
gIMMgr->loadIgnoreGroup();
|
||||
|
||||
bool success = false;
|
||||
// JC: gesture loading done below, when we have an asset system
|
||||
// in place. Don't delete/clear user_credentials until then.
|
||||
|
||||
if(gAgentID.notNull()
|
||||
&& gAgentSessionID.notNull()
|
||||
&& gMessageSystem->mOurCircuitCode
|
||||
&& gFirstSim.isOk()
|
||||
&& gInventory.getRootFolderID().notNull())
|
||||
{
|
||||
success = true;
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// local function definition
|
||||
@@ -4353,3 +4028,327 @@ bool LLStartUp::startLLProxy()
|
||||
|
||||
return proxy_ok;
|
||||
}
|
||||
bool process_login_success_response(std::string& password)
|
||||
{
|
||||
LLSD response = LLUserAuth::getInstance()->getResponse();
|
||||
|
||||
std::string text(response["udp_blacklist"]);
|
||||
if(!text.empty())
|
||||
{
|
||||
apply_udp_blacklist(text);
|
||||
}
|
||||
|
||||
// unpack login data needed by the application
|
||||
text = response["agent_id"].asString();
|
||||
if(!text.empty()) gAgentID.set(text);
|
||||
gDebugInfo["AgentID"] = text;
|
||||
|
||||
text = response["session_id"].asString();
|
||||
if(!text.empty()) gAgentSessionID.set(text);
|
||||
gDebugInfo["SessionID"] = text;
|
||||
|
||||
text = response["secure_session_id"].asString();
|
||||
if(!text.empty()) gAgent.mSecureSessionID.set(text);
|
||||
|
||||
std::string firstname;
|
||||
std::string lastname;
|
||||
text = response["first_name"].asString();
|
||||
if(!text.empty())
|
||||
{
|
||||
// Remove quotes from string. Login.cgi sends these to force
|
||||
// names that look like numbers into strings.
|
||||
firstname.assign(text);
|
||||
LLStringUtil::replaceChar(firstname, '"', ' ');
|
||||
LLStringUtil::trim(firstname);
|
||||
}
|
||||
text = response["last_name"].asString();
|
||||
if(!text.empty()) lastname.assign(text);
|
||||
gSavedSettings.setString("FirstName", firstname);
|
||||
gSavedSettings.setString("LastName", lastname);
|
||||
// <edit>
|
||||
gFullName = utf8str_tolower(firstname + " " + lastname);
|
||||
// </edit>
|
||||
|
||||
if (gSavedSettings.getBOOL("RememberPassword"))
|
||||
{
|
||||
// Successful login means the password is valid, so save it.
|
||||
LLStartUp::savePasswordToDisk(password);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Don't leave password from previous session sitting around
|
||||
// during this login session.
|
||||
LLStartUp::deletePasswordFromDisk();
|
||||
password.assign(""); // clear the password so it isn't saved to login history either
|
||||
}
|
||||
|
||||
{
|
||||
// Save the login history data to disk
|
||||
std::string history_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "saved_logins_sg2.xml");
|
||||
|
||||
LLSavedLogins history_data = LLSavedLogins::loadFile(history_file);
|
||||
std::string grid_nick = gHippoGridManager->getConnectedGrid()->getGridName();
|
||||
history_data.deleteEntry(firstname, lastname, grid_nick);
|
||||
if (gSavedSettings.getBOOL("RememberLogin"))
|
||||
{
|
||||
LLSavedLoginEntry login_entry(firstname, lastname, password, grid_nick);
|
||||
history_data.addEntry(login_entry);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Clear the old-style login data as well
|
||||
gSavedSettings.setString("FirstName", std::string(""));
|
||||
gSavedSettings.setString("LastName", std::string(""));
|
||||
}
|
||||
|
||||
LLSavedLogins::saveFile(history_data, history_file);
|
||||
}
|
||||
|
||||
// this is their actual ability to access content
|
||||
text = response["agent_access_max"].asString();
|
||||
if (!text.empty())
|
||||
{
|
||||
// agent_access can be 'A', 'M', and 'PG'.
|
||||
gAgent.setMaturity(text[0]);
|
||||
}
|
||||
|
||||
// this is the value of their preference setting for that content
|
||||
// which will always be <= agent_access_max
|
||||
text = response["agent_region_access"].asString();
|
||||
if (!text.empty())
|
||||
{
|
||||
U32 preferredMaturity = (U32)LLAgent::convertTextToMaturity(text[0]);
|
||||
|
||||
gSavedSettings.setU32("PreferredMaturity", preferredMaturity);
|
||||
}
|
||||
// During the AO transition, this flag will be true. Then the flag will
|
||||
// go away. After the AO transition, this code and all the code that
|
||||
// uses it can be deleted.
|
||||
text = response["ao_transition"].asString();
|
||||
if (!text.empty())
|
||||
{
|
||||
if (text == "1")
|
||||
{
|
||||
gAgent.setAOTransition();
|
||||
}
|
||||
}
|
||||
|
||||
text = response["start_location"].asString();
|
||||
if(!text.empty())
|
||||
{
|
||||
gAgentStartLocation.assign(text);
|
||||
}
|
||||
|
||||
text = response["circuit_code"].asString();
|
||||
if(!text.empty())
|
||||
{
|
||||
gMessageSystem->mOurCircuitCode = strtoul(text.c_str(), NULL, 10);
|
||||
}
|
||||
std::string sim_ip_str = response["sim_ip"];
|
||||
std::string sim_port_str = response["sim_port"];
|
||||
if(!sim_ip_str.empty() && !sim_port_str.empty())
|
||||
{
|
||||
U32 sim_port = strtoul(sim_port_str.c_str(), NULL, 10);
|
||||
gFirstSim.set(sim_ip_str, sim_port);
|
||||
if (gFirstSim.isOk())
|
||||
{
|
||||
gMessageSystem->enableCircuit(gFirstSim, TRUE);
|
||||
}
|
||||
}
|
||||
std::string region_x_str = response["region_x"];
|
||||
std::string region_y_str = response["region_y"];
|
||||
if(!region_x_str.empty() && !region_y_str.empty())
|
||||
{
|
||||
U32 region_x = strtoul(region_x_str.c_str(), NULL, 10);
|
||||
U32 region_y = strtoul(region_y_str.c_str(), NULL, 10);
|
||||
gFirstSimHandle = to_region_handle(region_x, region_y);
|
||||
}
|
||||
|
||||
const std::string look_at_str = response["look_at"];
|
||||
if (!look_at_str.empty())
|
||||
{
|
||||
size_t len = look_at_str.size();
|
||||
LLMemoryStream mstr((U8*)look_at_str.c_str(), len);
|
||||
LLSD sd = LLSDSerialize::fromNotation(mstr, len);
|
||||
gAgentStartLookAt = ll_vector3_from_sd(sd);
|
||||
}
|
||||
|
||||
text = response["seed_capability"].asString();
|
||||
if (!text.empty()) gFirstSimSeedCap = text;
|
||||
|
||||
text = response["seconds_since_epoch"].asString();
|
||||
if(!text.empty())
|
||||
{
|
||||
U32 server_utc_time = strtoul(text.c_str(), NULL, 10);
|
||||
if(server_utc_time)
|
||||
{
|
||||
time_t now = time(NULL);
|
||||
gUTCOffset = (server_utc_time - now);
|
||||
}
|
||||
}
|
||||
|
||||
std::string home_location = response["home"];
|
||||
if(!home_location.empty())
|
||||
{
|
||||
size_t len = home_location.size();
|
||||
LLMemoryStream mstr((U8*)home_location.c_str(), len);
|
||||
LLSD sd = LLSDSerialize::fromNotation(mstr, len);
|
||||
S32 region_x = sd["region_handle"][0].asInteger();
|
||||
S32 region_y = sd["region_handle"][1].asInteger();
|
||||
U64 region_handle = to_region_handle(region_x, region_y);
|
||||
LLVector3 position = ll_vector3_from_sd(sd["position"]);
|
||||
gAgent.setHomePosRegion(region_handle, position);
|
||||
}
|
||||
|
||||
gAgent.mMOTD.assign(response["message"]);
|
||||
|
||||
// Options...
|
||||
// Each 'option' is an array of submaps.
|
||||
// It appears that we only ever use the first element of the array.
|
||||
LLUUID inv_root_folder_id = response["inventory-root"][0]["folder_id"];
|
||||
if(inv_root_folder_id.notNull())
|
||||
{
|
||||
gInventory.setRootFolderID(inv_root_folder_id);
|
||||
//gInventory.mock(gAgent.getInventoryRootID());
|
||||
}
|
||||
|
||||
LLSD login_flags = response["login-flags"][0];
|
||||
if(login_flags.size())
|
||||
{
|
||||
std::string flag = login_flags["ever_logged_in"];
|
||||
if(!flag.empty())
|
||||
{
|
||||
gAgent.setFirstLogin((flag == "N") ? TRUE : FALSE);
|
||||
}
|
||||
|
||||
/* Flag is currently ignored by the viewer.
|
||||
flag = login_flags["stipend_since_login"];
|
||||
if(flag == "Y")
|
||||
{
|
||||
stipend_since_login = true;
|
||||
}
|
||||
*/
|
||||
|
||||
flag = login_flags["gendered"].asString();
|
||||
if(flag == "Y")
|
||||
{
|
||||
gAgent.setGenderChosen(TRUE);
|
||||
}
|
||||
|
||||
flag = login_flags["daylight_savings"].asString();
|
||||
if(flag == "Y")
|
||||
{
|
||||
gPacificDaylightTime = (flag == "Y");
|
||||
}
|
||||
}
|
||||
std::string map_server_url = response["map-server-url"];
|
||||
if(!map_server_url.empty())
|
||||
{
|
||||
gSavedSettings.setString("MapServerURL", map_server_url);
|
||||
LLWorldMap::gotMapServerURL(true);
|
||||
}
|
||||
// Initial outfit for the user.
|
||||
LLSD initial_outfit = response["initial-outfit"][0];
|
||||
if(initial_outfit.size())
|
||||
{
|
||||
std::string flag = initial_outfit["folder_name"];
|
||||
if(!flag.empty())
|
||||
{
|
||||
// Initial outfit is a folder in your inventory,
|
||||
// must be an exact folder-name match.
|
||||
sInitialOutfit = flag;
|
||||
}
|
||||
|
||||
flag = initial_outfit["gender"].asString();
|
||||
if(!flag.empty())
|
||||
{
|
||||
sInitialOutfitGender = flag;
|
||||
}
|
||||
}
|
||||
|
||||
LLSD global_textures = response["global-textures"][0];
|
||||
if(global_textures.size())
|
||||
{
|
||||
// Extract sun and moon texture IDs. These are used
|
||||
// in the LLVOSky constructor, but I can't figure out
|
||||
// how to pass them in. JC
|
||||
LLUUID id = global_textures["sun_texture_id"];
|
||||
if(id.notNull())
|
||||
{
|
||||
gSunTextureID = id;
|
||||
}
|
||||
|
||||
id = global_textures["moon_texture_id"];
|
||||
if(id.notNull())
|
||||
{
|
||||
gMoonTextureID = id;
|
||||
}
|
||||
|
||||
id = global_textures["cloud_texture_id"];
|
||||
if(id.notNull())
|
||||
{
|
||||
gCloudTextureID = id;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Override grid info with anything sent in the login response
|
||||
std::string tmp = response["gridname"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setGridName(tmp);
|
||||
tmp = response["loginuri"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginUri(tmp);
|
||||
tmp = response["welcome"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp);
|
||||
tmp = response["loginpage"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp);
|
||||
tmp = response["economy"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp);
|
||||
tmp = response["helperuri"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp);
|
||||
tmp = response["about"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp);
|
||||
tmp = response["website"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp);
|
||||
tmp = response["help"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp);
|
||||
tmp = response["support"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp);
|
||||
tmp = response["register"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp);
|
||||
tmp = response["account"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp);
|
||||
tmp = response["password"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setPasswordUrl(tmp);
|
||||
tmp = response["search"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSearchUrl(tmp);
|
||||
tmp = response["currency"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setCurrencySymbol(tmp);
|
||||
tmp = response["real_currency"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRealCurrencySymbol(tmp);
|
||||
tmp = response["directory_fee"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setDirectoryFee(atoi(tmp.c_str()));
|
||||
tmp = response["max_groups"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setMaxAgentGroups(atoi(tmp.c_str()));
|
||||
tmp = response["max-agent-groups"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setMaxAgentGroups(atoi(tmp.c_str()));
|
||||
tmp = response["VoiceConnector"];
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setVoiceConnector(tmp);
|
||||
gHippoGridManager->saveFile();
|
||||
gHippoLimits->setLimits();
|
||||
|
||||
gIMMgr->loadIgnoreGroup();
|
||||
|
||||
bool success = false;
|
||||
// JC: gesture loading done below, when we have an asset system
|
||||
// in place. Don't delete/clear user_credentials until then.
|
||||
|
||||
if(gAgentID.notNull()
|
||||
&& gAgentSessionID.notNull()
|
||||
&& gMessageSystem->mOurCircuitCode
|
||||
&& gFirstSim.isOk()
|
||||
&& gInventory.getRootFolderID().notNull())
|
||||
{
|
||||
success = true;
|
||||
}
|
||||
return success;
|
||||
}
|
||||
@@ -171,14 +171,12 @@ void LLToolCamera::pickCallback(const LLPickInfo& pick_info)
|
||||
BOOL good_customize_avatar_hit = FALSE;
|
||||
if( hit_obj )
|
||||
{
|
||||
LLVOAvatar* avatar = gAgentAvatarp;
|
||||
if( hit_obj == avatar)
|
||||
if (isAgentAvatarValid() && (hit_obj == gAgentAvatarp))
|
||||
{
|
||||
// It's you
|
||||
good_customize_avatar_hit = TRUE;
|
||||
}
|
||||
else
|
||||
if( hit_obj->isAttachment() && hit_obj->permYouOwner() )
|
||||
else if (hit_obj->isAttachment() && hit_obj->permYouOwner())
|
||||
{
|
||||
// It's an attachment that you're wearing
|
||||
good_customize_avatar_hit = TRUE;
|
||||
@@ -361,7 +359,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
|
||||
// Orbit tool
|
||||
if (hasMouseCapture())
|
||||
{
|
||||
const F32 RADIANS_PER_PIXEL = 360.f * DEG_TO_RAD / gViewerWindow->getWindowWidth();
|
||||
const F32 RADIANS_PER_PIXEL = 360.f * DEG_TO_RAD / gViewerWindow->getWorldViewWidthScaled();
|
||||
|
||||
if (dx != 0)
|
||||
{
|
||||
@@ -389,7 +387,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
|
||||
F32 dist = (F32) camera_to_focus.normVec();
|
||||
|
||||
// Fudge factor for pan
|
||||
F32 meters_per_pixel = 3.f * dist / gViewerWindow->getWindowWidth();
|
||||
F32 meters_per_pixel = 3.f * dist / gViewerWindow->getWorldViewWidthScaled();
|
||||
|
||||
if (dx != 0)
|
||||
{
|
||||
@@ -411,7 +409,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
|
||||
if (hasMouseCapture())
|
||||
{
|
||||
|
||||
const F32 RADIANS_PER_PIXEL = 360.f * DEG_TO_RAD / gViewerWindow->getWindowWidth();
|
||||
const F32 RADIANS_PER_PIXEL = 360.f * DEG_TO_RAD / gViewerWindow->getWorldViewWidthScaled();
|
||||
|
||||
if (dx != 0)
|
||||
{
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file lltoolgrab.cpp
|
||||
* @brief LLToolGrab class implementation
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
@@ -394,22 +388,7 @@ void LLToolGrab::startGrab()
|
||||
mDragStartPointGlobal = grab_start_global;
|
||||
mDragStartFromCamera = grab_start_global - gAgentCamera.getCameraPositionGlobal();
|
||||
|
||||
LLMessageSystem *msg = gMessageSystem;
|
||||
msg->newMessageFast(_PREHASH_ObjectGrab);
|
||||
msg->nextBlockFast(_PREHASH_AgentData);
|
||||
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
|
||||
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
|
||||
msg->nextBlockFast(_PREHASH_ObjectData);
|
||||
msg->addU32Fast(_PREHASH_LocalID, objectp->mLocalID);
|
||||
msg->addVector3Fast(_PREHASH_GrabOffset, grab_offset );
|
||||
msg->nextBlock("SurfaceInfo");
|
||||
msg->addVector3("UVCoord", LLVector3(mGrabPick.mUVCoords));
|
||||
msg->addVector3("STCoord", LLVector3(mGrabPick.mSTCoords));
|
||||
msg->addS32Fast(_PREHASH_FaceIndex, mGrabPick.mObjectFace);
|
||||
msg->addVector3("Position", mGrabPick.mIntersection);
|
||||
msg->addVector3("Normal", mGrabPick.mNormal);
|
||||
msg->addVector3("Binormal", mGrabPick.mBinormal);
|
||||
msg->sendMessage( objectp->getRegion()->getHost());
|
||||
send_ObjectGrab_message(objectp, mGrabPick, grab_offset);
|
||||
|
||||
mGrabOffsetFromCenterInitial = grab_offset;
|
||||
mGrabHiddenOffsetFromCamera = mDragStartFromCamera;
|
||||
@@ -534,8 +513,8 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask)
|
||||
const F32 RADIANS_PER_PIXEL_X = 0.01f;
|
||||
const F32 RADIANS_PER_PIXEL_Y = 0.01f;
|
||||
|
||||
S32 dx = x - (gViewerWindow->getWindowWidth() / 2);
|
||||
S32 dy = y - (gViewerWindow->getWindowHeight() / 2);
|
||||
S32 dx = x - (gViewerWindow->getWorldViewWidthScaled() / 2);
|
||||
S32 dy = y - (gViewerWindow->getWorldViewHeightScaled() / 2);
|
||||
|
||||
if (dx != 0 || dy != 0)
|
||||
{
|
||||
@@ -655,10 +634,10 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask)
|
||||
// Handle auto-rotation at screen edge.
|
||||
LLVector3 grab_pos_agent = gAgent.getPosAgentFromGlobal( grab_point_global );
|
||||
|
||||
LLCoordGL grab_center_gl( gViewerWindow->getWindowWidth() / 2, gViewerWindow->getWindowHeight() / 2);
|
||||
LLCoordGL grab_center_gl( gViewerWindow->getWorldViewWidthScaled() / 2, gViewerWindow->getWorldViewHeightScaled() / 2);
|
||||
LLViewerCamera::getInstance()->projectPosAgentToScreen(grab_pos_agent, grab_center_gl);
|
||||
|
||||
const S32 ROTATE_H_MARGIN = gViewerWindow->getWindowWidth() / 20;
|
||||
const S32 ROTATE_H_MARGIN = gViewerWindow->getWorldViewWidthScaled() / 20;
|
||||
const F32 ROTATE_ANGLE_PER_SECOND = 30.f * DEG_TO_RAD;
|
||||
const F32 rotate_angle = ROTATE_ANGLE_PER_SECOND / gFPSClamped;
|
||||
// ...build mode moves camera about focus point
|
||||
@@ -673,7 +652,7 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask)
|
||||
gAgentCamera.cameraOrbitAround(rotate_angle);
|
||||
}
|
||||
}
|
||||
else if (grab_center_gl.mX > gViewerWindow->getWindowWidth() - ROTATE_H_MARGIN)
|
||||
else if (grab_center_gl.mX > gViewerWindow->getWorldViewWidthScaled() - ROTATE_H_MARGIN)
|
||||
{
|
||||
if (gAgentCamera.getFocusOnAvatar())
|
||||
{
|
||||
@@ -686,7 +665,7 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask)
|
||||
}
|
||||
|
||||
// Don't move above top of screen or below bottom
|
||||
if ((grab_center_gl.mY < gViewerWindow->getWindowHeight() - 6)
|
||||
if ((grab_center_gl.mY < gViewerWindow->getWorldViewHeightScaled() - 6)
|
||||
&& (grab_center_gl.mY > 24))
|
||||
{
|
||||
// Transmit update to simulator
|
||||
@@ -1082,28 +1061,12 @@ void LLToolGrab::stopGrab()
|
||||
}
|
||||
|
||||
// Next, send messages to simulator
|
||||
LLMessageSystem *msg = gMessageSystem;
|
||||
switch(mMode)
|
||||
{
|
||||
case GRAB_ACTIVE_CENTER:
|
||||
case GRAB_NONPHYSICAL:
|
||||
case GRAB_LOCKED:
|
||||
msg->newMessageFast(_PREHASH_ObjectDeGrab);
|
||||
msg->nextBlockFast(_PREHASH_AgentData);
|
||||
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
|
||||
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
|
||||
msg->nextBlockFast(_PREHASH_ObjectData);
|
||||
msg->addU32Fast(_PREHASH_LocalID, objectp->mLocalID);
|
||||
msg->nextBlock("SurfaceInfo");
|
||||
msg->addVector3("UVCoord", LLVector3(pick.mUVCoords));
|
||||
msg->addVector3("STCoord", LLVector3(pick.mSTCoords));
|
||||
msg->addS32Fast(_PREHASH_FaceIndex, pick.mObjectFace);
|
||||
msg->addVector3("Position", pick.mIntersection);
|
||||
msg->addVector3("Normal", pick.mNormal);
|
||||
msg->addVector3("Binormal", pick.mBinormal);
|
||||
|
||||
msg->sendMessage(objectp->getRegion()->getHost());
|
||||
|
||||
send_ObjectDeGrab_message(objectp, pick);
|
||||
mVerticalDragging = FALSE;
|
||||
break;
|
||||
|
||||
@@ -1155,3 +1118,62 @@ LLVector3d LLToolGrab::getGrabPointGlobal()
|
||||
return gAgent.getPositionGlobal();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void send_ObjectGrab_message(LLViewerObject* object, const LLPickInfo & pick, const LLVector3 &grab_offset)
|
||||
{
|
||||
if (!object) return;
|
||||
|
||||
LLMessageSystem *msg = gMessageSystem;
|
||||
|
||||
msg->newMessageFast(_PREHASH_ObjectGrab);
|
||||
msg->nextBlockFast(_PREHASH_AgentData);
|
||||
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
|
||||
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
|
||||
msg->nextBlockFast( _PREHASH_ObjectData);
|
||||
msg->addU32Fast( _PREHASH_LocalID, object->mLocalID);
|
||||
msg->addVector3Fast(_PREHASH_GrabOffset, grab_offset);
|
||||
msg->nextBlock("SurfaceInfo");
|
||||
msg->addVector3("UVCoord", LLVector3(pick.mUVCoords));
|
||||
msg->addVector3("STCoord", LLVector3(pick.mSTCoords));
|
||||
msg->addS32Fast(_PREHASH_FaceIndex, pick.mObjectFace);
|
||||
msg->addVector3("Position", pick.mIntersection);
|
||||
msg->addVector3("Normal", pick.mNormal);
|
||||
msg->addVector3("Binormal", pick.mBinormal);
|
||||
msg->sendMessage( object->getRegion()->getHost());
|
||||
|
||||
/* Diagnostic code
|
||||
llinfos << "mUVCoords: " << pick.mUVCoords
|
||||
<< ", mSTCoords: " << pick.mSTCoords
|
||||
<< ", mObjectFace: " << pick.mObjectFace
|
||||
<< ", mIntersection: " << pick.mIntersection
|
||||
<< ", mNormal: " << pick.mNormal
|
||||
<< ", mBinormal: " << pick.mBinormal
|
||||
<< llendl;
|
||||
|
||||
llinfos << "Avatar pos: " << gAgent.getPositionAgent() << llendl;
|
||||
llinfos << "Object pos: " << object->getPosition() << llendl;
|
||||
*/
|
||||
}
|
||||
|
||||
void send_ObjectDeGrab_message(LLViewerObject* object, const LLPickInfo & pick)
|
||||
{
|
||||
if (!object) return;
|
||||
|
||||
LLMessageSystem *msg = gMessageSystem;
|
||||
|
||||
msg->newMessageFast(_PREHASH_ObjectDeGrab);
|
||||
msg->nextBlockFast(_PREHASH_AgentData);
|
||||
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
|
||||
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
|
||||
msg->nextBlockFast(_PREHASH_ObjectData);
|
||||
msg->addU32Fast(_PREHASH_LocalID, object->mLocalID);
|
||||
msg->nextBlock("SurfaceInfo");
|
||||
msg->addVector3("UVCoord", LLVector3(pick.mUVCoords));
|
||||
msg->addVector3("STCoord", LLVector3(pick.mSTCoords));
|
||||
msg->addS32Fast(_PREHASH_FaceIndex, pick.mObjectFace);
|
||||
msg->addVector3("Position", pick.mIntersection);
|
||||
msg->addVector3("Normal", pick.mNormal);
|
||||
msg->addVector3("Binormal", pick.mBinormal);
|
||||
msg->sendMessage(object->getRegion()->getHost());
|
||||
}
|
||||
|
||||
@@ -2,31 +2,25 @@
|
||||
* @file lltoolgrab.h
|
||||
* @brief LLToolGrab class header file
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
* 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.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* 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.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* 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$
|
||||
*/
|
||||
|
||||
@@ -45,6 +39,13 @@ class LLTextBox;
|
||||
class LLViewerObject;
|
||||
class LLPickInfo;
|
||||
|
||||
|
||||
// Message utilities
|
||||
void send_ObjectGrab_message(LLViewerObject* object, const LLPickInfo & pick, const LLVector3 &grab_offset);
|
||||
void send_ObjectDeGrab_message(LLViewerObject* object, const LLPickInfo & pick);
|
||||
|
||||
|
||||
|
||||
class LLToolGrab : public LLTool, public LLSingleton<LLToolGrab>
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -65,8 +65,7 @@ LLToolContainer::~LLToolContainer()
|
||||
|
||||
|
||||
LLToolView::LLToolView(const std::string& name, const LLRect& rect)
|
||||
: LLView(name, rect, MOUSE_OPAQUE),
|
||||
mButtonCount(0)
|
||||
: mButtonCount(0), LLView(name, rect, true)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -189,6 +189,7 @@ extern LLMap< const LLUUID, LLFloaterAvatarInfo* > gAvatarInfoInstances; // Only
|
||||
//
|
||||
const F32 BIRD_AUDIBLE_RADIUS = 32.0f;
|
||||
const F32 SIT_DISTANCE_FROM_TARGET = 0.25f;
|
||||
const F32 CAMERA_POSITION_THRESHOLD_SQUARED = 0.001f * 0.001f;
|
||||
static const F32 LOGOUT_REPLY_TIME = 3.f; // Wait this long after LogoutReply before quitting.
|
||||
|
||||
// Determine how quickly residents' scripts can issue question dialogs
|
||||
@@ -1355,20 +1356,12 @@ bool highlight_offered_object(const LLUUID& obj_id)
|
||||
|
||||
void inventory_offer_mute_callback(const LLUUID& blocked_id,
|
||||
const std::string& full_name,
|
||||
bool is_group )
|
||||
bool is_group)
|
||||
{
|
||||
std::string from_name = full_name;
|
||||
LLMute::EType type;
|
||||
if (is_group)
|
||||
{
|
||||
type = LLMute::GROUP;
|
||||
}
|
||||
else
|
||||
{
|
||||
type = LLMute::AGENT;
|
||||
}
|
||||
// *NOTE: blocks owner if the offer came from an object
|
||||
LLMute::EType mute_type = is_group ? LLMute::GROUP : LLMute::AGENT;
|
||||
|
||||
LLMute mute(blocked_id, from_name, type);
|
||||
LLMute mute(blocked_id, full_name, mute_type);
|
||||
if (LLMuteList::getInstance()->add(mute))
|
||||
{
|
||||
LLFloaterMute::showInstance();
|
||||
@@ -3214,8 +3207,8 @@ void process_offer_callingcard(LLMessageSystem* msg, void**)
|
||||
LLNameValue* nvlast = source->getNVPair("LastName");
|
||||
if (nvfirst && nvlast)
|
||||
{
|
||||
source_name = std::string(nvfirst->getString()) + " " + nvlast->getString();
|
||||
args["NAME"] = source_name;
|
||||
args["NAME"] = LLCacheName::buildFullName(
|
||||
nvfirst->getString(), nvlast->getString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4374,6 +4367,7 @@ void process_crossed_region(LLMessageSystem* msg, void**)
|
||||
return;
|
||||
}
|
||||
LL_INFOS("Messaging") << "process_crossed_region()" << LL_ENDL;
|
||||
gAgentAvatarp->resetRegionCrossingTimer();
|
||||
|
||||
U32 sim_ip;
|
||||
msg->getIPAddrFast(_PREHASH_RegionData, _PREHASH_SimIP, sim_ip);
|
||||
@@ -4849,6 +4843,12 @@ void process_sound_trigger(LLMessageSystem *msg, void **)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't play sounds from gestures if they are not enabled.
|
||||
if (object_id == owner_id && !gSavedSettings.getBOOL("EnableGestureSounds"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// <edit>
|
||||
//gAudiop->triggerSound(sound_id, owner_id, gain, LLAudioEngine::AUDIO_TYPE_SFX, pos_global);
|
||||
@@ -5290,7 +5290,7 @@ void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data)
|
||||
BOOL force_mouselook;
|
||||
mesgsys->getBOOLFast(_PREHASH_SitTransform, _PREHASH_ForceMouselook, force_mouselook);
|
||||
|
||||
if (isAgentAvatarValid() && dist_vec_squared(camera_eye, camera_at) > 0.0001f)
|
||||
if (isAgentAvatarValid() && dist_vec_squared(camera_eye, camera_at) > CAMERA_POSITION_THRESHOLD_SQUARED)
|
||||
{
|
||||
gAgentCamera.setSitCamera(sitObjectID, camera_eye, camera_at);
|
||||
}
|
||||
@@ -5693,6 +5693,12 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem)
|
||||
{
|
||||
// notification was specified using the new mechanism, so we can just handle it here
|
||||
std::string notificationID;
|
||||
msgsystem->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, notificationID);
|
||||
if (!LLNotifications::getInstance()->templateExists(notificationID))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string llsdRaw;
|
||||
LLSD llsdBlock;
|
||||
msgsystem->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, notificationID);
|
||||
@@ -6301,7 +6307,7 @@ void container_inventory_arrived(LLViewerObject* object,
|
||||
gAgentCamera.changeCameraToDefault();
|
||||
}
|
||||
|
||||
LLInventoryView* view = LLInventoryView::getActiveInventory();
|
||||
LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel();
|
||||
|
||||
if (inventory->size() > 2)
|
||||
{
|
||||
@@ -6339,9 +6345,9 @@ void container_inventory_arrived(LLViewerObject* object,
|
||||
}
|
||||
}
|
||||
gInventory.notifyObservers();
|
||||
if(view)
|
||||
if(active_panel)
|
||||
{
|
||||
view->getPanel()->setSelection(cat_id, TAKE_FOCUS_NO);
|
||||
active_panel->setSelection(cat_id, TAKE_FOCUS_NO);
|
||||
}
|
||||
}
|
||||
else if (inventory->size() == 2)
|
||||
@@ -6375,9 +6381,9 @@ void container_inventory_arrived(LLViewerObject* object,
|
||||
new_item->updateServer(TRUE);
|
||||
gInventory.updateItem(new_item);
|
||||
gInventory.notifyObservers();
|
||||
if(view)
|
||||
if(active_panel)
|
||||
{
|
||||
view->getPanel()->setSelection(item_id, TAKE_FOCUS_NO);
|
||||
active_panel->setSelection(item_id, TAKE_FOCUS_NO);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5744,17 +5744,13 @@ void LLViewerObject::resetChildrenPosition(const LLVector3& offset, BOOL simplif
|
||||
|
||||
|
||||
// <edit>
|
||||
S32 LLViewerObject::getAttachmentPoint()
|
||||
{
|
||||
return ((S32)((((U8)mState & AGENT_ATTACH_MASK) >> 4) | (((U8)mState & ~AGENT_ATTACH_MASK) << 4)));
|
||||
}
|
||||
|
||||
std::string LLViewerObject::getAttachmentPointName()
|
||||
{
|
||||
S32 point = getAttachmentPoint();
|
||||
if((point > 0) && (point < 39))
|
||||
S32 point = ATTACHMENT_ID_FROM_STATE(mState);
|
||||
LLVOAvatar::attachment_map_t::iterator it = gAgentAvatarp->mAttachmentPoints.find(point);
|
||||
if(it != gAgentAvatarp->mAttachmentPoints.end())
|
||||
{
|
||||
return gAgentAvatarp->mAttachmentPoints[point]->getName();
|
||||
return it->second->getName();
|
||||
}
|
||||
return llformat("unsupported point %d", point);
|
||||
}
|
||||
|
||||
@@ -772,7 +772,6 @@ private:
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
// <edit>
|
||||
S32 getAttachmentPoint();
|
||||
std::string getAttachmentPointName();
|
||||
// </edit>
|
||||
const LLUUID &getAttachmentItemID() const;
|
||||
@@ -788,8 +787,6 @@ private:
|
||||
BOOL mLastUpdateCached;
|
||||
};
|
||||
|
||||
typedef std::vector<LLViewerObject*> llvo_vec_t;
|
||||
|
||||
///////////////////
|
||||
//
|
||||
// Inlines
|
||||
|
||||
@@ -1008,7 +1008,7 @@ void LLViewerParcelMgr::sendParcelGodForceOwner(const LLUUID& owner_id)
|
||||
|
||||
bool callback_god_force_owner(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
S32 option = LLNotification::getSelectedOption(notification, response);
|
||||
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
if(0 == option)
|
||||
{
|
||||
LLMessageSystem* msg = gMessageSystem;
|
||||
@@ -1472,6 +1472,8 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
|
||||
|
||||
S32 other_clean_time = 0;
|
||||
|
||||
LLViewerParcelMgr& parcel_mgr = LLViewerParcelMgr::instance();
|
||||
|
||||
msg->getS32Fast(_PREHASH_ParcelData, _PREHASH_RequestResult, request_result );
|
||||
msg->getS32Fast(_PREHASH_ParcelData, _PREHASH_SequenceID, sequence_id );
|
||||
|
||||
@@ -1487,31 +1489,31 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
|
||||
if (sequence_id == SELECTED_PARCEL_SEQ_ID)
|
||||
{
|
||||
// ...selected parcels report this sequence id
|
||||
LLViewerParcelMgr::getInstance()->mRequestResult = PARCEL_RESULT_SUCCESS;
|
||||
parcel = LLViewerParcelMgr::getInstance()->mCurrentParcel;
|
||||
parcel_mgr.mRequestResult = PARCEL_RESULT_SUCCESS;
|
||||
parcel = parcel_mgr.mCurrentParcel;
|
||||
}
|
||||
else if (sequence_id == HOVERED_PARCEL_SEQ_ID)
|
||||
{
|
||||
LLViewerParcelMgr::getInstance()->mHoverRequestResult = PARCEL_RESULT_SUCCESS;
|
||||
parcel = LLViewerParcelMgr::getInstance()->mHoverParcel;
|
||||
parcel_mgr.mHoverRequestResult = PARCEL_RESULT_SUCCESS;
|
||||
parcel = parcel_mgr.mHoverParcel;
|
||||
}
|
||||
else if (sequence_id == COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID ||
|
||||
sequence_id == COLLISION_NOT_ON_LIST_PARCEL_SEQ_ID ||
|
||||
sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID)
|
||||
{
|
||||
LLViewerParcelMgr::getInstance()->mHoverRequestResult = PARCEL_RESULT_SUCCESS;
|
||||
parcel = LLViewerParcelMgr::getInstance()->mCollisionParcel;
|
||||
parcel_mgr.mHoverRequestResult = PARCEL_RESULT_SUCCESS;
|
||||
parcel = parcel_mgr.mCollisionParcel;
|
||||
}
|
||||
else if (sequence_id == 0 || sequence_id > LLViewerParcelMgr::getInstance()->mAgentParcelSequenceID)
|
||||
else if (sequence_id == 0 || sequence_id > parcel_mgr.mAgentParcelSequenceID)
|
||||
{
|
||||
// new agent parcel
|
||||
LLViewerParcelMgr::getInstance()->mAgentParcelSequenceID = sequence_id;
|
||||
parcel = LLViewerParcelMgr::getInstance()->mAgentParcel;
|
||||
parcel_mgr.mAgentParcelSequenceID = sequence_id;
|
||||
parcel = parcel_mgr.mAgentParcel;
|
||||
}
|
||||
else
|
||||
{
|
||||
llinfos << "out of order agent parcel sequence id " << sequence_id
|
||||
<< " last good " << LLViewerParcelMgr::getInstance()->mAgentParcelSequenceID
|
||||
<< " last good " << parcel_mgr.mAgentParcelSequenceID
|
||||
<< llendl;
|
||||
return;
|
||||
}
|
||||
@@ -1582,15 +1584,15 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
|
||||
parcel->setRegionDenyAgeUnverifiedOverride(region_deny_age_unverified_override);
|
||||
parcel->unpackMessage(msg);
|
||||
|
||||
if (parcel == LLViewerParcelMgr::getInstance()->mAgentParcel)
|
||||
if (parcel == parcel_mgr.mAgentParcel)
|
||||
{
|
||||
S32 bitmap_size = LLViewerParcelMgr::getInstance()->mParcelsPerEdge
|
||||
* LLViewerParcelMgr::getInstance()->mParcelsPerEdge
|
||||
S32 bitmap_size = parcel_mgr.mParcelsPerEdge
|
||||
* parcel_mgr.mParcelsPerEdge
|
||||
/ 8;
|
||||
U8* bitmap = new U8[ bitmap_size ];
|
||||
msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size);
|
||||
|
||||
LLViewerParcelMgr::getInstance()->writeAgentParcelFromBitmap(bitmap);
|
||||
parcel_mgr.writeAgentParcelFromBitmap(bitmap);
|
||||
delete[] bitmap;
|
||||
|
||||
// Let interesting parties know about agent parcel change.
|
||||
@@ -1612,11 +1614,11 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
|
||||
if (sequence_id == SELECTED_PARCEL_SEQ_ID)
|
||||
{
|
||||
// Update selected counts
|
||||
LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mSelectedSelfCount = self_count;
|
||||
LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mSelectedOtherCount = other_count;
|
||||
LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mSelectedPublicCount = public_count;
|
||||
parcel_mgr.mCurrentParcelSelection->mSelectedSelfCount = self_count;
|
||||
parcel_mgr.mCurrentParcelSelection->mSelectedOtherCount = other_count;
|
||||
parcel_mgr.mCurrentParcelSelection->mSelectedPublicCount = public_count;
|
||||
|
||||
LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mSelectedMultipleOwners =
|
||||
parcel_mgr.mCurrentParcelSelection->mSelectedMultipleOwners =
|
||||
(request_result == PARCEL_RESULT_MULTIPLE);
|
||||
|
||||
// Select the whole parcel
|
||||
@@ -1627,67 +1629,67 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
|
||||
{
|
||||
// don't muck with the westsouth and eastnorth.
|
||||
// just highlight it
|
||||
LLVector3 west_south = region->getPosRegionFromGlobal(LLViewerParcelMgr::getInstance()->mWestSouth);
|
||||
LLVector3 east_north = region->getPosRegionFromGlobal(LLViewerParcelMgr::getInstance()->mEastNorth);
|
||||
LLVector3 west_south = region->getPosRegionFromGlobal(parcel_mgr.mWestSouth);
|
||||
LLVector3 east_north = region->getPosRegionFromGlobal(parcel_mgr.mEastNorth);
|
||||
|
||||
LLViewerParcelMgr::getInstance()->resetSegments(LLViewerParcelMgr::getInstance()->mHighlightSegments);
|
||||
LLViewerParcelMgr::getInstance()->writeHighlightSegments(
|
||||
parcel_mgr.resetSegments(parcel_mgr.mHighlightSegments);
|
||||
parcel_mgr.writeHighlightSegments(
|
||||
west_south.mV[VX],
|
||||
west_south.mV[VY],
|
||||
east_north.mV[VX],
|
||||
east_north.mV[VY] );
|
||||
LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mWholeParcelSelected = FALSE;
|
||||
parcel_mgr.mCurrentParcelSelection->mWholeParcelSelected = FALSE;
|
||||
}
|
||||
else if (0 == local_id)
|
||||
{
|
||||
// this is public land, just highlight the selection
|
||||
LLViewerParcelMgr::getInstance()->mWestSouth = region->getPosGlobalFromRegion( aabb_min );
|
||||
LLViewerParcelMgr::getInstance()->mEastNorth = region->getPosGlobalFromRegion( aabb_max );
|
||||
parcel_mgr.mWestSouth = region->getPosGlobalFromRegion( aabb_min );
|
||||
parcel_mgr.mEastNorth = region->getPosGlobalFromRegion( aabb_max );
|
||||
|
||||
LLViewerParcelMgr::getInstance()->resetSegments(LLViewerParcelMgr::getInstance()->mHighlightSegments);
|
||||
LLViewerParcelMgr::getInstance()->writeHighlightSegments(
|
||||
parcel_mgr.resetSegments(parcel_mgr.mHighlightSegments);
|
||||
parcel_mgr.writeHighlightSegments(
|
||||
aabb_min.mV[VX],
|
||||
aabb_min.mV[VY],
|
||||
aabb_max.mV[VX],
|
||||
aabb_max.mV[VY] );
|
||||
LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mWholeParcelSelected = TRUE;
|
||||
parcel_mgr.mCurrentParcelSelection->mWholeParcelSelected = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
LLViewerParcelMgr::getInstance()->mWestSouth = region->getPosGlobalFromRegion( aabb_min );
|
||||
LLViewerParcelMgr::getInstance()->mEastNorth = region->getPosGlobalFromRegion( aabb_max );
|
||||
parcel_mgr.mWestSouth = region->getPosGlobalFromRegion( aabb_min );
|
||||
parcel_mgr.mEastNorth = region->getPosGlobalFromRegion( aabb_max );
|
||||
|
||||
// Owned land, highlight the boundaries
|
||||
S32 bitmap_size = LLViewerParcelMgr::getInstance()->mParcelsPerEdge
|
||||
* LLViewerParcelMgr::getInstance()->mParcelsPerEdge
|
||||
S32 bitmap_size = parcel_mgr.mParcelsPerEdge
|
||||
* parcel_mgr.mParcelsPerEdge
|
||||
/ 8;
|
||||
U8* bitmap = new U8[ bitmap_size ];
|
||||
msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size);
|
||||
|
||||
LLViewerParcelMgr::getInstance()->resetSegments(LLViewerParcelMgr::getInstance()->mHighlightSegments);
|
||||
LLViewerParcelMgr::getInstance()->writeSegmentsFromBitmap( bitmap, LLViewerParcelMgr::getInstance()->mHighlightSegments );
|
||||
parcel_mgr.resetSegments(parcel_mgr.mHighlightSegments);
|
||||
parcel_mgr.writeSegmentsFromBitmap( bitmap, parcel_mgr.mHighlightSegments );
|
||||
|
||||
delete[] bitmap;
|
||||
bitmap = NULL;
|
||||
|
||||
LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mWholeParcelSelected = TRUE;
|
||||
parcel_mgr.mCurrentParcelSelection->mWholeParcelSelected = TRUE;
|
||||
}
|
||||
|
||||
// Request access list information for this land
|
||||
LLViewerParcelMgr::getInstance()->sendParcelAccessListRequest(AL_ACCESS | AL_BAN);
|
||||
parcel_mgr.sendParcelAccessListRequest(AL_ACCESS | AL_BAN);
|
||||
|
||||
// Request the media url filter list for this land
|
||||
LLViewerParcelMgr::getInstance()->requestParcelMediaURLFilter();
|
||||
parcel_mgr.requestParcelMediaURLFilter();
|
||||
|
||||
// Request dwell for this land, if it's not public land.
|
||||
LLViewerParcelMgr::getInstance()->mSelectedDwell = 0.f;
|
||||
parcel_mgr.mSelectedDwell = 0.f;
|
||||
if (0 != local_id)
|
||||
{
|
||||
LLViewerParcelMgr::getInstance()->sendParcelDwellRequest();
|
||||
parcel_mgr.sendParcelDwellRequest();
|
||||
}
|
||||
|
||||
LLViewerParcelMgr::getInstance()->mSelected = TRUE;
|
||||
LLViewerParcelMgr::getInstance()->notifyObservers();
|
||||
parcel_mgr.mSelected = TRUE;
|
||||
parcel_mgr.notifyObservers();
|
||||
}
|
||||
}
|
||||
else if (sequence_id == COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID ||
|
||||
@@ -1695,32 +1697,32 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
|
||||
sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID)
|
||||
{
|
||||
// We're about to collide with this parcel
|
||||
LLViewerParcelMgr::getInstance()->mRenderCollision = TRUE;
|
||||
LLViewerParcelMgr::getInstance()->mCollisionTimer.reset();
|
||||
parcel_mgr.mRenderCollision = TRUE;
|
||||
parcel_mgr.mCollisionTimer.reset();
|
||||
|
||||
// Differentiate this parcel if we are banned from it.
|
||||
if (sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID)
|
||||
{
|
||||
LLViewerParcelMgr::getInstance()->mCollisionBanned = BA_BANNED;
|
||||
parcel_mgr.mCollisionBanned = BA_BANNED;
|
||||
}
|
||||
else if (sequence_id == COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID)
|
||||
{
|
||||
LLViewerParcelMgr::getInstance()->mCollisionBanned = BA_NOT_IN_GROUP;
|
||||
parcel_mgr.mCollisionBanned = BA_NOT_IN_GROUP;
|
||||
}
|
||||
else
|
||||
{
|
||||
LLViewerParcelMgr::getInstance()->mCollisionBanned = BA_NOT_ON_LIST;
|
||||
parcel_mgr.mCollisionBanned = BA_NOT_ON_LIST;
|
||||
|
||||
}
|
||||
|
||||
S32 bitmap_size = LLViewerParcelMgr::getInstance()->mParcelsPerEdge
|
||||
* LLViewerParcelMgr::getInstance()->mParcelsPerEdge
|
||||
S32 bitmap_size = parcel_mgr.mParcelsPerEdge
|
||||
* parcel_mgr.mParcelsPerEdge
|
||||
/ 8;
|
||||
U8* bitmap = new U8[ bitmap_size ];
|
||||
msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size);
|
||||
|
||||
LLViewerParcelMgr::getInstance()->resetSegments(LLViewerParcelMgr::getInstance()->mCollisionSegments);
|
||||
LLViewerParcelMgr::getInstance()->writeSegmentsFromBitmap( bitmap, LLViewerParcelMgr::getInstance()->mCollisionSegments );
|
||||
parcel_mgr.resetSegments(parcel_mgr.mCollisionSegments);
|
||||
parcel_mgr.writeSegmentsFromBitmap( bitmap, parcel_mgr.mCollisionSegments );
|
||||
|
||||
delete[] bitmap;
|
||||
bitmap = NULL;
|
||||
@@ -1731,13 +1733,13 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
|
||||
LLViewerRegion *region = LLWorld::getInstance()->getRegion( msg->getSender() );
|
||||
if (region)
|
||||
{
|
||||
LLViewerParcelMgr::getInstance()->mHoverWestSouth = region->getPosGlobalFromRegion( aabb_min );
|
||||
LLViewerParcelMgr::getInstance()->mHoverEastNorth = region->getPosGlobalFromRegion( aabb_max );
|
||||
parcel_mgr.mHoverWestSouth = region->getPosGlobalFromRegion( aabb_min );
|
||||
parcel_mgr.mHoverEastNorth = region->getPosGlobalFromRegion( aabb_max );
|
||||
}
|
||||
else
|
||||
{
|
||||
LLViewerParcelMgr::getInstance()->mHoverWestSouth.clearVec();
|
||||
LLViewerParcelMgr::getInstance()->mHoverEastNorth.clearVec();
|
||||
parcel_mgr.mHoverWestSouth.clearVec();
|
||||
parcel_mgr.mHoverEastNorth.clearVec();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2092,7 +2094,7 @@ void LLViewerParcelMgr::deedLandToGroup()
|
||||
// static
|
||||
bool LLViewerParcelMgr::deedAlertCB(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
S32 option = LLNotification::getSelectedOption(notification, response);
|
||||
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
if (option == 0)
|
||||
{
|
||||
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel();
|
||||
@@ -2259,7 +2261,7 @@ void LLViewerParcelMgr::startDivideLand()
|
||||
// static
|
||||
bool LLViewerParcelMgr::callbackDivideLand(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
S32 option = LLNotification::getSelectedOption(notification, response);
|
||||
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
LLVector3d west_south_d = ll_vector3d_from_sd(notification["payload"]["west_south_border"]);
|
||||
LLVector3d east_north_d = ll_vector3d_from_sd(notification["payload"]["east_north_border"]);
|
||||
LLVector3d parcel_center = (west_south_d + east_north_d) / 2.0;
|
||||
@@ -2322,7 +2324,7 @@ void LLViewerParcelMgr::startJoinLand()
|
||||
// static
|
||||
bool LLViewerParcelMgr::callbackJoinLand(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
S32 option = LLNotification::getSelectedOption(notification, response);
|
||||
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
LLVector3d west_south_d = ll_vector3d_from_sd(notification["payload"]["west_south_border"]);
|
||||
LLVector3d east_north_d = ll_vector3d_from_sd(notification["payload"]["east_north_border"]);
|
||||
LLVector3d parcel_center = (west_south_d + east_north_d) / 2.0;
|
||||
@@ -2421,7 +2423,7 @@ void LLViewerParcelMgr::reclaimParcel()
|
||||
// static
|
||||
bool LLViewerParcelMgr::releaseAlertCB(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
S32 option = LLNotification::getSelectedOption(notification, response);
|
||||
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
if (option == 0)
|
||||
{
|
||||
// Send the release message, not a force
|
||||
|
||||
@@ -264,7 +264,7 @@ public:
|
||||
BOOL remove_contribution);
|
||||
// callers responsibility to call deleteParcelBuy() on return value
|
||||
void sendParcelBuy(ParcelBuyInfo*);
|
||||
void deleteParcelBuy(ParcelBuyInfo* *);
|
||||
void deleteParcelBuy(ParcelBuyInfo* *info);
|
||||
|
||||
void sendParcelDeed(const LLUUID& group_id);
|
||||
|
||||
|
||||
@@ -335,7 +335,7 @@ void LLViewerParcelOverlay::updateOverlayTexture()
|
||||
{
|
||||
U8 ownership = mOwnership[i];
|
||||
|
||||
U8 r,g,b,a;
|
||||
F32 r,g,b,a;
|
||||
|
||||
// Color stored in low three bits
|
||||
switch( ownership & 0x7 )
|
||||
@@ -384,10 +384,10 @@ void LLViewerParcelOverlay::updateOverlayTexture()
|
||||
break;
|
||||
}
|
||||
|
||||
raw[pixel_index + 0] = r;
|
||||
raw[pixel_index + 1] = g;
|
||||
raw[pixel_index + 2] = b;
|
||||
raw[pixel_index + 3] = a;
|
||||
raw[pixel_index + 0] = (U8)r;
|
||||
raw[pixel_index + 1] = (U8)g;
|
||||
raw[pixel_index + 2] = (U8)b;
|
||||
raw[pixel_index + 3] = (U8)a;
|
||||
|
||||
pixel_index += OVERLAY_IMG_COMPONENTS;
|
||||
}
|
||||
|
||||
@@ -83,6 +83,7 @@ LLGLSLShader gGlowCombineFXAAProgram(LLViewerShaderMgr::SHADER_INTERFACE);
|
||||
LLGLSLShader gTwoTextureAddProgram(LLViewerShaderMgr::SHADER_INTERFACE);
|
||||
LLGLSLShader gOneTextureNoColorProgram(LLViewerShaderMgr::SHADER_INTERFACE);
|
||||
LLGLSLShader gDebugProgram(LLViewerShaderMgr::SHADER_INTERFACE);
|
||||
LLGLSLShader gClipProgram(LLViewerShaderMgr::SHADER_INTERFACE);
|
||||
LLGLSLShader gAlphaMaskProgram(LLViewerShaderMgr::SHADER_INTERFACE);
|
||||
|
||||
LLGLSLShader gUIProgram(LLViewerShaderMgr::SHADER_INTERFACE);
|
||||
@@ -2474,6 +2475,16 @@ BOOL LLViewerShaderMgr::loadShadersInterface()
|
||||
success = gDebugProgram.createShader(NULL, NULL);
|
||||
}
|
||||
|
||||
if (success)
|
||||
{
|
||||
gClipProgram.mName = "Clip Shader";
|
||||
gClipProgram.mShaderFiles.clear();
|
||||
gClipProgram.mShaderFiles.push_back(make_pair("interface/clipV.glsl", GL_VERTEX_SHADER_ARB));
|
||||
gClipProgram.mShaderFiles.push_back(make_pair("interface/clipF.glsl", GL_FRAGMENT_SHADER_ARB));
|
||||
gClipProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE];
|
||||
success = gClipProgram.createShader(NULL, NULL);
|
||||
}
|
||||
|
||||
if (success)
|
||||
{
|
||||
gAlphaMaskProgram.mName = "Alpha Mask Shader";
|
||||
|
||||
@@ -234,6 +234,7 @@ extern LLGLSLShader gGlowCombineProgram;
|
||||
extern LLGLSLShader gSplatTextureRectProgram;
|
||||
extern LLGLSLShader gGlowCombineFXAAProgram;
|
||||
extern LLGLSLShader gDebugProgram;
|
||||
extern LLGLSLShader gClipProgram;
|
||||
extern LLGLSLShader gAlphaMaskProgram;
|
||||
|
||||
//output tex0[tc0] + tex1[tc1]
|
||||
|
||||
@@ -4456,64 +4456,71 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
|
||||
{
|
||||
gDisplaySwapBuffers = FALSE;
|
||||
gDepthDirty = TRUE;
|
||||
{
|
||||
const U32 subfield = subimage_x+(subimage_y*llceil(scale_factor));
|
||||
display(do_rebuild, scale_factor, subfield, TRUE, is_tiling);
|
||||
// Required for showing the GUI in snapshots? See DEV-16350 for details. JC
|
||||
render_ui(scale_factor, subfield, is_tiling);
|
||||
}
|
||||
|
||||
S32 subimage_x_offset = llclamp(buffer_x_offset - (subimage_x * window_width), 0, window_width);
|
||||
// handle fractional rows
|
||||
U32 read_width = llmax(0, (window_width - subimage_x_offset) -
|
||||
llmax(0, (window_width * (subimage_x + 1)) - (buffer_x_offset + raw->getWidth())));
|
||||
|
||||
for(U32 out_y = 0; out_y < read_height ; out_y++)
|
||||
// Skip rendering and sampling altogether if either width or height is degenerated to 0 (common in cropping cases)
|
||||
if (read_width && read_height)
|
||||
{
|
||||
S32 output_buffer_offset = (
|
||||
(out_y * (raw->getWidth())) // ...plus iterated y...
|
||||
+ (window_width * subimage_x) // ...plus subimage start in x...
|
||||
+ (raw->getWidth() * window_height * subimage_y) // ...plus subimage start in y...
|
||||
- output_buffer_offset_x // ...minus buffer padding x...
|
||||
- (output_buffer_offset_y * (raw->getWidth())) // ...minus buffer padding y...
|
||||
) * raw->getComponents();
|
||||
const U32 subfield = subimage_x+(subimage_y*llceil(scale_factor));
|
||||
display(do_rebuild, scale_factor, subfield, TRUE, is_tiling);
|
||||
|
||||
// Ping the wathdog thread every 100 lines to keep us alive (arbitrary number, feel free to change)
|
||||
if (out_y % 100 == 0)
|
||||
if (!LLPipeline::sRenderDeferred)
|
||||
{
|
||||
LLAppViewer::instance()->pingMainloopTimeout("LLViewerWindow::rawSnapshot");
|
||||
// Required for showing the GUI in snapshots and performing bloom composite overlay
|
||||
// Call even if show_ui is FALSE
|
||||
render_ui(scale_factor, subfield);
|
||||
}
|
||||
|
||||
if (type == SNAPSHOT_TYPE_COLOR)
|
||||
for (U32 out_y = 0; out_y < read_height ; out_y++)
|
||||
{
|
||||
glReadPixels(
|
||||
subimage_x_offset,
|
||||
out_y + subimage_y_offset,
|
||||
read_width, 1,
|
||||
GL_RGB, GL_UNSIGNED_BYTE,
|
||||
raw->getData() + output_buffer_offset
|
||||
);
|
||||
}
|
||||
else // SNAPSHOT_TYPE_DEPTH
|
||||
{
|
||||
LLPointer<LLImageRaw> depth_line_buffer = new LLImageRaw(read_width, 1, sizeof(GL_FLOAT)); // need to store floating point values
|
||||
glReadPixels(
|
||||
subimage_x_offset, out_y + subimage_y_offset,
|
||||
read_width, 1,
|
||||
GL_DEPTH_COMPONENT, GL_FLOAT,
|
||||
depth_line_buffer->getData()// current output pixel is beginning of buffer...
|
||||
);
|
||||
|
||||
for (S32 i = 0; i < (S32)read_width; i++)
|
||||
S32 output_buffer_offset = (
|
||||
(out_y * (raw->getWidth())) // ...plus iterated y...
|
||||
+ (window_width * subimage_x) // ...plus subimage start in x...
|
||||
+ (raw->getWidth() * window_height * subimage_y) // ...plus subimage start in y...
|
||||
- output_buffer_offset_x // ...minus buffer padding x...
|
||||
- (output_buffer_offset_y * (raw->getWidth())) // ...minus buffer padding y...
|
||||
) * raw->getComponents();
|
||||
|
||||
// Ping the watchdog thread every 100 lines to keep us alive (arbitrary number, feel free to change)
|
||||
if (out_y % 100 == 0)
|
||||
{
|
||||
F32 depth_float = *(F32*)(depth_line_buffer->getData() + (i * sizeof(F32)));
|
||||
|
||||
F32 linear_depth_float = 1.f / (depth_conversion_factor_1 - (depth_float * depth_conversion_factor_2));
|
||||
U8 depth_byte = F32_to_U8(linear_depth_float, LLViewerCamera::getInstance()->getNear(), LLViewerCamera::getInstance()->getFar());
|
||||
//write converted scanline out to result image
|
||||
for(S32 j = 0; j < raw->getComponents(); j++)
|
||||
LLAppViewer::instance()->pingMainloopTimeout("LLViewerWindow::rawSnapshot");
|
||||
}
|
||||
|
||||
if (type == SNAPSHOT_TYPE_COLOR)
|
||||
{
|
||||
glReadPixels(
|
||||
subimage_x_offset, out_y + subimage_y_offset,
|
||||
read_width, 1,
|
||||
GL_RGB, GL_UNSIGNED_BYTE,
|
||||
raw->getData() + output_buffer_offset
|
||||
);
|
||||
}
|
||||
else // SNAPSHOT_TYPE_DEPTH
|
||||
{
|
||||
LLPointer<LLImageRaw> depth_line_buffer = new LLImageRaw(read_width, 1, sizeof(GL_FLOAT)); // need to store floating point values
|
||||
glReadPixels(
|
||||
subimage_x_offset, out_y + subimage_y_offset,
|
||||
read_width, 1,
|
||||
GL_DEPTH_COMPONENT, GL_FLOAT,
|
||||
depth_line_buffer->getData()// current output pixel is beginning of buffer...
|
||||
);
|
||||
|
||||
for (S32 i = 0; i < (S32)read_width; i++)
|
||||
{
|
||||
*(raw->getData() + output_buffer_offset + (i * raw->getComponents()) + j) = depth_byte;
|
||||
F32 depth_float = *(F32*)(depth_line_buffer->getData() + (i * sizeof(F32)));
|
||||
|
||||
F32 linear_depth_float = 1.f / (depth_conversion_factor_1 - (depth_float * depth_conversion_factor_2));
|
||||
U8 depth_byte = F32_to_U8(linear_depth_float, LLViewerCamera::getInstance()->getNear(), LLViewerCamera::getInstance()->getFar());
|
||||
// write converted scanline out to result image
|
||||
for (S32 j = 0; j < raw->getComponents(); j++)
|
||||
{
|
||||
*(raw->getData() + output_buffer_offset + (i * raw->getComponents()) + j) = depth_byte;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -447,14 +447,21 @@ void LLParticlePartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_co
|
||||
continue;
|
||||
}
|
||||
|
||||
count++;
|
||||
facep->mDistance = (facep->mCenterLocal - camera->getOrigin()) * camera->getAtAxis();
|
||||
obj->mDepth += facep->mDistance;
|
||||
if ((facep->getGeomCount() + vertex_count) <= 65536)
|
||||
{
|
||||
count++;
|
||||
facep->mDistance = (facep->mCenterLocal - camera->getOrigin()) * camera->getAtAxis();
|
||||
obj->mDepth += facep->mDistance;
|
||||
|
||||
mFaceList.push_back(facep);
|
||||
vertex_count += facep->getGeomCount();
|
||||
index_count += facep->getIndicesCount();
|
||||
llassert(facep->getIndicesCount() < 65536);
|
||||
mFaceList.push_back(facep);
|
||||
vertex_count += facep->getGeomCount();
|
||||
index_count += facep->getIndicesCount();
|
||||
llassert(facep->getIndicesCount() < 65536);
|
||||
}
|
||||
else
|
||||
{
|
||||
facep->clearVertexBuffer();
|
||||
}
|
||||
}
|
||||
|
||||
obj->mDepth /= count;
|
||||
|
||||
@@ -80,7 +80,7 @@ void LLWLDayCycle::loadDayCycle(const LLSD& day_data, LLWLParamKey::EScope scope
|
||||
// alert the user
|
||||
LLSD args;
|
||||
args["SKY"] = day_data[i][1].asString();
|
||||
LLNotificationsUtil::add("WLMissingSky", args, LLSD());
|
||||
LLNotifications::instance().add("WLMissingSky", args, LLSD());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -161,13 +161,13 @@ LLSD LLWLDayCycle::asLLSD()
|
||||
bool LLWLDayCycle::getSkyRefs(std::map<LLWLParamKey, LLWLParamSet>& refs) const
|
||||
{
|
||||
bool result = true;
|
||||
LLWLParamManager* wl_mgr = LLWLParamManager::getInstance();
|
||||
LLWLParamManager& wl_mgr = LLWLParamManager::instance();
|
||||
|
||||
refs.clear();
|
||||
for (std::map<F32, LLWLParamKey>::const_iterator iter = mTimeMap.begin(); iter != mTimeMap.end(); ++iter)
|
||||
{
|
||||
const LLWLParamKey& key = iter->second;
|
||||
if (!wl_mgr->getParamSet(key, refs[key]))
|
||||
if (!wl_mgr.getParamSet(key, refs[key]))
|
||||
{
|
||||
llwarns << "Cannot find sky [" << key.name << "] referenced by a day cycle" << llendl;
|
||||
result = false;
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "llagent.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "llenvmanager.h"
|
||||
#include "llnotifications.h"
|
||||
#include "llnotificationsutil.h"
|
||||
|
||||
/****
|
||||
* LLEnvironmentRequest
|
||||
@@ -144,7 +144,7 @@ bool LLEnvironmentApply::initiateRequest(const LLSD& content)
|
||||
{
|
||||
LLSD args(LLSD::emptyMap());
|
||||
args["WAIT"] = (F64)UPDATE_WAIT_SECONDS;
|
||||
LLNotifications::instance().add("EnvUpdateRate", args);
|
||||
LLNotificationsUtil::add("EnvUpdateRate", args);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ bool LLEnvironmentApply::initiateRequest(const LLSD& content)
|
||||
LL_WARNS("WindlightCaps") << "Region couldn't apply windlight settings! Reason from sim: " << content["fail_reason"].asString() << LL_ENDL;
|
||||
LLSD args(LLSD::emptyMap());
|
||||
args["FAIL_REASON"] = content["fail_reason"].asString();
|
||||
LLNotifications::instance().add("WLRegionApplyFail", args);
|
||||
LLNotificationsUtil::add("WLRegionApplyFail", args);
|
||||
LLEnvManagerNew::instance().onRegionSettingsApplyResponse(false);
|
||||
}
|
||||
}
|
||||
@@ -199,5 +199,5 @@ bool LLEnvironmentApply::initiateRequest(const LLSD& content)
|
||||
|
||||
LLSD args(LLSD::emptyMap());
|
||||
args["FAIL_REASON"] = msg.str();
|
||||
LLNotifications::instance().add("WLRegionApplyFail", args);
|
||||
LLNotificationsUtil::add("WLRegionApplyFail", args);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user