Merge branch 'animesh' of git://github.com/Shyotl/SingularityViewer into animesh
This commit is contained in:
@@ -107,6 +107,7 @@ public:
|
||||
PARAMS_RESERVED = 0x50, // Used on server-side
|
||||
PARAMS_MESH = 0x60,
|
||||
PARAMS_EXTENDED_MESH = 0x70,
|
||||
PARAMS_MAX = PARAMS_EXTENDED_MESH
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
@@ -868,7 +868,7 @@ BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f,
|
||||
{
|
||||
LL_DEBUGS("RiggedBox") << "skipping face " << f << ", bad num vertices "
|
||||
<< face.mNumVertices << " " << face.mNumIndices << " " << face.mWeights << LL_ENDL;
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//VECTORIZE THIS
|
||||
|
||||
@@ -128,7 +128,7 @@ BOOL LLToolPie::handleRightMouseDown(S32 x, S32 y, MASK mask)
|
||||
// don't pick transparent so users can't "pay" transparent objects
|
||||
mPick = gViewerWindow->pickImmediate(x, y,
|
||||
/*BOOL pick_transparent*/ FALSE,
|
||||
/*BOOL pick_rigged*/ TRUE,
|
||||
/*BOOL pick_rigged*/ mask != MASK_SHIFT,
|
||||
/*BOOL pick_particle*/ TRUE);
|
||||
mPick.mKeyMask = mask;
|
||||
|
||||
|
||||
@@ -288,7 +288,8 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
|
||||
mPhysicsShapeUnknown(true),
|
||||
mAttachmentItemID(LLUUID::null),
|
||||
mLastUpdateType(OUT_UNKNOWN),
|
||||
mLastUpdateCached(FALSE)
|
||||
mLastUpdateCached(FALSE),
|
||||
mExtraParameterList(LLNetworkData::PARAMS_MAX >> 4)
|
||||
{
|
||||
if(!is_global)
|
||||
{
|
||||
@@ -334,18 +335,6 @@ LLViewerObject::~LLViewerObject()
|
||||
}
|
||||
|
||||
// Delete memory associated with extra parameters.
|
||||
std::map<U16, ExtraParameter*>::iterator iter;
|
||||
for (iter = mExtraParameterList.begin(); iter != mExtraParameterList.end(); ++iter)
|
||||
{
|
||||
if(iter->second != NULL)
|
||||
{
|
||||
// <edit>
|
||||
// There was a crash here
|
||||
// </edit>
|
||||
delete iter->second->data;
|
||||
delete iter->second;
|
||||
}
|
||||
}
|
||||
mExtraParameterList.clear();
|
||||
|
||||
for_each(mNameValuePairs.begin(), mNameValuePairs.end(), DeletePairedPointer()) ;
|
||||
@@ -1388,10 +1377,11 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
|
||||
unpackParticleSource(block_num, owner_id);
|
||||
|
||||
// Mark all extra parameters not used
|
||||
std::map<U16, ExtraParameter*>::iterator iter;
|
||||
std::vector<std::unique_ptr<ExtraParameter> >::iterator iter;
|
||||
for (iter = mExtraParameterList.begin(); iter != mExtraParameterList.end(); ++iter)
|
||||
{
|
||||
iter->second->in_use = FALSE;
|
||||
if(*iter)
|
||||
(*iter)->in_use = FALSE;
|
||||
}
|
||||
|
||||
// Unpack extra parameters
|
||||
@@ -1418,12 +1408,12 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
|
||||
delete[] buffer;
|
||||
}
|
||||
|
||||
for (iter = mExtraParameterList.begin(); iter != mExtraParameterList.end(); ++iter)
|
||||
for (size_t i = 0; i < mExtraParameterList.size(); ++i)
|
||||
{
|
||||
if (!iter->second->in_use)
|
||||
if (mExtraParameterList[i] && !mExtraParameterList[i]->in_use)
|
||||
{
|
||||
// Send an update message in case it was formerly in use
|
||||
parameterChanged(iter->first, iter->second->data, FALSE, false);
|
||||
parameterChanged((i + 1) << 4, mExtraParameterList[i]->data.get(), FALSE, false);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1643,10 +1633,11 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
|
||||
}
|
||||
|
||||
// Mark all extra parameters not used
|
||||
std::map<U16, ExtraParameter*>::iterator iter;
|
||||
std::vector<std::unique_ptr<ExtraParameter> >::iterator iter;
|
||||
for (iter = mExtraParameterList.begin(); iter != mExtraParameterList.end(); ++iter)
|
||||
{
|
||||
iter->second->in_use = FALSE;
|
||||
if(*iter)
|
||||
(*iter)->in_use = FALSE;
|
||||
}
|
||||
|
||||
// Unpack extra params
|
||||
@@ -1664,12 +1655,12 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
|
||||
unpackParameterEntry(param_type, &dp2);
|
||||
}
|
||||
|
||||
for (iter = mExtraParameterList.begin(); iter != mExtraParameterList.end(); ++iter)
|
||||
for (size_t i = 0; i < mExtraParameterList.size(); ++i)
|
||||
{
|
||||
if (!iter->second->in_use)
|
||||
if (mExtraParameterList[i] && !mExtraParameterList[i]->in_use)
|
||||
{
|
||||
// Send an update message in case it was formerly in use
|
||||
parameterChanged(iter->first, iter->second->data, FALSE, false);
|
||||
parameterChanged((i + 1) << 4, mExtraParameterList[i]->data.get(), FALSE, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5824,7 +5815,7 @@ bool LLViewerObject::unpackParameterEntry(U16 param_type, LLDataPacker *dp)
|
||||
{
|
||||
param->data->unpack(*dp);
|
||||
param->in_use = TRUE;
|
||||
parameterChanged(param_type, param->data, TRUE, false);
|
||||
parameterChanged(param_type, param->data.get(), TRUE, false);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -5873,9 +5864,9 @@ LLViewerObject::ExtraParameter* LLViewerObject::createNewParameterEntry(U16 para
|
||||
if (new_block)
|
||||
{
|
||||
ExtraParameter* new_entry = new ExtraParameter;
|
||||
new_entry->data = new_block;
|
||||
new_entry->data = decltype(new_entry->data)(new_block);
|
||||
new_entry->in_use = false; // not in use yet
|
||||
mExtraParameterList[param_type] = new_entry;
|
||||
mExtraParameterList[(param_type >> 4) - 1].reset(new_entry);
|
||||
return new_entry;
|
||||
}
|
||||
return NULL;
|
||||
@@ -5883,12 +5874,7 @@ LLViewerObject::ExtraParameter* LLViewerObject::createNewParameterEntry(U16 para
|
||||
|
||||
LLViewerObject::ExtraParameter* LLViewerObject::getExtraParameterEntry(U16 param_type) const
|
||||
{
|
||||
std::map<U16, ExtraParameter*>::const_iterator itor = mExtraParameterList.find(param_type);
|
||||
if (itor != mExtraParameterList.end())
|
||||
{
|
||||
return itor->second;
|
||||
}
|
||||
return NULL;
|
||||
return param_type <= LLNetworkData::PARAMS_MAX ? mExtraParameterList[(param_type >> 4) - 1].get() : nullptr;
|
||||
}
|
||||
|
||||
LLViewerObject::ExtraParameter* LLViewerObject::getExtraParameterEntryCreate(U16 param_type)
|
||||
@@ -5906,7 +5892,7 @@ LLNetworkData* LLViewerObject::getParameterEntry(U16 param_type) const
|
||||
ExtraParameter* param = getExtraParameterEntry(param_type);
|
||||
if (param)
|
||||
{
|
||||
return param->data;
|
||||
return param->data.get();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5938,7 +5924,7 @@ bool LLViewerObject::setParameterEntry(U16 param_type, const LLNetworkData& new_
|
||||
}
|
||||
param->in_use = true;
|
||||
param->data->copy(new_value);
|
||||
parameterChanged(param_type, param->data, TRUE, local_origin);
|
||||
parameterChanged(param_type, param->data.get(), TRUE, local_origin);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -5956,7 +5942,7 @@ bool LLViewerObject::setParameterEntryInUse(U16 param_type, BOOL in_use, bool lo
|
||||
if (param && param->in_use != in_use)
|
||||
{
|
||||
param->in_use = in_use;
|
||||
parameterChanged(param_type, param->data, in_use, local_origin);
|
||||
parameterChanged(param_type, param->data.get(), in_use, local_origin);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -5967,7 +5953,7 @@ void LLViewerObject::parameterChanged(U16 param_type, bool local_origin)
|
||||
ExtraParameter* param = getExtraParameterEntry(param_type);
|
||||
if (param)
|
||||
{
|
||||
parameterChanged(param_type, param->data, param->in_use, local_origin);
|
||||
parameterChanged(param_type, param->data.get(), param->in_use, local_origin);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -127,9 +127,9 @@ protected:
|
||||
struct ExtraParameter
|
||||
{
|
||||
BOOL in_use;
|
||||
LLNetworkData *data;
|
||||
std::unique_ptr<LLNetworkData> data;
|
||||
};
|
||||
std::map<U16, ExtraParameter*> mExtraParameterList;
|
||||
std::vector<std::unique_ptr<ExtraParameter> > mExtraParameterList;
|
||||
|
||||
public:
|
||||
typedef std::list<LLPointer<LLViewerObject> > child_list_t;
|
||||
|
||||
@@ -1676,7 +1676,6 @@ LLViewerWindow::LLViewerWindow(
|
||||
mHideCursorPermanent( FALSE ),
|
||||
mCursorHidden(FALSE),
|
||||
mIgnoreActivate( FALSE ),
|
||||
mHoverPick(),
|
||||
mResDirty(false),
|
||||
//mStatesDirty(false), //Singu Note: No longer needed. State update is now in restoreGL.
|
||||
mIsFullscreenChecked(false),
|
||||
@@ -3416,40 +3415,9 @@ void LLViewerWindow::updateUI()
|
||||
{
|
||||
LLSelectMgr::getInstance()->deselectUnused();
|
||||
}
|
||||
|
||||
// per frame picking - for tooltips and changing cursor over interactive objects
|
||||
static S32 previous_x = -1;
|
||||
static S32 previous_y = -1;
|
||||
static BOOL mouse_moved_since_pick = FALSE;
|
||||
|
||||
if ((previous_x != x) || (previous_y != y))
|
||||
mouse_moved_since_pick = TRUE;
|
||||
|
||||
static const LLCachedControl<F32> picks_moving("PicksPerSecondMouseMoving",5.f);
|
||||
static const LLCachedControl<F32> picks_stationary("PicksPerSecondMouseStationary",0.f);
|
||||
if( !getCursorHidden()
|
||||
// When in-world media is in focus, pick every frame so that browser mouse-overs, dragging scrollbars, etc. work properly.
|
||||
&& (LLViewerMediaFocus::getInstance()->getFocus()
|
||||
|| ((mouse_moved_since_pick) && (picks_moving > 0.0) && (mPickTimer.getElapsedTimeF32() > 1.0f / picks_moving))
|
||||
|| ((!mouse_moved_since_pick) && (picks_stationary > 0.0) && (mPickTimer.getElapsedTimeF32() > 1.0f / picks_stationary))))
|
||||
{
|
||||
mouse_moved_since_pick = FALSE;
|
||||
mPickTimer.reset();
|
||||
pickAsync(getCurrentMouseX(), getCurrentMouseY(), mask, hoverPickCallback, TRUE, TRUE);
|
||||
}
|
||||
|
||||
previous_x = x;
|
||||
previous_y = y;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* static */
|
||||
void LLViewerWindow::hoverPickCallback(const LLPickInfo& pick_info)
|
||||
{
|
||||
gViewerWindow->mHoverPick = pick_info;
|
||||
}
|
||||
|
||||
void LLViewerWindow::updateLayout()
|
||||
{
|
||||
static const LLCachedControl<bool> freeze_time("FreezeTime",0);
|
||||
|
||||
@@ -250,7 +250,6 @@ public:
|
||||
BOOL getRightMouseDown() const { return mRightMouseDown; }
|
||||
|
||||
const LLPickInfo& getLastPick() const { return mLastPick; }
|
||||
const LLPickInfo& getHoverPick() const { return mHoverPick; }
|
||||
|
||||
void setup2DViewport(S32 x_offset = 0, S32 y_offset = 0);
|
||||
void setup3DViewport(S32 x_offset = 0, S32 y_offset = 0);
|
||||
@@ -464,7 +463,6 @@ protected:
|
||||
BOOL mHideCursorPermanent; // true during drags, mouselook
|
||||
BOOL mCursorHidden;
|
||||
LLPickInfo mLastPick;
|
||||
LLPickInfo mHoverPick;
|
||||
std::vector<LLPickInfo> mPicks;
|
||||
LLRect mPickScreenRegion; // area of frame buffer for rendering pick frames (generally follows mouse to avoid going offscreen)
|
||||
LLTimer mPickTimer; // timer for scheduling n picks per second
|
||||
|
||||
@@ -1331,9 +1331,7 @@ BOOL LLVOVolume::calcLOD()
|
||||
if (distance < rampDist)
|
||||
{
|
||||
// Boost LOD when you're REALLY close
|
||||
distance *= 1.0f/rampDist;
|
||||
distance *= distance;
|
||||
distance *= rampDist;
|
||||
distance *= distance/rampDist;
|
||||
}
|
||||
|
||||
// DON'T Compensate for field of view changing on FOV zoom.
|
||||
@@ -1435,7 +1433,8 @@ BOOL LLVOVolume::setDrawableParent(LLDrawable* parentp)
|
||||
|
||||
void LLVOVolume::updateFaceFlags()
|
||||
{
|
||||
for (S32 i = 0; i < getVolume()->getNumFaces(); i++)
|
||||
// There's no guarantee that getVolume()->getNumFaces() == mDrawable->getNumFaces()
|
||||
for (S32 i = 0; i < getVolume()->getNumFaces() && i < mDrawable->getNumFaces(); i++)
|
||||
{
|
||||
LLFace *face = mDrawable->getFace(i);
|
||||
if (face)
|
||||
@@ -1572,19 +1571,24 @@ BOOL LLVOVolume::genBBoxes(BOOL force_global)
|
||||
}
|
||||
}
|
||||
if (!any_valid_boxes) {
|
||||
for (S32 i = 0; i < getVolume()->getNumVolumeFaces(); i++)
|
||||
// There's no guarantee that getVolume()->getNumFaces() == mDrawable->getNumFaces()
|
||||
for (S32 i = 0;
|
||||
i < getVolume()->getNumVolumeFaces() && i < mDrawable->getNumFaces() && i < getNumTEs();
|
||||
i++)
|
||||
{
|
||||
LLFace *face = mDrawable->getFace(i);
|
||||
if (!face)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
res &= face->genVolumeBBoxes(*volume, i,
|
||||
bool face_res = face->genVolumeBBoxes(*volume, i,
|
||||
mRelativeXform,
|
||||
(mVolumeImpl && mVolumeImpl->isVolumeGlobal()) || force_global);
|
||||
// Singu note: Don't let one bad face to ruin the whole volume. &= bad. |= good.
|
||||
res &= face_res;
|
||||
|
||||
// MAINT-8264 - ignore bboxes of ill-formed faces.
|
||||
if (!res)
|
||||
if (!face_res)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user