Merge branch 'master' of ../singularity into future

Conflicts:
	indra/newview/llviewerparcelmgr.cpp
	indra/newview/llviewerregion.cpp
This commit is contained in:
Siana Gearz
2011-08-18 19:41:27 +02:00
35 changed files with 265 additions and 226 deletions

View File

@@ -249,15 +249,6 @@ LLSD LLApp::getOptionData(OptionPriority level)
return mOptions[level];
}
void LLApp::stepFrame()
{
LLFrameTimer::updateFrameTime();
LLFrameTimer::updateFrameCount();
LLEventTimer::updateClass();
mRunner.run();
}
void LLApp::setupErrorHandling()
{
// Error handling is done by starting up an error handling thread, which just sleeps and

View File

@@ -236,17 +236,6 @@ public:
pid_t fork();
#endif
/**
* @brief Get a reference to the application runner
*
* Please use the runner with caution. Since the Runner usage
* pattern is not yet clear, this method just gives access to it
* to add and remove runnables.
* @return Returns the application runner. Do not save the
* pointer past the caller's stack frame.
*/
LLRunner& getRunner() { return mRunner; }
public:
typedef std::map<std::string, std::string> string_map;
string_map mOptionMap; // Contains all command-line options and arguments in a map
@@ -264,11 +253,6 @@ protected:
static LLAppChildCallback sDefaultChildCallback;
#endif
/**
* @brief This method is called once a frame to do once a frame tasks.
*/
void stepFrame();
/**
* @ brief This method is called once as soon as logging is initialized.
*/
@@ -289,9 +273,6 @@ private:
// Default application threads
LLErrorThread* mThreadErrorp; // Waits for app to go to status ERROR, then runs the error callback
// This is the application level runnable scheduler.
LLRunner mRunner;
/** @name Runtime option implementation */
//@{

View File

@@ -4,6 +4,7 @@
* $LicenseInfo:firstyear=2002&license=viewergpl$
*
* Copyright (c) 2002-2009, Linden Research, Inc.
* Copyright (c) 2011, Aleric Inglewood.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
@@ -35,48 +36,55 @@
#include "llframetimer.h"
// Local constants.
static F64 const USEC_PER_SECOND = 1000000.0;
static F64 const USEC_TO_SEC_F64 = 0.000001;
// Static members
//LLTimer LLFrameTimer::sInternalTimer;
U64 LLFrameTimer::sStartTotalTime = totalTime();
F64 LLFrameTimer::sFrameTime = 0.0;
U64 LLFrameTimer::sTotalTime = 0;
F64 LLFrameTimer::sTotalSeconds = 0.0;
S32 LLFrameTimer::sFrameCount = 0;
U64 LLFrameTimer::sFrameDeltaTime = 0;
const F64 USEC_PER_SECOND = 1000000.0;
const F64 USEC_TO_SEC_F64 = 0.000001;
U64 const LLFrameTimer::sStartTotalTime = totalTime(); // Application start in microseconds since epoch.
U64 LLFrameTimer::sTotalTime = LLFrameTimer::sStartTotalTime; // Current time in microseconds since epoch, updated at least once per frame.
F64 LLFrameTimer::sTotalSeconds = // Current time in seconds since epoch, updated together with LLFrameTimer::sTotalTime.
U64_to_F64(LLFrameTimer::sTotalTime) * USEC_TO_SEC_F64;
F64 LLFrameTimer::sFrameTime = 0.0; // Current time in seconds since application start, updated together with LLFrameTimer::sTotalTime.
// Updated exactly once per frame:
S32 LLFrameTimer::sFrameCount = 0; // Current frame number (number of frames since application start).
U64 LLFrameTimer::sPrevTotalTime = LLFrameTimer::sStartTotalTime; // Previous (frame) time in microseconds since epoch, updated once per frame.
U64 LLFrameTimer::sFrameDeltaTime = 0; // Microseconds between last two calls to LLFrameTimer::updateFrameTimeAndCount.
// static
void LLFrameTimer::updateFrameTime()
{
U64 total_time = totalTime();
sFrameDeltaTime = total_time - sTotalTime;
sTotalTime = total_time;
sTotalTime = totalTime();
sTotalSeconds = U64_to_F64(sTotalTime) * USEC_TO_SEC_F64;
sFrameTime = U64_to_F64(sTotalTime - sStartTotalTime) * USEC_TO_SEC_F64;
}
void LLFrameTimer::start()
// static
void LLFrameTimer::updateFrameTimeAndCount()
{
reset();
mStarted = TRUE;
updateFrameTime();
sFrameDeltaTime = sTotalTime - sPrevTotalTime;
sPrevTotalTime = sTotalTime;
++sFrameCount;
}
void LLFrameTimer::reset(F32 expiration)
{
llassert(!mPaused);
mStartTime = sFrameTime;
mExpiry = sFrameTime + expiration;
}
void LLFrameTimer::start(F32 expiration)
{
reset(expiration);
mRunning = true; // Start, if not already started.
}
void LLFrameTimer::stop()
{
mStarted = FALSE;
}
void LLFrameTimer::reset()
{
mStartTime = sFrameTime;
mExpiry = sFrameTime;
}
void LLFrameTimer::resetWithExpiry(F32 expiration)
{
reset();
setTimerExpirySec(expiration);
llassert(!mPaused);
mRunning = false;
}
// Don't combine pause/unpause with start/stop
@@ -89,25 +97,31 @@ void LLFrameTimer::resetWithExpiry(F32 expiration)
// Note: elapsed would also be valid with no unpause() call (= time run until pause() called)
void LLFrameTimer::pause()
{
if (mStarted)
mStartTime = sFrameTime - mStartTime; // save dtime
mStarted = FALSE;
if (!mPaused)
{
mStartTime = sFrameTime - mStartTime; // Abuse mStartTime to store the elapsed time so far.
}
mPaused = true;
}
void LLFrameTimer::unpause()
{
if (!mStarted)
mStartTime = sFrameTime - mStartTime; // restore dtime
mStarted = TRUE;
if (mPaused)
{
mStartTime = sFrameTime - mStartTime; // Set mStartTime consistent with the elapsed time so far.
}
mPaused = false;
}
void LLFrameTimer::setTimerExpirySec(F32 expiration)
{
mExpiry = expiration + mStartTime;
llassert(!mPaused);
mExpiry = mStartTime + expiration;
}
void LLFrameTimer::setExpiryAt(F64 seconds_since_epoch)
{
llassert(!mPaused);
mStartTime = sFrameTime;
mExpiry = seconds_since_epoch - (USEC_TO_SEC_F64 * sStartTotalTime);
}
@@ -119,20 +133,14 @@ F64 LLFrameTimer::expiresAt() const
return expires_at;
}
BOOL LLFrameTimer::checkExpirationAndReset(F32 expiration)
bool LLFrameTimer::checkExpirationAndReset(F32 expiration)
{
//llinfos << "LLFrameTimer::checkExpirationAndReset()" << llendl;
//llinfos << " mStartTime:" << mStartTime << llendl;
//llinfos << " sFrameTime:" << sFrameTime << llendl;
//llinfos << " mExpiry: " << mExpiry << llendl;
if(hasExpired())
if (hasExpired())
{
reset();
setTimerExpirySec(expiration);
return TRUE;
reset(expiration);
return true;
}
return FALSE;
return false;
}
// static

