Sync llcommon with Alchemy a bit.

llmath::llround->ll_round
LL_ICC->LL_INTELC
Add llpredicate
Add LL_CPP11 macro
Remove llhash
Update llinitparam, llsd and all relatives of it.
This commit is contained in:
Inusaito Sayori
2015-03-20 22:04:04 -04:00
parent 16a2b28c1b
commit 72080e79e9
135 changed files with 1940 additions and 1282 deletions

View File

@@ -122,7 +122,7 @@ F32 LLLayoutPanel::getVisibleAmount() const
S32 LLLayoutPanel::getLayoutDim() const
{
return llmath::llround((F32)((mOrientation == LLLayoutStack::HORIZONTAL)
return ll_round((F32)((mOrientation == LLLayoutStack::HORIZONTAL)
? getRect().getWidth()
: getRect().getHeight()));
}
@@ -149,7 +149,7 @@ void LLLayoutPanel::setTargetDim(S32 value)
S32 LLLayoutPanel::getVisibleDim() const
{
F32 min_dim = getRelevantMinDim();
return llmath::llround(mVisibleAmt
return ll_round(mVisibleAmt
* (min_dim
+ (((F32)mTargetDim - min_dim) * (1.f - mCollapseAmt))));
}
@@ -157,7 +157,7 @@ S32 LLLayoutPanel::getVisibleDim() const
void LLLayoutPanel::setOrientation( LLLayoutStack::ELayoutOrientation orientation )
{
mOrientation = orientation;
S32 layout_dim = llmath::llround((F32)((mOrientation == LLLayoutStack::HORIZONTAL)
S32 layout_dim = ll_round((F32)((mOrientation == LLLayoutStack::HORIZONTAL)
? getRect().getWidth()
: getRect().getHeight()));
@@ -374,14 +374,14 @@ void LLLayoutStack::updateLayout()
{
panelp->mTargetDim = panelp->getRelevantMinDim();
}
space_to_distribute -= panelp->getVisibleDim() + llmath::llround((F32)mPanelSpacing * panelp->getVisibleAmount());
space_to_distribute -= panelp->getVisibleDim() + ll_round((F32)mPanelSpacing * panelp->getVisibleAmount());
total_visible_fraction += panelp->mFractionalSize * panelp->getAutoResizeFactor();
}
llassert(total_visible_fraction < 1.05f);
// don't need spacing after last panel
space_to_distribute += panelp ? llmath::llround((F32)mPanelSpacing * panelp->getVisibleAmount()) : 0;
space_to_distribute += panelp ? ll_round((F32)mPanelSpacing * panelp->getVisibleAmount()) : 0;
S32 remaining_space = space_to_distribute;
F32 fraction_distributed = 0.f;
@@ -392,7 +392,7 @@ void LLLayoutStack::updateLayout()
if (panelp->mAutoResize)
{
F32 fraction_to_distribute = (panelp->mFractionalSize * panelp->getAutoResizeFactor()) / (total_visible_fraction);
S32 delta = llmath::llround((F32)space_to_distribute * fraction_to_distribute);
S32 delta = ll_round((F32)space_to_distribute * fraction_to_distribute);
fraction_distributed += fraction_to_distribute;
panelp->mTargetDim += delta;
remaining_space -= delta;
@@ -425,17 +425,17 @@ void LLLayoutStack::updateLayout()
LLRect panel_rect;
if (mOrientation == HORIZONTAL)
{
panel_rect.setLeftTopAndSize(llmath::llround(cur_pos),
panel_rect.setLeftTopAndSize(ll_round(cur_pos),
getRect().getHeight(),
llmath::llround(panel_dim),
ll_round(panel_dim),
getRect().getHeight());
}
else
{
panel_rect.setLeftTopAndSize(0,
llmath::llround(cur_pos),
ll_round(cur_pos),
getRect().getWidth(),
llmath::llround(panel_dim));
ll_round(panel_dim));
}
panelp->setIgnoreReshape(true);
panelp->setShape(panel_rect);
@@ -447,14 +447,14 @@ void LLLayoutStack::updateLayout()
if (mOrientation == HORIZONTAL)
{
resize_bar_rect.mLeft = panel_rect.mRight - mResizeBarOverlap;
resize_bar_rect.mRight = panel_rect.mRight + (S32)(llmath::llround(panel_spacing)) + mResizeBarOverlap;
resize_bar_rect.mRight = panel_rect.mRight + (S32)(ll_round(panel_spacing)) + mResizeBarOverlap;
cur_pos += panel_visible_dim + panel_spacing;
}
else //VERTICAL
{
resize_bar_rect.mTop = panel_rect.mBottom + mResizeBarOverlap;
resize_bar_rect.mBottom = panel_rect.mBottom - (S32)(llmath::llround(panel_spacing)) - mResizeBarOverlap;
resize_bar_rect.mBottom = panel_rect.mBottom - (S32)(ll_round(panel_spacing)) - mResizeBarOverlap;
cur_pos -= panel_visible_dim + panel_spacing;
}
@@ -1035,4 +1035,4 @@ LLView* LLLayoutPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLUICtrlFactor
panelp->setOrigin(0, 0);
return panelp;
}
}