diff --git a/etc/message.xml b/etc/message.xml index 04cdbc8f28..847f483aab 100644 --- a/etc/message.xml +++ b/etc/message.xml @@ -673,6 +673,9 @@ FetchInventoryDescendents false + WebFetchInventoryDescendents + true + FetchInventory true diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index af41d373a4..bf3d3caa52 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/indra_constants.h b/indra/llcommon/indra_constants.h index a95b6499d7..478c746b01 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/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index c35a842552..59173eecdd 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 05e2bccaf2..09e88b3264 100644 --- a/indra/llcommon/llapp.h +++ b/indra/llcommon/llapp.h @@ -236,17 +236,6 @@ class LL_COMMON_API LLApp : public LLOptionInterface 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 @@ class LL_COMMON_API LLApp : public LLOptionInterface 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 @@ class LL_COMMON_API LLApp : public LLOptionInterface // 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 138c67a369..d05b9875cb 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::stop() +void LLFrameTimer::reset(F32 expiration) { - mStarted = FALSE; + llassert(!mPaused); + mStartTime = sFrameTime; + mExpiry = sFrameTime + expiration; } -void LLFrameTimer::reset() +void LLFrameTimer::start(F32 expiration) { - mStartTime = sFrameTime; - mExpiry = sFrameTime; + reset(expiration); + mRunning = true; // Start, if not already started. } -void LLFrameTimer::resetWithExpiry(F32 expiration) +void LLFrameTimer::stop() { - 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 f4775a9926..e737a884e5 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 @@ class LL_COMMON_API LLFrameTimer // 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/llcommon/llprocesslauncher.cpp b/indra/llcommon/llprocesslauncher.cpp index 45bd98e201..b6d410da92 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) diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h index ba2e3f5425..f126b4882c 100644 --- a/indra/llcommon/llversionviewer.h +++ b/indra/llcommon/llversionviewer.h @@ -36,7 +36,7 @@ const S32 LL_VERSION_MAJOR = 1; const S32 LL_VERSION_MINOR = 5; const S32 LL_VERSION_PATCH = 10; -const S32 LL_VERSION_BUILD = 1; +const S32 LL_VERSION_BUILD = 2; const char * const LL_CHANNEL = "Singularity"; diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 3f3dbc87c3..5fcc9db392 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 9f0cfa87d1..99b07be845 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 @@ class LLImageRaw : public LLImageBase 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/llinventory/llparcel.h b/indra/llinventory/llparcel.h index eb9c44e53f..881a6feb77 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/llpumpio.cpp b/indra/llmessage/llpumpio.cpp index c50dcc8763..7a10c0fa6f 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/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp index 892547cabb..855d1cccfc 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 4bf89e5130..77cfe710a2 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 90fb236349..12ed19ea4a 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 82fa6bb62b..dbfdf7059e 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 663e146a8f..ba21be711c 100644 --- a/indra/llmessage/patch_dct.h +++ b/indra/llmessage/patch_dct.h @@ -79,7 +79,7 @@ class LLPatchHeader 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/llui/llalertdialog.cpp b/indra/llui/llalertdialog.cpp index f708e220e4..27700ca202 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 fe4190a2b6..328e620519 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 1f94191d26..e1bf4d4aaa 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)) - { - S32 local_x = x - mJumpPrevArrowBtn->getRect().mLeft; - S32 local_y = y - mJumpPrevArrowBtn->getRect().mBottom; - mJumpPrevArrowBtn->handleHover(local_x, local_y, mask); - } - if (mJumpNextArrowBtn && mJumpNextArrowBtn->getRect().pointInRect(x, y)) - { - 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)) + 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 - mPrevArrowBtn->getRect().mLeft; - S32 local_y = y - mPrevArrowBtn->getRect().mBottom; - mPrevArrowBtn->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); } - else if (mNextArrowBtn->getRect().pointInRect(x, y)) + else if (!mDragAndDropDelayTimer.getStarted()) { - 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); } } + else + { + // 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) + 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()) { - 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(); - } + tuple->mButton->onCommit(); } } @@ -1849,5 +1859,3 @@ void LLTabContainer::commitHoveredButton(S32 x, S32 y) } } - - diff --git a/indra/llui/lltextparser.cpp b/indra/llui/lltextparser.cpp index 707dd0afdd..84c9e29a36 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/llvfs/llpidlock.cpp b/indra/llvfs/llpidlock.cpp index 28cee29405..5df5eadbe1 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/lscript/lscript_library/lscript_library.cpp b/indra/lscript/lscript_library/lscript_library.cpp index c78a72cdb9..d015319f69 100644 --- a/indra/lscript/lscript_library/lscript_library.cpp +++ b/indra/lscript/lscript_library/lscript_library.cpp @@ -462,19 +462,168 @@ void LLScriptLibrary::init() addFunction(10.f, 0.f, dummy_func, "llGetLinkNumberOfSides", "i", "i"); // IDEVO Name lookup calls, see lscript_avatar_names.h - addFunction(10.f, 0.f, dummy_func, "llGetUsername", "s", "k"); - addFunction(10.f, 0.f, dummy_func, "llRequestUsername", "k", "k"); - addFunction(10.f, 0.f, dummy_func, "llGetDisplayName", "s", "k"); + addFunction(10.f, 0.f, dummy_func, "llGetUsername", "s", "k"); + addFunction(10.f, 0.f, dummy_func, "llRequestUsername", "k", "k"); + addFunction(10.f, 0.f, dummy_func, "llGetDisplayName", "s", "k"); addFunction(10.f, 0.f, dummy_func, "llRequestDisplayName", "k", "k"); - addFunction(10.f, 0.f, dummy_func, "llGetEnv", "s", "s"); addFunction(10.f, 0.f, dummy_func, "llRegionSayTo", NULL, "kis"); +<<<<<<< HEAD +======= + // Adding missing (more recent) LSL functions. + + addFunction(10.f, 0.f, dummy_func, "llCastRay", "l", "vvl"); + addFunction(10.f, 0.f, dummy_func, "llGetSPMaxMemory", "i", NULL); + addFunction(10.f, 0.f, dummy_func, "llGetUsedMemory", "i", NULL); + addFunction(10.f, 0.f, dummy_func, "llGodLikeRezObject", NULL, "kv"); + addFunction(10.f, 0.f, dummy_func, "llScriptProfiler", NULL, "i"); + addFunction(10.f, 0.f, dummy_func, "llSetInventoryPermMask", NULL, "sii"); + addFunction(10.f, 0.f, dummy_func, "llSetObjectPermMask", NULL, "ii"); + +>>>>>>> Added the latest LSL and OSSL functions. // energy, sleep, dummy_func, name, return type, parameters, help text, gods-only // IF YOU ADD NEW SCRIPT CALLS, YOU MUST PUT THEM AT THE END OF THIS LIST. // Otherwise the bytecode numbers for each call will be wrong, and all // existing scripts will crash. +<<<<<<< HEAD +======= + + // REGARDING OSSL FUNCTIONS + // These additions should be posted underneath the llFunctions + // These functions pertain to OpenSimulator and are in no part applicable to SecondLife by Linden Labs + // The Current State of these functions are in flux and development is ongoing. Not all the functions are presently + // documented and therefore the description may be incomplete and require further attention. + // OpenSimulator is written in C# and not CPP therefore some values for example "double = float" etc. are different. + + // OSSL corrections and syntax additions added + set in same order as found in OSSL_stub.cs of OpenSim Source (Updated PM October-21-2010 + // based on OpenSimulator Ver. 0.7.x DEV/Master Git # a7acb650d400a280a7b9edabd304376dff9c81af - a7acb65-r/14142 + // Updates by WhiteStar Magic + + addFunction(10.f, 0.f, dummy_func, "osSetRegionWaterHeight", NULL, "f"); + addFunction(10.f, 0.f, dummy_func, "osSetRegionSunSettings", NULL, "iif"); + addFunction(10.f, 0.f, dummy_func, "osSetEstateSunSettings", NULL, "if"); + addFunction(10.f, 0.f, dummy_func, "osGetCurrentSunHour", "f", NULL); + addFunction(10.f, 0.f, dummy_func, "osSunGetParam","f", "s"); // Deprecated. Use osGetSunParam instead + addFunction(10.f, 0.f, dummy_func, "osSunSetParam", "sf", NULL); // Deprecated. Use osSetSunParam instead + addFunction(10.f, 0.f, dummy_func, "osWindActiveModelPluginName", "s", NULL); + addFunction(10.f, 0.f, dummy_func, "osParcelJoin", NULL, "vv"); + addFunction(10.f, 0.f, dummy_func, "osParcelSubdivide", NULL, "vv"); + addFunction(10.f, 0.f, dummy_func, "osParcelSetDetails", NULL, "vv"); // Deprecated. Use osSetParcelDetails instead. + // addFunction(10.f, 0.f, dummy_func, "osWindParamSet", NULL, "ssf"); // This function was renamed before it was implemented. Leaving this in for now. + // addFunction(10.f, 0.f, dummy_func, "osWindParamGet", "f", "ss"); // This function was renamed before it was implemented. Leaving this in for now. + addFunction(10.f, 0.f, dummy_func, "osList2Double", "f", "li"); + addFunction(10.f, 0.f, dummy_func, "osSetDynamicTextureURL", NULL, "ksssi"); + addFunction(10.f, 0.f, dummy_func, "osSetDynamicTextureData", NULL, "ksssi"); + addFunction(10.f, 0.f, dummy_func, "osSetDynamicTextureURLBlend", NULL, "ksssii"); + addFunction(10.f, 0.f, dummy_func, "osSetDynamicTextureDataBlend", NULL, "ksssii"); + addFunction(10.f, 0.f, dummy_func, "osSetDynamicTextureURLBlendFace", NULL, "ksssfiiii"); + addFunction(10.f, 0.f, dummy_func, "osSetDynamicTextureDataBlendFace", NULL, "ksssfiiii"); + addFunction(10.f, 0.f, dummy_func, "osTerrainGetHeight", "f", "ii"); // Deprecated. Use osGetTerrainHeight instead + addFunction(10.f, 0.f, dummy_func, "osTerrainSetHeight", NULL, "iif"); // Deprecated. Use osSetTerrainHeight instead + addFunction(10.f, 0.f, dummy_func, "osTerrainFlush", NULL, NULL); + addFunction(10.f, 0.f, dummy_func, "osRegionRestart", "i", "f"); + addFunction(10.f, 0.f, dummy_func, "osRegionNotice",NULL, "s"); + addFunction(10.f, 0.f, dummy_func, "osConsoleCommand", NULL, "s"); + addFunction(10.f, 0.f, dummy_func, "osSetParcelMediaURL", NULL, "s"); + addFunction(10.f, 0.f, dummy_func, "osSetParcelSIPAddress", NULL, "s"); + addFunction(10.f, 0.f, dummy_func, "osSetPrimFloatOnWater", NULL, "i"); + addFunction(10.f, 0.f, dummy_func, "osTeleportAgent", NULL, "ksvv"); + addFunction(10.f, 0.f, dummy_func, "osGetAgentIP", "s", "k"); + addFunction(10.f, 0.f, dummy_func, "osGetAgents", "l", NULL); + addFunction(10.f, 0.f, dummy_func, "osAvatarPlayAnimation", NULL, "ks"); + addFunction(10.f, 0.f, dummy_func, "osAvatarStopAnimation", NULL, "ks"); + addFunction(10.f, 0.f, dummy_func, "osMovePen", NULL, "sii"); + addFunction(10.f, 0.f, dummy_func, "osDrawLine", NULL, "siiii"); + addFunction(10.f, 0.f, dummy_func, "osDrawText", NULL, "ss"); + addFunction(10.f, 0.f, dummy_func, "osDrawEllipse", NULL, "sii"); + addFunction(10.f, 0.f, dummy_func, "osDrawRectangle", NULL, "sii"); + addFunction(10.f, 0.f, dummy_func, "osDrawFilledRectangle", NULL, "sii"); + addFunction(10.f, 0.f, dummy_func, "osDrawPolygon", "s", "sll"); + addFunction(10.f, 0.f, dummy_func, "osDrawFilledPolygon", "s", "sll"); + addFunction(10.f, 0.f, dummy_func, "osSetFontSize", NULL, "si"); + addFunction(10.f, 0.f, dummy_func, "osSetFontName", NULL, "ss"); + addFunction(10.f, 0.f, dummy_func, "osSetPenSize", NULL, "si"); + addFunction(10.f, 0.f, dummy_func, "osSetPenCap", NULL, "sss"); + addFunction(10.f, 0.f, dummy_func, "osSetPenColour", NULL, "ss"); // Deprecated. Use osSetPenColor instead + addFunction(10.f, 0.f, dummy_func, "osDrawImage", NULL, "siis"); + addFunction(10.f, 0.f, dummy_func, "osGetDrawStringSize", "v", "sssi"); + addFunction(10.f, 0.f, dummy_func, "osSetStateEvents", NULL, "i"); + addFunction(10.f, 0.f, dummy_func, "osGetScriptEngineName", "s", NULL); + addFunction(10.f, 0.f, dummy_func, "osGetSimulatorVersion", "s", NULL); + addFunction(10.f, 0.f, dummy_func, "osParseJSON", "s", "s"); + addFunction(10.f, 0.f, dummy_func, "osMessageObject", NULL, "ks"); + addFunction(10.f, 0.f, dummy_func, "osMakeNotecard", NULL, "sl"); + addFunction(10.f, 0.f, dummy_func, "osGetNotecardLine", "s", "si"); + addFunction(10.f, 0.f, dummy_func, "osGetNotecard", "s", "s"); + addFunction(10.f, 0.f, dummy_func, "osGetNumberOfNotecardLines", "i", "s"); + addFunction(10.f, 0.f, dummy_func, "osAvatarName2Key", "k", "ss"); + addFunction(10.f, 0.f, dummy_func, "osKey2Name", "s", "k"); + addFunction(10.f, 0.f, dummy_func, "osGetGridNick", "s", NULL); + addFunction(10.f, 0.f, dummy_func, "osGetGridName", "s", NULL); + addFunction(10.f, 0.f, dummy_func, "osGetGridLoginURI", "s", NULL); + addFunction(10.f, 0.f, dummy_func, "osFormatString", "s", "sl"); + addFunction(10.f, 0.f, dummy_func, "osMatchString", "l", "ssi"); + addFunction(10.f, 0.f, dummy_func, "osLoadedCreationDate", "s", NULL); + addFunction(10.f, 0.f, dummy_func, "osLoadedCreationTime", "s", NULL); + addFunction(10.f, 0.f, dummy_func, "osLoadedCreationID", "s", NULL); + addFunction(10.f, 0.f, dummy_func, "osGetLinkPrimitiveParams", "l", "il"); + addFunction(10.f, 0.f, dummy_func, "osNpcCreate", "k", "ssvk"); + addFunction(10.f, 0.f, dummy_func, "osNpcMoveTo", NULL, "kv"); + addFunction(10.f, 0.f, dummy_func, "osNpcSay", NULL, "ks"); + addFunction(10.f, 0.f, dummy_func, "osNpcRemove", NULL, "k"); + addFunction(10.f, 0.f, dummy_func, "osGetMapTexture", "k", NULL); + addFunction(10.f, 0.f, dummy_func, "osGetRegionMapTexture", "k", "s"); + addFunction(10.f, 0.f, dummy_func, "osGetRegionStats", "l", NULL); + addFunction(10.f, 0.f, dummy_func, "osGetSimulatorMemory", "i", NULL); + addFunction(10.f, 0.f, dummy_func, "osKickAvatar", NULL, "sss"); + addFunction(10.f, 0.f, dummy_func, "osSetSpeed", NULL, "kf"); + addFunction(10.f, 0.f, dummy_func, "osCauseDamage", NULL, "kf"); + addFunction(10.f, 0.f, dummy_func, "osCauseHealing", NULL, "kf"); + addFunction(10.f, 0.f, dummy_func, "osGetPrimitiveParams", "l", "kl"); + addFunction(10.f, 0.f, dummy_func, "osSetPrimitiveParams", NULL, "kl"); + addFunction(10.f, 0.f, dummy_func, "osSetProjectionParams", NULL, "kikfff"); + addFunction(10.f, 0.f, dummy_func, "osUnixTimeToTimestamp", "s", "i"); + addFunction(10.f, 0.f, dummy_func, "osSetPenColor", NULL, "ss"); + addFunction(10.f, 0.f, dummy_func, "osGetSunParam","f", "s"); + addFunction(10.f, 0.f, dummy_func, "osSetSunParam", "sf", NULL); + addFunction(10.f, 0.f, dummy_func, "osSetParcelDetails", NULL, "vl"); + addFunction(10.f, 0.f, dummy_func, "osGetTerrainHeight", "f", "ii"); + addFunction(10.f, 0.f, dummy_func, "osSetTerrainHeight", NULL, "iif"); + addFunction(10.f, 0.f, dummy_func, "osGetAvatarList", "l", NULL); + addFunction(10.f, 0.f, dummy_func, "osTeleportOwner", NULL, "svv"); + + // LightShare functions + addFunction(10.f, 0.f, dummy_func, "cmSetWindlightScene", "i", "l"); + addFunction(10.f, 0.f, dummy_func, "cmSetWindlightSceneTargeted", "i", "lk"); + addFunction(10.f, 0.f, dummy_func, "cmGetWindlightScene", "l", "l"); + // LightShare functions - alternate versions + // don't ask me why they renamed 'em, but we need to include both versions -- MC + addFunction(10.f, 0.f, dummy_func, "lsSetWindlightScene", "i", "l"); + addFunction(10.f, 0.f, dummy_func, "lsSetWindlightSceneTargeted", "i", "lk"); + addFunction(10.f, 0.f, dummy_func, "lsGetWindlightScene", "l", "l"); + + // New OSSL functions 08-10-2011 + addFunction(10.f, 0.f, dummy_func, "osNpcSaveAppearance", "k", "ks"); + addFunction(10.f, 0.f, dummy_func, "osNpcLoadAppearance", NULL, "ks"); + addFunction(10.f, 0.f, dummy_func, "osNpcMoveToTarget", NULL, "kvi"); + addFunction(10.f, 0.f, dummy_func, "osNpcStopMoveTo", NULL, "k"); + addFunction(10.f, 0.f, dummy_func, "osOwnerSaveAppearance", "k", "s"); + + addFunction(10.f, 0.f, dummy_func, "llSetMemoryLimit", "i", "i"); + addFunction(10.f, 0.f, dummy_func, "llSetLinkMedia", "i", "iil"); + addFunction(10.f, 0.f, dummy_func, "llGetLinkMedia", "l", "iil"); + addFunction(10.f, 0.f, dummy_func, "llClearLinkMedia", "i", "ii"); + addFunction(10.f, 0.f, dummy_func, "llSetLinkCamera", NULL, "ivv"); + addFunction(10.f, 0.f, dummy_func, "llSetContentType", NULL, "ki"); + addFunction(10.f, 0.f, dummy_func, "llLinkSitTarget", NULL, "ivr"); + addFunction(10.f, 0.f, dummy_func, "llAvatarOnLinkSitTarget", "k", "i"); + /* No info on these functions yet.... + * addFunction(10.f, 0.f, dummy_func, "llSetVelocity", "", ""); + * addFunction(10.f, 0.f, dummy_func, "llSetRotationalVelocity", "", ""); + */ +>>>>>>> Added the latest LSL and OSSL functions. } LLScriptLibraryFunction::LLScriptLibraryFunction(F32 eu, F32 st, void (*exec_func)(LLScriptLibData *, LLScriptLibData *, const LLUUID &), const char *name, const char *ret_type, const char *args, BOOL god_only) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 89cd31abb8..62d98582ee 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/app_settings/settings_files.xml b/indra/newview/app_settings/settings_files.xml index 6e52cfa247..ac304f7593 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 diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 874a246435..3b1436474d 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/llcloud.cpp b/indra/newview/llcloud.cpp index ca35c37116..116d227cc9 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/llconsole.cpp b/indra/newview/llconsole.cpp index 937ccec24b..db2d474b06 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/llfloateractivespeakers.cpp b/indra/newview/llfloateractivespeakers.cpp index a641ac69de..27d35c6bb1 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/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index 88030b6b0d..f9e99c6d69 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++) diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index d91f4067b2..8955eddb07 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/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index a60490da98..ad44c0bbd0 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 716573d128..3ad43d037b 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(); + } + } + if (mZoomTimer.getStarted()) + { + interp = mZoomTimer.getElapsedTimeF32() / MAP_ZOOM_TIME; } - F32 interp = mZoomTimer.getElapsedTimeF32() / MAP_ZOOM_TIME; - if (interp > 1.f) + 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 5c8c976d6a..03baa3eef7 100644 --- a/indra/newview/llfloaterworldmap.h +++ b/indra/newview/llfloaterworldmap.h @@ -164,6 +164,7 @@ class LLFloaterWorldMap : public LLFloater // Sets sMapScale, in pixels per region F32 mCurZoomVal; + F32 mCurZoomValInterpolationStart; // Used during mZoomTimer interpolation. LLFrameTimer mZoomTimer; LLDynamicArray mLandmarkAssetIDList; diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 092fdc6b53..5da3926b7b 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/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index bba3cf30d4..f7fccd2984 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; - bool rv = true; - for(LLSD::array_const_iterator it = options.beginArray(), - end = options.endArray(); it != end; ++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); - 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); + update_map_t child_counts; + + LLUUID id; + LLAssetType::EType preferred_type; + bool rv = true; + for (LLSD::array_const_iterator it = options.beginArray(); it < options.endArray(); ++it) + { + 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()) + { + 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) + { + 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) + { + preferred_type = LLAssetType::AT_NONE; + } + 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 + } + + 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) { - LLSD entry; - for(response_t::const_iterator it2 = it->begin(); it2 != it->end(); ++it2) + 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) { - entry[it2->first]=it2->second; + item->setFlags(strtoul((*meat).second.c_str(), NULL, 0)); } - options_list.append(entry); + 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 loadSkeleton(options_list,owner_id); + 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 697d1e29af..a6dc0f31ac 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -386,9 +386,13 @@ class LLInventoryModel // 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/llpanelmediahud.cpp b/indra/newview/llpanelmediahud.cpp index 4b33ae6f2a..b77ba15cbc 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 e23e662ecb..55a5ef6b05 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/llstartup.cpp b/indra/newview/llstartup.cpp index f6f051fd1e..bd69c300c4 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/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 50c8940a2f..240d122f39 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/llsurface.cpp b/indra/newview/llsurface.cpp index 9d718e88c0..7a46305e4f 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/lltextureview.cpp b/indra/newview/lltextureview.cpp index 2ce0c5ff41..736a6dafab 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/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 6bb8be13fd..fae33f091b 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); @@ -390,7 +391,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 +399,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 +490,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 @@ -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/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 4b086f8087..b792498603 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) { diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 5eb4096de1..5c04026a25 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 25edaa82ae..b63c81bfc5 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]; @@ -1343,8 +1349,8 @@ void LLViewerParcelMgr::processParcelOverlay(LLMessageSystem *msg, void **user) return; } - S32 parcels_per_edge = LLViewerParcelMgr::getInstance()->mParcelsPerEdge; - S32 expected_size = parcels_per_edge * parcels_per_edge / PARCEL_OVERLAY_CHUNKS; + //S32 parcels_per_edge = LLViewerParcelMgr::getInstance()->mParcelsPerEdge; + 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 236dbcbec2..43e79125c8 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -82,6 +82,8 @@ class LLViewerParcelMgr : public LLSingleton 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 46051f98e0..a40884e0f3 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 161b7a386b..97f2ec2b85 100644 --- a/indra/newview/llviewerparceloverlay.h +++ b/indra/newview/llviewerparceloverlay.h @@ -100,6 +100,7 @@ class LLViewerParcelOverlay : public LLGLUpdate LLViewerRegion* mRegion; S32 mParcelGridsPerEdge; + S32 mRegionSize; LLPointer mTexture; LLPointer mImageRaw; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 9319db1378..1de40ed2cc 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 { @@ -1453,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"); @@ -1496,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. diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index c1b87cc34c..481e97eb38 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 13f3c8f46f..73f96a7575 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(); diff --git a/indra/newview/llvlmanager.cpp b/indra/newview/llvlmanager.cpp index 07ef262668..19ebe05fa6 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 9d64d6f24b..4d7137face 100644 --- a/indra/newview/llvlmanager.h +++ b/indra/newview/llvlmanager.h @@ -65,6 +65,7 @@ class LLVLManager U32 mLandBits; U32 mWindBits; U32 mCloudBits; + U32 mWaterBits; }; class LLVLData diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index f219fe8601..a36f5db00c 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(); } diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index 347eb21b3d..c223d8dfb2 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 2b0f0d9693..0a2afd428e 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 0c445b65f5..022aa04d03 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 ec6e45b233..b3bd661cf3 100644 --- a/indra/newview/llworld.h +++ b/indra/newview/llworld.h @@ -71,7 +71,7 @@ class LLWorld : public LLSingleton 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 @@ class LLWorld : public LLSingleton 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; 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 00412ca2d7..7d4d31ceac 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"/> 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 5db0451982..a34e943bf5 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" /> diff --git a/indra/newview/skins/default/xui/en-us/strings.xml b/indra/newview/skins/default/xui/en-us/strings.xml index ba0074d582..161480f07d 100644 --- a/indra/newview/skins/default/xui/en-us/strings.xml +++ b/indra/newview/skins/default/xui/en-us/strings.xml @@ -1708,5 +1708,612 @@ string llGetEnv(string name) Returns a string with the requested data about the region +<<<<<<< HEAD +======= + +list llCastRay( Vector start, Vector end, list options ) +Returns a list consisting of the following three values for each hit: UUID, Link number, Hit position. + + +integer llGetSPMaxMemory( ) +Returns the integer of the most bytes used while llScriptProfiler was last active. + + +integer llGetUsedMemory( ) +Returns the integer of the number of bytes of memory currently in use by the script. + + +llGodLikeRezObject( key inventory, vector pos ) +Rez directly off of UUID if owner has god-bit set. +(Requires god mode) + + +llScriptProfiler( integer flags ) +Enables or disables the scripts profiling state. + + +llSetInventoryPermMask( string item, integer mask, integer value ) +Sets the given permission mask to the new value on the inventory item. +(Requires god mode) + + +llSetObjectPermMask( integer mask, integer value ) +Sets the given permission mask to the new value on the root object the task is attached to. +(Requires god mode) + + +integer llSetMemoryLimit( integer limit ) +Request ''limit'' bytes to be reserved for this script. + + +integer llSetLinkMedia( integer link, integer face, list params ) +Set the media params for a particular face on the linked prim(s) without a delay. + + +list llGetLinkMedia( integer link, integer face, list params ) +Returns a list with the media params for a particular face on a linked prim, given the desired list of named params. + + +integer llClearLinkMedia( integer link, integer face ) +Clears the media and all params from the given face on the linked prim(s). + + +llSetLinkCamera( integer link, vector eye, vector at ) +Sets the camera eye offset, and the offset that the camera is looking at, for avatars that sit on the linked prim. + + +llSetContentType( key request_id, integer content_type ) +Set the Internet media type of an LSL HTTP server response. + + +llLinkSitTarget( integer link, vector offset, rotation rot ); +Set the sit location for the linked prim(s). The sit location is relative to the prim's position and rotation. + + +key llAvatarOnLinkSitTarget( integer link ) +Returns a key that is the UUID of the user seated on the prim. + + + + + + + +osSetRegionWaterHeight(float height) +Adjusts water height on region. +(OpenSim only.) + + +osSetRegionSunSettings(integer useEstateSun, integer sunFixed, float sunHour) +Changes the estate sun settings, then triggers a sun update +'sunFixed' TRUE to keep the sun stationary, FALSE to use global time +'sunHour' The sun hour that is desired, 0...24, 0 is sunrise. +(OpenSim only.) + + +osSetEstateSunSettings(integer sunFixed, float sunHour) +sunFixed = TRUE or FALSE, sunHour = 00.00 to 24.00. +(OpenSim only.) + + +float osGetCurrentSunHour() +Returns float value of current sun hour 0...24 0 is sunrise. +(OpenSim only.) + + +*DEPRECATED* Use osGetSunParam instead. +(OpenSim only.) + + +*DEPRECATED* Use osSetSunParam instead. +(OpenSim only.) + + +string osWindActiveModelPluginName() +Returns the current working wind module installed +These are SimpleRandomWind or ConfigurableWind. +(OpenSim only.) + + +osParcelJoin(vector pos1, vector pos2)) +Joins parcels @ X,Y coordinates. +(OpenSim only.) + + +osParcelSubdivide(vector pos1, vector pos2)) +Subdivides parcels @ X,Y coordinates. +(OpenSim only.) + + +*DEPRECATED* Use osSetParcelDetails instead. +(OpenSim only.) + + +*DEPRECATED* Use osSetWindParam instead. +(OpenSim only.) + + +*DEPRECATED* Use osGetWindParam instead. +(OpenSim only.) + + +double osList2Double(list src, integer index) +Returns double-precision value from src at index. +(OpenSim only.) + + +osSetDynamicTextureURL(key dynamicID, string contentType, string url, string extraParams, integer timer ) +Renders a web texture on the prim containing the script, and returns the UUID of the newly created texture. +(OpenSim only.) + + +osSetDynamicTextureData(key dynamicID, string contentType, string data, string extraParams, integer timer) +Writes text and vector graphics onto a prim face. +(OpenSim only.) + + +osSetDynamicTextureURLBlend(key dynamicID, string contentType, string url, string extraParams, integer timer, integer alpha) +Allows for two dynamic textures to blend on the prim containing this script. +(OpenSim only.) + + +osSetDynamicTextureDataBlend(key dynamicID, string contentType, string data, string extraParams, integer timer, integer alpha) +Allows for two dynamic textures to blend on the prim containing this script. +(OpenSim only.) + + +osSetDynamicTextureURLBlendFace(key dynamicID, string contentType, string url, string extraParams, integer blend, integer disp, integer timer, integer alpha, integer face) +Loads a web texture on a prim. +(OpenSim only.) + + +osSetDynamicTextureDataBlendFace(key dynamicID, string contentType, string data, string extraParams, integer blend, integer disp, integer timer, integer alpha, integer face) +(OpenSim only.) + + +*DEPRECATED* Use osGetTerrainHeight instead. +(OpenSim only.) + + +*DEPRECATED* Use osSetTerrainHeight instead. +(OpenSim only.) + + +osTerrainFlush() +Updates terrain data. Call this after you are done using osTerrainSetHeight. +(OpenSim only.) + + +integer osRegionRestart(float seconds) +Restart the current region in the specified number of seconds from now. +(OpenSim only.) + + +osRegionNotice(string msg) +Broadcasts a notification message to all agents on the current region. +(OpenSim only.) + + +osConsoleCommand(string command) +Issues commands directly to the OpenSim server console. +(OpenSim only.) + + +osSetParcelMediaURL(string url) +Sets parcel media URL. +(OpenSim only.) + + +osSetParcelSIPAddress(string SIPAddress) +Sets parcel SIP Address for Voice. +(OpenSim only.) + + +osSetPrimFloatOnWater(integer floatYN) +Make physical prims float at the water level, TRUE or FALSE. +(OpenSim only.) + + +osTeleportAgent(key agent, integer regionX, integer regionY, vector position, vector lookat) + or +osTeleportAgent(key agent, string regionName, vector position, vector lookat) + or +osTeleportAgent(key agent, vector position, vector lookat) +Teleports the specified agent to a specified location in the region, the grid, or the hypergrid. See documentation for details. +(OpenSim only.) + + +string osGetAgentIP(key agent) +Returns the Avatars IP Address +Allows in-world tools be used to coordinate out of world network services that need access to client IP addresses. +Should *ONLY* be used by Region Server Owner. +(OpenSim only.) + + +list osGetAgents() +Returns a list of all avatars in the region in which the script is running. +(OpenSim only.) + + +osAvatarPlayAnimation(key UUID, string animation) +Triggers animations contained within the same prim as the script. Does not need the target avatar's permission. +(OpenSim only.) + + +osAvatarStopAnimation(key UUID, string animation) +Stops specified animation on the specified avatar. +(OpenSim only.) + + +osMovePen(string drawList, integer x, integer y) +Moves the pen's location to the coordinates specified by the x and y parameters, without drawing anything. +(OpenSim only.) + + +osDrawLine(string drawList, integer startX, integer startY, integer endX, integer endY) +osDrawLine(string drawList, integer endX, integer endY) +Draws a line on a dynamic texture. +(OpenSim only.) + + +osDrawText(string drawList, string text) +Renders text on a dynamic texture. +(OpenSim only.) + + +osDrawEllipse(string drawList, integer width, integer height) +Draws an ellipse on a dynamic texture. +(OpenSim only.) + + +osDrawRectangle(string drawList, integer width, integer height) +Draws a rectangle on a dynamic texture. +(OpenSim only.) + + +osDrawFilledRectangle(string drawList, integer width, integer height) +Draws a rectangle on a dynamic texture, and fills it with the current pen color. +(OpenSim only.) + + +string osDrawPolygon (string drawList, list x, list y) +Draws a polygon on a dynamic texture. +(OpenSim only.) + + +string osDrawFilledPolygon (string drawList, list x, list y) +Draws a polygon on a dynamic texture, and fills it with the current pen color. +(OpenSim only.) + + +osSetFontSize(string drawList, integer fontSize) +Sets the font size to be used in osDrawText. +(OpenSim only.) + + +osSetFontName(string drawList, string fontName) +Sets current font to be used by osDrawText. +(OpenSim only.) + + +osSetPenSize(string drawList, integer penSize) +Sets the pen size (line thickness) that is to be used when drawing dynamic textures. +(OpenSim only.) + + +osSetPenCap(string drawList, string direction, string type) +Apply a shape on the end of a line. This allows using arrow, diamond, round and flat caps. +(OpenSim only.) + + +*DEPRECATED* Use osSetPenColor instead +(OpenSim only.) + + +osDrawImage(string drawList, integer width, integer height, string imageUrl) +Retrieves an image specified by the imageUrl parameter and draws it at the specified height and width. +(OpenSim only.) + + +vector osGetDrawStringSize(string contentType, string text, string fontName, integer fontSize) +Returns a vector containing the horizontal and vertical dimensions in pixels of the specified text +(OpenSim only.) + + +osSetStateEvents(integer events) +Used in the past as a workaround for a bug with Opensim, which has long since been fixed. +(OpenSim only.) + + +string osGetScriptEngineName() +Returns the name of the script engine which is currently enabled on the server. +(OpenSim only.) + + +string osGetSimulatorVersion() +Returns OpenSim server version information as a string. +(OpenSim only.) + + +string osParseJSON(string JSON) +Returns a hashtable containing the structured JSON contents. +(OpenSim only.) + + +osMessageObject(key UUID, string message) +Sends a string to the object identified by UUID. +The receiving object requires a dataserver(key queryid, string data) in a contained script(s). +The queryid passed will be the id of the calling object. +(OpenSim only.) + + +osMakeNotecard(string notecardName, list contents) +Write a Notecard contained in Prim with contents of list. +(OpenSim only.) + + +string osGetNotecardLine(string name, integer line) +Reads the requested notecard line and return its data as a string. +(OpenSim only.) + + +string osGetNotecard(string name) +Reads the entire notecard and return its data as a string. +(OpenSim only.) + + +integer osGetNumberOfNotecardLines(string name) +Returns total number of lines in a notecard. +(OpenSim only.) + + +key osAvatarName2Key(string firstname, string lastname) +Returns the avatar's UUID from their firstname, lastname. +(OpenSim only.) + + +string osKey2Name(key UUID) +Returns avatar name from their UUID key. +(OpenSim only.) + + +string osGetGridNick() +Returns the grid's nickname. +(OpenSim only.) + + +string osGetGridName() +Returns the grid's name. +(OpenSim only.) + + +string osGetGridLoginURI() +Returns the grid's LoginURI. +(OpenSim only.) + + +string osFormatString(string str, list strings) +Return the string with parameters substituted into it (format comes from .NET String.Format class) +Parameters are specified positionally. +(OpenSim only.) + + +list osMatchString(string src, string pattern, integer start) +Return a list of matches for the pattern and its components inside the source string. +The pattern is a regular expression. Each match in the result is the string that matched and its position in the source. +(OpenSim only.) + + +string osLoadedCreationDate() +Returns Creation Date from meta data of OAR. +(OpenSim only.) + + +string osLoadedCreationTime() +Returns Creation Time from meta data of OAR. +(OpenSim only.) + + +string osLoadedCreationID() +Returns creation ID from meta data of OAR. Can not be used to identify a machine. +(OpenSim only.) + + +list osGetLinkPrimitiveParams(integer linknumber, list rules) +Returns the primitive parameters for the linkset prims specified by linknumber. If using linkset constants (e.g. LINK_SET, LINK_ALL_CHILDREN, etc), the requested parameters of each relevant prim are concatenated to the end of the list. Otherwise, usage is identical to llGetPrimitiveParams(). +(OpenSim only.) + + +key osNpcCreate(string firstname, string lastname, vector position, key UUID) +Creates an NPC (Non Player Character) clone named firstname lastname at position from an already existing avatar specified by UUID. +(OpenSim only.) + + +osNpcMoveTo(key npc, vector position) +Moves an NPC to a location within the region. +(OpenSim only.) + + +osNpcSay(key npc, string message) +Makes an NPC say something. +(OpenSim only.) + + +osNpcRemove(key npc) +Removes an NPC. +(OpenSim only.) + + +key osGetMapTexture() +Returns the map texture UUID. +(OpenSim only.) + + +key osGetRegionMapTexture(string regionName) +Returns the map texture UUID for the regionName requested. +(OpenSim only.) + + +list osGetRegionStats() +Returns a list of float values representing a number of region statistics (21 of the values shown in the statistics bar of LL-based clients). +(OpenSim only.) + + +integer osGetSimulatorMemory() +Returns the current amount of RAM used by the current OpenSim instance. +(OpenSim only.) + + +osKickAvatar(string FirstName, string LastName, string alert) +Kicks avatar from region with an alert message. +(OpenSim only.) + + +osSetSpeed(key UUID, float SpeedModifier) +Multiplies the normal running, walking, and flying speed of the specified avatar. +(OpenSim only.) + + +osCauseDamage(key UUID, float damage) +Causes damage to specified avatar. +(OpenSim only.) + + +osCauseHealing(key UUID, float healing) +Causes healing to specified avatar. +(OpenSim only.) + + +list osGetPrimitiveParams(key prim, list rules) +Gets the parameters of the primitive, specified by key. +(OpenSim only.) + + +osSetPrimitiveParams(key prim, list rules) +Sets primitive Params. +(OpenSim only.) + + +osSetProjectionParams(key prim. integer projection, key texture, float fov, float focus, float amb) +Set projection paramaters for light sources. +(OpenSim only.) + + +string osUnixTimeToTimestamp(integer unixtime) +Converts unixtime to an llGetTimeStamp() formated string. +(OpenSim only.) + + +osSetPenColor(string drawList, string color) +Sets the pen color that is to be used when drawing dynamic textures. +(OpenSim only.) + + +float osGetSunParam(string param) +Returns current float values for param, where param = day_length, year_length, day_night_offset, update_interval. +(OpenSim only.) + + +osSetSunParam(string param, float value) +Sets region's sun parameters, where param = day_length, year_length, day_night_offset, update_interval. +(OpenSim only.) + + +osSetParcelDetails(vector pos, list rules) +Set parcel details. +(OpenSim only.) + + +float osGetTerrainHeight(integer x, integer y) +Returns current terrain height at the given coordinates. +(OpenSim only.) + + +osSetTerrainHeight(integer x, integer y, float val) +Sets terrain height at the given coordinates. Use osTerrainFlush() afterwards. +(OpenSim only.) + + +list osGetAvatarList() +Returns a strided list of the UUID, position, and name of each avatar in the region, except the owner. +(OpenSim only.) + + +osTeleportOwner(integer regionX, integer regionY, vector position, vector lookat) + or +osTeleportOwner(string regionName, vector position, vector lookat) + or +osTeleportOwner(vector position, vector lookat) +Teleports the owner of the object that holds the script to a specified location in the region, the grid, or the hypergrid. See documentation for details. +(OpenSim only.) + + + + +integer cmSetWindlightScene(list rules) +Set the current WindLight scene. Estate managers and owners only. +(Reguires LightShare) + + +integer cmSetWindlightSceneTargeted(list rules, key target) +Set the current WindLight scene directed at a specific avatar. Estate managers and owners only. +(Reguires LightShare) + + +list cmGetWindlightScene(list rules) +Get the current WindLight settings. +(Reguires LightShare) + + + + +integer lsSetWindlightScene(list rules) +Set the current WindLight scene. Estate managers and owners only. +(Reguires LightShare) + + +integer lsSetWindlightSceneTargeted(list rules, key target) +Set the current WindLight scene directed at a specific avatar. Estate managers and owners only. +(Reguires LightShare) + + +list lsGetWindlightScene(list rules) +Get the current WindLight settings. +(Reguires LightShare) + + + + +key osNpcSaveAppearance(key npc, string notecardName) +Saves the NPC's appearance to a notecard. +(OpenSim only.) + + +osNpcLoadAppearance(key npc, string notecardName) +Loads the NPC's appearance from a notecard with appearance data. +Notecards can also be loaded by UUID. +(OpenSim only.) + + +osNpcMoveToTarget(key npc, vector position, integer options) +Moves the NPC to a target at a given vector, using options to walk or to fly there. +(OpenSim only.) + + +osNpcStopMoveTo(key npc) +Makes an NPC stop moving to a target. +(OpenSim only.) + + +key osOwnerSaveAppearance(string notecardName) +Saves the owner's appearance to a notecard inside the prim that holds the script. +(OpenSim only.) + +>>>>>>> Added the latest LSL and OSSL functions. diff --git a/indra/newview/statemachine/aievent.cpp b/indra/newview/statemachine/aievent.cpp index 0e7e9fa6e1..ec29019325 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 a90a04aaf9..34ecc4db36 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 3a3865a6e9..c85001e8be 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) diff --git a/indra/newview/statemachine/aifilepicker.cpp b/indra/newview/statemachine/aifilepicker.cpp index fdfb5a9684..38cbf69964 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 = "USERPROFILE"; #else - home = getenv("HOME"); + char const* envname = "HOME"; #endif - return home ? home : ""; + char const* home = getenv(envname); + if (!home || home[0] == '\0') + { +#if LL_WINDOWS + // On windows, the filepicker window won't pop up at all if we pass an empty string. + home = "C:\\"; +#else + home = "/"; +#endif + LL_DEBUGS("Plugin") << "context \"" << context << "\" not found, default_path empty, context \"savefile\" not found " + "and environment variable \"$" << envname << "\" empty! Returning \"" << home << "\"." << LL_ENDL; + } + else + { + LL_DEBUGS("Plugin") << "context \"" << context << "\" not found, default_path empty and context \"savefile\" not found. " + "Returning environment variable \"$" << envname << "\" (" << home << ")." << LL_ENDL; + } + return home; } }