View File

@@ -6,6 +6,7 @@
* $LicenseInfo:firstyear=2002&license=viewergpl$
*
* Copyright (c) 2002-2009, Linden Research, Inc.
* Copyright (c) 2011, Aleric Inglewood.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
@@ -37,7 +38,7 @@
/**
* *NOTE: Because of limitations on linux which we do not really have
* time to explore, the total time is derived from the frame time
* and is recsynchronized on every frame.
* and is resynchronized on every frame.
*/
#include "lltimer.h"
@@ -46,61 +47,64 @@
class LL_COMMON_API LLFrameTimer
{
public:
LLFrameTimer() : mStartTime( sFrameTime ), mExpiry(0), mStarted(TRUE) {}
// Create an LLFrameTimer and start it. After creation it is running and in the state expired (hasExpired will return true).
LLFrameTimer(void) : mStartTime(sFrameTime), mExpiry(0), mRunning(true), mPaused(false) { }
// Return the number of seconds since the start of this
// application instance.
// Return the number of seconds since the start of the application.
static F64 getElapsedSeconds()
{
// Loses msec precision after ~4.5 hours...
return sFrameTime;
}
// Return a low precision usec since epoch
// Return a low precision usec since epoch.
static U64 getTotalTime()
{
return sTotalTime ? sTotalTime : totalTime();
llassert(sTotalTime);
return sTotalTime;
}
// Return a low precision seconds since epoch
// Return a low precision seconds since epoch.
static F64 getTotalSeconds()
{
return sTotalSeconds;
}
// Call this method once per frame to update the current frame time. This is actually called
// at some other times as well
// Call this method once per frame to update the current frame time.
// This is actually called at some other times as well.
static void updateFrameTime();
// Call this method once, and only once, per frame to update the current frame count.
static void updateFrameCount() { sFrameCount++; }
// Call this method once, and only once, per frame to update the current frame count and sFrameDeltaTime.
static void updateFrameTimeAndCount();
static U32 getFrameCount() { return sFrameCount; }
// Return current frame number (the number of frames since application start).
static U32 getFrameCount() { return sFrameCount; }
static F32 getFrameDeltaTimeF32();
// Return duration of last frame in seconds.
static F32 getFrameDeltaTimeF32();
// Return seconds since the current frame started
static F32 getCurrentFrameTime();
static F32 getCurrentFrameTime();
// MANIPULATORS
void start();
void stop();
void reset();
void resetWithExpiry(F32 expiration);
void pause();
void unpause();
void reset(F32 expiration = 0.f); // Same as start() but leaves mRunning off when called after stop().
void start(F32 expiration = 0.f); // Reset and (re)start with expiration.
void stop(); // Stop running.
void pause(); // Mark elapsed time so far.
void unpause(); // Move 'start' time in order to decrement time between pause and unpause from ElapsedTime.
void setTimerExpirySec(F32 expiration);
void setExpiryAt(F64 seconds_since_epoch);
BOOL checkExpirationAndReset(F32 expiration);
F32 getElapsedTimeAndResetF32() { F32 t = F32(sFrameTime - mStartTime); reset(); return t; }
void setAge(const F64 age) { mStartTime = sFrameTime - age; }
bool checkExpirationAndReset(F32 expiration); // Returns true when expired. Only resets if expired.
F32 getElapsedTimeAndResetF32() { F32 t = getElapsedTimeF32(); reset(); return t; }
void setAge(const F64 age) { llassert(!mPaused); mStartTime = sFrameTime - age; }
// ACCESSORS
BOOL hasExpired() const { return (sFrameTime >= mExpiry); }
F32 getTimeToExpireF32() const { return (F32)(mExpiry - sFrameTime); }
F32 getElapsedTimeF32() const { return mStarted ? (F32)(sFrameTime - mStartTime) : (F32)mStartTime; }
BOOL getStarted() const { return mStarted; }
bool hasExpired() const { return sFrameTime >= mExpiry; }
F32 getElapsedTimeF32() const { llassert(mRunning); return mPaused ? (F32)mStartTime : (F32)(sFrameTime - mStartTime); }
bool getStarted() const { return mRunning; }
// return the seconds since epoch when this timer will expire.
F64 expiresAt() const;
@@ -114,45 +118,52 @@ protected:
// Aplication constants
//
// Start time of opp in usec since epoch
static U64 sStartTotalTime;
// Application start in microseconds since epoch.
static U64 const sStartTotalTime;
//
// Data updated per frame
//
// Seconds since application start
// Current time in seconds since application start, updated together with sTotalTime.
static F64 sFrameTime;
// Time that has elapsed since last call to updateFrameTime()
// Microseconds between last two calls to updateFrameTimeAndCount (time between last two frames).
static U64 sFrameDeltaTime;
// Total microseconds since epoch.
// Current time in microseconds since epoch, updated at least once per frame.
static U64 sTotalTime;
// Seconds since epoch.
// Previous (frame) time in microseconds since epoch, updated once per frame.
static U64 sPrevTotalTime;
// Current time in seconds since epoch, updated together with sTotalTime.
static F64 sTotalSeconds;
// Total number of frames elapsed in application
// Current frame number (number of frames since application start).
static S32 sFrameCount;
//
// Member data
//
// Number of seconds after application start when this timer was
// started. Set equal to sFrameTime when reset.
// When not paused (mPaused is false): number of seconds since application start,
// otherwise this value is equal to the accumulated run time (ElapsedTime).
// Set equal to sFrameTime when reset.
F64 mStartTime;
// Timer expires this many seconds after application start time.
// Timer expires when sFrameTime reaches this value (in seconds since application start).
F64 mExpiry;
// Useful bit of state usually associated with timers, but does
// not affect actual functionality
BOOL mStarted;
// True when running, merely a boolean return by getStarted(). The timer always runs.
bool mRunning;
// True when accumulating ElapsedTime. If false mStartTime has a different meaning
// and really unpause() should be called before anything else.
bool mPaused;
};
// Glue code for Havok (or anything else that doesn't want the full .h files)
extern F32 getCurrentFrameTime();
extern F32 getCurrentFrameTime();
#endif // LL_LLFRAMETIMER_H

