summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llcharacter/llcharacter.cpp26
-rw-r--r--indra/llcharacter/llcharacter.h5
-rw-r--r--indra/llcharacter/llkeyframemotion.cpp237
-rw-r--r--indra/llcharacter/llkeyframemotion.h10
-rw-r--r--indra/llcharacter/llkeyframemotionparam.cpp149
-rw-r--r--indra/llcharacter/llkeyframemotionparam.h16
-rw-r--r--indra/llcharacter/llpose.h2
-rw-r--r--indra/llcharacter/llstatemachine.h1
-rw-r--r--indra/llcommon/linden_common.h1
-rw-r--r--indra/llcommon/llsys.cpp3
-rw-r--r--indra/llcommon/llversionviewer.h4
-rw-r--r--indra/llinventory/llparcel.cpp6
-rw-r--r--indra/llmath/llvolume.cpp269
-rw-r--r--indra/llmath/llvolume.h4
-rw-r--r--indra/llmessage/llcircuit.h1
-rw-r--r--indra/llmessage/llcurl.cpp1
-rw-r--r--indra/llmessage/llnamevalue.h1
-rw-r--r--indra/llmessage/llpacketring.h1
-rw-r--r--indra/llmessage/llxfermanager.cpp46
-rw-r--r--indra/llmessage/llxfermanager.h4
-rw-r--r--indra/llmessage/message.h2
-rw-r--r--indra/llprimitive/llmaterialtable.cpp104
-rw-r--r--indra/llprimitive/llmaterialtable.h4
-rw-r--r--indra/llui/llfloater.h2
-rw-r--r--indra/llui/lltabcontainer.cpp7
-rw-r--r--indra/llwindow/llwindow.cpp10
-rw-r--r--indra/llxml/llcontrol.cpp35
-rw-r--r--indra/newview/English.lproj/InfoPlist.strings4
-rw-r--r--indra/newview/Info-SecondLife.plist2
-rw-r--r--indra/newview/app_settings/shaders/class2/environment/waterF.glsl2
-rw-r--r--indra/newview/featuretable.txt188
-rw-r--r--indra/newview/featuretable_linux.txt125
-rw-r--r--indra/newview/featuretable_mac.txt182
-rw-r--r--indra/newview/gpu_table.txt18
-rw-r--r--indra/newview/llappearance.h12
-rw-r--r--indra/newview/llappviewerwin32.cpp30
-rw-r--r--indra/newview/llcompilequeue.cpp1
-rw-r--r--indra/newview/lldebugmessagebox.cpp1
-rw-r--r--indra/newview/lldynamictexture.cpp13
-rw-r--r--indra/newview/lldynamictexture.h4
-rw-r--r--indra/newview/llfasttimerview.cpp8
-rw-r--r--indra/newview/llfeaturemanager.cpp14
-rw-r--r--indra/newview/llfeaturemanager.h1
-rw-r--r--indra/newview/llfloaterbump.cpp11
-rw-r--r--indra/newview/llfloatermap.cpp2
-rw-r--r--indra/newview/llfloaterpostcard.cpp14
-rw-r--r--indra/newview/llfloaterpostcard.h5
-rw-r--r--indra/newview/llfloaterurlentry.cpp5
-rw-r--r--indra/newview/llfloaterworldmap.cpp8
-rw-r--r--indra/newview/llhudeffectlookat.h1
-rw-r--r--indra/newview/llhudobject.h1
-rw-r--r--indra/newview/llimview.cpp1
-rw-r--r--indra/newview/llinventorybridge.cpp25
-rw-r--r--indra/newview/llinventorymodel.h2
-rw-r--r--indra/newview/llmanipscale.cpp24
-rw-r--r--indra/newview/llmanipscale.h17
-rw-r--r--indra/newview/llmaniptranslate.cpp30
-rw-r--r--indra/newview/llmaniptranslate.h15
-rw-r--r--indra/newview/llmenucommands.cpp1
-rw-r--r--indra/newview/llmimetypes.cpp2
-rw-r--r--indra/newview/llmoveview.cpp1
-rw-r--r--indra/newview/llnamebox.h1
-rw-r--r--indra/newview/llnameeditor.h1
-rw-r--r--indra/newview/llnetmap.cpp1
-rw-r--r--indra/newview/lloverlaybar.cpp10
-rw-r--r--indra/newview/lloverlaybar.h1
-rw-r--r--indra/newview/llpanelavatar.h1
-rw-r--r--indra/newview/llpanelobject.cpp7
-rw-r--r--indra/newview/llpolymesh.cpp82
-rw-r--r--indra/newview/llpolymesh.h17
-rw-r--r--indra/newview/llpolymorph.cpp5
-rw-r--r--indra/newview/llpolymorph.h2
-rw-r--r--indra/newview/llselectmgr.cpp1
-rw-r--r--indra/newview/lltextureview.h1
-rw-r--r--indra/newview/lltoolbrush.cpp60
-rw-r--r--indra/newview/lltoolbrush.h9
-rw-r--r--indra/newview/lltoolmgr.cpp50
-rw-r--r--indra/newview/lltoolmgr.h4
-rw-r--r--indra/newview/lltoolmorph.cpp12
-rw-r--r--indra/newview/lltoolmorph.h6
-rw-r--r--indra/newview/lltoolview.cpp16
-rw-r--r--indra/newview/lltoolview.h5
-rw-r--r--indra/newview/lluploaddialog.cpp13
-rw-r--r--indra/newview/llurlhistory.cpp8
-rw-r--r--indra/newview/llviewermessage.cpp24
-rw-r--r--indra/newview/llviewermessage.h3
-rw-r--r--indra/newview/llviewerobject.cpp31
-rw-r--r--indra/newview/llviewerobject.h4
-rw-r--r--indra/newview/llviewerobjectlist.h2
-rw-r--r--indra/newview/llviewerpartsim.h1
-rw-r--r--indra/newview/llviewerprecompiledheaders.h10
-rw-r--r--indra/newview/llviewerregion.cpp11
-rw-r--r--indra/newview/llviewerregion.h4
-rw-r--r--indra/newview/llviewerwindow.cpp52
-rw-r--r--indra/newview/llviewerwindow.h1
-rw-r--r--indra/newview/llvovolume.cpp5
-rw-r--r--indra/newview/llwearable.cpp125
-rw-r--r--indra/newview/llwearable.h7
-rw-r--r--indra/newview/llwearablelist.cpp5
-rw-r--r--indra/newview/llwearablelist.h7
-rw-r--r--indra/newview/llwindebug.cpp194
-rw-r--r--indra/newview/llworldmapview.cpp1
-rw-r--r--indra/newview/pipeline.cpp5
-rw-r--r--indra/newview/pipeline.h3
104 files changed, 1603 insertions, 926 deletions
diff --git a/indra/llcharacter/llcharacter.cpp b/indra/llcharacter/llcharacter.cpp
index ff05b25fe9..ccc666e74d 100644
--- a/indra/llcharacter/llcharacter.cpp
+++ b/indra/llcharacter/llcharacter.cpp
@@ -241,33 +241,15 @@ void LLCharacter::dumpCharacter( LLJoint* joint )
//-----------------------------------------------------------------------------
void LLCharacter::setAnimationData(std::string name, void *data)
{
- if(mAnimationData.getValue(name))
- {
- *mAnimationData[name] = data;
- }
- else
- {
- mAnimationData.addToHead(name, data);
- }
+ mAnimationData[name] = data;
}
//-----------------------------------------------------------------------------
// getAnimationData()
//-----------------------------------------------------------------------------
-void * LLCharacter::getAnimationData(std::string name)
+void* LLCharacter::getAnimationData(std::string name)
{
- void **result = mAnimationData.getValue(name);
- void *return_value; // Necessary to suppress VC6 warning. JC
- if (!result)
- {
- return_value = NULL;
- }
- else
- {
- return_value = *result;
- }
-
- return return_value;
+ return get_if_there(mAnimationData, name, (void*)NULL);
}
//-----------------------------------------------------------------------------
@@ -275,7 +257,7 @@ void * LLCharacter::getAnimationData(std::string name)
//-----------------------------------------------------------------------------
void LLCharacter::removeAnimationData(std::string name)
{
- mAnimationData.remove(name);
+ mAnimationData.erase(name);
}
//-----------------------------------------------------------------------------
diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h
index eb001d5fc7..a5719b0685 100644
--- a/indra/llcharacter/llcharacter.h
+++ b/indra/llcharacter/llcharacter.h
@@ -39,9 +39,7 @@
#include "lljoint.h"
#include "llmotioncontroller.h"
-#include "llassoclist.h"
#include "llvisualparam.h"
-#include "linked_lists.h"
#include "string_table.h"
#include "llmemory.h"
#include "llthread.h"
@@ -255,7 +253,8 @@ public:
protected:
LLMotionController mMotionController;
- LLAssocList<std::string, void *> mAnimationData;
+ typedef std::map<std::string, void *> animation_data_map_t;
+ animation_data_map_t mAnimationData;
F32 mPreferredPelvisHeight;
ESex mSex;
diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp
index 1d00f18f2d..91d96904ba 100644
--- a/indra/llcharacter/llkeyframemotion.cpp
+++ b/indra/llcharacter/llkeyframemotion.cpp
@@ -122,6 +122,7 @@ U32 LLKeyframeMotion::JointMotionList::dumpDiagInfo()
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
+
//-----------------------------------------------------------------------------
// ScaleCurve::ScaleCurve()
//-----------------------------------------------------------------------------
@@ -136,7 +137,7 @@ LLKeyframeMotion::ScaleCurve::ScaleCurve()
//-----------------------------------------------------------------------------
LLKeyframeMotion::ScaleCurve::~ScaleCurve()
{
- mKeys.deleteAllData();
+ mKeys.clear();
mNumKeys = 0;
}
@@ -146,43 +147,42 @@ LLKeyframeMotion::ScaleCurve::~ScaleCurve()
LLVector3 LLKeyframeMotion::ScaleCurve::getValue(F32 time, F32 duration)
{
LLVector3 value;
- F32 index_before, index_after;
- ScaleKey* scale_before;
- ScaleKey* scale_after;
- mKeys.getInterval(time, index_before, index_after, scale_before, scale_after);
- if (scale_before)
+ if (mKeys.empty())
{
- if (!scale_after)
- {
- scale_after = &mLoopInKey;
- index_after = duration;
- }
-
- if (index_after == index_before)
- {
- value = scale_after->mScale;
- }
- else
- {
- F32 u = (time - index_before) / (index_after - index_before);
- value = interp(u, *scale_before, *scale_after);
- }
+ value.clearVec();
+ return value;
+ }
+
+ key_map_t::iterator right = mKeys.lower_bound(time);
+ if (right == mKeys.end())
+ {
+ // Past last key
+ --right;
+ value = right->second.mScale;
+ }
+ else if (right == mKeys.begin() || right->first == time)
+ {
+ // Before first key or exactly on a key
+ value = right->second.mScale;
}
else
{
- // before first key
- if (scale_after)
- {
- value = scale_after->mScale;
- }
- // no keys?
- else
+ // Between two keys
+ key_map_t::iterator left = right; --left;
+ F32 index_before = left->first;
+ F32 index_after = right->first;
+ ScaleKey& scale_before = left->second;
+ ScaleKey& scale_after = right->second;
+ if (right == mKeys.end())
{
- value.clearVec();
+ scale_after = mLoopInKey;
+ index_after = duration;
}
- }
+ F32 u = (time - index_before) / (index_after - index_before);
+ value = interp(u, scale_before, scale_after);
+ }
return value;
}
@@ -217,7 +217,7 @@ LLKeyframeMotion::RotationCurve::RotationCurve()
//-----------------------------------------------------------------------------
LLKeyframeMotion::RotationCurve::~RotationCurve()
{
- mKeys.deleteAllData();
+ mKeys.clear();
mNumKeys = 0;
}
@@ -227,44 +227,42 @@ LLKeyframeMotion::RotationCurve::~RotationCurve()
LLQuaternion LLKeyframeMotion::RotationCurve::getValue(F32 time, F32 duration)
{
LLQuaternion value;
- F32 index_before, index_after;
- RotationKey* rot_before;
- RotationKey* rot_after;
-
- mKeys.getInterval(time, index_before, index_after, rot_before, rot_after);
- if (rot_before)
+ if (mKeys.empty())
{
- if (!rot_after)
- {
- rot_after = &mLoopInKey;
- index_after = duration;
- }
-
- if (index_after == index_before)
- {
- value = rot_after->mRotation;
- }
- else
- {
- F32 u = (time - index_before) / (index_after - index_before);
- value = interp(u, *rot_before, *rot_after);
- }
+ value = LLQuaternion::DEFAULT;
+ return value;
+ }
+
+ key_map_t::iterator right = mKeys.lower_bound(time);
+ if (right == mKeys.end())
+ {
+ // Past last key
+ --right;
+ value = right->second.mRotation;
+ }
+ else if (right == mKeys.begin() || right->first == time)
+ {
+ // Before first key or exactly on a key
+ value = right->second.mRotation;
}
else
{
- // before first key
- if (rot_after)
+ // Between two keys
+ key_map_t::iterator left = right; --left;
+ F32 index_before = left->first;
+ F32 index_after = right->first;
+ RotationKey& rot_before = left->second;
+ RotationKey& rot_after = right->second;
+ if (right == mKeys.end())
{
- value = rot_after->mRotation;
- }
- // no keys?
- else
- {
- value = LLQuaternion::DEFAULT;
+ rot_after = mLoopInKey;
+ index_after = duration;
}
- }
+ F32 u = (time - index_before) / (index_after - index_before);
+ value = interp(u, rot_before, rot_after);
+ }
return value;
}
@@ -300,7 +298,7 @@ LLKeyframeMotion::PositionCurve::PositionCurve()
//-----------------------------------------------------------------------------
LLKeyframeMotion::PositionCurve::~PositionCurve()
{
- mKeys.deleteAllData();
+ mKeys.clear();
mNumKeys = 0;
}
@@ -310,46 +308,45 @@ LLKeyframeMotion::PositionCurve::~PositionCurve()
LLVector3 LLKeyframeMotion::PositionCurve::getValue(F32 time, F32 duration)
{
LLVector3 value;
- F32 index_before, index_after;
- PositionKey* pos_before;
- PositionKey* pos_after;
- mKeys.getInterval(time, index_before, index_after, pos_before, pos_after);
-
- if (pos_before)
+ if (mKeys.empty())
{
- if (!pos_after)
- {
- pos_after = &mLoopInKey;
- index_after = duration;
- }
-
- if (index_after == index_before)
- {
- value = pos_after->mPosition;
- }
- else
- {
- F32 u = (time - index_before) / (index_after - index_before);
- value = interp(u, *pos_before, *pos_after);
- }
+ value.clearVec();
+ return value;
+ }
+
+ key_map_t::iterator right = mKeys.lower_bound(time);
+ if (right == mKeys.end())
+ {
+ // Past last key
+ --right;
+ value = right->second.mPosition;
+ }
+ else if (right == mKeys.begin() || right->first == time)
+ {
+ // Before first key or exactly on a key
+ value = right->second.mPosition;
}
else
{
- // before first key
- if (pos_after)
- {
- value = pos_after->mPosition;
- }
- // no keys?
- else
+ // Between two keys
+ key_map_t::iterator left = right; --left;
+ F32 index_before = left->first;
+ F32 index_after = right->first;
+ PositionKey& pos_before = left->second;
+ PositionKey& pos_after = right->second;
+ if (right == mKeys.end())
{
- value.clearVec();
+ pos_after = mLoopInKey;
+ index_after = duration;
}
+
+ F32 u = (time - index_before) / (index_after - index_before);
+ value = interp(u, pos_before, pos_after);
}
llassert(value.isFinite());
-
+
return value;
}
@@ -1404,8 +1401,8 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
time = U16_to_F32(time_short, 0.f, mJointMotionList->mDuration);
}
- RotationKey *rot_key = new RotationKey;
- rot_key->mTime = time;
+ RotationKey rot_key;
+ rot_key.mTime = time;
LLVector3 rot_angles;
U16 x, y, z;
@@ -1416,7 +1413,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
success = dp.unpackVector3(rot_angles, "rot_angles");
LLQuaternion::Order ro = StringToOrder("ZYX");
- rot_key->mRotation = mayaQ(rot_angles.mV[VX], rot_angles.mV[VY], rot_angles.mV[VZ], ro);
+ rot_key.mRotation = mayaQ(rot_angles.mV[VX], rot_angles.mV[VY], rot_angles.mV[VZ], ro);
}
else
{
@@ -1428,13 +1425,12 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
rot_vec.mV[VX] = U16_to_F32(x, -1.f, 1.f);
rot_vec.mV[VY] = U16_to_F32(y, -1.f, 1.f);
rot_vec.mV[VZ] = U16_to_F32(z, -1.f, 1.f);
- rot_key->mRotation.unpackFromVector3(rot_vec);
+ rot_key.mRotation.unpackFromVector3(rot_vec);
}
if (!success)
{
llwarns << "can't read rotation key (" << k << ")" << llendl;
- delete rot_key;
return FALSE;
}
@@ -1464,14 +1460,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
for (S32 k = 0; k < joint_motion->mPositionCurve.mNumKeys; k++)
{
U16 time_short;
- PositionKey* pos_key = new PositionKey;
+ PositionKey pos_key;
if (old_version)
{
- if (!dp.unpackF32(pos_key->mTime, "time"))
+ if (!dp.unpackF32(pos_key.mTime, "time"))
{
llwarns << "can't read position key (" << k << ")" << llendl;
- delete pos_key;
return FALSE;
}
}
@@ -1480,18 +1475,17 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if (!dp.unpackU16(time_short, "time"))
{
llwarns << "can't read position key (" << k << ")" << llendl;
- delete pos_key;
return FALSE;
}
- pos_key->mTime = U16_to_F32(time_short, 0.f, mJointMotionList->mDuration);
+ pos_key.mTime = U16_to_F32(time_short, 0.f, mJointMotionList->mDuration);
}
BOOL success = TRUE;
if (old_version)
{
- success = dp.unpackVector3(pos_key->mPosition, "pos");
+ success = dp.unpackVector3(pos_key.mPosition, "pos");
}
else
{
@@ -1501,23 +1495,22 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
success &= dp.unpackU16(y, "pos_y");
success &= dp.unpackU16(z, "pos_z");
- pos_key->mPosition.mV[VX] = U16_to_F32(x, -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
- pos_key->mPosition.mV[VY] = U16_to_F32(y, -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
- pos_key->mPosition.mV[VZ] = U16_to_F32(z, -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
+ pos_key.mPosition.mV[VX] = U16_to_F32(x, -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
+ pos_key.mPosition.mV[VY] = U16_to_F32(y, -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
+ pos_key.mPosition.mV[VZ] = U16_to_F32(z, -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
}
if (!success)
{
llwarns << "can't read position key (" << k << ")" << llendl;
- delete pos_key;
return FALSE;
}
- pCurve->mKeys[pos_key->mTime] = pos_key;
+ pCurve->mKeys[pos_key.mTime] = pos_key;
if (is_pelvis)
{
- mJointMotionList->mPelvisBBox.addPoint(pos_key->mPosition);
+ mJointMotionList->mPelvisBBox.addPoint(pos_key.mPosition);
}
}
@@ -1724,14 +1717,14 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const
success &= dp.packS32(joint_motionp->mPriority, "joint_priority");
success &= dp.packS32(joint_motionp->mRotationCurve.mNumKeys, "num_rot_keys");
- for (RotationKey* rot_keyp = joint_motionp->mRotationCurve.mKeys.getFirstData();
- rot_keyp;
- rot_keyp = joint_motionp->mRotationCurve.mKeys.getNextData())
+ for (RotationCurve::key_map_t::iterator iter = joint_motionp->mRotationCurve.mKeys.begin();
+ iter != joint_motionp->mRotationCurve.mKeys.end(); ++iter)
{
- U16 time_short = F32_to_U16(rot_keyp->mTime, 0.f, mJointMotionList->mDuration);
+ RotationKey& rot_key = iter->second;
+ U16 time_short = F32_to_U16(rot_key.mTime, 0.f, mJointMotionList->mDuration);
success &= dp.packU16(time_short, "time");
- LLVector3 rot_angles = rot_keyp->mRotation.packToVector3();
+ LLVector3 rot_angles = rot_key.mRotation.packToVector3();
U16 x, y, z;
rot_angles.quantize16(-1.f, 1.f, -1.f, 1.f);
@@ -1744,18 +1737,18 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const
}
success &= dp.packS32(joint_motionp->mPositionCurve.mNumKeys, "num_pos_keys");
- for (PositionKey* pos_keyp = joint_motionp->mPositionCurve.mKeys.getFirstData();
- pos_keyp;
- pos_keyp = joint_motionp->mPositionCurve.mKeys.getNextData())
+ for (PositionCurve::key_map_t::iterator iter = joint_motionp->mPositionCurve.mKeys.begin();
+ iter != joint_motionp->mPositionCurve.mKeys.end(); ++iter)
{
- U16 time_short = F32_to_U16(pos_keyp->mTime, 0.f, mJointMotionList->mDuration);
+ PositionKey& pos_key = iter->second;
+ U16 time_short = F32_to_U16(pos_key.mTime, 0.f, mJointMotionList->mDuration);
success &= dp.packU16(time_short, "time");
U16 x, y, z;
- pos_keyp->mPosition.quantize16(-LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET, -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
- x = F32_to_U16(pos_keyp->mPosition.mV[VX], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
- y = F32_to_U16(pos_keyp->mPosition.mV[VY], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
- z = F32_to_U16(pos_keyp->mPosition.mV[VZ], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
+ pos_key.mPosition.quantize16(-LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET, -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
+ x = F32_to_U16(pos_key.mPosition.mV[VX], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
+ y = F32_to_U16(pos_key.mPosition.mV[VY], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
+ z = F32_to_U16(pos_key.mPosition.mV[VZ], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
success &= dp.packU16(x, "pos_x");
success &= dp.packU16(y, "pos_y");
success &= dp.packU16(z, "pos_z");
diff --git a/indra/llcharacter/llkeyframemotion.h b/indra/llcharacter/llkeyframemotion.h
index 8d6ebbf4b7..c383e5e99e 100644
--- a/indra/llcharacter/llkeyframemotion.h
+++ b/indra/llcharacter/llkeyframemotion.h
@@ -43,7 +43,6 @@
#include "llhandmotion.h"
#include "lljointstate.h"
#include "llmotion.h"
-#include "llptrskipmap.h"
#include "llquaternion.h"
#include "v3dmath.h"
#include "v3math.h"
@@ -338,7 +337,8 @@ public:
InterpolationType mInterpolationType;
S32 mNumKeys;
- LLPtrSkipMap<F32, ScaleKey*> mKeys;
+ typedef std::map<F32, ScaleKey> key_map_t;
+ key_map_t mKeys;
ScaleKey mLoopInKey;
ScaleKey mLoopOutKey;
};
@@ -356,7 +356,8 @@ public:
InterpolationType mInterpolationType;
S32 mNumKeys;
- LLPtrSkipMap<F32, RotationKey*> mKeys;
+ typedef std::map<F32, RotationKey> key_map_t;
+ key_map_t mKeys;
RotationKey mLoopInKey;
RotationKey mLoopOutKey;
};
@@ -374,7 +375,8 @@ public:
InterpolationType mInterpolationType;
S32 mNumKeys;
- LLPtrSkipMap<F32, PositionKey*> mKeys;
+ typedef std::map<F32, PositionKey> key_map_t;
+ key_map_t mKeys;
PositionKey mLoopInKey;
PositionKey mLoopOutKey;
};
diff --git a/indra/llcharacter/llkeyframemotionparam.cpp b/indra/llcharacter/llkeyframemotionparam.cpp
index f54d1f4a83..30edc29c6e 100644
--- a/indra/llcharacter/llkeyframemotionparam.cpp
+++ b/indra/llcharacter/llkeyframemotionparam.cpp
@@ -48,14 +48,6 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-// sortFunc()
-//-----------------------------------------------------------------------------
-BOOL LLKeyframeMotionParam::sortFunc(ParameterizedMotion *new_motion, ParameterizedMotion *tested_motion)
-{
- return (new_motion->second < tested_motion->second);
-}
-
-//-----------------------------------------------------------------------------
// LLKeyframeMotionParam()
// Class Constructor
//-----------------------------------------------------------------------------
@@ -77,17 +69,18 @@ LLKeyframeMotionParam::LLKeyframeMotionParam( const LLUUID &id) : LLMotion(id)
//-----------------------------------------------------------------------------
LLKeyframeMotionParam::~LLKeyframeMotionParam()
{
- for (U32 i = 0; i < mParameterizedMotions.length(); i++)
+ for (motion_map_t::iterator iter = mParameterizedMotions.begin();
+ iter != mParameterizedMotions.end(); ++iter)
{
- LLLinkedList< ParameterizedMotion > *motionList = *mParameterizedMotions.getValueAt(i);
- for (ParameterizedMotion* paramMotion = motionList->getFirstData(); paramMotion; paramMotion = motionList->getNextData())
+ motion_list_t& motionList = iter->second;
+ for (motion_list_t::iterator iter2 = motionList.begin(); iter2 != motionList.end(); ++iter2)
{
- delete paramMotion->first;
+ const ParameterizedMotion& paramMotion = *iter2;
+ delete paramMotion.first; // note - deletes the structure; ParameterizedMotion pair remains intact
}
- delete motionList;
+ motionList.clear();
}
-
- mParameterizedMotions.removeAll();
+ mParameterizedMotions.clear();
}
//-----------------------------------------------------------------------------
@@ -102,36 +95,39 @@ LLMotion::LLMotionInitStatus LLKeyframeMotionParam::onInitialize(LLCharacter *ch
return STATUS_FAILURE;
}
- for (U32 i = 0; i < mParameterizedMotions.length(); i++)
+ for (motion_map_t::iterator iter = mParameterizedMotions.begin();
+ iter != mParameterizedMotions.end(); ++iter)
{
- LLLinkedList< ParameterizedMotion > *motionList = *mParameterizedMotions.getValueAt(i);
- for (ParameterizedMotion* paramMotion = motionList->getFirstData(); paramMotion; paramMotion = motionList->getNextData())
+ motion_list_t& motionList = iter->second;
+ for (motion_list_t::iterator iter2 = motionList.begin(); iter2 != motionList.end(); ++iter2)
{
- paramMotion->first->onInitialize(character);
+ const ParameterizedMotion& paramMotion = *iter2;
- if (paramMotion->first->getDuration() > mEaseInDuration)
+ paramMotion.first->onInitialize(character);
+
+ if (paramMotion.first->getDuration() > mEaseInDuration)
{
- mEaseInDuration = paramMotion->first->getEaseInDuration();
+ mEaseInDuration = paramMotion.first->getEaseInDuration();
}
- if (paramMotion->first->getEaseOutDuration() > mEaseOutDuration)
+ if (paramMotion.first->getEaseOutDuration() > mEaseOutDuration)
{
- mEaseOutDuration = paramMotion->first->getEaseOutDuration();
+ mEaseOutDuration = paramMotion.first->getEaseOutDuration();
}
- if (paramMotion->first->getDuration() > mDuration)
+ if (paramMotion.first->getDuration() > mDuration)
{
- mDuration = paramMotion->first->getDuration();
+ mDuration = paramMotion.first->getDuration();
}
- if (paramMotion->first->getPriority() > mPriority)
+ if (paramMotion.first->getPriority() > mPriority)
{
- mPriority = paramMotion->first->getPriority();
+ mPriority = paramMotion.first->getPriority();
}
- LLPose *pose = paramMotion->first->getPose();
+ LLPose *pose = paramMotion.first->getPose();
- mPoseBlender.addMotion(paramMotion->first);
+ mPoseBlender.addMotion(paramMotion.first);
for (LLJointState *jsp = pose->getFirstJointState(); jsp; jsp = pose->getNextJointState())
{
LLPose *blendedPose = mPoseBlender.getBlendedPose();
@@ -148,12 +144,14 @@ LLMotion::LLMotionInitStatus LLKeyframeMotionParam::onInitialize(LLCharacter *ch
//-----------------------------------------------------------------------------
BOOL LLKeyframeMotionParam::onActivate()
{
- for (U32 i = 0; i < mParameterizedMotions.length(); i++)
+ for (motion_map_t::iterator iter = mParameterizedMotions.begin();
+ iter != mParameterizedMotions.end(); ++iter)
{
- LLLinkedList< ParameterizedMotion > *motionList = *mParameterizedMotions.getValueAt(i);
- for (ParameterizedMotion* paramMotion = motionList->getFirstData(); paramMotion; paramMotion = motionList->getNextData())
+ motion_list_t& motionList = iter->second;
+ for (motion_list_t::iterator iter2 = motionList.begin(); iter2 != motionList.end(); ++iter2)
{
- paramMotion->first->activate();
+ const ParameterizedMotion& paramMotion = *iter2;
+ paramMotion.first->activate();
}
}
return TRUE;
@@ -165,46 +163,48 @@ BOOL LLKeyframeMotionParam::onActivate()
//-----------------------------------------------------------------------------
BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask)
{
- F32 weightFactor = 1.f / (F32)mParameterizedMotions.length();
- U32 i;
+ F32 weightFactor = 1.f / (F32)mParameterizedMotions.size();
// zero out all pose weights
- for (i = 0; i < mParameterizedMotions.length(); i++)
+ for (motion_map_t::iterator iter = mParameterizedMotions.begin();
+ iter != mParameterizedMotions.end(); ++iter)
{
- LLLinkedList< ParameterizedMotion > *motionList = *mParameterizedMotions.getValueAt(i);
-
- for (ParameterizedMotion* paramMotion = motionList->getFirstData(); paramMotion; paramMotion = motionList->getNextData())
+ motion_list_t& motionList = iter->second;
+ for (motion_list_t::iterator iter2 = motionList.begin(); iter2 != motionList.end(); ++iter2)
{
-// llinfos << "Weight for pose " << paramMotion->first->getName() << " is " << paramMotion->first->getPose()->getWeight() << llendl;
- paramMotion->first->getPose()->setWeight(0.f);
+ const ParameterizedMotion& paramMotion = *iter2;
+// llinfos << "Weight for pose " << paramMotion.first->getName() << " is " << paramMotion.first->getPose()->getWeight() << llendl;
+ paramMotion.first->getPose()->setWeight(0.f);
}
}
- for (i = 0; i < mParameterizedMotions.length(); i++)
+ for (motion_map_t::iterator iter = mParameterizedMotions.begin();
+ iter != mParameterizedMotions.end(); ++iter)
{
- LLLinkedList< ParameterizedMotion > *motionList = *mParameterizedMotions.getValueAt(i);
- std::string *paramName = mParameterizedMotions.getIndexAt(i);
- F32* paramValue = (F32 *)mCharacter->getAnimationData(*paramName);
- ParameterizedMotion* firstMotion = NULL;
- ParameterizedMotion* secondMotion = NULL;
-
+ const std::string& paramName = iter->first;
+ F32* paramValue = (F32 *)mCharacter->getAnimationData(paramName);
if (NULL == paramValue) // unexpected, but...
{
llwarns << "paramValue == NULL" << llendl;
continue;
}
- for (ParameterizedMotion* paramMotion = motionList->getFirstData(); paramMotion; paramMotion = motionList->getNextData())
+ const ParameterizedMotion* firstMotion = NULL;
+ const ParameterizedMotion* secondMotion = NULL;
+
+ motion_list_t& motionList = iter->second;
+ for (motion_list_t::iterator iter2 = motionList.begin(); iter2 != motionList.end(); ++iter2)
{
- paramMotion->first->onUpdate(time, joint_mask);
+ const ParameterizedMotion& paramMotion = *iter2;
+ paramMotion.first->onUpdate(time, joint_mask);
- F32 distToParam = paramMotion->second - *paramValue;
+ F32 distToParam = paramMotion.second - *paramValue;
if ( distToParam <= 0.f)
{
// keep track of the motion closest to the parameter value
- firstMotion = paramMotion;
+ firstMotion = &paramMotion;
}
else
{
@@ -212,13 +212,13 @@ BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask)
// so store the first motion we find as the second one we want to blend...
if (firstMotion && !secondMotion )
{
- secondMotion = paramMotion;
+ secondMotion = &paramMotion;
}
//...or, if we've seen no other motion so far, make sure we blend to this only
else if (!firstMotion)
{
- firstMotion = paramMotion;
- secondMotion = paramMotion;
+ firstMotion = &paramMotion;
+ secondMotion = &paramMotion;
}
}
}
@@ -283,12 +283,14 @@ BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask)
//-----------------------------------------------------------------------------
void LLKeyframeMotionParam::onDeactivate()
{
- for (U32 i = 0; i < mParameterizedMotions.length(); i++)
+ for (motion_map_t::iterator iter = mParameterizedMotions.begin();
+ iter != mParameterizedMotions.end(); ++iter)
{
- LLLinkedList< ParameterizedMotion > *motionList = *mParameterizedMotions.getValueAt(i);
- for (ParameterizedMotion* paramMotion = motionList->getFirstData(); paramMotion; paramMotion = motionList->getNextData())
+ motion_list_t& motionList = iter->second;
+ for (motion_list_t::iterator iter2 = motionList.begin(); iter2 != motionList.end(); ++iter2)
{
- paramMotion->first->onDeactivate();
+ const ParameterizedMotion& paramMotion = *iter2;
+ paramMotion.first->onDeactivate();
}
}
}
@@ -307,23 +309,8 @@ BOOL LLKeyframeMotionParam::addKeyframeMotion(char *name, const LLUUID &id, char
newMotion->setName(name);
- // make sure a list of motions exists for this parameter
- LLLinkedList< ParameterizedMotion > *motionList;
- if (mParameterizedMotions.getValue(param))
- {
- motionList = *mParameterizedMotions.getValue(param);
- }
- else
- {
- motionList = new LLLinkedList< ParameterizedMotion >;
- motionList->setInsertBefore(sortFunc);
- mParameterizedMotions.addToHead(param, motionList);
- }
-
// now add motion to this list
- ParameterizedMotion *parameterizedMotion = new ParameterizedMotion(newMotion, value);
-
- motionList->addDataSorted(parameterizedMotion);
+ mParameterizedMotions[param].insert(ParameterizedMotion(newMotion, value));
return TRUE;
}
@@ -334,14 +321,16 @@ BOOL LLKeyframeMotionParam::addKeyframeMotion(char *name, const LLUUID &id, char
//-----------------------------------------------------------------------------
void LLKeyframeMotionParam::setDefaultKeyframeMotion(char *name)
{
- for (U32 i = 0; i < mParameterizedMotions.length(); i++)
+ for (motion_map_t::iterator iter = mParameterizedMotions.begin();
+ iter != mParameterizedMotions.end(); ++iter)
{
- LLLinkedList< ParameterizedMotion > *motionList = *mParameterizedMotions.getValueAt(i);
- for (ParameterizedMotion* paramMotion = motionList->getFirstData(); paramMotion; paramMotion = motionList->getNextData())
+ motion_list_t& motionList = iter->second;
+ for (motion_list_t::iterator iter2 = motionList.begin(); iter2 != motionList.end(); ++iter2)
{
- if (paramMotion->first->getName() == name)
+ const ParameterizedMotion& paramMotion = *iter2;
+ if (paramMotion.first->getName() == name)
{
- mDefaultKeyframeMotion = paramMotion->first;
+ mDefaultKeyframeMotion = paramMotion.first;
}
}
}
diff --git a/indra/llcharacter/llkeyframemotionparam.h b/indra/llcharacter/llkeyframemotionparam.h
index 39a02aea25..305207eb09 100644
--- a/indra/llcharacter/llkeyframemotionparam.h
+++ b/indra/llcharacter/llkeyframemotionparam.h
@@ -143,8 +143,20 @@ protected:
// Member Data
//-------------------------------------------------------------------------
- typedef LLLinkedList < ParameterizedMotion > motion_list_t;
- LLAssocList <std::string, motion_list_t* > mParameterizedMotions;
+ struct compare_motions
+ {
+ bool operator() (const ParameterizedMotion& a, const ParameterizedMotion& b) const
+ {
+ if (a.second != b.second)
+ return (a.second < b.second);
+ else
+ return a.first < b.first;
+ }
+ };
+
+ typedef std::set < ParameterizedMotion, compare_motions > motion_list_t;
+ typedef std::map <std::string, motion_list_t > motion_map_t;
+ motion_map_t mParameterizedMotions;
LLMotion* mDefaultKeyframeMotion;
LLCharacter* mCharacter;
LLPoseBlender mPoseBlender;
diff --git a/indra/llcharacter/llpose.h b/indra/llcharacter/llpose.h
index 5ba579a167..0c71fd77b3 100644
--- a/indra/llcharacter/llpose.h
+++ b/indra/llcharacter/llpose.h
@@ -37,10 +37,8 @@
//-----------------------------------------------------------------------------
#include <string>
-#include "linked_lists.h"
#include "llmap.h"
#include "lljointstate.h"
-#include "llassoclist.h"
#include "lljoint.h"
#include <map>
diff --git a/indra/llcharacter/llstatemachine.h b/indra/llcharacter/llstatemachine.h
index 6983729147..c19a926dbb 100644
--- a/indra/llcharacter/llstatemachine.h
+++ b/indra/llcharacter/llstatemachine.h
@@ -34,7 +34,6 @@
#include <string>
-#include "llassoclist.h"
#include "llerror.h"
#include <map>
diff --git a/indra/llcommon/linden_common.h b/indra/llcommon/linden_common.h
index 504552a9d2..9ee4d1159e 100644
--- a/indra/llcommon/linden_common.h
+++ b/indra/llcommon/linden_common.h
@@ -62,6 +62,7 @@
#pragma warning (disable : 4100) // unreferenced formal parameter
#pragma warning (disable : 4127) // conditional expression is constant (e.g. while(1) )
#pragma warning (disable : 4244) // possible loss of data on conversions
+#pragma warning (disable : 4396) // the inline specifier cannot be used when a friend declaration refers to a specialization of a function template
#pragma warning (disable : 4512) // assignment operator could not be generated
#pragma warning (disable : 4706) // assignment within conditional (even if((x = y)) )
#endif // LL_WINDOWS
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp
index 7346b29fb1..98393dacd1 100644
--- a/indra/llcommon/llsys.cpp
+++ b/indra/llcommon/llsys.cpp
@@ -679,7 +679,8 @@ BOOL gunzip_file(const char *srcfile, const char *dstfile)
size_t nwrit = fwrite(buffer, sizeof(U8), bytes, dst);
if (nwrit < (size_t) bytes)
{
- llerrs << "Short write on " << tmpfile << llendl;
+ llwarns << "Short write on " << tmpfile << ": Wrote " << nwrit << " of " << bytes << " bytes." << llendl;
+ goto err;
}
} while(gzeof(src) == 0);
fclose(dst);
diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
index 65db226ff9..02b956d86c 100644
--- a/indra/llcommon/llversionviewer.h
+++ b/indra/llcommon/llversionviewer.h
@@ -34,8 +34,8 @@
const S32 LL_VERSION_MAJOR = 1;
const S32 LL_VERSION_MINOR = 19;
-const S32 LL_VERSION_PATCH = 0;
-const S32 LL_VERSION_BUILD = 5;
+const S32 LL_VERSION_PATCH = 1;
+const S32 LL_VERSION_BUILD = 0;
const char * const LL_CHANNEL = "Second Life Release";
diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp
index 81001a2c9d..15beeec866 100644
--- a/indra/llinventory/llparcel.cpp
+++ b/indra/llinventory/llparcel.cpp
@@ -332,6 +332,12 @@ void LLParcel::setMediaType(const char* type)
// abstraction layer.
set_std_string(type, mMediaType);
mMediaType = rawstr_to_utf8(mMediaType);
+
+ // This code attempts to preserve legacy movie functioning
+ if(mMediaType.empty() && ! mMediaURL.empty())
+ {
+ setMediaType("video/vnd.secondlife.qt.legacy");
+ }
}
void LLParcel::setMediaWidth(S32 width)
{
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index ab2eef0ee9..44fef9daf6 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -1854,55 +1854,70 @@ inline LLVector3 sculpt_rgb_to_vector(U8 r, U8 g, U8 b)
return value;
}
+inline U32 sculpt_xy_to_index(U32 x, U32 y, U16 sculpt_width, U16 sculpt_height, S8 sculpt_components)
+{
+ U32 index = (x + y * sculpt_width) * sculpt_components;
-// sculpt replaces generate() for sculpted surfaces
-void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, S32 sculpt_level)
+ // attempt to resolve DEV-11158 - remove assert later.
+ llassert(index < sculpt_width * sculpt_height * sculpt_components);
+
+ return index;
+}
+
+
+inline U32 sculpt_st_to_index(S32 s, S32 t, S32 size_s, S32 size_t, U16 sculpt_width, U16 sculpt_height, S8 sculpt_components)
{
- U8 sculpt_type = mParams.getSculptType();
+ U32 x = (U32) ((F32)s/(size_s) * (F32) sculpt_width);
+ U32 y = (U32) ((F32)t/(size_t) * (F32) sculpt_height);
- BOOL data_is_empty = FALSE;
+ return sculpt_xy_to_index(x, y, sculpt_width, sculpt_height, sculpt_components);
+}
- if (sculpt_width == 0 || sculpt_height == 0 || sculpt_data == NULL)
- {
- sculpt_level = -1;
- data_is_empty = TRUE;
- }
- mPathp->generate(mDetail, 0, TRUE);
- mProfilep->generate(mPathp->isOpen(), mDetail, 0, TRUE);
-
+inline LLVector3 sculpt_index_to_vector(U32 index, const U8* sculpt_data)
+{
+ LLVector3 v = sculpt_rgb_to_vector(sculpt_data[index], sculpt_data[index+1], sculpt_data[index+2]);
+
+ return v;
+}
+
+inline LLVector3 sculpt_st_to_vector(S32 s, S32 t, S32 size_s, S32 size_t, U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data)
+{
+ U32 index = sculpt_st_to_index(s, t, size_s, size_t, sculpt_width, sculpt_height, sculpt_components);
+
+ return sculpt_index_to_vector(index, sculpt_data);
+}
+
+inline LLVector3 sculpt_xy_to_vector(U32 x, U32 y, U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data)
+{
+ U32 index = sculpt_xy_to_index(x, y, sculpt_width, sculpt_height, sculpt_components);
+
+ return sculpt_index_to_vector(index, sculpt_data);
+}
+
+
+F32 LLVolume::sculptGetSurfaceArea(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data)
+{
+ // test to see if image has enough variation to create non-degenerate geometry
+
S32 sizeS = mPathp->mPath.size();
S32 sizeT = mProfilep->mProfile.size();
- sNumMeshPoints -= mMesh.size();
- mMesh.resize(sizeS * sizeT);
- sNumMeshPoints += mMesh.size();
-
F32 area = 0;
- // first test to see if image has enough variation to create non-degenerate geometry
- if (!data_is_empty)
+
+ if ((sculpt_width != 0) &&
+ (sculpt_height != 0) &&
+ (sculpt_components != 0) &&
+ (sculpt_data != NULL))
{
for (S32 s = 0; s < sizeS - 1; s++)
{
for (S32 t = 0; t < sizeT - 1; t++)
{
- // first coordinate
- U32 x = (U32) ((F32)s/(sizeS) * (F32) sculpt_width);
- U32 y = (U32) ((F32)t/(sizeT) * (F32) sculpt_height);
-
- // coordinate offset by 1
- U32 x2 = (U32) ((F32)(s+1)/(sizeS) * (F32) sculpt_width);
- U32 y2 = (U32) ((F32)(t+1)/(sizeT) * (F32) sculpt_height);
-
- // three points on a triagle - find the image indices first
- U32 p1_index = (x + y * sculpt_width) * sculpt_components;
- U32 p2_index = (x2 + y * sculpt_width) * sculpt_components;
- U32 p3_index = (x + y2 * sculpt_width) * sculpt_components;
-
// convert image data to vectors
- LLVector3 p1 = sculpt_rgb_to_vector(sculpt_data[p1_index], sculpt_data[p1_index+1], sculpt_data[p1_index+2]);
- LLVector3 p2 = sculpt_rgb_to_vector(sculpt_data[p2_index], sculpt_data[p2_index+1], sculpt_data[p2_index+2]);
- LLVector3 p3 = sculpt_rgb_to_vector(sculpt_data[p3_index], sculpt_data[p3_index+1], sculpt_data[p3_index+2]);
+ LLVector3 p1 = sculpt_st_to_vector(s, t, sizeS, sizeT, sculpt_width, sculpt_height, sculpt_components, sculpt_data);
+ LLVector3 p2 = sculpt_st_to_vector(s+1, t, sizeS, sizeT, sculpt_width, sculpt_height, sculpt_components, sculpt_data);
+ LLVector3 p3 = sculpt_st_to_vector(s, t+1, sizeS, sizeT, sculpt_width, sculpt_height, sculpt_components, sculpt_data);
// compute the area of the parallelogram by taking the length of the cross product:
// (parallegram is an approximation of two triangles)
@@ -1910,99 +1925,151 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components,
area += cross.magVec();
}
}
- if (area < SCULPT_MIN_AREA)
- data_is_empty = TRUE;
}
- //generate vertex positions
- if (data_is_empty) // if empty, make a sphere
- {
- S32 line = 0;
+ return area;
+}
+
+// create placeholder shape
+void LLVolume::sculptGeneratePlaceholder()
+{
+ S32 sizeS = mPathp->mPath.size();
+ S32 sizeT = mProfilep->mProfile.size();
+
+ S32 line = 0;
- for (S32 s = 0; s < sizeS; s++)
+ // for now, this is a sphere.
+ for (S32 s = 0; s < sizeS; s++)
+ {
+ for (S32 t = 0; t < sizeT; t++)
{
- for (S32 t = 0; t < sizeT; t++)
- {
- S32 i = t + line;
- Point& pt = mMesh[i];
+ S32 i = t + line;
+ Point& pt = mMesh[i];
- F32 u = (F32)s/(sizeS-1);
- F32 v = (F32)t/(sizeT-1);
+ F32 u = (F32)s/(sizeS-1);
+ F32 v = (F32)t/(sizeT-1);
- const F32 RADIUS = (F32) 0.3;
+ const F32 RADIUS = (F32) 0.3;
- pt.mPos.mV[0] = (F32)(sin(F_PI * v) * cos(2.0 * F_PI * u) * RADIUS);
- pt.mPos.mV[1] = (F32)(sin(F_PI * v) * sin(2.0 * F_PI * u) * RADIUS);
- pt.mPos.mV[2] = (F32)(cos(F_PI * v) * RADIUS);
+ pt.mPos.mV[0] = (F32)(sin(F_PI * v) * cos(2.0 * F_PI * u) * RADIUS);
+ pt.mPos.mV[1] = (F32)(sin(F_PI * v) * sin(2.0 * F_PI * u) * RADIUS);
+ pt.mPos.mV[2] = (F32)(cos(F_PI * v) * RADIUS);
- }
- line += sizeT;
}
- }
- else
+ line += sizeT;
+ }
+}
+
+// create the vertices from the map
+void LLVolume::sculptGenerateMapVertices(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, U8 sculpt_type)
+{
+ S32 sizeS = mPathp->mPath.size();
+ S32 sizeT = mProfilep->mProfile.size();
+
+ S32 line = 0;
+ for (S32 s = 0; s < sizeS; s++)
{
- S32 line = 0;
- for (S32 s = 0; s < sizeS; s++)
+ // Run along the profile.
+ for (S32 t = 0; t < sizeT; t++)
{
- // Run along the profile.
- for (S32 t = 0; t < sizeT; t++)
- {
- S32 i = t + line;
- Point& pt = mMesh[i];
+ S32 i = t + line;
+ Point& pt = mMesh[i];
- U32 x = (U32) ((F32)t/(sizeT-1) * (F32) sculpt_width);
- U32 y = (U32) ((F32)s/(sizeS-1) * (F32) sculpt_height);
+ U32 x = (U32) ((F32)t/(sizeT-1) * (F32) sculpt_width);
+ U32 y = (U32) ((F32)s/(sizeS-1) * (F32) sculpt_height);
- if (y == 0) // top row stitching
+ if (y == 0) // top row stitching
+ {
+ // pinch?
+ if (sculpt_type == LL_SCULPT_TYPE_SPHERE)
{
- // pinch?
- if (sculpt_type == LL_SCULPT_TYPE_SPHERE)
- {
- x = sculpt_width / 2;
- }
+ x = sculpt_width / 2;
}
+ }
- if (y == sculpt_height) // bottom row stitching
+ if (y == sculpt_height) // bottom row stitching
+ {
+ // wrap?
+ if (sculpt_type == LL_SCULPT_TYPE_TORUS)
{
- // wrap?
- if (sculpt_type == LL_SCULPT_TYPE_TORUS)
- {
- y = 0;
- }
- else
- {
- y = sculpt_height - 1;
- }
+ y = 0;
+ }
+ else
+ {
+ y = sculpt_height - 1;
+ }
- // pinch?
- if (sculpt_type == LL_SCULPT_TYPE_SPHERE)
- {
- x = sculpt_width / 2;
- }
+ // pinch?
+ if (sculpt_type == LL_SCULPT_TYPE_SPHERE)
+ {
+ x = sculpt_width / 2;
}
+ }
- if (x == sculpt_width) // side stitching
+ if (x == sculpt_width) // side stitching
+ {
+ // wrap?
+ if ((sculpt_type == LL_SCULPT_TYPE_SPHERE) ||
+ (sculpt_type == LL_SCULPT_TYPE_TORUS) ||
+ (sculpt_type == LL_SCULPT_TYPE_CYLINDER))
{
- // wrap?
- if ((sculpt_type == LL_SCULPT_TYPE_SPHERE) ||
- (sculpt_type == LL_SCULPT_TYPE_TORUS) ||
- (sculpt_type == LL_SCULPT_TYPE_CYLINDER))
- {
- x = 0;
- }
+ x = 0;
+ }
- else
- {
- x = sculpt_width - 1;
- }
+ else
+ {
+ x = sculpt_width - 1;
}
-
- U32 index = (x + y * sculpt_width) * sculpt_components;
- pt.mPos = sculpt_rgb_to_vector(sculpt_data[index], sculpt_data[index+1], sculpt_data[index+2]);
}
- line += sizeT;
+
+ pt.mPos = sculpt_xy_to_vector(x, y, sculpt_width, sculpt_height, sculpt_components, sculpt_data);
}
+ line += sizeT;
+ }
+}
+
+
+// sculpt replaces generate() for sculpted surfaces
+void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, S32 sculpt_level)
+{
+ U8 sculpt_type = mParams.getSculptType();
+
+ BOOL data_is_empty = FALSE;
+
+ if (sculpt_width == 0 || sculpt_height == 0 || sculpt_components == 0 || sculpt_data == NULL)
+ {
+ sculpt_level = -1;
+ data_is_empty = TRUE;
+ }
+
+ mPathp->generate(mDetail, 0, TRUE);
+ mProfilep->generate(mPathp->isOpen(), mDetail, 0, TRUE);
+
+ S32 sizeS = mPathp->mPath.size();
+ S32 sizeT = mProfilep->mProfile.size();
+
+ // weird crash bug - DEV-11158 - trying to collect more data:
+ if ((sizeS == 0) || (sizeT == 0))
+ {
+ llwarns << "sculpt bad mesh size " << sizeS << " " << sizeT << llendl;
+ }
+
+ sNumMeshPoints -= mMesh.size();
+ mMesh.resize(sizeS * sizeT);
+ sNumMeshPoints += mMesh.size();
+
+ if (sculptGetSurfaceArea(sculpt_width, sculpt_height, sculpt_components, sculpt_data) < SCULPT_MIN_AREA)
+ data_is_empty = TRUE;
+
+ //generate vertex positions
+ if (data_is_empty) // if empty, make a placeholder mesh
+ {
+ sculptGeneratePlaceholder();
+ }
+ else
+ {
+ sculptGenerateMapVertices(sculpt_width, sculpt_height, sculpt_components, sculpt_data, sculpt_type);
}
for (S32 i = 0; i < (S32)mProfilep->mFaces.size(); i++)
diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h
index 3e61947947..9af02d2629 100644
--- a/indra/llmath/llvolume.h
+++ b/indra/llmath/llvolume.h
@@ -903,6 +903,10 @@ public:
LLVector3 mLODScaleBias; // vector for biasing LOD based on scale
void sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, S32 sculpt_level);
+private:
+ F32 sculptGetSurfaceArea(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data);
+ void sculptGenerateMapVertices(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, U8 sculpt_type);
+ void sculptGeneratePlaceholder();
protected:
BOOL generate();
diff --git a/indra/llmessage/llcircuit.h b/indra/llmessage/llcircuit.h
index 1a6611f5d4..8824e6825a 100644
--- a/indra/llmessage/llcircuit.h
+++ b/indra/llmessage/llcircuit.h
@@ -37,7 +37,6 @@
#include <vector>
#include "llerror.h"
-#include "linked_lists.h"
#include "lltimer.h"
#include "timing.h"
diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 8afcb6ba4f..8b9a45ff3f 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -121,6 +121,7 @@ void LLCurl::Responder::error(U32 status, const std::string& reason)
// virtual
void LLCurl::Responder::result(const LLSD& content)
{
+ llwarns << "Virtual Function not implemented" << llendl;
}
// virtual
diff --git a/indra/llmessage/llnamevalue.h b/indra/llmessage/llnamevalue.h
index 1bdfeb2365..7a4c80f3f3 100644
--- a/indra/llmessage/llnamevalue.h
+++ b/indra/llmessage/llnamevalue.h
@@ -33,7 +33,6 @@
#define LL_LLNAMEVALUE_H
#include "string_table.h"
-#include "llskipmap.h"
#include "llmath.h"
#include "v3math.h"
#include "lldbstrings.h"
diff --git a/indra/llmessage/llpacketring.h b/indra/llmessage/llpacketring.h
index 109d5e60dd..0e1450ac1b 100644
--- a/indra/llmessage/llpacketring.h
+++ b/indra/llmessage/llpacketring.h
@@ -36,7 +36,6 @@
#include <queue>
#include "llpacketbuffer.h"
-#include "linked_lists.h"
#include "llhost.h"
#include "net.h"
#include "llthrottle.h"
diff --git a/indra/llmessage/llxfermanager.cpp b/indra/llmessage/llxfermanager.cpp
index c4dd3406b4..a612e181cd 100644
--- a/indra/llmessage/llxfermanager.cpp
+++ b/indra/llmessage/llxfermanager.cpp
@@ -90,8 +90,9 @@ void LLXferManager::free ()
{
LLXfer *xferp;
LLXfer *delp;
-
- mOutgoingHosts.deleteAllData();
+
+ for_each(mOutgoingHosts.begin(), mOutgoingHosts.end(), DeletePointer());
+ mOutgoingHosts.clear();
delp = mSendList;
while (delp)
@@ -155,12 +156,15 @@ void LLXferManager::updateHostStatus()
LLXfer *xferp;
LLHostStatus *host_statusp = NULL;
- mOutgoingHosts.deleteAllData();
+ for_each(mOutgoingHosts.begin(), mOutgoingHosts.end(), DeletePointer());
+ mOutgoingHosts.clear();
for (xferp = mSendList; xferp; xferp = xferp->mNext)
{
- for (host_statusp = mOutgoingHosts.getFirstData(); host_statusp; host_statusp = mOutgoingHosts.getNextData())
+ for (status_list_t::iterator iter = mOutgoingHosts.begin();
+ iter != mOutgoingHosts.end(); ++iter)
{
+ host_statusp = *iter;
if (host_statusp->mHost == xferp->mRemoteHost)
{
break;
@@ -172,7 +176,7 @@ void LLXferManager::updateHostStatus()
if (host_statusp)
{
host_statusp->mHost = xferp->mRemoteHost;
- mOutgoingHosts.addData(host_statusp);
+ mOutgoingHosts.push_front(host_statusp);
}
}
if (host_statusp)
@@ -195,12 +199,14 @@ void LLXferManager::updateHostStatus()
void LLXferManager::printHostStatus()
{
LLHostStatus *host_statusp = NULL;
- if (mOutgoingHosts.getFirstData())
+ if (!mOutgoingHosts.empty())
{
llinfos << "Outgoing Xfers:" << llendl;
- for (host_statusp = mOutgoingHosts.getFirstData(); host_statusp; host_statusp = mOutgoingHosts.getNextData())
+ for (status_list_t::iterator iter = mOutgoingHosts.begin();
+ iter != mOutgoingHosts.end(); ++iter)
{
+ host_statusp = *iter;
llinfos << " " << host_statusp->mHost << " active: " << host_statusp->mNumActive << " pending: " << host_statusp->mNumPending << llendl;
}
}
@@ -275,8 +281,10 @@ S32 LLXferManager::numPendingXfers(const LLHost &host)
{
LLHostStatus *host_statusp = NULL;
- for (host_statusp = mOutgoingHosts.getFirstData(); host_statusp; host_statusp = mOutgoingHosts.getNextData())
+ for (status_list_t::iterator iter = mOutgoingHosts.begin();
+ iter != mOutgoingHosts.end(); ++iter)
{
+ host_statusp = *iter;
if (host_statusp->mHost == host)
{
return (host_statusp->mNumPending);
@@ -291,8 +299,10 @@ S32 LLXferManager::numActiveXfers(const LLHost &host)
{
LLHostStatus *host_statusp = NULL;
- for (host_statusp = mOutgoingHosts.getFirstData(); host_statusp; host_statusp = mOutgoingHosts.getNextData())
+ for (status_list_t::iterator iter = mOutgoingHosts.begin();
+ iter != mOutgoingHosts.end(); ++iter)
{
+ host_statusp = *iter;
if (host_statusp->mHost == host)
{
return (host_statusp->mNumActive);
@@ -307,8 +317,10 @@ void LLXferManager::changeNumActiveXfers(const LLHost &host, S32 delta)
{
LLHostStatus *host_statusp = NULL;
- for (host_statusp = mOutgoingHosts.getFirstData(); host_statusp; host_statusp = mOutgoingHosts.getNextData())
+ for (status_list_t::iterator iter = mOutgoingHosts.begin();
+ iter != mOutgoingHosts.end(); ++iter)
{
+ host_statusp = *iter;
if (host_statusp->mHost == host)
{
host_statusp->mNumActive += delta;
@@ -1010,15 +1022,15 @@ void LLXferManager::startPendingDownloads()
// stateful iteration, it would be possible for old requests to
// never start.
LLXfer* xferp = mReceiveList;
- LLLinkedList<LLXfer> pending_downloads;
+ std::list<LLXfer*> pending_downloads;
S32 download_count = 0;
S32 pending_count = 0;
while(xferp)
{
if(xferp->mStatus == e_LL_XFER_PENDING)
{
- ++pending_count; // getLength() is O(N), so track it here.
- pending_downloads.addData(xferp);
+ ++pending_count;
+ pending_downloads.push_front(xferp);
}
else if(xferp->mStatus == e_LL_XFER_IN_PROGRESS)
{
@@ -1036,16 +1048,18 @@ void LLXferManager::startPendingDownloads()
if((start_count > 0) && (pending_count > 0))
{
S32 result;
- xferp = pending_downloads.getFirstData();
- while(start_count-- && xferp)
+ for (std::list<LLXfer*>::iterator iter = pending_downloads.begin();
+ iter != pending_downloads.end(); ++iter)
{
+ xferp = *iter;
+ if (start_count-- <= 0)
+ break;
result = xferp->startDownload();
if(result)
{
xferp->abort(result);
++start_count;
}
- xferp = pending_downloads.getNextData();
}
}
}
diff --git a/indra/llmessage/llxfermanager.h b/indra/llmessage/llxfermanager.h
index 5d213bbc71..c4af8fe937 100644
--- a/indra/llmessage/llxfermanager.h
+++ b/indra/llmessage/llxfermanager.h
@@ -45,7 +45,6 @@ class LLVFS;
#include "llxfer.h"
#include "message.h"
#include "llassetstorage.h"
-#include "linked_lists.h"
#include "lldir.h"
#include "lllinkedqueue.h"
#include "llthrottle.h"
@@ -101,7 +100,8 @@ class LLXferManager
LLXfer *mSendList;
LLXfer *mReceiveList;
- LLLinkedList <LLHostStatus> mOutgoingHosts;
+ typedef std::list<LLHostStatus*> status_list_t;
+ status_list_t mOutgoingHosts;
private:
protected:
diff --git a/indra/llmessage/message.h b/indra/llmessage/message.h
index 4debcddf99..61d34b7fc1 100644
--- a/indra/llmessage/message.h
+++ b/indra/llmessage/message.h
@@ -216,8 +216,6 @@ class LLMessageSystem
LLPacketRing mPacketRing;
LLReliablePacketParams mReliablePacketParams;
- //LLLinkedList<LLPacketAck> mAckList;
-
// Set this flag to TRUE when you want *very* verbose logs.
BOOL mVerboseLog;
diff --git a/indra/llprimitive/llmaterialtable.cpp b/indra/llprimitive/llmaterialtable.cpp
index 9970a035d7..40cf97099c 100644
--- a/indra/llprimitive/llmaterialtable.cpp
+++ b/indra/llprimitive/llmaterialtable.cpp
@@ -32,6 +32,7 @@
#include "linden_common.h"
#include "llmaterialtable.h"
+#include "llstl.h"
#include "material_codes.h"
#include "sound_ids.h"
#include "imageids.h"
@@ -70,7 +71,8 @@ LLMaterialTable::~LLMaterialTable()
mRollingSoundMatrix = NULL;
}
- mMaterialInfoList.deleteAllData();
+ for_each(mMaterialInfoList.begin(), mMaterialInfoList.end(), DeletePointer());
+ mMaterialInfoList.clear();
}
void LLMaterialTable::initBasicTable()
@@ -290,7 +292,7 @@ BOOL LLMaterialTable::add(U8 mcode, char* name, const LLUUID &uuid)
// Add at the end so the order in menus matches the order in this
// file. JNC 11.30.01
- mMaterialInfoList.addDataAtEnd(infop);
+ mMaterialInfoList.push_back(infop);
return TRUE;
}
@@ -336,10 +338,10 @@ BOOL LLMaterialTable::addRollingSound(U8 mcode, U8 mcode2, const LLUUID &uuid)
BOOL LLMaterialTable::addShatterSound(U8 mcode, const LLUUID &uuid)
{
- LLMaterialInfo *infop;
-
- for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() )
+ for (info_list_t::iterator iter = mMaterialInfoList.begin();
+ iter != mMaterialInfoList.end(); ++iter)
{
+ LLMaterialInfo *infop = *iter;
if (mcode == infop->mMCode)
{
infop->mShatterSoundID = uuid;
@@ -352,10 +354,10 @@ BOOL LLMaterialTable::addShatterSound(U8 mcode, const LLUUID &uuid)
BOOL LLMaterialTable::addDensity(U8 mcode, const F32 &density)
{
- LLMaterialInfo *infop;
-
- for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() )
+ for (info_list_t::iterator iter = mMaterialInfoList.begin();
+ iter != mMaterialInfoList.end(); ++iter)
{
+ LLMaterialInfo *infop = *iter;
if (mcode == infop->mMCode)
{
infop->mDensity = density;
@@ -368,10 +370,10 @@ BOOL LLMaterialTable::addDensity(U8 mcode, const F32 &density)
BOOL LLMaterialTable::addRestitution(U8 mcode, const F32 &restitution)
{
- LLMaterialInfo *infop;
-
- for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() )
+ for (info_list_t::iterator iter = mMaterialInfoList.begin();
+ iter != mMaterialInfoList.end(); ++iter)
{
+ LLMaterialInfo *infop = *iter;
if (mcode == infop->mMCode)
{
infop->mRestitution = restitution;
@@ -384,10 +386,10 @@ BOOL LLMaterialTable::addRestitution(U8 mcode, const F32 &restitution)
BOOL LLMaterialTable::addFriction(U8 mcode, const F32 &friction)
{
- LLMaterialInfo *infop;
-
- for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() )
+ for (info_list_t::iterator iter = mMaterialInfoList.begin();
+ iter != mMaterialInfoList.end(); ++iter)
{
+ LLMaterialInfo *infop = *iter;
if (mcode == infop->mMCode)
{
infop->mFriction = friction;
@@ -400,10 +402,10 @@ BOOL LLMaterialTable::addFriction(U8 mcode, const F32 &friction)
BOOL LLMaterialTable::addDamageAndEnergy(U8 mcode, const F32 &hp_mod, const F32 &damage_mod, const F32 &ep_mod)
{
- LLMaterialInfo *infop;
-
- for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() )
+ for (info_list_t::iterator iter = mMaterialInfoList.begin();
+ iter != mMaterialInfoList.end(); ++iter)
{
+ LLMaterialInfo *infop = *iter;
if (mcode == infop->mMCode)
{
infop->mHPModifier = hp_mod;
@@ -418,10 +420,10 @@ BOOL LLMaterialTable::addDamageAndEnergy(U8 mcode, const F32 &hp_mod, const F32
LLUUID LLMaterialTable::getDefaultTextureID(char* name)
{
- LLMaterialInfo *infop;
-
- for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() )
+ for (info_list_t::iterator iter = mMaterialInfoList.begin();
+ iter != mMaterialInfoList.end(); ++iter)
{
+ LLMaterialInfo *infop = *iter;
if (!strcmp(name, infop->mName))
{
return infop->mDefaultTextureID;
@@ -434,12 +436,11 @@ LLUUID LLMaterialTable::getDefaultTextureID(char* name)
LLUUID LLMaterialTable::getDefaultTextureID(U8 mcode)
{
- LLMaterialInfo *infop;
-
mcode &= LL_MCODE_MASK;
-
- for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() )
+ for (info_list_t::iterator iter = mMaterialInfoList.begin();
+ iter != mMaterialInfoList.end(); ++iter)
{
+ LLMaterialInfo *infop = *iter;
if (mcode == infop->mMCode)
{
return infop->mDefaultTextureID;
@@ -452,10 +453,10 @@ LLUUID LLMaterialTable::getDefaultTextureID(U8 mcode)
U8 LLMaterialTable::getMCode(const char* name)
{
- LLMaterialInfo *infop;
-
- for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() )
+ for (info_list_t::iterator iter = mMaterialInfoList.begin();
+ iter != mMaterialInfoList.end(); ++iter)
{
+ LLMaterialInfo *infop = *iter;
if (!strcmp(name, infop->mName))
{
return infop->mMCode;
@@ -468,12 +469,11 @@ U8 LLMaterialTable::getMCode(const char* name)
char* LLMaterialTable::getName(U8 mcode)
{
- LLMaterialInfo *infop;
-
mcode &= LL_MCODE_MASK;
-
- for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() )
+ for (info_list_t::iterator iter = mMaterialInfoList.begin();
+ iter != mMaterialInfoList.end(); ++iter)
{
+ LLMaterialInfo *infop = *iter;
if (mcode == infop->mMCode)
{
return infop->mName;
@@ -569,11 +569,11 @@ LLUUID LLMaterialTable::getGroundCollisionParticleUUID(U8 mcode)
F32 LLMaterialTable::getDensity(U8 mcode)
{
- LLMaterialInfo *infop;
-
mcode &= LL_MCODE_MASK;
- for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() )
+ for (info_list_t::iterator iter = mMaterialInfoList.begin();
+ iter != mMaterialInfoList.end(); ++iter)
{
+ LLMaterialInfo *infop = *iter;
if (mcode == infop->mMCode)
{
return infop->mDensity;
@@ -585,11 +585,11 @@ F32 LLMaterialTable::getDensity(U8 mcode)
F32 LLMaterialTable::getRestitution(U8 mcode)
{
- LLMaterialInfo *infop;
-
mcode &= LL_MCODE_MASK;
- for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() )
+ for (info_list_t::iterator iter = mMaterialInfoList.begin();
+ iter != mMaterialInfoList.end(); ++iter)
{
+ LLMaterialInfo *infop = *iter;
if (mcode == infop->mMCode)
{
return infop->mRestitution;
@@ -601,11 +601,11 @@ F32 LLMaterialTable::getRestitution(U8 mcode)
F32 LLMaterialTable::getFriction(U8 mcode)
{
- LLMaterialInfo *infop;
-
mcode &= LL_MCODE_MASK;
- for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() )
+ for (info_list_t::iterator iter = mMaterialInfoList.begin();
+ iter != mMaterialInfoList.end(); ++iter)
{
+ LLMaterialInfo *infop = *iter;
if (mcode == infop->mMCode)
{
return infop->mFriction;
@@ -617,11 +617,11 @@ F32 LLMaterialTable::getFriction(U8 mcode)
F32 LLMaterialTable::getHPMod(U8 mcode)
{
- LLMaterialInfo *infop;
-
mcode &= LL_MCODE_MASK;
- for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() )
+ for (info_list_t::iterator iter = mMaterialInfoList.begin();
+ iter != mMaterialInfoList.end(); ++iter)
{
+ LLMaterialInfo *infop = *iter;
if (mcode == infop->mMCode)
{
return infop->mHPModifier;
@@ -633,11 +633,11 @@ F32 LLMaterialTable::getHPMod(U8 mcode)
F32 LLMaterialTable::getDamageMod(U8 mcode)
{
- LLMaterialInfo *infop;
-
mcode &= LL_MCODE_MASK;
- for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() )
+ for (info_list_t::iterator iter = mMaterialInfoList.begin();
+ iter != mMaterialInfoList.end(); ++iter)
{
+ LLMaterialInfo *infop = *iter;
if (mcode == infop->mMCode)
{
return infop->mDamageModifier;
@@ -649,11 +649,11 @@ F32 LLMaterialTable::getDamageMod(U8 mcode)
F32 LLMaterialTable::getEPMod(U8 mcode)
{
- LLMaterialInfo *infop;
-
mcode &= LL_MCODE_MASK;
- for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() )
+ for (info_list_t::iterator iter = mMaterialInfoList.begin();
+ iter != mMaterialInfoList.end(); ++iter)
{
+ LLMaterialInfo *infop = *iter;
if (mcode == infop->mMCode)
{
return infop->mEPModifier;
@@ -665,11 +665,11 @@ F32 LLMaterialTable::getEPMod(U8 mcode)
LLUUID LLMaterialTable::getShatterSoundUUID(U8 mcode)
{
- LLMaterialInfo *infop;
-
mcode &= LL_MCODE_MASK;
- for (infop = mMaterialInfoList.getFirstData(); infop != NULL; infop = mMaterialInfoList.getNextData() )
+ for (info_list_t::iterator iter = mMaterialInfoList.begin();
+ iter != mMaterialInfoList.end(); ++iter)
{
+ LLMaterialInfo *infop = *iter;
if (mcode == infop->mMCode)
{
return infop->mShatterSoundID;
diff --git a/indra/llprimitive/llmaterialtable.h b/indra/llprimitive/llmaterialtable.h
index e786a868e9..46b6f070d9 100644
--- a/indra/llprimitive/llmaterialtable.h
+++ b/indra/llprimitive/llmaterialtable.h
@@ -84,7 +84,9 @@ public:
class LLMaterialTable
{
public:
- LLLinkedList<LLMaterialInfo> mMaterialInfoList;
+ typedef std::list<LLMaterialInfo*> info_list_t;
+ info_list_t mMaterialInfoList;
+
LLUUID *mCollisionSoundMatrix;
LLUUID *mSlidingSoundMatrix;
LLUUID *mRollingSoundMatrix;
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 5eb55e0420..32ee0227d0 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -185,7 +185,7 @@ public:
// Defaults to destroy().
virtual void onClose(bool app_quitting) { destroy(); }
- virtual BOOL canClose() const { return TRUE; }
+ virtual BOOL canClose() { return TRUE; }
virtual void setVisible(BOOL visible);
void setFrontmost(BOOL take_focus = TRUE);
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index 0e64c6df5c..8d1bab6bd7 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -344,7 +344,8 @@ BOOL LLTabContainer::handleMouseDown( S32 x, S32 y, MASK mask )
handled = LLPanel::handleMouseDown( x, y, mask );
}
- if (getTabCount() > 0)
+ S32 tab_count = getTabCount();
+ if (tab_count > 0)
{
LLTabTuple* firsttuple = getTab(0);
LLRect tab_rect;
@@ -364,7 +365,9 @@ BOOL LLTabContainer::handleMouseDown( S32 x, S32 y, MASK mask )
}
if( tab_rect.pointInRect( x, y ) )
{
- LLButton* tab_button = getTab(getCurrentPanelIndex())->mButton;
+ S32 index = getCurrentPanelIndex();
+ index = llclamp(index, 0, tab_count-1);
+ LLButton* tab_button = getTab(index)->mButton;
gFocusMgr.setMouseCapture(this);
gFocusMgr.setKeyboardFocus(tab_button);
}
diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index fce0d055e6..43f3081321 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -415,7 +415,7 @@ void LLSplashScreen::hide()
//
// TODO: replace with std::set
-static LLLinkedList<LLWindow> sWindowList;
+static std::set<LLWindow*> sWindowList;
LLWindow* LLWindowManager::createWindow(
char *title,
@@ -481,13 +481,13 @@ LLWindow* LLWindowManager::createWindow(
llwarns << "LLWindowManager::create() : Error creating window." << llendl;
return NULL;
}
- sWindowList.addDataAtEnd(new_window);
+ sWindowList.insert(new_window);
return new_window;
}
BOOL LLWindowManager::destroyWindow(LLWindow* window)
{
- if (!sWindowList.checkData(window))
+ if (sWindowList.find(window) == sWindowList.end())
{
llerrs << "LLWindowManager::destroyWindow() : Window pointer not valid, this window doesn't exist!"
<< llendl;
@@ -496,7 +496,7 @@ BOOL LLWindowManager::destroyWindow(LLWindow* window)
window->close();
- sWindowList.removeData(window);
+ sWindowList.erase(window);
delete window;
@@ -505,5 +505,5 @@ BOOL LLWindowManager::destroyWindow(LLWindow* window)
BOOL LLWindowManager::isWindowValid(LLWindow *window)
{
- return sWindowList.checkData(window);
+ return sWindowList.find(window) != sWindowList.end();
}
diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp
index d3778853dd..4ad44f455f 100644
--- a/indra/llxml/llcontrol.cpp
+++ b/indra/llxml/llcontrol.cpp
@@ -69,8 +69,6 @@ std::set<LLControlBase*> LLControlBase::mChangedControls;
const S32 CURRENT_VERSION = 101;
-BOOL control_insert_before( LLControlBase* first, LLControlBase* second );
-
BOOL LLControl::llsd_compare(const LLSD& a, const LLSD & b)
{
switch (mType)
@@ -1033,6 +1031,13 @@ U32 LLControlGroup::loadFromFile(const LLString& filename, BOOL require_declarat
return validitems;
}
+struct compare_controls
+{
+ bool operator() (const LLControlBase* const a, const LLControlBase* const b) const
+ {
+ return a->getName() < b->getName();
+ }
+};
U32 LLControlGroup::saveToFile(const LLString& filename, BOOL nondefault_only)
{
@@ -1042,13 +1047,14 @@ U32 LLControlGroup::saveToFile(const LLString& filename, BOOL nondefault_only)
// place the objects in a temporary container that enforces a sort
// order to ease manual editing of the file
- LLLinkedList< LLControlBase > controls;
- controls.setInsertBefore( &control_insert_before );
- LLString name;
+
+ typedef std::set< LLControlBase*, compare_controls > control_list_t;
+ control_list_t controls;
+
for (ctrl_name_table_t::iterator iter = mNameTable.begin();
iter != mNameTable.end(); iter++)
{
- name = iter->first;
+ LLString name = iter->first;
if (name.empty())
{
CONTROL_ERRS << "Control with no name found!!!" << llendl;
@@ -1065,7 +1071,7 @@ U32 LLControlGroup::saveToFile(const LLString& filename, BOOL nondefault_only)
{
if (!(nondefault_only && (control->mIsDefault)))
{
- controls.addDataSorted( control );
+ controls.insert( control );
}
else
{
@@ -1088,12 +1094,12 @@ U32 LLControlGroup::saveToFile(const LLString& filename, BOOL nondefault_only)
// Write file version
file << "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>\n";
file << "<settings version = \"" << CURRENT_VERSION << "\">\n";
- for( LLControlBase* control = controls.getFirstData();
- control != NULL;
- control = controls.getNextData() )
+ for (control_list_t::iterator iter = controls.begin();
+ iter != controls.end(); ++iter)
{
+ LLControlBase* control = *iter;
file << "\t<!--" << control->comment() << "-->" << ENDL;
- name = control->name();
+ LLString name = control->getName();
switch (control->type())
{
case TYPE_U32:
@@ -1165,7 +1171,7 @@ U32 LLControlGroup::saveToFile(const LLString& filename, BOOL nondefault_only)
file << "</settings>\n";
file.close();
- return controls.getLength();
+ return controls.size();
}
void LLControlGroup::applyOverrides(const std::map<std::string, std::string>& overrides)
@@ -1435,8 +1441,3 @@ void main()
}
#endif
-BOOL control_insert_before( LLControlBase* first, LLControlBase* second )
-{
- return ( first->getName().compare(second->getName()) < 0 );
-}
-
diff --git a/indra/newview/English.lproj/InfoPlist.strings b/indra/newview/English.lproj/InfoPlist.strings
index 608a6ad733..5bca4eab5e 100644
--- a/indra/newview/English.lproj/InfoPlist.strings
+++ b/indra/newview/English.lproj/InfoPlist.strings
@@ -1,5 +1,5 @@
/* Localized versions of Info.plist keys */
CFBundleName = "Second Life";
-CFBundleShortVersionString = "Second Life version 1.19.0.5";
-CFBundleGetInfoString = "Second Life version 1.19.0.5, Copyright 2004-2007 Linden Research, Inc.";
+CFBundleShortVersionString = "Second Life version 1.19.1.0";
+CFBundleGetInfoString = "Second Life version 1.19.1.0, Copyright 2004-2008 Linden Research, Inc.";
diff --git a/indra/newview/Info-SecondLife.plist b/indra/newview/Info-SecondLife.plist
index e257d6f3aa..6f8c464466 100644
--- a/indra/newview/Info-SecondLife.plist
+++ b/indra/newview/Info-SecondLife.plist
@@ -32,7 +32,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
- <string>1.19.0.5</string>
+ <string>1.19.1.0</string>
<key>CSResourcesFileMapped</key>
<true/>
</dict>
diff --git a/indra/newview/app_settings/shaders/class2/environment/waterF.glsl b/indra/newview/app_settings/shaders/class2/environment/waterF.glsl
index 8f3d11badc..6ec3dc4788 100644
--- a/indra/newview/app_settings/shaders/class2/environment/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/environment/waterF.glsl
@@ -48,7 +48,7 @@ void main()
vec3 df = vec3(
dot(viewVec, wave1),
- dot(viewVec, wave2),
+ dot(viewVec, (wave2 + wave3) * 0.5),
dot(viewVec, wave3)
) * fresnelScale + fresnelOffset;
df *= df;
diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt
index 8a023de5f6..898751d3f1 100644
--- a/indra/newview/featuretable.txt
+++ b/indra/newview/featuretable.txt
@@ -49,6 +49,8 @@ UseOcclusion 1 1
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
WLSkyDetail 1 128
+Disregard128DefaultDrawDistance 1 1
+Disregard96DefaultDrawDistance 1 1
//
// Low Graphics Settings
@@ -238,8 +240,6 @@ RenderVBOEnable 1 0
list Intel
RenderAnisotropic 1 0
RenderLightingDetail 1 0
-RenderTerrainDetail 1 0
-RenderVBOEnable 1 0
list GeForce2
RenderAnisotropic 1 0
@@ -248,9 +248,78 @@ RenderMaxPartCount 1 2048
RenderTerrainDetail 1 0
RenderVBOEnable 1 1
+
+list Intel_830M
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_845G
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_855GM
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_865G
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_900
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_915GM
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_915G
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_945GM
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_945G
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_950
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
list Intel_965
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
UseOcclusion 0 0
+list Intel_G33
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_Bear_Lake
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_Broadwater
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_Brookdale
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_Montara
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_Springdale
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+
+
list ATI_Mobility_Radeon_9800
RenderAvatarCloth 0 0
VertexShaderEnable 0 0
@@ -265,29 +334,60 @@ list ATI_Mobility_Radeon_9600
RenderAvatarCloth 0 0
VertexShaderEnable 0 0
WindLightUseAtmosShaders 0 0
+Disregard96DefaultDrawDistance 1 0
+
+
+/// tweaked ATI to 96 Draw distance
+
+list ATI_Radeon_9000
+Disregard96DefaultDrawDistance 1 0
+list ATI_Radeon_9200
+Disregard96DefaultDrawDistance 1 0
+list ATI_Radeon_9500
+Disregard96DefaultDrawDistance 1 0
+list ATI_Radeon_9600
+Disregard96DefaultDrawDistance 1 0
+
+/// tweaked ATI to 128 draw distance
+
+list ATI_Radeon_X300
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X400
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X500
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X600
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X700
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X1300
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X1400
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X1500
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X1600
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X1700
+Disregard128DefaultDrawDistance 1 0
+
+list ATI_Mobility_Radeon_X1xxx
+Disregard128DefaultDrawDistance 1 0
+
+
// Avatar hardware skinning causes
// invisible avatars on x2600... so I masked
-// out other possible bad ones till it's fixed
-list ATI_Radeon_X2400
-RenderAvatarVP 0 0
-RenderAvatarCloth 0 0
-list ATI_Radeon_X2600
-RenderAvatarVP 0 0
-RenderAvatarCloth 0 0
-list ATI_Radeon_X2900
-RenderAvatarVP 0 0
-RenderAvatarCloth 0 0
-list ATI_Radeon_X3800
-RenderAvatarVP 0 0
-RenderAvatarCloth 0 0
+// out other possible bad ones till it's fixed in 8.2
list ATI_Radeon_HD_2300
RenderAvatarVP 0 0
RenderAvatarCloth 0 0
+Disregard128DefaultDrawDistance 1 0
list ATI_Radeon_HD_2400
RenderAvatarVP 0 0
RenderAvatarCloth 0 0
+Disregard128DefaultDrawDistance 1 0
list ATI_Radeon_HD_2600
RenderAvatarVP 0 0
RenderAvatarCloth 0 0
@@ -301,6 +401,7 @@ RenderAvatarCloth 0 0
list ATI_ASUS_AH24xx
RenderAvatarVP 0 0
RenderAvatarCloth 0 0
+Disregard128DefaultDrawDistance 1 0
list ATI_ASUS_AH26xx
RenderAvatarVP 0 0
RenderAvatarCloth 0 0
@@ -314,17 +415,74 @@ list ATI_ASUS_EAH38xx
RenderAvatarVP 0 0
RenderAvatarCloth 0 0
+
+/// Tweaked NVIDIA
+
+list NVIDIA_GeForce_FX_5100
+Disregard96DefaultDrawDistance 1 0
+list NVIDIA_GeForce_FX_5200
+Disregard96DefaultDrawDistance 1 0
+list NVIDIA_GeForce_FX_5500
+Disregard96DefaultDrawDistance 1 0
+list NVIDIA_GeForce_FX_5600
+Disregard96DefaultDrawDistance 1 0
+
+list NVIDIA_GeForce_FX_Go5100
+Disregard96DefaultDrawDistance 1 0
+list NVIDIA_GeForce_FX_Go5200
+Disregard96DefaultDrawDistance 1 0
+list NVIDIA_GeForce_FX_Go5300
+Disregard96DefaultDrawDistance 1 0
+list NVIDIA_GeForce_FX_Go5500
+Disregard96DefaultDrawDistance 1 0
+list NVIDIA_GeForce_FX_Go5600
+Disregard96DefaultDrawDistance 1 0
+
+list NVIDIA_GeForce_6100
+Disregard128DefaultDrawDistance 1 0
+list NVIDIA_GeForce_6200
+Disregard128DefaultDrawDistance 1 0
+list NVIDIA_GeForce_6500
+Disregard128DefaultDrawDistance 1 0
+list NVIDIA_GeForce_6600
+Disregard128DefaultDrawDistance 1 0
+
+list NVIDIA_G73
+Disregard128DefaultDrawDistance 1 0
+
list NVIDIA_GeForce_Go_6100
RenderVBOEnable 1 0
+Disregard128DefaultDrawDistance 1 0
list NVIDIA_GeForce_Go_6200
RenderVBOEnable 1 0
+Disregard128DefaultDrawDistance 1 0
list NVIDIA_GeForce_Go_6500
RenderVBOEnable 1 0
+Disregard128DefaultDrawDistance 1 0
list NVIDIA_GeForce_Go_6600
RenderVBOEnable 1 0
+Disregard128DefaultDrawDistance 1 0
list NVIDIA_GeForce_Go_6700
RenderVBOEnable 1 0
+Disregard128DefaultDrawDistance 1 0
list NVIDIA_GeForce_Go_6800
RenderVBOEnable 1 0
+Disregard128DefaultDrawDistance 1 0
list NVIDIA_GeForce_Go_6
RenderVBOEnable 1 0
+Disregard128DefaultDrawDistance 1 0
+
+list NVIDIA_GeForce_7200
+Disregard128DefaultDrawDistance 1 0
+list NVIDIA_GeForce_7300
+Disregard128DefaultDrawDistance 1 0
+list NVIDIA_GeForce_7400
+Disregard128DefaultDrawDistance 1 0
+
+list NVIDIA_GeForce_Go_7200
+Disregard128DefaultDrawDistance 1 0
+list NVIDIA_GeForce_Go_7300
+Disregard128DefaultDrawDistance 1 0
+list NVIDIA_GeForce_Go_7400
+Disregard128DefaultDrawDistance 1 0
+
diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt
index ccffc8d424..d7921ffb59 100644
--- a/indra/newview/featuretable_linux.txt
+++ b/indra/newview/featuretable_linux.txt
@@ -49,6 +49,8 @@ UseOcclusion 1 1
VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
WLSkyDetail 1 128
+Disregard128DefaultDrawDistance 1 1
+Disregard96DefaultDrawDistance 1 1
//
// Low Graphics Settings
@@ -271,50 +273,153 @@ list ATI_Mobility_Radeon_9600
RenderAvatarCloth 0 0
VertexShaderEnable 0 0
WindLightUseAtmosShaders 0 0
+Disregard96DefaultDrawDistance 1 0
+
+
+/// tweaked ATI to 96 Draw distance
+
+list ATI_Radeon_9000
+Disregard96DefaultDrawDistance 1 0
+list ATI_Radeon_9200
+Disregard96DefaultDrawDistance 1 0
+list ATI_Radeon_9500
+Disregard96DefaultDrawDistance 1 0
+list ATI_Radeon_9600
+Disregard96DefaultDrawDistance 1 0
+
+/// tweaked ATI to 128 draw distance
+
+list ATI_Radeon_X300
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X400
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X500
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X600
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X700
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X1300
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X1400
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X1500
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X1600
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X1700
+Disregard128DefaultDrawDistance 1 0
+list ATI_Mobility_Radeon_X1xxx
+Disregard128DefaultDrawDistance 1 0
+
+
+
// Avatar hardware skinning causes
-// invisible avatars on x2600... so I masked
+// invisible avatars on HD 2400... so I masked
// out other possible bad ones till it's fixed
-list ATI_Radeon_X2400
+
+list ATI_Radeon_HD_2300
RenderAvatarVP 0 0
RenderAvatarCloth 0 0
-list ATI_Radeon_X2600
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_HD_2400
RenderAvatarVP 0 0
RenderAvatarCloth 0 0
-list ATI_Radeon_X2900
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_HD_2600
+RenderAvatarVP 0 0
+RenderAvatarCloth 0 0
+list ATI_Radeon_HD_2900
RenderAvatarVP 0 0
RenderAvatarCloth 0 0
-list ATI_Radeon_X3800
+list ATI_Radeon_HD_3800
RenderAvatarVP 0 0
RenderAvatarCloth 0 0
-list ATI_Radeon_HD_2300
+list ATI_ASUS_AH24xx
RenderAvatarVP 0 0
RenderAvatarCloth 0 0
-list ATI_Radeon_HD_2400
+Disregard128DefaultDrawDistance 1 0
+list ATI_ASUS_AH26xx
RenderAvatarVP 0 0
RenderAvatarCloth 0 0
-list ATI_Radeon_HD_2600
+list ATI_ASUS_EAH24xx
RenderAvatarVP 0 0
RenderAvatarCloth 0 0
-list ATI_Radeon_HD_2900
+list ATI_ASUS_EAH26xx
RenderAvatarVP 0 0
RenderAvatarCloth 0 0
-list ATI_Radeon_HD_3800
+list ATI_ASUS_EAH38xx
RenderAvatarVP 0 0
RenderAvatarCloth 0 0
+
+/// Tweaked NVIDIA
+
+list NVIDIA_GeForce_FX_5100
+Disregard96DefaultDrawDistance 1 0
+list NVIDIA_GeForce_FX_5200
+Disregard96DefaultDrawDistance 1 0
+list NVIDIA_GeForce_FX_5500
+Disregard96DefaultDrawDistance 1 0
+list NVIDIA_GeForce_FX_5600
+Disregard96DefaultDrawDistance 1 0
+
+list NVIDIA_GeForce_FX_Go5100
+Disregard96DefaultDrawDistance 1 0
+list NVIDIA_GeForce_FX_Go5200
+Disregard96DefaultDrawDistance 1 0
+list NVIDIA_GeForce_FX_Go5300
+Disregard96DefaultDrawDistance 1 0
+list NVIDIA_GeForce_FX_Go5500
+Disregard96DefaultDrawDistance 1 0
+list NVIDIA_GeForce_FX_Go5600
+Disregard96DefaultDrawDistance 1 0
+
+list NVIDIA_GeForce_6100
+Disregard128DefaultDrawDistance 1 0
+list NVIDIA_GeForce_6200
+Disregard128DefaultDrawDistance 1 0
+list NVIDIA_GeForce_6500
+Disregard128DefaultDrawDistance 1 0
+list NVIDIA_GeForce_6600
+Disregard128DefaultDrawDistance 1 0
+
+
list NVIDIA_GeForce_Go_6100
RenderVBOEnable 1 0
+Disregard128DefaultDrawDistance 1 0
list NVIDIA_GeForce_Go_6200
RenderVBOEnable 1 0
+Disregard128DefaultDrawDistance 1 0
list NVIDIA_GeForce_Go_6500
RenderVBOEnable 1 0
+Disregard128DefaultDrawDistance 1 0
list NVIDIA_GeForce_Go_6600
RenderVBOEnable 1 0
+Disregard128DefaultDrawDistance 1 0
list NVIDIA_GeForce_Go_6700
RenderVBOEnable 1 0
+Disregard128DefaultDrawDistance 1 0
list NVIDIA_GeForce_Go_6800
RenderVBOEnable 1 0
+Disregard128DefaultDrawDistance 1 0
list NVIDIA_GeForce_Go_6
RenderVBOEnable 1 0
+Disregard128DefaultDrawDistance 1 0
+
+list NVIDIA_GeForce_7200
+Disregard128DefaultDrawDistance 1 0
+list NVIDIA_GeForce_7300
+Disregard128DefaultDrawDistance 1 0
+list NVIDIA_GeForce_7400
+Disregard128DefaultDrawDistance 1 0
+
+list NVIDIA_GeForce_Go_7200
+Disregard128DefaultDrawDistance 1 0
+list NVIDIA_GeForce_Go_7300
+Disregard128DefaultDrawDistance 1 0
+list NVIDIA_GeForce_Go_7400
+Disregard128DefaultDrawDistance 1 0
+
diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt
index bebb51fc12..9645ff8abf 100644
--- a/indra/newview/featuretable_mac.txt
+++ b/indra/newview/featuretable_mac.txt
@@ -50,6 +50,8 @@ VertexShaderEnable 1 1
WindLightUseAtmosShaders 1 1
WLSkyDetail 1 128
RenderUseCleverUI 1 1
+Disregard128DefaultDrawDistance 1 1
+Disregard96DefaultDrawDistance 1 1
//
// Low Graphics Settings
@@ -239,8 +241,6 @@ RenderVBOEnable 1 0
list Intel
RenderAnisotropic 1 0
RenderLightingDetail 1 0
-RenderTerrainDetail 1 0
-RenderVBOEnable 1 0
list GeForce2
RenderAnisotropic 1 0
@@ -249,9 +249,78 @@ RenderMaxPartCount 1 2048
RenderTerrainDetail 1 0
RenderVBOEnable 1 1
+list Intel_830M
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_845G
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_855GM
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_865G
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_900
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_915GM
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_915G
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_945GM
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_945G
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_950
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
list Intel_965
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
UseOcclusion 0 0
+list Intel_G33
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_Bear_Lake
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_Broadwater
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_Brookdale
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_X3100
+WindLightUseAtmosShaders 0 0
+
+list Intel_Montara
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
+list Intel_Springdale
+RenderTerrainDetail 1 0
+RenderVBOEnable 1 0
+
list ATI_Mobility_Radeon_9800
RenderAvatarCloth 0 0
VertexShaderEnable 0 0
@@ -266,29 +335,60 @@ list ATI_Mobility_Radeon_9600
RenderAvatarCloth 0 0
VertexShaderEnable 0 0
WindLightUseAtmosShaders 0 0
+Disregard96DefaultDrawDistance 1 0
+
+
+/// tweaked ATI to 96 Draw distance
+
+list ATI_Radeon_9000
+Disregard96DefaultDrawDistance 1 0
+list ATI_Radeon_9200
+Disregard96DefaultDrawDistance 1 0
+list ATI_Radeon_9500
+Disregard96DefaultDrawDistance 1 0
+list ATI_Radeon_9600
+Disregard96DefaultDrawDistance 1 0
+
+/// tweaked ATI to 128 draw distance
+
+list ATI_Radeon_X300
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X400
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X500
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X600
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X700
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X1300
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X1400
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X1500
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X1600
+Disregard128DefaultDrawDistance 1 0
+list ATI_Radeon_X1700
+Disregard128DefaultDrawDistance 1 0
+list ATI_Mobility_Radeon_X1xxx
+Disregard128DefaultDrawDistance 1 0
+
+
+
// Avatar hardware skinning causes
-// invisible avatars on x2600... so I masked
+// invisible avatars on HD 2600... so I masked
// out other possible bad ones till it's fixed
-list ATI_Radeon_X2400
-RenderAvatarVP 0 0
-RenderAvatarCloth 0 0
-list ATI_Radeon_X2600
-RenderAvatarVP 0 0
-RenderAvatarCloth 0 0
-list ATI_Radeon_X2900
-RenderAvatarVP 0 0
-RenderAvatarCloth 0 0
-list ATI_Radeon_X3800
-RenderAvatarVP 0 0
-RenderAvatarCloth 0 0
list ATI_Radeon_HD_2300
RenderAvatarVP 0 0
RenderAvatarCloth 0 0
+Disregard128DefaultDrawDistance 1 0
list ATI_Radeon_HD_2400
RenderAvatarVP 0 0
RenderAvatarCloth 0 0
+Disregard128DefaultDrawDistance 1 0
list ATI_Radeon_HD_2600
RenderAvatarVP 0 0
RenderAvatarCloth 0 0
@@ -299,17 +399,69 @@ list ATI_Radeon_HD_3800
RenderAvatarVP 0 0
RenderAvatarCloth 0 0
+/// Tweaked NVIDIA
+
+list NVIDIA_GeForce_FX_5100
+Disregard96DefaultDrawDistance 1 0
+list NVIDIA_GeForce_FX_5200
+Disregard96DefaultDrawDistance 1 0
+list NVIDIA_GeForce_FX_5500
+Disregard96DefaultDrawDistance 1 0
+
+list NVIDIA_GeForce_FX_Go5100
+Disregard96DefaultDrawDistance 1 0
+list NVIDIA_GeForce_FX_Go5200
+Disregard96DefaultDrawDistance 1 0
+list NVIDIA_GeForce_FX_Go5300
+Disregard96DefaultDrawDistance 1 0
+list NVIDIA_GeForce_FX_Go5500
+Disregard96DefaultDrawDistance 1 0
+list NVIDIA_GeForce_FX_Go5600
+Disregard96DefaultDrawDistance 1 0
+
+list NVIDIA_GeForce_6100
+Disregard128DefaultDrawDistance 1 0
+list NVIDIA_GeForce_6200
+Disregard128DefaultDrawDistance 1 0
+list NVIDIA_GeForce_6500
+Disregard128DefaultDrawDistance 1 0
+list NVIDIA_GeForce_6600
+Disregard128DefaultDrawDistance 1 0
+
+
list NVIDIA_GeForce_Go_6100
RenderVBOEnable 1 0
+Disregard128DefaultDrawDistance 1 0
list NVIDIA_GeForce_Go_6200
RenderVBOEnable 1 0
+Disregard128DefaultDrawDistance 1 0
list NVIDIA_GeForce_Go_6500
RenderVBOEnable 1 0
+Disregard128DefaultDrawDistance 1 0
list NVIDIA_GeForce_Go_6600
RenderVBOEnable 1 0
+Disregard128DefaultDrawDistance 1 0
list NVIDIA_GeForce_Go_6700
RenderVBOEnable 1 0
+Disregard128DefaultDrawDistance 1 0
list NVIDIA_GeForce_Go_6800
RenderVBOEnable 1 0
+Disregard128DefaultDrawDistance 1 0
list NVIDIA_GeForce_Go_6
RenderVBOEnable 1 0
+Disregard128DefaultDrawDistance 1 0
+
+list NVIDIA_GeForce_7200
+Disregard128DefaultDrawDistance 1 0
+list NVIDIA_GeForce_7300
+Disregard128DefaultDrawDistance 1 0
+list NVIDIA_GeForce_7400
+Disregard128DefaultDrawDistance 1 0
+
+list NVIDIA_GeForce_Go_7200
+Disregard128DefaultDrawDistance 1 0
+list NVIDIA_GeForce_Go_7300
+Disregard128DefaultDrawDistance 1 0
+list NVIDIA_GeForce_Go_7400
+Disregard128DefaultDrawDistance 1 0
+
diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt
index 5d73a70497..066cd980b6 100644
--- a/indra/newview/gpu_table.txt
+++ b/indra/newview/gpu_table.txt
@@ -28,7 +28,7 @@ ATI All-in-Wonder X800 .*ATI.*All-in-Wonder X8.* 2 1
ATI All-in-Wonder X1800 .*ATI.*All-in-Wonder X18.* 3 1
ATI All-in-Wonder X1900 .*ATI.*All-in-Wonder X19.* 3 1
ATI ASUS A9xxx .*ATI.*ASUS.*A9.* 1 1
-ATI ASUS AH24xx .*ATI.*ASUS.*AH24.* 3 1
+ATI ASUS AH24xx .*ATI.*ASUS.*AH24.* 1 1
ATI ASUS AH26xx .*ATI.*ASUS.*AH26.* 3 1
ATI ASUS AX3xx .*ATI.*ASUS.*AX3.* 1 1
ATI ASUS AX5xx .*ATI.*ASUS.*AX5.* 1 1
@@ -56,8 +56,8 @@ ATI Mobility Radeon X6xx .*ATI.*Mobility.*X6.* 1 1
ATI Mobility Radeon X7xx .*ATI.*Mobility.*X7.* 1 1
ATI Mobility Radeon Xxxx .*ATI.*Mobility.*X.* 1 1
ATI Mobility Radeon .*ATI.*Mobility.* 0 1
-ATI Radeon HD 2300 .*ATI.*Radeon HD 23.* 2 1
-ATI Radeon HD 2400 .*ATI.*Radeon HD 24.* 2 1
+ATI Radeon HD 2300 .*ATI.*Radeon HD 23.* 1 1
+ATI Radeon HD 2400 .*ATI.*Radeon HD 24.* 1 1
ATI Radeon HD 2600 .*ATI.*Radeon HD 26.* 2 1
ATI Radeon HD 2900 .*ATI.*Radeon HD 29.* 3 1
ATI Radeon HD 3800 .*ATI.*Radeon HD 38.* 3 1
@@ -76,7 +76,7 @@ ATI Radeon RX700 .*ATI.*RX70.* 1 1
ATI Radeon RX800 .*ATI.*Radeon *RX80.* 2 1
ATI Radeon VE .*ATI.*Radeon.*VE.* 0 0
ATI Radeon X1000 .*ATI.*Radeon *X10.* 0 1
-ATI Radeon X1200 .*ATI.*Radeon *X12.* 1 1
+ATI Radeon X1200 .*ATI.*Radeon *X12.* 0 1
ATI Radeon X1300 .*ATI.*Radeon *X13.* 1 1
ATI Radeon X1400 .*ATI.*Radeon X14.* 1 1
ATI Radeon X1500 .*ATI.*Radeon X15.* 1 1
@@ -84,9 +84,6 @@ ATI Radeon X1600 .*ATI.*Radeon X16.* 1 1
ATI Radeon X1700 .*ATI.*Radeon X17.* 1 1
ATI Radeon X1800 .*ATI.*Radeon X18.* 3 1
ATI Radeon X1900 .*ATI.*Radeon X19.* 3 1
-ATI Radeon X2400 .*ATI.*Radeon X24.* 3 1
-ATI Radeon X2600 .*ATI.*Radeon X26.* 3 1
-ATI Radeon X2900 .*ATI.*Radeon X29.* 3 1
ATI Radeon X300 .*ATI.*Radeon *X3.* 1 1
ATI Radeon X400 .*ATI.*Radeon X4.* 1 1
ATI Radeon X500 .*ATI.*Radeon X5.* 1 1
@@ -99,7 +96,7 @@ ATI Rage 128 .*ATI.*Rage 128.* 0 1
ATI RV250 .*ATI.*RV250.* 0 1
ATI RV530 .*ATI.*RV530.* 1 1
ATI RX700 .*ATI.*RX700.* 1 1
-Intel x3100 .*Intel.*x3100 0 1
+Intel X3100 .*Intel.*X3100.* 1 1
Intel 830M .*Intel.*830M 0 0
Intel 845G .*Intel.*845G 0 0
Intel 855GM .*Intel.*855GM 0 0
@@ -120,7 +117,7 @@ Intel Springdale .*Intel.*Springdale.* 0 0
Matrox .*Matrox.* 0 0
Mesa .*Mesa.* 0 0
NVIDIA G72 .*NVIDIA.*G72.* 1 1
-NVIDIA G73 .*NVIDIA.*G73.* 2 1
+NVIDIA G73 .*NVIDIA.*G73.* 1 1
NVIDIA GeForce .*GeForce 256.* 0 0
NVIDIA GeForce 2 .*GeForce2.* 0 1
NVIDIA GeForce 3 .*GeForce3.* 0 1
@@ -134,7 +131,7 @@ NVIDIA GeForce 6600 .*NVIDIA.*GeForce 66.* 1 1
NVIDIA GeForce 6700 .*NVIDIA.*GeForce 67.* 2 1
NVIDIA GeForce 6800 .*NVIDIA.*GeForce 68.* 2 1
NVIDIA GeForce 7000 .*NVIDIA.*GeForce 70.* 0 1
-NVIDIA GeForce 7100 .*NVIDIA.*GeForce 71.* 1 1
+NVIDIA GeForce 7100 .*NVIDIA.*GeForce 71.* 0 1
NVIDIA GeForce 7200 .*NVIDIA.*GeForce 72.* 1 1
NVIDIA GeForce 7300 .*NVIDIA.*GeForce 73.* 1 1
NVIDIA GeForce 7500 .*NVIDIA.*GeForce 75.* 1 1
@@ -178,6 +175,7 @@ NVIDIA GeForce Go 7900 .*NVIDIA.*GeForce Go 79.* 2 1
NVIDIA GeForce Go 6 .*GeForce Go 6.* 1 1
NVIDIA GeForce PCX .*GeForce PCX.* 0 1
NVIDIA Generic .*NVIDIA.*Unknown.* 0 0
+NVIDIA NV43 .*NVIDIA.*NV43.* 1 1
NVIDIA Quadro2 .*Quadro2.* 0 0
NVIDIA Quadro4 .*Quadro4.* 0 0
NVIDIA Quadro DCC .*Quadro DCC.* 0 0
diff --git a/indra/newview/llappearance.h b/indra/newview/llappearance.h
index 2a4c1759ca..07c0c0cb68 100644
--- a/indra/newview/llappearance.h
+++ b/indra/newview/llappearance.h
@@ -32,24 +32,24 @@
#ifndef LL_LLAPPEARANCE_H
#define LL_LLAPPEARANCE_H
-#include "llskiplist.h"
#include "lluuid.h"
class LLAppearance
{
public:
LLAppearance() {}
- ~LLAppearance() { mParamMap.deleteAllData(); }
+ ~LLAppearance() { mParamMap.clear(); }
- void addParam( S32 id, F32 value ) { mParamMap.addData( id, new F32(value) ); }
- F32* getParam( S32 id ) { F32* temp = mParamMap.getIfThere( id ); return temp; } // temp works around an invalid warning.
+ void addParam( S32 id, F32 value ) { mParamMap[id] = value; }
+ F32 getParam( S32 id, F32 defval ) { return get_if_there(mParamMap, id, defval ); }
void addTexture( S32 te, const LLUUID& uuid ) { if( te < LLVOAvatar::TEX_NUM_ENTRIES ) mTextures[te] = uuid; }
const LLUUID& getTexture( S32 te ) { return ( te < LLVOAvatar::TEX_NUM_ENTRIES ) ? mTextures[te] : LLUUID::null; }
- void clear() { mParamMap.deleteAllData(); for( S32 i=0; i<LLVOAvatar::TEX_NUM_ENTRIES; i++ ) mTextures[i].setNull(); }
+ void clear() { mParamMap.clear(); for( S32 i=0; i<LLVOAvatar::TEX_NUM_ENTRIES; i++ ) mTextures[i].setNull(); }
- LLPtrSkipMap<S32, F32*> mParamMap;
+ typedef std::map<S32, F32> param_map_t;
+ param_map_t mParamMap;
LLUUID mTextures[LLVOAvatar::TEX_NUM_ENTRIES];
};
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index 814c209e67..09bcf6f7cc 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -127,7 +127,14 @@ LONG WINAPI viewer_windows_exception_handler(struct _EXCEPTION_POINTERS *excepti
return retval;
}
-int APIENTRY WinMain(HINSTANCE hInstance,
+
+#if DEBUGGING_SEH_FILTER
+# define WINMAIN DebuggingWinMain
+#else
+# define WINMAIN WinMain
+#endif
+
+int APIENTRY WINMAIN(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
@@ -207,6 +214,27 @@ int APIENTRY WinMain(HINSTANCE hInstance,
return 0;
}
+#if DEBUGGING_SEH_FILTER
+// The compiler doesn't like it when you use __try/__except blocks
+// in a method that uses object destructors. Go figure.
+// This winmain just calls the real winmain inside __try.
+// The __except calls our exception filter function. For debugging purposes.
+int APIENTRY WinMain(HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ LPSTR lpCmdLine,
+ int nCmdShow)
+{
+ __try
+ {
+ WINMAIN(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
+ }
+ __except( viewer_windows_exception_handler( GetExceptionInformation() ) )
+ {
+ _tprintf( _T("Exception handled.\n") );
+ }
+}
+#endif
+
void LLAppViewerWin32::disableWinErrorReporting()
{
const char win_xp_string[] = "Microsoft Windows XP";
diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp
index 1a4d3c16fd..087f8ac673 100644
--- a/indra/newview/llcompilequeue.cpp
+++ b/indra/newview/llcompilequeue.cpp
@@ -44,7 +44,6 @@
#include "llagent.h"
#include "llchat.h"
#include "llviewerwindow.h"
-#include "llcallbacklist.h"
#include "llviewerobject.h"
#include "llviewerobjectlist.h"
#include "llviewerregion.h"
diff --git a/indra/newview/lldebugmessagebox.cpp b/indra/newview/lldebugmessagebox.cpp
index de185e280d..371426d56e 100644
--- a/indra/newview/lldebugmessagebox.cpp
+++ b/indra/newview/lldebugmessagebox.cpp
@@ -39,7 +39,6 @@
#include "llsliderctrl.h"
#include "llcheckboxctrl.h"
#include "lltextbox.h"
-#include "llcallbacklist.h"
#include "lllineeditor.h"
#include "llfocusmgr.h"
diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp
index a4b3d259bb..c925cc058c 100644
--- a/indra/newview/lldynamictexture.cpp
+++ b/indra/newview/lldynamictexture.cpp
@@ -32,7 +32,6 @@
#include "llviewerprecompiledheaders.h"
#include "lldynamictexture.h"
-#include "linked_lists.h"
#include "llimagegl.h"
#include "llglheaders.h"
#include "llviewerwindow.h"
@@ -46,7 +45,7 @@
void render_ui_and_swap_if_needed();
// static
-LLLinkedList<LLDynamicTexture> LLDynamicTexture::sInstances[ LLDynamicTexture::ORDER_COUNT ];
+LLDynamicTexture::instance_list_t LLDynamicTexture::sInstances[ LLDynamicTexture::ORDER_COUNT ];
S32 LLDynamicTexture::sNumRenders = 0;
//-----------------------------------------------------------------------------
@@ -65,7 +64,7 @@ LLDynamicTexture::LLDynamicTexture(S32 width, S32 height, S32 components, EOrder
generateGLTexture();
llassert( 0 <= order && order < ORDER_COUNT );
- LLDynamicTexture::sInstances[ order ].addData(this);
+ LLDynamicTexture::sInstances[ order ].insert(this);
}
//-----------------------------------------------------------------------------
@@ -76,7 +75,7 @@ LLDynamicTexture::~LLDynamicTexture()
releaseGLTexture();
for( S32 order = 0; order < ORDER_COUNT; order++ )
{
- LLDynamicTexture::sInstances[order].removeData(this); // will fail in all but one case.
+ LLDynamicTexture::sInstances[order].erase(this); // will fail in all but one case.
}
}
@@ -214,10 +213,10 @@ BOOL LLDynamicTexture::updateAllInstances()
BOOL result = FALSE;
for( S32 order = 0; order < ORDER_COUNT; order++ )
{
- for (LLDynamicTexture *dynamicTexture = LLDynamicTexture::sInstances[order].getFirstData();
- dynamicTexture;
- dynamicTexture = LLDynamicTexture::sInstances[order].getNextData())
+ for (instance_list_t::iterator iter = LLDynamicTexture::sInstances[order].begin();
+ iter != LLDynamicTexture::sInstances[order].end(); ++iter)
{
+ LLDynamicTexture *dynamicTexture = *iter;
if (dynamicTexture->needsRender())
{
render_ui_and_swap_if_needed();
diff --git a/indra/newview/lldynamictexture.h b/indra/newview/lldynamictexture.h
index 49c8b0cdfb..9f647232c5 100644
--- a/indra/newview/lldynamictexture.h
+++ b/indra/newview/lldynamictexture.h
@@ -33,7 +33,6 @@
#define LL_LLDYNAMICTEXTURE_H
#include "llgl.h"
-#include "linked_lists.h"
#include "llcamera.h"
#include "llcoord.h"
#include "llimagegl.h"
@@ -84,7 +83,8 @@ protected:
LLCoordGL mOrigin;
LLCamera mCamera;
- static LLLinkedList<LLDynamicTexture> sInstances[ LLDynamicTexture::ORDER_COUNT ];
+ typedef std::set<LLDynamicTexture*> instance_list_t;
+ static instance_list_t sInstances[ LLDynamicTexture::ORDER_COUNT ];
static S32 sNumRenders;
};
diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp
index e29d8fb40d..c1194fa99e 100644
--- a/indra/newview/llfasttimerview.cpp
+++ b/indra/newview/llfasttimerview.cpp
@@ -95,7 +95,7 @@ static struct ft_display_info ft_display_table[] =
{ LLFastTimer::FTM_UPDATE_MOVE, " Move Objects", &LLColor4::pink2, 0 },
{ LLFastTimer::FTM_OCTREE_BALANCE, " Octree Balance", &LLColor4::red3, 0 },
{ LLFastTimer::FTM_SIMULATE_PARTICLES, " Particle Sim", &LLColor4::blue4, 0 },
- { LLFastTimer::FTM_OBJECTLIST_UPDATE, " Object Update", &LLColor4::purple1, 0 },
+ { LLFastTimer::FTM_OBJECTLIST_UPDATE, " Object Update", &LLColor4::purple1, 1 },
{ LLFastTimer::FTM_AVATAR_UPDATE, " Avatars", &LLColor4::purple2, 0 },
{ LLFastTimer::FTM_JOINT_UPDATE, " Joints", &LLColor4::purple3, 0 },
{ LLFastTimer::FTM_ATTACHMENT_UPDATE, " Attachments", &LLColor4::purple4, 0 },
@@ -124,7 +124,7 @@ static struct ft_display_info ft_display_table[] =
{ LLFastTimer::FTM_HUD_UPDATE, " HUD Update", &LLColor4::orange2, 0 },
{ LLFastTimer::FTM_UPDATE_SKY, " Sky Update", &LLColor4::cyan1, 0 },
{ LLFastTimer::FTM_UPDATE_TEXTURES, " Textures", &LLColor4::pink2, 0 },
- { LLFastTimer::FTM_GEO_UPDATE, " Geo Update", &LLColor4::blue3, 0 },
+ { LLFastTimer::FTM_GEO_UPDATE, " Geo Update", &LLColor4::blue3, 1 },
{ LLFastTimer::FTM_UPDATE_PRIMITIVES, " Volumes", &LLColor4::blue4, 0 },
{ LLFastTimer::FTM_GEN_VOLUME, " Gen Volume", &LLColor4::yellow3, 0 },
{ LLFastTimer::FTM_GEN_FLEX, " Flexible", &LLColor4::yellow4, 0 },
@@ -189,6 +189,7 @@ static struct ft_display_info ft_display_table[] =
{ LLFastTimer::FTM_SWAP, " Swap", &LLColor4::pink1, 0 },
{ LLFastTimer::FTM_CLIENT_COPY, " Client Copy", &LLColor4::red1, 1},
+#if 0 || !LL_RELEASE_FOR_DOWNLOAD
{ LLFastTimer::FTM_TEMP1, " Temp1", &LLColor4::red1, 0 },
{ LLFastTimer::FTM_TEMP2, " Temp2", &LLColor4::magenta1, 0 },
{ LLFastTimer::FTM_TEMP3, " Temp3", &LLColor4::red2, 0 },
@@ -197,7 +198,8 @@ static struct ft_display_info ft_display_table[] =
{ LLFastTimer::FTM_TEMP6, " Temp6", &LLColor4::magenta3, 0 },
{ LLFastTimer::FTM_TEMP7, " Temp7", &LLColor4::red4, 0 },
{ LLFastTimer::FTM_TEMP8, " Temp8", &LLColor4::magenta4, 0 },
-
+#endif
+
{ LLFastTimer::FTM_OTHER, " Other", &red0 }
};
static int ft_display_didcalc = 0;
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp
index 561d96d281..bf7d48f911 100644
--- a/indra/newview/llfeaturemanager.cpp
+++ b/indra/newview/llfeaturemanager.cpp
@@ -443,6 +443,20 @@ void LLFeatureManager::applyRecommendedSettings()
gSavedSettings.setU32("RenderQualityPerformance", level);
gSavedSettings.setBOOL("RenderCustomSettings", FALSE);
+ // now apply the tweaks to draw distance
+ // these are double negatives, because feature masks only work by
+ // downgrading values, so i needed to make a true value go to false
+ // for certain cards, thus the awkward name, "Disregard..."
+ if(!gSavedSettings.getBOOL("Disregard96DefaultDrawDistance"))
+ {
+ gSavedSettings.setF32("RenderFarClip", 96.0f);
+ }
+ else if(!gSavedSettings.getBOOL("Disregard128DefaultDrawDistance"))
+ {
+ gSavedSettings.setF32("RenderFarClip", 128.0f);
+ }
+
+
}
void LLFeatureManager::applyFeatures(bool skipFeatures)
diff --git a/indra/newview/llfeaturemanager.h b/indra/newview/llfeaturemanager.h
index 26d491b96f..3d05bbe2e0 100644
--- a/indra/newview/llfeaturemanager.h
+++ b/indra/newview/llfeaturemanager.h
@@ -35,7 +35,6 @@
#include "stdtypes.h"
#include "llstring.h"
-#include "llskipmap.h"
#include <map>
typedef enum EGPUClass
diff --git a/indra/newview/llfloaterbump.cpp b/indra/newview/llfloaterbump.cpp
index 3f6ed92868..2cf1f555ea 100644
--- a/indra/newview/llfloaterbump.cpp
+++ b/indra/newview/llfloaterbump.cpp
@@ -37,13 +37,12 @@
#include "llscrolllistctrl.h"
#include "llvieweruictrlfactory.h"
+#include "llviewermessage.h"
#include "llappviewer.h" // gPacificDaylightTime
///----------------------------------------------------------------------------
/// Local function declarations, constants, enums, and typedefs
///----------------------------------------------------------------------------
-extern LLLinkedList<LLMeanCollisionData> gMeanCollisionList;
-
LLFloaterBump* LLFloaterBump::sInstance = NULL;
///----------------------------------------------------------------------------
@@ -83,7 +82,7 @@ void LLFloaterBump::show(void *contents)
if (!list) return;
list->deleteAllItems();
- if (gMeanCollisionList.isEmpty())
+ if (gMeanCollisionList.empty())
{
LLString none_detected = sInstance->getString("none_detected");
LLSD row;
@@ -93,10 +92,10 @@ void LLFloaterBump::show(void *contents)
}
else
{
- for (LLMeanCollisionData* mcd = gMeanCollisionList.getFirstData();
- mcd;
- mcd = gMeanCollisionList.getNextData())
+ for (mean_collision_list_t::iterator iter = gMeanCollisionList.begin();
+ iter != gMeanCollisionList.end(); ++iter)
{
+ LLMeanCollisionData *mcd = *iter;
LLFloaterBump::add(list, mcd);
}
}
diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp
index 4097abc22d..7de980a075 100644
--- a/indra/newview/llfloatermap.cpp
+++ b/indra/newview/llfloatermap.cpp
@@ -118,7 +118,7 @@ LLFloaterMap *gFloaterMap = NULL;
LLFloaterMap::LLFloaterMap(const std::string& name)
:
LLFloater(name,
- "FloaterMapRect",
+ "FloaterMiniMapRect",
MAP_TITLE,
TRUE,
FLOATERMAP_MIN_WIDTH,
diff --git a/indra/newview/llfloaterpostcard.cpp b/indra/newview/llfloaterpostcard.cpp
index 044c8c9d90..4d97688b2a 100644
--- a/indra/newview/llfloaterpostcard.cpp
+++ b/indra/newview/llfloaterpostcard.cpp
@@ -67,7 +67,8 @@
/// Local function declarations, constants, enums, and typedefs
///----------------------------------------------------------------------------
-LLLinkedList<LLFloaterPostcard> LLFloaterPostcard::sInstances;
+//static
+LLFloaterPostcard::instance_list_t LLFloaterPostcard::sInstances;
///----------------------------------------------------------------------------
/// Class LLFloaterPostcard
@@ -97,13 +98,13 @@ void LLFloaterPostcard::init()
gAgent.sendReliableMessage();
}
- sInstances.addData(this);
+ sInstances.insert(this);
}
// Destroys the object
LLFloaterPostcard::~LLFloaterPostcard()
{
- sInstances.removeData(this);
+ sInstances.erase(this);
mJPEGImage = NULL; // deletes image
}
@@ -313,11 +314,10 @@ void LLFloaterPostcard::uploadCallback(const LLUUID& asset_id, void *user_data,
// static
void LLFloaterPostcard::updateUserInfo(const char *email)
{
- LLFloaterPostcard *instance;
-
- sInstances.resetList();
- while ((instance = sInstances.getNextData()))
+ for (instance_list_t::iterator iter = sInstances.begin();
+ iter != sInstances.end(); ++iter)
{
+ LLFloaterPostcard *instance = *iter;
const LLString& text = instance->childGetValue("from_form").asString();
if (text.empty())
{
diff --git a/indra/newview/llfloaterpostcard.h b/indra/newview/llfloaterpostcard.h
index 5e0efa0ccb..2e2fffb18a 100644
--- a/indra/newview/llfloaterpostcard.h
+++ b/indra/newview/llfloaterpostcard.h
@@ -78,8 +78,9 @@ protected:
LLVector2 mImageScale;
LLVector3d mPosTakenGlobal;
boolean mHasFirstMsgFocus;
-
- static LLLinkedList<LLFloaterPostcard> sInstances;
+
+ typedef std::set<LLFloaterPostcard*> instance_list_t;
+ static instance_list_t sInstances;
};
diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp
index 16d869ea6f..e9e2584b17 100644
--- a/indra/newview/llfloaterurlentry.cpp
+++ b/indra/newview/llfloaterurlentry.cpp
@@ -72,9 +72,12 @@ public:
void completeAny(U32 status, const std::string& mime_type)
{
+ // Set empty type to none/none. Empty string is reserved for legacy parcels
+ // which have no mime type set.
+ std::string resolved_mime_type = ! mime_type.empty() ? mime_type : "none/none";
LLFloaterURLEntry* floater_url_entry = (LLFloaterURLEntry*)mParent.get();
if ( floater_url_entry )
- floater_url_entry->headerFetchComplete( status, mime_type );
+ floater_url_entry->headerFetchComplete( status, resolved_mime_type );
}
};
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index ebc6dc2322..8a40cdd062 100644
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -150,13 +150,7 @@ const LLUUID LLFloaterWorldMap::sHomeID( "10000000-0000-0000-0000-000000000001"
LLFloaterWorldMap::LLFloaterWorldMap()
-: LLFloater("worldmap", "FloaterWorldMapRect", "World Map",
- TRUE, // resize
- 410, // min-width
- 520, // min-height
- FALSE, // drag on left
- TRUE, // minimize
- TRUE), // close
+: LLFloater("worldmap"),
mInventory(NULL),
mInventoryObserver(NULL),
mFriendObserver(NULL),
diff --git a/indra/newview/llhudeffectlookat.h b/indra/newview/llhudeffectlookat.h
index 4295078681..ef3691d8d7 100644
--- a/indra/newview/llhudeffectlookat.h
+++ b/indra/newview/llhudeffectlookat.h
@@ -33,7 +33,6 @@
#define LL_LLHUDEFFECTLOOKAT_H
#include "llhudeffect.h"
-#include "llskiplist.h"
class LLViewerObject;
class LLVOAvatar;
diff --git a/indra/newview/llhudobject.h b/indra/newview/llhudobject.h
index 5e2c300d2c..11d9f43fcc 100644
--- a/indra/newview/llhudobject.h
+++ b/indra/newview/llhudobject.h
@@ -41,7 +41,6 @@
#include "v4color.h"
#include "v3math.h"
#include "v3dmath.h"
-#include "linked_lists.h"
#include "lldrawpool.h"
#include <list>
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 58139e41aa..4dc5bfddec 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -40,7 +40,6 @@
#include "llhttpclient.h"
#include "llsdutil.h"
#include "llstring.h"
-#include "linked_lists.h"
#include "llvieweruictrlfactory.h"
#include "llagent.h"
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 0e17d8503d..a0fa0e083c 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -3522,8 +3522,13 @@ struct LLFoundData
struct LLWearableHoldingPattern
{
LLWearableHoldingPattern() : mResolved(0) {}
- ~LLWearableHoldingPattern() { mFoundList.deleteAllData(); }
- LLDoubleLinkedList<LLFoundData> mFoundList;
+ ~LLWearableHoldingPattern()
+ {
+ for_each(mFoundList.begin(), mFoundList.end(), DeletePointer());
+ mFoundList.clear();
+ }
+ typedef std::list<LLFoundData*> found_list_t;
+ found_list_t mFoundList;
S32 mResolved;
};
@@ -3913,7 +3918,7 @@ void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata )
item_array.get(i)->getAssetUUID(),
item_array.get(i)->getName(),
item_array.get(i)->getType());
- holder->mFoundList.addData(found);
+ holder->mFoundList.push_front(found);
found_container.put(found);
}
for(i = 0; i < wearable_count; ++i)
@@ -4004,10 +4009,10 @@ void wear_inventory_category_on_avatar_loop(LLWearable* wearable, void* data)
if(wearable)
{
- for(LLFoundData* data = holder->mFoundList.getFirstData();
- data;
- data = holder->mFoundList.getNextData() )
+ for (LLWearableHoldingPattern::found_list_t::iterator iter = holder->mFoundList.begin();
+ iter != holder->mFoundList.end(); ++iter)
{
+ LLFoundData* data = *iter;
if(wearable->getID() == data->mAssetID)
{
data->mWearable = wearable;
@@ -4016,7 +4021,7 @@ void wear_inventory_category_on_avatar_loop(LLWearable* wearable, void* data)
}
}
holder->mResolved += 1;
- if(holder->mResolved >= holder->mFoundList.getLength())
+ if(holder->mResolved >= (S32)holder->mFoundList.size())
{
wear_inventory_category_on_avatar_step3(holder, append);
}
@@ -4032,10 +4037,10 @@ void wear_inventory_category_on_avatar_step3(LLWearableHoldingPattern* holder, B
// that we recursed through.
for( S32 i = 0; i < WT_COUNT; i++ )
{
- for(LLFoundData* data = holder->mFoundList.getFirstData();
- data;
- data = holder->mFoundList.getNextData())
+ for (LLWearableHoldingPattern::found_list_t::iterator iter = holder->mFoundList.begin();
+ iter != holder->mFoundList.end(); ++iter)
{
+ LLFoundData* data = *iter;
LLWearable* wearable = data->mWearable;
if( wearable && ((S32)wearable->getType() == i) )
{
diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h
index 79a35f78ea..c2ec01a1a0 100644
--- a/indra/newview/llinventorymodel.h
+++ b/indra/newview/llinventorymodel.h
@@ -439,8 +439,6 @@ protected:
mutable LLPointer<LLViewerInventoryItem> mLastItem;
// This last set of indices is used to map parents to children.
- //LLPtrSkipMap<const LLUUID, cat_array_t*> mParentChildCategoryTree;
- //LLPtrSkipMap<const LLUUID, item_array_t*> mParentChildItemTree;
typedef std::map<LLUUID, cat_array_t*> parent_cat_map_t;
typedef std::map<LLUUID, item_array_t*> parent_item_map_t;
parent_cat_map_t mParentChildCategoryTree;
diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp
index 457682a154..5252e3e3c6 100644
--- a/indra/newview/llmanipscale.cpp
+++ b/indra/newview/llmanipscale.cpp
@@ -173,11 +173,6 @@ void LLManipScale::handleDeselect()
LLManip::handleDeselect();
}
-BOOL sort_manip_by_z(LLManipScale::ManipulatorHandle *new_manip, LLManipScale::ManipulatorHandle *test_manip)
-{
- return ((new_manip->mType < test_manip->mType) || (new_manip->mPosition.mV[VZ] < test_manip->mPosition.mV[VZ]));
-}
-
LLManipScale::LLManipScale( LLToolComposite* composite )
:
LLManip( "Scale", composite ),
@@ -194,7 +189,6 @@ LLManipScale::LLManipScale( LLToolComposite* composite )
mSnapGuideLength(0.f),
mScaleSnapValue(0.f)
{
- mProjectedManipulators.setInsertBefore(sort_manip_by_z);
mManipulatorScales = new F32[NUM_MANIPULATORS];
for (S32 i = 0; i < NUM_MANIPULATORS; i++)
{
@@ -204,7 +198,8 @@ LLManipScale::LLManipScale( LLToolComposite* composite )
LLManipScale::~LLManipScale()
{
- delete []mManipulatorScales;
+ for_each(mProjectedManipulators.begin(), mProjectedManipulators.end(), DeletePointer());
+ delete[] mManipulatorScales;
}
void LLManipScale::render()
@@ -471,8 +466,6 @@ void LLManipScale::highlightManipulators(S32 x, S32 y)
LLVector3 max = bbox.getMaxLocal();
LLVector3 ctr = bbox.getCenterLocal();
- mProjectedManipulators.deleteAllData();
-
S32 numManips = 0;
// corners
mManipulatorVertices[numManips++] = LLVector4(min.mV[VX], min.mV[VY], min.mV[VZ], 1.f);
@@ -496,6 +489,9 @@ void LLManipScale::highlightManipulators(S32 x, S32 y)
mManipulatorVertices[numManips++] = LLVector4(ctr.mV[VX], ctr.mV[VY], min.mV[VZ], 1.f);
}
+ for_each(mProjectedManipulators.begin(), mProjectedManipulators.end(), DeletePointer());
+ mProjectedManipulators.clear();
+
for (S32 i = 0; i < numManips; i++)
{
LLVector4 projectedVertex = mManipulatorVertices[i] * transform;
@@ -503,7 +499,7 @@ void LLManipScale::highlightManipulators(S32 x, S32 y)
ManipulatorHandle* projManipulator = new ManipulatorHandle(LLVector3(projectedVertex.mV[VX], projectedVertex.mV[VY],
projectedVertex.mV[VZ]), MANIPULATOR_IDS[i], (i < 7) ? SCALE_MANIP_CORNER : SCALE_MANIP_FACE);
- mProjectedManipulators.addDataSorted(projManipulator);
+ mProjectedManipulators.insert(projManipulator);
}
F32 half_width = (F32)gViewerWindow->getWindowWidth() / 2.f;
@@ -514,9 +510,10 @@ void LLManipScale::highlightManipulators(S32 x, S32 y)
mHighlightedPart = LL_NO_PART;
- for (ManipulatorHandle* manipulator = mProjectedManipulators.getFirstData();
- manipulator;
- manipulator = mProjectedManipulators.getNextData())
+ for (minpulator_list_t::iterator iter = mProjectedManipulators.begin();
+ iter != mProjectedManipulators.end(); ++iter)
+ {
+ ManipulatorHandle* manipulator = *iter;
{
manip2d.setVec(manipulator->mPosition.mV[VX] * half_width, manipulator->mPosition.mV[VY] * half_height);
@@ -529,6 +526,7 @@ void LLManipScale::highlightManipulators(S32 x, S32 y)
break;
}
}
+ }
}
for (S32 i = 0; i < NUM_MANIPULATORS; i++)
diff --git a/indra/newview/llmanipscale.h b/indra/newview/llmanipscale.h
index 3ea5ee7d7a..c02845e358 100644
--- a/indra/newview/llmanipscale.h
+++ b/indra/newview/llmanipscale.h
@@ -124,6 +124,20 @@ private:
void updateSnapGuides(const LLBBox& bbox);
private:
+ struct compare_manipulators
+ {
+ bool operator() (const ManipulatorHandle* const a, const ManipulatorHandle* const b) const
+ {
+ if (a->mType != b->mType)
+ return a->mType < b->mType;
+ else if (a->mPosition.mV[VZ] != b->mPosition.mV[VZ])
+ return a->mPosition.mV[VZ] < b->mPosition.mV[VZ];
+ else
+ return a->mManipID < b->mManipID;
+ }
+ };
+
+
F32 mBoxHandleSize; // The size of the handles at the corners of the bounding box
F32 mScaledBoxHandleSize; // handle size after scaling for selection feedback
EManipPart mManipPart;
@@ -135,7 +149,8 @@ private:
S32 mLastMouseY;
BOOL mSendUpdateOnMouseUp;
U32 mLastUpdateFlags;
- LLLinkedList<ManipulatorHandle> mProjectedManipulators;
+ typedef std::set<ManipulatorHandle*, compare_manipulators> minpulator_list_t;
+ minpulator_list_t mProjectedManipulators;
LLVector4 mManipulatorVertices[14];
F32 mScaleSnapUnit1; // size of snap multiples for axis 1
F32 mScaleSnapUnit2; // size of snap multiples for axis 2
diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp
index 3182f14951..98d67f3804 100644
--- a/indra/newview/llmaniptranslate.cpp
+++ b/indra/newview/llmaniptranslate.cpp
@@ -100,11 +100,6 @@ const U32 ARROW_TO_AXIS[4] =
VZ
};
-BOOL sort_manip_by_end_z(LLManipTranslate::ManipulatorHandle *new_manip, LLManipTranslate::ManipulatorHandle *test_manip)
-{
- return (new_manip->mEndPosition.mV[VZ] < test_manip->mEndPosition.mV[VZ]);
-}
-
LLManipTranslate::LLManipTranslate( LLToolComposite* composite )
: LLManip( "Move", composite ),
mLastHoverMouseX(-1),
@@ -125,8 +120,6 @@ LLManipTranslate::LLManipTranslate( LLToolComposite* composite )
mPlaneScales(1.f, 1.f, 1.f),
mPlaneManipPositions(1.f, 1.f, 1.f, 1.f)
{
- mProjectedManipulators.setInsertBefore(sort_manip_by_end_z);
-
if (sGridTex == 0)
{
restoreGL();
@@ -253,7 +246,7 @@ void LLManipTranslate::restoreGL()
LLManipTranslate::~LLManipTranslate()
{
- mProjectedManipulators.deleteAllData();
+ for_each(mProjectedManipulators.begin(), mProjectedManipulators.end(), DeletePointer());
}
@@ -841,8 +834,6 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y)
transform *= projMatrix;
}
- mProjectedManipulators.deleteAllData();
-
S32 numManips = 0;
// edges
@@ -898,6 +889,9 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y)
planar_manip_xy_visible = TRUE;
}
+ for_each(mProjectedManipulators.begin(), mProjectedManipulators.end(), DeletePointer());
+ mProjectedManipulators.clear();
+
for (S32 i = 0; i < num_arrow_manips; i+= 2)
{
LLVector4 projected_start = mManipulatorVertices[i] * transform;
@@ -911,7 +905,7 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y)
LLVector3(projected_end.mV[VX], projected_end.mV[VY], projected_end.mV[VZ]),
MANIPULATOR_IDS[i / 2],
10.f); // 10 pixel hotspot for arrows
- mProjectedManipulators.addDataSorted(projManipulator);
+ mProjectedManipulators.insert(projManipulator);
}
if (planar_manip_yz_visible)
@@ -928,7 +922,7 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y)
LLVector3(projected_end.mV[VX], projected_end.mV[VY], projected_end.mV[VZ]),
MANIPULATOR_IDS[i / 2],
20.f); // 20 pixels for planar manipulators
- mProjectedManipulators.addDataSorted(projManipulator);
+ mProjectedManipulators.insert(projManipulator);
}
if (planar_manip_xz_visible)
@@ -945,7 +939,7 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y)
LLVector3(projected_end.mV[VX], projected_end.mV[VY], projected_end.mV[VZ]),
MANIPULATOR_IDS[i / 2],
20.f); // 20 pixels for planar manipulators
- mProjectedManipulators.addDataSorted(projManipulator);
+ mProjectedManipulators.insert(projManipulator);
}
if (planar_manip_xy_visible)
@@ -962,7 +956,7 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y)
LLVector3(projected_end.mV[VX], projected_end.mV[VY], projected_end.mV[VZ]),
MANIPULATOR_IDS[i / 2],
20.f); // 20 pixels for planar manipulators
- mProjectedManipulators.addDataSorted(projManipulator);
+ mProjectedManipulators.insert(projManipulator);
}
LLVector2 manip_start_2d;
@@ -973,9 +967,10 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y)
LLVector2 mousePos((F32)x - half_width, (F32)y - half_height);
LLVector2 mouse_delta;
- for (ManipulatorHandle* manipulator = mProjectedManipulators.getFirstData();
- manipulator;
- manipulator = mProjectedManipulators.getNextData())
+ for (minpulator_list_t::iterator iter = mProjectedManipulators.begin();
+ iter != mProjectedManipulators.end(); ++iter)
+ {
+ ManipulatorHandle* manipulator = *iter;
{
manip_start_2d.setVec(manipulator->mStartPosition.mV[VX] * half_width, manipulator->mStartPosition.mV[VY] * half_height);
manip_end_2d.setVec(manipulator->mEndPosition.mV[VX] * half_width, manipulator->mEndPosition.mV[VY] * half_height);
@@ -996,6 +991,7 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y)
break;
}
}
+ }
}
F32 LLManipTranslate::getMinGridScale()
diff --git a/indra/newview/llmaniptranslate.h b/indra/newview/llmaniptranslate.h
index 8821b64c90..c9f98e9c7d 100644
--- a/indra/newview/llmaniptranslate.h
+++ b/indra/newview/llmaniptranslate.h
@@ -35,7 +35,6 @@
#include "llmanip.h"
#include "lltimer.h"
#include "v4math.h"
-#include "linked_lists.h"
#include "llquaternion.h"
class LLManipTranslate : public LLManip
@@ -88,6 +87,17 @@ protected:
F32 getMinGridScale();
private:
+ struct compare_manipulators
+ {
+ bool operator() (const ManipulatorHandle* const a, const ManipulatorHandle* const b) const
+ {
+ if (a->mEndPosition.mV[VZ] != b->mEndPosition.mV[VZ])
+ return (a->mEndPosition.mV[VZ] < b->mEndPosition.mV[VZ]);
+ else
+ return a->mManipID < b->mManipID;
+ }
+ };
+
S32 mLastHoverMouseX;
S32 mLastHoverMouseY;
BOOL mSendUpdateOnMouseUp;
@@ -105,7 +115,8 @@ private:
LLVector3d mDragCursorStartGlobal;
LLVector3d mDragSelectionStartGlobal;
LLTimer mUpdateTimer;
- LLLinkedList<ManipulatorHandle> mProjectedManipulators;
+ typedef std::set<ManipulatorHandle*, compare_manipulators> minpulator_list_t;
+ minpulator_list_t mProjectedManipulators;
LLVector4 mManipulatorVertices[18];
F32 mSnapOffsetMeters;
LLVector3 mSnapOffsetAxis;
diff --git a/indra/newview/llmenucommands.cpp b/indra/newview/llmenucommands.cpp
index 68bbe53090..080413bb56 100644
--- a/indra/newview/llmenucommands.cpp
+++ b/indra/newview/llmenucommands.cpp
@@ -41,7 +41,6 @@
#include "message.h"
#include "llagent.h"
-#include "llcallbacklist.h"
#include "llcallingcard.h"
#include "llchatbar.h"
#include "llviewercontrol.h"
diff --git a/indra/newview/llmimetypes.cpp b/indra/newview/llmimetypes.cpp
index 67f7532ff6..e1bc3dbf11 100644
--- a/indra/newview/llmimetypes.cpp
+++ b/indra/newview/llmimetypes.cpp
@@ -53,7 +53,7 @@ bool LLMIMETypes::parseMIMETypes(const LLString& xml_filename)
{
LLXMLNodePtr root;
bool success = LLViewerUICtrlFactory::getLayeredXMLNode(xml_filename, root);
- if ( ! success || ! root.isNull() || ! root->hasName( "mimetypes" ) )
+ if ( ! success || root.isNull() || ! root->hasName( "mimetypes" ) )
{
llwarns << "Unable to read MIME type file: "
<< xml_filename << llendl;
diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp
index 4f1d7bb514..4963b42a62 100644
--- a/indra/newview/llmoveview.cpp
+++ b/indra/newview/llmoveview.cpp
@@ -38,7 +38,6 @@
// Viewer includes
#include "llagent.h"
-#include "llcallbacklist.h"
#include "llviewercontrol.h"
#include "llfontgl.h"
#include "llbutton.h"
diff --git a/indra/newview/llnamebox.h b/indra/newview/llnamebox.h
index 5fd92f5daa..da8df5c225 100644
--- a/indra/newview/llnamebox.h
+++ b/indra/newview/llnamebox.h
@@ -37,7 +37,6 @@
#include "llview.h"
#include "llstring.h"
#include "llfontgl.h"
-#include "linked_lists.h"
#include "lltextbox.h"
class LLNameBox
diff --git a/indra/newview/llnameeditor.h b/indra/newview/llnameeditor.h
index 9c89454c33..a5a0c5d9c8 100644
--- a/indra/newview/llnameeditor.h
+++ b/indra/newview/llnameeditor.h
@@ -38,7 +38,6 @@
#include "v4color.h"
#include "llstring.h"
#include "llfontgl.h"
-#include "linked_lists.h"
#include "lllineeditor.h"
diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp
index 0a078e1058..7ceb40499f 100644
--- a/indra/newview/llnetmap.cpp
+++ b/indra/newview/llnetmap.cpp
@@ -36,7 +36,6 @@
#include "indra_constants.h"
#include "llui.h"
-#include "linked_lists.h"
#include "llmath.h" // clampf()
#include "llfocusmgr.h"
#include "llglimmediate.h"
diff --git a/indra/newview/lloverlaybar.cpp b/indra/newview/lloverlaybar.cpp
index cda921ab8f..237826cb7a 100644
--- a/indra/newview/lloverlaybar.cpp
+++ b/indra/newview/lloverlaybar.cpp
@@ -331,7 +331,15 @@ void LLOverlayBar::onClickStandUp(void*)
////////////////////////////////////////////////////////////////////////////////
// static media helpers
// *TODO: Move this into an audio manager abstraction
-
+//static
+void LLOverlayBar::mediaStop(void*)
+{
+ if (!gOverlayBar)
+ {
+ return;
+ }
+ LLViewerParcelMedia::stop();
+}
//static
void LLOverlayBar::toggleMediaPlay(void*)
{
diff --git a/indra/newview/lloverlaybar.h b/indra/newview/lloverlaybar.h
index 741095e408..4fb438a712 100644
--- a/indra/newview/lloverlaybar.h
+++ b/indra/newview/lloverlaybar.h
@@ -81,6 +81,7 @@ public:
static void toggleMusicPlay(void*);
static void musicPause(void*);
static void musicStop(void*);
+ static void mediaStop(void*);
static void toggleAudioVolumeFloater(void*);
diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h
index 6e5b7bfb41..a598dfebf5 100644
--- a/indra/newview/llpanelavatar.h
+++ b/indra/newview/llpanelavatar.h
@@ -35,7 +35,6 @@
#include "llpanel.h"
#include "v3dmath.h"
#include "lluuid.h"
-#include "linked_lists.h"
#include "llwebbrowserctrl.h"
class LLButton;
diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp
index f0acbf4b22..1ad71075ae 100644
--- a/indra/newview/llpanelobject.cpp
+++ b/indra/newview/llpanelobject.cpp
@@ -164,11 +164,10 @@ BOOL LLPanelObject::postBuild()
childSetCommitCallback("material",onCommitMaterial,this);
mComboMaterial->removeall();
// *TODO:translate
- LLMaterialInfo *minfop;
- for (minfop = LLMaterialTable::basic.mMaterialInfoList.getFirstData();
- minfop != NULL;
- minfop = LLMaterialTable::basic.mMaterialInfoList.getNextData())
+ for (LLMaterialTable::info_list_t::iterator iter = LLMaterialTable::basic.mMaterialInfoList.begin();
+ iter != LLMaterialTable::basic.mMaterialInfoList.end(); ++iter)
{
+ LLMaterialInfo* minfop = *iter;
if (minfop->mMCode != LL_MCODE_LIGHT)
{
mComboMaterial->add(minfop->mName);
diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp
index dc67ff48ea..85d5def673 100644
--- a/indra/newview/llpolymesh.cpp
+++ b/indra/newview/llpolymesh.cpp
@@ -90,7 +90,8 @@ LLPolyMeshSharedData::LLPolyMeshSharedData()
LLPolyMeshSharedData::~LLPolyMeshSharedData()
{
freeMeshData();
- mMorphData.deleteAllData();
+ for_each(mMorphData.begin(), mMorphData.end(), DeletePointer());
+ mMorphData.clear();
}
//-----------------------------------------------------------------------------
@@ -604,7 +605,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName )
continue;
}
- mMorphData.addData(morph_data);
+ mMorphData.insert(morph_data);
}
S32 numRemaps;
@@ -759,11 +760,11 @@ LLPolyMesh *LLPolyMesh::getMesh(const LLString &name, LLPolyMesh* reference_mesh
//-------------------------------------------------------------------------
// search for an existing mesh by this name
//-------------------------------------------------------------------------
- LLPolyMeshSharedData **meshSharedData = sGlobalSharedMeshList.getValue(name);
+ LLPolyMeshSharedData* meshSharedData = get_if_there(sGlobalSharedMeshList, name, (LLPolyMeshSharedData*)NULL);
if (meshSharedData)
{
// llinfos << "Polymesh " << name << " found in global mesh table." << llendl;
- LLPolyMesh *poly_mesh = new LLPolyMesh(*meshSharedData, reference_mesh);
+ LLPolyMesh *poly_mesh = new LLPolyMesh(meshSharedData, reference_mesh);
return poly_mesh;
}
@@ -787,7 +788,7 @@ LLPolyMesh *LLPolyMesh::getMesh(const LLString &name, LLPolyMesh* reference_mesh
LLPolyMesh *poly_mesh = new LLPolyMesh(mesh_data, reference_mesh);
// llinfos << "Polymesh " << name << " added to global mesh table." << llendl;
- sGlobalSharedMeshList.addToTail(name, poly_mesh->mSharedData);
+ sGlobalSharedMeshList[name] = poly_mesh->mSharedData;
return poly_mesh;
}
@@ -797,21 +798,9 @@ LLPolyMesh *LLPolyMesh::getMesh(const LLString &name, LLPolyMesh* reference_mesh
//-----------------------------------------------------------------------------
void LLPolyMesh::freeAllMeshes()
{
- U32 i;
-
// delete each item in the global lists
- for (i=0; i<sGlobalSharedMeshList.length(); i++)
- {
- // returns a pointer to the value, which is the pointer
- // to the mesh
- LLPolyMeshSharedData **shared_mesh_pp = sGlobalSharedMeshList.getValueAt(i);
-
- // delete the mesh
- delete *shared_mesh_pp;
- }
-
- // empty the lists
- sGlobalSharedMeshList.removeAll();
+ for_each(sGlobalSharedMeshList.begin(), sGlobalSharedMeshList.end(), DeletePairedPointer());
+ sGlobalSharedMeshList.clear();
}
LLPolyMeshSharedData *LLPolyMesh::getSharedData() const
@@ -830,7 +819,7 @@ void LLPolyMesh::dumpDiagInfo()
U32 total_faces = 0;
U32 total_kb = 0;
- char buf[1024]; /*Flawfinder: ignore*/
+ std::string buf;
llinfos << "-----------------------------------------------------" << llendl;
llinfos << " Global PolyMesh Table (DEBUG only)" << llendl;
@@ -838,18 +827,17 @@ void LLPolyMesh::dumpDiagInfo()
llinfos << "-----------------------------------------------------" << llendl;
// print each loaded mesh, and it's memory usage
- for (U32 i=0; i<sGlobalSharedMeshList.length(); i++)
+ for(LLPolyMeshSharedDataTable::iterator iter = sGlobalSharedMeshList.begin();
+ iter != sGlobalSharedMeshList.end(); ++iter)
{
- std::string *mesh_name_p = sGlobalSharedMeshList.getIndexAt(i);
-
- LLPolyMeshSharedData **mesh_pp = sGlobalSharedMeshList.getValueAt(i);
- LLPolyMeshSharedData &mesh = **mesh_pp;
+ const std::string& mesh_name = iter->first;
+ LLPolyMeshSharedData* mesh = iter->second;
- S32 num_verts = mesh.mNumVertices;
- S32 num_faces = mesh.mNumFaces;
- U32 num_kb = mesh.getNumKB();
+ S32 num_verts = mesh->mNumVertices;
+ S32 num_faces = mesh->mNumFaces;
+ U32 num_kb = mesh->getNumKB();
- snprintf(buf, sizeof(buf), "%8d %8d %8d %s", num_verts, num_faces, num_kb, mesh_name_p->c_str()); /* Flawfinder: ignore */
+ buf = llformat("%8d %8d %8d %s", num_verts, num_faces, num_kb, mesh_name.c_str());
llinfos << buf << llendl;
total_verts += num_verts;
@@ -858,7 +846,7 @@ void LLPolyMesh::dumpDiagInfo()
}
llinfos << "-----------------------------------------------------" << llendl;
- snprintf(buf, sizeof(buf), "%8d %8d %8d TOTAL", total_verts, total_faces, total_kb ); /* Flawfinder: ignore */
+ buf = llformat("%8d %8d %8d TOTAL", total_verts, total_faces, total_kb );
llinfos << buf << llendl;
llinfos << "-----------------------------------------------------" << llendl;
}
@@ -943,11 +931,12 @@ void LLPolyMesh::initializeForMorph()
//-----------------------------------------------------------------------------
LLPolyMorphData* LLPolyMesh::getMorphData(const char *morph_name)
{
- if (!mSharedData) return NULL;
- for (LLPolyMorphData *morph_data = mSharedData->mMorphData.getFirstData();
- morph_data;
- morph_data = mSharedData->mMorphData.getNextData())
+ if (!mSharedData)
+ return NULL;
+ for (LLPolyMeshSharedData::morphdata_list_t::iterator iter = mSharedData->mMorphData.begin();
+ iter != mSharedData->mMorphData.end(); ++iter)
{
+ LLPolyMorphData *morph_data = *iter;
if (!strcmp(morph_data->getName(), morph_name))
{
return morph_data;
@@ -959,22 +948,25 @@ LLPolyMorphData* LLPolyMesh::getMorphData(const char *morph_name)
//-----------------------------------------------------------------------------
// removeMorphData()
//-----------------------------------------------------------------------------
-void LLPolyMesh::removeMorphData(LLPolyMorphData *morph_target)
-{
- if (!mSharedData) return;
-
- mSharedData->mMorphData.removeData(morph_target);
-}
+// // erasing but not deleting seems bad, but fortunately we don't actually use this...
+// void LLPolyMesh::removeMorphData(LLPolyMorphData *morph_target)
+// {
+// if (!mSharedData)
+// return;
+// mSharedData->mMorphData.erase(morph_target);
+// }
//-----------------------------------------------------------------------------
// deleteAllMorphData()
//-----------------------------------------------------------------------------
-void LLPolyMesh::deleteAllMorphData()
-{
- if (!mSharedData) return;
+// void LLPolyMesh::deleteAllMorphData()
+// {
+// if (!mSharedData)
+// return;
- mSharedData->mMorphData.deleteAllData();
-}
+// for_each(mSharedData->mMorphData.begin(), mSharedData->mMorphData.end(), DeletePointer());
+// mSharedData->mMorphData.clear();
+// }
//-----------------------------------------------------------------------------
// getWritableWeights()
diff --git a/indra/newview/llpolymesh.h b/indra/newview/llpolymesh.h
index 8003c4a89d..32e500e19d 100644
--- a/indra/newview/llpolymesh.h
+++ b/indra/newview/llpolymesh.h
@@ -39,10 +39,7 @@
#include "v3math.h"
#include "v2math.h"
#include "llquaternion.h"
-#include "llskipmap.h"
-#include "llassoclist.h"
#include "llpolymorph.h"
-#include "llptrskipmap.h"
#include "lljoint.h"
//#include "lldarray.h"
@@ -99,8 +96,8 @@ private:
std::string* mJointNames;
// morph targets
- typedef LLLinkedList<LLPolyMorphData> LLPolyMorphDataList;
- LLPolyMorphDataList mMorphData;
+ typedef std::set<LLPolyMorphData*> morphdata_list_t;
+ morphdata_list_t mMorphData;
std::map<S32, S32> mSharedVerts;
@@ -113,11 +110,11 @@ public:
U32 mNumTriangleIndices;
U32 *mTriangleIndices;
-private:
+public:
LLPolyMeshSharedData();
-
~LLPolyMeshSharedData();
+private:
void setupLOD(LLPolyMeshSharedData* reference_data);
// Frees all mesh memory resources
@@ -315,8 +312,8 @@ public:
}
LLPolyMorphData* getMorphData(const char *morph_name);
- void removeMorphData(LLPolyMorphData *morph_target);
- void deleteAllMorphData();
+// void removeMorphData(LLPolyMorphData *morph_target);
+// void deleteAllMorphData();
LLPolyMeshSharedData *getSharedData() const;
LLPolyMesh *getReferenceMesh() { return mReferenceMesh ? mReferenceMesh : this; }
@@ -365,7 +362,7 @@ protected:
LLPolyMesh *mReferenceMesh;
// global mesh list
- typedef LLAssocList<std::string, LLPolyMeshSharedData*> LLPolyMeshSharedDataTable;
+ typedef std::map<LLString, LLPolyMeshSharedData*> LLPolyMeshSharedDataTable;
static LLPolyMeshSharedDataTable sGlobalSharedMeshList;
// Backlink only; don't make this an LLPointer.
diff --git a/indra/newview/llpolymorph.cpp b/indra/newview/llpolymorph.cpp
index 107b51d032..5574ec67c7 100644
--- a/indra/newview/llpolymorph.cpp
+++ b/indra/newview/llpolymorph.cpp
@@ -35,7 +35,6 @@
#include "llviewerprecompiledheaders.h"
#include "llpolymorph.h"
-#include "linked_lists.h"
#include "llvoavatar.h"
#include "llxmltree.h"
#include "llendianswizzle.h"
@@ -44,8 +43,6 @@
const F32 NORMAL_SOFTEN_FACTOR = 0.65f;
-LLLinkedList<LLPolyMorphData> gLoadedMorphs;
-
//-----------------------------------------------------------------------------
// LLPolyMorphData()
//-----------------------------------------------------------------------------
@@ -184,8 +181,6 @@ BOOL LLPolyMorphData::loadBinary(FILE *fp, LLPolyMeshSharedData *mesh)
mAvgDistortion = mAvgDistortion * (1.f/(F32)mNumIndices);
mAvgDistortion.normVec();
- gLoadedMorphs.addData(this);
-
return TRUE;
}
diff --git a/indra/newview/llpolymorph.h b/indra/newview/llpolymorph.h
index 0d6ebc304b..088963584e 100644
--- a/indra/newview/llpolymorph.h
+++ b/indra/newview/llpolymorph.h
@@ -36,8 +36,6 @@
#include <vector>
#include "llviewervisualparam.h"
-#include "llskiplist.h"
-#include "linked_lists.h"
class LLPolyMeshSharedData;
class LLVOAvatar;
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index d2e3dc1ed9..f6556ffbd5 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -42,7 +42,6 @@
#include "llglimmediate.h"
#include "llpermissions.h"
#include "llpermissionsflags.h"
-#include "llptrskiplist.h"
#include "llundo.h"
#include "lluuid.h"
#include "llvolume.h"
diff --git a/indra/newview/lltextureview.h b/indra/newview/lltextureview.h
index 60bf63479b..4c5fb1ce68 100644
--- a/indra/newview/lltextureview.h
+++ b/indra/newview/lltextureview.h
@@ -33,7 +33,6 @@
#define LL_LLTEXTUREVIEW_H
#include "llcontainerview.h"
-#include "linked_lists.h"
class LLViewerImage;
class LLTextureBar;
diff --git a/indra/newview/lltoolbrush.cpp b/indra/newview/lltoolbrush.cpp
index 5a637a6346..d39ce57e56 100644
--- a/indra/newview/lltoolbrush.cpp
+++ b/indra/newview/lltoolbrush.cpp
@@ -108,10 +108,10 @@ void LLToolBrushLand::modifyLandAtPointGlobal(const LLVector3d &pos_global,
S32 radioAction = gSavedSettings.getS32("RadioLandBrushAction");
determineAffectedRegions(mLastAffectedRegions, pos_global);
- for(LLViewerRegion* regionp = mLastAffectedRegions.getFirstData();
- regionp != NULL;
- regionp = mLastAffectedRegions.getNextData())
+ for(region_list_t::iterator iter = mLastAffectedRegions.begin();
+ iter != mLastAffectedRegions.end(); ++iter)
{
+ LLViewerRegion* regionp = *iter;
//BOOL is_changed = FALSE;
LLVector3 pos_region = regionp->getPosRegionFromGlobal(pos_global);
LLSurface &land = regionp->getLand();
@@ -200,7 +200,7 @@ void LLToolBrushLand::modifyLandInSelectionGlobal()
S32 radioAction = gSavedSettings.getS32("RadioLandBrushAction");
- mLastAffectedRegions.removeAllNodes();
+ mLastAffectedRegions.clear();
determineAffectedRegions(mLastAffectedRegions, LLVector3d(min.mdV[VX], min.mdV[VY], 0));
determineAffectedRegions(mLastAffectedRegions, LLVector3d(min.mdV[VX], max.mdV[VY], 0));
@@ -223,10 +223,10 @@ void LLToolBrushLand::modifyLandInSelectionGlobal()
}
// Stop if our selection include a no-terraform region
- for(LLViewerRegion* regionp = mLastAffectedRegions.getFirstData();
- regionp != NULL;
- regionp = mLastAffectedRegions.getNextData())
+ for(region_list_t::iterator iter = mLastAffectedRegions.begin();
+ iter != mLastAffectedRegions.end(); ++iter)
{
+ LLViewerRegion* regionp = *iter;
if (!canTerraform(regionp))
{
alertNoTerraform(regionp);
@@ -234,10 +234,10 @@ void LLToolBrushLand::modifyLandInSelectionGlobal()
}
}
- for(LLViewerRegion* regionp = mLastAffectedRegions.getFirstData();
- regionp != NULL;
- regionp = mLastAffectedRegions.getNextData())
+ for(region_list_t::iterator iter = mLastAffectedRegions.begin();
+ iter != mLastAffectedRegions.end(); ++iter)
{
+ LLViewerRegion* regionp = *iter;
//BOOL is_changed = FALSE;
LLVector3 min_region = regionp->getPosRegionFromGlobal(min);
LLVector3 max_region = regionp->getPosRegionFromGlobal(max);
@@ -398,7 +398,7 @@ BOOL LLToolBrushLand::handleHover( S32 x, S32 y, MASK mask )
BOOL LLToolBrushLand::handleMouseUp(S32 x, S32 y, MASK mask)
{
BOOL handled = FALSE;
- mLastAffectedRegions.removeAllNodes();
+ mLastAffectedRegions.clear();
if( hasMouseCapture() )
{
// Release the mouse
@@ -452,15 +452,15 @@ void LLToolBrushLand::render()
spot.mdV[VY] = floor( spot.mdV[VY] + 0.5 );
mBrushIndex = gSavedSettings.getS32("RadioLandBrushSize");
- LLLinkedList<LLViewerRegion> regions;
+ region_list_t regions;
determineAffectedRegions(regions, spot);
// Now, for each region, render the overlay
LLVector3 pos_world = gAgent.getRegion()->getPosRegionFromGlobal(spot);
- for(LLViewerRegion* region = regions.getFirstData();
- region != NULL;
- region = regions.getNextData())
+ for(region_list_t::iterator iter = regions.begin();
+ iter != regions.end(); ++iter)
{
+ LLViewerRegion* region = *iter;
renderOverlay(region->getLand(),
region->getPosRegionFromGlobal(spot),
pos_world);
@@ -499,7 +499,7 @@ void LLToolBrushLand::renderOverlay(LLSurface& land, const LLVector3& pos_region
glPopMatrix();
}
-void LLToolBrushLand::determineAffectedRegions(LLLinkedList<LLViewerRegion>& regions,
+void LLToolBrushLand::determineAffectedRegions(region_list_t& regions,
const LLVector3d& spot ) const
{
LLVector3d corner(spot);
@@ -507,27 +507,27 @@ void LLToolBrushLand::determineAffectedRegions(LLLinkedList<LLViewerRegion>& reg
corner.mdV[VY] -= (LAND_BRUSH_SIZE[mBrushIndex] / 2);
LLViewerRegion* region = NULL;
region = gWorldPointer->getRegionFromPosGlobal(corner);
- if(region && !regions.checkData(region))
+ if(region && regions.find(region) == regions.end())
{
- regions.addData(region);
+ regions.insert(region);
}
corner.mdV[VY] += LAND_BRUSH_SIZE[mBrushIndex];
region = gWorldPointer->getRegionFromPosGlobal(corner);
- if(region && !regions.checkData(region))
+ if(region && regions.find(region) == regions.end())
{
- regions.addData(region);
+ regions.insert(region);
}
corner.mdV[VX] += LAND_BRUSH_SIZE[mBrushIndex];
region = gWorldPointer->getRegionFromPosGlobal(corner);
- if(region && !regions.checkData(region))
+ if(region && regions.find(region) == regions.end())
{
- regions.addData(region);
+ regions.insert(region);
}
corner.mdV[VY] -= LAND_BRUSH_SIZE[mBrushIndex];
region = gWorldPointer->getRegionFromPosGlobal(corner);
- if(region && !regions.checkData(region))
+ if(region && regions.find(region) == regions.end())
{
- regions.addData(region);
+ regions.insert(region);
}
}
@@ -554,10 +554,10 @@ void LLToolBrushLand::onMouseCaptureLost()
// static
void LLToolBrushLand::undo()
{
- for(LLViewerRegion* regionp = mLastAffectedRegions.getFirstData();
- regionp != NULL;
- regionp = mLastAffectedRegions.getNextData())
+ for(region_list_t::iterator iter = mLastAffectedRegions.begin();
+ iter != mLastAffectedRegions.end(); ++iter)
{
+ LLViewerRegion* regionp = *iter;
gMessageSystem->newMessageFast(_PREHASH_UndoLand);
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
@@ -570,10 +570,10 @@ void LLToolBrushLand::undo()
/*
void LLToolBrushLand::redo()
{
- for(LLViewerRegion* regionp = mLastAffectedRegions.getFirstData();
- regionp != NULL;
- regionp = mLastAffectedRegions.getNextData())
+ for(region_list_t::iterator iter = mLastAffectedRegions.begin();
+ iter != mLastAffectedRegions.end(); ++iter)
{
+ LLViewerRegion* regionp = *iter;
gMessageSystem->newMessageFast(_PREHASH_RedoLand);
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
diff --git a/indra/newview/lltoolbrush.h b/indra/newview/lltoolbrush.h
index 738934ebb1..c46037a8f7 100644
--- a/indra/newview/lltoolbrush.h
+++ b/indra/newview/lltoolbrush.h
@@ -40,8 +40,6 @@ class LLSurface;
class LLVector3d;
class LLViewerRegion;
-template<class DATA_TYPE> class LLLinkedList;
-
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLToolBrushLand
//
@@ -50,6 +48,8 @@ template<class DATA_TYPE> class LLLinkedList;
class LLToolBrushLand : public LLTool, public LLEditMenuHandler
{
+ typedef std::set<LLViewerRegion*> region_list_t;
+
public:
LLToolBrushLand();
@@ -80,7 +80,7 @@ protected:
void brush( void );
void modifyLandAtPointGlobal( const LLVector3d &spot, MASK mask );
- void determineAffectedRegions(LLLinkedList<LLViewerRegion>& regions,
+ void determineAffectedRegions(region_list_t& regions,
const LLVector3d& spot) const;
void renderOverlay(LLSurface& land, const LLVector3& pos_region,
const LLVector3& pos_world);
@@ -99,7 +99,8 @@ protected:
BOOL mGotHover;
BOOL mLastShowParcelOwners;
BOOL mBrushSelected;
- LLLinkedList<LLViewerRegion> mLastAffectedRegions;
+ // Order doesn't matter and we do check for existance of regions, so use a set
+ region_list_t mLastAffectedRegions;
};
extern LLToolBrushLand *gToolLand;
diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp
index 0e46ece794..c365f14674 100644
--- a/indra/newview/lltoolmgr.cpp
+++ b/indra/newview/lltoolmgr.cpp
@@ -438,9 +438,7 @@ void LLToolMgr::clearSavedTool()
void LLToolset::addTool(LLTool* tool)
{
- llassert( !mToolList.checkData( tool ) ); // check for duplicates
-
- mToolList.addDataAtEnd( tool );
+ mToolList.push_back( tool );
if( !mSelectedTool )
{
mSelectedTool = tool;
@@ -457,7 +455,7 @@ void LLToolset::selectTool(LLTool* tool)
void LLToolset::selectToolByIndex( S32 index )
{
- LLTool *tool = mToolList.getNthData( index );
+ LLTool *tool = (index >= 0 && index < (S32)mToolList.size()) ? mToolList[index] : NULL;
if (tool)
{
mSelectedTool = tool;
@@ -467,13 +465,14 @@ void LLToolset::selectToolByIndex( S32 index )
BOOL LLToolset::isToolSelected( S32 index )
{
- return (mToolList.getNthData( index ) == mSelectedTool);
+ LLTool *tool = (index >= 0 && index < (S32)mToolList.size()) ? mToolList[index] : NULL;
+ return (tool == mSelectedTool);
}
void LLToolset::selectFirstTool()
{
- mSelectedTool = mToolList.getFirstData();
+ mSelectedTool = (0 < mToolList.size()) ? mToolList[0] : NULL;
if (gToolMgr)
{
gToolMgr->setCurrentTool( mSelectedTool );
@@ -484,43 +483,52 @@ void LLToolset::selectFirstTool()
void LLToolset::selectNextTool()
{
LLTool* next = NULL;
- for( LLTool* cur = mToolList.getFirstData(); cur; cur = mToolList.getNextData() )
+ for( tool_list_t::iterator iter = mToolList.begin();
+ iter != mToolList.end(); )
{
- if( cur == mSelectedTool )
+ LLTool* cur = *iter++;
+ if( cur == mSelectedTool && iter != mToolList.end() )
{
- next = mToolList.getNextData();
+ next = *iter;
break;
}
}
- if( !next )
+ if( next )
{
- next = mToolList.getFirstData();
+ mSelectedTool = next;
+ gToolMgr->setCurrentTool( mSelectedTool );
+ }
+ else
+ {
+ selectFirstTool();
}
-
- mSelectedTool = next;
- gToolMgr->setCurrentTool( mSelectedTool );
}
void LLToolset::selectPrevTool()
{
LLTool* prev = NULL;
- for( LLTool* cur = mToolList.getLastData(); cur; cur = mToolList.getPreviousData() )
+ for( tool_list_t::reverse_iterator iter = mToolList.rbegin();
+ iter != mToolList.rend(); )
{
- if( cur == mSelectedTool )
+ LLTool* cur = *iter++;
+ if( cur == mSelectedTool && iter != mToolList.rend() )
{
- prev = mToolList.getPreviousData();
+ prev = *iter;
break;
}
}
- if( !prev )
+ if( prev )
{
- prev = mToolList.getLastData();
+ mSelectedTool = prev;
+ gToolMgr->setCurrentTool( mSelectedTool );
+ }
+ else if (mToolList.size() > 0)
+ {
+ selectToolByIndex((S32)mToolList.size()-1);
}
- mSelectedTool = prev;
- gToolMgr->setCurrentTool( mSelectedTool );
}
void select_tool( void *tool_pointer )
diff --git a/indra/newview/lltoolmgr.h b/indra/newview/lltoolmgr.h
index 557208be7b..c1e144b252 100644
--- a/indra/newview/lltoolmgr.h
+++ b/indra/newview/lltoolmgr.h
@@ -32,7 +32,6 @@
#ifndef LL_TOOLMGR_H
#define LL_TOOLMGR_H
-#include "doublelinkedlist.h"
#include "llkeyboard.h"
class LLTool;
@@ -108,7 +107,8 @@ public:
protected:
LLTool* mSelectedTool;
- LLDoubleLinkedList<LLTool> mToolList;
+ typedef std::vector<LLTool*> tool_list_t;
+ tool_list_t mToolList;
};
// Handy callbacks for switching tools
diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp
index e32f9bfcc1..25d20f96aa 100644
--- a/indra/newview/lltoolmorph.cpp
+++ b/indra/newview/lltoolmorph.cpp
@@ -67,7 +67,7 @@
//LLToolMorph *gToolMorph = NULL;
//static
-LLLinkedList<LLVisualParamHint> LLVisualParamHint::sInstances;
+LLVisualParamHint::instance_list_t LLVisualParamHint::sInstances;
BOOL LLVisualParamReset::sDirty = FALSE;
//-----------------------------------------------------------------------------
@@ -93,7 +93,7 @@ LLVisualParamHint::LLVisualParamHint(
mRect( pos_x, pos_y + height, pos_x + width, pos_y ),
mLastParamWeight(0.f)
{
- LLVisualParamHint::sInstances.addData( this );
+ LLVisualParamHint::sInstances.insert( this );
LLUUID id;
id.set( gViewerArt.getString("avatar_thumb_bkgrnd.tga") );
mBackgroundp = gImageList.getImage(id, FALSE, TRUE);
@@ -108,7 +108,7 @@ LLVisualParamHint::LLVisualParamHint(
//-----------------------------------------------------------------------------
LLVisualParamHint::~LLVisualParamHint()
{
- LLVisualParamHint::sInstances.removeData( this );
+ LLVisualParamHint::sInstances.erase( this );
}
//-----------------------------------------------------------------------------
@@ -119,10 +119,10 @@ LLVisualParamHint::~LLVisualParamHint()
void LLVisualParamHint::requestHintUpdates( LLVisualParamHint* exception1, LLVisualParamHint* exception2 )
{
S32 delay_frames = 0;
- for(LLVisualParamHint* instance = sInstances.getFirstData();
- instance;
- instance = sInstances.getNextData())
+ for (instance_list_t::iterator iter = sInstances.begin();
+ iter != sInstances.end(); ++iter)
{
+ LLVisualParamHint* instance = *iter;
if( (instance != exception1) && (instance != exception2) )
{
if( instance->mAllowsUpdates )
diff --git a/indra/newview/lltoolmorph.h b/indra/newview/lltoolmorph.h
index 72e73b0934..4c3489b35f 100644
--- a/indra/newview/lltoolmorph.h
+++ b/indra/newview/lltoolmorph.h
@@ -35,7 +35,6 @@
#include "lltool.h"
#include "m4math.h"
#include "v2math.h"
-#include "linked_lists.h"
#include "lldynamictexture.h"
#include "llundo.h"
#include "lltextbox.h"
@@ -93,8 +92,9 @@ protected:
F32 mLastParamWeight;
LLPointer<LLViewerImage> mBackgroundp;
-
- static LLLinkedList<LLVisualParamHint> sInstances;
+
+ typedef std::set<LLVisualParamHint*> instance_list_t;
+ static instance_list_t sInstances;
};
// this class resets avatar data at the end of an update cycle
diff --git a/indra/newview/lltoolview.cpp b/indra/newview/lltoolview.cpp
index 93729a5b91..ad7a980091 100644
--- a/indra/newview/lltoolview.cpp
+++ b/indra/newview/lltoolview.cpp
@@ -72,7 +72,8 @@ LLToolView::LLToolView(const std::string& name, const LLRect& rect)
LLToolView::~LLToolView()
{
- mContainList.deleteAllData();
+ for_each(mContainList.begin(), mContainList.end(), DeletePointer());
+ mContainList.clear();
}
//*TODO:translate?
@@ -118,7 +119,7 @@ void LLToolView::addTool(const LLString& icon_off, const LLString& icon_on, LLPa
addChild(contain->mPanel);
}
- mContainList.addData(contain);
+ mContainList.push_back(contain);
}
@@ -153,11 +154,10 @@ void LLToolView::draw()
// turn off highlighting for all containers
// and hide all option panels except for the selected one.
LLTool* selected = gToolMgr->getCurrentToolset()->getSelectedTool();
- for( LLToolContainer* contain = mContainList.getFirstData();
- contain != NULL;
- contain = mContainList.getNextData()
- )
+ for (contain_list_t::iterator iter = mContainList.begin();
+ iter != mContainList.end(); ++iter)
{
+ LLToolContainer* contain = *iter;
BOOL state = (contain->mTool == selected);
contain->mButton->setToggleState( state );
if (contain->mPanel)
@@ -175,8 +175,10 @@ LLToolContainer* LLToolView::findToolContainer( LLTool *tool )
{
// Find the container for this tool
llassert( tool );
- for( LLToolContainer* contain = mContainList.getFirstData(); contain; contain = mContainList.getNextData() )
+ for (contain_list_t::iterator iter = mContainList.begin();
+ iter != mContainList.end(); ++iter)
{
+ LLToolContainer* contain = *iter;
if( contain->mTool == tool )
{
return contain;
diff --git a/indra/newview/lltoolview.h b/indra/newview/lltoolview.h
index bde0010466..23f4263602 100644
--- a/indra/newview/lltoolview.h
+++ b/indra/newview/lltoolview.h
@@ -33,7 +33,6 @@
#define LL_LLTOOLVIEW_H
// requires stdtypes.h
-#include "linked_lists.h"
#include "llpanel.h"
// forward declares
@@ -84,8 +83,8 @@ private:
private:
- LLLinkedList
- <LLToolContainer> mContainList;
+ typedef std::vector<LLToolContainer*> contain_list_t;
+ contain_list_t mContainList;
S32 mButtonCount; // used to compute rectangles
};
diff --git a/indra/newview/lluploaddialog.cpp b/indra/newview/lluploaddialog.cpp
index b9f2ef2ddf..ac41e02744 100644
--- a/indra/newview/lluploaddialog.cpp
+++ b/indra/newview/lluploaddialog.cpp
@@ -100,7 +100,7 @@ void LLUploadDialog::setMessage( const std::string& msg)
// Split message into lines, separated by '\n'
S32 max_msg_width = 0;
- LLDoubleLinkedList<LLString> msg_lines;
+ std::list<std::string> msg_lines;
S32 size = msg.size() + 1;// + strlen("Uploading...\n\n");
char* temp_msg = new char[size];
@@ -118,7 +118,7 @@ void LLUploadDialog::setMessage( const std::string& msg)
{
S32 cur_width = S32(font->getWidth(token) + 0.99f) + TEXT_PAD;
max_msg_width = llmax( max_msg_width, cur_width );
- msg_lines.addDataAtEnd( new LLString( token ) );
+ msg_lines.push_back( std::string( token ) );
token = strtok( NULL, "\n" );
}
delete[] temp_msg;
@@ -126,7 +126,7 @@ void LLUploadDialog::setMessage( const std::string& msg)
S32 line_height = S32( font->getLineHeight() + 0.99f );
S32 dialog_width = max_msg_width + 2 * HPAD;
- S32 dialog_height = line_height * msg_lines.getLength() + 2 * VPAD;
+ S32 dialog_height = line_height * msg_lines.size() + 2 * VPAD;
reshape( dialog_width, dialog_height, FALSE );
@@ -139,18 +139,19 @@ void LLUploadDialog::setMessage( const std::string& msg)
mLabelBox[line_num]->setVisible(FALSE);
}
line_num = 0;
- for( LLString* cur_line = msg_lines.getFirstData(); cur_line; cur_line = msg_lines.getNextData() )
+ for (std::list<std::string>::iterator iter = msg_lines.begin();
+ iter != msg_lines.end(); ++iter)
{
+ std::string& cur_line = *iter;
LLRect msg_rect;
msg_rect.setOriginAndSize( msg_x, msg_y, max_msg_width, line_height );
mLabelBox[line_num]->setRect(msg_rect);
- mLabelBox[line_num]->setText(*cur_line);
+ mLabelBox[line_num]->setText(cur_line);
mLabelBox[line_num]->setColor( gColors.getColor( "LabelTextColor" ) );
mLabelBox[line_num]->setVisible(TRUE);
msg_y -= line_height;
++line_num;
}
- msg_lines.deleteAllData();
centerWithin(gViewerWindow->getRootView()->getRect());
}
diff --git a/indra/newview/llurlhistory.cpp b/indra/newview/llurlhistory.cpp
index 8f9c926616..d5241a4e98 100644
--- a/indra/newview/llurlhistory.cpp
+++ b/indra/newview/llurlhistory.cpp
@@ -62,6 +62,7 @@ bool LLURLHistory::loadFile(const LLString& filename)
llinfos << "file missing, ill-formed, "
"or simply undefined; not changing the"
" file" << llendl;
+ sHistorySD = LLSD();
return false;
}
}
@@ -100,8 +101,11 @@ LLSD LLURLHistory::getURLHistory(const std::string& collection)
// static
void LLURLHistory::addURL(const std::string& collection, const std::string& url)
{
- sHistorySD[collection].insert(0, url);
- LLURLHistory::limitSize(collection);
+ if(! url.empty())
+ {
+ sHistorySD[collection].insert(0, url);
+ LLURLHistory::limitSize(collection);
+ }
}
// static
void LLURLHistory::removeURL(const std::string& collection, const std::string& url)
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 16cbb3272f..5200c321db 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -4121,7 +4121,7 @@ void process_alert_core(const std::string& message, BOOL modal)
}
}
-LLLinkedList<LLMeanCollisionData> gMeanCollisionList;
+mean_collision_list_t gMeanCollisionList;
time_t gLastDisplayedTime = 0;
void handle_show_mean_events(void *)
@@ -4141,15 +4141,19 @@ void mean_name_callback(const LLUUID &id, const char *first, const char *last, B
return;
}
- while(gMeanCollisionList.getLength() > 20)
+ static const int max_collision_list_size = 20;
+ if (gMeanCollisionList.size() > max_collision_list_size)
{
- gMeanCollisionList.getLastData();
- gMeanCollisionList.deleteCurrentData();
+ mean_collision_list_t::iterator iter = gMeanCollisionList.begin();
+ for (S32 i=0; i<max_collision_list_size; i++) iter++;
+ for_each(iter, gMeanCollisionList.end(), DeletePointer());
+ gMeanCollisionList.erase(iter, gMeanCollisionList.end());
}
- LLMeanCollisionData *mcd;
- for (mcd = gMeanCollisionList.getFirstData(); mcd; mcd = gMeanCollisionList.getNextData())
+ for (mean_collision_list_t::iterator iter = gMeanCollisionList.begin();
+ iter != gMeanCollisionList.end(); ++iter)
{
+ LLMeanCollisionData *mcd = *iter;
if (mcd->mPerp == id)
{
strncpy(mcd->mFirstName, first, DB_FIRST_NAME_BUF_SIZE -1); /* Flawfinder: ignore */
@@ -4190,12 +4194,12 @@ void process_mean_collision_alert_message(LLMessageSystem *msgsystem, void **use
type = (EMeanCollisionType)u8type;
- LLMeanCollisionData *mcd;
-
BOOL b_found = FALSE;
- for (mcd = gMeanCollisionList.getFirstData(); mcd; mcd = gMeanCollisionList.getNextData())
+ for (mean_collision_list_t::iterator iter = gMeanCollisionList.begin();
+ iter != gMeanCollisionList.end(); ++iter)
{
+ LLMeanCollisionData *mcd = *iter;
if ((mcd->mPerp == perp) && (mcd->mType == type))
{
mcd->mTime = time;
@@ -4208,7 +4212,7 @@ void process_mean_collision_alert_message(LLMessageSystem *msgsystem, void **use
if (!b_found)
{
LLMeanCollisionData *mcd = new LLMeanCollisionData(gAgentID, perp, time, type, mag);
- gMeanCollisionList.addData(mcd);
+ gMeanCollisionList.push_front(mcd);
const BOOL is_group = FALSE;
gCacheName->get(perp, is_group, mean_name_callback);
}
diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h
index f7739f0871..23783058a0 100644
--- a/indra/newview/llviewermessage.h
+++ b/indra/newview/llviewermessage.h
@@ -111,6 +111,9 @@ void process_agent_alert_message(LLMessageSystem* msgsystem, void** user_data);
void process_alert_core(const std::string& message, BOOL modal);
// "Mean" or player-vs-player abuse
+typedef std::list<LLMeanCollisionData*> mean_collision_list_t;
+extern mean_collision_list_t gMeanCollisionList;
+
void handle_show_mean_events(void *);
void process_mean_collision_alert_message(LLMessageSystem* msg, void**);
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 602b60bc9d..e89722fde8 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -2292,7 +2292,7 @@ void LLViewerObject::dirtyInventory()
// If there aren't any LLVOInventoryListeners, we won't be
// able to update our mInventory when it comes back from the
// simulator, so we should not clear the inventory either.
- if(mInventory && !mInventoryCallbacks.isEmpty())
+ if(mInventory && !mInventoryCallbacks.empty())
{
mInventory->clear(); // will deref and delete entries
delete mInventory;
@@ -2308,20 +2308,22 @@ void LLViewerObject::registerInventoryListener(LLVOInventoryListener* listener,
LLInventoryCallbackInfo* info = new LLInventoryCallbackInfo;
info->mListener = listener;
info->mInventoryData = user_data;
- mInventoryCallbacks.addData(info);
+ mInventoryCallbacks.push_front(info);
}
void LLViewerObject::removeInventoryListener(LLVOInventoryListener* listener)
{
- if (listener == NULL) return;
- LLInventoryCallbackInfo* info;
- for (info = mInventoryCallbacks.getFirstData();
- info;
- info = mInventoryCallbacks.getNextData() )
+ if (listener == NULL)
+ return;
+ for (callback_list_t::iterator iter = mInventoryCallbacks.begin();
+ iter != mInventoryCallbacks.end(); )
{
+ callback_list_t::iterator curiter = iter++;
+ LLInventoryCallbackInfo* info = *curiter;
if (info->mListener == listener)
{
- mInventoryCallbacks.deleteCurrentData();
+ delete info;
+ mInventoryCallbacks.erase(curiter);
break;
}
}
@@ -2329,7 +2331,8 @@ void LLViewerObject::removeInventoryListener(LLVOInventoryListener* listener)
void LLViewerObject::clearInventoryListeners()
{
- mInventoryCallbacks.deleteAllData();
+ for_each(mInventoryCallbacks.begin(), mInventoryCallbacks.end(), DeletePointer());
+ mInventoryCallbacks.clear();
}
void LLViewerObject::requestInventory()
@@ -2518,10 +2521,11 @@ void LLViewerObject::loadTaskInvFile(const char* filename)
void LLViewerObject::doInventoryCallback()
{
- for(LLInventoryCallbackInfo* info = mInventoryCallbacks.getFirstData();
- info != NULL;
- info = mInventoryCallbacks.getNextData())
+ for (callback_list_t::iterator iter = mInventoryCallbacks.begin();
+ iter != mInventoryCallbacks.end(); )
{
+ callback_list_t::iterator curiter = iter++;
+ LLInventoryCallbackInfo* info = *curiter;
if (info->mListener != NULL)
{
info->mListener->inventoryChanged(this,
@@ -2532,7 +2536,8 @@ void LLViewerObject::doInventoryCallback()
else
{
llinfos << "LLViewerObject::doInventoryCallback() deleting bad listener entry." << llendl;
- mInventoryCallbacks.deleteCurrentData();
+ delete info;
+ mInventoryCallbacks.erase(curiter);
}
}
mInventoryPending = FALSE;
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index c11c3c891e..38744c35cf 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -34,7 +34,6 @@
#include <map>
-#include "linked_lists.h"
#include "llassetstorage.h"
#include "lldarrayptr.h"
#include "llhudtext.h"
@@ -591,7 +590,8 @@ protected:
LLVOInventoryListener* mListener;
void* mInventoryData;
};
- LLLinkedList<LLInventoryCallbackInfo> mInventoryCallbacks;
+ typedef std::list<LLInventoryCallbackInfo*> callback_list_t;
+ callback_list_t mInventoryCallbacks;
S16 mInventorySerialNum;
LLViewerRegion *mRegionp; // Region that this object belongs to.
diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h
index 95c65d15ce..39603cfd3b 100644
--- a/indra/newview/llviewerobjectlist.h
+++ b/indra/newview/llviewerobjectlist.h
@@ -36,10 +36,8 @@
#include <set>
// common includes
-#include "doublelinkedlist.h"
#include "llstat.h"
#include "lldarrayptr.h"
-#include "llskipmap.h"
#include "llstring.h"
// project includes
diff --git a/indra/newview/llviewerpartsim.h b/indra/newview/llviewerpartsim.h
index 51b8e5a42a..343425f3d4 100644
--- a/indra/newview/llviewerpartsim.h
+++ b/indra/newview/llviewerpartsim.h
@@ -33,7 +33,6 @@
#define LL_LLVIEWERPARTSIM_H
#include "lldarrayptr.h"
-#include "llskiplist.h"
#include "llframetimer.h"
#include "llmemory.h"
diff --git a/indra/newview/llviewerprecompiledheaders.h b/indra/newview/llviewerprecompiledheaders.h
index 0e0265d30b..ce0fe2c836 100644
--- a/indra/newview/llviewerprecompiledheaders.h
+++ b/indra/newview/llviewerprecompiledheaders.h
@@ -68,21 +68,17 @@
// Library headers from llcommon project:
#include "bitpack.h"
-#include "doublelinkedlist.h"
#include "imageids.h"
#include "indra_constants.h"
//#include "linden_common.h"
//#include "llpreprocessor.h"
-#include "linked_lists.h"
#include "llapp.h"
#include "llapr.h"
-#include "llassoclist.h"
#include "llcriticaldamp.h"
#include "lldarray.h"
#include "lldarrayptr.h"
#include "lldefs.h"
#include "lldepthstack.h"
-#include "lldlinked.h"
#include "lldqueueptr.h"
#include "llendianswizzle.h"
#include "llerror.h"
@@ -90,18 +86,13 @@
#include "llfixedbuffer.h"
#include "llframetimer.h"
#include "llhash.h"
-#include "lllinkedqueue.h"
#include "lllocalidhashmap.h"
#include "llmap.h"
#include "llmemory.h"
#include "llnametable.h"
#include "llpriqueuemap.h"
#include "llprocessor.h"
-#include "llptrskiplist.h"
-#include "llptrskipmap.h"
//#include "llsecondlifeurls.h"
-#include "llskiplist.h"
-#include "llskipmap.h"
#include "llstack.h"
#include "llstat.h"
#include "llstl.h"
@@ -170,7 +161,6 @@
// Library includes from llmessage project
//#include "llassetstorage.h"
#include "llcachename.h"
-#include "llcallbacklisth.h"
#include "llcircuit.h"
#include "lldatapacker.h"
#include "lldbstrings.h"
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 42654e250b..88271aa7f6 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -98,7 +98,6 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
mBillableFactor(1.0),
mMaxTasks(MAX_TASKS_PER_REGION),
mCacheLoaded(FALSE),
- mCacheMap(),
mCacheEntriesCount(0),
mCacheID(),
mEventPoll(NULL)
@@ -343,7 +342,7 @@ void LLViewerRegion::saveCache()
entry->writeToFile(fp);
}
- mCacheMap.removeAllData();
+ mCacheMap.clear();
mCacheEnd.unlink();
mCacheEnd.init();
mCacheStart.deleteAll();
@@ -1013,7 +1012,7 @@ void LLViewerRegion::cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinary
U32 local_id = objectp->getLocalID();
U32 crc = objectp->getCRC();
- LLVOCacheEntry *entry = mCacheMap.getIfThere(local_id);
+ LLVOCacheEntry* entry = get_if_there(mCacheMap, local_id, (LLVOCacheEntry*)NULL);
if (entry)
{
@@ -1026,7 +1025,7 @@ void LLViewerRegion::cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinary
else
{
// Update the cache entry
- mCacheMap.removeData(local_id);
+ mCacheMap.erase(local_id);
delete entry;
entry = new LLVOCacheEntry(local_id, crc, dp);
mCacheEnd.insert(*entry);
@@ -1041,7 +1040,7 @@ void LLViewerRegion::cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinary
if (mCacheEntriesCount > MAX_OBJECT_CACHE_ENTRIES)
{
entry = mCacheStart.getNext();
- mCacheMap.removeData(entry->getLocalID());
+ mCacheMap.erase(entry->getLocalID());
delete entry;
mCacheEntriesCount--;
}
@@ -1060,7 +1059,7 @@ LLDataPacker *LLViewerRegion::getDP(U32 local_id, U32 crc)
{
llassert(mCacheLoaded);
- LLVOCacheEntry *entry = mCacheMap.getIfThere(local_id);
+ LLVOCacheEntry* entry = get_if_there(mCacheMap, local_id, (LLVOCacheEntry*)NULL);
if (entry)
{
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index 3d5334cd18..6625e3bdf6 100644
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -44,7 +44,6 @@
#include "llhost.h"
#include "llstring.h"
#include "llregionflags.h"
-#include "llptrskipmap.h"
#include "lluuid.h"
#include "lldatapacker.h"
#include "llvocache.h"
@@ -352,7 +351,8 @@ protected:
// Regions can have order 10,000 objects, so assume
// a structure of size 2^14 = 16,000
BOOL mCacheLoaded;
- LLPtrSkipMap<U32, LLVOCacheEntry *, 14> mCacheMap;
+ typedef std::map<U32, LLVOCacheEntry *> cache_map_t;
+ cache_map_t mCacheMap;
LLVOCacheEntry mCacheStart;
LLVOCacheEntry mCacheEnd;
U32 mCacheEntriesCount;
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index d1e67bfbbd..dcceb397d3 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -57,7 +57,6 @@
// linden library includes
#include "audioengine.h" // mute on minimize
#include "indra_constants.h"
-#include "linked_lists.h"
#include "llassetstorage.h"
#include "llfontgl.h"
#include "llrect.h"
@@ -1812,18 +1811,23 @@ void adjust_rect_bottom_center(const LLString& control, const LLRect& window)
}
}
-
-void update_saved_window_size(const LLString& control,S32 delta_width, S32 delta_height)
+void adjust_rect_centered_partial_zoom(const LLString& control,
+ const LLRect& window)
{
- if (delta_width || delta_height )
- {
- LLRect mXMLRect = gSavedSettings.getRect(control);
- //hard code it all follows the right and top
- mXMLRect.mRight += delta_width;
- mXMLRect.mTop += delta_height;
- mXMLRect.mLeft = llmax (0, mXMLRect.mLeft+delta_width);
- mXMLRect.mBottom = llmax(0,mXMLRect.mBottom+delta_height);
- gSavedSettings.setRect(control,mXMLRect);
+ LLRect rect = gSavedSettings.getRect(control);
+ // Only adjust on first use
+ if (rect.mLeft == 0 && rect.mBottom == 0)
+ {
+ S32 width = window.getWidth();
+ S32 height = window.getHeight();
+ rect.set(0, height-STATUS_BAR_HEIGHT, width, TOOL_BAR_HEIGHT);
+ // Make floater fill 80% of window, leaving 20% padding on
+ // the sides.
+ const F32 ZOOM_FRACTION = 0.8f;
+ S32 dx = (S32)(width * (1.f - ZOOM_FRACTION));
+ S32 dy = (S32)(height * (1.f - ZOOM_FRACTION));
+ rect.stretch(-dx/2, -dy/2);
+ gSavedSettings.setRect(control, rect);
}
}
@@ -1848,7 +1852,7 @@ void LLViewerWindow::adjustRectanglesForFirstUse(const LLRect& window)
adjust_rect_top_left("FloaterGestureRect2", window);
- adjust_rect_top_right("FloaterMapRect", window);
+ adjust_rect_top_right("FloaterMiniMapRect", window);
adjust_rect_top_right("FloaterLagMeter", window);
@@ -1917,17 +1921,8 @@ void LLViewerWindow::initWorldUI()
LLWorldMapView::initClass();
- LLRect world_map_rect = gSavedSettings.getRect("FloaterWorldMapRect");
- // if 0,0,0,0 then use fullscreen
- if (world_map_rect.mTop == 0
- && world_map_rect.mLeft == 0
- && world_map_rect.mRight == 0
- && world_map_rect.mBottom == 0)
- {
- world_map_rect.set(0, height-TOOL_BAR_HEIGHT, width, STATUS_BAR_HEIGHT);
- world_map_rect.stretch(-4);
- gSavedSettings.setRect("FloaterWorldMapRect", world_map_rect);
- }
+ adjust_rect_centered_partial_zoom("FloaterWorldMapRect2", full_window);
+
gFloaterWorldMap = new LLFloaterWorldMap();
gFloaterWorldMap->setVisible(FALSE);
@@ -2121,9 +2116,6 @@ void LLViewerWindow::reshape(S32 width, S32 height)
}
}
- // changes in window's width and hight
- S32 delta_width = width - mWindowRect.getWidth();
- S32 delta_height = height - mWindowRect.getHeight();
// update our window rectangle
mWindowRect.mRight = mWindowRect.mLeft + width;
mWindowRect.mTop = mWindowRect.mBottom + height;
@@ -2174,12 +2166,6 @@ void LLViewerWindow::reshape(S32 width, S32 height)
{
gSavedSettings.setS32("WindowWidth", window_size.mX);
gSavedSettings.setS32("WindowHeight", window_size.mY);
- if (!gFloaterMap)
- {
- update_saved_window_size("FloaterWorldMapRect",delta_width, delta_height);
- update_saved_window_size("FloaterMapRect",delta_width, delta_height);
- }
-
}
}
diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h
index f62c25df91..09ad3fc270 100644
--- a/indra/newview/llviewerwindow.h
+++ b/indra/newview/llviewerwindow.h
@@ -41,7 +41,6 @@
#ifndef LL_LLVIEWERWINDOW_H
#define LL_LLVIEWERWINDOW_H
-#include "linked_lists.h"
#include "v3dmath.h"
#include "v2math.h"
#include "llwindow.h"
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 5521b7f5f7..58f94120d0 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -746,13 +746,16 @@ void LLVOVolume::sculpt()
return;
LLPointer<LLImageRaw> raw_image = new LLImageRaw();
- mSculptTexture->readBackRaw(discard_level, raw_image, TRUE);
+ mSculptTexture->readBackRaw(discard_level, raw_image, FALSE);
sculpt_height = raw_image->getHeight();
sculpt_width = raw_image->getWidth();
sculpt_components = raw_image->getComponents();
sculpt_data = raw_image->getData();
+
+ llassert_always(raw_image->getDataSize() >= sculpt_height * sculpt_width * sculpt_components);
+
getVolume()->sculpt(sculpt_width, sculpt_height, sculpt_components, sculpt_data, discard_level);
}
}
diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp
index b4e79109ac..b63543a327 100644
--- a/indra/newview/llwearable.cpp
+++ b/indra/newview/llwearable.cpp
@@ -132,8 +132,6 @@ LLWearable::LLWearable(const LLAssetID& asset_id) :
LLWearable::~LLWearable()
{
- mVisualParamMap.deleteAllData();
- mTEMap.deleteAllData();
}
@@ -227,35 +225,37 @@ BOOL LLWearable::exportFile( FILE* file )
}
// parameters
- S32 num_parameters = mVisualParamMap.getLength();
+ S32 num_parameters = mVisualParamMap.size();
if( fprintf( file, "parameters %d\n", num_parameters ) < 0 )
{
return FALSE;
}
char s[ MAX_STRING ]; /* Flawfinder: ignore */
- for( F32* param_weightp = mVisualParamMap.getFirstData(); param_weightp; param_weightp = mVisualParamMap.getNextData() )
+ for (param_map_t::iterator iter = mVisualParamMap.begin();
+ iter != mVisualParamMap.end(); ++iter)
{
- S32 param_id = mVisualParamMap.getCurrentKeyWithoutIncrement();
- if( fprintf( file, "%d %s\n", param_id, terse_F32_to_string( *param_weightp, s ) ) < 0 )
+ S32 param_id = iter->first;
+ F32 param_weight = iter->second;
+ if( fprintf( file, "%d %s\n", param_id, terse_F32_to_string( param_weight, s ) ) < 0 )
{
return FALSE;
}
}
// texture entries
- S32 num_textures = mTEMap.getLength();
+ S32 num_textures = mTEMap.size();
if( fprintf( file, "textures %d\n", num_textures ) < 0 )
{
return FALSE;
}
- for( LLUUID* image_id = mTEMap.getFirstData(); image_id; image_id = mTEMap.getNextData() )
+ for (te_map_t::iterator iter = mTEMap.begin();
+ iter != mTEMap.end(); ++iter)
{
- S32 te = mTEMap.getCurrentKeyWithoutIncrement();
- char image_id_string[UUID_STR_LENGTH]; /* Flawfinder: ignore */
- image_id->toString( image_id_string );
- if( fprintf( file, "%d %s\n", te, image_id_string) < 0 )
+ S32 te = iter->first;
+ LLUUID& image_id = iter->second;
+ if( fprintf( file, "%d %s\n", te, image_id.asString().c_str()) < 0 )
{
return FALSE;
}
@@ -418,7 +418,7 @@ BOOL LLWearable::importFile( FILE* file )
llwarns << "Bad Wearable asset: bad parameter, #" << i << llendl;
return FALSE;
}
- mVisualParamMap.addData( param_id, new F32(param_weight) );
+ mVisualParamMap[param_id] = param_weight;
}
// textures header
@@ -450,7 +450,7 @@ BOOL LLWearable::importFile( FILE* file )
return FALSE;
}
- mTEMap.addData( te, new LLUUID( text_buffer ) );
+ mTEMap[te] = LLUUID(text_buffer );
}
return TRUE;
@@ -488,13 +488,13 @@ BOOL LLWearable::isOldVersion()
if( (param->getWearableType() == mType) && (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE ) )
{
param_count++;
- if( !mVisualParamMap.checkKey( param->getID() ) )
+ if( !is_in_map(mVisualParamMap, param->getID() ) )
{
return TRUE;
}
}
}
- if( param_count != mVisualParamMap.getLength() )
+ if( param_count != mVisualParamMap.size() )
{
return TRUE;
}
@@ -506,13 +506,13 @@ BOOL LLWearable::isOldVersion()
if( LLVOAvatar::getTEWearableType( te ) == mType )
{
te_count++;
- if( !mTEMap.checkKey( te ) )
+ if( !is_in_map(mTEMap, te ) )
{
return TRUE;
}
}
}
- if( te_count != mTEMap.getLength() )
+ if( te_count != mTEMap.size() )
{
return TRUE;
}
@@ -543,16 +543,8 @@ BOOL LLWearable::isDirty()
{
if( (param->getWearableType() == mType) && (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE ) )
{
- F32* weightp = mVisualParamMap.getIfThere( param->getID() );
- F32 weight;
- if( weightp )
- {
- weight = llclamp( *weightp, param->getMinWeight(), param->getMaxWeight() );
- }
- else
- {
- weight = param->getDefaultWeight();
- }
+ F32 weight = get_if_there(mVisualParamMap, param->getID(), param->getDefaultWeight());
+ weight = llclamp( weight, param->getMinWeight(), param->getMaxWeight() );
U8 a = F32_to_U8( param->getWeight(), param->getMinWeight(), param->getMaxWeight() );
U8 b = F32_to_U8( weight, param->getMinWeight(), param->getMaxWeight() );
@@ -573,8 +565,7 @@ BOOL LLWearable::isDirty()
llassert( 0 );
continue;
}
- LLUUID* mapped_image_id = mTEMap.getIfThere( te );
- const LLUUID& image_id = mapped_image_id ? *mapped_image_id : LLVOAvatar::getDefaultTEImageID( te );
+ const LLUUID& image_id = get_if_there(mTEMap, te, LLVOAvatar::getDefaultTEImageID( te ) );
if( avatar_image->getID() != image_id )
{
return TRUE;
@@ -603,24 +594,24 @@ void LLWearable::setParamsToDefaults()
return;
}
- mVisualParamMap.deleteAllData();
+ mVisualParamMap.clear();
for( LLVisualParam* param = avatar->getFirstVisualParam(); param; param = avatar->getNextVisualParam() )
{
if( (((LLViewerVisualParam*)param)->getWearableType() == mType ) && (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE ) )
{
- mVisualParamMap.addData( param->getID(), new F32( param->getDefaultWeight() ) );
+ mVisualParamMap[param->getID()] = param->getDefaultWeight();
}
}
}
void LLWearable::setTexturesToDefaults()
{
- mTEMap.deleteAllData();
+ mTEMap.clear();
for( S32 te = 0; te < LLVOAvatar::TEX_NUM_ENTRIES; te++ )
{
if( LLVOAvatar::getTEWearableType( te ) == mType )
{
- mTEMap.addData( te, new LLUUID( LLVOAvatar::getDefaultTEImageID( te ) ) );
+ mTEMap[te] = LLVOAvatar::getDefaultTEImageID( te );
}
}
}
@@ -643,30 +634,15 @@ void LLWearable::writeToAvatar( BOOL set_by_user )
if( (((LLViewerVisualParam*)param)->getWearableType() == mType) && (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE ) )
{
S32 param_id = param->getID();
- F32* weight = mVisualParamMap.getIfThere( param_id );
- if( weight )
+ F32 weight = get_if_there(mVisualParamMap, param_id, param->getDefaultWeight());
+ // only animate with user-originated changes
+ if (set_by_user)
{
- // only animate with user-originated changes
- if (set_by_user)
- {
- param->setAnimationTarget(*weight, set_by_user);
- }
- else
- {
- avatar->setVisualParamWeight( param_id, *weight, set_by_user );
- }
+ param->setAnimationTarget(weight, set_by_user);
}
else
{
- // only animate with user-originated changes
- if (set_by_user)
- {
- param->setAnimationTarget(param->getDefaultWeight(), set_by_user);
- }
- else
- {
- avatar->setVisualParamWeight( param_id, param->getDefaultWeight(), set_by_user );
- }
+ avatar->setVisualParamWeight( param_id, weight, set_by_user );
}
}
}
@@ -682,8 +658,7 @@ void LLWearable::writeToAvatar( BOOL set_by_user )
{
if( LLVOAvatar::getTEWearableType( te ) == mType )
{
- LLUUID* mapped_image_id = mTEMap.getIfThere( te );
- const LLUUID& image_id = mapped_image_id ? *mapped_image_id : LLVOAvatar::getDefaultTEImageID( te );
+ const LLUUID& image_id = get_if_there(mTEMap, te, LLVOAvatar::getDefaultTEImageID( te ) );
LLViewerImage* image = gImageList.getImage( image_id );
avatar->setLocTexTE( te, image, set_by_user );
}
@@ -792,16 +767,16 @@ void LLWearable::readFromAvatar()
mDefinitionVersion = LLWearable::sCurrentDefinitionVersion;
- mVisualParamMap.deleteAllData();
+ mVisualParamMap.clear();
for( LLVisualParam* param = avatar->getFirstVisualParam(); param; param = avatar->getNextVisualParam() )
{
if( (((LLViewerVisualParam*)param)->getWearableType() == mType) && (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE ) )
{
- mVisualParamMap.addData( param->getID(), new F32( param->getWeight() ) );
+ mVisualParamMap[param->getID()] = param->getWeight();
}
}
- mTEMap.deleteAllData();
+ mTEMap.clear();
for( S32 te = 0; te < LLVOAvatar::TEX_NUM_ENTRIES; te++ )
{
if( LLVOAvatar::getTEWearableType( te ) == mType )
@@ -809,7 +784,7 @@ void LLWearable::readFromAvatar()
LLViewerImage* image = avatar->getTEImage( te );
if( image )
{
- mTEMap.addData( te, new LLUUID( image->getID() ) );
+ mTEMap[te] = image->getID();
}
}
}
@@ -847,9 +822,8 @@ void LLWearable::copyDataFrom( LLWearable* src )
if( (param->getWearableType() == mType) && (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE ) )
{
S32 id = param->getID();
- F32* weightp = src->mVisualParamMap.getIfThere( id );
- F32 weight = weightp ? *weightp : param->getDefaultWeight();
- mVisualParamMap.addData( id, new F32( weight ) );
+ F32 weight = get_if_there(src->mVisualParamMap, id, param->getDefaultWeight() );
+ mVisualParamMap[id] = weight;
}
}
@@ -858,9 +832,8 @@ void LLWearable::copyDataFrom( LLWearable* src )
{
if( LLVOAvatar::getTEWearableType( te ) == mType )
{
- LLUUID* mapped_image_id = src->mTEMap.getIfThere( te );
- const LLUUID& image_id = mapped_image_id ? *mapped_image_id : LLVOAvatar::getDefaultTEImageID( te );
- mTEMap.addData( te, new LLUUID( image_id ) );
+ const LLUUID& image_id = get_if_there(src->mTEMap, te, LLVOAvatar::getDefaultTEImageID( te ) );
+ mTEMap[te] = image_id;
}
}
}
@@ -985,21 +958,21 @@ void LLWearable::dump()
//mSaleInfo
llinfos << " Params:" << llendl;
- for( F32* param_weightp = mVisualParamMap.getFirstData();
- param_weightp;
- param_weightp = mVisualParamMap.getNextData() )
+ for (param_map_t::iterator iter = mVisualParamMap.begin();
+ iter != mVisualParamMap.end(); ++iter)
{
- S32 param_id = mVisualParamMap.getCurrentKeyWithoutIncrement();
- llinfos << " " << param_id << " " << *param_weightp << llendl;
+ S32 param_id = iter->first;
+ F32 param_weight = iter->second;
+ llinfos << " " << param_id << " " << param_weight << llendl;
}
llinfos << " Textures:" << llendl;
- for( LLUUID* image_id = mTEMap.getFirstData();
- image_id;
- image_id = mTEMap.getNextData() )
+ for (te_map_t::iterator iter = mTEMap.begin();
+ iter != mTEMap.end(); ++iter)
{
- S32 te = mTEMap.getCurrentKeyWithoutIncrement();
- llinfos << " " << te << " " << *image_id << llendl;
+ S32 te = iter->first;
+ LLUUID& image_id = iter->second;
+ llinfos << " " << te << " " << image_id << llendl;
}
}
diff --git a/indra/newview/llwearable.h b/indra/newview/llwearable.h
index cd02843ccf..1b0fb3d7aa 100644
--- a/indra/newview/llwearable.h
+++ b/indra/newview/llwearable.h
@@ -33,7 +33,6 @@
#define LL_LLWEARABLE_H
#include "lluuid.h"
-#include "llptrskipmap.h"
#include "llstring.h"
#include "llpermissions.h"
#include "llsaleinfo.h"
@@ -132,8 +131,10 @@ private:
LLTransactionID mTransactionID;
EWearableType mType;
- LLPtrSkipMap<S32, F32*> mVisualParamMap; // maps visual param id to weight
- LLPtrSkipMap<S32, LLUUID*> mTEMap; // maps TE to Image ID
+ typedef std::map<S32, F32> param_map_t;
+ param_map_t mVisualParamMap; // maps visual param id to weight
+ typedef std::map<S32, LLUUID> te_map_t;
+ te_map_t mTEMap; // maps TE to Image ID
static const char* sTypeName[ WT_COUNT ];
static const char* sTypeLabel[ WT_COUNT ];
diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp
index 39a6046f59..c94ee7c54e 100644
--- a/indra/newview/llwearablelist.cpp
+++ b/indra/newview/llwearablelist.cpp
@@ -73,13 +73,14 @@ struct LLWearableArrivedData
LLWearableList::~LLWearableList()
{
- mList.deleteAllData();
+ for_each(mList.begin(), mList.end(), DeletePairedPointer());
+ mList.clear();
}
void LLWearableList::getAsset( const LLAssetID& assetID, const LLString& wearable_name, LLAssetType::EType asset_type, void(*asset_arrived_callback)(LLWearable*, void* userdata), void* userdata )
{
llassert( (asset_type == LLAssetType::AT_CLOTHING) || (asset_type == LLAssetType::AT_BODYPART) );
- LLWearable* instance = mList.getIfThere( assetID );
+ LLWearable* instance = get_if_there(mList, assetID, (LLWearable*)NULL );
if( instance )
{
asset_arrived_callback( instance, userdata );
diff --git a/indra/newview/llwearablelist.h b/indra/newview/llwearablelist.h
index 303fcb7bd3..c3a7e1bd91 100644
--- a/indra/newview/llwearablelist.h
+++ b/indra/newview/llwearablelist.h
@@ -33,7 +33,6 @@
#define LL_LLWEARABLELIST_H
#include "llwearable.h"
-#include "llskiplist.h"
#include "lluuid.h"
#include "llassetstorage.h"
@@ -43,9 +42,7 @@ public:
LLWearableList() {}
~LLWearableList();
- S32 getLength() { return mList.getLength(); }
- const LLWearable* getFirst() { return mList.getFirstData(); }
- const LLWearable* getNext() { return mList.getNextData(); }
+ S32 getLength() { return mList.size(); }
void getAsset(
const LLAssetID& assetID,
@@ -65,7 +62,7 @@ public:
static void processGetAssetReply(const char* filename, const LLAssetID& assetID, void* user_data, S32 status, LLExtStat ext_status);
protected:
- LLPtrSkipMap< const LLUUID, LLWearable* > mList;
+ std::map< LLUUID, LLWearable* > mList;
};
extern LLWearableList gWearableList;
diff --git a/indra/newview/llwindebug.cpp b/indra/newview/llwindebug.cpp
index 949ea71c56..42f8a12e4c 100644
--- a/indra/newview/llwindebug.cpp
+++ b/indra/newview/llwindebug.cpp
@@ -121,6 +121,172 @@ MODULE32_NEST Module32Next_;
#define CALL_TRACE_MAX ((DUMP_SIZE_MAX - 2000) / (MAX_PATH + 40)) //max number of traced calls
#define NL L"\r\n" //new line
+BOOL WINAPI Get_Module_By_Ret_Addr(PBYTE Ret_Addr, LPWSTR Module_Name, PBYTE & Module_Addr);
+
+
+void printError( CHAR* msg )
+{
+ DWORD eNum;
+ TCHAR sysMsg[256];
+ TCHAR* p;
+
+ eNum = GetLastError( );
+ FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL, eNum,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+ sysMsg, 256, NULL );
+
+ // Trim the end of the line and terminate it with a null
+ p = sysMsg;
+ while( ( *p > 31 ) || ( *p == 9 ) )
+ ++p;
+ do { *p-- = 0; } while( ( p >= sysMsg ) &&
+ ( ( *p == '.' ) || ( *p < 33 ) ) );
+
+ // Display the message
+ printf( "\n WARNING: %s failed with error %d (%s)", msg, eNum, sysMsg );
+}
+
+BOOL GetProcessThreadIDs(DWORD process_id, std::vector<DWORD>& thread_ids)
+{
+ HANDLE hThreadSnap = INVALID_HANDLE_VALUE;
+ THREADENTRY32 te32;
+
+ // Take a snapshot of all running threads
+ hThreadSnap = CreateToolhelp32Snapshot( TH32CS_SNAPTHREAD, 0 );
+ if( hThreadSnap == INVALID_HANDLE_VALUE )
+ return( FALSE );
+
+ // Fill in the size of the structure before using it.
+ te32.dwSize = sizeof(THREADENTRY32 );
+
+ // Retrieve information about the first thread,
+ // and exit if unsuccessful
+ if( !Thread32First( hThreadSnap, &te32 ) )
+ {
+ printError( "Thread32First" ); // Show cause of failure
+ CloseHandle( hThreadSnap ); // Must clean up the snapshot object!
+ return( FALSE );
+ }
+
+ // Now walk the thread list of the system,
+ // and display information about each thread
+ // associated with the specified process
+ do
+ {
+ if( te32.th32OwnerProcessID == process_id )
+ {
+ thread_ids.push_back(te32.th32ThreadID);
+ }
+ } while( Thread32Next(hThreadSnap, &te32 ) );
+
+// Don't forget to clean up the snapshot object.
+ CloseHandle( hThreadSnap );
+ return( TRUE );
+}
+
+void WINAPI GetCallStackData(const CONTEXT* context_struct, LLSD& info)
+{
+ // Fill Str with call stack info.
+ // pException can be either GetExceptionInformation() or NULL.
+ // If pException = NULL - get current call stack.
+
+ LPWSTR Module_Name = new WCHAR[MAX_PATH];
+ PBYTE Module_Addr = 0;
+
+ typedef struct STACK
+ {
+ STACK * Ebp;
+ PBYTE Ret_Addr;
+ DWORD Param[0];
+ } STACK, * PSTACK;
+
+ PSTACK Ebp;
+
+ if(context_struct)
+ {
+ Ebp = (PSTACK)context_struct->Ebp;
+ }
+ else
+ {
+ // The context struct is NULL,
+ // so we will use the current stack.
+ Ebp = (PSTACK)&context_struct - 1;
+
+ // Skip frame of GetCallStackData().
+ if (!IsBadReadPtr(Ebp, sizeof(PSTACK)))
+ Ebp = Ebp->Ebp; //caller ebp
+ }
+
+ // Trace CALL_TRACE_MAX calls maximum - not to exceed DUMP_SIZE_MAX.
+ // Break trace on wrong stack frame.
+ for (int Ret_Addr_I = 0, i = 0;
+ (Ret_Addr_I < CALL_TRACE_MAX) && !IsBadReadPtr(Ebp, sizeof(PSTACK)) && !IsBadCodePtr(FARPROC(Ebp->Ret_Addr));
+ Ret_Addr_I++, Ebp = Ebp->Ebp, ++i)
+ {
+ // If module with Ebp->Ret_Addr found.
+
+ if (Get_Module_By_Ret_Addr(Ebp->Ret_Addr, Module_Name, Module_Addr))
+ {
+ // Save module's address and full path.
+ info["CallStack"][i]["ModuleName"] = ll_convert_wide_to_string(Module_Name);
+ info["CallStack"][i]["ModuleAddress"] = (int)Module_Addr;
+ info["CallStack"][i]["CallOffset"] = (int)(Ebp->Ret_Addr - Module_Addr);
+
+ LLSD params;
+ // Save 5 params of the call. We don't know the real number of params.
+ if (!IsBadReadPtr(Ebp, sizeof(PSTACK) + 5 * sizeof(DWORD)))
+ {
+ for(int j = 0; j < 5; ++j)
+ {
+ params[j] = (int)Ebp->Param[j];
+ }
+ }
+ info["CallStack"][i]["Parameters"] = params;
+ }
+ info["CallStack"][i]["ReturnAddress"] = (int)Ebp->Ret_Addr;
+ }
+}
+
+BOOL GetThreadCallStack(DWORD thread_id, LLSD& info)
+{
+ if(GetCurrentThreadId() == thread_id)
+ {
+ // Early exit for the current thread.
+ // Suspending the current thread would be a bad idea.
+ // Plus you can't retrieve a valid current thread context.
+ return false;
+ }
+
+ HANDLE thread_handle = INVALID_HANDLE_VALUE;
+ thread_handle = OpenThread(THREAD_ALL_ACCESS, FALSE, thread_id);
+ if(INVALID_HANDLE_VALUE == thread_handle)
+ {
+ return FALSE;
+ }
+
+ BOOL result = false;
+ if(-1 != SuspendThread(thread_handle))
+ {
+ CONTEXT context_struct;
+ context_struct.ContextFlags = CONTEXT_FULL;
+ if(GetThreadContext(thread_handle, &context_struct))
+ {
+ GetCallStackData(&context_struct, info);
+ result = true;
+ }
+ ResumeThread(thread_handle);
+ }
+ else
+ {
+ // Couldn't suspend thread.
+ }
+
+ CloseHandle(thread_handle);
+ return result;
+}
+
+
//Windows Call Stack Construction idea from
//http://www.codeproject.com/tools/minidump.asp
@@ -490,7 +656,33 @@ LONG LLWinDebug::handleException(struct _EXCEPTION_POINTERS *exception_infop)
LLSD info;
info = Get_Exception_Info(exception_infop);
- if (info)
+
+
+ LLSD threads;
+ std::vector<DWORD> thread_ids;
+ GetProcessThreadIDs(GetCurrentProcessId(), thread_ids);
+
+ for(std::vector<DWORD>::iterator th_itr = thread_ids.begin();
+ th_itr != thread_ids.end();
+ ++th_itr)
+ {
+ LLSD thread_info;
+ if(*th_itr != GetCurrentThreadId())
+ {
+ GetThreadCallStack(*th_itr, thread_info);
+ }
+
+ if(thread_info)
+ {
+
+ threads[llformat("ID %d", *th_itr)] = thread_info;
+ }
+ }
+
+
+ info["Threads"] = threads;
+
+ if (info)
{
std::ofstream out_file(log_path.c_str());
LLSDSerialize::toPrettyXML(info, out_file);
diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp
index 6bbe5307b0..1664515f58 100644
--- a/indra/newview/llworldmapview.cpp
+++ b/indra/newview/llworldmapview.cpp
@@ -35,7 +35,6 @@
#include "indra_constants.h"
#include "llui.h"
-#include "linked_lists.h"
#include "llmath.h" // clampf()
#include "llregionhandle.h"
#include "lleventflags.h"
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 4f533e1189..136612e1a8 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -5073,11 +5073,6 @@ LLCubeMap* LLPipeline::findReflectionMap(const LLVector3& location)
return NULL;
}
-S32 LLPipeline::getVisibleCount() const
-{
- return sCull->getVisibleListSize();
-}
-
void LLPipeline::renderGroups(LLRenderPass* pass, U32 type, U32 mask, BOOL texture)
{
#if !LL_RELEASE_FOR_DOWNLOAD
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 32f5a7487b..2054492b72 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -36,8 +36,6 @@
#include "lldarrayptr.h"
#include "lldqueueptr.h"
#include "llstat.h"
-#include "lllinkedqueue.h"
-#include "llskiplist.h"
#include "lldrawpool.h"
#include "llspatialpartition.h"
#include "m4math.h"
@@ -193,7 +191,6 @@ public:
void findReferences(LLDrawable *drawablep); // Find the lists which have references to this object
BOOL verify(); // Verify that all data in the pipeline is "correct"
- S32 getVisibleCount() const;
S32 getLightCount() const { return mLights.size(); }
void calcNearbyLights(LLCamera& camera);