Merge branch 'master' of https://github.com/AlericInglewood/SingularityViewer
This commit is contained in:
@@ -61,17 +61,13 @@ BOOL LLMemory::sEnableMemoryFailurePrevention = FALSE;
|
||||
LLPrivateMemoryPoolManager::mem_allocation_info_t LLPrivateMemoryPoolManager::sMemAllocationTracker;
|
||||
#endif
|
||||
|
||||
void ll_assert_aligned_func(uintptr_t ptr,U32 alignment)
|
||||
{
|
||||
#ifdef SHOW_ASSERT
|
||||
void singu_alignment_check_failed(void)
|
||||
{
|
||||
// Redundant, place to set breakpoints.
|
||||
if (ptr%alignment!=0)
|
||||
{
|
||||
llwarns << "alignment check failed" << llendl;
|
||||
}
|
||||
llassert(ptr%alignment==0);
|
||||
#endif
|
||||
llassert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
//static
|
||||
void LLMemory::initClass()
|
||||
|
||||
@@ -42,10 +42,32 @@ class LLMutex ;
|
||||
#define LL_CHECK_MEMORY
|
||||
#endif
|
||||
|
||||
LL_COMMON_API void ll_assert_aligned_func(uintptr_t ptr,U32 alignment);
|
||||
|
||||
//<singu>
|
||||
// ll_assert_aligned seems to only exist to set breakpoints in case an alignment check fails.
|
||||
// However, the implementation was horrible: the test was done using a integer modulo after
|
||||
// calling a function; which is like 500 times slower then the below. That turned out to be
|
||||
// significant compared to CPU cycles used to do vector calculations in side of which this test
|
||||
// is used.
|
||||
//
|
||||
// This implementation uses a faster, inlined test, and then still calls a function when
|
||||
// that fails to set a break point there if needed.
|
||||
//
|
||||
// This uses the fact that 'alignment' is literal int (aka, '16' or '64') that is a power of two.
|
||||
// As a result, the modulo is converted by the compiler to a logical AND with alignment-1, what
|
||||
// it cannot do if you don't inline the test.
|
||||
#ifdef SHOW_ASSERT
|
||||
#define ll_assert_aligned(ptr,alignment) ll_assert_aligned_func(reinterpret_cast<uintptr_t>(ptr),((U32)alignment))
|
||||
LL_COMMON_API void singu_alignment_check_failed(void);
|
||||
|
||||
#define ll_assert_aligned(ptr,alignment) \
|
||||
do \
|
||||
{ \
|
||||
if (LL_UNLIKELY(reinterpret_cast<intptr_t>(ptr) % alignment)) \
|
||||
{ \
|
||||
singu_alignment_check_failed(); \
|
||||
} \
|
||||
} \
|
||||
while(0)
|
||||
//</singu>
|
||||
#else
|
||||
#define ll_assert_aligned(ptr,alignment)
|
||||
#endif
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
//
|
||||
const char* DEFAULT_DESC = "(No Description)";
|
||||
const F32 DELAY_BEFORE_SHOW_TIP = 0.35f;
|
||||
const F32 DELAY_BEFORE_REFRESH_TIP = 0.50f;
|
||||
|
||||
//
|
||||
// Local globals
|
||||
@@ -113,6 +114,9 @@ LLHoverView::LLHoverView(const std::string& name, const LLRect& rect)
|
||||
mUseHover = TRUE;
|
||||
mTyping = FALSE;
|
||||
mHoverOffset.clearVec();
|
||||
//<singu>
|
||||
mLastTextHoverObject = NULL;
|
||||
//</singu>
|
||||
}
|
||||
|
||||
LLHoverView::~LLHoverView()
|
||||
@@ -139,6 +143,9 @@ void LLHoverView::updateHover(LLTool* current_tool)
|
||||
mStartHoverPickTimer = TRUE;
|
||||
// Clear the existing text so that we do not briefly show the wrong data.
|
||||
mText.clear();
|
||||
//<singu>
|
||||
mLastTextHoverObject = NULL;
|
||||
//</singu>
|
||||
}
|
||||
|
||||
if (mDoneHoverPick)
|
||||
@@ -222,6 +229,18 @@ void LLHoverView::updateText()
|
||||
LLViewerObject* hit_object = getLastHoverObject();
|
||||
std::string line;
|
||||
|
||||
//<singu>
|
||||
if (hit_object == mLastTextHoverObject &&
|
||||
!(mLastTextHoverObjectTimer.getStarted() && mLastTextHoverObjectTimer.hasExpired()))
|
||||
{
|
||||
// mText is already up to date.
|
||||
return;
|
||||
}
|
||||
mLastTextHoverObject = hit_object;
|
||||
mLastTextHoverObjectTimer.stop();
|
||||
bool retrieving_data = false;
|
||||
//</singu>
|
||||
|
||||
mText.clear();
|
||||
if ( hit_object )
|
||||
{
|
||||
@@ -403,6 +422,7 @@ void LLHoverView::updateText()
|
||||
else
|
||||
{
|
||||
line.append(LLTrans::getString("RetrievingData"));
|
||||
retrieving_data = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -417,12 +437,14 @@ void LLHoverView::updateText()
|
||||
else
|
||||
{
|
||||
line.append(LLTrans::getString("RetrievingData"));
|
||||
retrieving_data = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
line.append(LLTrans::getString("RetrievingData"));
|
||||
retrieving_data = true;
|
||||
}
|
||||
mText.push_back(line);
|
||||
|
||||
@@ -514,6 +536,7 @@ void LLHoverView::updateText()
|
||||
{
|
||||
LLStringUtil::format_map_t args;
|
||||
args["[MESSAGE]"] = LLTrans::getString("RetrievingData");
|
||||
retrieving_data = true;
|
||||
line.append(LLTrans::getString("TooltipForSaleMsg", args));
|
||||
}
|
||||
mText.push_back(line);
|
||||
@@ -604,6 +627,7 @@ void LLHoverView::updateText()
|
||||
else
|
||||
{
|
||||
line.append(LLTrans::getString("RetrievingData"));
|
||||
retrieving_data = true;
|
||||
}
|
||||
}
|
||||
else if(gCacheName->getFullName(owner, name))
|
||||
@@ -616,11 +640,13 @@ void LLHoverView::updateText()
|
||||
else
|
||||
{
|
||||
line.append(LLTrans::getString("RetrievingData"));
|
||||
retrieving_data = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
line.append(LLTrans::getString("RetrievingData"));
|
||||
retrieving_data = true;
|
||||
}
|
||||
mText.push_back(line);
|
||||
|
||||
@@ -699,8 +725,15 @@ void LLHoverView::updateText()
|
||||
mText.push_back(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//<singu>
|
||||
if (retrieving_data)
|
||||
{
|
||||
// Keep doing this twice per second, until all data was retrieved.
|
||||
mLastTextHoverObjectTimer.start(DELAY_BEFORE_REFRESH_TIP);
|
||||
}
|
||||
//</singu>
|
||||
}
|
||||
|
||||
void LLHoverView::draw()
|
||||
{
|
||||
|
||||
@@ -105,6 +105,8 @@ protected:
|
||||
|
||||
// If not null and not dead, we're over an object.
|
||||
LLPointer<LLViewerObject> mLastHoverObject;
|
||||
LLViewerObject* mLastTextHoverObject; // Singu extension: the value of mLastHoverObject that corresponds to mText.
|
||||
LLFrameTimer mLastTextHoverObjectTimer; // Singu extension: times how long ago the text was updated (while retrieving data).
|
||||
LLPickInfo mLastPickInfo;
|
||||
|
||||
// If not LLVector3d::ZERO, we're over land.
|
||||
|
||||
Reference in New Issue
Block a user