View File

@@ -245,7 +245,7 @@ U8* LLImageBase::allocateDataSize(S32 width, S32 height, S32 ncomponents, S32 si
// LLImageRaw
//---------------------------------------------------------------------------
S32 LLImageRaw::sGlobalRawMemory = 0;
AITHREADSAFESIMPLE(S32, LLImageRaw::sGlobalRawMemory, );
S32 LLImageRaw::sRawImageCount = 0;
S32 LLImageRaw::sRawImageCachedCount = 0;
@@ -295,23 +295,25 @@ LLImageRaw::~LLImageRaw()
U8* LLImageRaw::allocateData(S32 size)
{
U8* res = LLImageBase::allocateData(size);
sGlobalRawMemory += getDataSize();
*AIAccess<S32>(sGlobalRawMemory) += getDataSize();
return res;
}
// virtual
U8* LLImageRaw::reallocateData(S32 size)
{
sGlobalRawMemory -= getDataSize();
S32 old_data_size = getDataSize();
U8* res = LLImageBase::reallocateData(size);
sGlobalRawMemory += getDataSize();
*AIAccess<S32>(sGlobalRawMemory) += getDataSize() - old_data_size;
return res;
}
// virtual
void LLImageRaw::deleteData()
{
sGlobalRawMemory -= getDataSize();
{
*AIAccess<S32>(sGlobalRawMemory) -= getDataSize();
}
LLImageBase::deleteData();
}
@@ -327,7 +329,7 @@ void LLImageRaw::setDataAndSize(U8 *data, S32 width, S32 height, S8 components)
LLImageBase::setSize(width, height, components) ;
LLImageBase::setDataAndSize(data, width * height * components) ;
sGlobalRawMemory += getDataSize();
*AIAccess<S32>(sGlobalRawMemory) += getDataSize();
}
BOOL LLImageRaw::resize(U16 width, U16 height, S8 components)

View File

@@ -37,6 +37,7 @@
#include "llstring.h"
#include "llmemory.h"
#include "llthread.h"
#include "aithreadsafe.h"
const S32 MIN_IMAGE_MIP = 2; // 4x4, only used for expand/contract power of 2
const S32 MAX_IMAGE_MIP = 11; // 2048x2048
@@ -241,7 +242,7 @@ protected:
void setDataAndSize(U8 *data, S32 width, S32 height, S8 components) ;
public:
static S32 sGlobalRawMemory;
static AIThreadSafeSimple<S32> sGlobalRawMemory;
static S32 sRawImageCount;
static S32 sRawImageCachedCount;

