Merge branch 'animesh' of git://github.com/Shyotl/SingularityViewer into animesh
# Conflicts: # indra/llcommon/llindexedvector.h
This commit is contained in:
@@ -138,257 +138,6 @@ U32 LLKeyframeMotion::JointMotionList::dumpDiagInfo(bool silent) const
|
||||
return total_size;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
// ****Curve classes
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// ScaleCurve::ScaleCurve()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLKeyframeMotion::ScaleCurve::ScaleCurve()
|
||||
{
|
||||
mInterpolationType = LLKeyframeMotion::IT_LINEAR;
|
||||
mNumKeys = 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// ScaleCurve::~ScaleCurve()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLKeyframeMotion::ScaleCurve::~ScaleCurve()
|
||||
{
|
||||
mKeys.clear();
|
||||
mNumKeys = 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// getValue()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLVector3 LLKeyframeMotion::ScaleCurve::getValue(F32 time, F32 duration)
|
||||
{
|
||||
LLVector3 value;
|
||||
|
||||
if (mKeys.empty())
|
||||
{
|
||||
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
|
||||
{
|
||||
// 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())
|
||||
{
|
||||
scale_after = mLoopInKey;
|
||||
index_after = duration;
|
||||
}
|
||||
|
||||
F32 u = (time - index_before) / (index_after - index_before);
|
||||
value = interp(u, scale_before, scale_after);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// interp()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLVector3 LLKeyframeMotion::ScaleCurve::interp(F32 u, ScaleKey& before, ScaleKey& after)
|
||||
{
|
||||
switch (mInterpolationType)
|
||||
{
|
||||
case IT_STEP:
|
||||
return before.mScale;
|
||||
|
||||
default:
|
||||
case IT_LINEAR:
|
||||
case IT_SPLINE:
|
||||
return lerp(before.mScale, after.mScale, u);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// RotationCurve::RotationCurve()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLKeyframeMotion::RotationCurve::RotationCurve()
|
||||
{
|
||||
mInterpolationType = LLKeyframeMotion::IT_LINEAR;
|
||||
mNumKeys = 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// RotationCurve::~RotationCurve()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLKeyframeMotion::RotationCurve::~RotationCurve()
|
||||
{
|
||||
mKeys.clear();
|
||||
mNumKeys = 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// RotationCurve::getValue()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLQuaternion LLKeyframeMotion::RotationCurve::getValue(F32 time, F32 duration)
|
||||
{
|
||||
LLQuaternion value;
|
||||
|
||||
if (mKeys.empty())
|
||||
{
|
||||
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
|
||||
{
|
||||
// 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())
|
||||
{
|
||||
rot_after = mLoopInKey;
|
||||
index_after = duration;
|
||||
}
|
||||
|
||||
F32 u = (time - index_before) / (index_after - index_before);
|
||||
value = interp(u, rot_before, rot_after);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// interp()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLQuaternion LLKeyframeMotion::RotationCurve::interp(F32 u, RotationKey& before, RotationKey& after)
|
||||
{
|
||||
switch (mInterpolationType)
|
||||
{
|
||||
case IT_STEP:
|
||||
return before.mRotation;
|
||||
|
||||
default:
|
||||
case IT_LINEAR:
|
||||
case IT_SPLINE:
|
||||
return nlerp(u, before.mRotation, after.mRotation);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// PositionCurve::PositionCurve()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLKeyframeMotion::PositionCurve::PositionCurve()
|
||||
{
|
||||
mInterpolationType = LLKeyframeMotion::IT_LINEAR;
|
||||
mNumKeys = 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// PositionCurve::~PositionCurve()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLKeyframeMotion::PositionCurve::~PositionCurve()
|
||||
{
|
||||
mKeys.clear();
|
||||
mNumKeys = 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// PositionCurve::getValue()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLVector3 LLKeyframeMotion::PositionCurve::getValue(F32 time, F32 duration)
|
||||
{
|
||||
LLVector3 value;
|
||||
|
||||
if (mKeys.empty())
|
||||
{
|
||||
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
|
||||
{
|
||||
// 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())
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// interp()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLVector3 LLKeyframeMotion::PositionCurve::interp(F32 u, PositionKey& before, PositionKey& after)
|
||||
{
|
||||
switch (mInterpolationType)
|
||||
{
|
||||
case IT_STEP:
|
||||
return before.mPosition;
|
||||
default:
|
||||
case IT_LINEAR:
|
||||
case IT_SPLINE:
|
||||
return lerp(before.mPosition, after.mPosition, u);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
// JointMotion class
|
||||
@@ -1668,7 +1417,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id)
|
||||
success = dp.unpackVector3(rot_angles, "rot_angles") && rot_angles.isFinite();
|
||||
|
||||
LLQuaternion::Order ro = StringToOrder("ZYX");
|
||||
rot_key.mRotation = mayaQ(rot_angles.mV[VX], rot_angles.mV[VY], rot_angles.mV[VZ], ro);
|
||||
rot_key.mValue = mayaQ(rot_angles.mV[VX], rot_angles.mV[VY], rot_angles.mV[VZ], ro);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1680,10 +1429,10 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id)
|
||||
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.mValue.unpackFromVector3(rot_vec);
|
||||
}
|
||||
|
||||
if( !(rot_key.mRotation.isFinite()) )
|
||||
if( !(rot_key.mValue.isFinite()) )
|
||||
{
|
||||
LL_WARNS() << "non-finite angle in rotation key"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
@@ -1697,9 +1446,11 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
rCurve->mKeys[time] = rot_key;
|
||||
rCurve->mKeys.emplace_back(time, rot_key);
|
||||
}
|
||||
|
||||
std::sort(rCurve->mKeys.begin(), rCurve->mKeys.end(), [](const auto& a, const auto& b) { return a.first < b.first; });
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
// scan position curve header
|
||||
//---------------------------------------------------------------------
|
||||
@@ -1752,12 +1503,12 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id)
|
||||
|
||||
if (old_version)
|
||||
{
|
||||
success = dp.unpackVector3(pos_key.mPosition, "pos");
|
||||
success = dp.unpackVector3(pos_key.mValue, "pos");
|
||||
|
||||
//MAINT-6162
|
||||
pos_key.mPosition.mV[VX] = llclamp( pos_key.mPosition.mV[VX], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
|
||||
pos_key.mPosition.mV[VY] = llclamp( pos_key.mPosition.mV[VY], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
|
||||
pos_key.mPosition.mV[VZ] = llclamp( pos_key.mPosition.mV[VZ], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
|
||||
pos_key.mValue.mV[VX] = llclamp( pos_key.mValue.mV[VX], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
|
||||
pos_key.mValue.mV[VY] = llclamp( pos_key.mValue.mV[VY], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
|
||||
pos_key.mValue.mV[VZ] = llclamp( pos_key.mValue.mV[VZ], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
|
||||
|
||||
}
|
||||
else
|
||||
@@ -1768,12 +1519,12 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id)
|
||||
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.mValue.mV[VX] = U16_to_F32(x, -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
|
||||
pos_key.mValue.mV[VY] = U16_to_F32(y, -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
|
||||
pos_key.mValue.mV[VZ] = U16_to_F32(z, -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
|
||||
}
|
||||
|
||||
if( !(pos_key.mPosition.isFinite()) )
|
||||
if( !(pos_key.mValue.isFinite()) )
|
||||
{
|
||||
LL_WARNS() << "non-finite position in key"
|
||||
<< " for animation " << asset_id << LL_ENDL;
|
||||
@@ -1787,14 +1538,17 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pCurve->mKeys[pos_key.mTime] = pos_key;
|
||||
pCurve->mKeys.emplace_back(pos_key.mTime, pos_key);
|
||||
|
||||
if (is_pelvis)
|
||||
{
|
||||
mJointMotionList->mPelvisBBox.addPoint(pos_key.mPosition);
|
||||
mJointMotionList->mPelvisBBox.addPoint(pos_key.mValue);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::sort(pCurve->mKeys.begin(), pCurve->mKeys.end(), [](const auto& a, const auto& b) { return a.first < b.first; });
|
||||
|
||||
joint_motion->mUsage = joint_state->getUsage();
|
||||
}
|
||||
|
||||
@@ -2087,7 +1841,7 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const
|
||||
U16 time_short = F32_to_U16(rot_key.mTime, 0.f, mJointMotionList->mDuration);
|
||||
success &= dp.packU16(time_short, "time");
|
||||
|
||||
LLVector3 rot_angles = rot_key.mRotation.packToVector3();
|
||||
LLVector3 rot_angles = rot_key.mValue.packToVector3();
|
||||
|
||||
U16 x, y, z;
|
||||
rot_angles.quantize16(-1.f, 1.f, -1.f, 1.f);
|
||||
@@ -2110,15 +1864,15 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const
|
||||
success &= dp.packU16(time_short, "time");
|
||||
|
||||
U16 x, y, z;
|
||||
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);
|
||||
pos_key.mValue.quantize16(-LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET, -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
|
||||
x = F32_to_U16(pos_key.mValue.mV[VX], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
|
||||
y = F32_to_U16(pos_key.mValue.mV[VY], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
|
||||
z = F32_to_U16(pos_key.mValue.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");
|
||||
|
||||
LL_DEBUGS("BVH") << " pos: t " << pos_key.mTime << " pos " << pos_key.mPosition.mV[VX] <<","<< pos_key.mPosition.mV[VY] <<","<< pos_key.mPosition.mV[VZ] << LL_ENDL;
|
||||
LL_DEBUGS("BVH") << " pos: t " << pos_key.mTime << " pos " << pos_key.mValue.mV[VX] <<","<< pos_key.mValue.mV[VY] <<","<< pos_key.mValue.mV[VZ] << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2296,9 +2050,9 @@ void LLKeyframeMotion::setLoopIn(F32 in_point)
|
||||
rot_curve->mLoopInKey.mTime = mJointMotionList->mLoopInPoint;
|
||||
scale_curve->mLoopInKey.mTime = mJointMotionList->mLoopInPoint;
|
||||
|
||||
pos_curve->mLoopInKey.mPosition = pos_curve->getValue(mJointMotionList->mLoopInPoint, mJointMotionList->mDuration);
|
||||
rot_curve->mLoopInKey.mRotation = rot_curve->getValue(mJointMotionList->mLoopInPoint, mJointMotionList->mDuration);
|
||||
scale_curve->mLoopInKey.mScale = scale_curve->getValue(mJointMotionList->mLoopInPoint, mJointMotionList->mDuration);
|
||||
pos_curve->mLoopInKey.mValue = pos_curve->getValue(mJointMotionList->mLoopInPoint, mJointMotionList->mDuration);
|
||||
rot_curve->mLoopInKey.mValue = rot_curve->getValue(mJointMotionList->mLoopInPoint, mJointMotionList->mDuration);
|
||||
scale_curve->mLoopInKey.mValue = scale_curve->getValue(mJointMotionList->mLoopInPoint, mJointMotionList->mDuration);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2325,9 +2079,9 @@ void LLKeyframeMotion::setLoopOut(F32 out_point)
|
||||
rot_curve->mLoopOutKey.mTime = mJointMotionList->mLoopOutPoint;
|
||||
scale_curve->mLoopOutKey.mTime = mJointMotionList->mLoopOutPoint;
|
||||
|
||||
pos_curve->mLoopOutKey.mPosition = pos_curve->getValue(mJointMotionList->mLoopOutPoint, mJointMotionList->mDuration);
|
||||
rot_curve->mLoopOutKey.mRotation = rot_curve->getValue(mJointMotionList->mLoopOutPoint, mJointMotionList->mDuration);
|
||||
scale_curve->mLoopOutKey.mScale = scale_curve->getValue(mJointMotionList->mLoopOutPoint, mJointMotionList->mDuration);
|
||||
pos_curve->mLoopOutKey.mValue = pos_curve->getValue(mJointMotionList->mLoopOutPoint, mJointMotionList->mDuration);
|
||||
rot_curve->mLoopOutKey.mValue = rot_curve->getValue(mJointMotionList->mLoopOutPoint, mJointMotionList->mDuration);
|
||||
scale_curve->mLoopOutKey.mValue = scale_curve->getValue(mJointMotionList->mLoopOutPoint, mJointMotionList->mDuration);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,6 +171,22 @@ int AICachedPointerPtr<KEY, T>::sCnt;
|
||||
//-----------------------------------------------------------------------------
|
||||
// class LLKeyframeMotion
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace LLKeyframeMotionLerp
|
||||
{
|
||||
template<typename T>
|
||||
inline T lerp(F32 t, const T& before, const T& after)
|
||||
{
|
||||
return ::lerp(before, after, t);
|
||||
}
|
||||
|
||||
template<>
|
||||
inline LLQuaternion lerp(F32 t, const LLQuaternion& before, const LLQuaternion& after)
|
||||
{
|
||||
return nlerp(t, before, after);
|
||||
}
|
||||
}
|
||||
|
||||
class LLKeyframeMotion :
|
||||
public LLMotion
|
||||
{
|
||||
@@ -387,101 +403,84 @@ public:
|
||||
|
||||
enum InterpolationType { IT_STEP, IT_LINEAR, IT_SPLINE };
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// ScaleKey
|
||||
//-------------------------------------------------------------------------
|
||||
class ScaleKey
|
||||
template<typename T>
|
||||
struct Curve
|
||||
{
|
||||
public:
|
||||
ScaleKey() { mTime = 0.0f; }
|
||||
ScaleKey(F32 time, const LLVector3 &scale) { mTime = time; mScale = scale; }
|
||||
struct Key
|
||||
{
|
||||
Key() = default;
|
||||
Key(F32 time, const T& value) { mTime = time; mValue = value; }
|
||||
F32 mTime = 0;
|
||||
T mValue;
|
||||
};
|
||||
|
||||
F32 mTime;
|
||||
LLVector3 mScale;
|
||||
};
|
||||
T interp(F32 u, Key& before, Key& after)
|
||||
{
|
||||
switch (mInterpolationType)
|
||||
{
|
||||
case IT_STEP:
|
||||
return before.mValue;
|
||||
default:
|
||||
case IT_LINEAR:
|
||||
case IT_SPLINE:
|
||||
return LLKeyframeMotionLerp::lerp(u, before.mValue, after.mValue);
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// RotationKey
|
||||
//-------------------------------------------------------------------------
|
||||
class RotationKey
|
||||
{
|
||||
public:
|
||||
RotationKey() { mTime = 0.0f; }
|
||||
RotationKey(F32 time, const LLQuaternion &rotation) { mTime = time; mRotation = rotation; }
|
||||
T getValue(F32 time, F32 duration)
|
||||
{
|
||||
if (mKeys.empty())
|
||||
{
|
||||
return T();
|
||||
}
|
||||
|
||||
F32 mTime;
|
||||
LLQuaternion mRotation;
|
||||
};
|
||||
T value;
|
||||
typename key_map_t::iterator right = std::lower_bound(mKeys.begin(), mKeys.end(), time, [](const auto& a, const auto& b) { return a.first < b; });
|
||||
if (right == mKeys.end())
|
||||
{
|
||||
// Past last key
|
||||
--right;
|
||||
value = right->second.mValue;
|
||||
}
|
||||
else if (right == mKeys.begin() || right->first == time)
|
||||
{
|
||||
// Before first key or exactly on a key
|
||||
value = right->second.mValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Between two keys
|
||||
typename key_map_t::iterator left = right; --left;
|
||||
F32 index_before = left->first;
|
||||
F32 index_after = right->first;
|
||||
Key& pos_before = left->second;
|
||||
Key& pos_after = right->second;
|
||||
if (right == mKeys.end())
|
||||
{
|
||||
pos_after = mLoopInKey;
|
||||
index_after = duration;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// PositionKey
|
||||
//-------------------------------------------------------------------------
|
||||
class PositionKey
|
||||
{
|
||||
public:
|
||||
PositionKey() { mTime = 0.0f; }
|
||||
PositionKey(F32 time, const LLVector3 &position) { mTime = time; mPosition = position; }
|
||||
F32 u = (time - index_before) / (index_after - index_before);
|
||||
value = interp(u, pos_before, pos_after);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
F32 mTime;
|
||||
LLVector3 mPosition;
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// ScaleCurve
|
||||
//-------------------------------------------------------------------------
|
||||
class ScaleCurve
|
||||
{
|
||||
public:
|
||||
ScaleCurve();
|
||||
~ScaleCurve();
|
||||
LLVector3 getValue(F32 time, F32 duration);
|
||||
LLVector3 interp(F32 u, ScaleKey& before, ScaleKey& after);
|
||||
|
||||
InterpolationType mInterpolationType;
|
||||
S32 mNumKeys;
|
||||
typedef std::map<F32, ScaleKey> key_map_t;
|
||||
InterpolationType mInterpolationType = LLKeyframeMotion::IT_LINEAR;
|
||||
S32 mNumKeys = 0;
|
||||
typedef std::vector< std::pair<F32, Key> > key_map_t;
|
||||
key_map_t mKeys;
|
||||
ScaleKey mLoopInKey;
|
||||
ScaleKey mLoopOutKey;
|
||||
Key mLoopInKey;
|
||||
Key mLoopOutKey;
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// RotationCurve
|
||||
//-------------------------------------------------------------------------
|
||||
class RotationCurve
|
||||
{
|
||||
public:
|
||||
RotationCurve();
|
||||
~RotationCurve();
|
||||
LLQuaternion getValue(F32 time, F32 duration);
|
||||
LLQuaternion interp(F32 u, RotationKey& before, RotationKey& after);
|
||||
|
||||
InterpolationType mInterpolationType;
|
||||
S32 mNumKeys;
|
||||
typedef std::map<F32, RotationKey> key_map_t;
|
||||
key_map_t mKeys;
|
||||
RotationKey mLoopInKey;
|
||||
RotationKey mLoopOutKey;
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// PositionCurve
|
||||
//-------------------------------------------------------------------------
|
||||
class PositionCurve
|
||||
{
|
||||
public:
|
||||
PositionCurve();
|
||||
~PositionCurve();
|
||||
LLVector3 getValue(F32 time, F32 duration);
|
||||
LLVector3 interp(F32 u, PositionKey& before, PositionKey& after);
|
||||
|
||||
InterpolationType mInterpolationType;
|
||||
S32 mNumKeys;
|
||||
typedef std::map<F32, PositionKey> key_map_t;
|
||||
key_map_t mKeys;
|
||||
PositionKey mLoopInKey;
|
||||
PositionKey mLoopOutKey;
|
||||
};
|
||||
typedef Curve<LLVector3> ScaleCurve;
|
||||
typedef ScaleCurve::Key ScaleKey;
|
||||
typedef Curve<LLQuaternion> RotationCurve;
|
||||
typedef RotationCurve::Key RotationKey;
|
||||
typedef Curve<LLVector3> PositionCurve;
|
||||
typedef PositionCurve::Key PositionKey;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// JointMotion
|
||||
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
return std::find_if(mVector.begin(), mVector.end(), [&k](const typename vec_type_t::value_type& e) { return e.first == k; });
|
||||
}
|
||||
|
||||
typedef DeletePairedPointer DeletePointer;
|
||||
using DeletePointer = ::DeletePairedPointer;
|
||||
};
|
||||
|
||||
template <typename Type, typename Key, int BlockSize = 32>
|
||||
@@ -189,7 +189,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
typedef ::DeletePointer DeletePointer;
|
||||
using DeletePointer = ::DeletePointer;
|
||||
};
|
||||
|
||||
template <typename Type, typename Key, int BlockSize = 32>
|
||||
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
BOOL setSize(LLCoordScreen size);
|
||||
BOOL setSize(LLCoordWindow size);
|
||||
virtual void setMinSize(U32 min_width, U32 min_height, bool enforce_immediately = true);
|
||||
virtual BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, const LLCoordScreen * const posp = NULL) = 0;
|
||||
virtual BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, std::function<void()> stopFn, std::function<void(bool)> restoreFn, const LLCoordScreen * const posp = NULL) = 0;
|
||||
virtual BOOL setCursorPosition(LLCoordWindow position) = 0;
|
||||
virtual BOOL getCursorPosition(LLCoordWindow *position) = 0;
|
||||
virtual void showCursor() = 0;
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
/*virtual*/ BOOL setPosition(LLCoordScreen position) {return FALSE;};
|
||||
/*virtual*/ BOOL setSizeImpl(LLCoordScreen size) {return FALSE;};
|
||||
/*virtual*/ BOOL setSizeImpl(LLCoordWindow size) {return FALSE;};
|
||||
/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, const LLCoordScreen * const posp = NULL) {return FALSE;};
|
||||
/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, std::function<void()> stopFn, std::function<void(bool)> restoreFn, const LLCoordScreen * const posp = NULL) {return FALSE;};
|
||||
/*virtual*/ BOOL setCursorPosition(LLCoordWindow position) {return FALSE;};
|
||||
/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position) {return FALSE;};
|
||||
/*virtual*/ void showCursor() {};
|
||||
|
||||
@@ -659,7 +659,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits
|
||||
|
||||
// We only support OS X 10.7's fullscreen app mode which is literally a full screen window that fills a virtual desktop.
|
||||
// This makes this method obsolete.
|
||||
BOOL LLWindowMacOSX::switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, const LLCoordScreen * const posp)
|
||||
BOOL LLWindowMacOSX::switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, std::function<void()> stopFn, std::function<void(bool)> restoreFn, const LLCoordScreen * const posp)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
/*virtual*/ BOOL setPosition(LLCoordScreen position);
|
||||
/*virtual*/ BOOL setSizeImpl(LLCoordScreen size);
|
||||
/*virtual*/ BOOL setSizeImpl(LLCoordWindow size);
|
||||
/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, const LLCoordScreen * const posp = nullptr);
|
||||
/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, std::function<void()> stopFn, std::function<void(bool)> restoreFn, const LLCoordScreen * const posp = nullptr);
|
||||
/*virtual*/ BOOL setCursorPosition(LLCoordWindow position);
|
||||
/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position);
|
||||
/*virtual*/ void showCursor();
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
/*virtual*/ BOOL setPosition(LLCoordScreen position) {return FALSE;};
|
||||
/*virtual*/ BOOL setSizeImpl(LLCoordScreen size) {return FALSE;};
|
||||
/*virtual*/ BOOL setSizeImpl(LLCoordWindow size) {return FALSE;};
|
||||
/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, const LLCoordScreen * const posp = NULL) {return FALSE;};
|
||||
/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, std::function<void()> stopFn, std::function<void(bool)> restoreFn, const LLCoordScreen * const posp = NULL) {return FALSE;};
|
||||
/*virtual*/ BOOL setCursorPosition(LLCoordWindow position) {return FALSE;};
|
||||
/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position) {return FALSE;};
|
||||
/*virtual*/ void showCursor() {};
|
||||
|
||||
@@ -734,7 +734,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
|
||||
|
||||
|
||||
// changing fullscreen resolution, or switching between windowed and fullscreen mode.
|
||||
BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, const LLCoordScreen * const posp)
|
||||
BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, std::function<void()> stopFn, std::function<void(bool)> restoreFn, const LLCoordScreen * const posp)
|
||||
{
|
||||
const BOOL needsRebuild = TRUE; // Just nuke the context and start over.
|
||||
BOOL result = true;
|
||||
@@ -743,6 +743,7 @@ BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, cons
|
||||
stop_glerror();
|
||||
if(needsRebuild)
|
||||
{
|
||||
if (stopFn) stopFn();
|
||||
destroyContext();
|
||||
result = createContext(0, 0, size.mX, size.mY, 0, fullscreen, vsync_mode);
|
||||
if (result)
|
||||
@@ -751,6 +752,7 @@ BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, cons
|
||||
initCursors();
|
||||
setCursor( UI_CURSOR_ARROW );
|
||||
}
|
||||
if (restoreFn) restoreFn(true);
|
||||
}
|
||||
|
||||
stop_glerror();
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
/*virtual*/ BOOL setPosition(LLCoordScreen position);
|
||||
/*virtual*/ BOOL setSizeImpl(LLCoordScreen size);
|
||||
/*virtual*/ BOOL setSizeImpl(LLCoordWindow size);
|
||||
/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, const LLCoordScreen * const posp = NULL);
|
||||
/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, std::function<void()> stopFn, std::function<void(bool)> restoreFn, const LLCoordScreen * const posp = NULL);
|
||||
/*virtual*/ BOOL setCursorPosition(LLCoordWindow position);
|
||||
/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position);
|
||||
/*virtual*/ void showCursor();
|
||||
|
||||
@@ -677,7 +677,8 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
|
||||
|
||||
initDPIAwareness();
|
||||
|
||||
if (!switchContext(mFullscreen, windowSize, vsync_mode, &windowPos))
|
||||
|
||||
if (!switchContext(mFullscreen, windowSize, vsync_mode, nullptr, nullptr, &windowPos))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -956,7 +957,7 @@ BOOL LLWindowWin32::setSizeImpl(const LLCoordWindow size)
|
||||
}
|
||||
|
||||
// changing fullscreen resolution
|
||||
BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, const LLCoordScreen * const posp)
|
||||
BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, std::function<void()> stopFn, std::function<void(bool)> restoreFn, const LLCoordScreen * const posp)
|
||||
{
|
||||
GLuint pixel_format;
|
||||
DEVMODE dev_mode;
|
||||
@@ -986,20 +987,25 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co
|
||||
}
|
||||
|
||||
gGLManager.shutdownGL();
|
||||
//destroy gl context
|
||||
class ContextHandle
|
||||
{
|
||||
public:
|
||||
ContextHandle(HGLRC context) : mOldContext(context)
|
||||
{}
|
||||
~ContextHandle()
|
||||
{
|
||||
wglDeleteContext(mOldContext);
|
||||
}
|
||||
operator HGLRC() const { return mOldContext; }
|
||||
private:
|
||||
HGLRC mOldContext;
|
||||
} oldContext = mhRC;
|
||||
if (mhRC)
|
||||
{
|
||||
if (!wglMakeCurrent(NULL, NULL))
|
||||
{
|
||||
LL_WARNS("Window") << "Release of DC and RC failed" << LL_ENDL;
|
||||
}
|
||||
|
||||
if (!wglDeleteContext(mhRC))
|
||||
{
|
||||
LL_WARNS("Window") << "Release of rendering context failed" << LL_ENDL;
|
||||
}
|
||||
|
||||
mhRC = NULL;
|
||||
}
|
||||
|
||||
if (fullscreen)
|
||||
@@ -1509,6 +1515,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co
|
||||
}
|
||||
|
||||
mhRC = 0;
|
||||
bool sharedContext = false;
|
||||
if (wglCreateContextAttribsARB)
|
||||
{ //attempt to create a specific versioned context
|
||||
S32 attribs[] =
|
||||
@@ -1523,8 +1530,11 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co
|
||||
bool done = false;
|
||||
while (!done)
|
||||
{
|
||||
mhRC = wglCreateContextAttribsARB(mhDC, mhRC, attribs);
|
||||
|
||||
sharedContext = oldContext && (mhRC = wglCreateContextAttribsARB(mhDC, oldContext, attribs)) != nullptr;
|
||||
if (!sharedContext)
|
||||
{
|
||||
mhRC = wglCreateContextAttribsARB(mhDC, nullptr, attribs);
|
||||
}
|
||||
if (!mhRC)
|
||||
{
|
||||
if (attribs[3] > 0)
|
||||
@@ -1555,7 +1565,11 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co
|
||||
}
|
||||
}
|
||||
|
||||
if (!mhRC && !(mhRC = wglCreateContext(mhDC)))
|
||||
bool abort = !mhRC && !(mhRC = wglCreateContext(mhDC));
|
||||
|
||||
if (!sharedContext && stopFn) stopFn();
|
||||
|
||||
if (abort)
|
||||
{
|
||||
close();
|
||||
OSMessageBox(mCallbacks->translateString("MBGLContextErr"), mCallbacks->translateString("MBError"), OSMB_OK);
|
||||
@@ -1626,6 +1640,8 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co
|
||||
glGetIntegerv(GL_SAMPLES, &buf);
|
||||
LL_INFOS() << "Acquired FSAA Samples = " << buf << LL_ENDL;
|
||||
|
||||
if(restoreFn) restoreFn(!sharedContext);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
/*virtual*/ BOOL setPosition(LLCoordScreen position);
|
||||
/*virtual*/ BOOL setSizeImpl(LLCoordScreen size);
|
||||
/*virtual*/ BOOL setSizeImpl(LLCoordWindow size);
|
||||
/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, const LLCoordScreen * const posp = NULL);
|
||||
/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, const S32 vsync_mode, std::function<void()> stopFn, std::function<void(bool)> restoreFn, const LLCoordScreen * const posp = NULL);
|
||||
/*virtual*/ BOOL setCursorPosition(LLCoordWindow position);
|
||||
/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position);
|
||||
/*virtual*/ void showCursor();
|
||||
|
||||
@@ -199,6 +199,8 @@ void LLScriptLibrary::init()
|
||||
addFunction(10.f, 0.f, dummy_func, "llStringLength", "i", "s");
|
||||
addFunction(10.f, 0.f, dummy_func, "llStartAnimation", NULL, "s");
|
||||
addFunction(10.f, 0.f, dummy_func, "llStopAnimation", NULL, "s");
|
||||
addFunction(10.f, 0.f, dummy_func, "llStartObjectAnimation", NULL, "s");
|
||||
addFunction(10.f, 0.f, dummy_func, "llStopObjectAnimation", NULL, "s");
|
||||
addFunction(10.f, 0.f, dummy_func, "llPointAt", NULL, "v");
|
||||
addFunction(10.f, 0.f, dummy_func, "llStopPointAt", NULL, NULL);
|
||||
addFunction(10.f, 0.f, dummy_func, "llTargetOmega", NULL, "vff");
|
||||
|
||||
@@ -730,6 +730,8 @@ llRotLookAt
|
||||
llStringLength
|
||||
llStartAnimation
|
||||
llStopAnimation
|
||||
llStartObjectAnimation
|
||||
llStopObjectAnimation
|
||||
llPointAt
|
||||
llStopPointAt
|
||||
llTargetOmega
|
||||
|
||||
@@ -305,6 +305,10 @@
|
||||
<map/>
|
||||
<key>llStopAnimation</key>
|
||||
<map/>
|
||||
<key>llStartObjectAnimation</key>
|
||||
<map/>
|
||||
<key>llStopObjectAnimation</key>
|
||||
<map/>
|
||||
<key>llPointAt</key>
|
||||
<map/>
|
||||
<key>llStopPointAt</key>
|
||||
|
||||
@@ -238,7 +238,7 @@ namespace
|
||||
LLViewerObject* obj = node->getObject();
|
||||
if (obj->isSculpted() && !obj->isMesh())
|
||||
{
|
||||
LLSculptParams *sculpt_params = (LLSculptParams *)obj->getParameterEntry(LLNetworkData::PARAMS_SCULPT);
|
||||
const LLSculptParams *sculpt_params = obj->getSculptParams();
|
||||
LLUUID sculpt_id = sculpt_params->getSculptTexture();
|
||||
|
||||
// Find inventory items with asset id of the sculpt map
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace DAEExportUtil
|
||||
LLViewerObject* obj = node->getObject();
|
||||
if (obj->isSculpted() && !obj->isMesh())
|
||||
{
|
||||
LLSculptParams *sculpt_params = (LLSculptParams *)obj->getParameterEntry(LLNetworkData::PARAMS_SCULPT);
|
||||
const LLSculptParams *sculpt_params = obj->getSculptParams();
|
||||
LLUUID sculpt_id = sculpt_params->getSculptTexture();
|
||||
return canExportTexture(sculpt_id);
|
||||
}
|
||||
|
||||
@@ -1056,15 +1056,16 @@ void LLHUDNameTag::reshape()
|
||||
|
||||
F32 LLHUDNameTag::LLHUDTextSegment::getWidth(const LLFontGL* font)
|
||||
{
|
||||
std::map<const LLFontGL*, F32>::iterator iter = mFontWidthMap.find(font);
|
||||
if (iter != mFontWidthMap.end())
|
||||
// Singu note: Reworked hotspot. Less indirection
|
||||
if (mFontWidthMap[0].first == font)
|
||||
{
|
||||
return iter->second;
|
||||
return mFontWidthMap[0].second;
|
||||
}
|
||||
else
|
||||
else if (mFontWidthMap[1].first == font)
|
||||
{
|
||||
F32 width = font->getWidthF32(mText.c_str());
|
||||
mFontWidthMap[font] = width;
|
||||
return width;
|
||||
return mFontWidthMap[1].second;
|
||||
}
|
||||
F32 width = font->getWidthF32(mText.c_str());
|
||||
mFontWidthMap[mFontWidthMap[0].first != nullptr] = std::make_pair(font, width);
|
||||
return width;
|
||||
}
|
||||
|
||||
@@ -63,14 +63,14 @@ protected:
|
||||
{}
|
||||
F32 getWidth(const LLFontGL* font);
|
||||
const LLWString& getText() const { return mText; }
|
||||
void clearFontWidthMap() { mFontWidthMap.clear(); }
|
||||
void clearFontWidthMap() { mFontWidthMap[0].first = nullptr; mFontWidthMap[1].first = nullptr; }
|
||||
|
||||
LLColor4 mColor;
|
||||
LLFontGL::StyleFlags mStyle;
|
||||
const LLFontGL* mFont;
|
||||
private:
|
||||
LLWString mText;
|
||||
std::map<const LLFontGL*, F32> mFontWidthMap;
|
||||
std::pair<const LLFontGL*, F32> mFontWidthMap[2];
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
@@ -674,17 +674,18 @@ void LLHUDText::reshape()
|
||||
|
||||
F32 LLHUDText::LLHUDTextSegment::getWidth(const LLFontGL* font)
|
||||
{
|
||||
std::map<const LLFontGL*, F32>::iterator iter = mFontWidthMap.find(font);
|
||||
if (iter != mFontWidthMap.end())
|
||||
// Singu note: Reworked hotspot. Less indirection
|
||||
if (mFontWidthMap[0].first == font)
|
||||
{
|
||||
return iter->second;
|
||||
return mFontWidthMap[0].second;
|
||||
}
|
||||
else
|
||||
else if (mFontWidthMap[1].first == font)
|
||||
{
|
||||
F32 width = font->getWidthF32(mText.c_str());
|
||||
mFontWidthMap[font] = width;
|
||||
return width;
|
||||
return mFontWidthMap[1].second;
|
||||
}
|
||||
F32 width = font->getWidthF32(mText.c_str());
|
||||
mFontWidthMap[mFontWidthMap[0].first != nullptr] = std::make_pair(font, width);
|
||||
return width;
|
||||
}
|
||||
|
||||
// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.4.0a) | Added: RLVa-1.0.0f
|
||||
|
||||
@@ -61,14 +61,14 @@ protected:
|
||||
{}
|
||||
F32 getWidth(const LLFontGL* font);
|
||||
const LLWString& getText() const { return mText; }
|
||||
void clearFontWidthMap() { mFontWidthMap.clear(); }
|
||||
void clearFontWidthMap() { mFontWidthMap[0].first = nullptr; mFontWidthMap[1].first = nullptr; }
|
||||
|
||||
LLColor4 mColor;
|
||||
LLFontGL::StyleFlags mStyle;
|
||||
const LLFontGL* mFont;
|
||||
private:
|
||||
LLWString mText;
|
||||
std::map<const LLFontGL*, F32> mFontWidthMap;
|
||||
std::pair<const LLFontGL*, F32> mFontWidthMap[2];
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
@@ -130,10 +130,10 @@ LLVector3 LLPanelObject::mClipboardPos;
|
||||
LLVector3 LLPanelObject::mClipboardSize;
|
||||
LLVector3 LLPanelObject::mClipboardRot;
|
||||
LLVolumeParams LLPanelObject::mClipboardVolumeParams;
|
||||
LLFlexibleObjectData* LLPanelObject::mClipboardFlexiParams = NULL;
|
||||
LLLightParams* LLPanelObject::mClipboardLightParams = NULL;
|
||||
LLSculptParams* LLPanelObject::mClipboardSculptParams = NULL;
|
||||
LLLightImageParams* LLPanelObject::mClipboardLightImageParams = NULL;
|
||||
const LLFlexibleObjectData* LLPanelObject::mClipboardFlexiParams = NULL;
|
||||
const LLLightParams* LLPanelObject::mClipboardLightParams = NULL;
|
||||
const LLSculptParams* LLPanelObject::mClipboardSculptParams = NULL;
|
||||
const LLLightImageParams* LLPanelObject::mClipboardLightImageParams = NULL;
|
||||
BOOL LLPanelObject::hasParamClipboard = FALSE;
|
||||
|
||||
BOOL LLPanelObject::postBuild()
|
||||
@@ -895,7 +895,7 @@ void LLPanelObject::getState( )
|
||||
}
|
||||
|
||||
|
||||
if (objectp->getParameterEntryInUse(LLNetworkData::PARAMS_SCULPT))
|
||||
if (objectp->getSculptParams())
|
||||
{
|
||||
selected_item = MI_SCULPT;
|
||||
LLFirstUse::useSculptedPrim();
|
||||
@@ -1398,7 +1398,7 @@ void LLPanelObject::getState( )
|
||||
|
||||
|
||||
LLUUID id;
|
||||
LLSculptParams *sculpt_params = (LLSculptParams *)objectp->getParameterEntry(LLNetworkData::PARAMS_SCULPT);
|
||||
const LLSculptParams *sculpt_params = objectp->getSculptParams();
|
||||
|
||||
|
||||
if (sculpt_params) // if we have a legal sculpt param block for this object:
|
||||
@@ -1574,13 +1574,13 @@ void LLPanelObject::onCommitParametric( LLUICtrl* ctrl, void* userdata )
|
||||
if (selected_type == MI_SCULPT)
|
||||
{
|
||||
self->mObject->setParameterEntryInUse(LLNetworkData::PARAMS_SCULPT, TRUE, TRUE);
|
||||
LLSculptParams *sculpt_params = (LLSculptParams *)self->mObject->getParameterEntry(LLNetworkData::PARAMS_SCULPT);
|
||||
const LLSculptParams *sculpt_params = self->mObject->getSculptParams();
|
||||
if (sculpt_params)
|
||||
volume_params.setSculptID(sculpt_params->getSculptTexture(), sculpt_params->getSculptType());
|
||||
}
|
||||
else
|
||||
{
|
||||
LLSculptParams *sculpt_params = (LLSculptParams *)self->mObject->getParameterEntry(LLNetworkData::PARAMS_SCULPT);
|
||||
const LLSculptParams *sculpt_params = self->mObject->getSculptParams();
|
||||
if (sculpt_params)
|
||||
self->mObject->setParameterEntryInUse(LLNetworkData::PARAMS_SCULPT, FALSE, TRUE);
|
||||
}
|
||||
@@ -2463,16 +2463,16 @@ void LLPanelObject::onCopyParams(void* user_data)
|
||||
|
||||
LLViewerObject* objp = self->mObject;
|
||||
|
||||
mClipboardFlexiParams = objp->getParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE) ? static_cast<LLFlexibleObjectData*>(objp->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE)) : NULL;
|
||||
mClipboardLightParams = objp->getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT) ? static_cast<LLLightParams*>(objp->getParameterEntry(LLNetworkData::PARAMS_LIGHT)) : NULL;
|
||||
mClipboardSculptParams = objp->getParameterEntryInUse(LLNetworkData::PARAMS_SCULPT) ? static_cast<LLSculptParams*>(objp->getParameterEntry(LLNetworkData::PARAMS_SCULPT)) : NULL;
|
||||
mClipboardFlexiParams = objp->getFlexibleObjectData();
|
||||
mClipboardLightParams = objp->getLightParams();
|
||||
mClipboardSculptParams = objp->getSculptParams();
|
||||
if (mClipboardSculptParams)
|
||||
{
|
||||
const LLUUID id = mClipboardSculptParams->getSculptTexture();
|
||||
if (id != LLUUID(SCULPT_DEFAULT_TEXTURE) && !texturePermsCheck(id))
|
||||
mClipboardSculptParams = NULL;
|
||||
}
|
||||
mClipboardLightImageParams = objp->getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE) ? static_cast<LLLightImageParams*>(objp->getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE)) : NULL;
|
||||
mClipboardLightImageParams = objp->getLightImageParams();
|
||||
if (mClipboardLightImageParams && texturePermsCheck(mClipboardLightImageParams->getLightTexture()))
|
||||
{
|
||||
mClipboardLightImageParams = NULL;
|
||||
|
||||
@@ -122,10 +122,10 @@ protected:
|
||||
static LLVector3 mClipboardSize;
|
||||
static LLVector3 mClipboardRot;
|
||||
static LLVolumeParams mClipboardVolumeParams;
|
||||
static LLFlexibleObjectData* mClipboardFlexiParams;
|
||||
static LLLightParams* mClipboardLightParams;
|
||||
static LLSculptParams* mClipboardSculptParams;
|
||||
static LLLightImageParams* mClipboardLightImageParams;
|
||||
static const LLFlexibleObjectData* mClipboardFlexiParams;
|
||||
static const LLLightParams* mClipboardLightParams;
|
||||
static const LLSculptParams* mClipboardSculptParams;
|
||||
static const LLLightImageParams* mClipboardLightImageParams;
|
||||
static BOOL hasParamClipboard;
|
||||
|
||||
S32 mComboMaterialItemCount;
|
||||
|
||||
@@ -410,7 +410,7 @@ void LLPanelVolume::getState( )
|
||||
getChildView("FlexForceY")->setEnabled(true);
|
||||
getChildView("FlexForceZ")->setEnabled(true);
|
||||
|
||||
LLFlexibleObjectData *attributes = (LLFlexibleObjectData *)objectp->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE);
|
||||
const LLFlexibleObjectData *attributes = objectp->getFlexibleObjectData();
|
||||
|
||||
getChild<LLUICtrl>("FlexNumSections")->setValue((F32)attributes->getSimulateLOD());
|
||||
getChild<LLUICtrl>("FlexGravity")->setValue(attributes->getGravity());
|
||||
@@ -462,7 +462,7 @@ void LLPanelVolume::getState( )
|
||||
mComboPhysicsShapeType->add(getString("None"), LLSD(1));
|
||||
|
||||
BOOL isMesh = FALSE;
|
||||
LLSculptParams *sculpt_params = (LLSculptParams *)objectp->getParameterEntry(LLNetworkData::PARAMS_SCULPT);
|
||||
const LLSculptParams *sculpt_params = objectp->getSculptParams();
|
||||
if (sculpt_params)
|
||||
{
|
||||
U8 sculpt_type = sculpt_params->getSculptType();
|
||||
@@ -777,7 +777,7 @@ void LLPanelVolume::onCommitFlexible( LLUICtrl* ctrl, void* userdata )
|
||||
return;
|
||||
}
|
||||
|
||||
LLFlexibleObjectData *attributes = (LLFlexibleObjectData *)objectp->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE);
|
||||
const LLFlexibleObjectData *attributes = objectp->getFlexibleObjectData();
|
||||
if (attributes)
|
||||
{
|
||||
LLFlexibleObjectData new_attributes;
|
||||
|
||||
@@ -1269,6 +1269,7 @@ public:
|
||||
group->destroyGL();
|
||||
|
||||
{OctreeGuard guard(group->getOctreeNode());
|
||||
if (!mNoRebuild) // Singu note: No need to iterate if not rebuilding...
|
||||
for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
|
||||
{
|
||||
LLDrawable* drawable = (LLDrawable*)(*i)->getDrawable();
|
||||
|
||||
@@ -2189,7 +2189,7 @@ public:
|
||||
LLVOVolume* volume = (*(img->getVolumeList()))[i];
|
||||
if (volume && volume->isSculpted())
|
||||
{
|
||||
LLSculptParams *sculpt_params = (LLSculptParams *)volume->getParameterEntry(LLNetworkData::PARAMS_SCULPT);
|
||||
const LLSculptParams *sculpt_params = volume->getSculptParams();
|
||||
if(sculpt_params->getSculptTexture() == id)
|
||||
volume->notifyMeshLoaded();
|
||||
}
|
||||
@@ -2226,7 +2226,7 @@ void reload_objects(LLTextureReloader& texture_list, LLViewerObject::const_child
|
||||
|
||||
if(object->isSculpted() && !object->isMesh())
|
||||
{
|
||||
LLSculptParams *sculpt_params = (LLSculptParams *)object->getParameterEntry(LLNetworkData::PARAMS_SCULPT);
|
||||
const LLSculptParams *sculpt_params = object->getSculptParams();
|
||||
if(sculpt_params)
|
||||
{
|
||||
texture_list.addTexture(LLViewerTextureManager::getFetchedTexture(sculpt_params->getSculptTexture()));
|
||||
|
||||
@@ -1377,11 +1377,9 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
|
||||
unpackParticleSource(block_num, owner_id);
|
||||
|
||||
// Mark all extra parameters not used
|
||||
std::vector<std::unique_ptr<ExtraParameter> >::iterator iter;
|
||||
for (iter = mExtraParameterList.begin(); iter != mExtraParameterList.end(); ++iter)
|
||||
for (auto& entry : mExtraParameterList)
|
||||
{
|
||||
if(*iter)
|
||||
(*iter)->in_use = FALSE;
|
||||
if (entry.in_use) *entry.in_use = false;
|
||||
}
|
||||
|
||||
// Unpack extra parameters
|
||||
@@ -1410,10 +1408,11 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
|
||||
|
||||
for (size_t i = 0; i < mExtraParameterList.size(); ++i)
|
||||
{
|
||||
if (mExtraParameterList[i] && !mExtraParameterList[i]->in_use)
|
||||
auto& entry = mExtraParameterList[i];
|
||||
if (entry.in_use && !*entry.in_use)
|
||||
{
|
||||
// Send an update message in case it was formerly in use
|
||||
parameterChanged((i + 1) << 4, mExtraParameterList[i]->data.get(), FALSE, false);
|
||||
parameterChanged((i + 1) << 4, entry.data, FALSE, false);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1633,11 +1632,9 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
|
||||
}
|
||||
|
||||
// Mark all extra parameters not used
|
||||
std::vector<std::unique_ptr<ExtraParameter> >::iterator iter;
|
||||
for (iter = mExtraParameterList.begin(); iter != mExtraParameterList.end(); ++iter)
|
||||
for (auto& entry : mExtraParameterList)
|
||||
{
|
||||
if(*iter)
|
||||
(*iter)->in_use = FALSE;
|
||||
if (entry.in_use) *entry.in_use = false;
|
||||
}
|
||||
|
||||
// Unpack extra params
|
||||
@@ -1657,10 +1654,11 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
|
||||
|
||||
for (size_t i = 0; i < mExtraParameterList.size(); ++i)
|
||||
{
|
||||
if (mExtraParameterList[i] && !mExtraParameterList[i]->in_use)
|
||||
auto& entry = mExtraParameterList[i];
|
||||
if (entry.in_use && !*entry.in_use)
|
||||
{
|
||||
// Send an update message in case it was formerly in use
|
||||
parameterChanged((i + 1) << 4, mExtraParameterList[i]->data.get(), FALSE, false);
|
||||
parameterChanged((i + 1) << 4, entry.data, FALSE, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3990,7 +3988,7 @@ void LLViewerObject::boostTexturePriority(BOOL boost_children /* = TRUE */)
|
||||
|
||||
if (isSculpted() && !isMesh())
|
||||
{
|
||||
LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT);
|
||||
const LLSculptParams *sculpt_params = getSculptParams();
|
||||
LLUUID sculpt_id = sculpt_params->getSculptTexture();
|
||||
LLViewerTextureManager::getFetchedTexture(sculpt_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)->setBoostLevel(LLGLTexture::BOOST_SELECTED);
|
||||
}
|
||||
@@ -5814,8 +5812,8 @@ bool LLViewerObject::unpackParameterEntry(U16 param_type, LLDataPacker *dp)
|
||||
if (param)
|
||||
{
|
||||
param->data->unpack(*dp);
|
||||
param->in_use = TRUE;
|
||||
parameterChanged(param_type, param->data.get(), TRUE, false);
|
||||
*param->in_use = TRUE;
|
||||
parameterChanged(param_type, param->data, TRUE, false);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -5827,31 +5825,37 @@ bool LLViewerObject::unpackParameterEntry(U16 param_type, LLDataPacker *dp)
|
||||
LLViewerObject::ExtraParameter* LLViewerObject::createNewParameterEntry(U16 param_type)
|
||||
{
|
||||
LLNetworkData* new_block = NULL;
|
||||
bool* in_use = NULL;
|
||||
switch (param_type)
|
||||
{
|
||||
case LLNetworkData::PARAMS_FLEXIBLE:
|
||||
{
|
||||
new_block = new LLFlexibleObjectData();
|
||||
new_block = &mFlexibleObjectData;
|
||||
in_use = &mFlexibleObjectDataInUse;
|
||||
break;
|
||||
}
|
||||
case LLNetworkData::PARAMS_LIGHT:
|
||||
{
|
||||
new_block = new LLLightParams();
|
||||
new_block = &mLightParams;
|
||||
in_use = &mLightParamsInUse;
|
||||
break;
|
||||
}
|
||||
case LLNetworkData::PARAMS_SCULPT:
|
||||
{
|
||||
new_block = new LLSculptParams();
|
||||
new_block = &mSculptParams;
|
||||
in_use = &mSculptParamsInUse;
|
||||
break;
|
||||
}
|
||||
case LLNetworkData::PARAMS_LIGHT_IMAGE:
|
||||
{
|
||||
new_block = new LLLightImageParams();
|
||||
new_block = &mLightImageParams;
|
||||
in_use = &mLightImageParamsInUse;
|
||||
break;
|
||||
}
|
||||
case LLNetworkData::PARAMS_EXTENDED_MESH:
|
||||
{
|
||||
new_block = new LLExtendedMeshParams();
|
||||
new_block = &mExtendedMeshParams;
|
||||
in_use = &mExtendedMeshParamsInUse;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -5861,70 +5865,33 @@ LLViewerObject::ExtraParameter* LLViewerObject::createNewParameterEntry(U16 para
|
||||
}
|
||||
};
|
||||
|
||||
ExtraParameter& entry = mExtraParameterList[U32(param_type >> 4) - 1];
|
||||
if (new_block)
|
||||
{
|
||||
ExtraParameter* new_entry = new ExtraParameter;
|
||||
new_entry->data = decltype(new_entry->data)(new_block);
|
||||
new_entry->in_use = false; // not in use yet
|
||||
mExtraParameterList[(param_type >> 4) - 1].reset(new_entry);
|
||||
return new_entry;
|
||||
entry.in_use = in_use;
|
||||
*entry.in_use = false; // not in use yet
|
||||
entry.data = new_block;
|
||||
return &entry;
|
||||
}
|
||||
else
|
||||
{
|
||||
entry.is_invalid = true;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LLViewerObject::ExtraParameter* LLViewerObject::getExtraParameterEntry(U16 param_type) const
|
||||
{
|
||||
return param_type <= LLNetworkData::PARAMS_MAX ? mExtraParameterList[(param_type >> 4) - 1].get() : nullptr;
|
||||
}
|
||||
|
||||
LLViewerObject::ExtraParameter* LLViewerObject::getExtraParameterEntryCreate(U16 param_type)
|
||||
{
|
||||
ExtraParameter* param = getExtraParameterEntry(param_type);
|
||||
if (!param)
|
||||
{
|
||||
param = createNewParameterEntry(param_type);
|
||||
}
|
||||
return param;
|
||||
}
|
||||
|
||||
LLNetworkData* LLViewerObject::getParameterEntry(U16 param_type) const
|
||||
{
|
||||
ExtraParameter* param = getExtraParameterEntry(param_type);
|
||||
if (param)
|
||||
{
|
||||
return param->data.get();
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL LLViewerObject::getParameterEntryInUse(U16 param_type) const
|
||||
{
|
||||
ExtraParameter* param = getExtraParameterEntry(param_type);
|
||||
if (param)
|
||||
{
|
||||
return param->in_use;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
bool LLViewerObject::setParameterEntry(U16 param_type, const LLNetworkData& new_value, bool local_origin)
|
||||
{
|
||||
ExtraParameter* param = getExtraParameterEntryCreate(param_type);
|
||||
if (param)
|
||||
{
|
||||
if (param->in_use && new_value == *(param->data))
|
||||
if (*(param->in_use) && new_value == *(param->data))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
param->in_use = true;
|
||||
*param->in_use = true;
|
||||
param->data->copy(new_value);
|
||||
parameterChanged(param_type, param->data.get(), TRUE, local_origin);
|
||||
parameterChanged(param_type, param->data, TRUE, local_origin);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -5938,22 +5905,28 @@ bool LLViewerObject::setParameterEntry(U16 param_type, const LLNetworkData& new_
|
||||
// Should always return true.
|
||||
bool LLViewerObject::setParameterEntryInUse(U16 param_type, BOOL in_use, bool local_origin)
|
||||
{
|
||||
ExtraParameter* param = getExtraParameterEntryCreate(param_type);
|
||||
if (param && param->in_use != in_use)
|
||||
if (param_type <= LLNetworkData::PARAMS_MAX)
|
||||
{
|
||||
param->in_use = in_use;
|
||||
parameterChanged(param_type, param->data.get(), in_use, local_origin);
|
||||
return true;
|
||||
ExtraParameter* param = (in_use ? getExtraParameterEntryCreate(param_type) : &getExtraParameterEntry(param_type));
|
||||
if (param && param->data && *param->in_use != (bool)in_use)
|
||||
{
|
||||
*param->in_use = in_use;
|
||||
parameterChanged(param_type, param->data, in_use, local_origin);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void LLViewerObject::parameterChanged(U16 param_type, bool local_origin)
|
||||
{
|
||||
ExtraParameter* param = getExtraParameterEntry(param_type);
|
||||
if (param)
|
||||
if (param_type <= LLNetworkData::PARAMS_MAX)
|
||||
{
|
||||
parameterChanged(param_type, param->data.get(), param->in_use, local_origin);
|
||||
const ExtraParameter& param = getExtraParameterEntry(param_type);
|
||||
if (param.data)
|
||||
{
|
||||
parameterChanged(param_type, param.data, *param.in_use, local_origin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -123,13 +123,24 @@ class LLViewerObject
|
||||
protected:
|
||||
~LLViewerObject(); // use unref()
|
||||
|
||||
// TomY: Provide for a list of extra parameter structures, mapped by structure name
|
||||
private:
|
||||
struct ExtraParameter
|
||||
{
|
||||
BOOL in_use;
|
||||
std::unique_ptr<LLNetworkData> data;
|
||||
bool is_invalid = false;
|
||||
bool* in_use = nullptr;
|
||||
LLNetworkData* data = nullptr;
|
||||
};
|
||||
std::vector<std::unique_ptr<ExtraParameter> > mExtraParameterList;
|
||||
std::vector<ExtraParameter> mExtraParameterList;
|
||||
bool mFlexibleObjectDataInUse = false;
|
||||
bool mLightParamsInUse = false;
|
||||
bool mSculptParamsInUse = false;
|
||||
bool mLightImageParamsInUse = false;
|
||||
bool mExtendedMeshParamsInUse = false;
|
||||
LLFlexibleObjectData mFlexibleObjectData;
|
||||
LLLightParams mLightParams;
|
||||
LLSculptParams mSculptParams;
|
||||
LLLightImageParams mLightImageParams;
|
||||
LLExtendedMeshParams mExtendedMeshParams;
|
||||
|
||||
public:
|
||||
typedef std::list<LLPointer<LLViewerObject> > child_list_t;
|
||||
@@ -587,10 +598,15 @@ public:
|
||||
virtual void dirtySpatialGroup(BOOL priority = FALSE) const;
|
||||
virtual void dirtyMesh();
|
||||
|
||||
virtual LLNetworkData* getParameterEntry(U16 param_type) const;
|
||||
virtual bool setParameterEntry(U16 param_type, const LLNetworkData& new_value, bool local_origin);
|
||||
virtual BOOL getParameterEntryInUse(U16 param_type) const;
|
||||
virtual bool setParameterEntryInUse(U16 param_type, BOOL in_use, bool local_origin);
|
||||
const LLFlexibleObjectData* getFlexibleObjectData() const { return mFlexibleObjectDataInUse ? &mFlexibleObjectData : nullptr; }
|
||||
const LLLightParams* getLightParams() const { return mLightParamsInUse ? &mLightParams : nullptr; }
|
||||
const LLSculptParams* getSculptParams() const { return mSculptParamsInUse ? &mSculptParams : nullptr; }
|
||||
const LLLightImageParams* getLightImageParams() const { return mLightImageParamsInUse ? &mLightImageParams : nullptr; }
|
||||
const LLExtendedMeshParams* getExtendedMeshParams() const { return mExtendedMeshParamsInUse ? &mExtendedMeshParams : nullptr; }
|
||||
|
||||
bool setParameterEntry(U16 param_type, const LLNetworkData& new_value, bool local_origin);
|
||||
bool setParameterEntryInUse(U16 param_type, BOOL in_use, bool local_origin);
|
||||
|
||||
// Called when a parameter is changed
|
||||
virtual void parameterChanged(U16 param_type, bool local_origin);
|
||||
virtual void parameterChanged(U16 param_type, LLNetworkData* data, BOOL in_use, bool local_origin);
|
||||
@@ -617,9 +633,32 @@ public:
|
||||
|
||||
private:
|
||||
ExtraParameter* createNewParameterEntry(U16 param_type);
|
||||
ExtraParameter* getExtraParameterEntry(U16 param_type) const;
|
||||
ExtraParameter* getExtraParameterEntryCreate(U16 param_type);
|
||||
bool unpackParameterEntry(U16 param_type, LLDataPacker *dp);
|
||||
const ExtraParameter& getExtraParameterEntry(U16 param_type) const
|
||||
{
|
||||
return mExtraParameterList[U32(param_type >> 4) - 1];
|
||||
}
|
||||
ExtraParameter& getExtraParameterEntry(U16 param_type)
|
||||
{
|
||||
return mExtraParameterList[U32(param_type >> 4) - 1];
|
||||
}
|
||||
ExtraParameter* getExtraParameterEntryCreate(U16 param_type)
|
||||
{
|
||||
if (param_type <= LLNetworkData::PARAMS_MAX)
|
||||
{
|
||||
ExtraParameter& param = getExtraParameterEntry(param_type);
|
||||
if (!param.is_invalid)
|
||||
{
|
||||
if (!param.data)
|
||||
{
|
||||
ExtraParameter* new_entry = createNewParameterEntry(param_type);
|
||||
return new_entry;
|
||||
}
|
||||
return ¶m;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
bool unpackParameterEntry(U16 param_type, LLDataPacker* dp);
|
||||
|
||||
// This function checks to see if the given media URL has changed its version
|
||||
// and the update wasn't due to this agent's last action.
|
||||
|
||||
@@ -525,8 +525,7 @@ bool LLObjectBackup::validateNode(LLSelectNode* node)
|
||||
}
|
||||
else
|
||||
{
|
||||
LLSculptParams* params;
|
||||
params = (LLSculptParams*)obj->getParameterEntry(LLNetworkData::PARAMS_SCULPT);
|
||||
const LLSculptParams* params = obj->getSculptParams();
|
||||
LLUUID sculpt_id = params->getSculptTexture();
|
||||
return validateTexturePerms(sculpt_id);
|
||||
}
|
||||
@@ -871,23 +870,24 @@ LLSD LLObjectBackup::primsToLLSD(LLViewerObject::child_list_t child_list,
|
||||
if (object->isFlexible())
|
||||
{
|
||||
// Flexible
|
||||
LLFlexibleObjectData* flex;
|
||||
flex = (LLFlexibleObjectData*)object->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE);
|
||||
prim_llsd["flexible"] = flex->asLLSD();
|
||||
const LLFlexibleObjectData* flex = object->getFlexibleObjectData();
|
||||
if (flex)
|
||||
{
|
||||
prim_llsd["flexible"] = flex->asLLSD();
|
||||
}
|
||||
}
|
||||
|
||||
if (object->getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT))
|
||||
const LLLightParams* light = object->getLightParams();
|
||||
if (light)
|
||||
{
|
||||
// Light
|
||||
LLLightParams* light;
|
||||
light = (LLLightParams*)object->getParameterEntry(LLNetworkData::PARAMS_LIGHT);
|
||||
prim_llsd["light"] = light->asLLSD();
|
||||
}
|
||||
if (object->getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE))
|
||||
|
||||
const LLLightImageParams* light_param = object->getLightImageParams();
|
||||
if (light_param)
|
||||
{
|
||||
// Light image
|
||||
LLLightImageParams* light_param;
|
||||
light_param = (LLLightImageParams*)object->getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
|
||||
t_id = validateTextureID(light_param->getLightTexture());
|
||||
if (mTexturesList.count(t_id) == 0)
|
||||
{
|
||||
@@ -898,11 +898,10 @@ LLSD LLObjectBackup::primsToLLSD(LLViewerObject::child_list_t child_list,
|
||||
prim_llsd["light_texture"] = light_param->asLLSD();
|
||||
}
|
||||
|
||||
if (object->getParameterEntryInUse(LLNetworkData::PARAMS_SCULPT))
|
||||
const LLSculptParams* sculpt = object->getSculptParams();
|
||||
if (sculpt)
|
||||
{
|
||||
// Sculpt
|
||||
LLSculptParams* sculpt;
|
||||
sculpt = (LLSculptParams*)object->getParameterEntry(LLNetworkData::PARAMS_SCULPT);
|
||||
prim_llsd["sculpt"] = sculpt->asLLSD();
|
||||
if ((sculpt->getSculptType() & LL_SCULPT_TYPE_MASK) != LL_SCULPT_TYPE_MESH)
|
||||
{
|
||||
|
||||
@@ -326,6 +326,7 @@ void LLViewerTextureList::shutdown()
|
||||
mCreateTextureList.clear();
|
||||
|
||||
mUUIDMap.clear();
|
||||
mUUIDDict.clear();
|
||||
|
||||
mImageList.clear();
|
||||
|
||||
@@ -600,8 +601,9 @@ LLViewerFetchedTexture* LLViewerTextureList::createImage(const LLUUID &image_id,
|
||||
|
||||
LLViewerFetchedTexture *LLViewerTextureList::findImage(const LLUUID &image_id)
|
||||
{
|
||||
uuid_map_t::iterator iter = mUUIDMap.find(image_id);
|
||||
if(iter == mUUIDMap.end())
|
||||
// Singu note: Reworked hotspot
|
||||
auto& iter = mUUIDDict.find(image_id);
|
||||
if(iter == mUUIDDict.end())
|
||||
return NULL;
|
||||
return iter->second;
|
||||
}
|
||||
@@ -648,8 +650,8 @@ void LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *image)
|
||||
<< " but doesn't have mInImageList set"
|
||||
<< " ref count is " << image->getNumRefs()
|
||||
<< LL_ENDL;
|
||||
uuid_map_t::iterator iter = mUUIDMap.find(image->getID());
|
||||
if(iter == mUUIDMap.end())
|
||||
auto& iter = mUUIDDict.find(image->getID());
|
||||
if(iter == mUUIDDict.end())
|
||||
{
|
||||
LL_INFOS() << "Image " << image->getID() << " is also not in mUUIDMap!" << LL_ENDL ;
|
||||
}
|
||||
@@ -690,7 +692,8 @@ void LLViewerTextureList::addImage(LLViewerFetchedTexture *new_image)
|
||||
sNumImages++;
|
||||
|
||||
addImageToList(new_image);
|
||||
mUUIDMap[image_id] = new_image;
|
||||
mUUIDMap.emplace(image_id, new_image);
|
||||
mUUIDDict.emplace(image_id, new_image);
|
||||
}
|
||||
|
||||
|
||||
@@ -703,7 +706,9 @@ void LLViewerTextureList::deleteImage(LLViewerFetchedTexture *image)
|
||||
mCallbackList.erase(image);
|
||||
}
|
||||
|
||||
llverify(mUUIDMap.erase(image->getID()) == 1);
|
||||
const LLUUID& id = image->getID();
|
||||
llverify(mUUIDMap.erase(id) == 1);
|
||||
llverify(mUUIDDict.erase(id) == 1);
|
||||
sNumImages--;
|
||||
removeImageFromList(image);
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "llui.h"
|
||||
#include <list>
|
||||
#include <set>
|
||||
#include <unordered_map>
|
||||
|
||||
const U32 LL_IMAGE_REZ_LOSSLESS_CUTOFF = 128;
|
||||
|
||||
@@ -187,6 +188,8 @@ public:
|
||||
private:
|
||||
typedef std::map< LLUUID, LLPointer<LLViewerFetchedTexture> > uuid_map_t;
|
||||
uuid_map_t mUUIDMap;
|
||||
typedef std::unordered_map< LLUUID, LLPointer<LLViewerFetchedTexture>* > uuid_dict_t;
|
||||
uuid_map_t mUUIDDict;
|
||||
LLUUID mLastUpdateUUID;
|
||||
LLUUID mLastFetchUUID;
|
||||
|
||||
|
||||
@@ -5395,26 +5395,39 @@ void LLViewerWindow::stopGL(BOOL save_state)
|
||||
}
|
||||
}
|
||||
|
||||
void LLViewerWindow::restoreGL(const std::string& progress_message)
|
||||
void LLViewerWindow::restoreGLState()
|
||||
{
|
||||
gGL.init();
|
||||
stop_glerror();
|
||||
initGLDefaults();
|
||||
stop_glerror();
|
||||
gGL.refreshState(); //Singu Note: Call immediately. Cached states may have prevented initGLDefaults from actually applying changes.
|
||||
stop_glerror();
|
||||
LLGLStateValidator::restoreGL();
|
||||
stop_glerror();
|
||||
}
|
||||
|
||||
void LLViewerWindow::restoreGL(bool full_restore, const std::string& progress_message)
|
||||
{
|
||||
//Note: --bao
|
||||
//if not necessary, do not change the order of the function calls in this function.
|
||||
//if change something, make sure it will not break anything.
|
||||
//especially, be careful to put something before gTextureList.restoreGL();
|
||||
if (!gGLManager.mIsDisabled && !full_restore)
|
||||
{
|
||||
LL_INFOS() << "Restoring GL state..." << LL_ENDL;
|
||||
restoreGLState();
|
||||
gPipeline.releaseOcclusionBuffers(); // Occlusion handles must be invalidated
|
||||
return;
|
||||
}
|
||||
if (gGLManager.mIsDisabled)
|
||||
{
|
||||
stop_glerror();
|
||||
LL_INFOS() << "Restoring GL..." << LL_ENDL;
|
||||
gGLManager.mIsDisabled = FALSE;
|
||||
|
||||
gGL.init();
|
||||
stop_glerror();
|
||||
initGLDefaults();
|
||||
stop_glerror();
|
||||
gGL.refreshState(); //Singu Note: Call immediately. Cached states may have prevented initGLDefaults from actually applying changes.
|
||||
stop_glerror();
|
||||
LLGLStateValidator::restoreGL();
|
||||
stop_glerror();
|
||||
restoreGLState();
|
||||
|
||||
gTextureList.restoreGL();
|
||||
stop_glerror();
|
||||
|
||||
@@ -5617,11 +5630,11 @@ void LLViewerWindow::restartDisplay(BOOL show_progress_bar)
|
||||
stopGL();
|
||||
if (show_progress_bar)
|
||||
{
|
||||
restoreGL(LLTrans::getString("ProgressChangingResolution"));
|
||||
restoreGL(true, LLTrans::getString("ProgressChangingResolution"));
|
||||
}
|
||||
else
|
||||
{
|
||||
restoreGL();
|
||||
restoreGL(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5669,7 +5682,7 @@ BOOL LLViewerWindow::changeDisplaySettings(BOOL fullscreen, LLCoordScreen size,
|
||||
LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
|
||||
send_agent_pause();
|
||||
LL_INFOS() << "Stopping GL during changeDisplaySettings" << LL_ENDL;
|
||||
stopGL();
|
||||
//stopGL();
|
||||
mIgnoreActivate = TRUE;
|
||||
LLCoordScreen old_size;
|
||||
LLCoordScreen old_pos;
|
||||
@@ -5695,12 +5708,18 @@ BOOL LLViewerWindow::changeDisplaySettings(BOOL fullscreen, LLCoordScreen size,
|
||||
mWindow->setFSAASamples(fsaa);
|
||||
mWindow->setVsyncMode(vsync_mode);
|
||||
|
||||
result_first_try = mWindow->switchContext(fullscreen, size, vsync_mode, &new_pos);
|
||||
auto stopfn = [this]() { this->stopGL(); };
|
||||
auto restoreFn = [this, show_progress_bar](bool full_restore) {
|
||||
LL_INFOS() << "Restoring GL during resolution change" << LL_ENDL;
|
||||
this->restoreGL(full_restore, show_progress_bar ? LLTrans::getString("ProgressChangingResolution") : "");
|
||||
};
|
||||
|
||||
result_first_try = mWindow->switchContext(fullscreen, size, vsync_mode, stopfn, restoreFn, &new_pos);
|
||||
if (!result_first_try)
|
||||
{
|
||||
// try to switch back
|
||||
mWindow->setFSAASamples(old_fsaa);
|
||||
result_second_try = mWindow->switchContext(old_fullscreen, old_size, vsync_mode, &new_pos);
|
||||
result_second_try = mWindow->switchContext(old_fullscreen, old_size, vsync_mode, stopfn, restoreFn, &new_pos);
|
||||
|
||||
if (!result_second_try)
|
||||
{
|
||||
@@ -5712,16 +5731,6 @@ BOOL LLViewerWindow::changeDisplaySettings(BOOL fullscreen, LLCoordScreen size,
|
||||
}
|
||||
send_agent_resume();
|
||||
|
||||
LL_INFOS() << "Restoring GL during resolution change" << LL_ENDL;
|
||||
if (show_progress_bar)
|
||||
{
|
||||
restoreGL(LLTrans::getString("ProgressChangingResolution"));
|
||||
}
|
||||
else
|
||||
{
|
||||
restoreGL();
|
||||
}
|
||||
|
||||
if (!result_first_try)
|
||||
{
|
||||
LLSD args;
|
||||
|
||||
@@ -414,11 +414,11 @@ private:
|
||||
bool shouldShowToolTipFor(LLMouseHandler *mh);
|
||||
static bool onAlert(const LLSD& notify);
|
||||
|
||||
void switchToolByMask(MASK mask);
|
||||
void destroyWindow();
|
||||
void drawMouselookInstructions();
|
||||
void stopGL(BOOL save_state = TRUE);
|
||||
void restoreGL(const std::string& progress_message = LLStringUtil::null);
|
||||
void restoreGLState();
|
||||
void restoreGL(bool full_restore, const std::string& progress_message = LLStringUtil::null);
|
||||
void initFonts(F32 zoom_factor = 1.f);
|
||||
void schedulePick(LLPickInfo& pick_info);
|
||||
S32 getChatConsoleBottomPad(); // Vertical padding for child console rect, varied by bottom clutter
|
||||
|
||||
@@ -10627,8 +10627,12 @@ void LLVOAvatar::idleUpdateRenderComplexity()
|
||||
}
|
||||
}
|
||||
|
||||
// Render Complexity
|
||||
calculateUpdateRenderComplexity(); // Update mVisualComplexity if needed
|
||||
if (mComplexityTimer.getElapsedTimeF32() > 5.f)
|
||||
{
|
||||
// Render Complexity
|
||||
calculateUpdateRenderComplexity(); // Update mVisualComplexity if needed
|
||||
mComplexityTimer.start();
|
||||
}
|
||||
|
||||
if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHAME))
|
||||
{
|
||||
|
||||
@@ -1171,6 +1171,8 @@ public:
|
||||
private:
|
||||
S32 mIdleMinute;
|
||||
|
||||
LLTimer mComplexityTimer;
|
||||
|
||||
//CCS Nametag
|
||||
public:
|
||||
void setNameFromChat(const std::string &text);
|
||||
|
||||
@@ -333,7 +333,7 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
|
||||
U8 sculpt_type = 0;
|
||||
if (isSculpted())
|
||||
{
|
||||
LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT);
|
||||
const LLSculptParams *sculpt_params = getSculptParams();
|
||||
sculpt_id = sculpt_params->getSculptTexture();
|
||||
sculpt_type = sculpt_params->getSculptType();
|
||||
}
|
||||
@@ -850,7 +850,7 @@ void LLVOVolume::updateTextureVirtualSize(bool forced)
|
||||
|
||||
if (getLightTextureID().notNull())
|
||||
{
|
||||
LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
|
||||
const LLLightImageParams* params = getLightImageParams();
|
||||
LLUUID id = params->getLightTexture();
|
||||
mLightTexture = LLViewerTextureManager::getFetchedTexture(id);
|
||||
if (mLightTexture.notNull())
|
||||
@@ -996,7 +996,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bo
|
||||
setParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE, TRUE, false);
|
||||
if (!mVolumeImpl)
|
||||
{
|
||||
LLFlexibleObjectData* data = (LLFlexibleObjectData*)getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE);
|
||||
LLFlexibleObjectData* data = (LLFlexibleObjectData*)getFlexibleObjectData();
|
||||
mVolumeImpl = new LLVolumeImplFlexible(this, data);
|
||||
}
|
||||
}
|
||||
@@ -1100,7 +1100,7 @@ void LLVOVolume::updateSculptTexture()
|
||||
|
||||
if (isSculpted() && !isMesh())
|
||||
{
|
||||
LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT);
|
||||
const LLSculptParams *sculpt_params = getSculptParams();
|
||||
LLUUID id = sculpt_params->getSculptTexture();
|
||||
if (id.notNull())
|
||||
{
|
||||
@@ -2946,7 +2946,7 @@ void LLVOVolume::setLightTextureID(LLUUID id)
|
||||
{
|
||||
setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE, TRUE, true);
|
||||
}
|
||||
LLLightImageParams* param_block = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
|
||||
LLLightImageParams* param_block = (LLLightImageParams*)getLightImageParams();
|
||||
if (param_block && param_block->getLightTexture() != id)
|
||||
{
|
||||
param_block->setLightTexture(id);
|
||||
@@ -2966,7 +2966,7 @@ void LLVOVolume::setLightTextureID(LLUUID id)
|
||||
|
||||
void LLVOVolume::setSpotLightParams(LLVector3 params)
|
||||
{
|
||||
LLLightImageParams* param_block = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
|
||||
LLLightImageParams* param_block = (LLLightImageParams*)getLightImageParams();
|
||||
if (param_block && param_block->getParams() != params)
|
||||
{
|
||||
param_block->setParams(params);
|
||||
@@ -3003,7 +3003,7 @@ void LLVOVolume::setIsLight(BOOL is_light)
|
||||
|
||||
void LLVOVolume::setLightColor(const LLColor3& color)
|
||||
{
|
||||
LLLightParams *param_block = (LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
|
||||
LLLightParams *param_block = (LLLightParams *)getLightParams();
|
||||
if (param_block)
|
||||
{
|
||||
if (param_block->getColor() != color)
|
||||
@@ -3018,7 +3018,7 @@ void LLVOVolume::setLightColor(const LLColor3& color)
|
||||
|
||||
void LLVOVolume::setLightIntensity(F32 intensity)
|
||||
{
|
||||
LLLightParams *param_block = (LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
|
||||
LLLightParams *param_block = (LLLightParams *)getLightParams();
|
||||
if (param_block)
|
||||
{
|
||||
if (param_block->getColor().mV[3] != intensity)
|
||||
@@ -3031,7 +3031,7 @@ void LLVOVolume::setLightIntensity(F32 intensity)
|
||||
|
||||
void LLVOVolume::setLightRadius(F32 radius)
|
||||
{
|
||||
LLLightParams *param_block = (LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
|
||||
LLLightParams *param_block = (LLLightParams *)getLightParams();
|
||||
if (param_block)
|
||||
{
|
||||
if (param_block->getRadius() != radius)
|
||||
@@ -3044,7 +3044,7 @@ void LLVOVolume::setLightRadius(F32 radius)
|
||||
|
||||
void LLVOVolume::setLightFalloff(F32 falloff)
|
||||
{
|
||||
LLLightParams *param_block = (LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
|
||||
LLLightParams *param_block = (LLLightParams *)getLightParams();
|
||||
if (param_block)
|
||||
{
|
||||
if (param_block->getFalloff() != falloff)
|
||||
@@ -3057,7 +3057,7 @@ void LLVOVolume::setLightFalloff(F32 falloff)
|
||||
|
||||
void LLVOVolume::setLightCutoff(F32 cutoff)
|
||||
{
|
||||
LLLightParams *param_block = (LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
|
||||
LLLightParams *param_block = (LLLightParams *)getLightParams();
|
||||
if (param_block)
|
||||
{
|
||||
if (param_block->getCutoff() != cutoff)
|
||||
@@ -3072,12 +3072,12 @@ void LLVOVolume::setLightCutoff(F32 cutoff)
|
||||
|
||||
BOOL LLVOVolume::getIsLight() const
|
||||
{
|
||||
return getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT);
|
||||
return getLightParams() != nullptr;
|
||||
}
|
||||
|
||||
LLColor3 LLVOVolume::getLightBaseColor() const
|
||||
{
|
||||
const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
|
||||
const LLLightParams *param_block = getLightParams();
|
||||
if (param_block)
|
||||
{
|
||||
return LLColor3(param_block->getColor());
|
||||
@@ -3090,7 +3090,7 @@ LLColor3 LLVOVolume::getLightBaseColor() const
|
||||
|
||||
LLColor3 LLVOVolume::getLightColor() const
|
||||
{
|
||||
const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
|
||||
const LLLightParams *param_block = getLightParams();
|
||||
if (param_block)
|
||||
{
|
||||
return LLColor3(param_block->getColor()) * param_block->getColor().mV[3];
|
||||
@@ -3103,13 +3103,10 @@ LLColor3 LLVOVolume::getLightColor() const
|
||||
|
||||
LLUUID LLVOVolume::getLightTextureID() const
|
||||
{
|
||||
if (getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE))
|
||||
const LLLightImageParams *param_block = getLightImageParams();
|
||||
if (param_block)
|
||||
{
|
||||
const LLLightImageParams *param_block = (const LLLightImageParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
|
||||
if (param_block)
|
||||
{
|
||||
return param_block->getLightTexture();
|
||||
}
|
||||
return param_block->getLightTexture();
|
||||
}
|
||||
|
||||
return LLUUID::null;
|
||||
@@ -3118,13 +3115,10 @@ LLUUID LLVOVolume::getLightTextureID() const
|
||||
|
||||
LLVector3 LLVOVolume::getSpotLightParams() const
|
||||
{
|
||||
if (getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE))
|
||||
const LLLightImageParams *param_block = getLightImageParams();
|
||||
if (param_block)
|
||||
{
|
||||
const LLLightImageParams *param_block = (const LLLightImageParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
|
||||
if (param_block)
|
||||
{
|
||||
return param_block->getParams();
|
||||
}
|
||||
return param_block->getParams();
|
||||
}
|
||||
|
||||
return LLVector3();
|
||||
@@ -3161,8 +3155,8 @@ void LLVOVolume::updateSpotLightPriority()
|
||||
|
||||
bool LLVOVolume::isLightSpotlight() const
|
||||
{
|
||||
LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
|
||||
if (params && getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE))
|
||||
const LLLightImageParams* params = getLightImageParams();
|
||||
if (params)
|
||||
{
|
||||
return params->isLightSpotlight();
|
||||
}
|
||||
@@ -3191,7 +3185,7 @@ LLViewerTexture* LLVOVolume::getLightTexture()
|
||||
|
||||
F32 LLVOVolume::getLightIntensity() const
|
||||
{
|
||||
const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
|
||||
const LLLightParams *param_block = getLightParams();
|
||||
if (param_block)
|
||||
{
|
||||
return param_block->getColor().mV[3];
|
||||
@@ -3204,7 +3198,7 @@ F32 LLVOVolume::getLightIntensity() const
|
||||
|
||||
F32 LLVOVolume::getLightRadius() const
|
||||
{
|
||||
const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
|
||||
const LLLightParams *param_block = getLightParams();
|
||||
if (param_block)
|
||||
{
|
||||
return param_block->getRadius();
|
||||
@@ -3217,7 +3211,7 @@ F32 LLVOVolume::getLightRadius() const
|
||||
|
||||
F32 LLVOVolume::getLightFalloff() const
|
||||
{
|
||||
const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
|
||||
const LLLightParams *param_block = getLightParams();
|
||||
if (param_block)
|
||||
{
|
||||
return param_block->getFalloff();
|
||||
@@ -3230,7 +3224,7 @@ F32 LLVOVolume::getLightFalloff() const
|
||||
|
||||
F32 LLVOVolume::getLightCutoff() const
|
||||
{
|
||||
const LLLightParams *param_block = (const LLLightParams *)getParameterEntry(LLNetworkData::PARAMS_LIGHT);
|
||||
const LLLightParams *param_block = getLightParams();
|
||||
if (param_block)
|
||||
{
|
||||
return param_block->getCutoff();
|
||||
@@ -3253,7 +3247,7 @@ U32 LLVOVolume::getVolumeInterfaceID() const
|
||||
|
||||
BOOL LLVOVolume::isFlexible() const
|
||||
{
|
||||
if (getParameterEntryInUse(LLNetworkData::PARAMS_FLEXIBLE))
|
||||
if (getFlexibleObjectData())
|
||||
{
|
||||
LLVolume* volume = getVolume();
|
||||
if (volume && volume->getParams().getPathParams().getCurveType() != LL_PCODE_PATH_FLEXIBLE)
|
||||
@@ -3272,7 +3266,7 @@ BOOL LLVOVolume::isFlexible() const
|
||||
|
||||
BOOL LLVOVolume::isSculpted() const
|
||||
{
|
||||
if (getParameterEntryInUse(LLNetworkData::PARAMS_SCULPT))
|
||||
if (getSculptParams())
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@@ -3284,7 +3278,7 @@ BOOL LLVOVolume::isMesh() const
|
||||
{
|
||||
if (isSculpted())
|
||||
{
|
||||
LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT);
|
||||
const LLSculptParams *sculpt_params = getSculptParams();
|
||||
U8 sculpt_type = sculpt_params->getSculptType();
|
||||
|
||||
if ((sculpt_type & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH)
|
||||
@@ -3299,7 +3293,7 @@ BOOL LLVOVolume::isMesh() const
|
||||
|
||||
BOOL LLVOVolume::hasLightTexture() const
|
||||
{
|
||||
if (getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE))
|
||||
if (getLightImageParams())
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@@ -3393,8 +3387,7 @@ BOOL LLVOVolume::isRiggedMesh() const
|
||||
//----------------------------------------------------------------------------
|
||||
U32 LLVOVolume::getExtendedMeshFlags() const
|
||||
{
|
||||
const LLExtendedMeshParams *param_block =
|
||||
(const LLExtendedMeshParams *)getParameterEntry(LLNetworkData::PARAMS_EXTENDED_MESH);
|
||||
const LLExtendedMeshParams *param_block = getExtendedMeshParams();
|
||||
if (param_block)
|
||||
{
|
||||
return param_block->getFlags();
|
||||
@@ -3439,8 +3432,7 @@ void LLVOVolume::setExtendedMeshFlags(U32 flags)
|
||||
{
|
||||
bool in_use = true;
|
||||
setParameterEntryInUse(LLNetworkData::PARAMS_EXTENDED_MESH, in_use, true);
|
||||
LLExtendedMeshParams *param_block =
|
||||
(LLExtendedMeshParams *)getParameterEntry(LLNetworkData::PARAMS_EXTENDED_MESH);
|
||||
LLExtendedMeshParams *param_block = (LLExtendedMeshParams *)getExtendedMeshParams();
|
||||
if (param_block)
|
||||
{
|
||||
param_block->setFlags(flags);
|
||||
@@ -3762,7 +3754,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
|
||||
}
|
||||
else
|
||||
{
|
||||
const LLSculptParams *sculpt_params = (LLSculptParams *) getParameterEntry(LLNetworkData::PARAMS_SCULPT);
|
||||
const LLSculptParams *sculpt_params = getSculptParams();
|
||||
LLUUID sculpt_id = sculpt_params->getSculptTexture();
|
||||
if (textures.find(sculpt_id) == textures.end())
|
||||
{
|
||||
|
||||
@@ -978,6 +978,22 @@ void LLPipeline::refreshCachedSettings()
|
||||
&& gGLManager.mHasOcclusionQuery) ? 2 : 0;
|
||||
}
|
||||
|
||||
void LLPipeline::releaseOcclusionBuffers()
|
||||
{
|
||||
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
|
||||
iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
|
||||
{
|
||||
LLViewerRegion* region = *iter;
|
||||
for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++)
|
||||
{
|
||||
LLSpatialPartition* part = region->getSpatialPartition(i);
|
||||
if (part)
|
||||
{
|
||||
part->resetVertexBuffers();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void LLPipeline::releaseVertexBuffers()
|
||||
{
|
||||
mCubeVB = NULL;
|
||||
|
||||
@@ -117,6 +117,7 @@ public:
|
||||
void resetVertexBuffers();
|
||||
void doResetVertexBuffers(bool forced = false);
|
||||
void resizeScreenTexture();
|
||||
void releaseOcclusionBuffers();
|
||||
void releaseVertexBuffers();
|
||||
void releaseGLBuffers();
|
||||
void releaseLUTBuffers();
|
||||
|
||||
@@ -1048,6 +1048,14 @@ Starts animation anim for agent that granted PERMISSION_TRIGGER_ANIMATION if the
|
||||
llStopAnimation(string anim)
|
||||
Stops animation anim for agent that granted permission
|
||||
</string>
|
||||
<string name="LSLTipText_llStartObjectAnimation">
|
||||
llStartObjectAnimation(string anim)
|
||||
Start animation for the current object
|
||||
</string>
|
||||
<string name="LSLTipText_llStopObjectAnimation">
|
||||
llStopObjectAnimation(string anim)
|
||||
Stop an animation for the current object
|
||||
</string>
|
||||
<string name="LSLTipText_llPointAt">
|
||||
llPointAt(vector pos)
|
||||
Makes agent that owns object point at pos
|
||||
|
||||
Reference in New Issue
Block a user