From a8fb423e44ede5777a15cc6f7cfbd614795f6cf9 Mon Sep 17 00:00:00 2001 From: TighMacFanatic Date: Sun, 17 Jul 2011 17:04:33 -0400 Subject: [PATCH 01/22] Fix compile warning due to signed/unsigned mistake. --- indra/newview/lltexturefetch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 967d56b9d..ced122c78 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -479,7 +479,7 @@ static bool sgConnectionThrottle() { LLMutexLock lock(&mutex); const U32 THROTTLE_TIMESTEPS_PER_SECOND = 10; static const LLCachedControl max_connections_per_second("HTTPRequestRate", 30); - S32 max_connections = max_connections_per_second/THROTTLE_TIMESTEPS_PER_SECOND; + U32 max_connections = max_connections_per_second/THROTTLE_TIMESTEPS_PER_SECOND; const S32 timestep = USEC_PER_SEC/THROTTLE_TIMESTEPS_PER_SECOND; U64 now = LLTimer::getTotalTime(); std::deque timestamps; From 057a154a6da61bca8fa479af38a30b4caa3e33c5 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Fri, 29 Jul 2011 17:24:39 +0200 Subject: [PATCH 02/22] Minor documentation fixes. --- indra/newview/statemachine/aievent.cpp | 2 +- indra/newview/statemachine/aievent.h | 2 +- indra/newview/statemachine/aifetchinventoryfolder.cpp | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/indra/newview/statemachine/aievent.cpp b/indra/newview/statemachine/aievent.cpp index 0e7e9fa6e..ec2901932 100644 --- a/indra/newview/statemachine/aievent.cpp +++ b/indra/newview/statemachine/aievent.cpp @@ -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 rsm_type; rsm_type mRegisteredStateMachines; diff --git a/indra/newview/statemachine/aievent.h b/indra/newview/statemachine/aievent.h index a90a04aaf..34ecc4db3 100644 --- a/indra/newview/statemachine/aievent.h +++ b/indra/newview/statemachine/aievent.h @@ -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. diff --git a/indra/newview/statemachine/aifetchinventoryfolder.cpp b/indra/newview/statemachine/aifetchinventoryfolder.cpp index 3a3865a6e..c85001e8b 100644 --- a/indra/newview/statemachine/aifetchinventoryfolder.cpp +++ b/indra/newview/statemachine/aifetchinventoryfolder.cpp @@ -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) From d828f858c9b97b2c934ffb740c01fb7e8e298aa3 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Mon, 1 Aug 2011 21:00:27 +0200 Subject: [PATCH 03/22] LLFrameTimer review and resulting changes. This makes the class API a bit more sane, although only a bit, because I had to leave it working with possibly new code merged in from LL: the API can't really change. I also removed some unused code. While reviewing how LLFrameTimer worked however, I did find a few instances where things where broken: * sFrameDeltaTime wasn't correctly updated (more than once per frame and therefore erratic). This only influenced scrolling speed, but still. * While dragging an inventory item, the scroll arrows of a tab container didn't work (LLTabContainer::handleDragAndDrop). * Map zoom interpolation was broken (it interpolated between A and B, but used the already updated interpolation for A the next frame... (added mCurZoomValInterpolationStart). --- indra/llcommon/llapp.cpp | 9 -- indra/llcommon/llapp.h | 19 ---- indra/llcommon/llframetimer.cpp | 100 ++++++++++++---------- indra/llcommon/llframetimer.h | 95 +++++++++++--------- indra/llmessage/llpumpio.cpp | 4 +- indra/llui/llalertdialog.cpp | 3 +- indra/llui/lllineeditor.cpp | 3 +- indra/llui/lltabcontainer.cpp | 80 +++++++++-------- indra/llvfs/llpidlock.cpp | 2 +- indra/newview/llappviewer.cpp | 3 +- indra/newview/llfloateractivespeakers.cpp | 10 +-- indra/newview/llfloatersnapshot.cpp | 6 +- indra/newview/llfloaterworldmap.cpp | 19 ++-- indra/newview/llfloaterworldmap.h | 1 + indra/newview/llpanelmediahud.cpp | 3 +- indra/newview/llpreviewtexture.cpp | 3 +- indra/newview/llstatusbar.cpp | 6 +- indra/newview/llviewerinventory.cpp | 12 +-- indra/newview/llvoavatar.cpp | 2 +- 19 files changed, 189 insertions(+), 191 deletions(-) diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index c35a84255..59173eecd 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -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 diff --git a/indra/llcommon/llapp.h b/indra/llcommon/llapp.h index 05e2bccaf..09e88b326 100644 --- a/indra/llcommon/llapp.h +++ b/indra/llcommon/llapp.h @@ -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 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 */ //@{ diff --git a/indra/llcommon/llframetimer.cpp b/indra/llcommon/llframetimer.cpp index 138c67a36..d05b9875c 100644 --- a/indra/llcommon/llframetimer.cpp +++ b/indra/llcommon/llframetimer.cpp @@ -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 diff --git a/indra/llcommon/llframetimer.h b/indra/llcommon/llframetimer.h index f4775a992..e737a884e 100644 --- a/indra/llcommon/llframetimer.h +++ b/indra/llcommon/llframetimer.h @@ -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 diff --git a/indra/llmessage/llpumpio.cpp b/indra/llmessage/llpumpio.cpp index c50dcc876..7a10c0fa6 100644 --- a/indra/llmessage/llpumpio.cpp +++ b/indra/llmessage/llpumpio.cpp @@ -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 { diff --git a/indra/llui/llalertdialog.cpp b/indra/llui/llalertdialog.cpp index f708e220e..27700ca20 100644 --- a/indra/llui/llalertdialog.cpp +++ b/indra/llui/llalertdialog.cpp @@ -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 diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index fe4190a2b..328e62051 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -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 diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 1f94191d2..e1bf4d4aa 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -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) } } - - diff --git a/indra/llvfs/llpidlock.cpp b/indra/llvfs/llpidlock.cpp index 28cee2940..5df5eadbe 100644 --- a/indra/llvfs/llpidlock.cpp +++ b/indra/llvfs/llpidlock.cpp @@ -167,7 +167,7 @@ bool LLPidLockFile::requestLock(LLNameTable *name_table, bool autosave, if (!mWaiting) //Not presently waiting to save. Queue up. { - mTimer.resetWithExpiry(timeout); + mTimer.reset(timeout); mWaiting=TRUE; } diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 874a24643..3b1436474 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3501,8 +3501,7 @@ void LLAppViewer::idle() // Update frame timers static LLTimer idle_timer; - LLFrameTimer::updateFrameTime(); - LLFrameTimer::updateFrameCount(); + LLFrameTimer::updateFrameTimeAndCount(); LLEventTimer::updateClass(); LLCriticalDamp::updateInterpolants(); LLMortician::updateClass(); diff --git a/indra/newview/llfloateractivespeakers.cpp b/indra/newview/llfloateractivespeakers.cpp index a641ac69d..27d35c6bb 100644 --- a/indra/newview/llfloateractivespeakers.cpp +++ b/indra/newview/llfloateractivespeakers.cpp @@ -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 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); } } } diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index a60490da9..ad44c0bbd 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -228,7 +228,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); @@ -349,8 +348,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) { @@ -753,7 +751,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) { diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 716573d12..3ad43d037 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -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 ); diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h index 5c8c976d6..03baa3eef 100644 --- a/indra/newview/llfloaterworldmap.h +++ b/indra/newview/llfloaterworldmap.h @@ -164,6 +164,7 @@ protected: // Sets sMapScale, in pixels per region F32 mCurZoomVal; + F32 mCurZoomValInterpolationStart; // Used during mZoomTimer interpolation. LLFrameTimer mZoomTimer; LLDynamicArray mLandmarkAssetIDList; diff --git a/indra/newview/llpanelmediahud.cpp b/indra/newview/llpanelmediahud.cpp index 4b33ae6f2..b77ba15cb 100644 --- a/indra/newview/llpanelmediahud.cpp +++ b/indra/newview/llpanelmediahud.cpp @@ -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(); } } diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index e23e662ec..55a5ef6b0 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -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(); diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 50c8940a2..240d122f3 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -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; diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 6bb8be13f..4e4d56df1 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -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() // if((mUUID == gSystemFolderRoot) || (gInventory.isObjectDescendentOf(mUUID, gSystemFolderRoot))) return false; // - 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 diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index f219fe860..a36f5db00 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3817,7 +3817,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(); } From f54ca35d1bb1b7f7fab7fb1d4a7c4b908e88c9f2 Mon Sep 17 00:00:00 2001 From: TighMacFanatic Date: Tue, 2 Aug 2011 14:56:18 -0400 Subject: [PATCH 04/22] Fix label on disable TP and login screen options. --- .../default/xui/en-us/panel_preferences_ascent_vanity.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml index 5db045198..a34e943bf 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml @@ -13,8 +13,8 @@ width="400" /> From 27c91e25716722bab987814a75150d59f737fe55 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Tue, 2 Aug 2011 23:26:02 +0200 Subject: [PATCH 05/22] Don't instantiate LLTextParser::getInstance before user logged in. --- indra/llui/lltextparser.cpp | 11 +++++------ indra/newview/llconsole.cpp | 10 +++++++++- indra/newview/llfloaterchat.cpp | 4 ++++ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/indra/llui/lltextparser.cpp b/indra/llui/lltextparser.cpp index 707dd0afd..84c9e29a3 100644 --- a/indra/llui/lltextparser.cpp +++ b/indra/llui/lltextparser.cpp @@ -245,15 +245,14 @@ LLSD LLTextParser::loadFromDisk() 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; } diff --git a/indra/newview/llconsole.cpp b/indra/newview/llconsole.cpp index 937ccec24..db2d474b0 100644 --- a/indra/newview/llconsole.cpp +++ b/indra/newview/llconsole.cpp @@ -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); + } } diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index 88030b6b0..f9e99c6d6 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -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;imHighlights.size();i++) From 393ee9d3ebeee1ffa2320ee446c1342391731b3a Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Wed, 3 Aug 2011 17:36:21 +0200 Subject: [PATCH 06/22] This should fix the settings --- indra/newview/app_settings/settings_files.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings_files.xml b/indra/newview/app_settings/settings_files.xml index 6e52cfa24..ac304f759 100644 --- a/indra/newview/app_settings/settings_files.xml +++ b/indra/newview/app_settings/settings_files.xml @@ -81,7 +81,7 @@ PerAccount Name - settings_sg_per_account.xml + settings_per_account.xml From d255bfa6f7d47942d9f793808bb0cc85cc090526 Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Wed, 3 Aug 2011 17:40:06 +0200 Subject: [PATCH 07/22] Variable size region support, by RevolutionSmythe --- indra/llcommon/indra_constants.h | 5 +++++ indra/llinventory/llparcel.h | 1 + indra/llmessage/message_prehash.cpp | 2 ++ indra/llmessage/message_prehash.h | 2 ++ indra/llmessage/patch_code.cpp | 11 ++++++---- indra/llmessage/patch_code.h | 2 +- indra/llmessage/patch_dct.h | 2 +- indra/newview/llcloud.cpp | 2 +- indra/newview/llfloaterregioninfo.cpp | 9 ++++---- indra/newview/llglsandbox.cpp | 2 +- indra/newview/llstartup.cpp | 16 ++++++++++++-- indra/newview/llsurface.cpp | 20 ++++++++++++----- indra/newview/llviewermessage.cpp | 29 +++++++++++++++++++++++-- indra/newview/llviewerparcelmgr.cpp | 22 ++++++++++++------- indra/newview/llviewerparcelmgr.h | 2 ++ indra/newview/llviewerparceloverlay.cpp | 4 +++- indra/newview/llviewerparceloverlay.h | 1 + indra/newview/llviewerregion.cpp | 3 +++ indra/newview/llvlmanager.cpp | 28 +++++++++++++++++++----- indra/newview/llvlmanager.h | 1 + indra/newview/llvowater.cpp | 2 +- indra/newview/llwind.cpp | 4 ++-- indra/newview/llworld.cpp | 28 ++++++++++++++++++------ indra/newview/llworld.h | 6 ++--- 24 files changed, 155 insertions(+), 49 deletions(-) diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index a95b6499d..478c746b0 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -153,6 +153,11 @@ const char LAND_LAYER_CODE = 'L'; const char WATER_LAYER_CODE = 'W'; const char WIND_LAYER_CODE = '7'; const char CLOUD_LAYER_CODE = '8'; +// Extended land layer for Aurora Sim +const char AURORA_LAND_LAYER_CODE = 'M'; +const char AURORA_WATER_LAYER_CODE = 'X'; +const char AURORA_WIND_LAYER_CODE = '9'; +const char AURORA_CLOUD_LAYER_CODE = ':'; // keys // Bit masks for various keyboard modifier keys. diff --git a/indra/llinventory/llparcel.h b/indra/llinventory/llparcel.h index eb9c44e53..881a6feb7 100644 --- a/indra/llinventory/llparcel.h +++ b/indra/llinventory/llparcel.h @@ -67,6 +67,7 @@ const F32 PARCEL_PASS_HOURS_DEFAULT = 1.f; // Number of "chunks" in which parcel overlay data is sent // Chunk 0 = southern rows, entire width +// NOTE: NOT USABLE FOR VAR SIZED REGIONS! const S32 PARCEL_OVERLAY_CHUNKS = 4; // Bottom three bits are a color index for the land overlay diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp index 892547cab..855d1cccf 100644 --- a/indra/llmessage/message_prehash.cpp +++ b/indra/llmessage/message_prehash.cpp @@ -588,6 +588,8 @@ char* _PREHASH_LastName = LLMessageStringTable::getInstance()->getString("LastNa char* _PREHASH_From = LLMessageStringTable::getInstance()->getString("From"); char* _PREHASH_RoleChange = LLMessageStringTable::getInstance()->getString("RoleChange"); char* _PREHASH_Port = LLMessageStringTable::getInstance()->getString("Port"); +char* _PREHASH_RegionSizeX = LLMessageStringTable::getInstance()->getString("RegionSizeX"); +char* _PREHASH_RegionSizeY = LLMessageStringTable::getInstance()->getString("RegionSizeY"); char* _PREHASH_MemberTitle = LLMessageStringTable::getInstance()->getString("MemberTitle"); char* _PREHASH_LogParcelChanges = LLMessageStringTable::getInstance()->getString("LogParcelChanges"); char* _PREHASH_AgentCachedTextureResponse = LLMessageStringTable::getInstance()->getString("AgentCachedTextureResponse"); diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h index 4bf89e513..77cfe710a 100644 --- a/indra/llmessage/message_prehash.h +++ b/indra/llmessage/message_prehash.h @@ -588,6 +588,8 @@ extern char * _PREHASH_LastName; extern char * _PREHASH_From; extern char * _PREHASH_RoleChange; extern char * _PREHASH_Port; +extern char * _PREHASH_RegionSizeX; +extern char * _PREHASH_RegionSizeY; extern char * _PREHASH_MemberTitle; extern char * _PREHASH_LogParcelChanges; extern char * _PREHASH_AgentCachedTextureResponse; diff --git a/indra/llmessage/patch_code.cpp b/indra/llmessage/patch_code.cpp index 90fb23634..12ed19ea4 100644 --- a/indra/llmessage/patch_code.cpp +++ b/indra/llmessage/patch_code.cpp @@ -235,7 +235,7 @@ void decode_patch_group_header(LLBitPack &bitpack, LLGroupHeader *gopp) gPatchSize = gopp->patch_size; } -void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph) +void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, BOOL b_large_patch) { U8 retvalu8; @@ -274,15 +274,18 @@ void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph) #endif ph->range = retvalu16; - retvalu16 = 0; + retvalu32 = 0; #ifdef LL_BIG_ENDIAN ret = (U8 *)&retvalu16; bitpack.bitUnpack(&(ret[1]), 8); bitpack.bitUnpack(&(ret[0]), 2); #else - bitpack.bitUnpack((U8 *)&retvalu16, 10); + if (b_large_patch) + bitpack.bitUnpack((U8 *)&retvalu32, 32); + else + bitpack.bitUnpack((U8 *)&retvalu32, 10); #endif - ph->patchids = retvalu16; + ph->patchids = retvalu32; gWordBits = (ph->quant_wbits & 0xf) + 2; } diff --git a/indra/llmessage/patch_code.h b/indra/llmessage/patch_code.h index 82fa6bb62..dbfdf7059 100644 --- a/indra/llmessage/patch_code.h +++ b/indra/llmessage/patch_code.h @@ -46,7 +46,7 @@ void end_patch_coding(LLBitPack &bitpack); void init_patch_decoding(LLBitPack &bitpack); void decode_patch_group_header(LLBitPack &bitpack, LLGroupHeader *gopp); -void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph); +void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, BOOL b_large_patch); void decode_patch(LLBitPack &bitpack, S32 *patches); #endif diff --git a/indra/llmessage/patch_dct.h b/indra/llmessage/patch_dct.h index 663e146a8..ba21be711 100644 --- a/indra/llmessage/patch_dct.h +++ b/indra/llmessage/patch_dct.h @@ -79,7 +79,7 @@ public: F32 dc_offset; // 4 bytes U16 range; // 2 = 7 ((S16) FP range (breaks if we need > 32K meters in 1 patch) U8 quant_wbits; // 1 = 8 (upper 4 bits is quant - 2, lower 4 bits is word bits - 2) - U16 patchids; // 2 = 10 (actually only uses 10 bits, 5 for each) + U32 patchids; // 2 = 10 (actually only uses 10 bits, 5 for each) }; // Compression routines diff --git a/indra/newview/llcloud.cpp b/indra/newview/llcloud.cpp index ca35c3711..116d227cc 100644 --- a/indra/newview/llcloud.cpp +++ b/indra/newview/llcloud.cpp @@ -437,7 +437,7 @@ void LLCloudLayer::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp) group_headerp->stride = group_headerp->patch_size; // offset required to step up one row set_group_of_patch_header(group_headerp); - decode_patch_header(bitpack, &patch_header); + decode_patch_header(bitpack, &patch_header, FALSE); decode_patch(bitpack, gBuffer); decompress_patch(mDensityp, gBuffer, &patch_header); } diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index d91f4067b..8955eddb0 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -1089,10 +1089,11 @@ BOOL LLPanelRegionTextureInfo::sendUpdate() llinfos << "LLPanelRegionTextureInfo::sendUpdate()" << llendl; // Make sure user hasn't chosen wacky textures. - if (!validateTextureSizes()) - { - return FALSE; - } + // -Revolution Allow 'wacky' things + //if (!validateTextureSizes()) + //{ + // return FALSE; + //} LLTextureCtrl* texture_ctrl; std::string buffer; diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 092fdc6b5..5da3926b7 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -613,7 +613,7 @@ void LLViewerParcelMgr::renderOneSegment(F32 x1, F32 y1, F32 x2, F32 y2, F32 hei return; // HACK: At edge of last region of world, we need to make sure the region // resolves correctly so we can get a height value. - const F32 BORDER = REGION_WIDTH_METERS - 0.1f; + const F32 BORDER = regionp->getWidth() - 0.1f; F32 clamped_x1 = x1; F32 clamped_y1 = y1; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index f6f051fd1..bd69c300c 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -370,6 +370,8 @@ bool idle_startup() static U64 first_sim_handle = 0; static LLHost first_sim; static std::string first_sim_seed_cap; + static U32 first_sim_size_x = 256; + static U32 first_sim_size_y = 256; static LLVector3 initial_sun_direction(1.f, 0.f, 0.f); static LLVector3 agent_start_position_region(10.f, 10.f, 10.f); // default for when no space server @@ -1657,7 +1659,17 @@ bool idle_startup() U32 region_y = strtoul(region_y_str.c_str(), NULL, 10); first_sim_handle = to_region_handle(region_x, region_y); } - + + text = LLUserAuth::getInstance()->getResponse("region_size_x"); + if(!text.empty()) { + first_sim_size_x = strtoul(text.c_str(), NULL, 10); + LLViewerParcelMgr::getInstance()->init(first_sim_size_x); + } + + //region Y size is currently unused, major refactoring required. - Patrick Sapinski (2/10/2011) + text = LLUserAuth::getInstance()->getResponse("region_size_y"); + if(!text.empty()) first_sim_size_y = strtoul(text.c_str(), NULL, 10); + const std::string look_at_str = LLUserAuth::getInstance()->getResponse("look_at"); if (!look_at_str.empty()) { @@ -1946,7 +1958,7 @@ bool idle_startup() gAgent.initOriginGlobal(from_region_handle(first_sim_handle)); - LLWorld::getInstance()->addRegion(first_sim_handle, first_sim); + LLWorld::getInstance()->addRegion(first_sim_handle, first_sim, first_sim_size_x, first_sim_size_y); LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(first_sim_handle); LL_INFOS("AppInit") << "Adding initial simulator " << regionp->getOriginGlobal() << LL_ENDL; diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp index 9d718e88c..7a46305e4 100644 --- a/indra/newview/llsurface.cpp +++ b/indra/newview/llsurface.cpp @@ -299,7 +299,7 @@ void LLSurface::initTextures() mWaterObjp = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, mRegionp); gPipeline.createObject(mWaterObjp); LLVector3d water_pos_global = from_region_handle(mRegionp->getHandle()); - water_pos_global += LLVector3d(128.0, 128.0, DEFAULT_WATER_HEIGHT); + water_pos_global += LLVector3d(mRegionp->getWidth()/2, mRegionp->getWidth()/2, DEFAULT_WATER_HEIGHT); mWaterObjp->setPositionGlobal(water_pos_global); } } @@ -329,8 +329,8 @@ void LLSurface::setOriginGlobal(const LLVector3d &origin_global) // Hack! if (mWaterObjp.notNull() && mWaterObjp->mDrawable.notNull()) { - const F64 x = origin_global.mdV[VX] + 128.0; - const F64 y = origin_global.mdV[VY] + 128.0; + const F64 x = origin_global.mdV[VX] + (F64)mRegionp->getWidth()/2; + const F64 y = origin_global.mdV[VY] + (F64)mRegionp->getWidth()/2; const F64 z = mWaterObjp->getPositionGlobal().mdV[VZ]; LLVector3d water_origin_global(x, y, z); @@ -680,14 +680,22 @@ void LLSurface::decompressDCTPatch(LLBitPack &bitpack, LLGroupHeader *gopp, BOOL while (1) { - decode_patch_header(bitpack, &ph); + decode_patch_header(bitpack, &ph, b_large_patch); if (ph.quant_wbits == END_OF_PATCHES) { break; } - i = ph.patchids >> 5; - j = ph.patchids & 0x1F; + if (b_large_patch) + { + i = ph.patchids >> 16; //x + j = ph.patchids & 0xFFFF; //y + } + else + { + i = ph.patchids >> 5; //x + j = ph.patchids & 0x1F; //y + } if ((i >= mPatchesPerEdge) || (j >= mPatchesPerEdge)) { diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 5eb4096de..5c04026a2 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3718,6 +3718,18 @@ void process_teleport_finish(LLMessageSystem* msg, void**) U32 teleport_flags; msg->getU32Fast(_PREHASH_Info, _PREHASH_TeleportFlags, teleport_flags); + U32 region_size_x = 256; + msg->getU32Fast(_PREHASH_Info, _PREHASH_RegionSizeX, region_size_x); + + U32 region_size_y = 256; + msg->getU32Fast(_PREHASH_Info, _PREHASH_RegionSizeY, region_size_y); + + //and a little hack for Second Life compatibility + if (region_size_y == 0 || region_size_x == 0) + { + region_size_x = 256; + region_size_y = 256; + } std::string seedCap; msg->getStringFast(_PREHASH_Info, _PREHASH_SeedCapability, seedCap); @@ -3737,7 +3749,7 @@ void process_teleport_finish(LLMessageSystem* msg, void**) // Viewer trusts the simulator. gMessageSystem->enableCircuit(sim_host, TRUE); - LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host); + LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host, region_size_x, region_size_y); /* // send camera update to new region @@ -4043,9 +4055,22 @@ void process_crossed_region(LLMessageSystem* msg, void**) std::string seedCap; msg->getStringFast(_PREHASH_RegionData, _PREHASH_SeedCapability, seedCap); + U32 region_size_x = 256; + msg->getU32(_PREHASH_RegionData, _PREHASH_RegionSizeX, region_size_x); + + U32 region_size_y = 256; + msg->getU32(_PREHASH_RegionData, _PREHASH_RegionSizeY, region_size_y); + + //and a little hack for Second Life compatibility + if (region_size_y == 0 || region_size_x == 0) + { + region_size_x = 256; + region_size_y = 256; + } + send_complete_agent_movement(sim_host); - LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host); + LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host, region_size_x, region_size_y); regionp->setSeedCapability(seedCap); } diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 25edaa82a..617798d9a 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -137,7 +137,18 @@ LLViewerParcelMgr::LLViewerParcelMgr() mAgentParcel = new LLParcel(); mHoverParcel = new LLParcel(); mCollisionParcel = new LLParcel(); + mBlockedImage = LLViewerTextureManager::getFetchedTextureFromFile("noentrylines.j2c"); + mPassImage = LLViewerTextureManager::getFetchedTextureFromFile("noentrypasslines.j2c"); + + init(256); + +} +//moved this stuff out of the constructor and into a function that we can call again after we get the region size. +//LLViewerParcelMgr needs to be changed so we either get an instance per region, or it handles various region sizes +//on a single grid properly - Patrick Sapinski (2/10/2011) +void LLViewerParcelMgr::init(F32 region_size) +{ mParcelsPerEdge = S32( REGION_WIDTH_METERS / PARCEL_GRID_STEP_METERS ); mHighlightSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)]; resetSegments(mHighlightSegments); @@ -145,13 +156,8 @@ LLViewerParcelMgr::LLViewerParcelMgr() mCollisionSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)]; resetSegments(mCollisionSegments); - // JC: Resolved a merge conflict here, eliminated - // mBlockedImage->setAddressMode(LLTexUnit::TAM_WRAP); - // because it is done in llviewertexturelist.cpp - mBlockedImage = LLViewerTextureManager::getFetchedTextureFromFile("noentrylines.j2c"); - mPassImage = LLViewerTextureManager::getFetchedTextureFromFile("noentrypasslines.j2c"); - - S32 overlay_size = mParcelsPerEdge * mParcelsPerEdge / PARCEL_OVERLAY_CHUNKS; + S32 mParcelOverLayChunks = region_size * region_size / (128 * 128); + S32 overlay_size = mParcelsPerEdge * mParcelsPerEdge / mParcelOverLayChunks; sPackedOverlay = new U8[overlay_size]; mAgentParcelOverlay = new U8[mParcelsPerEdge * mParcelsPerEdge]; @@ -1344,7 +1350,7 @@ void LLViewerParcelMgr::processParcelOverlay(LLMessageSystem *msg, void **user) } S32 parcels_per_edge = LLViewerParcelMgr::getInstance()->mParcelsPerEdge; - S32 expected_size = parcels_per_edge * parcels_per_edge / PARCEL_OVERLAY_CHUNKS; + S32 expected_size = 1024; if (packed_overlay_size != expected_size) { llwarns << "Got parcel overlay size " << packed_overlay_size diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index 236dbcbec..43e79125c 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -82,6 +82,8 @@ public: LLViewerParcelMgr(); ~LLViewerParcelMgr(); + void init(F32 region_size); + static void cleanupGlobals(); BOOL selectionEmpty() const; diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp index 46051f98e..a40884e0f 100644 --- a/indra/newview/llviewerparceloverlay.cpp +++ b/indra/newview/llviewerparceloverlay.cpp @@ -58,6 +58,7 @@ const U8 OVERLAY_IMG_COMPONENTS = 4; LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_width_meters) : mRegion( region ), mParcelGridsPerEdge( S32( region_width_meters / PARCEL_GRID_STEP_METERS ) ), + mRegionSize(S32(region_width_meters)), mDirty( FALSE ), mTimeSinceLastUpdate(), mOverlayTextureIdx(-1), @@ -298,7 +299,8 @@ void LLViewerParcelOverlay::uncompressLandOverlay(S32 chunk, U8 *packed_overlay) { // Unpack the message data into the ownership array S32 size = mParcelGridsPerEdge * mParcelGridsPerEdge; - S32 chunk_size = size / PARCEL_OVERLAY_CHUNKS; + S32 mParcelOverLayChunks = mRegionSize * mRegionSize / (128 * 128); + S32 chunk_size = size / mParcelOverLayChunks; memcpy(mOwnership + chunk*chunk_size, packed_overlay, chunk_size); /*Flawfinder: ignore*/ diff --git a/indra/newview/llviewerparceloverlay.h b/indra/newview/llviewerparceloverlay.h index 161b7a386..97f2ec2b8 100644 --- a/indra/newview/llviewerparceloverlay.h +++ b/indra/newview/llviewerparceloverlay.h @@ -100,6 +100,7 @@ private: LLViewerRegion* mRegion; S32 mParcelGridsPerEdge; + S32 mRegionSize; LLPointer mTexture; LLPointer mImageRaw; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 9319db137..f9a214fb9 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -66,6 +66,7 @@ #include "llvoclouds.h" #include "llworld.h" #include "llspatialpartition.h" +#include "llviewerparcelmgr.h" // Viewer object cache version, change if object update // format changes. JC @@ -199,6 +200,8 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, if (!gNoRender) { mParcelOverlay = new LLViewerParcelOverlay(this, region_width_meters); + //Re-init the parcel mgr for this sim + LLViewerParcelMgr::getInstance()->init(region_width_meters); } else { diff --git a/indra/newview/llvlmanager.cpp b/indra/newview/llvlmanager.cpp index 07ef26266..19ebe05fa 100644 --- a/indra/newview/llvlmanager.cpp +++ b/indra/newview/llvlmanager.cpp @@ -56,18 +56,26 @@ LLVLManager::~LLVLManager() void LLVLManager::addLayerData(LLVLData *vl_datap, const S32 mesg_size) { - if (LAND_LAYER_CODE == vl_datap->mType) + if (LAND_LAYER_CODE == vl_datap->mType || + AURORA_LAND_LAYER_CODE == vl_datap->mType) { mLandBits += mesg_size * 8; } - else if (WIND_LAYER_CODE == vl_datap->mType) + else if (WIND_LAYER_CODE == vl_datap->mType || + AURORA_WIND_LAYER_CODE == vl_datap->mType) { mWindBits += mesg_size * 8; } - else if (CLOUD_LAYER_CODE == vl_datap->mType) + else if (CLOUD_LAYER_CODE == vl_datap->mType || + AURORA_CLOUD_LAYER_CODE == vl_datap->mType) { mCloudBits += mesg_size * 8; } + else if (WATER_LAYER_CODE == vl_datap->mType || + AURORA_CLOUD_LAYER_CODE == vl_datap->mType) + { + mWaterBits += mesg_size * 8; + } else { llerrs << "Unknown layer type!" << (S32)vl_datap->mType << llendl; @@ -93,15 +101,25 @@ void LLVLManager::unpackData(const S32 num_packets) { datap->mRegionp->getLand().decompressDCTPatch(bit_pack, &goph, FALSE); } - else if (WIND_LAYER_CODE == datap->mType) + else if (AURORA_LAND_LAYER_CODE == datap->mType) + { + datap->mRegionp->getLand().decompressDCTPatch(bit_pack, &goph, TRUE); + } + else if (WIND_LAYER_CODE == datap->mType || + AURORA_WIND_LAYER_CODE == datap->mType) { datap->mRegionp->mWind.decompress(bit_pack, &goph); } - else if (CLOUD_LAYER_CODE == datap->mType) + else if (CLOUD_LAYER_CODE == datap->mType || + AURORA_CLOUD_LAYER_CODE == datap->mType) { datap->mRegionp->mCloudLayer.decompress(bit_pack, &goph); } + else if (WATER_LAYER_CODE == datap->mType || + AURORA_WATER_LAYER_CODE == datap->mType) + { + } } for (i = 0; i < mPacketData.count(); i++) diff --git a/indra/newview/llvlmanager.h b/indra/newview/llvlmanager.h index 9d64d6f24..4d7137fac 100644 --- a/indra/newview/llvlmanager.h +++ b/indra/newview/llvlmanager.h @@ -65,6 +65,7 @@ protected: U32 mLandBits; U32 mWindBits; U32 mCloudBits; + U32 mWaterBits; }; class LLVLData diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index 347eb21b3..c223d8dfb 100644 --- a/indra/newview/llvowater.cpp +++ b/indra/newview/llvowater.cpp @@ -74,7 +74,7 @@ LLVOWater::LLVOWater(const LLUUID &id, { // Terrain must draw during selection passes so it can block objects behind it. mbCanSelect = FALSE; - setScale(LLVector3(256.f, 256.f, 0.f)); // Hack for setting scale for bounding boxes/visibility. + setScale(LLVector3(mRegionp->getWidth(), mRegionp->getWidth(), 0.f)); // Hack for setting scale for bounding boxes/visibility. mUseTexture = TRUE; mIsEdgePatch = FALSE; diff --git a/indra/newview/llwind.cpp b/indra/newview/llwind.cpp index 2b0f0d969..0a2afd428 100644 --- a/indra/newview/llwind.cpp +++ b/indra/newview/llwind.cpp @@ -121,12 +121,12 @@ void LLWind::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp) set_group_of_patch_header(group_headerp); // X component - decode_patch_header(bitpack, &patch_header); + decode_patch_header(bitpack, &patch_header, FALSE); decode_patch(bitpack, buffer); decompress_patch(mVelX, buffer, &patch_header); // Y component - decode_patch_header(bitpack, &patch_header); + decode_patch_header(bitpack, &patch_header, FALSE); decode_patch(bitpack, buffer); decompress_patch(mVelY, buffer, &patch_header); diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 0c445b65f..022aa04d0 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -77,12 +77,12 @@ const S32 WORLD_PATCH_SIZE = 16; extern LLColor4U MAX_WATER_COLOR; -const U32 LLWorld::mWidth = 256; +U32 LLWorld::mWidth = 256; // meters/point, therefore mWidth * mScale = meters per edge const F32 LLWorld::mScale = 1.f; -const F32 LLWorld::mWidthInMeters = mWidth * mScale; +F32 LLWorld::mWidthInMeters = mWidth * mScale; // // Functions @@ -133,7 +133,7 @@ void LLWorld::destroyClass() } -LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host) +LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host, const U32 ®ion_size_x, const U32 ®ion_size_y) { LLMemType mt(LLMemType::MTYPE_REGIONS); llinfos << "Add region with handle: " << region_handle << " on host " << host << llendl; @@ -166,9 +166,11 @@ LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host) U32 iindex = 0; U32 jindex = 0; + mWidth = region_size_x; + mWidthInMeters = mWidth * mScale; from_region_handle(region_handle, &iindex, &jindex); - S32 x = (S32)(iindex/mWidth); - S32 y = (S32)(jindex/mWidth); + S32 x = (S32)(iindex/256); + S32 y = (S32)(jindex/256); llinfos << "Adding new region (" << x << ":" << y << ")" << llendl; llinfos << "Host: " << host << llendl; @@ -813,7 +815,7 @@ F32 LLWorld::getLandFarClip() const void LLWorld::setLandFarClip(const F32 far_clip) { - static S32 const rwidth = (S32)REGION_WIDTH_U32; + static S32 const rwidth = (S32)getRegionWidthInMeters(); S32 const n1 = (llceil(mLandFarClip) - 1) / rwidth; S32 const n2 = (llceil(far_clip) - 1) / rwidth; bool need_water_objects_update = n1 != n2; @@ -1243,9 +1245,21 @@ void process_enable_simulator(LLMessageSystem *msg, void **user_data) // which simulator should we modify? LLHost sim(ip_u32, port); + U32 region_size_x = 256; + msg->getU32Fast(_PREHASH_SimulatorInfo, _PREHASH_RegionSizeX, region_size_x); + + U32 region_size_y = 256; + msg->getU32Fast(_PREHASH_SimulatorInfo, _PREHASH_RegionSizeY, region_size_y); + + if (region_size_y == 0 || region_size_x == 0) + { + region_size_x = 256; + region_size_y = 256; + } + // Viewer trusts the simulator. msg->enableCircuit(sim, TRUE); - LLWorld::getInstance()->addRegion(handle, sim); + LLWorld::getInstance()->addRegion(handle, sim, region_size_x, region_size_y); // give the simulator a message it can use to get ip and port llinfos << "simulator_enable() Enabling " << sim << " with code " << msg->getOurCircuitCode() << llendl; diff --git a/indra/newview/llworld.h b/indra/newview/llworld.h index ec6e45b23..b3bd661cf 100644 --- a/indra/newview/llworld.h +++ b/indra/newview/llworld.h @@ -71,7 +71,7 @@ public: LLWorld(); void destroyClass(); - LLViewerRegion* addRegion(const U64 ®ion_handle, const LLHost &host); + LLViewerRegion* addRegion(const U64 ®ion_handle, const LLHost &host, const U32 ®ion_size_x, const U32 ®ion_size_y); // safe to call if already present, does the "right thing" if // hosts are same, or if hosts are different, etc... void removeRegion(const LLHost &host); @@ -170,12 +170,12 @@ private: region_list_t mCulledRegionList; // Number of points on edge - static const U32 mWidth; + static U32 mWidth; // meters/point, therefore mWidth * mScale = meters per edge static const F32 mScale; - static const F32 mWidthInMeters; + static F32 mWidthInMeters; F32 mLandFarClip; // Far clip distance for land. LLPatchVertexArray mLandPatch; From f65624b2427b90ac5b7d92c1d281df4f71486882 Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Tue, 2 Aug 2011 01:13:53 +0200 Subject: [PATCH 08/22] Debug build fixes, linux32 --- indra/cmake/00-Common.cmake | 2 +- indra/llcommon/llprocesslauncher.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index af41d373a..bf3d3caa5 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -230,7 +230,7 @@ if (LINUX) endif (${ARCH} STREQUAL "x86_64") endif (VIEWER) - set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG}") + set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG} -msse2") set(CMAKE_CXX_FLAGS_RELEASE "-O3 ${CMAKE_CXX_FLAGS_RELEASE}") set(CMAKE_C_FLAGS_RELEASE "-O3 ${CMAKE_C_FLAGS_RELEASE}") set(CMAKE_CXX_FLAGS_RELEASESSE2 "-O3 ${CMAKE_CXX_FLAGS_RELEASESSE2}") diff --git a/indra/llcommon/llprocesslauncher.cpp b/indra/llcommon/llprocesslauncher.cpp index 45bd98e20..b6d410da9 100644 --- a/indra/llcommon/llprocesslauncher.cpp +++ b/indra/llcommon/llprocesslauncher.cpp @@ -328,7 +328,11 @@ int LLProcessLauncher::launch(void) apr_file_t* out; AIAPRPool pool; pool.create(); +#if(APR_VERSION_MAJOR==1 && APR_VERSION_MINOR>=3 || APR_VERSION_MAJOR>1) apr_status_t status = apr_file_pipe_create_ex(&in, &out, APR_FULL_BLOCK, pool()); +#else + apr_status_t status = apr_file_pipe_create(&in, &out, pool()); +#endif assert(status == APR_SUCCESS); bool success = (status == APR_SUCCESS); if (success) From 8787d37d5cbe9171f168fd8f28651576a572c40b Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Wed, 3 Aug 2011 23:16:00 +0200 Subject: [PATCH 09/22] Build fix for that --- indra/newview/CMakeLists.txt | 1 + indra/newview/llviewerparcelmgr.cpp | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 89cd31abb..62d98582e 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1224,6 +1224,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 diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 617798d9a..b63c81bfc 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -138,16 +138,16 @@ LLViewerParcelMgr::LLViewerParcelMgr() mHoverParcel = new LLParcel(); mCollisionParcel = new LLParcel(); mBlockedImage = LLViewerTextureManager::getFetchedTextureFromFile("noentrylines.j2c"); - mPassImage = LLViewerTextureManager::getFetchedTextureFromFile("noentrypasslines.j2c"); - - init(256); - + mPassImage = LLViewerTextureManager::getFetchedTextureFromFile("noentrypasslines.j2c"); + + init(256); + } -//moved this stuff out of the constructor and into a function that we can call again after we get the region size. -//LLViewerParcelMgr needs to be changed so we either get an instance per region, or it handles various region sizes -//on a single grid properly - Patrick Sapinski (2/10/2011) -void LLViewerParcelMgr::init(F32 region_size) +//moved this stuff out of the constructor and into a function that we can call again after we get the region size. +//LLViewerParcelMgr needs to be changed so we either get an instance per region, or it handles various region sizes +//on a single grid properly - Patrick Sapinski (2/10/2011) +void LLViewerParcelMgr::init(F32 region_size) { mParcelsPerEdge = S32( REGION_WIDTH_METERS / PARCEL_GRID_STEP_METERS ); mHighlightSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)]; @@ -1349,7 +1349,7 @@ void LLViewerParcelMgr::processParcelOverlay(LLMessageSystem *msg, void **user) return; } - S32 parcels_per_edge = LLViewerParcelMgr::getInstance()->mParcelsPerEdge; + //S32 parcels_per_edge = LLViewerParcelMgr::getInstance()->mParcelsPerEdge; S32 expected_size = 1024; if (packed_overlay_size != expected_size) { From 8d72f6f516a8caeaa9cc9dbf6fc331c67ea9be5c Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Thu, 4 Aug 2011 03:20:51 +0200 Subject: [PATCH 10/22] This temporarily fixes inventory problems on Aurora. DO NOT MERGE THIS INTO FUTURE. --- etc/message.xml | 3 + indra/newview/llinventorymodel.cpp | 470 +++++++++++++++++++++++----- indra/newview/llinventorymodel.h | 8 +- indra/newview/llviewerinventory.cpp | 18 +- indra/newview/llviewerregion.cpp | 14 +- 5 files changed, 412 insertions(+), 101 deletions(-) diff --git a/etc/message.xml b/etc/message.xml index 04cdbc8f2..847f483aa 100644 --- a/etc/message.xml +++ b/etc/message.xml @@ -673,6 +673,9 @@ FetchInventoryDescendents false + WebFetchInventoryDescendents + true + FetchInventory true diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index bba3cf30d..f7fccd298 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1318,6 +1318,7 @@ void LLInventoryModel::mock(const LLUUID& root_id) void LLInventoryModel::fetchInventoryResponder::result(const LLSD& content) { + LL_DEBUGS("Inventory") << " fetch http got " << ll_pretty_print_sd(content) << LL_ENDL; // OGPX start_new_inventory_observer(); /*LLUUID agent_id; @@ -1435,6 +1436,7 @@ class fetchDescendentsResponder: public LLHTTPClient::Responder // Note: this is the handler for WebFetchInventoryDescendents and agent/inventory caps void fetchDescendentsResponder::result(const LLSD& content) { + LL_DEBUGS("Inventory") << " fetch descendents got " << ll_pretty_print_sd(content) << LL_ENDL; // OGPX if (content.has("folders")) { @@ -1656,7 +1658,11 @@ void LLInventoryModel::bulkFetch(std::string url) folder_sd["fetch_items"] = (LLSD::Boolean)TRUE; LL_DEBUGS("Inventory") << " fetching "<getUUID()<<" with cat owner "<getOwnerID()<<" and agent" << gAgent.getID() << LL_ENDL; - if (ALEXANDRIA_LINDEN_ID == cat->getOwnerID()) + //OGPX if (ALEXANDRIA_LINDEN_ID == cat->getOwnerID()) + // for OGP it really doesnt make sense to have the decision about whether to fetch + // from the library or user cap be determined by a hard coded UUID. + // if it isnt an item that belongs to the agent, then fetch from the library + if (gAgent.getID() != cat->getOwnerID()) //if i am not the owner, it must be in the library body_lib["folders"].append(folder_sd); else body["folders"].append(folder_sd); @@ -1690,12 +1696,14 @@ void LLInventoryModel::bulkFetch(std::string url) sBulkFetchCount++; if (body["folders"].size()) { + LL_DEBUGS("Inventory") << " fetch descendents post to " << url << ": " << ll_pretty_print_sd(body) << LL_ENDL; // OGPX LLHTTPClient::post(url, body, new fetchDescendentsResponder(body),300.0); } if (body_lib["folders"].size()) { std::string url_lib; url_lib = gAgent.getRegion()->getCapability("FetchLibDescendents"); + LL_DEBUGS("Inventory") << " fetch descendents lib post: " << ll_pretty_print_sd(body_lib) << LL_ENDL; // OGPX LLHTTPClient::post(url_lib, body_lib, new fetchDescendentsResponder(body_lib),300.0); } sFetchTimer.reset(); @@ -1796,20 +1804,20 @@ void LLInventoryModel::backgroundFetch(void*) { if (sBackgroundFetchActive && gAgent.getRegion()) { - // If we'll be using the capability, we'll be sending batches and the background thing isn't as important. - std::string url = gAgent.getRegion()->getCapability("FetchInventoryDescendents"); - if (false /*gSavedSettings.getBOOL("UseHTTPInventory")*/ && !url.empty()) + std::string url = gAgent.getRegion()->getCapability("WebFetchInventoryDescendents"); + + if (!url.empty()) { bulkFetch(url); return; } -#if 1 + // If there was no HTTP cap to fetch with, then do the UDP fetch //DEPRECATED OLD CODE FOLLOWS. // no more categories to fetch, stop fetch process if (sFetchQueue.empty()) { - llinfos << "Inventory fetch completed" << llendl; + LL_DEBUGS("Inventory") << "Inventory fetch completed" << LL_ENDL; if (sFullFetchStarted) { sAllFoldersFetched = TRUE; @@ -1825,7 +1833,7 @@ void LLInventoryModel::backgroundFetch(void*) // double timeouts on failure sMinTimeBetweenFetches = llmin(sMinTimeBetweenFetches * 2.f, 10.f); sMaxTimeBetweenFetches = llmin(sMaxTimeBetweenFetches * 2.f, 120.f); - llinfos << "Inventory fetch times grown to (" << sMinTimeBetweenFetches << ", " << sMaxTimeBetweenFetches << ")" << llendl; + LL_DEBUGS("Inventory") << "Inventory fetch times grown to (" << sMinTimeBetweenFetches << ", " << sMaxTimeBetweenFetches << ")" << LL_ENDL; // fetch is no longer considered "timely" although we will wait for full time-out sTimelyFetchPending = FALSE; } @@ -1920,11 +1928,6 @@ void LLInventoryModel::backgroundFetch(void*) // not enough time has elapsed to do a new fetch break; } - - // - // DEPRECATED OLD CODE - //-------------------------------------------------------------------------------- -#endif } } @@ -2204,53 +2207,57 @@ bool LLInventoryModel::loadSkeleton( const LLSD& options, const LLUUID& owner_id) { - lldebugs << "importing inventory skeleton for " << owner_id << llendl; + LL_INFOS("OGPX") << "importing inventory skeleton for " << owner_id << LL_ENDL; + LL_DEBUGS("Inventory") << " skeleton is " << ll_pretty_print_sd(options) << LL_ENDL; typedef std::set, InventoryIDPtrLess> cat_set_t; cat_set_t temp_cats; + + update_map_t child_counts; + + LLUUID id; + LLAssetType::EType preferred_type; bool rv = true; - - for(LLSD::array_const_iterator it = options.beginArray(), - end = options.endArray(); it != end; ++it) + for (LLSD::array_const_iterator it = options.beginArray(); it < options.endArray(); ++it) { - LLSD name = (*it)["name"]; - LLSD folder_id = (*it)["folder_id"]; - LLSD parent_id = (*it)["parent_id"]; - LLSD version = (*it)["version"]; - if(name.isDefined() - && folder_id.isDefined() - && parent_id.isDefined() - && version.isDefined() - && folder_id.asUUID().notNull() // if an id is null, it locks the viewer. - ) + LLPointer cat = new LLViewerInventoryCategory(owner_id); + + LL_DEBUGS("Inventory") << "cat name, folder, parent, type " << (*it)["name"].asString() << " " << (*it)["folder_id"].asUUID() << " " << (*it)["parent_id"].asUUID() << " " << (*it)["type_default"].asString() << " " << LL_ENDL; // OGPX + if ((*it)["name"].asString().empty()) goto clean_cat; + cat->rename((*it)["name"].asString().c_str()); + if ((*it)["folder_id"].asUUID().isNull()) goto clean_cat; + id = (*it)["folder_id"].asUUID(); + // if an id is null, it locks the viewer. + if (id.isNull()) goto clean_cat; + cat->setUUID(id); + // OGPX : slight change in snowglobe non OGP handling of things with null parents vs OGP9 SVN branch + // OGPX : so commented this line out for OGPX as well. if((*it)["parent_id"].asUUID().isNull()) goto clean_cat; + id = (*it)["parent_id"].asUUID(); + cat->setParent(id); + if ((*it)["type_default"].asString().empty()) { - LLPointer cat = new LLViewerInventoryCategory(owner_id); - cat->rename(name.asString()); - cat->setUUID(folder_id.asUUID()); - cat->setParent(parent_id.asUUID()); - - LLAssetType::EType preferred_type = LLAssetType::AT_NONE; - LLSD type_default = (*it)["type_default"]; - if(type_default.isDefined()) - { - preferred_type = (LLAssetType::EType)type_default.asInteger(); - } - cat->setPreferredType(preferred_type); - cat->setVersion(version.asInteger()); - temp_cats.insert(cat); + preferred_type = LLAssetType::AT_NONE; } else { - llwarns << "Unable to import near " << name.asString() << llendl; - rv = false; + S32 t = (*it)["type_default"].asInteger(); + preferred_type = (LLAssetType::EType)t; } + cat->setPreferredType(preferred_type); + if ((*it)["version"].asString().empty()) goto clean_cat; + cat->setVersion((*it)["version"].asInteger()); + temp_cats.insert(cat); + continue; + clean_cat: + llwarns << "Unable to import near " << cat->getName() << llendl; + rv = false; + //delete cat; // automatic when cat is reasigned or destroyed } - + S32 cached_category_count = 0; S32 cached_item_count = 0; - if(!temp_cats.empty()) + if (!temp_cats.empty()) { - update_map_t child_counts; cat_array_t categories; item_array_t items; cat_set_t invalid_categories; // Used to mark categories that weren't successfully loaded. @@ -2320,9 +2327,9 @@ bool LLInventoryModel::loadSkeleton( } // go ahead and add the cats returned during the download - std::set::const_iterator not_cached_id = cached_ids.end(); + std::set::iterator not_cached_id = cached_ids.end(); cached_category_count = cached_ids.size(); - for(cat_set_t::iterator it = temp_cats.begin(); it != temp_cats.end(); ++it) + for (cat_set_t::iterator it = temp_cats.begin(); it != temp_cats.end(); ++it) { if (cached_ids.find((*it)->getUUID()) == not_cached_id) { @@ -2338,32 +2345,30 @@ bool LLInventoryModel::loadSkeleton( // Add all the items loaded which are parented to a // category with a correctly cached parent + count = items.count(); S32 bad_link_count = 0; cat_map_t::iterator unparented = mCategoryMap.end(); - for(item_array_t::const_iterator item_iter = items.begin(); - item_iter != items.end(); - ++item_iter) + for (int i = 0; i < count; ++i) { - LLViewerInventoryItem *item = (*item_iter).get(); - const cat_map_t::iterator cit = mCategoryMap.find(item->getParentUUID()); + cat_map_t::iterator cit = mCategoryMap.find(items[i]->getParentUUID()); - if(cit != unparented) + if (cit != unparented) { - const LLViewerInventoryCategory* cat = cit->second.get(); - if(cat->getVersion() != NO_VERSION) + LLViewerInventoryCategory* cat = cit->second; + if (cat->getVersion() != NO_VERSION) { // This can happen if the linked object's baseobj is removed from the cache but the linked object is still in the cache. - if (item->getIsBrokenLink()) + if (items[i]->getIsBrokenLink()) { bad_link_count++; lldebugs << "Attempted to add cached link item without baseobj present ( name: " - << item->getName() << " itemID: " << item->getUUID() - << " assetID: " << item->getAssetUUID() + << items[i]->getName() << " itemID: " << items[i]->getUUID() + << " assetID: " << items[i]->getAssetUUID() << " ). Ignoring and invalidating " << cat->getName() << " . " << llendl; invalid_categories.insert(cit->second); continue; } - addItem(item); + addItem(items[i]); cached_item_count += 1; ++child_counts[cat->getUUID()]; } @@ -2402,17 +2407,17 @@ bool LLInventoryModel::loadSkeleton( // At this point, we need to set the known descendents for each // category which successfully cached so that we do not // needlessly fetch descendents for categories which we have. - update_map_t::const_iterator no_child_counts = child_counts.end(); - for(cat_set_t::iterator it = temp_cats.begin(); it != temp_cats.end(); ++it) + update_map_t::iterator no_child_counts = child_counts.end(); + update_map_t::iterator the_count; + for (cat_set_t::iterator it = temp_cats.begin(); it != temp_cats.end(); ++it) { - LLViewerInventoryCategory* cat = (*it).get(); - if(cat->getVersion() != NO_VERSION) + LLViewerInventoryCategory* cat = (*it); + if (cat->getVersion() != NO_VERSION) { - update_map_t::const_iterator the_count = child_counts.find(cat->getUUID()); - if(the_count != no_child_counts) + the_count = child_counts.find(cat->getUUID()); + if (the_count != no_child_counts) { - const S32 num_descendents = (*the_count).second.mValue; - cat->setDescendentCount(num_descendents); + cat->setDescendentCount((*the_count).second.mValue); } else { @@ -2435,30 +2440,341 @@ bool LLInventoryModel::loadSkeleton( categories.clear(); // will unref and delete entries } - llinfos << "Successfully loaded " << cached_category_count + LL_DEBUGS("Inventory") << "Successfully loaded " << cached_category_count << " categories and " << cached_item_count << " items from cache." - << llendl; + << LL_ENDL; return rv; } -//OGPX crap. Since this function is actually functionally the same as its LLSD variant.. -// just convert options_t to LLSD and route to the LLSD version. Yuck. bool LLInventoryModel::loadSkeleton( const LLInventoryModel::options_t& options, const LLUUID& owner_id) { - LLSD options_list; + lldebugs << "importing inventory skeleton for " << owner_id << llendl; + + typedef std::set, InventoryIDPtrLess> cat_set_t; + cat_set_t temp_cats; + + update_map_t child_counts; + + LLUUID id; + LLAssetType::EType preferred_type; + bool rv = true; for(options_t::const_iterator it = options.begin(); it < options.end(); ++it) { - LLSD entry; - for(response_t::const_iterator it2 = it->begin(); it2 != it->end(); ++it2) + LLPointer cat = new LLViewerInventoryCategory(owner_id); + response_t::const_iterator no_response = (*it).end(); + response_t::const_iterator skel; + skel = (*it).find("name"); + if(skel == no_response) goto clean_cat; + cat->rename(std::string((*skel).second)); + skel = (*it).find("folder_id"); + if(skel == no_response) goto clean_cat; + id.set((*skel).second); + // if an id is null, it locks the viewer. + if(id.isNull()) goto clean_cat; + cat->setUUID(id); + skel = (*it).find("parent_id"); + if(skel == no_response) goto clean_cat; + id.set((*skel).second); + cat->setParent(id); + skel = (*it).find("type_default"); + if(skel == no_response) { - entry[it2->first]=it2->second; + preferred_type = LLAssetType::AT_NONE; } - options_list.append(entry); + else + { + S32 t = atoi((*skel).second.c_str()); + preferred_type = (LLAssetType::EType)t; + } + cat->setPreferredType(preferred_type); + skel = (*it).find("version"); + if(skel == no_response) goto clean_cat; + cat->setVersion(atoi((*skel).second.c_str())); + temp_cats.insert(cat); + continue; + clean_cat: + llwarns << "Unable to import near " << cat->getName() << llendl; + rv = false; + //delete cat; // automatic when cat is reasigned or destroyed } - return loadSkeleton(options_list,owner_id); + + S32 cached_category_count = 0; + S32 cached_item_count = 0; + if(!temp_cats.empty()) + { + cat_array_t categories; + item_array_t items; + cat_set_t invalid_categories; // Used to mark categories that weren't successfully loaded. + std::string owner_id_str; + owner_id.toString(owner_id_str); + std::string path(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, owner_id_str)); + std::string inventory_filename; + inventory_filename = llformat(CACHE_FORMAT_STRING, path.c_str()); + const S32 NO_VERSION = LLViewerInventoryCategory::VERSION_UNKNOWN; + std::string gzip_filename(inventory_filename); + gzip_filename.append(".gz"); + LLFILE* fp = LLFile::fopen(gzip_filename, "rb"); + bool remove_inventory_file = false; + if(fp) + { + fclose(fp); + fp = NULL; + if(gunzip_file(gzip_filename, inventory_filename)) + { + // we only want to remove the inventory file if it was + // gzipped before we loaded, and we successfully + // gunziped it. + remove_inventory_file = true; + } + else + { + llinfos << "Unable to gunzip " << gzip_filename << llendl; + } + } + bool is_cache_obsolete = false; + if (loadFromFile(inventory_filename, categories, items, is_cache_obsolete)) + { + // We were able to find a cache of files. So, use what we + // found to generate a set of categories we should add. We + // will go through each category loaded and if the version + // does not match, invalidate the version. + S32 count = categories.count(); + cat_set_t::iterator not_cached = temp_cats.end(); + std::set cached_ids; + for(S32 i = 0; i < count; ++i) + { + LLViewerInventoryCategory* cat = categories[i]; + cat_set_t::iterator cit = temp_cats.find(cat); + if (cit == temp_cats.end()) + { + continue; // cache corruption?? not sure why this happens -SJB + } + LLViewerInventoryCategory* tcat = *cit; + + // we can safely ignore anything loaded from file, but + // not sent down in the skeleton. + if(cit == not_cached) + { + continue; + } + if(cat->getVersion() != tcat->getVersion()) + { + // if the cached version does not match the server version, + // throw away the version we have so we can fetch the + // correct contents the next time the viewer opens the folder. + tcat->setVersion(NO_VERSION); + } + else + { + cached_ids.insert(tcat->getUUID()); + } + } + + // go ahead and add the cats returned during the download + std::set::iterator not_cached_id = cached_ids.end(); + cached_category_count = cached_ids.size(); + for(cat_set_t::iterator it = temp_cats.begin(); it != temp_cats.end(); ++it) + { + if(cached_ids.find((*it)->getUUID()) == not_cached_id) + { + // this check is performed so that we do not + // mark new folders in the skeleton (and not in cache) + // as being cached. + LLViewerInventoryCategory *llvic = (*it); + llvic->setVersion(NO_VERSION); + } + addCategory(*it); + ++child_counts[(*it)->getParentUUID()]; + } + + // Add all the items loaded which are parented to a + // category with a correctly cached parent + count = items.count(); + S32 bad_link_count = 0; + cat_map_t::iterator unparented = mCategoryMap.end(); + for(int i = 0; i < count; ++i) + { + cat_map_t::iterator cit = mCategoryMap.find(items[i]->getParentUUID()); + + if(cit != unparented) + { + LLViewerInventoryCategory* cat = cit->second; + if(cat->getVersion() != NO_VERSION) + { + // This can happen if the linked object's baseobj is removed from the cache but the linked object is still in the cache. + if (items[i]->getIsBrokenLink()) + { + bad_link_count++; + lldebugs << "Attempted to add cached link item without baseobj present ( name: " + << items[i]->getName() << " itemID: " << items[i]->getUUID() + << " assetID: " << items[i]->getAssetUUID() + << " ). Ignoring and invalidating " << cat->getName() << " . " << llendl; + invalid_categories.insert(cit->second); + continue; + } + addItem(items[i]); + cached_item_count += 1; + ++child_counts[cat->getUUID()]; + } + } + } + if (bad_link_count > 0) + { + llinfos << "Attempted to add " << bad_link_count + << " cached link items without baseobj present. " + << "The corresponding categories were invalidated." << llendl; + } + } + else + { + // go ahead and add everything after stripping the version + // information. + for(cat_set_t::iterator it = temp_cats.begin(); it != temp_cats.end(); ++it) + { + LLViewerInventoryCategory *llvic = (*it); + llvic->setVersion(NO_VERSION); + addCategory(*it); + } + } + + // Invalidate all categories that failed fetching descendents for whatever + // reason (e.g. one of the descendents was a broken link). + for (cat_set_t::iterator invalid_cat_it = invalid_categories.begin(); + invalid_cat_it != invalid_categories.end(); + invalid_cat_it++) + { + LLViewerInventoryCategory* cat = (*invalid_cat_it).get(); + cat->setVersion(NO_VERSION); + llinfos << "Invalidating category name: " << cat->getName() << " UUID: " << cat->getUUID() << " due to invalid descendents cache" << llendl; + } + + // At this point, we need to set the known descendents for each + // category which successfully cached so that we do not + // needlessly fetch descendents for categories which we have. + update_map_t::iterator no_child_counts = child_counts.end(); + update_map_t::iterator the_count; + for(cat_set_t::iterator it = temp_cats.begin(); it != temp_cats.end(); ++it) + { + LLViewerInventoryCategory* cat = (*it); + if(cat->getVersion() != NO_VERSION) + { + the_count = child_counts.find(cat->getUUID()); + if(the_count != no_child_counts) + { + cat->setDescendentCount((*the_count).second.mValue); + } + else + { + cat->setDescendentCount(0); + } + } + } + + if(remove_inventory_file) + { + // clean up the gunzipped file. + LLFile::remove(inventory_filename); + } + if (is_cache_obsolete) + { + // If out of date, remove the gzipped file too. + llwarns << "Inv cache out of date, removing" << llendl; + LLFile::remove(gzip_filename); + } + categories.clear(); // will unref and delete entries + } + + LL_DEBUGS("Inventory") << "Successfully loaded " << cached_category_count + << " categories and " << cached_item_count << " items from cache." + << LL_ENDL; + + return rv; +} + +bool LLInventoryModel::loadMeat( + const LLInventoryModel::options_t& options, const LLUUID& owner_id) +{ + llinfos << "importing inventory for " << owner_id << llendl; + LLPermissions default_perm; + default_perm.init(LLUUID::null, owner_id, LLUUID::null, LLUUID::null); + LLPointer item; + LLUUID id; + LLAssetType::EType type; + LLInventoryType::EType inv_type; + bool rv = true; + for(options_t::const_iterator it = options.begin(); it < options.end(); ++it) + { + item = new LLViewerInventoryItem; + response_t::const_iterator no_response = (*it).end(); + response_t::const_iterator meat; + meat = (*it).find("name"); + if(meat == no_response) goto clean_item; + item->rename(std::string((*meat).second)); + meat = (*it).find("item_id"); + if(meat == no_response) goto clean_item; + id.set((*meat).second); + item->setUUID(id); + meat = (*it).find("parent_id"); + if(meat == no_response) goto clean_item; + id.set((*meat).second); + item->setParent(id); + meat = (*it).find("type"); + if(meat == no_response) goto clean_item; + type = (LLAssetType::EType)atoi((*meat).second.c_str()); + item->setType(type); + meat = (*it).find("inv_type"); + if(meat != no_response) + { + inv_type = (LLInventoryType::EType)atoi((*meat).second.c_str()); + item->setInventoryType(inv_type); + } + meat = (*it).find("data_id"); + if(meat == no_response) goto clean_item; + id.set((*meat).second); + if(LLAssetType::AT_CALLINGCARD == type) + { + LLPermissions perm; + perm.init(id, owner_id, LLUUID::null, LLUUID::null); + item->setPermissions(perm); + } + else + { + meat = (*it).find("perm_mask"); + if(meat != no_response) + { + PermissionMask perm_mask = atoi((*meat).second.c_str()); + default_perm.initMasks( + perm_mask, perm_mask, perm_mask, perm_mask, perm_mask); + } + else + { + default_perm.initMasks( + PERM_NONE, PERM_NONE, PERM_NONE, PERM_NONE, PERM_NONE); + } + item->setPermissions(default_perm); + item->setAssetUUID(id); + } + meat = (*it).find("flags"); + if(meat != no_response) + { + item->setFlags(strtoul((*meat).second.c_str(), NULL, 0)); + } + meat = (*it).find("time"); + if(meat != no_response) + { + item->setCreationDate(atoi((*meat).second.c_str())); + } + addItem(item); + continue; + clean_item: + llwarns << "Unable to import near " << item->getName() << llendl; + rv = false; + //delete item; // automatic when item is reassigned or destroyed + } + return rv; } // This is a brute force method to rebuild the entire parent-child diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 697d1e29a..a6dc0f31a 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -386,9 +386,13 @@ public: // during authentication. return true if everything parsed. typedef std::map response_t; typedef std::vector options_t; - - //OGPX really screwed with the login process. This is needed until it's all sorted out. + // OGPX : Two loadSkeleton(), one for the XML-RPC logins, one for LLSD + //... The concept of a skeleton being different from the cap that + //... we do inventory queries on should be examined, and the usage of + //... the skeleton in querying the wearables needs to be examined as well. bool loadSkeleton(const options_t& options, const LLUUID& owner_id); + bool loadMeat(const options_t& options, const LLUUID& owner_id); + /** Mutators ** ** *******************************************************************************/ diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 6bb8be13f..e85cc97a2 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -274,6 +274,7 @@ void LLViewerInventoryItem::setTransactionID(const LLTransactionID& transaction_ // virtual void LLViewerInventoryItem::packMessage(LLMessageSystem* msg) const { + LL_INFOS("Inventory") << " UDP Rez/UpdateObject of UUID " << mUUID << " parent = " << mParentUUID << " type= " << mType << " transaction= "<< mTransactionID << LL_ENDL; // OGPX msg->addUUIDFast(_PREHASH_ItemID, mUUID); msg->addUUIDFast(_PREHASH_FolderID, mParentUUID); mPermissions.packMessage(msg); @@ -503,28 +504,15 @@ bool LLViewerInventoryCategory::fetchDescendents() // This comes from LLInventoryFilter from llfolderview.h U32 sort_order = gSavedSettings.getU32("InventorySortOrder") & 0x1; - // *NOTE: For bug EXT-2879, originally commented out - // gAgent.getRegion()->getCapability in order to use the old - // message-based system. This has been uncommented now that - // AIS folks are aware of the issue and have a fix in process. - // see ticket for details. + std::string url = gAgent.getRegion()->getCapability("WebFetchInventoryDescendents"); - std::string url; - if (gAgent.getRegion()) - { - url = gAgent.getRegion()->getCapability("FetchInventoryDescendents"); - } - else - { - llwarns << "agent region is null" << llendl; - } if (!url.empty()) //Capability found. Build up LLSD and use it. { LLInventoryModel::startBackgroundFetch(mUUID); } else { //Deprecated, but if we don't have a capability, use the old system. - llinfos << "FetchInventoryDescendents capability not found. Using deprecated UDP message." << llendl; + llinfos << "WebFetchInventoryDescendents or agent/inventory capability not found. Using deprecated UDP message." << llendl; LLMessageSystem* msg = gMessageSystem; msg->newMessage("FetchInventoryDescendents"); msg->nextBlock("AgentData"); diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index f9a214fb9..1de40ed2c 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1456,13 +1456,9 @@ void LLViewerRegion::setSeedCapability(const std::string& url) capabilityNames.append("DispatchRegionInfo"); capabilityNames.append("EstateChangeInfo"); capabilityNames.append("EventQueueGet"); - if (false)//gSavedSettings.getBOOL("UseHTTPInventory")) //Caps suffixed with 2 by LL. Don't update until rest of fetch system is updated first. - { - capabilityNames.append("FetchLib"); - capabilityNames.append("FetchLibDescendents"); - capabilityNames.append("FetchInventory"); - capabilityNames.append("FetchInventoryDescendents"); - } + capabilityNames.append("FetchInventory"); + capabilityNames.append("FetchLib"); + capabilityNames.append("FetchLibDescendents"); capabilityNames.append("GetTexture"); capabilityNames.append("GroupProposalBallot"); capabilityNames.append("GetDisplayNames"); @@ -1499,6 +1495,10 @@ void LLViewerRegion::setSeedCapability(const std::string& url) capabilityNames.append("UploadBakedTexture"); capabilityNames.append("ViewerStartAuction"); capabilityNames.append("ViewerStats"); + capabilityNames.append("WebFetchInventoryDescendents"); // OGPX : since this is asking the region + // leave the old naming in place, on agent domain + // it is now called agent/inventory. Both + // caps have the same LLSD returned. // Please add new capabilities alphabetically to reduce // merge conflicts. From 20d2012fc34dfdf14ce3ff16d1c54ec3eb72bae5 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Thu, 4 Aug 2011 22:41:37 +0200 Subject: [PATCH 11/22] Fix a typo. --- .../skins/default/xui/en-us/panel_preferences_ascent_chat.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml index 00412ca2d..7d4d31cea 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml @@ -272,7 +272,7 @@ To use spellcheck, right-click a misspelled word left="5" name="CmdDivisor" width="356"/> From 881d065220b7d7731ae615ee6093ec261b6dfd41 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Fri, 5 Aug 2011 00:05:08 +0200 Subject: [PATCH 12/22] Wrap sGlobalRawMemory in AIThreadSafe. This is accessed by different threads. Other globals like it might also be accessed by different threads, this has to be investigated. --- indra/llimage/llimage.cpp | 14 ++++++++------ indra/llimage/llimage.h | 3 ++- indra/newview/lltextureview.cpp | 6 +++++- indra/newview/llviewerstats.cpp | 6 +++++- indra/newview/llviewertexturelist.cpp | 6 +++++- 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 3f3dbc87c..5fcc9db39 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -246,7 +246,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; @@ -296,23 +296,25 @@ LLImageRaw::~LLImageRaw() U8* LLImageRaw::allocateData(S32 size) { U8* res = LLImageBase::allocateData(size); - sGlobalRawMemory += getDataSize(); + *AIAccess(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(sGlobalRawMemory) += getDataSize() - old_data_size; return res; } // virtual void LLImageRaw::deleteData() { - sGlobalRawMemory -= getDataSize(); + { + *AIAccess(sGlobalRawMemory) -= getDataSize(); + } LLImageBase::deleteData(); } @@ -328,7 +330,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(sGlobalRawMemory) += getDataSize(); } BOOL LLImageRaw::resize(U16 width, U16 height, S8 components) diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index 9f0cfa87d..99b07be84 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -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 sGlobalRawMemory; static S32 sRawImageCount; static S32 sRawImageCachedCount; diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 2ce0c5ff4..736a6dafa 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -421,12 +421,16 @@ void LLGLTexMemBar::draw() std::string text; + S32 global_raw_memory; + { + global_raw_memory = *AIAccess(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 diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index c1b87cc34..481e97eb3 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -362,12 +362,16 @@ void reset_statistics() void output_statistics(void*) { + S32 global_raw_memory; + { + global_raw_memory = *AIAccess(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; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 13f3c8f46..73f96a757 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -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(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(); From 5005f4aa1daaa716822b51161a22f2ae78bcc3e8 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Fri, 5 Aug 2011 14:53:11 +0200 Subject: [PATCH 13/22] Never pass an empty string as directory path to the filepicker. Should work around the problem as described in http://code.google.com/p/singularity-viewer/issues/detail?id=117 --- indra/newview/statemachine/aifilepicker.cpp | 29 ++++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/indra/newview/statemachine/aifilepicker.cpp b/indra/newview/statemachine/aifilepicker.cpp index fdfb5a968..19b3af0d4 100644 --- a/indra/newview/statemachine/aifilepicker.cpp +++ b/indra/newview/statemachine/aifilepicker.cpp @@ -82,7 +82,7 @@ std::string AIFilePicker::get_folder(std::string const& default_path, std::strin { AIAccess 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 = "HOMEPATH"; #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; } } From 1c6d890a5a65859742f4e038c82fe51b44f84a56 Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Sun, 7 Aug 2011 19:29:57 +0200 Subject: [PATCH 14/22] Correct, complete user profile path on Windows --- indra/newview/statemachine/aifilepicker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/statemachine/aifilepicker.cpp b/indra/newview/statemachine/aifilepicker.cpp index 19b3af0d4..38cbf6996 100644 --- a/indra/newview/statemachine/aifilepicker.cpp +++ b/indra/newview/statemachine/aifilepicker.cpp @@ -100,7 +100,7 @@ std::string AIFilePicker::get_folder(std::string const& default_path, std::strin { // This is the last resort when all else failed. Open the file chooser in directory 'home'. #if LL_WINDOWS - char const* envname = "HOMEPATH"; + char const* envname = "USERPROFILE"; #else char const* envname = "HOME"; #endif From 3853d50eec2b68c5491e41e96eb126f3c8266978 Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Mon, 8 Aug 2011 02:39:29 +0200 Subject: [PATCH 15/22] This should fix KV TVs --- indra/newview/llviewermedia.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 4b086f808..b79249860 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -682,9 +682,16 @@ void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mi LLURI uri(url); std::string scheme = uri.scheme(); - if(scheme.empty() || "http" == scheme || "https" == scheme) + if(scheme.empty() || ("http" == scheme || "https" == scheme)) { - LLHTTPClient::getHeaderOnly( url, new LLMimeDiscoveryResponder(this)); + if(mime_type.empty()) + { + LLHTTPClient::getHeaderOnly( url, new LLMimeDiscoveryResponder(this)); + } + else if(initializeMedia(mime_type) && (plugin = getMediaPlugin())) + { + plugin->loadURI( url ); + } } else if("data" == scheme || "file" == scheme || "about" == scheme) { From c466b9a91ab1ff403fc0f9180cf1114e0b2f8b93 Mon Sep 17 00:00:00 2001 From: TighMacFanatic Date: Thu, 22 Sep 2011 17:26:39 -0400 Subject: [PATCH 16/22] Reverted code that allows users to steal UUID's of clothing textures. --- indra/newview/llfloateravatartextures.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/indra/newview/llfloateravatartextures.cpp b/indra/newview/llfloateravatartextures.cpp index 5f656bae2..70f79f3c5 100644 --- a/indra/newview/llfloateravatartextures.cpp +++ b/indra/newview/llfloateravatartextures.cpp @@ -165,9 +165,7 @@ void LLFloaterAvatarTextures::refresh() // static void LLFloaterAvatarTextures::onClickDump(void* data) { -// -//#if !LL_RELEASE_FOR_DOWNLOAD -// +#if !LL_RELEASE_FOR_DOWNLOAD LLFloaterAvatarTextures* self = (LLFloaterAvatarTextures*)data; LLVOAvatar* avatarp = find_avatar(self->mID); if (!avatarp) return; @@ -179,7 +177,5 @@ void LLFloaterAvatarTextures::onClickDump(void* data) llinfos << "Avatar TE " << i << " id " << te->getID() << llendl; } -// -//#endif -// +#endif } From 344df747d5faf4cfd3d700a8c1ebc6f6c9212146 Mon Sep 17 00:00:00 2001 From: TighMacFanatic Date: Tue, 27 Sep 2011 12:00:28 -0400 Subject: [PATCH 17/22] Fixed text highlighting so terms found in names do not trigger. --- indra/newview/llfloaterchat.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index eac5187f0..6fdd1bc19 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -604,11 +604,14 @@ LLColor4 get_text_color(const LLChat& chat) static const LLCachedControl mKeywordsChangeColor(gSavedPerAccountSettings, "KeywordsChangeColor", false); static const LLCachedControl mKeywordsColor(gSavedPerAccountSettings, "KeywordsColor", LLColor4(1.f, 1.f, 1.f, 1.f)); - if (gAgent.getID() != chat.mFromID) + if ((gAgent.getID() != chat.mFromID) && (chat.mSourceType != CHAT_SOURCE_SYSTEM)) { if (mKeywordsChangeColor) { - if (AscentKeyword::hasKeyword(chat.mText, 1)) + std::string shortmsg(chat.mText); + shortmsg.erase(0, chat.mFromName.length()); + + if (AscentKeyword::hasKeyword(shortmsg, 1)) { text_color = mKeywordsColor; } From 3c758a06a38ba39e456d6e751d29e6fc8a6d9392 Mon Sep 17 00:00:00 2001 From: TighMacFanatic Date: Tue, 27 Sep 2011 12:37:02 -0400 Subject: [PATCH 18/22] Re-enabled Cancel TP button. --- indra/newview/lloverlaybar.cpp | 2 +- indra/newview/skins/default/xui/en-us/panel_overlaybar.xml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/indra/newview/lloverlaybar.cpp b/indra/newview/lloverlaybar.cpp index 5a7dfd0c3..d7a1d9a08 100644 --- a/indra/newview/lloverlaybar.cpp +++ b/indra/newview/lloverlaybar.cpp @@ -464,7 +464,7 @@ void LLOverlayBar::onClickStandUp(void*) void LLOverlayBar::onClickCancelTP(void* data) { LLOverlayBar* self = (LLOverlayBar*)data; - self->setCancelTPButtonVisible(FALSE,std::string("Cancel")); + self->setCancelTPButtonVisible(FALSE, std::string("Cancel TP")); gAgent.teleportCancel(); llinfos << "trying to cancel teleport" << llendl; } diff --git a/indra/newview/skins/default/xui/en-us/panel_overlaybar.xml b/indra/newview/skins/default/xui/en-us/panel_overlaybar.xml index 678e48f6e..090a164d8 100644 --- a/indra/newview/skins/default/xui/en-us/panel_overlaybar.xml +++ b/indra/newview/skins/default/xui/en-us/panel_overlaybar.xml @@ -38,7 +38,10 @@