View File

@@ -1147,9 +1147,7 @@ void LLPumpIO::LLChainInfo::setTimeoutSeconds(F32 timeout)
LLMemType m1(LLMemType::MTYPE_IO_PUMP);
if(timeout > 0.0f)
{
mTimer.start();
mTimer.reset();
mTimer.setTimerExpirySec(timeout);
mTimer.start(timeout);
}
else
{

View File

@@ -349,8 +349,7 @@ bool LLAlertDialog::show()
if(mDefaultOption >= 0)
{
// delay before enabling default button
mDefaultBtnTimer.start();
mDefaultBtnTimer.setTimerExpirySec(DEFAULT_BUTTON_DELAY);
mDefaultBtnTimer.start(DEFAULT_BUTTON_DELAY);
}
// attach to floater if necessary

View File

@@ -858,8 +858,7 @@ BOOL LLLineEditor::handleHover(S32 x, S32 y, MASK mask)
if (mScrollTimer.hasExpired())
{
S32 increment = llround(mScrollTimer.getElapsedTimeF32() / AUTO_SCROLL_TIME);
mScrollTimer.reset();
mScrollTimer.setTimerExpirySec(AUTO_SCROLL_TIME);
mScrollTimer.reset(AUTO_SCROLL_TIME);
if( (x < mMinHPixels) && (mScrollHPos > 0 ) )
{
// Scroll to the left

View File

@@ -630,49 +630,59 @@ LLXMLNodePtr LLTabContainer::getXML(bool save_children) const
// virtual
BOOL LLTabContainer::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType type, void* cargo_data, EAcceptance *accept, std::string &tooltip)
{
BOOL has_scroll_arrows = (getMaxScrollPos() > 0);
bool const has_scroll_arrows = (getMaxScrollPos() > 0);
if( mDragAndDropDelayTimer.getElapsedTimeF32() > SCROLL_DELAY_TIME )
LLButton* button = NULL;
if (has_scroll_arrows)
{
if (has_scroll_arrows)
// We're dragging an inventory item. Check if we're hovering over scroll arrows of this tab container.
if (mJumpPrevArrowBtn && mJumpPrevArrowBtn->getRect().pointInRect(x, y))
{
if (mJumpPrevArrowBtn && mJumpPrevArrowBtn->getRect().pointInRect(x, y))
button = mJumpPrevArrowBtn;
}
else if (mJumpNextArrowBtn && mJumpNextArrowBtn->getRect().pointInRect(x, y))
{
button = mJumpNextArrowBtn;
}
else if (mPrevArrowBtn->getRect().pointInRect(x, y))
{
button = mPrevArrowBtn;
}
else if (mNextArrowBtn->getRect().pointInRect(x, y))
{
button = mNextArrowBtn;
}
if (button)
{
if (mDragAndDropDelayTimer.getStarted() && mDragAndDropDelayTimer.hasExpired())
{
S32 local_x = x - mJumpPrevArrowBtn->getRect().mLeft;
S32 local_y = y - mJumpPrevArrowBtn->getRect().mBottom;
mJumpPrevArrowBtn->handleHover(local_x, local_y, mask);
// We've been hovering (another) SCROLL_DELAY_TIME seconds. Emulate a button press.
button->onCommit();
// Reset the timer.
mDragAndDropDelayTimer.start(SCROLL_DELAY_TIME);
}
if (mJumpNextArrowBtn && mJumpNextArrowBtn->getRect().pointInRect(x, y))
else if (!mDragAndDropDelayTimer.getStarted())
{
S32 local_x = x - mJumpNextArrowBtn->getRect().mLeft;
S32 local_y = y - mJumpNextArrowBtn->getRect().mBottom;
mJumpNextArrowBtn->handleHover(local_x, local_y, mask);
}
if (mPrevArrowBtn->getRect().pointInRect(x, y))
{
S32 local_x = x - mPrevArrowBtn->getRect().mLeft;
S32 local_y = y - mPrevArrowBtn->getRect().mBottom;
mPrevArrowBtn->handleHover(local_x, local_y, mask);
}
else if (mNextArrowBtn->getRect().pointInRect(x, y))
{
S32 local_x = x - mNextArrowBtn->getRect().mLeft;
S32 local_y = y - mNextArrowBtn->getRect().mBottom;
mNextArrowBtn->handleHover(local_x, local_y, mask);
// We just entered the arrow. Start the timer.
mDragAndDropDelayTimer.start(SCROLL_DELAY_TIME);
}
}
for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter)
else
{
LLTabTuple* tuple = *iter;
tuple->mButton->setVisible( TRUE );
S32 local_x = x - tuple->mButton->getRect().mLeft;
S32 local_y = y - tuple->mButton->getRect().mBottom;
if (tuple->mButton->pointInView(local_x, local_y) && tuple->mButton->getEnabled() && !tuple->mTabPanel->getVisible())
{
tuple->mButton->onCommit();
mDragAndDropDelayTimer.stop();
}
// We're not on an arrow or just left it. Stop the time (in case it was running).
mDragAndDropDelayTimer.stop();
}
}
for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter)
{
LLTabTuple* tuple = *iter;
tuple->mButton->setVisible( TRUE );
S32 local_x = x - tuple->mButton->getRect().mLeft;
S32 local_y = y - tuple->mButton->getRect().mBottom;
if (tuple->mButton->pointInView(local_x, local_y) && tuple->mButton->getEnabled() && !tuple->mTabPanel->getVisible())
{
tuple->mButton->onCommit();
}
}
@@ -1849,5 +1859,3 @@ void LLTabContainer::commitHoveredButton(S32 x, S32 y)
}
}

View File

@@ -233,15 +233,14 @@ void LLTextParser::loadKeywords()
bool LLTextParser::saveToDisk(LLSD highlights)
{
mHighlights=highlights;
std::string filename=getFileName();
if (filename.empty())
if (gDirUtilp->getLindenUserDir(true).empty())
{
llwarns << "LLTextParser::saveToDisk() no valid user directory." << llendl;
return FALSE;
// User didn't login, so nothing to save.
return false;
}
llofstream file;
file.open(filename.c_str());
file.open(getFileName().c_str());
LLSDSerialize::toPrettyXML(mHighlights, file);
file.close();
return TRUE;
return true;
}

View File

@@ -167,7 +167,7 @@ bool LLPidLockFile::requestLock(LLNameTable<void *> *name_table, bool autosave,
if (!mWaiting) //Not presently waiting to save. Queue up.
{
mTimer.resetWithExpiry(timeout);
mTimer.reset(timeout);
mWaiting=TRUE;
}

View File

@@ -1232,6 +1232,7 @@ set_source_files_properties(${viewer_XUI_FILES}
list(APPEND viewer_SOURCE_FILES ${viewer_XUI_FILES})
set(viewer_APPSETTINGS_FILES
viewer_manifest.py
app_settings/anim.ini
app_settings/cmd_line.xml
app_settings/grass.xml

View File

@@ -3545,8 +3545,7 @@ void LLAppViewer::idle()
// Update frame timers
static LLTimer idle_timer;
LLFrameTimer::updateFrameTime();
LLFrameTimer::updateFrameCount();
LLFrameTimer::updateFrameTimeAndCount();
LLEventTimer::updateClass();
LLCriticalDamp::updateInterpolants();
LLMortician::updateClass();

View File

@@ -456,6 +456,14 @@ void LLConsole::Paragraph::updateLines(F32 screen_width, LLFontGL* font, bool fo
LLConsole::Paragraph::Paragraph (LLWString str, const LLColor4 &color, F32 add_time)
: mParagraphText(str), mAddTime(add_time), mMaxWidth(-1)
{
makeParagraphColorSegments(color);
// Only call makeParagraphColorSegments if the user logged in already (we come
// here before he logged in when they disabled login/logout screens).
// Otherwise makeParagraphColorSegments calls LLTextParser::getInstance() which
// causes a one-time initialization by reading highlights.xml, which fails
// when not logged in because it's per account.
if (!gDirUtilp->getLindenUserDir(true).empty())
{
makeParagraphColorSegments(color);
}
}

View File

@@ -91,7 +91,7 @@ LLSpeaker::LLSpeaker(const LLUUID& id, const std::string& name, const ESpeakerTy
gVoiceClient->setUserVolume(id, LLMuteList::getInstance()->getSavedResidentVolume(id));
mActivityTimer.resetWithExpiry(SPEAKER_TIMEOUT);
mActivityTimer.reset(SPEAKER_TIMEOUT);
}
@@ -1021,7 +1021,7 @@ LLPointer<LLSpeaker> LLSpeakerMgr::setSpeaker(const LLUUID& id, const std::strin
{
// keep highest priority status (lowest value) instead of overriding current value
speakerp->mStatus = llmin(speakerp->mStatus, status);
speakerp->mActivityTimer.resetWithExpiry(SPEAKER_TIMEOUT);
speakerp->mActivityTimer.reset(SPEAKER_TIMEOUT);
// RN: due to a weird behavior where IMs from attached objects come from the wearer's agent_id
// we need to override speakers that we think are objects when we find out they are really
// residents
@@ -1329,7 +1329,7 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update)
{
speakerp->mStatus = LLSpeaker::STATUS_NOT_IN_CHANNEL;
speakerp->mDotColor = INACTIVE_COLOR;
speakerp->mActivityTimer.resetWithExpiry(SPEAKER_TIMEOUT);
speakerp->mActivityTimer.reset(SPEAKER_TIMEOUT);
}
else if (agent_data["transition"].asString() == "ENTER")
{
@@ -1377,7 +1377,7 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update)
{
speakerp->mStatus = LLSpeaker::STATUS_NOT_IN_CHANNEL;
speakerp->mDotColor = INACTIVE_COLOR;
speakerp->mActivityTimer.resetWithExpiry(SPEAKER_TIMEOUT);
speakerp->mActivityTimer.reset(SPEAKER_TIMEOUT);
}
else if ( agent_transition == "ENTER")
{
@@ -1476,7 +1476,7 @@ void LLLocalSpeakerMgr::updateSpeakerList()
{
speakerp->mStatus = LLSpeaker::STATUS_NOT_IN_CHANNEL;
speakerp->mDotColor = INACTIVE_COLOR;
speakerp->mActivityTimer.resetWithExpiry(SPEAKER_TIMEOUT);
speakerp->mActivityTimer.reset(SPEAKER_TIMEOUT);
}
}
}

View File

@@ -497,6 +497,10 @@ void LLFloaterChat::addChat(const LLChat& chat,
//static
void LLFloaterChat::triggerAlerts(const std::string& text)
{
// Cannot instantiate LLTextParser before logging in.
if (gDirUtilp->getLindenUserDir(true).empty())
return;
LLTextParser* parser = LLTextParser::getInstance();
// bool spoken=FALSE;
for (S32 i=0;i<parser->mHighlights.size();i++)

View File

@@ -229,7 +229,6 @@ LLSnapshotLivePreview::LLSnapshotLivePreview (const LLRect& rect) :
mSnapshotBufferType(LLViewerWindow::SNAPSHOT_TYPE_COLOR)
{
setSnapshotQuality(gSavedSettings.getS32("SnapshotQuality"));
mSnapshotDelayTimer.setTimerExpirySec(0.0f);
mSnapshotDelayTimer.start();
// gIdleCallbacks.addFunction( &LLSnapshotLivePreview::onIdle, (void*)this );
sList.insert(this);
@@ -350,8 +349,7 @@ void LLSnapshotLivePreview::updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail
mShineAnimTimer.stop();
if (new_snapshot)
{
mSnapshotDelayTimer.start();
mSnapshotDelayTimer.setTimerExpirySec(delay);
mSnapshotDelayTimer.start(delay);
}
if(new_thumbnail)
{
@@ -754,7 +752,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
// see if it's time yet to snap the shot and bomb out otherwise.
previewp->mSnapshotActive =
(previewp->mSnapshotDelayTimer.getStarted() && previewp->mSnapshotDelayTimer.hasExpired())
(previewp->mSnapshotDelayTimer.getStarted() && previewp->mSnapshotDelayTimer.hasExpired())
&& !LLToolCamera::getInstance()->hasMouseCapture(); // don't take snapshots while ALT-zoom active
if ( ! previewp->mSnapshotActive)
{

View File

@@ -502,17 +502,26 @@ void LLFloaterWorldMap::draw()
getDragHandle()->setMouseOpaque(TRUE);
//RN: snaps to zoom value because interpolation caused jitter in the text rendering
if (!mZoomTimer.getStarted() && mCurZoomVal != (F32)childGetValue("zoom slider").asReal())
F32 interp = 1.f;
if (!mZoomTimer.getStarted())
{
mZoomTimer.start();
mCurZoomValInterpolationStart = mCurZoomVal;
if (mCurZoomVal < (F32)childGetValue("zoom slider").asReal())
{
mZoomTimer.start();
}
}
F32 interp = mZoomTimer.getElapsedTimeF32() / MAP_ZOOM_TIME;
if (interp > 1.f)
if (mZoomTimer.getStarted())
{
interp = mZoomTimer.getElapsedTimeF32() / MAP_ZOOM_TIME;
}
if (interp >= 1.f)
{
interp = 1.f;
mZoomTimer.stop();
}
mCurZoomVal = lerp(mCurZoomVal, (F32)childGetValue("zoom slider").asReal(), interp);
// Interpolate between mCurZoomValInterpolationStart and "zoom slider".
mCurZoomVal = lerp(mCurZoomValInterpolationStart, (F32)childGetValue("zoom slider").asReal(), interp);
F32 map_scale = 256.f*pow(2.f, mCurZoomVal);
LLWorldMapView::setScale( map_scale );

View File

@@ -164,6 +164,7 @@ protected:
// Sets sMapScale, in pixels per region
F32 mCurZoomVal;
F32 mCurZoomValInterpolationStart; // Used during mZoomTimer interpolation.
LLFrameTimer mZoomTimer;
LLDynamicArray<LLUUID> mLandmarkAssetIDList;

View File

@@ -396,9 +396,8 @@ void LLPanelMediaHUD::updateShape()
}
}
// If we need to start fading the UI (and we have not already started)
else if(! mFadeTimer.getStarted())
else if (!mFadeTimer.getStarted())
{
mFadeTimer.reset();
mFadeTimer.start();
}
}

View File

@@ -446,8 +446,7 @@ void LLPreviewTexture::onFileLoadedForSave(BOOL success,
}
else
{
self->mSavedFileTimer.reset();
self->mSavedFileTimer.setTimerExpirySec( SECONDS_TO_SHOW_FILE_SAVED_MSG );
self->mSavedFileTimer.reset(SECONDS_TO_SHOW_FILE_SAVED_MSG);
}
self->mSaveFileName.clear();

View File

@@ -683,8 +683,7 @@ void LLStatusBar::setBalance(S32 balance)
if( balance != mBalance )
{
mBalanceTimer->reset();
mBalanceTimer->setTimerExpirySec( ICON_TIMER_EXPIRY );
mBalanceTimer->reset(ICON_TIMER_EXPIRY);
mBalance = balance;
}
}
@@ -728,8 +727,7 @@ void LLStatusBar::setHealth(S32 health)
}
}
mHealthTimer->reset();
mHealthTimer->setTimerExpirySec( ICON_TIMER_EXPIRY );
mHealthTimer->reset(ICON_TIMER_EXPIRY);
}
mHealth = health;

View File

@@ -421,12 +421,16 @@ void LLGLTexMemBar::draw()
std::string text;
S32 global_raw_memory;
{
global_raw_memory = *AIAccess<S32>(LLImageRaw::sGlobalRawMemory);
}
text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB Raw Tot: %d MB Bias: %.2f Cache: %.1f/%.1f MB Net Tot Tex: %.1f MB Tot Obj: %.1f MB",
total_mem,
max_total_mem,
bound_mem,
max_bound_mem,
LLImageRaw::sGlobalRawMemory >> 20, discard_bias,
global_raw_memory >> 20, discard_bias,
cache_usage, cache_max_usage, total_texture_downloaded, total_object_downloaded);
//, cache_entries, cache_max_entries

View File

@@ -390,7 +390,7 @@ LLViewerInventoryCategory::LLViewerInventoryCategory(const LLUUID& uuid,
mVersion(LLViewerInventoryCategory::VERSION_UNKNOWN),
mDescendentCount(LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN)
{
mDescendentsRequested.reset();
mDescendentsRequested.stop();
}
LLViewerInventoryCategory::LLViewerInventoryCategory(const LLUUID& owner_id) :
@@ -398,7 +398,7 @@ LLViewerInventoryCategory::LLViewerInventoryCategory(const LLUUID& owner_id) :
mVersion(LLViewerInventoryCategory::VERSION_UNKNOWN),
mDescendentCount(LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN)
{
mDescendentsRequested.reset();
mDescendentsRequested.stop();
}
LLViewerInventoryCategory::LLViewerInventoryCategory(const LLViewerInventoryCategory* other)
@@ -489,12 +489,12 @@ bool LLViewerInventoryCategory::fetchDescendents()
// <edit>
if((mUUID == gSystemFolderRoot) || (gInventory.isObjectDescendentOf(mUUID, gSystemFolderRoot))) return false;
// </edit>
if((VERSION_UNKNOWN == mVersion)
&& mDescendentsRequested.hasExpired()) //Expired check prevents multiple downloads.
if (VERSION_UNKNOWN == mVersion &&
(!mDescendentsRequested.getStarted() ||
mDescendentsRequested.hasExpired())) // Expired check prevents multiple downloads.
{
const F32 FETCH_TIMER_EXPIRY = 10.0f;
mDescendentsRequested.reset();
mDescendentsRequested.setTimerExpirySec(FETCH_TIMER_EXPIRY);
mDescendentsRequested.start(FETCH_TIMER_EXPIRY);
// bitfield
// 1 = by date

View File

@@ -72,10 +72,6 @@
#include "llsdserialize.h"
#include "llviewerparcelmgr.h"
// Viewer object cache version, change if object update
// format changes. JC
const U32 INDRA_OBJECT_CACHE_VERSION = 14;
extern BOOL gNoRender;
#ifdef LL_WINDOWS

View File

@@ -362,12 +362,16 @@ void reset_statistics()
void output_statistics(void*)
{
S32 global_raw_memory;
{
global_raw_memory = *AIAccess<S32>(LLImageRaw::sGlobalRawMemory);
}
llinfos << "Number of orphans: " << gObjectList.getOrphanCount() << llendl;
llinfos << "Number of dead objects: " << gObjectList.mNumDeadObjects << llendl;
llinfos << "Num images: " << gTextureList.getNumImages() << llendl;
llinfos << "Texture usage: " << LLImageGL::sGlobalTextureMemoryInBytes << llendl;
llinfos << "Texture working set: " << LLImageGL::sBoundTextureMemoryInBytes << llendl;
llinfos << "Raw usage: " << LLImageRaw::sGlobalRawMemory << llendl;
llinfos << "Raw usage: " << global_raw_memory << llendl;
llinfos << "Formatted usage: " << LLImageFormatted::sGlobalFormattedMemory << llendl;
llinfos << "Zombie Viewer Objects: " << LLViewerObject::getNumZombieObjects() << llendl;
llinfos << "Number of lights: " << gPipeline.getLightCount() << llendl;

View File

@@ -608,11 +608,15 @@ void LLViewerTextureList::updateImages(F32 max_time)
{
LLAppViewer::getTextureFetch()->setTextureBandwidth(LLViewerStats::getInstance()->mTextureKBitStat.getMeanPerSec());
S32 global_raw_memory;
{
global_raw_memory = *AIAccess<S32>(LLImageRaw::sGlobalRawMemory);
}
sNumImagesStat.addValue(sNumImages);
sNumRawImagesStat.addValue(LLImageRaw::sRawImageCount);
sGLTexMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageGL::sGlobalTextureMemoryInBytes));
sGLBoundMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageGL::sBoundTextureMemoryInBytes));
sRawMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageRaw::sGlobalRawMemory));
sRawMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(global_raw_memory));
sFormattedMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageFormatted::sGlobalFormattedMemory));
updateImagesDecodePriorities();

View File

@@ -3964,7 +3964,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
}
//idle text
std::string idle_string;
if(!mIsSelf && mIdleTimer.getElapsedTimeF32() > 120 && gSavedSettings.getBOOL("AscentShowIdleTime"))
if(!mIsSelf && mIdleTimer.getElapsedTimeF32() > 120.f && gSavedSettings.getBOOL("AscentShowIdleTime"))
{
idle_string = getIdleTime();
}

View File

@@ -272,7 +272,7 @@ To use spellcheck, right-click a misspelled word
left="5" name="CmdDivisor" width="356"/>
<check_box bottom_delta="-24" enabled="true" follows="left|top" font="SansSerifSmall" height="16"
label="Highlight messages if any of they contain the terms" left="5" mouse_opaque="true"
label="Highlight messages if any of them contain the terms" left="5" mouse_opaque="true"
name="KeywordsOn" radio_style="false" width="270"/>
<text bottom_delta="-20" follows="left|top" font="SansSerifSmall" height="20" left="12"
name="keyword_txt1" width="512">

View File

@@ -13,8 +13,8 @@
width="400" />
<check_box bottom_delta="-20" control_name="AscentDisableTeleportScreens" enabled="true"
follows="left|top" font="SansSerifSmall" height="16" initial_value="true"
label="Show the Teleport progress screens" left="10"
tool_tip="If turned off, the viewer will not hide your UI while teleporting, allowing you to continue to read IMs."
label="Hide the Teleport progress screens" left="10"
tool_tip="If checked, the viewer will hide the teleport progress screen, allowing you to continue to read IMs."
mouse_opaque="true" name="disable_tp_screen_check" radio_style="false"
width="400" />
<check_box bottom_delta="-20" control_name="OptionPlayTpSound" enabled="true"
@@ -25,8 +25,8 @@
width="400" />
<check_box bottom_delta="-20" control_name="AscentDisableLogoutScreens" enabled="true"
follows="left|top" font="SansSerifSmall" height="16" initial_value="true"
label="Show the Login/Logout progress screens" left="10"
tool_tip="If turned off, the viewer does not hide the UI when logging in or out."
label="Hide the Login/Logout progress screens" left="10"
tool_tip="If checked, the viewer will hide the login/logout progress screen."
mouse_opaque="true" name="disable_logout_screen_check" radio_style="false"
width="400" />
</panel>

View File

@@ -40,7 +40,7 @@ struct AIRSData {
AIRSData(bool one_shot) : mOneShot(one_shot) { }
};
// A list of all statemachines registered for a particular event, and and API to work on it.
// A list of all statemachines registered for a particular event, and an API to work on it.
struct AIRegisteredStateMachines {
typedef std::map<AIStateMachine*, AIRSData> rsm_type;
rsm_type mRegisteredStateMachines;

View File

@@ -56,7 +56,7 @@ class AIEvent {
*
* This may be called for already unregistered events.
* This should be called from the destructor of a statemachine for any event it registers,
* as well as when it doesn't need the event anymore (in the case on non- one shot events).
* as well as when it doesn't need the event anymore (in the case of non- one shot events).
*
* @param event the event we want to no longer be notified off.
* @param statemachine the statemachine.

View File

@@ -88,7 +88,10 @@ void AIFetchInventoryFolder::initialize_impl(void)
mNeedNotifyObservers = false;
set_state(AIFetchInventoryFolder_checkFolderExists);
if (!gInventory.isInventoryUsable())
{
// This immediately calls this->idle(), and then when the event occurs cont().
AIEvent::Register(AIEvent::LLInventoryModel_mIsAgentInvUsable_true, this);
}
}
void AIFetchInventoryFolder::multiplex_impl(void)

View File

@@ -82,7 +82,7 @@ std::string AIFilePicker::get_folder(std::string const& default_path, std::strin
{
AIAccess<context_map_type> wContextMap(sContextMap);
context_map_type::iterator iter = wContextMap->find(context);
if (iter != wContextMap->end())
if (iter != wContextMap->end() && !iter->second.empty())
{
return iter->second;
}
@@ -91,22 +91,37 @@ std::string AIFilePicker::get_folder(std::string const& default_path, std::strin
LL_DEBUGS("Plugin") << "context \"" << context << "\" not found. Returning default_path \"" << default_path << "\"." << LL_ENDL;
return default_path;
}
else if ((iter = wContextMap->find("savefile")) != wContextMap->end())
else if ((iter = wContextMap->find("savefile")) != wContextMap->end() && !iter->second.empty())
{
LL_DEBUGS("Plugin") << "context \"" << context << "\" not found and default_path empty. Returning context \"savefile\": \"" << iter->second << "\"." << LL_ENDL;
return iter->second;
}
else
{
LL_DEBUGS("Plugin") << "context \"" << context << "\" not found, default_path empty and context \"savefile\" not found. Returning \"$HOME\"." << LL_ENDL;
// This is the last resort when all else failed. Open the file chooser in directory 'home'.
char const* home = NULL;
#if LL_WINDOWS
home = getenv("HOMEPATH");
char const* envname = "USERPROFILE";
#else
home = getenv("HOME");
char const* envname = "HOME";
#endif
return home ? home : "";
char const* home = getenv(envname);
if (!home || home[0] == '\0')
{
#if LL_WINDOWS
// On windows, the filepicker window won't pop up at all if we pass an empty string.
home = "C:\\";
#else
home = "/";
#endif
LL_DEBUGS("Plugin") << "context \"" << context << "\" not found, default_path empty, context \"savefile\" not found "
"and environment variable \"$" << envname << "\" empty! Returning \"" << home << "\"." << LL_ENDL;
}
else
{
LL_DEBUGS("Plugin") << "context \"" << context << "\" not found, default_path empty and context \"savefile\" not found. "
"Returning environment variable \"$" << envname << "\" (" << home << ")." << LL_ENDL;
}
return home;
}
}