diff --git a/.gitignore b/.gitignore index c56bf2a54..bbd3247a9 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ /bin-release /indra/viewer-* /indra/newview/vivox-runtime/ +/indra/newview/dbghelp.dll /libraries/ /lib/ *.pyc diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index d5f75fa89..a900d4c28 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -18,7 +18,7 @@ cmake_minimum_required(VERSION 2.6.2 FATAL_ERROR) cmake_policy(SET CMP0003 OLD) set(ROOT_PROJECT_NAME "Singularity" CACHE STRING - "The root project/makefile/solution name. Defaults to SecondLife.") + "The root project/makefile/solution name. Defaults to Singularity.") project(${ROOT_PROJECT_NAME}) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") diff --git a/indra/cmake/ViewerMiscLibs.cmake b/indra/cmake/ViewerMiscLibs.cmake index e52492c38..275b840a0 100644 --- a/indra/cmake/ViewerMiscLibs.cmake +++ b/indra/cmake/ViewerMiscLibs.cmake @@ -19,8 +19,3 @@ else (NOT STANDALONE) endif(LINUX AND ${ARCH} STREQUAL "x86_64") set(STANDALONE ON) endif(NOT STANDALONE) - -if (WINDOWS) - use_prebuilt_binary(dbghelp) -endif (WINDOWS) - diff --git a/indra/llcharacter/llcharacter.cpp b/indra/llcharacter/llcharacter.cpp index 6818be493..23d1fbeb3 100644 --- a/indra/llcharacter/llcharacter.cpp +++ b/indra/llcharacter/llcharacter.cpp @@ -193,21 +193,30 @@ void LLCharacter::requestStopMotion( LLMotion* motion) //----------------------------------------------------------------------------- // updateMotions() //----------------------------------------------------------------------------- +static LLFastTimer::DeclareTimer FTM_UPDATE_ANIMATION("Update Animation"); +static LLFastTimer::DeclareTimer FTM_UPDATE_HIDDEN_ANIMATION("Update Hidden Anim"); +static LLFastTimer::DeclareTimer FTM_UPDATE_MOTIONS("Update Motions"); + void LLCharacter::updateMotions(e_update_t update_type) { if (update_type == HIDDEN_UPDATE) { + LLFastTimer t(FTM_UPDATE_HIDDEN_ANIMATION); mMotionController.updateMotionsMinimal(); } else { + LLFastTimer t(FTM_UPDATE_ANIMATION); // unpause if the number of outstanding pause requests has dropped to the initial one if (mMotionController.isPaused() && mPauseRequest->getNumRefs() == 1) { mMotionController.unpauseAllMotions(); } bool force_update = (update_type == FORCE_UPDATE); - mMotionController.updateMotions(force_update); + { + LLFastTimer t(FTM_UPDATE_MOTIONS); + mMotionController.updateMotions(force_update); + } } } diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp index d040a1a22..eecbd1823 100644 --- a/indra/llcharacter/llmotioncontroller.cpp +++ b/indra/llcharacter/llmotioncontroller.cpp @@ -547,6 +547,8 @@ void LLMotionController::updateIdleActiveMotions() //----------------------------------------------------------------------------- // updateMotionsByType() //----------------------------------------------------------------------------- +static LLFastTimer::DeclareTimer FTM_MOTION_ON_UPDATE("Motion onUpdate"); + void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_type) { BOOL update_result = TRUE; @@ -704,7 +706,10 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty } // perform motion update - update_result = motionp->onUpdate(mAnimTime - motionp->mActivationTimestamp, last_joint_signature); + { + LLFastTimer t(FTM_MOTION_ON_UPDATE); + update_result = motionp->onUpdate(mAnimTime - motionp->mActivationTimestamp, last_joint_signature); + } } //********************** diff --git a/indra/llcommon/llfasttimer_class.cpp b/indra/llcommon/llfasttimer_class.cpp index 5fb9fd580..07ea31a5a 100644 --- a/indra/llcommon/llfasttimer_class.cpp +++ b/indra/llcommon/llfasttimer_class.cpp @@ -182,6 +182,7 @@ std::string LLFastTimer::sLogName = ""; BOOL LLFastTimer::sMetricLog = FALSE; LLMutex* LLFastTimer::sLogLock = NULL; std::queue LLFastTimer::sLogQueue; +const int LLFastTimer::NamedTimer::HISTORY_NUM = 300; #if LL_WINDOWS #define USE_RDTSC 1 @@ -435,16 +436,12 @@ LLFastTimer::NamedTimer::NamedTimer(const std::string& name) mFrameStateIndex = frame_state_list.size(); getFrameStateList().push_back(FrameState(this)); - mCountHistory = new U32[HISTORY_NUM]; - memset(mCountHistory, 0, sizeof(U32) * HISTORY_NUM); - mCallHistory = new U32[HISTORY_NUM]; - memset(mCallHistory, 0, sizeof(U32) * HISTORY_NUM); + mCountHistory.resize(HISTORY_NUM); + mCallHistory.resize(HISTORY_NUM); } LLFastTimer::NamedTimer::~NamedTimer() { - delete[] mCountHistory; - delete[] mCallHistory; } std::string LLFastTimer::NamedTimer::getToolTip(S32 history_idx) @@ -637,10 +634,12 @@ void LLFastTimer::NamedTimer::accumulateTimings() // update timer history int hidx = cur_frame % HISTORY_NUM; + int weight = llmin(100, cur_frame); + timerp->mCountHistory[hidx] = timerp->mTotalTimeCounter; - timerp->mCountAverage = ((U64)timerp->mCountAverage * cur_frame + timerp->mTotalTimeCounter) / (cur_frame+1); + timerp->mCountAverage = ((F64)timerp->mCountAverage * weight + (F64)timerp->mTotalTimeCounter) / (weight+1); timerp->mCallHistory[hidx] = timerp->getFrameState().mCalls; - timerp->mCallAverage = ((U64)timerp->mCallAverage * cur_frame + timerp->getFrameState().mCalls) / (cur_frame+1); + timerp->mCallAverage = ((F64)timerp->mCallAverage * weight + (F64)timerp->getFrameState().mCalls) / (weight+1); } } } @@ -776,8 +775,10 @@ void LLFastTimer::NamedTimer::reset() timer.mCountAverage = 0; timer.mCallAverage = 0; - memset(timer.mCountHistory, 0, sizeof(U32) * HISTORY_NUM); - memset(timer.mCallHistory, 0, sizeof(U32) * HISTORY_NUM); + timer.mCountHistory.clear(); + timer.mCountHistory.resize(HISTORY_NUM); + timer.mCallHistory.clear(); + timer.mCallHistory.resize(HISTORY_NUM); } } @@ -856,7 +857,8 @@ void LLFastTimer::nextFrame() if (!sPauseHistory) { NamedTimer::processTimes(); - sLastFrameIndex = sCurFrameIndex++; + sLastFrameIndex = sCurFrameIndex; + ++sCurFrameIndex; } // get ready for next frame diff --git a/indra/llcommon/llfasttimer_class.h b/indra/llcommon/llfasttimer_class.h index c6a6f59c1..aa1f8ffac 100644 --- a/indra/llcommon/llfasttimer_class.h +++ b/indra/llcommon/llfasttimer_class.h @@ -66,7 +66,7 @@ public: public: ~NamedTimer(); - enum { HISTORY_NUM = 300 }; + static const int HISTORY_NUM; const std::string& getName() const { return mName; } NamedTimer* getParent() const { return mParent; } @@ -82,8 +82,8 @@ public: void setCollapsed(bool collapsed) { mCollapsed = collapsed; } bool getCollapsed() const { return mCollapsed; } - U32 getCountAverage() const; //{ return mCountAverage } - U32 getCallAverage() const; //{ return mCallAverage } + U32 getCountAverage() const; + U32 getCallAverage() const; U32 getHistoricalCount(S32 history_index = 0) const; U32 getHistoricalCalls(S32 history_index = 0) const; @@ -122,11 +122,11 @@ public: U32 mTotalTimeCounter; - U32 mCountAverage; - U32 mCallAverage; + F64 mCountAverage; + F64 mCallAverage; - U32* mCountHistory; - U32* mCallHistory; + std::vector mCountHistory; + std::vector mCallHistory; // tree structure NamedTimer* mParent; // NamedTimer of caller(parent) @@ -258,11 +258,10 @@ public: static CurTimerData sCurTimerData; static std::string sClockType; -public: +private: static U32 getCPUClockCount32(); static U64 getCPUClockCount64(); -private: static S32 sCurFrameIndex; static S32 sLastFrameIndex; static U64 sLastFrameTime; diff --git a/indra/llcommon/llversionviewer.h.in b/indra/llcommon/llversionviewer.h.in index 82285523d..40933fcd4 100644 --- a/indra/llcommon/llversionviewer.h.in +++ b/indra/llcommon/llversionviewer.h.in @@ -35,7 +35,7 @@ const S32 LL_VERSION_MAJOR = 1; const S32 LL_VERSION_MINOR = 7; -const S32 LL_VERSION_PATCH = 1; +const S32 LL_VERSION_PATCH = 2; const S32 LL_VERSION_BUILD = ${vBUILD}; const char * const LL_CHANNEL = "${VIEWER_CHANNEL}"; diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp index 6b6fd445f..65967085f 100644 --- a/indra/llmessage/llurlrequest.cpp +++ b/indra/llmessage/llurlrequest.cpp @@ -253,6 +253,8 @@ LLIOPipe::EStatus LLURLRequest::handleError( } static LLFastTimer::DeclareTimer FTM_PROCESS_URL_REQUEST("URL Request"); +static LLFastTimer::DeclareTimer FTM_PROCESS_URL_REQUEST_GET_RESULT("Get Result"); +static LLFastTimer::DeclareTimer FTM_URL_PERFORM("Perform"); // virtual LLIOPipe::EStatus LLURLRequest::process_impl( @@ -323,7 +325,6 @@ LLIOPipe::EStatus LLURLRequest::process_impl( { PUMP_DEBUG; LLIOPipe::EStatus status = STATUS_BREAK; - static LLFastTimer::DeclareTimer FTM_URL_PERFORM("Perform"); { LLFastTimer t(FTM_URL_PERFORM); mDetail->mCurlRequest->perform(); @@ -333,8 +334,6 @@ LLIOPipe::EStatus LLURLRequest::process_impl( { CURLcode result; - static LLFastTimer::DeclareTimer FTM_PROCESS_URL_REQUEST_GET_RESULT("Get Result"); - bool newmsg = false; { LLFastTimer t(FTM_PROCESS_URL_REQUEST_GET_RESULT); diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt index ea9afec16..e377434b1 100644 --- a/indra/llplugin/slplugin/CMakeLists.txt +++ b/indra/llplugin/slplugin/CMakeLists.txt @@ -52,7 +52,14 @@ add_executable(SLPlugin set_target_properties(SLPlugin PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/slplugin_info.plist +) + +if (WINDOWS) + set_target_properties(SLPlugin + PROPERTIES + LINK_FLAGS "/OPT:NOREF" ) +endif() target_link_libraries(SLPlugin ${LLPLUGIN_LIBRARIES} diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 1c90d7658..ce130cf30 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -244,14 +244,16 @@ BOOL LLGLSLShader::createShader(vector * attributes, BOOL LLGLSLShader::attachObject(std::string object) { - if (LLShaderMgr::instance()->mShaderObjects.count(object) > 0) + std::multimap::iterator it = LLShaderMgr::instance()->mShaderObjects.begin(); + for(; it!=LLShaderMgr::instance()->mShaderObjects.end(); it++) { - stop_glerror(); - glAttachObjectARB(mProgramObject, LLShaderMgr::instance()->mShaderObjects[object]); - stop_glerror(); - return TRUE; + if((*it).first == object) + { + glAttachObjectARB(mProgramObject, (*it).second.mHandle); + stop_glerror(); + return TRUE; + } } - else { LL_WARNS("ShaderLoading") << "Attempting to attach shader object that hasn't been compiled: " << object << LL_ENDL; return FALSE; @@ -262,6 +264,20 @@ void LLGLSLShader::attachObject(GLhandleARB object) { if (object != 0) { + std::multimap::iterator it = LLShaderMgr::instance()->mShaderObjects.begin(); + for(; it!=LLShaderMgr::instance()->mShaderObjects.end(); it++) + { + if((*it).second.mHandle == object) + { + LL_DEBUGS("ShaderLoading") << "Attached: " << (*it).first << llendl; + break; + } + } + if(it == LLShaderMgr::instance()->mShaderObjects.end()) + { + LL_WARNS("ShaderLoading") << "Attached unknown shader!" << llendl; + } + stop_glerror(); glAttachObjectARB(mProgramObject, object); stop_glerror(); diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index dfac4c2af..5bf4f1f38 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -290,9 +290,11 @@ S32 LLImageGL::dataFormatComponents(S32 dataformat) //---------------------------------------------------------------------------- +static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_STATS("Image Stats"); // static void LLImageGL::updateStats(F32 current_time) { + LLFastTimer t(FTM_IMAGE_UPDATE_STATS); sLastFrameTime = current_time; sBoundTextureMemoryInBytes = sCurBoundTextureMemory; sCurBoundTextureMemory = 0; diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index c75304957..6454f92d9 100644 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -775,11 +775,8 @@ bool LLMultisampleBuffer::allocate(U32 resx, U32 resy, U32 color_fmt, bool depth //Restrict to valid sample count { mSamples = samples; - mSamples = llmin(mSamples, (U32)4); //Cap to prevent memory bloat. - mSamples = llmin(mSamples, (U32) gGLManager.mMaxIntegerSamples);//GL_RGBA - - if(depth && !stencil) - mSamples = llmin(mSamples, (U32) gGLManager.mMaxSamples); //GL_DEPTH_COMPONENT16_ARB + //mSamples = llmin(mSamples, (U32)4); //Cap to prevent memory bloat. + mSamples = llmin(mSamples, (U32) gGLManager.mMaxSamples); } if (mSamples <= 1) diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 2531df4b6..234d2e141 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -525,6 +525,14 @@ void LLShaderMgr::dumpObjectLog(GLhandleARB ret, BOOL warns) GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, S32 texture_index_channels) { + std::pair::iterator, std::multimap::iterator> range; + range = mShaderObjects.equal_range(filename); + for (std::multimap::iterator it = range.first; it != range.second;++it) + { + if((*it).second.mLevel == shader_level && (*it).second.mType == type) + return (*it).second.mHandle; + } + GLenum error = GL_NO_ERROR; if (gDebugGL) { @@ -888,7 +896,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade if (ret) { // Add shader file to map - mShaderObjects[filename] = ret; + mShaderObjects.insert(make_pair(filename,CachedObjectInfo(ret,try_gpu_class,type))); shader_level = try_gpu_class; } else diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h index b06d61b3e..fc9242f7c 100644 --- a/indra/llrender/llshadermgr.h +++ b/indra/llrender/llshadermgr.h @@ -185,8 +185,16 @@ public: virtual void updateShaderUniforms(LLGLSLShader * shader) = 0; // Pure Virtual public: + struct CachedObjectInfo + { + CachedObjectInfo(GLhandleARB handle, U32 level, GLenum type) : + mHandle(handle), mLevel(level), mType(type) {} + GLhandleARB mHandle; //Actual handle of the opengl shader object. + U32 mLevel; //Level /might/ not be needed, but it's stored to ensure there's no change in behavior. + GLenum mType; //GL_VERTEX_SHADER_ARB or GL_FRAGMENT_SHADER_ARB. Tracked because some utility shaders can be loaded as both types (carefully). + }; // Map of shader names to compiled - std::map mShaderObjects; + std::multimap mShaderObjects; //Singu Note: Packing more info here. Doing such provides capability to skip unneeded duplicate loading.. //global (reserved slot) shader parameters std::vector mReservedAttribs; diff --git a/indra/llui/lltrans.cpp b/indra/llui/lltrans.cpp index f7988c965..13721aa40 100644 --- a/indra/llui/lltrans.cpp +++ b/indra/llui/lltrans.cpp @@ -92,9 +92,15 @@ bool LLTrans::parseStrings(const std::string& xml_filename, const std::set +#include U32 NACLAntiSpamRegistry::globalAmount; U32 NACLAntiSpamRegistry::globalTime; @@ -28,6 +30,7 @@ NACLAntiSpamQueue* NACLAntiSpamRegistry::queues[NACLAntiSpamRegistry::QUEUE_MAX] std::tr1::unordered_map NACLAntiSpamRegistry::globalEntries; std::tr1::unordered_map::iterator NACLAntiSpamRegistry::it2; +// The following sounds will be ignored for purposes of spam protection. They have been gathered from wiki documentation of frequent official sounds. const std::string COLLISION_SOUNDS[] ={"dce5fdd4-afe4-4ea1-822f-dd52cac46b08","51011582-fbca-4580-ae9e-1a5593f094ec","68d62208-e257-4d0c-bbe2-20c9ea9760bb","75872e8c-bc39-451b-9b0b-042d7ba36cba","6a45ba0b-5775-4ea8-8513-26008a17f873","992a6d1b-8c77-40e0-9495-4098ce539694","2de4da5a-faf8-46be-bac6-c4d74f1e5767","6e3fb0f7-6d9c-42ca-b86b-1122ff562d7d","14209133-4961-4acc-9649-53fc38ee1667","bc4a4348-cfcc-4e5e-908e-8a52a8915fe6","9e5c1297-6eed-40c0-825a-d9bcd86e3193","e534761c-1894-4b61-b20c-658a6fb68157","8761f73f-6cf9-4186-8aaa-0948ed002db1","874a26fd-142f-4173-8c5b-890cd846c74d","0e24a717-b97e-4b77-9c94-b59a5a88b2da","75cf3ade-9a5b-4c4d-bb35-f9799bda7fb2","153c8bf7-fb89-4d89-b263-47e58b1b4774","55c3e0ce-275a-46fa-82ff-e0465f5e8703","24babf58-7156-4841-9a3f-761bdbb8e237","aca261d8-e145-4610-9e20-9eff990f2c12","0642fba6-5dcf-4d62-8e7b-94dbb529d117","25a863e8-dc42-4e8a-a357-e76422ace9b5","9538f37c-456e-4047-81be-6435045608d4","8c0f84c3-9afd-4396-b5f5-9bca2c911c20","be582e5d-b123-41a2-a150-454c39e961c8","c70141d4-ba06-41ea-bcbc-35ea81cb8335","7d1826f4-24c4-4aac-8c2e-eff45df37783","063c97d3-033a-4e9b-98d8-05c8074922cb","00000000-0000-0000-0000-000000000120"}; const int COLLISION_SOUNDS_SIZE=29; @@ -45,11 +48,11 @@ void NACLAntiSpamQueueEntry::clearEntry() entryAmount=0; blocked=false; } -U32 NACLAntiSpamQueueEntry::getEntryAmount() +U32 NACLAntiSpamQueueEntry::getEntryAmount() const { return entryAmount; } -U32 NACLAntiSpamQueueEntry::getEntryTime() +U32 NACLAntiSpamQueueEntry::getEntryTime() const { return entryTime; } @@ -65,7 +68,7 @@ void NACLAntiSpamQueueEntry::setBlocked() { blocked=true; } -bool NACLAntiSpamQueueEntry::getBlocked() +bool NACLAntiSpamQueueEntry::getBlocked() const { return blocked; } @@ -85,6 +88,14 @@ void NACLAntiSpamQueue::setTime(U32 time) { queueTime=time; } +U32 NACLAntiSpamQueue::getAmount() const +{ + return queueAmount; +} +U32 NACLAntiSpamQueue::getTime() const +{ + return queueTime; +} void NACLAntiSpamQueue::clearEntries() { for(it = entries.begin(); it != entries.end(); it++) @@ -110,6 +121,7 @@ void NACLAntiSpamQueue::blockEntry(LLUUID& source) entries[source.asString()]->setBlocked(); } int NACLAntiSpamQueue::checkEntry(LLUUID& name, U32 multiplier) +// Returns 0 if unblocked/disabled, 1 if check results in a new block, 2 if by an existing block { static LLCachedControl enabled(gSavedSettings,"AntiSpamEnabled",false); if(!enabled) return 0; @@ -141,6 +153,7 @@ int NACLAntiSpamQueue::checkEntry(LLUUID& name, U32 multiplier) } else { + //lldebugs << "[antispam] New queue entry:" << name.asString() << llendl; entries[name.asString()]=new NACLAntiSpamQueueEntry(); entries[name.asString()]->updateEntryAmount(); entries[name.asString()]->updateEntryTime(); @@ -154,8 +167,8 @@ static const char* QUEUE_NAME[NACLAntiSpamRegistry::QUEUE_MAX] = { "Chat", "Inventory", "Instant Message", -"Calling Card", -"Sound", +"calling card", +"sound", "Sound Preload", "Script Dialog", "Teleport"}; @@ -171,12 +184,14 @@ NACLAntiSpamRegistry::NACLAntiSpamRegistry(U32 time, U32 amount) queues[queue] = new NACLAntiSpamQueue(time,amount); } } +//static const char* NACLAntiSpamRegistry::getQueueName(U32 queue_id) { if(queue_id >= QUEUE_MAX) return "Unknown"; return QUEUE_NAME[queue_id]; } +//static void NACLAntiSpamRegistry::registerQueues(U32 time, U32 amount) { globalTime=time; @@ -188,16 +203,16 @@ void NACLAntiSpamRegistry::registerQueues(U32 time, U32 amount) queues[queue] = new NACLAntiSpamQueue(time,amount); } } -void NACLAntiSpamRegistry::registerQueue(U32 name, U32 time, U32 amount) +//static +/*void NACLAntiSpamRegistry::registerQueue(U32 name, U32 time, U32 amount) { - /* it=queues.find(name); if(it == queues.end()) { queues[name]=new NACLAntiSpamQueue(time,amount); } - */ -} +}*/ +//static void NACLAntiSpamRegistry::setRegisteredQueueTime(U32 name, U32 time) { if(name >= QUEUE_MAX || queues[name] == 0) @@ -208,6 +223,7 @@ void NACLAntiSpamRegistry::setRegisteredQueueTime(U32 name, U32 time) queues[name]->setTime(time); } +//static void NACLAntiSpamRegistry::setRegisteredQueueAmount(U32 name, U32 amount) { if(name >= QUEUE_MAX || queues[name] == 0) @@ -218,23 +234,28 @@ void NACLAntiSpamRegistry::setRegisteredQueueAmount(U32 name, U32 amount) queues[name]->setAmount(amount); } +//static void NACLAntiSpamRegistry::setAllQueueTimes(U32 time) { globalTime=time; for(int queue = 0; queue < QUEUE_MAX; ++queue) - queues[queue]->setTime(time); + if( queues[queue] ) + queues[queue]->setTime(time); } +//static void NACLAntiSpamRegistry::setAllQueueAmounts(U32 amount) { globalAmount=amount; for(int queue = 0; queue < QUEUE_MAX; ++queue) { + if(!queues[queue]) continue; if(queue == QUEUE_SOUND || queue == QUEUE_SOUND_PRELOAD) queues[queue]->setAmount(amount*5); else queues[queue]->setAmount(amount); } } +//static void NACLAntiSpamRegistry::clearRegisteredQueue(U32 name) { if(name >= QUEUE_MAX || queues[name] == 0) @@ -245,6 +266,7 @@ void NACLAntiSpamRegistry::clearRegisteredQueue(U32 name) queues[name]->clearEntries(); } +//static void NACLAntiSpamRegistry::purgeRegisteredQueue(U32 name) { if(name >= QUEUE_MAX || queues[name] == 0) @@ -255,6 +277,7 @@ void NACLAntiSpamRegistry::purgeRegisteredQueue(U32 name) queues[name]->purgeEntries(); } +//static void NACLAntiSpamRegistry::blockOnQueue(U32 name, LLUUID& source) { if(bGlobalQueue) @@ -271,6 +294,7 @@ void NACLAntiSpamRegistry::blockOnQueue(U32 name, LLUUID& source) queues[name]->blockEntry(source); } } +//static void NACLAntiSpamRegistry::blockGlobalEntry(LLUUID& source) { it2=globalEntries.find(source.asString()); @@ -280,13 +304,13 @@ void NACLAntiSpamRegistry::blockGlobalEntry(LLUUID& source) } globalEntries[source.asString()]->setBlocked(); } +//static bool NACLAntiSpamRegistry::checkQueue(U32 name, LLUUID& source, U32 multiplier) +//returns true if blocked { - if(source.isNull()) return false; - if(gAgent.getID() == source) return false; + if(source.isNull() || gAgent.getID() == source) return false; LLViewerObject *obj=gObjectList.findObject(source); - if(obj) - if(obj->permYouOwner()) return false; + if(obj && obj->permYouOwner()) return false; int result; if(bGlobalQueue) @@ -302,40 +326,45 @@ bool NACLAntiSpamRegistry::checkQueue(U32 name, LLUUID& source, U32 multiplier) } result=queues[name]->checkEntry(source,multiplier); } - if(result==0) - { + if(result == 0) //Safe return false; - } - else if(result==2) + else if(result == 2) //Previously blocked { return true; } - else + else //Just blocked! { if(gSavedSettings.getBOOL("AntiSpamNotify")) { - LLSD args; - args["MESSAGE"] = std::string(getQueueName(name))+": Blocked object "+source.asString(); - LLNotificationsUtil::add("SystemMessageTip", args); + LLSD args; + args["SOURCE"] = source.asString().c_str(); + args["TYPE"] = LLTrans::getString(getQueueName(name)); + args["AMOUNT"] = boost::lexical_cast(multiplier * queues[name]->getAmount()); + args["TIME"] = boost::lexical_cast(queues[name]->getTime()); + LLNotificationsUtil::add("AntiSpamBlock", args); } return true; } } // Global queue stoof +//static void NACLAntiSpamRegistry::setGlobalQueue(bool value) { NACLAntiSpamRegistry::purgeAllQueues(); bGlobalQueue=value; } +//static void NACLAntiSpamRegistry::setGlobalAmount(U32 amount) { globalAmount=amount; } +//static void NACLAntiSpamRegistry::setGlobalTime(U32 time) { globalTime=time; } +//static void NACLAntiSpamRegistry::clearAllQueues() { if(bGlobalQueue) @@ -343,9 +372,10 @@ void NACLAntiSpamRegistry::clearAllQueues() else for(int queue = 0; queue < QUEUE_MAX; ++queue) { - queues[queue]->clearEntries(); + if(queues[queue]) queues[queue]->clearEntries(); } } +//static void NACLAntiSpamRegistry::purgeAllQueues() { if(bGlobalQueue) @@ -353,9 +383,11 @@ void NACLAntiSpamRegistry::purgeAllQueues() else for(int queue = 0; queue < QUEUE_MAX; ++queue) { - queues[queue]->purgeEntries(); + if(queues[queue]) queues[queue]->purgeEntries(); } + llinfos << "AntiSpam Queues Purged" << llendl; } +//static int NACLAntiSpamRegistry::checkGlobalEntry(LLUUID& name, U32 multiplier) { static LLCachedControl enabled(gSavedSettings,"AntiSpamEnabled",false); @@ -391,6 +423,7 @@ int NACLAntiSpamRegistry::checkGlobalEntry(LLUUID& name, U32 multiplier) return 0; } } +//static void NACLAntiSpamRegistry::clearGlobalEntries() { for(it2 = globalEntries.begin(); it2 != globalEntries.end(); it2++) @@ -398,6 +431,7 @@ void NACLAntiSpamRegistry::clearGlobalEntries() it2->second->clearEntry(); } } +//static void NACLAntiSpamRegistry::purgeGlobalEntries() { for(it2 = globalEntries.begin(); it2 != globalEntries.end(); it2++) @@ -407,16 +441,21 @@ void NACLAntiSpamRegistry::purgeGlobalEntries() } globalEntries.clear(); } + +//Handlers +//static bool NACLAntiSpamRegistry::handleNaclAntiSpamGlobalQueueChanged(const LLSD& newvalue) { setGlobalQueue(newvalue.asBoolean()); return true; } +//static bool NACLAntiSpamRegistry::handleNaclAntiSpamTimeChanged(const LLSD& newvalue) { setAllQueueTimes(newvalue.asInteger()); return true; } +//static bool NACLAntiSpamRegistry::handleNaclAntiSpamAmountChanged(const LLSD& newvalue) { setAllQueueAmounts(newvalue.asInteger()); diff --git a/indra/newview/NACLantispam.h b/indra/newview/NACLantispam.h index 6da32f5c1..e0476e267 100644 --- a/indra/newview/NACLantispam.h +++ b/indra/newview/NACLantispam.h @@ -25,11 +25,11 @@ class NACLAntiSpamQueueEntry protected: NACLAntiSpamQueueEntry(); void clearEntry(); - U32 getEntryAmount(); - U32 getEntryTime(); + U32 getEntryAmount() const; + U32 getEntryTime() const; void updateEntryAmount(); void updateEntryTime(); - bool getBlocked(); + bool getBlocked() const; void setBlocked(); private: U32 entryAmount; @@ -39,6 +39,9 @@ private: class NACLAntiSpamQueue { friend class NACLAntiSpamRegistry; +public: + U32 getAmount() const; + U32 getTime() const; protected: NACLAntiSpamQueue(U32 time, U32 amount); void setAmount(U32 amount); @@ -58,7 +61,7 @@ class NACLAntiSpamRegistry public: NACLAntiSpamRegistry(U32 time=2, U32 amount=10); static void registerQueues(U32 time=2, U32 amount=10); - static void registerQueue(U32 name, U32 time, U32 amount); +// static void registerQueue(U32 name, U32 time, U32 amount); static void setRegisteredQueueTime(U32 name, U32 time); static void setRegisteredQueueAmount(U32 name,U32 amount); static void setAllQueueTimes(U32 amount); diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 36279ab1f..0687366e4 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9,6 +9,17 @@ settings_rlv.xml + SGAllowRiggedMeshSelection + + Comment + Allow selection of your worn rigged meshes in build mode + Persist + 1 + Type + Boolean + Value + 0 + SGShiftCrouchToggle Comment @@ -20,7 +31,6 @@ Value 1 - SGServerVersionChangedNotification Comment @@ -1032,7 +1042,7 @@ _NACL_AntiSpamGlobalQueue Comment - Collect spamtypes together, instead of individually counting them + Collect spamtypes together, instead of individually counting them; Use in cases of extreme spam, only. Persist 1 Type @@ -1043,7 +1053,7 @@ _NACL_AntiSpamTime Comment - Time in seconds for spamtype to accumulate the _NACL_AntiSpamAmount and be blocked + Time in seconds for spamtype to accumulate to more than _NACL_AntiSpamAmount and be blocked Persist 1 Type @@ -1054,7 +1064,7 @@ _NACL_AntiSpamAmount Comment - Amount of spamtype to be reached before the blocking will occur. + Count of spamtype to be reached during _NACL_AntiSpamTime before the spam blocking will occur. Persist 1 Type @@ -1065,7 +1075,7 @@ _NACL_AntiSpamSoundMulti Comment - + Multiplier for _NACL_AntiSpamTime for sounds heard in _NACL_AntiSpamTime interval needed to trigger a block, since sounds are more common than messages Persist 1 Type @@ -1076,18 +1086,18 @@ _NACL_AntiSpamNewlines Comment - How many newlines a message can have before it's considered spam. + How many newlines a message is allowed to have without being considered spam. Persist 1 Type U32 Value - 20 + 70 _NACL_AntiSpamSoundPreloadMulti Comment - + Multiplier for _NACL_AntiSpamTime for sounds preloaded in _NACL_AntiSpamTime interval needed to trigger a block, since sound preloads are more common than messages Persist 1 Type diff --git a/indra/newview/chatbar_as_cmdline.cpp b/indra/newview/chatbar_as_cmdline.cpp index a0051de59..5f416241c 100644 --- a/indra/newview/chatbar_as_cmdline.cpp +++ b/indra/newview/chatbar_as_cmdline.cpp @@ -210,7 +210,24 @@ bool stort_calls(const std::pair& left, const std::pair sAscentCmdLine(gSavedSettings, "AscentCmdLine"); + static LLCachedControl sAscentCmdLinePos(gSavedSettings, "AscentCmdLinePos"); + static LLCachedControl sAscentCmdLineDrawDistance(gSavedSettings, "AscentCmdLineDrawDistance"); + static LLCachedControl sAscentCmdTeleportToCam(gSavedSettings, "AscentCmdTeleportToCam"); + static LLCachedControl sAscentCmdLineKeyToName(gSavedSettings, "AscentCmdLineKeyToName"); + static LLCachedControl sAscentCmdLineOfferTp(gSavedSettings, "AscentCmdLineOfferTp"); + static LLCachedControl sAscentCmdLineGround(gSavedSettings, "AscentCmdLineGround"); + static LLCachedControl sAscentCmdLineHeight(gSavedSettings, "AscentCmdLineHeight"); + static LLCachedControl sAscentCmdLineTeleportHome(gSavedSettings, "AscentCmdLineTeleportHome"); + static LLCachedControl sAscentCmdLineRezPlatform(gSavedSettings, "AscentCmdLineRezPlatform"); + static LLCachedControl sAscentCmdLineMapTo(gSavedSettings, "AscentCmdLineMapTo"); + static LLCachedControl sAscentCmdLineMapToKeepPos(gSavedSettings, "AscentMapToKeepPos"); + static LLCachedControl sAscentCmdLineCalc(gSavedSettings, "AscentCmdLineCalc"); + static LLCachedControl sAscentCmdLineTP2(gSavedSettings, "AscentCmdLineTP2"); + static LLCachedControl sSinguCmdLineClearChat(gSavedSettings, "SinguCmdLineAway"); + static LLCachedControl sAscentCmdLineClearChat(gSavedSettings, "AscentCmdLineClearChat"); + + if(sAscentCmdLine) { std::istringstream i(revised_text); std::string command; @@ -218,7 +235,7 @@ bool cmd_line_chat(std::string revised_text, EChatType type) command = utf8str_tolower(command); if(command != "") { - if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdLinePos"))) + if(command == utf8str_tolower(sAscentCmdLinePos)) { F32 x,y,z; if (i >> x) @@ -241,74 +258,73 @@ bool cmd_line_chat(std::string revised_text, EChatType type) } } } - else if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdLineDrawDistance"))) + else if(command == utf8str_tolower(sAscentCmdLineDrawDistance)) { - int drawDist; - if(i >> drawDist) - { - gSavedSettings.setF32("RenderFarClip", drawDist); - gAgentCamera.mDrawDistance=drawDist; - char buffer[DB_IM_MSG_BUF_SIZE * 2]; /* Flawfinder: ignore */ - snprintf(buffer,sizeof(buffer),"Draw distance set to: %dm",drawDist); + int drawDist; + if(i >> drawDist) + { + gSavedSettings.setF32("RenderFarClip", drawDist); + gAgentCamera.mDrawDistance=drawDist; + char buffer[DB_IM_MSG_BUF_SIZE * 2]; /* Flawfinder: ignore */ + snprintf(buffer,sizeof(buffer),"Draw distance set to: %dm",drawDist); cmdline_printchat(std::string(buffer)); return false; - } + } } - else if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdTeleportToCam"))) - { + else if(command == utf8str_tolower(sAscentCmdTeleportToCam)) + { gAgent.teleportViaLocation(gAgentCamera.getCameraPositionGlobal()); return false; - } - else if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdLineKeyToName"))) - { - LLUUID targetKey; - if(i >> targetKey) - { - std::string object_name; - gCacheName->getFullName(targetKey, object_name); - char buffer[DB_IM_MSG_BUF_SIZE * 2]; /* Flawfinder: ignore */ - snprintf(buffer,sizeof(buffer),"%s: (%s)",targetKey.asString().c_str(), object_name.c_str()); + } + else if(command == utf8str_tolower(sAscentCmdLineKeyToName)) + { + LLUUID targetKey; + if(i >> targetKey) + { + std::string object_name; + gCacheName->getFullName(targetKey, object_name); + char buffer[DB_IM_MSG_BUF_SIZE * 2]; /* Flawfinder: ignore */ + snprintf(buffer,sizeof(buffer),"%s: (%s)",targetKey.asString().c_str(), object_name.c_str()); cmdline_printchat(std::string(buffer)); - } + } return false; - } - else if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdLineOfferTp"))) - { - std::string avatarKey; + } + else if(command == utf8str_tolower(sAscentCmdLineOfferTp)) + { + std::string avatarKey; // llinfos << "CMD DEBUG 0 " << command << " " << avatarName << llendl; - if(i >> avatarKey) - { + if(i >> avatarKey) + { // llinfos << "CMD DEBUG 0 afterif " << command << " " << avatarName << llendl; - LLUUID tempUUID; - if(LLUUID::parseUUID(avatarKey, &tempUUID)) - { - char buffer[DB_IM_MSG_BUF_SIZE * 2]; /* Flawfinder: ignore */ - LLDynamicArray ids; - ids.push_back(tempUUID); - std::string tpMsg="Join me!"; - LLMessageSystem* msg = gMessageSystem; - msg->newMessageFast(_PREHASH_StartLure); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_Info); - msg->addU8Fast(_PREHASH_LureType, (U8)0); + LLUUID tempUUID; + if(LLUUID::parseUUID(avatarKey, &tempUUID)) + { + char buffer[DB_IM_MSG_BUF_SIZE * 2]; /* Flawfinder: ignore */ + LLDynamicArray ids; + ids.push_back(tempUUID); + std::string tpMsg="Join me!"; + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_StartLure); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->nextBlockFast(_PREHASH_Info); + msg->addU8Fast(_PREHASH_LureType, (U8)0); - msg->addStringFast(_PREHASH_Message, tpMsg); - for(LLDynamicArray::iterator itr = ids.begin(); itr != ids.end(); ++itr) - { - msg->nextBlockFast(_PREHASH_TargetData); - msg->addUUIDFast(_PREHASH_TargetID, *itr); - } - gAgent.sendReliableMessage(); - snprintf(buffer,sizeof(buffer),"Offered TP to key %s",tempUUID.asString().c_str()); + msg->addStringFast(_PREHASH_Message, tpMsg); + for(LLDynamicArray::iterator itr = ids.begin(); itr != ids.end(); ++itr) + { + msg->nextBlockFast(_PREHASH_TargetData); + msg->addUUIDFast(_PREHASH_TargetID, *itr); + } + gAgent.sendReliableMessage(); + snprintf(buffer,sizeof(buffer),"Offered TP to key %s",tempUUID.asString().c_str()); cmdline_printchat(std::string(buffer)); return false; - } - } - } - - else if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdLineGround"))) + } + } + } + else if(command == utf8str_tolower(sAscentCmdLineGround)) { LLVector3 agentPos = gAgent.getPositionAgent(); U64 agentRegion = gAgent.getRegion()->getHandle(); @@ -317,7 +333,8 @@ bool cmd_line_chat(std::string revised_text, EChatType type) pos_global += LLVector3d((F64)targetPos.mV[0],(F64)targetPos.mV[1],(F64)targetPos.mV[2]); gAgent.teleportViaLocation(pos_global); return false; - }else if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdLineHeight"))) + } + else if(command == utf8str_tolower(sAscentCmdLineHeight)) { F32 z; if(i >> z) @@ -330,17 +347,20 @@ bool cmd_line_chat(std::string revised_text, EChatType type) gAgent.teleportViaLocation(pos_global); return false; } - }else if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdLineTeleportHome"))) + } + else if(command == utf8str_tolower(sAscentCmdLineTeleportHome)) { gAgent.teleportHome(); return false; - }else if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdLineRezPlatform"))) - { + } + else if(command == utf8str_tolower(sAscentCmdLineRezPlatform)) + { F32 width; if (i >> width) cmdline_rezplat(false, width); else cmdline_rezplat(); return false; - }else if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdLineMapTo"))) + } + else if(command == utf8str_tolower(sAscentCmdLineMapTo)) { if (revised_text.length() > command.length() + 1) //Typing this command with no argument was causing a crash. -Madgeek { @@ -351,7 +371,7 @@ bool cmd_line_chat(std::string revised_text, EChatType type) std::string region_name = LLWeb::escapeURL(revised_text.substr(command.length()+1)); std::string url; - if(!gSavedSettings.getBOOL("AscentMapToKeepPos")) + if(!sAscentCmdLineMapToKeepPos) { agent_x = 128; agent_y = 128; @@ -362,7 +382,8 @@ bool cmd_line_chat(std::string revised_text, EChatType type) LLURLDispatcher::dispatch(url, NULL, true); } return false; - }else if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdLineCalc")))//Cryogenic Blitz + } + else if(command == utf8str_tolower(sAscentCmdLineCalc))//Cryogenic Blitz { bool success; F32 result = 0.f; @@ -391,7 +412,8 @@ bool cmd_line_chat(std::string revised_text, EChatType type) cmdline_printchat(out); return false; } - }else if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdLineTP2"))) + } + else if(command == utf8str_tolower(sAscentCmdLineTP2)) { if (revised_text.length() > command.length() + 1) //Typing this command with no argument was causing a crash. -Madgeek { @@ -399,11 +421,13 @@ bool cmd_line_chat(std::string revised_text, EChatType type) cmdline_tp2name(name); } return false; - }else if(command == utf8str_tolower(gSavedSettings.getString("SinguCmdLineAway"))) + } + else if(command == utf8str_tolower(sSinguCmdLineClearChat)) { handle_fake_away_status(NULL); return false; - }else if(command == "typingstop") + } + else if(command == "typingstop") { std::string text; if(i >> text) @@ -411,7 +435,7 @@ bool cmd_line_chat(std::string revised_text, EChatType type) gChatBar->sendChatFromViewer(text, CHAT_TYPE_STOP, FALSE); } } - else if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdLineClearChat"))) + else if(command == utf8str_tolower(sAscentCmdLineClearChat)) { LLFloaterChat* chat = LLFloaterChat::getInstance(LLSD()); if(chat) @@ -422,7 +446,8 @@ bool cmd_line_chat(std::string revised_text, EChatType type) history_editor_with_mute->clear(); return false; } - }else if(command == "invrepair") + } + else if(command == "invrepair") { invrepair(); } @@ -513,55 +538,61 @@ void cmdline_tp2name(std::string target) void cmdline_rezplat(bool use_saved_value, F32 visual_radius) //cmdline_rezplat() will still work... just will use the saved value { - LLVector3 agentPos = gAgent.getPositionAgent()+(gAgent.getVelocity()*(F32)0.333); - LLMessageSystem* msg = gMessageSystem; - msg->newMessageFast(_PREHASH_ObjectAdd); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->addUUIDFast(_PREHASH_GroupID, gAgent.getGroupID()); - msg->nextBlockFast(_PREHASH_ObjectData); - msg->addU8Fast(_PREHASH_PCode, LL_PCODE_VOLUME); - msg->addU8Fast(_PREHASH_Material, LL_MCODE_METAL); + LLVector3 agentPos = gAgent.getPositionAgent()+(gAgent.getVelocity()*(F32)0.333); + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_ObjectAdd); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->addUUIDFast(_PREHASH_GroupID, gAgent.getGroupID()); + msg->nextBlockFast(_PREHASH_ObjectData); + msg->addU8Fast(_PREHASH_PCode, LL_PCODE_VOLUME); + msg->addU8Fast(_PREHASH_Material, LL_MCODE_METAL); - if(agentPos.mV[2] > 4096.0)msg->addU32Fast(_PREHASH_AddFlags, FLAGS_CREATE_SELECTED); - else msg->addU32Fast(_PREHASH_AddFlags, 0); + if(agentPos.mV[2] > 4096.0) + msg->addU32Fast(_PREHASH_AddFlags, FLAGS_CREATE_SELECTED); + else + msg->addU32Fast(_PREHASH_AddFlags, 0); - LLVolumeParams volume_params; + LLVolumeParams volume_params; - volume_params.setType( LL_PCODE_PROFILE_CIRCLE, LL_PCODE_PATH_CIRCLE_33 ); - volume_params.setRatio ( 2, 2 ); - volume_params.setShear ( 0, 0 ); - volume_params.setTaper(2.0f,2.0f); - volume_params.setTaperX(0.f); - volume_params.setTaperY(0.f); + volume_params.setType( LL_PCODE_PROFILE_CIRCLE, LL_PCODE_PATH_CIRCLE_33 ); + volume_params.setRatio( 2, 2 ); + volume_params.setShear( 0, 0 ); + volume_params.setTaper(2.0f,2.0f); + volume_params.setTaperX(0.f); + volume_params.setTaperY(0.f); - LLVolumeMessage::packVolumeParams(&volume_params, msg); - LLVector3 rezpos = agentPos - LLVector3(0.0f,0.0f,2.5f); - LLQuaternion rotation; - rotation.setQuat(90.f * DEG_TO_RAD, LLVector3::y_axis); + LLVolumeMessage::packVolumeParams(&volume_params, msg); + LLVector3 rezpos = agentPos - LLVector3(0.0f,0.0f,2.5f); + LLQuaternion rotation; + rotation.setQuat(90.f * DEG_TO_RAD, LLVector3::y_axis); + + if (use_saved_value) + { + visual_radius = gSavedSettings.getF32("AscentPlatformSize"); + } - if (use_saved_value) visual_radius = gSavedSettings.getF32("AscentPlatformSize"); F32 realsize = visual_radius / 3.0f; if (realsize < 0.01f) realsize = 0.01f; else if (realsize > 10.0f) realsize = 10.0f; - msg->addVector3Fast(_PREHASH_Scale, LLVector3(0.01f,realsize,realsize) ); - msg->addQuatFast(_PREHASH_Rotation, rotation ); - msg->addVector3Fast(_PREHASH_RayStart, rezpos ); - msg->addVector3Fast(_PREHASH_RayEnd, rezpos ); - msg->addU8Fast(_PREHASH_BypassRaycast, (U8)1 ); - msg->addU8Fast(_PREHASH_RayEndIsIntersection, (U8)FALSE ); - msg->addU8Fast(_PREHASH_State, 0); - msg->addUUIDFast(_PREHASH_RayTargetID, LLUUID::null ); - msg->sendReliable(gAgent.getRegionHost()); + msg->addVector3Fast(_PREHASH_Scale, LLVector3(0.01f,realsize,realsize) ); + msg->addQuatFast(_PREHASH_Rotation, rotation ); + msg->addVector3Fast(_PREHASH_RayStart, rezpos ); + msg->addVector3Fast(_PREHASH_RayEnd, rezpos ); + msg->addU8Fast(_PREHASH_BypassRaycast, (U8)1 ); + msg->addU8Fast(_PREHASH_RayEndIsIntersection, (U8)FALSE ); + msg->addU8Fast(_PREHASH_State, 0); + msg->addUUIDFast(_PREHASH_RayTargetID, LLUUID::null ); + msg->sendReliable(gAgent.getRegionHost()); } void cmdline_printchat(std::string message) { - LLChat chat; - chat.mText = message; + LLChat chat; + chat.mText = message; chat.mSourceType = CHAT_SOURCE_SYSTEM; - LLFloaterChat::addChat(chat, FALSE, FALSE); + LLFloaterChat::addChat(chat, FALSE, FALSE); } diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 955a420c6..73ebdac82 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -316,10 +316,10 @@ BOOL gLogoutInProgress = FALSE; // Internal globals... that should be removed. static std::string gArgs; -const std::string MARKER_FILE_NAME("SecondLife.exec_marker"); -const std::string ERROR_MARKER_FILE_NAME("SecondLife.error_marker"); -const std::string LLERROR_MARKER_FILE_NAME("SecondLife.llerror_marker"); -const std::string LOGOUT_MARKER_FILE_NAME("SecondLife.logout_marker"); +const std::string MARKER_FILE_NAME("Singularity.exec_marker"); +const std::string ERROR_MARKER_FILE_NAME("Singularity.error_marker"); +const std::string LLERROR_MARKER_FILE_NAME("Singularity.llerror_marker"); +const std::string LOGOUT_MARKER_FILE_NAME("Singularity.logout_marker"); static BOOL gDoDisconnect = FALSE; // //static BOOL gBusyDisconnect = FALSE; @@ -1017,6 +1017,8 @@ void LLAppViewer::checkMemory() static LLFastTimer::DeclareTimer FTM_MESSAGES("System Messages"); static LLFastTimer::DeclareTimer FTM_SLEEP("Sleep"); +static LLFastTimer::DeclareTimer FTM_YIELD("Yield"); + static LLFastTimer::DeclareTimer FTM_TEXTURE_CACHE("Texture Cache"); static LLFastTimer::DeclareTimer FTM_DECODE("Image Decode"); static LLFastTimer::DeclareTimer FTM_VFS("VFS Thread"); @@ -1084,7 +1086,7 @@ bool LLAppViewer::mainLoop() LLFastTimer t2(FTM_MESSAGES); gViewerWindow->getWindow()->processMiscNativeEvents(); } - + pingMainloopTimeout("Main:GatherInput"); if (gViewerWindow) @@ -1207,6 +1209,7 @@ bool LLAppViewer::mainLoop() // yield some time to the os based on command line option if(mYieldTime >= 0) { + LLFastTimer t(FTM_YIELD); ms_sleep(mYieldTime); } @@ -1869,15 +1872,15 @@ bool LLAppViewer::initLogging() // Remove the last ".old" log file. std::string old_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, - "SecondLife.old"); + "Singularity.old"); LLFile::remove(old_log_file); // Rename current log file to ".old" std::string log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, - "SecondLife.log"); + "Singularity.log"); LLFile::rename(log_file, old_log_file); - // Set the log file to SecondLife.log + // Set the log file to Singularity.log LLError::logToFile(log_file); @@ -2931,10 +2934,10 @@ void LLAppViewer::initMarkerFile() LL_DEBUGS("MarkerFile") << "Checking marker file for lock..." << LL_ENDL; //We've got 4 things to test for here - // - Other Process Running (SecondLife.exec_marker present, locked) - // - Freeze (SecondLife.exec_marker present, not locked) - // - LLError Crash (SecondLife.llerror_marker present) - // - Other Crash (SecondLife.error_marker present) + // - Other Process Running (Singularity.exec_marker present, locked) + // - Freeze (Singularity.exec_marker present, not locked) + // - LLError Crash (Singularity.llerror_marker present) + // - Other Crash (Singularity.error_marker present) // These checks should also remove these files for the last 2 cases if they currently exist //LLError/Error checks. Only one of these should ever happen at a time. diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 3e818faa4..e74bacaa8 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -99,7 +99,6 @@ S32 AVATAR_OFFSET_TEX0 = 32; S32 AVATAR_OFFSET_TEX1 = 40; S32 AVATAR_VERTEX_BYTES = 48; - BOOL gAvatarEmbossBumpMap = FALSE; static BOOL sRenderingSkinned = FALSE; S32 normal_channel = -1; @@ -1040,9 +1039,12 @@ void LLDrawPoolAvatar::endDeferredSkinned() gGL.getTexUnit(0)->activate(); } +static LLFastTimer::DeclareTimer FTM_RENDER_AVATARS("renderAvatars"); void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) { + LLFastTimer t(FTM_RENDER_AVATARS); + if (pass == -1) { for (S32 i = 1; i < getNumPasses(); i++) @@ -1546,8 +1548,12 @@ void LLDrawPoolAvatar::renderDeferredRiggedBump(LLVOAvatar* avatar) renderRigged(avatar, RIGGED_DEFERRED_BUMP); } +static LLFastTimer::DeclareTimer FTM_RIGGED_VBO("Rigged VBO"); + void LLDrawPoolAvatar::updateRiggedVertexBuffers(LLVOAvatar* avatar) { + LLFastTimer t(FTM_RIGGED_VBO); + //update rigged vertex buffers for (U32 type = 0; type < NUM_RIGGED_PASSES; ++type) { diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index 60af91ac8..dd8b4e80c 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -1598,16 +1598,18 @@ void LLDrawPoolInvisible::renderDeferred( S32 pass ) } LLFastTimer t(FTM_RENDER_INVISIBLE); - + + gOcclusionProgram.bind(); + U32 invisi_mask = LLVertexBuffer::MAP_VERTEX; glStencilMask(0); - glStencilOp(GL_ZERO, GL_KEEP, GL_REPLACE); gGL.setColorMask(false, false); pushBatches(LLRenderPass::PASS_INVISIBLE, invisi_mask, FALSE); gGL.setColorMask(true, true); - glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); glStencilMask(0xFFFFFFFF); + gOcclusionProgram.unbind(); + if (gPipeline.hasRenderBatches(LLRenderPass::PASS_INVISI_SHINY)) { beginShiny(true); diff --git a/indra/newview/llenvmanager.cpp b/indra/newview/llenvmanager.cpp index f3ffe732f..7e5377bd1 100644 --- a/indra/newview/llenvmanager.cpp +++ b/indra/newview/llenvmanager.cpp @@ -494,11 +494,13 @@ void LLEnvManagerNew::onRegionSettingsResponse(const LLSD& content) // Load region sky presets. LLWLParamManager::instance().refreshRegionPresets(); - // Not possible to assume M7WL should take precidence as OpenSim will send both - // bool bOverridden = M7WindlightInterface::getInstance()->hasOverride(); + bool bOverridden = M7WindlightInterface::getInstance()->hasOverride(); // If using server settings, update managers. - if (getUseRegionSettings()) +// if (getUseRegionSettings()) +// [RLVa:KB] - Checked: 2011-08-29 (RLVa-1.4.1a) | Added: RLVa-1.4.1a + if (!bOverridden && (getUseRegionSettings()) && (LLWLParamManager::getInstance()->mAnimator.getIsRunning()) ) +// [/RLVa:KB] { updateManagersFromPrefs(mInterpNextChangeMessage); } diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 42a14b7f6..eeb53a98d 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -103,6 +103,10 @@ LLFastTimerView::LLFastTimerView(const std::string& name, const LLRect& rect) FTV_NUM_TIMERS = LLFastTimer::NamedTimer::instanceCount(); mPrintStats = -1; mAverageCyclesPerTimer = 0; + // Making the ledgend part of fast timers scrollable + mOverLegend = false; + mScrollOffset = 0; + // LLUICtrlFactory::getInstance()->buildFloater(this, "floater_fast_timers.xml"); } @@ -258,6 +262,7 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) } mHoverTimer = NULL; mHoverID = NULL; + mOverLegend = false; // Making the ledgend part of fast timers scrollable if(LLFastTimer::sPauseHistory && mBarRect.pointInRect(x, y)) { @@ -311,6 +316,7 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) { mHoverID = timer_id; } + mOverLegend = true; // Making the ledgend part of fast timers scrollable } return LLFloater::handleHover(x, y, mask); @@ -358,10 +364,36 @@ BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* stic BOOL LLFastTimerView::handleScrollWheel(S32 x, S32 y, S32 clicks) { - LLFastTimer::sPauseHistory = TRUE; - mScrollIndex = llclamp( mScrollIndex + clicks, - 0, - llmin(LLFastTimer::getLastFrameIndex(), (S32)LLFastTimer::NamedTimer::HISTORY_NUM - MAX_VISIBLE_HISTORY)); + //LLFastTimer::sPauseHistory = TRUE; + //mScrollIndex = llclamp( mScrollIndex + clicks, + //0, + //llmin(LLFastTimer::getLastFrameIndex(), (S32)LLFastTimer::NamedTimer::HISTORY_NUM - MAX_VISIBLE_HISTORY)); + // Making the ledgend part of fast timers scrollable + if(mOverLegend) + { + mScrollOffset += clicks; + S32 count = 0; + for (timer_tree_iterator_t it = begin_timer_tree(LLFastTimer::NamedTimer::getRootNamedTimer()); + it != timer_tree_iterator_t(); + ++it) + { + count++; + LLFastTimer::NamedTimer* idp = (*it); + if (idp->getCollapsed()) + { + it.skipDescendants(); + } + } + mScrollOffset = llclamp(mScrollOffset,0,count-5); + } + else + { + LLFastTimer::sPauseHistory = TRUE; + mScrollIndex = llclamp( mScrollIndex + clicks, + 0, + llmin(LLFastTimer::getLastFrameIndex(), (S32)LLFastTimer::NamedTimer::HISTORY_NUM - MAX_VISIBLE_HISTORY)); + } + // return TRUE; } @@ -479,11 +511,23 @@ void LLFastTimerView::draw() S32 cur_line = 0; ft_display_idx.clear(); std::map display_line; + S32 mScrollOffset_tmp = mScrollOffset; // Making the ledgend part of fast timers scrollable for (timer_tree_iterator_t it = begin_timer_tree(LLFastTimer::NamedTimer::getRootNamedTimer()); it != timer_tree_iterator_t(); ++it) { LLFastTimer::NamedTimer* idp = (*it); + // Making the ledgend part of fast timers scrollable + if(mScrollOffset_tmp) + { + --mScrollOffset_tmp; + if (idp->getCollapsed()) + { + it.skipDescendants(); + } + continue; + } + // display_line[idp] = cur_line; ft_display_idx.push_back(idp); cur_line++; diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h index 04fa500e1..47972b272 100644 --- a/indra/newview/llfasttimerview.h +++ b/indra/newview/llfasttimerview.h @@ -99,6 +99,11 @@ private: S32 mPrintStats; S32 mAverageCyclesPerTimer; LLRect mGraphRect; + + // Making the ledgend part of fast timers scrollable + bool mOverLegend; + S32 mScrollOffset; + // }; #endif diff --git a/indra/newview/llfloateractivespeakers.cpp b/indra/newview/llfloateractivespeakers.cpp index f0f856ef0..1d1fb1ebf 100644 --- a/indra/newview/llfloateractivespeakers.cpp +++ b/indra/newview/llfloateractivespeakers.cpp @@ -35,7 +35,9 @@ #include "llfloateractivespeakers.h" #include "llagent.h" -#include "llvoavatar.h" +#include "llappviewer.h" +#include "llimview.h" +#include "llsdutil.h" #include "llfloateravatarinfo.h" #include "lluictrlfactory.h" #include "llviewercontrol.h" @@ -44,12 +46,10 @@ #include "lltextbox.h" #include "llmutelist.h" #include "llviewerobjectlist.h" +#include "llvoavatar.h" #include "llimpanel.h" // LLVoiceChannel -#include "llsdutil.h" -#include "llimview.h" #include "llviewerwindow.h" #include "llworld.h" -#include "llappviewer.h" // [RLVa:KB] #include "rlvhandler.h" @@ -90,9 +90,7 @@ LLSpeaker::LLSpeaker(const LLUUID& id, const std::string& name, const ESpeakerTy mDisplayName = name; mLegacyName = name; } - gVoiceClient->setUserVolume(id, LLMuteList::getInstance()->getSavedResidentVolume(id)); - mActivityTimer.reset(SPEAKER_TIMEOUT); } @@ -104,7 +102,7 @@ void LLSpeaker::lookupName() // [/Ansariel: Display name support] } -//static +//static // [Ansariel: Display name support] void LLSpeaker::onAvatarNameLookup(const LLUUID& id, const LLAvatarName& avatar_name, void* user_data) // [/Ansariel: Display name support] @@ -122,12 +120,12 @@ void LLSpeaker::onAvatarNameLookup(const LLUUID& id, const LLAvatarName& avatar_ case 2 : speaker_ptr->mDisplayName = avatar_name.mDisplayName; break; default : speaker_ptr->mDisplayName = avatar_name.getLegacyName(); break; } - + // Also set the legacy name. We will need it to initiate a new // IM session. speaker_ptr->mLegacyName = LLCacheName::cleanFullName(avatar_name.getLegacyName()); // [/Ansariel: Display name support] - + // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-1.0.0g // TODO-RLVa: this seems to get called per frame which is very likely an LL bug that will eventuall get fixed if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) @@ -500,7 +498,7 @@ void LLPanelActiveSpeakers::refreshSpeakers() } LLColor4 icon_color; - + if (speakerp->mStatus == LLSpeaker::STATUS_MUTED) { icon_cell->setValue(mute_icon_image); @@ -605,7 +603,7 @@ void LLPanelActiveSpeakers::refreshSpeakers() speaking_status_cell->setValue(speaking_order_sort_string); } } - + // we potentially modified the sort order by touching the list items mSpeakerList->setSorted(FALSE); @@ -860,25 +858,25 @@ void LLPanelActiveSpeakers::onModeratorMuteVoice(LLUICtrl* ctrl, void* user_data if ( gIMMgr ) { - //403 == you're not a mod - //should be disabled if you're not a moderator LLFloaterIMPanel* floaterp; floaterp = gIMMgr->findFloaterBySession(mSessionID); if ( floaterp ) { + //403 == you're not a mod + //should be disabled if you're not a moderator if ( 403 == status ) { floaterp->showSessionEventError( "mute", - "not_a_moderator"); + "not_a_mod_error"); } else { floaterp->showSessionEventError( "mute", - "generic"); + "generic_request_error"); } } } @@ -925,25 +923,25 @@ void LLPanelActiveSpeakers::onModeratorMuteText(LLUICtrl* ctrl, void* user_data) if ( gIMMgr ) { - //403 == you're not a mod - //should be disabled if you're not a moderator LLFloaterIMPanel* floaterp; floaterp = gIMMgr->findFloaterBySession(mSessionID); if ( floaterp ) { + //403 == you're not a mod + //should be disabled if you're not a moderator if ( 403 == status ) { floaterp->showSessionEventError( "mute", - "not_a_moderator"); + "not_a_mod_error"); } else { floaterp->showSessionEventError( "mute", - "generic"); + "generic_request_error"); } } } @@ -1194,6 +1192,9 @@ void LLSpeakerMgr::updateSpeakerList() const LLPointer LLSpeakerMgr::findSpeaker(const LLUUID& speaker_id) { + //In some conditions map causes crash if it is empty(Windows only), adding check (EK) + if (mSpeakers.size() == 0) + return NULL; speaker_map_t::iterator found_it = mSpeakers.find(speaker_id); if (found_it == mSpeakers.end()) { diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index 37bcb873b..ba047ae41 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -74,6 +74,7 @@ #include "llsurface.h" #include "llviewercontrol.h" #include "lluictrlfactory.h" +#include "lltrans.h" #include "lltransfertargetfile.h" #include "lltransfersourcefile.h" @@ -172,6 +173,7 @@ LLFloaterGodTools::~LLFloaterGodTools() // children automatically deleted } + U32 LLFloaterGodTools::computeRegionFlags() const { U32 flags = gAgent.getRegion()->getRegionFlags(); @@ -245,14 +247,16 @@ void LLFloaterGodTools::showPanel(const std::string& panel_name) void LLFloaterGodTools::onTabChanged(LLUICtrl* ctrl, const LLSD& param) { LLPanel* panel = (LLPanel*)ctrl->getChildView(param.asString(),false,false); - if(panel) + if (panel) panel->setFocus(TRUE); } - // static void LLFloaterGodTools::processRegionInfo(LLMessageSystem* msg) { + llassert(msg); + if (!msg) return; + //const S32 SIM_NAME_BUF = 256; U32 region_flags; U8 sim_access; @@ -307,12 +311,12 @@ void LLFloaterGodTools::processRegionInfo(LLMessageSystem* msg) regionp->setBillableFactor(billable_factor); } + if (!sGodTools) return; + // push values to god tools, if available - if (sGodTools + if ( gAgent.isGodlike() && sGodTools->mPanelRegionTools - && sGodTools->mPanelObjectTools - && msg - && gAgent.isGodlike()) + && sGodTools->mPanelObjectTools) { LLPanelRegionTools* rtool = sGodTools->mPanelRegionTools; sGodTools->mCurrentHost = host; @@ -371,6 +375,8 @@ void LLFloaterGodTools::sendRegionInfoRequest() void LLFloaterGodTools::sendGodUpdateRegionInfo() { + if (!sGodTools) return; + LLViewerRegion *regionp = gAgent.getRegion(); if (gAgent.isGodlike() && sGodTools->mPanelRegionTools @@ -777,9 +783,7 @@ void LLPanelRegionTools::setPricePerMeter(S32 price) // static void LLPanelRegionTools::onChangeAnything(LLUICtrl* ctrl, void* userdata) { - if (sGodTools - && userdata - && gAgent.isGodlike()) + if (sGodTools && userdata && gAgent.isGodlike()) { LLPanelRegionTools* region_tools = (LLPanelRegionTools*) userdata; region_tools->childEnable("Apply"); @@ -803,9 +807,7 @@ void LLPanelRegionTools::onChangePrelude(LLUICtrl* ctrl, void* data) // static void LLPanelRegionTools::onChangeSimName(LLLineEditor* caller, void* userdata ) { - if (sGodTools - && userdata - && gAgent.isGodlike()) + if (sGodTools && userdata && gAgent.isGodlike()) { LLPanelRegionTools* region_tools = (LLPanelRegionTools*) userdata; region_tools->childEnable("Apply"); @@ -815,10 +817,9 @@ void LLPanelRegionTools::onChangeSimName(LLLineEditor* caller, void* userdata ) //static void LLPanelRegionTools::onRefresh(void* userdata) { + if(!sGodTools) return; LLViewerRegion *region = gAgent.getRegion(); - if (region - && sGodTools - && gAgent.isGodlike()) + if (region && gAgent.isGodlike()) { sGodTools->sendRegionInfoRequest(); } @@ -827,11 +828,9 @@ void LLPanelRegionTools::onRefresh(void* userdata) // static void LLPanelRegionTools::onApplyChanges(void* userdata) { + if(!sGodTools) return; LLViewerRegion *region = gAgent.getRegion(); - if (region - && sGodTools - && userdata - && gAgent.isGodlike()) + if (region && userdata && gAgent.isGodlike()) { LLPanelRegionTools* region_tools = (LLPanelRegionTools*) userdata; @@ -840,19 +839,19 @@ void LLPanelRegionTools::onApplyChanges(void* userdata) } } -// static +// static void LLPanelRegionTools::onBakeTerrain(void *userdata) { LLPanelRequestTools::sendRequest("terrain", "bake", gAgent.getRegionHost()); } -// static +// static void LLPanelRegionTools::onRevertTerrain(void *userdata) { LLPanelRequestTools::sendRequest("terrain", "revert", gAgent.getRegionHost()); } -// static +// static void LLPanelRegionTools::onSwapTerrain(void *userdata) { LLPanelRequestTools::sendRequest("terrain", "swap", gAgent.getRegionHost()); @@ -953,7 +952,6 @@ bool LLPanelGridTools::finishKick(const LLSD& notification, const LLSD& response { S32 option = LLNotification::getSelectedOption(notification, response); - if (option == 0) { LLMessageSystem* msg = gMessageSystem; @@ -1027,7 +1025,8 @@ bool LLPanelGridTools::flushMapVisibilityCachesConfirm(const LLSD& notification, // Default constructor LLPanelObjectTools::LLPanelObjectTools(const std::string& title) -: LLPanel(title), mTargetAvatar() + : LLPanel(title), + mTargetAvatar() { } @@ -1063,7 +1062,7 @@ void LLPanelObjectTools::setTargetAvatar(const LLUUID &target_id) mTargetAvatar = target_id; if (target_id.isNull()) { - childSetValue("target_avatar_name", "(no target)"); + childSetValue("target_avatar_name", getString("no_target")); } } @@ -1146,8 +1145,9 @@ void LLPanelObjectTools::enableAllWidgets() // static void LLPanelObjectTools::onGetTopColliders(void* userdata) { - if (sGodTools - && gAgent.isGodlike()) + if(!sGodTools) return; + + if (gAgent.isGodlike()) { LLFloaterTopObjects::show(); LLFloaterTopObjects::setMode(STAT_REPORT_TOP_COLLIDERS); @@ -1158,8 +1158,9 @@ void LLPanelObjectTools::onGetTopColliders(void* userdata) // static void LLPanelObjectTools::onGetTopScripts(void* userdata) { - if (sGodTools - && gAgent.isGodlike()) + if(!sGodTools) return; + + if (gAgent.isGodlike()) { LLFloaterTopObjects::show(); LLFloaterTopObjects::setMode(STAT_REPORT_TOP_SCRIPTS); @@ -1170,8 +1171,7 @@ void LLPanelObjectTools::onGetTopScripts(void* userdata) // static void LLPanelObjectTools::onGetScriptDigest(void* userdata) { - if (sGodTools - && gAgent.isGodlike()) + if (sGodTools && gAgent.isGodlike()) { // get the list of scripts and number of occurences of each // (useful for finding self-replicating objects) @@ -1281,7 +1281,10 @@ void LLPanelObjectTools::onClickSetBySelection(void* data) LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name); panelp->mTargetAvatar = owner_id; - std::string name = "Object " + node->mName + " owned by " + owner_name; + LLStringUtil::format_map_t args; + args["[OBJECT]"] = node->mName; + args["[OWNER]"] = owner_name; + std::string name = LLTrans::getString("GodToolsObjectOwnedBy", args); panelp->childSetValue("target_avatar_name", name); } @@ -1295,11 +1298,10 @@ void LLPanelObjectTools::callbackAvatarID(const std::vector& names, object_tools->refresh(); } - // static void LLPanelObjectTools::onChangeAnything(LLUICtrl* ctrl, void* userdata) { - if (sGodTools + if (sGodTools && userdata && gAgent.isGodlike()) { @@ -1311,15 +1313,12 @@ void LLPanelObjectTools::onChangeAnything(LLUICtrl* ctrl, void* userdata) // static void LLPanelObjectTools::onApplyChanges(void* userdata) { + if(!sGodTools) return; LLViewerRegion *region = gAgent.getRegion(); - if (region - && sGodTools - && userdata - && gAgent.isGodlike()) + if (region && userdata && gAgent.isGodlike()) { LLPanelObjectTools* object_tools = (LLPanelObjectTools*) userdata; // TODO -- implement this - object_tools->childDisable("Apply"); sGodTools->sendGodUpdateRegionInfo(); } diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 20f60e920..ac3e2f7cc 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2260,8 +2260,8 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata) BOOL allow_damage = !self->mCheckSafe->get(); BOOL allow_fly = self->mCheckFly->get(); BOOL allow_landmark = self->mCheckLandmark->get(); - BOOL allow_group_scripts = self->mCheckGroupScripts->get() || self->mCheckOtherScripts->get(); BOOL allow_other_scripts = self->mCheckOtherScripts->get(); + BOOL allow_group_scripts = self->mCheckGroupScripts->get() || allow_other_scripts; BOOL allow_publish = FALSE; BOOL mature_publish = self->mMatureCtrl->get(); BOOL push_restriction = self->mPushRestrictionCtrl->get(); @@ -2424,7 +2424,7 @@ void LLPanelLandAccess::refresh() mListAccess->deleteAllItems(); if (mListBanned) mListBanned->deleteAllItems(); - + LLParcel *parcel = mParcel->getParcel(); // Display options diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp index 1d930c337..9ac324468 100644 --- a/indra/newview/llfloaternamedesc.cpp +++ b/indra/newview/llfloaternamedesc.cpp @@ -157,7 +157,10 @@ BOOL LLFloaterNameDesc::postBuild() // OK button childSetLabelArg("ok_btn", "[UPLOADFEE]", gHippoGridManager->getConnectedGrid()->getUploadFee()); - //childSetAction("ok_btn", onBtnOK, this); + if (exten == "wav") + { + childSetAction("ok_btn", onBtnOK, this); + } setDefaultBtn("ok_btn"); return TRUE; diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 794e774fe..7bf346769 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -165,6 +165,7 @@ bool estate_dispatch_initialized = false; //S32 LLFloaterRegionInfo::sRequestSerial = 0; LLUUID LLFloaterRegionInfo::sRequestInvoice; + LLFloaterRegionInfo::LLFloaterRegionInfo(const LLSD& seed) { LLUICtrlFactory::getInstance()->buildFloater(this, "floater_region_info.xml", NULL, FALSE); @@ -176,26 +177,6 @@ BOOL LLFloaterRegionInfo::postBuild() // contruct the panels LLPanelRegionInfo* panel; - panel = new LLPanelRegionGeneralInfo; - mInfoPanels.push_back(panel); - LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_general.xml"); - mTab->addTabPanel(panel, panel->getLabel(), TRUE); - - panel = new LLPanelRegionDebugInfo; - mInfoPanels.push_back(panel); - LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_debug.xml"); - mTab->addTabPanel(panel, panel->getLabel(), FALSE); - - panel = new LLPanelRegionTextureInfo; - mInfoPanels.push_back(panel); - LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_texture.xml"); - mTab->addTabPanel(panel, panel->getLabel(), FALSE); - - panel = new LLPanelRegionTerrainInfo; - mInfoPanels.push_back(panel); - LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_terrain.xml"); - mTab->addTabPanel(panel, panel->getLabel(), FALSE); - panel = new LLPanelEstateInfo; mInfoPanels.push_back(panel); LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_estate.xml"); @@ -206,6 +187,26 @@ BOOL LLFloaterRegionInfo::postBuild() LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_covenant.xml"); mTab->addTabPanel(panel, panel->getLabel(), FALSE); + panel = new LLPanelRegionGeneralInfo; + mInfoPanels.push_back(panel); + LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_general.xml"); + mTab->addTabPanel(panel, panel->getLabel(), TRUE); + + panel = new LLPanelRegionTerrainInfo; + mInfoPanels.push_back(panel); + LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_terrain.xml"); + mTab->addTabPanel(panel, panel->getLabel(), FALSE); + + panel = new LLPanelRegionTextureInfo; + mInfoPanels.push_back(panel); + LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_texture.xml"); + mTab->addTabPanel(panel, panel->getLabel(), FALSE); + + panel = new LLPanelRegionDebugInfo; + mInfoPanels.push_back(panel); + LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_debug.xml"); + mTab->addTabPanel(panel, panel->getLabel(), FALSE); + gMessageSystem->setHandlerFunc( "EstateOwnerMessage", &processEstateOwnerRequest); @@ -331,6 +332,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) msg->getSize("RegionInfo2", "ProductName") > 0) { msg->getString("RegionInfo2", "ProductName", sim_type); + LLTrans::findString(sim_type, sim_type); // try localizing sim product name } // GENERAL PANEL @@ -1234,6 +1236,7 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region) return LLPanelRegionInfo::refreshFromRegion(region); } + // virtual BOOL LLPanelRegionTerrainInfo::sendUpdate() { @@ -1390,6 +1393,7 @@ bool LLPanelRegionTerrainInfo::callbackBakeTerrain(const LLSD& notification, con strings.push_back("bake"); LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); sendEstateOwnerMessage(gMessageSystem, "terrain", invoice, strings); + return false; } @@ -1669,26 +1673,29 @@ bool LLPanelEstateInfo::kickUserConfirm(const LLSD& notification, const LLSD& re std::string all_estates_text() { LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); - if (!panel) return "(error)"; + if (!panel) return "(" + LLTrans::getString("RegionInfoError") + ")"; + LLStringUtil::format_map_t args; std::string owner = panel->getOwnerName(); LLViewerRegion* region = gAgent.getRegion(); if (gAgent.isGodlike()) { - return llformat("all estates\nowned by %s", owner.c_str()); + args["[OWNER]"] = owner.c_str(); + return LLTrans::getString("RegionInfoAllEstatesOwnedBy", args); } else if (region && region->getOwner() == gAgent.getID()) { - return "all estates you own"; + return LLTrans::getString("RegionInfoAllEstatesYouOwn"); } else if (region && region->isEstateManager()) { - return llformat("all estates that\nyou manage for %s", owner.c_str()); + args["[OWNER]"] = owner.c_str(); + return LLTrans::getString("RegionInfoAllEstatesYouManage", args); } else { - return "(error)"; + return "(" + LLTrans::getString("RegionInfoError") + ")"; } } @@ -2254,6 +2261,7 @@ bool LLPanelEstateInfo::callbackChangeLindenEstate(const LLSD& notification, con LLFloaterRegionInfo::nextInvoice(); commitEstateInfoDataserver(); } + // we don't want to do this because we'll get it automatically from the sim // after the spaceserver processes it // else @@ -2723,7 +2731,6 @@ bool LLPanelEstateCovenant::refreshFromRegion(LLViewerRegion* region) region_landtype->setText(region->getLocalizedSimProductName()); } - // let the parent class handle the general data collection. bool rv = LLPanelRegionInfo::refreshFromRegion(region); LLMessageSystem *msg = gMessageSystem; @@ -2863,7 +2870,7 @@ void LLPanelEstateCovenant::loadInvItem(LLInventoryItem *itemp) else { mAssetStatus = ASSET_LOADED; - setCovenantTextEditor("There is no Covenant provided for this Estate."); + setCovenantTextEditor(LLTrans::getString("RegionNoCovenant")); sendChangeCovenantID(LLUUID::null); } } @@ -3179,9 +3186,10 @@ bool LLDispatchSetEstateAccess::operator()( totalAllowedAgents += allowed_agent_name_list->getItemCount(); } - std::string msg = llformat("Allowed residents: (%d, max %d)", - totalAllowedAgents, - ESTATE_MAX_ACCESS_IDS); + LLStringUtil::format_map_t args; + args["[ALLOWEDAGENTS]"] = llformat ("%d", totalAllowedAgents); + args["[MAXACCESS]"] = llformat ("%d", ESTATE_MAX_ACCESS_IDS); + std::string msg = LLTrans::getString("RegionInfoAllowedResidents", args); panel->childSetValue("allow_resident_label", LLSD(msg)); if (allowed_agent_name_list) @@ -3203,9 +3211,10 @@ bool LLDispatchSetEstateAccess::operator()( LLNameListCtrl* allowed_group_name_list; allowed_group_name_list = panel->getChild("allowed_group_name_list"); - std::string msg = llformat("Allowed groups: (%d, max %d)", - num_allowed_groups, - (S32) ESTATE_MAX_GROUP_IDS); + LLStringUtil::format_map_t args; + args["[ALLOWEDGROUPS]"] = llformat ("%d", num_allowed_groups); + args["[MAXACCESS]"] = llformat ("%d", ESTATE_MAX_GROUP_IDS); + std::string msg = LLTrans::getString("RegionInfoAllowedGroups", args); panel->childSetValue("allow_group_label", LLSD(msg)); if (allowed_group_name_list) diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 8cd9ea972..d541a93e5 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -64,6 +64,7 @@ #include "llscrolllistctrl.h" #include "lltextbox.h" #include "lltracker.h" +#include "lltrans.h" #include "llurldispatcher.h" #include "llviewermenu.h" #include "llviewerregion.h" @@ -1625,7 +1626,8 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim) } else { - list->addCommentText(std::string("None found.")); + // if we found nothing, say "none" + list->addCommentText(LLTrans::getString("worldmap_results_none_found")); list->operateOnAll(LLCtrlListInterface::OP_DESELECT); } } diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 27774273a..4ba053a40 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -50,19 +50,20 @@ #include "llchat.h" #include "llconsole.h" #include "llfloater.h" -#include "llfloatergroupinfo.h" -#include "llimview.h" -#include "llfloaterinventory.h" -#include "llinventory.h" -#include "llinventoryfunctions.h" #include "llfloateractivespeakers.h" #include "llfloateravatarinfo.h" #include "llfloaterchat.h" +#include "llfloatergroupinfo.h" +#include "llimview.h" +#include "llinventory.h" +#include "llinventoryfunctions.h" +#include "llfloaterinventory.h" +#include "llcheckboxctrl.h" #include "llkeyboard.h" #include "lllineeditor.h" -#include "llcheckboxctrl.h" #include "llnotify.h" #include "llresmgr.h" +#include "lltrans.h" #include "lltabcontainer.h" #include "llviewertexteditor.h" #include "llviewermessage.h" @@ -2544,7 +2545,7 @@ void LLFloaterIMPanel::chatFromLogFile(LLLogChat::ELogLineType type, std::string // add log end message if (gSavedPerAccountSettings.getBOOL("LogInstantMessages")) { - message = LLFloaterChat::getInstance()->getString("IM_logging_string"); + message = LLFloaterChat::getInstance()->getString("IM_end_log_string"); } break; case LLLogChat::LOG_LINE: @@ -2562,19 +2563,8 @@ void LLFloaterIMPanel::chatFromLogFile(LLLogChat::ELogLineType type, std::string void LLFloaterIMPanel::showSessionStartError( const std::string& error_string) { - //the error strings etc. should be really be static and local - //to this file instead of in the LLFloaterIM - //but they were in llimview.cpp first and unfortunately - //some translations into non English languages already occurred - //thus making it a tad harder to change over to a - //"correct" solution. The best solution - //would be to store all of the misc. strings into - //their own XML file which would be read in by any LLIMPanel - //post build function instead of repeating the same info - //in the group, adhoc and normal IM xml files. LLSD args; - args["REASON"] = - LLFloaterIM::sErrorStringsMap[error_string]; + args["REASON"] = LLTrans::getString(error_string); args["RECIPIENT"] = getTitle(); LLSD payload; @@ -2592,13 +2582,14 @@ void LLFloaterIMPanel::showSessionEventError( const std::string& error_string) { LLSD args; - std::string recipient = getTitle(); - std::string reason = LLFloaterIM::sErrorStringsMap[error_string]; - boost::replace_all(reason, "[RECIPIENT]", recipient); - std::string event = LLFloaterIM::sEventStringsMap[event_string]; - boost::replace_all(event, "[RECIPIENT]", recipient); - args["REASON"] = reason; - args["EVENT"] = event; + LLStringUtil::format_map_t event_args; + + event_args["RECIPIENT"] = getTitle(); + + args["REASON"] = + LLTrans::getString(error_string); + args["EVENT"] = + LLTrans::getString(event_string, event_args); LLNotifications::instance().add( "ChatterBoxSessionEventError", @@ -2611,7 +2602,7 @@ void LLFloaterIMPanel::showSessionForceClose( LLSD args; args["NAME"] = getTitle(); - args["REASON"] = LLFloaterIM::sForceCloseSessionMap[reason_string]; + args["REASON"] = LLTrans::getString(reason_string); LLSD payload; payload["session_id"] = mSessionUUID; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index ba794068a..9783badf7 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -41,6 +41,7 @@ #include "llhttpclient.h" #include "llsdutil_math.h" #include "llstring.h" +#include "lltrans.h" #include "lluictrlfactory.h" #include "llagent.h" @@ -81,19 +82,6 @@ // LLIMMgr* gIMMgr = NULL; -// -// Statics -// -// *FIXME: make these all either UIStrings or Strings -static std::string sOnlyUserMessage; -static LLUIString sOfflineMessage; -static std::string sMutedMessage; -static LLUIString sInviteMessage; - -std::map LLFloaterIM::sEventStringsMap; -std::map LLFloaterIM::sErrorStringsMap; -std::map LLFloaterIM::sForceCloseSessionMap; - // // Helper Functions // @@ -172,18 +160,16 @@ public: gIMMgr->clearPendingAgentListUpdates(mSessionID); gIMMgr->clearPendingInvitation(mSessionID); - LLFloaterIMPanel* floaterp = - gIMMgr->findFloaterBySession(mSessionID); + LLFloaterIMPanel* floaterp = gIMMgr->findFloaterBySession(mSessionID); if ( floaterp ) { if ( 404 == statusNum ) { std::string error_string; - error_string = "does not exist"; + error_string = "session_does_not_exist_error"; - floaterp->showSessionStartError( - error_string); + floaterp->showSessionStartError(error_string); } } } @@ -250,86 +236,6 @@ LLFloaterIM::LLFloaterIM() LLUICtrlFactory::getInstance()->buildFloater(this, "floater_im.xml"); } -BOOL LLFloaterIM::postBuild() -{ - // IM session initiation warnings - sOnlyUserMessage = getString("only_user_message"); - sOfflineMessage = getString("offline_message"); - sMutedMessage = getString("muted_message"); - - sInviteMessage = getString("invite_message"); - - if ( sErrorStringsMap.find("generic") == sErrorStringsMap.end() ) - { - sErrorStringsMap["generic"] = - getString("generic_request_error"); - } - - if ( sErrorStringsMap.find("unverified") == - sErrorStringsMap.end() ) - { - sErrorStringsMap["unverified"] = - getString("insufficient_perms_error"); - } - - if ( sErrorStringsMap.end() == - sErrorStringsMap.find("no_ability") ) - { - sErrorStringsMap["no_ability"] = - getString("no_ability_error"); - } - - if ( sErrorStringsMap.end() == - sErrorStringsMap.find("muted") ) - { - sErrorStringsMap["muted"] = - getString("muted_error"); - } - - if ( sErrorStringsMap.end() == - sErrorStringsMap.find("not_a_moderator") ) - { - sErrorStringsMap["not_a_moderator"] = - getString("not_a_mod_error"); - } - - if ( sErrorStringsMap.end() == - sErrorStringsMap.find("does not exist") ) - { - sErrorStringsMap["does not exist"] = - getString("session_does_not_exist_error"); - } - - if ( sEventStringsMap.end() == sEventStringsMap.find("add") ) - { - sEventStringsMap["add"] = - getString("add_session_event"); - } - - if ( sEventStringsMap.end() == sEventStringsMap.find("message") ) - { - sEventStringsMap["message"] = - getString("message_session_event"); - } - - - if ( sForceCloseSessionMap.end() == - sForceCloseSessionMap.find("removed") ) - { - sForceCloseSessionMap["removed"] = - getString("removed_from_group"); - } - - if ( sForceCloseSessionMap.end() == - sForceCloseSessionMap.find("no ability") ) - { - sForceCloseSessionMap["no ability"] = - getString("close_on_no_ability"); - } - - return TRUE; -} - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLIMViewFriendObserver // @@ -645,10 +551,10 @@ void LLIMMgr::addMessage( { // *TODO:translate (low priority, god ability) std::ostringstream bonus_info; - bonus_info << "*** parent estate: " + bonus_info << LLTrans::getString("***")+ " "+ LLTrans::getString("IMParentEstate") + LLTrans::getString(":") + " " << parent_estate_id - << ((parent_estate_id == 1) ? ", mainland" : "") - << ((parent_estate_id == 5) ? ", teen" : ""); + << ((parent_estate_id == 1) ? LLTrans::getString(",") + LLTrans::getString("IMMainland") : "") + << ((parent_estate_id == 5) ? LLTrans::getString(",") + LLTrans::getString ("IMTeen") : ""); // once we have web-services (or something) which returns // information about a region id, we can print this out @@ -717,23 +623,20 @@ void LLIMMgr::addSystemMessage(const LLUUID& session_id, const std::string& mess // null session id means near me (chat history) if (session_id.isNull()) { - LLFloaterChat* floaterp = LLFloaterChat::getInstance(); - - message = floaterp->getString(message_name); + message = LLTrans::getString(message_name); message.setArgs(args); LLChat chat(message); chat.mSourceType = CHAT_SOURCE_SYSTEM; + LLFloaterChat::getInstance()->addChatHistory(chat); } else // going to IM session { - LLFloaterIMPanel* floaterp = findFloaterBySession(session_id); - if (floaterp) + message = LLTrans::getString(message_name + "-im"); + message.setArgs(args); + if (hasSession(session_id)) { - message = floaterp->getString(message_name); - message.setArgs(args); - gIMMgr->addMessage(session_id, LLUUID::null, SYSTEM_FROM, message.getString()); } } @@ -764,7 +667,7 @@ int LLIMMgr::getIMUnreadCount() } // This method returns TRUE if the local viewer has a session -// currently open keyed to the uuid. +// currently open keyed to the uuid. BOOL LLIMMgr::isIMSessionOpen(const LLUUID& uuid) { LLFloaterIMPanel* floater = findFloaterBySession(uuid); @@ -780,12 +683,14 @@ LLUUID LLIMMgr::addP2PSession(const std::string& name, LLUUID session_id = addSession(name, IM_NOTHING_SPECIAL, other_participant_id); LLFloaterIMPanel* floater = findFloaterBySession(session_id); - if(floater) + if (floater) { - LLVoiceChannelP2P* voice_channelp = (LLVoiceChannelP2P*)floater->getVoiceChannel(); - voice_channelp->setSessionHandle(voice_session_handle, caller_uri); + LLVoiceChannelP2P* voice_channel = dynamic_cast(floater->getVoiceChannel()); + if (voice_channel) + { + voice_channel->setSessionHandle(voice_session_handle, caller_uri); + } } - return session_id; } @@ -951,7 +856,7 @@ void LLIMMgr::inviteToSession( payload["session_handle"] = session_handle; payload["session_uri"] = session_uri; payload["notify_box_type"] = notify_box_type; - + LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(session_id); if (channelp && channelp->callStarted()) { @@ -962,17 +867,13 @@ void LLIMMgr::inviteToSession( if (type == IM_SESSION_P2P_INVITE || ad_hoc_invite) { - // is the inviter a friend? - if (LLAvatarTracker::instance().getBuddyInfo(caller_id) == NULL) + if ( // we're rejecting non-friend voice calls and this isn't a friend + (gSavedSettings.getBOOL("VoiceCallsFriendsOnly") && (LLAvatarTracker::instance().getBuddyInfo(caller_id) == NULL)) + ) { - // if not, and we are ignoring voice invites from non-friends - // then silently decline - if (gSavedSettings.getBOOL("VoiceCallsFriendsOnly")) - { - // invite not from a friend, so decline - LLNotifications::instance().forceResponse(LLNotification::Params("VoiceInviteP2P").payload(payload), 1); - return; - } + // silently decline the call + LLNotifications::instance().forceResponse(LLNotification::Params("VoiceInviteP2P").payload(payload), 1); + return; } } @@ -980,7 +881,8 @@ void LLIMMgr::inviteToSession( { if (caller_name.empty()) { - gCacheName->get(caller_id, true, boost::bind(&LLIMMgr::onInviteNameLookup,_1,_2,_3,payload)); + gCacheName->get(caller_id, true, // voice + boost::bind(&LLIMMgr::onInviteNameLookup, _1, _2, _3, payload)); } else { @@ -998,7 +900,7 @@ void LLIMMgr::inviteToSession( } } -//static +//static void LLIMMgr::onInviteNameLookup(const LLUUID& id, const std::string& full_name, bool is_group, LLSD payload) { payload["caller_name"] = full_name; @@ -1234,7 +1136,8 @@ void LLIMMgr::noteOfflineUsers( S32 count = ids.count(); if(count == 0) { - floater->addHistoryLine(sOnlyUserMessage, gSavedSettings.getColor4("SystemChatColor")); + const std::string& only_user = LLTrans::getString("only_user_message"); + floater->addHistoryLine(only_user, gSavedSettings.getColor4("SystemChatColor")); } else { @@ -1244,10 +1147,11 @@ void LLIMMgr::noteOfflineUsers( { info = at.getBuddyInfo(ids.get(i)); std::string full_name; - if(info && !info->isOnline() - && gCacheName->getFullName(ids.get(i), full_name)) + if (info + && !info->isOnline() + && gCacheName->getFullName(ids.get(i), full_name)) { - LLUIString offline = sOfflineMessage; + LLUIString offline = LLTrans::getString("offline_message"); offline.setArg("[NAME]", full_name); floater->addHistoryLine(offline, gSavedSettings.getColor4("SystemChatColor")); } @@ -1272,7 +1176,8 @@ void LLIMMgr::noteMutedUsers(LLFloaterIMPanel* floater, { if( ml->isMuted(ids.get(i)) ) { - LLUIString muted = sMutedMessage; + LLUIString muted = LLTrans::getString("muted_message"); + floater->addHistoryLine(muted); break; } @@ -1474,10 +1379,8 @@ public: } else { - //throw an error dialog and close the temp session's - //floater - LLFloaterIMPanel* floater = - gIMMgr->findFloaterBySession(temp_session_id); + //throw an error dialog and close the temp session's floater + LLFloaterIMPanel* floater = gIMMgr->findFloaterBySession(temp_session_id); if ( floater ) { diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index be8db650a..fc2dd33b7 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -221,7 +221,7 @@ private: std::list mIgnoreGroupList; public: - + S32 getIgnoreGroupListCount() { return mIgnoreGroupList.size(); } }; @@ -230,11 +230,6 @@ class LLFloaterIM : public LLMultiFloater { public: LLFloaterIM(); - /*virtual*/ BOOL postBuild(); - - static std::map sEventStringsMap; - static std::map sErrorStringsMap; - static std::map sForceCloseSessionMap; }; // Globals diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index caf2ce7da..5367711ce 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1104,19 +1104,24 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat mMeshHeader[mesh_id] = header; } + + LLMutexLock lock(mMutex); // FIRE-7182, make sure only one thread access mPendingLOD at the same time. + //check for pending requests pending_lod_map::iterator iter = mPendingLOD.find(mesh_params); if (iter != mPendingLOD.end()) { - LLMutexLock lock(mMutex); + // LLMutexLock lock(mMutex); FIRE-7182, lock was moved up, before calling mPendingLOD.find for (U32 i = 0; i < iter->second.size(); ++i) { LODRequest req(mesh_params, iter->second[i]); mLODReqQ.push(req); LLMeshRepository::sLODProcessing++; } + + mPendingLOD.erase(iter); // FIRE-7182, only call erase if iter is really valid. } - mPendingLOD.erase(iter); + // mPendingLOD.erase(iter); // avoid crash by moving erase up. } return true; diff --git a/indra/newview/llnotify.h b/indra/newview/llnotify.h index 439cae239..4047430a5 100644 --- a/indra/newview/llnotify.h +++ b/indra/newview/llnotify.h @@ -152,7 +152,7 @@ public: public: Matcher(){} virtual ~Matcher() {} - virtual BOOL matches(const LLNotificationPtr) const = 0; + virtual bool matches(const LLNotificationPtr) const = 0; }; // Walks the list and removes any stacked messages for which the given matcher returns TRUE. // Useful when muting people and things in order to clear out any similar previously queued messages. diff --git a/indra/newview/llpaneldisplay.cpp b/indra/newview/llpaneldisplay.cpp index 45214ca05..d2f3bdd01 100644 --- a/indra/newview/llpaneldisplay.cpp +++ b/indra/newview/llpaneldisplay.cpp @@ -877,7 +877,7 @@ void LLPanelDisplay::cancel() void LLPanelDisplay::apply() { U32 fsaa_value = childGetValue("fsaa").asInteger(); - bool apply_fsaa_change = !LLRenderTarget::sUseFBO && (mFSAASamples != fsaa_value); + bool apply_fsaa_change = !gSavedSettings.getBOOL("RenderUseFBO") && (mFSAASamples != fsaa_value); gSavedSettings.setU32("RenderFSAASamples", fsaa_value); applyResolution(); diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index 4baa6cd8b..9b7ee5c78 100644 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -1105,7 +1105,7 @@ void LLGroupMoneyDetailsTabEventHandler::processReply(LLMessageSystem* msg, text.append(1, '\n'); - text.append(llformat("%-24s %6d\n", "Total", total_amount)); + text.append(llformat("%-24s %6d\n", LLTrans::getString("GroupMoneyTotal").c_str(), total_amount)); if ( mImplementationp->mTextEditorp ) { @@ -1227,7 +1227,7 @@ void LLGroupMoneySalesTabEventHandler::processReply(LLMessageSystem* msg, S32 transactions = msg->getNumberOfBlocksFast(_PREHASH_HistoryData); if (transactions == 0) { - text.append("(none)"); + text.append(LLTrans::getString("none_text")); } else { @@ -1252,22 +1252,22 @@ void LLGroupMoneySalesTabEventHandler::processReply(LLMessageSystem* msg, switch(type) { case TRANS_OBJECT_SALE: - verb = "bought"; + verb = LLTrans::getString("GroupMoneyBought").c_str(); break; case TRANS_GIFT: - verb = "paid you"; + verb = LLTrans::getString("GroupMoneyPaidYou").c_str(); break; case TRANS_PAY_OBJECT: - verb = "paid into"; + verb = LLTrans::getString("GroupMoneyPaidInto").c_str(); break; case TRANS_LAND_PASS_SALE: - verb = "bought pass to"; + verb = LLTrans::getString("GroupMoneyBoughtPassTo").c_str(); break; case TRANS_EVENT_FEE: - verb = "paid fee for event"; + verb = LLTrans::getString("GroupMoneyPaidFeeForEvent").c_str(); break; case TRANS_EVENT_PRIZE: - verb = "paid prize for event"; + verb = LLTrans::getString("GroupMoneyPaidPrizeForEvent").c_str(); break; default: verb = ""; @@ -1429,15 +1429,18 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg, return; } - text.append("Summary for this week, beginning on "); + text.append(LLTrans::getString("SummaryForTheWeek")); + text.append(start_date); + text.append(". "); if (current_interval == 0) { - text.append("The next stipend day is "); + text.append(LLTrans::getString("NextStipendDay")); + text.append(next_stipend_date); - text.append("\n\n"); - text.append(llformat("%-24s%s%6d\n", "Balance", + text.append(".\n\n"); + text.append(llformat("%-24s%s%6d\n", LLTrans::getString("GroupMoneyBalance").c_str(), gHippoGridManager->getConnectedGrid()->getCurrencySymbol().c_str(), balance)); text.append(1, '\n'); @@ -1445,15 +1448,15 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg, // [DEV-29503] Hide the individual info since // non_exempt_member here is a wrong choice to calculate individual shares. - // text.append( " Group Individual Share\n"); - // text.append(llformat( "%-24s %6d %6d \n", "Credits", total_credits, (S32)floor((F32)total_credits/(F32)non_exempt_members))); - // text.append(llformat( "%-24s %6d %6d \n", "Debits", total_debits, (S32)floor((F32)total_debits/(F32)non_exempt_members))); - // text.append(llformat( "%-24s %6d %6d \n", "Total", total_credits + total_debits, (S32)floor((F32)(total_credits + total_debits)/(F32)non_exempt_members))); +// text.append( LLTrans::getString("GroupIndividualShare")); +// text.append(llformat( "%-24s %6d %6d \n", LLTrans::getString("GroupMoneyCredits").c_str(), total_credits, (S32)floor((F32)total_credits/(F32)non_exempt_members))); +// text.append(llformat( "%-24s %6d %6d \n", LLTrans::getString("GroupMoneyDebits").c_str(), total_debits, (S32)floor((F32)total_debits/(F32)non_exempt_members))); +// text.append(llformat( "%-24s %6d %6d \n", LLTrans::getString("GroupMoneyTotal").c_str(), total_credits + total_debits, (S32)floor((F32)(total_credits + total_debits)/(F32)non_exempt_members))); - text.append( " Group\n"); - text.append(llformat( "%-24s %6d\n", "Credits", total_credits)); - text.append(llformat( "%-24s %6d\n", "Debits", total_debits)); - text.append(llformat( "%-24s %6d\n", "Total", total_credits + total_debits)); + text.append(llformat( "%s\n", LLTrans::getString("GroupColumn").c_str())); + text.append(llformat( "%-24s %6d\n", LLTrans::getString("GroupMoneyCredits").c_str(), total_credits)); + text.append(llformat( "%-24s %6d\n", LLTrans::getString("GroupMoneyDebits").c_str(), total_debits)); + text.append(llformat( "%-24s %6d\n", LLTrans::getString("GroupMoneyTotal").c_str(), total_credits + total_debits)); if ( mImplementationp->mTextEditorp ) { diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 796a535d7..ef6c5f138 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -514,8 +514,11 @@ void LLPanelObject::getState( ) mCtrlPosY->setEnabled(enable_move); mCtrlPosZ->setEnabled(enable_move); mBtnLinkObj->setEnabled(LLSelectMgr::getInstance()->enableLinkObjects()); - mBtnUnlinkObj->setEnabled((LLSelectMgr::getInstance()->enableUnlinkObjects() - && (selected_count > 1) && LLSelectMgr::getInstance()->getSelection()->getRootObjectCount()<=1)); + LLViewerObject* linkset_parent = objectp->getSubParent()? objectp->getSubParent() : objectp; + mBtnUnlinkObj->setEnabled( + LLSelectMgr::getInstance()->enableUnlinkObjects() + && (linkset_parent->numChildren() >= 1) + && LLSelectMgr::getInstance()->getSelection()->getRootObjectCount()<=1); mBtnCopyPos->setEnabled(enable_move); mBtnPastePos->setEnabled(enable_move); mBtnPastePosClip->setEnabled(enable_move); diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index c78f3ce21..8929780d5 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -94,8 +94,8 @@ public: LLTaskInvFVBridge(LLPanelObjectInventory* panel, const LLUUID& uuid, const std::string& name, - U32 flags=0); - virtual ~LLTaskInvFVBridge( ) {} + U32 flags=0); + virtual ~LLTaskInvFVBridge() {} virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; } virtual std::string getLabelSuffix() const { return LLStringUtil::null; } @@ -243,9 +243,9 @@ void LLTaskInvFVBridge::buyItem() if (sale_info.getSaleType() != LLSaleInfo::FS_CONTENTS) { U32 next_owner_mask = perm.getMaskNextOwner(); - args["MODIFYPERM"] = LLNotifications::instance().getGlobalString((next_owner_mask & PERM_MODIFY) ? "PermYes" : "PermNo"); - args["COPYPERM"] = LLNotifications::instance().getGlobalString((next_owner_mask & PERM_COPY) ? "PermYes" : "PermNo"); - args["RESELLPERM"] = LLNotifications::instance().getGlobalString((next_owner_mask & PERM_TRANSFER) ? "PermYes" : "PermNo"); + args["MODIFYPERM"] = LLTrans::getString((next_owner_mask & PERM_MODIFY) ? "PermYes" : "PermNo"); + args["COPYPERM"] = LLTrans::getString((next_owner_mask & PERM_COPY) ? "PermYes" : "PermNo"); + args["RESELLPERM"] = LLTrans::getString((next_owner_mask & PERM_TRANSFER) ? "PermYes" : "PermNo"); } std::string alertdesc; @@ -318,10 +318,18 @@ const std::string& LLTaskInvFVBridge::getName() const const std::string& LLTaskInvFVBridge::getDisplayName() const { LLInventoryItem* item = findItem(); + if(item) { mDisplayName.assign(item->getName()); + // Localize "New Script", "New Script 1", "New Script 2", etc. + if (item->getType() == LLAssetType::AT_LSL_TEXT && + LLStringUtil::startsWith(item->getName(), "New Script")) + { + LLStringUtil::replaceString(mDisplayName, "New Script", LLTrans::getString("PanelContentsNewScript")); + } + const LLPermissions& perm(item->getPermissions()); BOOL copy = gAgent.allowOperation(PERM_COPY, perm, GP_OBJECT_MANIPULATE); BOOL mod = gAgent.allowOperation(PERM_MODIFY, perm, GP_OBJECT_MANIPULATE); @@ -677,7 +685,9 @@ void LLTaskInvFVBridge::performAction(LLInventoryModel* model, std::string actio { if (price > 0 && price > gStatusBar->getBalance()) { - LLFloaterBuyCurrency::buyCurrency("This costs", price); + LLStringUtil::format_map_t args; + args["CURRENCY"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); + LLFloaterBuyCurrency::buyCurrency( LLTrans::getString("this_costs", args), price ); } else { @@ -723,7 +733,7 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) else { std::ostringstream info; - info << "Buy for " << gHippoGridManager->getConnectedGrid()->getCurrencySymbol() << price; + info << LLTrans::getString("Buyfor") << gHippoGridManager->getConnectedGrid()->getCurrencySymbol() << price; label.assign(info.str()); } @@ -1013,8 +1023,8 @@ class LLTaskSoundBridge : public LLTaskInvFVBridge { public: LLTaskSoundBridge(LLPanelObjectInventory* panel, - const LLUUID& uuid, - const std::string& name) : + const LLUUID& uuid, + const std::string& name) : LLTaskInvFVBridge(panel, uuid, name) {} virtual BOOL canOpenItem() const { return TRUE; } @@ -1086,7 +1096,7 @@ void LLTaskSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) else { std::ostringstream info; - info << "Buy for " << gHippoGridManager->getConnectedGrid()->getCurrencySymbol() << price; + info << LLTrans::getString("Buyfor") << gHippoGridManager->getConnectedGrid()->getCurrencySymbol() << price; label.assign(info.str()); } @@ -1121,6 +1131,7 @@ void LLTaskSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } items.push_back(std::string("Task Play")); + /*menu.addSeparator(); menu.append(new LLMenuItemCallGL("Play", &LLTaskSoundBridge::playSound, @@ -1138,8 +1149,8 @@ class LLTaskLandmarkBridge : public LLTaskInvFVBridge { public: LLTaskLandmarkBridge(LLPanelObjectInventory* panel, - const LLUUID& uuid, - const std::string& name) : + const LLUUID& uuid, + const std::string& name) : LLTaskInvFVBridge(panel, uuid, name) {} }; diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp index d7b342b25..1265ed7c7 100644 --- a/indra/newview/llpolymesh.cpp +++ b/indra/newview/llpolymesh.cpp @@ -1912,8 +1912,12 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info) //----------------------------------------------------------------------------- // apply() //----------------------------------------------------------------------------- +static LLFastTimer::DeclareTimer FTM_POLYSKELETAL_DISTORTION_APPLY("Skeletal Distortion"); + void LLPolySkeletalDistortion::apply( ESex avatar_sex ) { + LLFastTimer t(FTM_POLYSKELETAL_DISTORTION_APPLY); + F32 effective_weight = ( getSex() & avatar_sex ) ? mCurWeight : getDefaultWeight(); LLJoint* joint; diff --git a/indra/newview/llpolymorph.cpp b/indra/newview/llpolymorph.cpp index b43837e89..cfbe6907c 100644 --- a/indra/newview/llpolymorph.cpp +++ b/indra/newview/llpolymorph.cpp @@ -781,6 +781,8 @@ F32 LLPolyMorphTarget::getMaxDistortion() //----------------------------------------------------------------------------- // apply() //----------------------------------------------------------------------------- +static LLFastTimer::DeclareTimer FTM_APPLY_MORPH_TARGET("Apply Morph"); + void LLPolyMorphTarget::apply( ESex avatar_sex ) { if (!mMorphData || mNumMorphMasksPending > 0) @@ -788,6 +790,8 @@ void LLPolyMorphTarget::apply( ESex avatar_sex ) return; } + LLFastTimer t(FTM_APPLY_MORPH_TARGET); + mLastSex = avatar_sex; // Check for NaN condition (NaN is detected if a variable doesn't equal itself. diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 513e92f3a..81c6bcb87 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -5484,6 +5484,8 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); + gGL.pushUIMatrix(); + gGL.loadUIIdentity(); gGL.loadIdentity(); gGL.loadMatrix(OGL_TO_CFR_ROTATION); // Load Cory's favorite reference frame gGL.translatef(-hud_bbox.getCenterLocal().mV[VX] + (depth *0.5f), 0.f, 0.f); @@ -5576,6 +5578,7 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.popMatrix(); + gGL.popUIMatrix(); stop_glerror(); } @@ -5898,8 +5901,8 @@ void pushWireframe(LLDrawable* drawable) if (drawable->isState(LLDrawable::RIGGED)) { - vobj->updateRiggedVolume(); - volume = vobj->getRiggedVolume(); + vobj->updateRiggedVolume(); + volume = vobj->getRiggedVolume(); } else { @@ -5941,6 +5944,8 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color) gDebugProgram.bind(); } + static LLCachedControl mode("OutlineMode",0); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); @@ -5961,10 +5966,12 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color) glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + //Singu Note: Diverges from v3. If sRenderHiddenSelections set, draw non-z-culled wireframe, else draw occluded 'thick' wireframe to create an outline. if (LLSelectMgr::sRenderHiddenSelections) // && gFloaterTools && gFloaterTools->getVisible()) { gGL.blendFunc(LLRender::BF_SOURCE_COLOR, LLRender::BF_ONE); LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GEQUAL); + if (shader) { gGL.diffuseColor4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f); @@ -5986,18 +5993,21 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color) pushWireframe(drawable); } } + gGL.setSceneBlendType(LLRender::BT_ALPHA); + } + else + { + LLGLEnable cull_face(GL_CULL_FACE); + LLGLEnable offset(GL_POLYGON_OFFSET_LINE); + + gGL.setSceneBlendType(LLRender::BT_ALPHA); + gGL.diffuseColor4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2); + glPolygonOffset(3.f, 3.f); + glLineWidth(3.f); + pushWireframe(drawable); + glLineWidth(1.f); } - gGL.flush(); - gGL.setSceneBlendType(LLRender::BT_ALPHA); - - gGL.diffuseColor4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2); - - LLGLEnable offset(GL_POLYGON_OFFSET_LINE); - glPolygonOffset(3.f, 3.f); - glLineWidth(3.f); - pushWireframe(drawable); - glLineWidth(1.f); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); gGL.popMatrix(); @@ -6053,6 +6063,9 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); + gGL.pushUIMatrix(); + gGL.loadUIIdentity(); + if (!is_hud_object) { gGL.loadIdentity(); @@ -6169,6 +6182,7 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) gGL.flush(); } gGL.popMatrix(); + gGL.popUIMatrix(); if (shader) { diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 990a7228a..18493bd7c 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -1103,6 +1103,7 @@ LLTextureCtrl::LLTextureCtrl( LLFontGL::getFontSansSerifSmall() ); mTentativeLabel->setHAlign( LLFontGL::HCENTER ); mTentativeLabel->setFollowsAll(); + mTentativeLabel->setMouseOpaque(FALSE); addChild( mTentativeLabel ); LLRect border_rect(0, getRect().getHeight(), getRect().getWidth(), 0); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index a48ac85d7..1f540a01c 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -31,8 +31,8 @@ */ #include "llviewerprecompiledheaders.h" - #include "llviewermessage.h" +#include #include @@ -78,7 +78,6 @@ #include "llviewercontrol.h" #include "lldrawpool.h" #include "llfirstuse.h" -#include "llfloateractivespeakers.h" #include "llfloateranimpreview.h" #include "llfloaterbuycurrency.h" #include "llfloaterbuyland.h" @@ -115,6 +114,7 @@ #include "llstatenums.h" #include "llstatusbar.h" #include "llimview.h" +#include "llfloateractivespeakers.h" #include "lltexturestats.h" #include "lltool.h" #include "lltoolbar.h" @@ -127,14 +127,13 @@ #include "llviewerdisplay.h" #include "llviewerfoldertype.h" #include "llviewergenericmessage.h" +#include "llviewermenu.h" #include "llviewerinventory.h" #include "llviewerjoystick.h" -#include "llviewermenu.h" #include "llviewerobject.h" #include "llviewerobjectlist.h" #include "llviewerparcelmgr.h" #include "llviewerpartsource.h" -#include "llviewerregion.h" #include "llviewerstats.h" #include "llviewertexteditor.h" #include "llviewerthrottle.h" @@ -148,6 +147,7 @@ #include "llfloaterworldmap.h" #include "llviewerdisplay.h" #include "llkeythrottle.h" +#include "llviewerregion.h" // #include "llviewernetwork.h" // @@ -336,7 +336,9 @@ void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_ } else { - LLFloaterBuyCurrency::buyCurrency("Giving", amount); + LLStringUtil::format_map_t args; + args["CURRENCY"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); + LLFloaterBuyCurrency::buyCurrency( LLTrans::getString("giving", args)+" ", amount ); } } @@ -399,12 +401,10 @@ void process_layer_data(LLMessageSystem *mesgsys, void **user_data) { LLViewerRegion *regionp = LLWorld::getInstance()->getRegion(mesgsys->getSender()); - if (!regionp || gNoRender) + if(!regionp || gNoRender) { return; } - - S32 size; S8 type; @@ -796,6 +796,7 @@ static void highlight_inventory_objects_in_panel(const std::vector& item } } } + static LLNotificationFunctorRegistration jgr_1("JoinGroup", join_group_response); static LLNotificationFunctorRegistration jgr_2("JoinedTooManyGroupsMember", join_group_response); static LLNotificationFunctorRegistration jgr_3("JoinGroupCanAfford", join_group_response); @@ -1160,21 +1161,29 @@ bool check_offer_throttle(const std::string& from_name, bool check_only) { // Use the name of the last item giver, who is probably the person // spamming you. - std::ostringstream message; - message << LLAppViewer::instance()->getSecondLifeTitle(); + + LLStringUtil::format_map_t arg; + std::string log_msg; + std::ostringstream time ; + time<getSecondLifeTitle(); + arg["TIME"] = time.str(); + if (!from_name.empty()) { - message << ": Items coming in too fast from " << from_name; + arg["FROM_NAME"] = from_name; + log_msg = LLTrans::getString("ItemsComingInTooFastFrom", arg); } else { - message << ": Items coming in too fast"; + log_msg = LLTrans::getString("ItemsComingInTooFast", arg); } - message << ", automatic preview disabled for " - << OFFER_THROTTLE_TIME << " seconds."; - chat.mText = message.str(); + + chat.mText = log_msg; //this is kinda important, so actually put it on screen LLFloaterChat::addChat(chat, FALSE, FALSE); + throttle_logged=true; } return false; @@ -1186,7 +1195,7 @@ bool check_offer_throttle(const std::string& from_name, bool check_only) } } } - + void open_inventory_offer(const uuid_vec_t& items, const std::string& from_name) { uuid_vec_t::const_iterator it = items.begin(); @@ -1321,7 +1330,7 @@ void inventory_offer_mute_callback(const LLUUID& blocked_id, { public: OfferMatcher(const LLUUID& to_block) : blocked_id(to_block) {} - BOOL matches(const LLNotificationPtr notification) const + bool matches(const LLNotificationPtr notification) const { if(notification->getName() == "ObjectGiveItem" || notification->getName() == "ObjectGiveItemUnknownUser" @@ -1701,7 +1710,7 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) } // [/RLVa:KB] } - + LLSD args; args["[OBJECTNAME]"] = msg; @@ -1711,7 +1720,9 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) std::string typestr = ll_safe_string(LLAssetType::lookupHumanReadable(info->mType)); if (!typestr.empty()) { - args["OBJECTTYPE"] = typestr; + // human readable matches string name from strings.xml + // lets get asset type localized name + args["OBJECTTYPE"] = LLTrans::getString(typestr); } else { @@ -1730,7 +1741,6 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) payload["from_id"] = info->mFromID; args["OBJECTFROMNAME"] = info->mFromName; args["NAME"] = info->mFromName; - if (info->mFromGroup) { std::string group_name; @@ -1934,7 +1944,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LLChat chat; std::string buffer; - // *TODO:translate - need to fix the full name to first/last (maybe) + // *TODO: Translate - need to fix the full name to first/last (maybe) msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, from_id); msg->getBOOLFast(_PREHASH_MessageBlock, _PREHASH_FromGroup, from_group); msg->getUUIDFast(_PREHASH_MessageBlock, _PREHASH_ToAgentID, to_id); @@ -1958,11 +1968,13 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) if((U32)std::abs(std::distance(iter, boost::sregex_iterator())) > SpamNewlines) { NACLAntiSpamRegistry::blockOnQueue((U32)NACLAntiSpamRegistry::QUEUE_IM,from_id); + llinfos << "[antispam] blocked owner due to too many newlines: " << from_id << llendl; if(gSavedSettings.getBOOL("AntiSpamNotify")) { LLSD args; - args["MESSAGE"] = "Message: Blocked newline flood from "+from_id.asString(); - LLNotificationsUtil::add("SystemMessageTip", args); + args["SOURCE"] = from_id.asString(); + args["AMOUNT"] = boost::lexical_cast(SpamNewlines); + LLNotificationsUtil::add("AntiSpamNewlineFlood", args); } return; } @@ -1999,7 +2011,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) BOOL is_muted = LLMuteList::getInstance()->isMuted(from_id, name, LLMute::flagTextChat); BOOL is_linden = LLMuteList::getInstance()->isLinden(name); BOOL is_owned_by_me = FALSE; - + LLUUID computed_session_id = LLIMMgr::computeSessionID(dialog,from_id); chat.mMuted = is_muted && !is_linden; @@ -2438,7 +2450,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) case IM_MESSAGEBOX: { // This is a block, modeless dialog. - // *TODO:translate + // *TODO: Translate args["MESSAGE"] = message; LLNotificationsUtil::add("SystemMessage", args); } @@ -2598,7 +2610,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) return; // NaCl End LLOfferInfo* info = new LLOfferInfo; - if (IM_INVENTORY_OFFERED == dialog) { struct offer_agent_bucket_t @@ -2642,19 +2653,12 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) info->mTransactionID = session_id; info->mFolderID = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(info->mType)); - if (dialog == IM_TASK_INVENTORY_OFFERED) - { - info->mFromObject = TRUE; - } - else - { - info->mFromObject = FALSE; - } + info->mFromObject = (dialog == IM_TASK_INVENTORY_OFFERED); info->mFromName = name; info->mDesc = message; info->mHost = msg->getSender(); //if (((is_busy && !is_owned_by_me) || is_muted)) - if ( is_muted ) + if (is_muted) { // Same as closing window info->forceResponse(IOR_DECLINE); @@ -2810,8 +2814,8 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) chat.mFromName = name; // Build a link to open the object IM info window. - std::string location = ll_safe_string((char*)binary_bucket,binary_bucket_size); - + std::string location = ll_safe_string((char*)binary_bucket, binary_bucket_size); + LLSD query_string; query_string["owner"] = from_id; query_string["slurl"] = location.c_str(); @@ -2819,7 +2823,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) if (from_group) { query_string["groupowned"] = "true"; - } + } if (session_id.notNull()) { @@ -2932,7 +2936,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // [/RLVa:KB] LLSD args; - // *TODO:translate -> [FIRST] [LAST] (maybe) + // *TODO: Translate -> [FIRST] [LAST] (maybe) args["NAME"] = name; args["MESSAGE"] = message; LLSD payload; @@ -3085,7 +3089,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) else { args["[MESSAGE]"] = message; - LLNotificationsUtil::add("OfferFriendship", args, payload); + LLNotificationsUtil::add("OfferFriendship", args, payload); } } } @@ -3128,7 +3132,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } } - void busy_message (LLMessageSystem* msg, LLUUID from_id) { if (gAgent.getBusy()) @@ -3226,7 +3229,7 @@ void process_offer_callingcard(LLMessageSystem* msg, void**) LLNameValue* nvlast = source->getNVPair("LastName"); if (nvfirst && nvlast) { - args["NAME"] = LLCacheName::buildFullName( + source_name = LLCacheName::buildFullName( nvfirst->getString(), nvlast->getString()); } } @@ -3241,6 +3244,7 @@ void process_offer_callingcard(LLMessageSystem* msg, void**) } else { + args["NAME"] = source_name; LLNotificationsUtil::add("OfferCallingCard", args, payload); } } @@ -3355,7 +3359,7 @@ class AuthHandler : public HippoRestHandlerRaw void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) { - LLChat chat; + LLChat chat; std::string mesg; std::string from_name; U8 source_temp; @@ -3376,19 +3380,15 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) msg->getUUID("ChatData", "SourceID", from_id); chat.mFromID = from_id; - chatter = gObjectList.findObject(from_id); - - if(chatter) + if(chatter && chatter->isAvatar()) { - if(chatter->isAvatar()) - { - ((LLVOAvatar*)chatter)->mIdleTimer.reset(); - } + ((LLVOAvatar*)chatter)->mIdleTimer.reset(); } + // Object owner for objects msg->getUUID("ChatData", "OwnerID", owner_id); - + msg->getU8Fast(_PREHASH_ChatData, _PREHASH_SourceType, source_temp); chat.mSourceType = (EChatSourceType)source_temp; @@ -3450,7 +3450,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) LLSD args; args["NAME"] = from_name; chat.mPosAgent = chatter->getPositionAgent(); - + // Make swirly things only for talking objects. (not script debug messages, though) // if (chat.mSourceType == CHAT_SOURCE_OBJECT // && chat.mChatType != CHAT_TYPE_DEBUG_MSG @@ -3907,7 +3907,7 @@ void process_teleport_start(LLMessageSystem *msg, void**) //if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) // [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | Added: RLVa-0.2.0b - if ( (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) || (!gRlvHandler.getCanCancelTp()) ) + if ( (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) || (!gRlvHandler.getCanCancelTp()) ) // [/RLVa:KB] { gViewerWindow->setProgressCancelButtonVisible(FALSE); @@ -3927,6 +3927,7 @@ void process_teleport_start(LLMessageSystem *msg, void**) make_ui_sound("UISndTeleportOut"); LL_INFOS("Messaging") << "Teleport initiated by remote TeleportStart message with TeleportFlags: " << teleport_flags << LL_ENDL; + // Don't call LLFirstUse::useTeleport here because this could be // due to being killed, which would send you home, not to a Telehub } @@ -4160,7 +4161,7 @@ void process_teleport_finish(LLMessageSystem* msg, void**) // Make sure we're standing gAgent.standUp(); - + // now, use the circuit info to tell simulator about us! LL_INFOS("Messaging") << "process_teleport_finish() Enabling " << sim_host << " with code " << msg->mOurCircuitCode << LL_ENDL; @@ -4294,14 +4295,15 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) gAgent.sendAgentSetAppearance(); // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) - if ( (isAgentAvatarValid()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) + if (isAgentAvatarValid() && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) // [/RLVa:KB] -// if (avatarp) +// if (isAgentAvatarValid()) { // Chat the "back" SLURL. (DEV-4907) - LLChat chat("Teleport completed from " + gAgent.getTeleportSourceSLURL()); + + LLChat chat(LLTrans::getString("completed_from") + " " + gAgent.getTeleportSourceSLURL()); chat.mSourceType = CHAT_SOURCE_SYSTEM; - LLFloaterChat::addChatHistory(chat); + LLFloaterChat::addChatHistory(chat); // Set the new position gAgentAvatarp->setPositionAgent(agent_pos); @@ -4314,7 +4316,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) } else { - // This is likely just the initial logging in phase. + // This is initial log-in or a region crossing gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); if(LLStartUp::getStartupState() < STATE_STARTED) @@ -4529,6 +4531,7 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) // MASK key_mask = gKeyboard->currentMask(TRUE); + if (key_mask & MASK_ALT || key_mask & MASK_CONTROL) { control_flags &= ~( AGENT_CONTROL_LBUTTON_DOWN | @@ -4557,7 +4560,7 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) control_flag_change != 0 || flag_change != 0) { -/* + /* if (head_rot_chg < THRESHOLD_HEAD_ROT_QDOT) { //LL_INFOS("Messaging") << "head rot " << head_rotation << LL_ENDL; @@ -4579,7 +4582,7 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) { LL_INFOS("Messaging") << "dcf = " << control_flag_change << LL_ENDL; } -*/ + */ duplicate_count = 0; } @@ -4918,7 +4921,7 @@ void process_sound_trigger(LLMessageSystem *msg, void **) if(owner_id != gAgent.getID() || !gSavedSettings.getBOOL("EnableGestureSoundsSelf")) return; } - + // //gAudiop->triggerSound(sound_id, owner_id, gain, LLAudioEngine::AUDIO_TYPE_SFX, pos_global); gAudiop->triggerSound(sound_id, owner_id, gain, LLAudioEngine::AUDIO_TYPE_SFX, pos_global, object_id); @@ -5327,7 +5330,7 @@ void process_avatar_appearance(LLMessageSystem *mesgsys, void **user_data) mesgsys->getUUIDFast(_PREHASH_Sender, _PREHASH_ID, uuid); LLVOAvatar* avatarp = gObjectList.findAvatar(uuid); - if( avatarp ) + if (avatarp) { avatarp->processAvatarAppearance( mesgsys ); } @@ -5649,7 +5652,6 @@ void process_time_dilation(LLMessageSystem *msg, void **user_data) */ - void process_money_balance_reply( LLMessageSystem* msg, void** ) { S32 balance = 0; @@ -5926,24 +5928,33 @@ void process_alert_core(const std::string& message, BOOL modal) } else { - // *TODO:translate - args["MESSAGE"] = text; + std::string new_msg =LLNotifications::instance().getGlobalString(text); + args["MESSAGE"] = new_msg; LLNotificationsUtil::add("SystemMessage", args); } } else if (modal) { - // *TODO:translate LLSD args; - args["ERROR_MESSAGE"] = message; + std::string new_msg =LLNotifications::instance().getGlobalString(message); + args["ERROR_MESSAGE"] = new_msg; LLNotificationsUtil::add("ErrorMessage", args); } else { - // *TODO:translate - LLSD args; - args["MESSAGE"] = message; - LLNotificationsUtil::add("SystemMessageTip", args); + // Hack fix for EXP-623 (blame fix on RN :)) to avoid a sim deploy + const std::string AUTOPILOT_CANCELED_MSG("Autopilot canceled"); + if (message.find(AUTOPILOT_CANCELED_MSG) == std::string::npos ) + { + LLSD args; + std::string new_msg =LLNotifications::instance().getGlobalString(message); + + std::string localized_msg; + bool is_message_localized = LLTrans::findString(localized_msg, new_msg); + + args["MESSAGE"] = is_message_localized ? localized_msg : new_msg; + LLNotificationsUtil::add("SystemMessageTip", args); + } } } @@ -6230,7 +6241,7 @@ bool script_question_cb(const LLSD& notification, const LLSD& response) { public: OfferMatcher(const LLUUID& to_block) : blocked_id(to_block) {} - BOOL matches(const LLNotificationPtr notification) const + bool matches(const LLNotificationPtr notification) const { if (notification->getName() == "ScriptQuestionCaution" || notification->getName() == "ScriptQuestion") @@ -6416,7 +6427,7 @@ void container_inventory_arrived(LLViewerObject* object, // create a new inventory category to put this in LLUUID cat_id; cat_id = gInventory.createNewCategory(gInventory.getRootFolderID(), - LLFolderType::FT_NONE, + LLFolderType::FT_NONE, LLTrans::getString("AcquiredItems")); LLInventoryObject::object_list_t::const_iterator it = inventory->begin(); @@ -6524,6 +6535,9 @@ void process_teleport_failed(LLMessageSystem *msg, void**) std::string big_reason; LLSD args; + // Let the interested parties know that teleport failed. + LLViewerParcelMgr::getInstance()->onTeleportFailed(); + // if we have additional alert data if (msg->has(_PREHASH_AlertInfo) && msg->getSizeFast(_PREHASH_AlertInfo, _PREHASH_Message) > 0) { @@ -6582,9 +6596,6 @@ void process_teleport_failed(LLMessageSystem *msg, void**) LLNotificationsUtil::add("CouldNotTeleportReason", args); - // Let the interested parties know that teleport failed. - LLViewerParcelMgr::getInstance()->onTeleportFailed(); - if( gAgent.getTeleportState() != LLAgent::TELEPORT_NONE ) { gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); @@ -6608,7 +6619,7 @@ void process_teleport_local(LLMessageSystem *msg,void**) msg->getVector3Fast(_PREHASH_Info, _PREHASH_Position, pos); msg->getVector3Fast(_PREHASH_Info, _PREHASH_LookAt, look_at); msg->getU32Fast(_PREHASH_Info, _PREHASH_TeleportFlags, teleport_flags); - + if( gAgent.getTeleportState() != LLAgent::TELEPORT_NONE ) { if( gAgent.getTeleportState() == LLAgent::TELEPORT_LOCAL ) @@ -6782,6 +6793,7 @@ void handle_lure(const uuid_vec_t& ids) if (ids.empty()) return; if (!gAgent.getRegion()) return; + LLSD edit_args; // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-04 (RLVa-1.0.0a) edit_args["REGION"] = @@ -6909,6 +6921,7 @@ const char* SCRIPT_DIALOG_HEADER = "Script Dialog:\n"; bool callback_script_dialog(const LLSD& notification, const LLSD& response) { LLNotificationForm form(notification["form"]); + std::string button = LLNotification::getSelectedOptionName(response); S32 button_idx = LLNotification::getSelectedOption(notification, response); // Didn't click "Ignore" @@ -6954,7 +6967,7 @@ void process_script_dialog(LLMessageSystem* msg, void**) return; // NaCl End - // For compability with OS grids first check for presence of extended packet before fetching data. +// For compability with OS grids first check for presence of extended packet before fetching data. LLUUID owner_id; if (gMessageSystem->getNumberOfBlocks("OwnerData") > 0) { @@ -6974,12 +6987,12 @@ void process_script_dialog(LLMessageSystem* msg, void**) std::string message; std::string first_name; std::string last_name; - std::string title; + std::string object_name; S32 chat_channel; msg->getString("Data", "FirstName", first_name); msg->getString("Data", "LastName", last_name); - msg->getString("Data", "ObjectName", title); + msg->getString("Data", "ObjectName", object_name); msg->getString("Data", "Message", message); msg->getS32("Data", "ChatChannel", chat_channel); @@ -7017,7 +7030,7 @@ void process_script_dialog(LLMessageSystem* msg, void**) } else { - for (i = 1; i < button_count; i++) + for (i = 1; i < button_count; i++) { std::string tdesc; msg->getString("Buttons", "ButtonLabel", tdesc, i); @@ -7026,7 +7039,7 @@ void process_script_dialog(LLMessageSystem* msg, void**) } LLSD args; - args["TITLE"] = title; + args["TITLE"] = object_name; args["MESSAGE"] = message; // args["CHANNEL"] = chat_channel; @@ -7090,7 +7103,7 @@ void callback_load_url_name(const LLUUID& id, const std::string& full_name, bool std::string owner_name; if (is_group) { - owner_name = full_name + " (group)"; + owner_name = full_name + LLTrans::getString("Group"); } else { @@ -7220,7 +7233,7 @@ void process_script_teleport_request(LLMessageSystem* msg, void**) return; // NaCl End if (!gSavedSettings.getBOOL("ScriptsCanShowUI")) return; - + std::string object_name; std::string sim_name; LLVector3 pos; @@ -7292,11 +7305,11 @@ void process_covenant_reply(LLMessageSystem* msg, void**) if (estate_owner_id.isNull()) { // mainland - covenant_text = "There is no Covenant provided for this Estate."; + covenant_text = LLTrans::getString("RegionNoCovenant"); } else { - covenant_text = "There is no Covenant provided for this Estate. The land on this estate is being sold by the Estate owner, not Linden Lab. Please contact the Estate Owner for sales details."; + covenant_text = LLTrans::getString("RegionNoCovenantOtherOwner"); } LLPanelEstateCovenant::updateCovenantText(covenant_text, covenant_id); LLPanelLandCovenant::updateCovenantText(covenant_text); @@ -7432,3 +7445,4 @@ void LLOfferInfo::forceResponse(InventoryOfferResponse response) params.functor(boost::bind(&LLOfferInfo::inventory_offer_callback, this, _1, _2)); LLNotifications::instance().forceResponse(params, response); } + diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 186e7d57b..b8833d302 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -241,6 +241,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mNumFaces(0), mTimeDilation(1.f), mRotTime(0.f), + mAngularVelocityRot(), mState(0), mMedia(NULL), mClickAction(0), @@ -270,6 +271,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe { mPositionAgent = mRegionp->getOriginAgent(); } + resetRot(); LLViewerObject::sNumObjects++; } @@ -2105,14 +2107,14 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, if (new_rot != getRotation() || new_angv != old_angv) { - if (new_rot != getRotation()) + if (new_angv != old_angv) { - setRotation(new_rot); + resetRot(); } - + + // Set the rotation of the object followed by adjusting for the accumulated angular velocity (llSetTargetOmega) + setRotation(new_rot * mAngularVelocityRot); setChanged(ROTATED | SILHOUETTE); - - resetRot(); } @@ -5498,8 +5500,13 @@ void LLViewerObject::applyAngularVelocity(F32 dt) ang_vel *= 1.f/omega; + // calculate the delta increment based on the object's angular velocity dQ.setQuat(angle, ang_vel); + + // accumulate the angular velocity rotations to re-apply in the case of an object update + mAngularVelocityRot *= dQ; + // Just apply the delta increment to the current rotation setRotation(getRotation()*dQ); setChanged(MOVED | SILHOUETTE); } @@ -5508,6 +5515,9 @@ void LLViewerObject::applyAngularVelocity(F32 dt) void LLViewerObject::resetRot() { mRotTime = 0.0f; + + // Reset the accumulated angular velocity rotation + mAngularVelocityRot.loadIdentity(); } U32 LLViewerObject::getPartitionType() const diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 2b9597510..791393533 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -736,6 +736,7 @@ protected: F32 mTimeDilation; // Time dilation sent with the object. F32 mRotTime; // Amount (in seconds) that object has rotated according to angular velocity (llSetTargetOmega) + LLQuaternion mAngularVelocityRot; // accumulated rotation from the angular velocity computations U8 mState; // legacy LLViewerObjectMedia* mMedia; // NULL if no media associated diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 475950f5d..df6a14a20 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1499,6 +1499,10 @@ void LLViewerObjectList::onPhysicsFlagsFetchFailure(const LLUUID& object_id) mPendingPhysicsFlags.erase(object_id); } +static LLFastTimer::DeclareTimer FTM_SHIFT_OBJECTS("Shift Objects"); +static LLFastTimer::DeclareTimer FTM_PIPELINE_SHIFT("Pipeline Shift"); +static LLFastTimer::DeclareTimer FTM_REGION_SHIFT("Region Shift"); + void LLViewerObjectList::shiftObjects(const LLVector3 &offset) { // This is called when we shift our origin when we cross region boundaries... @@ -1510,6 +1514,8 @@ void LLViewerObjectList::shiftObjects(const LLVector3 &offset) return; } + LLFastTimer t(FTM_SHIFT_OBJECTS); + LLViewerObject *objectp; for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter) { @@ -1526,8 +1532,15 @@ void LLViewerObjectList::shiftObjects(const LLVector3 &offset) } } - gPipeline.shiftObjects(offset); - LLWorld::getInstance()->shiftRegions(offset); + { + LLFastTimer t(FTM_PIPELINE_SHIFT); + gPipeline.shiftObjects(offset); + } + + { + LLFastTimer t(FTM_REGION_SHIFT); + LLWorld::getInstance()->shiftRegions(offset); + } } void LLViewerObjectList::repartitionObjects() @@ -2062,8 +2075,8 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port) llinfos << "Agent: " << objectp->getPositionAgent() << llendl; addDebugBeacon(objectp->getPositionAgent(),""); #endif - gPipeline.markMoved(objectp->mDrawable); - objectp->setChanged(LLXform::MOVED | LLXform::SILHOUETTE); + gPipeline.markMoved(objectp->mDrawable); + objectp->setChanged(LLXform::MOVED | LLXform::SILHOUETTE); // Flag the object as no longer orphaned childp->mOrphaned = FALSE; diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 75b2170fb..356cc6cac 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -576,10 +576,10 @@ void LLViewerShaderMgr::setShaders() //Flag base shader objects for deletion //Don't worry-- they won't be deleted until no programs refrence them. - std::map::iterator it = mShaderObjects.begin(); + std::multimap::iterator it = mShaderObjects.begin(); for(; it!=mShaderObjects.end();++it) - if(it->second) - glDeleteObjectARB(it->second); + if(it->second.mHandle) + glDeleteObjectARB(it->second.mHandle); mShaderObjects.clear(); } else diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index c2f4d51e0..4b27f6a2a 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2099,7 +2099,9 @@ LLViewerObject* LLVOAvatar::lineSegmentIntersectRiggedAttachments(const LLVector LLVector3* normal, LLVector3* bi_normal) { - if (isSelf() && !gAgent.needsRenderAvatar()) + static const LLCachedControl allow_mesh_picking("SGAllowRiggedMeshSelection"); + + if (!allow_mesh_picking || (isSelf() && !gAgent.needsRenderAvatar())) { return NULL; } diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index 6434dd619..c36ad0787 100644 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -330,6 +330,7 @@ BOOL LLVOGrass::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) return TRUE ; } + if (mPatch && (mLastPatchUpdateTime != mPatch->getLastUpdateTime())) { gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE); diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 0362adaf4..78a000a93 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -1113,7 +1113,7 @@ LLVoiceClient::LLVoiceClient() gVoiceClient = this; mWriteInProgress = false; mAreaVoiceDisabled = false; - mPTT = true; + mPTT = false; mUserPTTState = false; mMuteMic = false; mSessionTerminateRequested = false; diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index 0a5a76900..3dca0b479 100644 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -167,6 +167,7 @@ void LLVOPartGroup::freeVBSlot(S32 idx) *sVBSlotCursor = idx; } } + LLVOPartGroup::LLVOPartGroup(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) : LLAlphaObject(id, pcode, regionp), mViewerPartGroupp(NULL) @@ -181,7 +182,6 @@ LLVOPartGroup::~LLVOPartGroup() { } - BOOL LLVOPartGroup::isActive() const { return FALSE; diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 416834eee..de657beed 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -352,7 +352,6 @@ LLVOSky::LLVOSky(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) cloud_pos_density1 = LLColor3(); cloud_pos_density2 = LLColor3(); - mInitialized = FALSE; mbCanSelect = FALSE; mUpdateTimer.reset(); @@ -409,7 +408,6 @@ LLVOSky::~LLVOSky() mCubeMap = NULL; } - void LLVOSky::init() { const F32 haze_int = color_intens(mHaze.calcSigSca(0)); @@ -1250,6 +1248,7 @@ void LLVOSky::createDummyVertexBuffer() } static LLFastTimer::DeclareTimer FTM_RENDER_FAKE_VBO_UPDATE("Fake VBO Update"); + void LLVOSky::updateDummyVertexBuffer() { if(!LLVertexBuffer::sEnableVBOs) @@ -1491,6 +1490,7 @@ BOOL LLVOSky::updateHeavenlyBodyGeometry(LLDrawable *drawable, const S32 f, cons } llassert(facep->getVertexBuffer()->getNumIndices() == 6); + index_offset = facep->getGeometry(verticesp,normalsp,texCoordsp, indicesp); if (-1 == index_offset) diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index e50c11ced..c765371c6 100644 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -894,7 +894,6 @@ void LLVOTree::updateMesh() S32 stop_depth = 0; F32 alpha = 1.0; - U32 vert_count = 0; U32 index_count = 0; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 29d6b24f3..1e1ca8bad 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1044,9 +1044,9 @@ BOOL LLVOVolume::calcLOD() F32 radius; F32 distance; - if (mDrawable->isState(LLDrawable::RIGGED) && getAvatar()) + if (mDrawable->isState(LLDrawable::RIGGED) && getAvatar() && getAvatar()->mDrawable) { - LLVOAvatar* avatar = getAvatar(); + LLVOAvatar* avatar = getAvatar(); distance = avatar->mDrawable->mDistanceWRTCamera; radius = avatar->getBinRadius(); } @@ -1605,9 +1605,13 @@ S32 LLVOVolume::setTEColor(const U8 te, const LLColor4& color) } else if (color != tep->getColor()) { - if (color.mV[3] != tep->getColor().mV[3]) + F32 old_alpha = tep->getColor().mV[3]; + if ((color.mV[3] != old_alpha) && (color.mV[3] == 1.f || old_alpha == 1.f)) { gPipeline.markTextured(mDrawable); + //treat this alpha change as an LoD update since render batches may need to get rebuilt + mLODChanged = TRUE; + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, FALSE); } retval = LLPrimitive::setTEColor(te, color); if (mDrawable.notNull() && retval) @@ -2827,10 +2831,11 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector3& start, const LLVector3& e if (mDrawable->isState(LLDrawable::RIGGED)) { - if (gFloaterTools->getVisible() && getAvatar()->isSelf()) + static const LLCachedControl allow_mesh_picking("SGAllowRiggedMeshSelection"); + if (allow_mesh_picking && gFloaterTools->getVisible() && getAvatar()->isSelf()) { updateRiggedVolume(); - genBBoxes(FALSE); + //genBBoxes(FALSE); volume = mRiggedVolume; transform = false; } diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index 05e033392..6f085d6cc 100644 --- a/indra/newview/llvowater.cpp +++ b/indra/newview/llvowater.cpp @@ -140,6 +140,7 @@ LLDrawable *LLVOWater::createDrawable(LLPipeline *pipeline) } static LLFastTimer::DeclareTimer FTM_UPDATE_WATER("Update Water"); + BOOL LLVOWater::updateGeometry(LLDrawable *drawable) { LLFastTimer ftm(FTM_UPDATE_WATER); @@ -213,6 +214,7 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable) { //bump edge patches down 10 cm to prevent aliasing along edges z_fudge = -0.1f; } + for (y = 0; y < size; y++) { for (x = 0; x < size; x++) diff --git a/indra/newview/llvowlsky.cpp b/indra/newview/llvowlsky.cpp index e9a03fee8..492bfe174 100644 --- a/indra/newview/llvowlsky.cpp +++ b/indra/newview/llvowlsky.cpp @@ -354,6 +354,7 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable) llinfos << "WL Skydome strips in " << strips_segments << " batches." << llendl; mStripsVerts.resize(strips_segments, NULL); + LLTimer timer; timer.start(); diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp index ed81936f7..6f6411ce3 100644 --- a/indra/newview/llwearablelist.cpp +++ b/indra/newview/llwearablelist.cpp @@ -177,8 +177,7 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID else { LLSD args; - // *TODO:translate - args["TYPE"] = LLAssetType::lookupHumanReadable(data->mAssetType); + args["TYPE"] =LLTrans::getString(LLAssetType::lookupHumanReadable(data->mAssetType)); if (isNewWearable) { LLNotificationsUtil::add("InvalidWearable"); @@ -230,7 +229,7 @@ LLWearable* LLWearableList::createNewWearable( LLWearableType::EType type ) LLWearable *wearable = generateNewWearable(); wearable->setType( type ); - std::string name = LLWearableType::getTypeDefaultNewName(wearable->getType()); + std::string name = LLTrans::getString( LLWearableType::getTypeDefaultNewName(wearable->getType()) ); wearable->setName( name ); LLPermissions perm; diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 6f92bedf9..e4605ec9c 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -1253,9 +1253,11 @@ void LLWorld::disconnectRegions() } } +static LLFastTimer::DeclareTimer FTM_ENABLE_SIMULATOR("Enable Sim"); void process_enable_simulator(LLMessageSystem *msg, void **user_data) { + LLFastTimer t(FTM_ENABLE_SIMULATOR); // enable the appropriate circuit for this simulator and // add its values into the gSimulator structure U64 handle; diff --git a/indra/newview/m7wlinterface.cpp b/indra/newview/m7wlinterface.cpp index 365e6165a..7906ab81a 100644 --- a/indra/newview/m7wlinterface.cpp +++ b/indra/newview/m7wlinterface.cpp @@ -45,6 +45,22 @@ void M7WindlightInterface::receiveMessage(LLMessageSystem* msg) _PREHASH_ParamList, _PREHASH_Parameter, buf, size, i, 249); +#if 0 + std::ostringstream wldump; + char hex []= "0123456789abcdefRRRR"; + for (int i = 0; i<250; ++i){ + wldump << "\\x" << hex[((U8)buf[i]&0xF0)>>4] << hex[(U8)buf[i]&0x0F]; + } + llinfos << "Received LightShare data: " << wldump.str() << llendl; +#endif + char default_windlight[] = "\x00\x00\x80\x40\x00\x00\x18\x42\x00\x00\x80\x42\x00\x00\x80\x40\x00\x00\x80\x3e\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x40\xcd\xcc\xcc\x3e\x00\x00\x00\x3f\x8f\xc2\xf5\x3c\xcd\xcc\x4c\x3e\x0a\xd7\x23\x3d\x66\x66\x86\x3f\x3d\x0a\xd7\xbe\x7b\x14\x8e\x3f\xe1\x7a\x94\xbf\x82\x2d\xed\x49\x9a\x6c\xf6\x1c\xcb\x89\x6d\xf5\x4f\x42\xcd\xf4\x00\x00\x80\x3e\x00\x00\x80\x3e\x0a\xd7\xa3\x3e\x0a\xd7\xa3\x3e\x5c\x8f\x42\x3e\x8f\xc2\xf5\x3d\xae\x47\x61\x3e\x5c\x8f\xc2\x3e\x5c\x8f\xc2\x3e\x33\x33\x33\x3f\xec\x51\x38\x3e\xcd\xcc\x4c\x3f\x8f\xc2\x75\x3e\xb8\x1e\x85\x3e\x9a\x99\x99\x3e\x9a\x99\x99\x3e\xd3\x4d\xa2\x3e\x33\x33\xb3\x3e\x33\x33\xb3\x3e\x33\x33\xb3\x3e\x33\x33\xb3\x3e\x00\x00\x00\x00\xcd\xcc\xcc\x3d\x00\x00\xe0\x3f\x00\x00\x80\x3f\x00\x00\x00\x00\x85\xeb\xd1\x3e\x85\xeb\xd1\x3e\x85\xeb\xd1\x3e\x85\xeb\xd1\x3e\x00\x00\x80\x3f\x14\xae\x07\x3f\x00\x00\x80\x3f\x71\x3d\x8a\x3e\x3d\x0a\xd7\x3e\x00\x00\x80\x3f\x14\xae\x07\x3f\x8f\xc2\xf5\x3d\xcd\xcc\x4c\x3e\x0a\xd7\x23\x3c\x45\x06\x00"; + if(!memcmp(default_windlight, buf, sizeof(default_windlight))) + { + llinfos << "LightShare matches default" << llendl; + receiveReset(); + return; + } + LLWaterParamManager::getInstance()->getParamSet("Default", mWater); Meta7WindlightPacket* wl = (Meta7WindlightPacket*)buf; @@ -120,6 +136,7 @@ void M7WindlightInterface::receiveMessage(LLMessageSystem* msg) void M7WindlightInterface::receiveReset() { + llinfos << "Received LightShare reset" << llendl; mHasOverride = false; LLEnvManagerNew::getInstance()->usePrefs(); } diff --git a/indra/newview/meta7windlight.h b/indra/newview/meta7windlight.h index 04ce86d46..03af81165 100644 --- a/indra/newview/meta7windlight.h +++ b/indra/newview/meta7windlight.h @@ -31,6 +31,9 @@ #include "linden_common.h" +#pragma pack(push) +#pragma pack(1) + struct M7Color3{ M7Color3(){}; M7Color3(F32 pRed, F32 pGreen, F32 pBlue) @@ -124,8 +127,8 @@ struct Meta7WindlightPacket { char cloudScrollXLock; char cloudScrollYLock; char drawClassicClouds; - - }; +#pragma pack(pop) + #endif diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 12f7c170e..4a8a021a2 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -110,7 +110,7 @@ #include "llspatialpartition.h" #include "llmutelist.h" -// [RLVa:KB] +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) #include "rlvhandler.h" #include "rlvlocks.h" // [/RLVa:KB] @@ -185,8 +185,13 @@ LLFastTimer::DeclareTimer FTM_RENDER_BUMP("Bump"); LLFastTimer::DeclareTimer FTM_RENDER_FULLBRIGHT("Fullbright"); LLFastTimer::DeclareTimer FTM_RENDER_GLOW("Glow"); LLFastTimer::DeclareTimer FTM_GEO_UPDATE("Geo Update"); +LLFastTimer::DeclareTimer FTM_PIPELINE_CREATE("Pipeline Create"); LLFastTimer::DeclareTimer FTM_POOLRENDER("RenderPool"); LLFastTimer::DeclareTimer FTM_POOLS("Pools"); +LLFastTimer::DeclareTimer FTM_DEFERRED_POOLRENDER("RenderPool (Deferred)"); +LLFastTimer::DeclareTimer FTM_DEFERRED_POOLS("Pools (Deferred)"); +LLFastTimer::DeclareTimer FTM_POST_DEFERRED_POOLRENDER("RenderPool (Post)"); +LLFastTimer::DeclareTimer FTM_POST_DEFERRED_POOLS("Pools (Post)"); LLFastTimer::DeclareTimer FTM_RENDER_BLOOM_FBO("First FBO"); LLFastTimer::DeclareTimer FTM_STATESORT("Sort Draw State"); LLFastTimer::DeclareTimer FTM_PIPELINE("Pipeline"); @@ -1474,7 +1479,7 @@ U32 LLPipeline::addObject(LLViewerObject *vobj) void LLPipeline::createObjects(F32 max_dtime) { - LLFastTimer ftm(FTM_GEO_UPDATE); + LLFastTimer ftm(FTM_PIPELINE_CREATE); LLMemType mt(LLMemType::MTYPE_PIPELINE_CREATE_OBJECTS); LLTimer update_timer; @@ -2311,14 +2316,19 @@ BOOL LLPipeline::updateDrawableGeom(LLDrawable* drawablep, BOOL priority) static LLFastTimer::DeclareTimer FTM_SEED_VBO_POOLS("Seed VBO Pool"); +static LLFastTimer::DeclareTimer FTM_UPDATE_GL("Update GL"); + void LLPipeline::updateGL() { - while (!LLGLUpdate::sGLQ.empty()) { - LLGLUpdate* glu = LLGLUpdate::sGLQ.front(); - glu->updateGL(); - glu->mInQ = FALSE; - LLGLUpdate::sGLQ.pop_front(); + LLFastTimer t(FTM_UPDATE_GL); + while (!LLGLUpdate::sGLQ.empty()) + { + LLGLUpdate* glu = LLGLUpdate::sGLQ.front(); + glu->updateGL(); + glu->mInQ = FALSE; + LLGLUpdate::sGLQ.pop_front(); + } } /*{ //seed VBO Pools @@ -2327,11 +2337,14 @@ void LLPipeline::updateGL() }*/ } +static LLFastTimer::DeclareTimer FTM_REBUILD_PRIORITY_GROUPS("Rebuild Priority Groups"); + void LLPipeline::rebuildPriorityGroups() { + LLFastTimer t(FTM_REBUILD_PRIORITY_GROUPS); LLTimer update_timer; LLMemType mt(LLMemType::MTYPE_PIPELINE); - + assertInitialized(); gMeshRepo.notifyLoadedMeshes(); @@ -2350,7 +2363,9 @@ void LLPipeline::rebuildPriorityGroups() mGroupQ1Locked = false; } - + +static LLFastTimer::DeclareTimer FTM_REBUILD_GROUPS("Rebuild Groups"); + void LLPipeline::rebuildGroups() { if (mGroupQ2.empty()) @@ -2358,6 +2373,7 @@ void LLPipeline::rebuildGroups() return; } + LLFastTimer t(FTM_REBUILD_GROUPS); mGroupQ2Locked = true; // Iterate through some drawables on the non-priority build queue S32 size = (S32) mGroupQ2.size(); @@ -2614,6 +2630,10 @@ void LLPipeline::markShift(LLDrawable *drawablep) } } +static LLFastTimer::DeclareTimer FTM_SHIFT_DRAWABLE("Shift Drawable"); +static LLFastTimer::DeclareTimer FTM_SHIFT_OCTREE("Shift Octree"); +static LLFastTimer::DeclareTimer FTM_SHIFT_HUD("Shift HUD"); + void LLPipeline::shiftObjects(const LLVector3 &offset) { LLMemType mt(LLMemType::MTYPE_PIPELINE_SHIFT_OBJECTS); @@ -2626,35 +2646,44 @@ void LLPipeline::shiftObjects(const LLVector3 &offset) LLVector4a offseta; offseta.load3(offset.mV); - for (LLDrawable::drawable_vector_t::iterator iter = mShiftList.begin(); - iter != mShiftList.end(); iter++) { - LLDrawable *drawablep = *iter; - if (drawablep->isDead()) + LLFastTimer t(FTM_SHIFT_DRAWABLE); + for (LLDrawable::drawable_vector_t::iterator iter = mShiftList.begin(); + iter != mShiftList.end(); iter++) { - continue; - } - drawablep->shiftPos(offseta); - drawablep->clearState(LLDrawable::ON_SHIFT_LIST); - } - mShiftList.resize(0); - - for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); - iter != LLWorld::getInstance()->getRegionList().end(); ++iter) - { - LLViewerRegion* region = *iter; - for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++) - { - LLSpatialPartition* part = region->getSpatialPartition(i); - if (part) + LLDrawable *drawablep = *iter; + if (drawablep->isDead()) { - part->shift(offseta); + continue; + } + drawablep->shiftPos(offseta); + drawablep->clearState(LLDrawable::ON_SHIFT_LIST); + } + mShiftList.resize(0); + } + + { + LLFastTimer t(FTM_SHIFT_OCTREE); + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) + { + LLViewerRegion* region = *iter; + for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++) + { + LLSpatialPartition* part = region->getSpatialPartition(i); + if (part) + { + part->shift(offseta); + } } } } - LLHUDText::shiftAll(offset); - LLHUDNameTag::shiftAll(offset); + { + LLFastTimer t(FTM_SHIFT_HUD); + LLHUDText::shiftAll(offset); + LLHUDNameTag::shiftAll(offset); + } display_update_camera(); } @@ -2687,8 +2716,10 @@ void LLPipeline::markPartitionMove(LLDrawable* drawable) } } +static LLFastTimer::DeclareTimer FTM_PROCESS_PARTITIONQ("PartitionQ"); void LLPipeline::processPartitionQ() { + LLFastTimer t(FTM_PROCESS_PARTITIONQ); for (LLDrawable::drawable_list_t::iterator iter = mPartitionQ.begin(); iter != mPartitionQ.end(); ++iter) { LLDrawable* drawable = *iter; @@ -3228,7 +3259,7 @@ void LLPipeline::postSort(LLCamera& camera) rebuildPriorityGroups(); llpushcallstacks ; - + //build render map for (LLCullResult::sg_iterator i = sCull->beginVisibleGroups(); i != sCull->endVisibleGroups(); ++i) { @@ -3849,7 +3880,7 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera) LLMemType mt_rgd(LLMemType::MTYPE_PIPELINE_RENDER_GEOM_DEFFERRED); LLFastTimer t(FTM_RENDER_GEOMETRY); - LLFastTimer t2(FTM_POOLS); + LLFastTimer t2(FTM_DEFERRED_POOLS); LLGLEnable cull(GL_CULL_FACE); @@ -3892,7 +3923,7 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera) pool_set_t::iterator iter2 = iter1; if (hasRenderType(poolp->getType()) && poolp->getNumDeferredPasses() > 0) { - LLFastTimer t(FTM_POOLRENDER); + LLFastTimer t(FTM_DEFERRED_POOLRENDER); gGLLastMatrix = NULL; gGL.loadMatrix(gGLModelView); @@ -3947,7 +3978,7 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera) void LLPipeline::renderGeomPostDeferred(LLCamera& camera) { LLMemType mt_rgpd(LLMemType::MTYPE_PIPELINE_RENDER_GEOM_POST_DEF); - LLFastTimer t(FTM_POOLS); + LLFastTimer t(FTM_POST_DEFERRED_POOLS); U32 cur_type = 0; LLGLEnable cull(GL_CULL_FACE); @@ -3982,7 +4013,7 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera) pool_set_t::iterator iter2 = iter1; if (hasRenderType(poolp->getType()) && poolp->getNumPostDeferredPasses() > 0) { - LLFastTimer t(FTM_POOLRENDER); + LLFastTimer t(FTM_POST_DEFERRED_POOLRENDER); gGLLastMatrix = NULL; gGL.loadMatrix(gGLModelView); @@ -4398,8 +4429,7 @@ void LLPipeline::renderDebug() gGL.vertex3fv(frust[2].mV); gGL.vertex3fv(frust[6].mV); gGL.vertex3fv(frust[3].mV); gGL.vertex3fv(frust[7].mV); gGL.end(); - } - + } } /*gGL.flush(); @@ -4527,8 +4557,11 @@ void LLPipeline::renderDebug() } } +static LLFastTimer::DeclareTimer FTM_REBUILD_POOLS("Rebuild Pools"); + void LLPipeline::rebuildPools() { + LLFastTimer t(FTM_REBUILD_POOLS); LLMemType mt(LLMemType::MTYPE_PIPELINE_REBUILD_POOLS); assertInitialized(); @@ -6126,13 +6159,16 @@ void LLPipeline::resetVertexBuffers() { mResetVertexBuffers = true; } +static LLFastTimer::DeclareTimer FTM_RESET_VB("Reset VB"); + void LLPipeline::doResetVertexBuffers() { if (!mResetVertexBuffers) { return; } - + + LLFastTimer t(FTM_RESET_VB); mResetVertexBuffers = false; mCubeVB = NULL; @@ -6631,7 +6667,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield, b F32 blur_constant = focal_length*focal_length/(fnumber*(subject_distance-focal_length)); blur_constant /= 1000.f; //convert to meters for shader F32 magnification = focal_length/(subject_distance-focal_length); - + { //build diffuse+bloom+CoF mDeferredLight.bindTarget(); shader = &gDeferredCoFProgram; @@ -7238,7 +7274,7 @@ void LLPipeline::renderDeferredLighting() static const LLCachedControl RenderShadowBlurDistFactor("RenderShadowBlurDistFactor",.1f); static const LLCachedControl RenderDeferredAtmospheric("RenderDeferredAtmospheric",false); static const LLCachedControl RenderLocalLights("RenderLocalLights",false); - + { LLFastTimer ftm(FTM_RENDER_DEFERRED); @@ -7498,7 +7534,7 @@ void LLPipeline::renderDeferredLighting() } mCubeVB->setBuffer(LLVertexBuffer::MAP_VERTEX); - + LLGLDepthTest depth(GL_TRUE, GL_FALSE); for (LLDrawable::drawable_set_t::iterator iter = mLights.begin(); iter != mLights.end(); ++iter) { @@ -7544,7 +7580,7 @@ void LLPipeline::renderDeferredLighting() } sVisibleLightCount++; - + if (camera->getOrigin().mV[0] > c[0] + s + 0.2f || camera->getOrigin().mV[0] < c[0] - s - 0.2f || camera->getOrigin().mV[1] > c[1] + s + 0.2f || @@ -8040,14 +8076,14 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) gGL.setColorMask(true, false); mWaterRef.getViewport(gGLViewport); - + stop_glerror(); gGL.pushMatrix(); mat.set_scale(glh::vec3f(1,1,-1)); mat.set_translate(glh::vec3f(0,0,height*2.f)); - + glh::matrix4f current = glh_get_current_modelview(); mat = current * mat; @@ -8067,7 +8103,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) glCullFace(GL_FRONT); static LLCullResult ref_result; - + if (LLDrawPoolWater::sNeedsReflectionUpdate) { //initial sky pass (no user clip plane) @@ -8100,10 +8136,10 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) #endif if (detail < 3) { - clearRenderTypeMask(LLPipeline::RENDER_TYPE_AVATAR, END_RENDER_TYPES); + clearRenderTypeMask(LLPipeline::RENDER_TYPE_AVATAR, END_RENDER_TYPES); if (detail < 2) { - clearRenderTypeMask(LLPipeline::RENDER_TYPE_VOLUME, END_RENDER_TYPES); + clearRenderTypeMask(LLPipeline::RENDER_TYPE_VOLUME, END_RENDER_TYPES); } } } @@ -8379,7 +8415,7 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera gDeferredShadowAlphaMaskProgram.bind(); gDeferredShadowAlphaMaskProgram.setMinimumAlpha(0.598f); gDeferredShadowAlphaMaskProgram.uniform1f(LLShaderMgr::DEFERRED_SHADOW_TARGET_WIDTH, (float)target_width); - + U32 mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_COLOR | @@ -8593,6 +8629,7 @@ BOOL LLPipeline::getVisiblePointCloud(LLCamera& camera, LLVector3& min, LLVector } +static LLFastTimer::DeclareTimer FTM_GEN_SUN_SHADOW("Gen Sun Shadow"); void LLPipeline::generateSunShadow(LLCamera& camera) { @@ -8611,6 +8648,8 @@ void LLPipeline::generateSunShadow(LLCamera& camera) return; } + LLFastTimer t(FTM_GEN_SUN_SHADOW); + BOOL skip_avatar_update = FALSE; if (!isAgentAvatarValid() || gAgentCamera.getCameraAnimating() || gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK || !LLVOAvatar::sVisibleInFirstPerson) { @@ -9372,6 +9411,12 @@ void LLPipeline::renderGroups(LLRenderPass* pass, U32 type, U32 mask, BOOL textu } } +static LLFastTimer::DeclareTimer FTM_IMPOSTOR_MARK_VISIBLE("Impostor Mark Visible"); +static LLFastTimer::DeclareTimer FTM_IMPOSTOR_SETUP("Impostor Setup"); +static LLFastTimer::DeclareTimer FTM_IMPOSTOR_BACKGROUND("Impostor Background"); +static LLFastTimer::DeclareTimer FTM_IMPOSTOR_ALLOCATE("Impostor Allocate"); +static LLFastTimer::DeclareTimer FTM_IMPOSTOR_RESIZE("Impostor Resize"); + void LLPipeline::generateImpostor(LLVOAvatar* avatar) { LLMemType mt_gi(LLMemType::MTYPE_PIPELINE_GENERATE_IMPOSTOR); @@ -9427,22 +9472,26 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) sImpostorRender = TRUE; LLViewerCamera* viewer_camera = LLViewerCamera::getInstance(); - markVisible(avatar->mDrawable, *viewer_camera); - LLVOAvatar::sUseImpostors = FALSE; - LLVOAvatar::attachment_map_t::iterator iter; - for (iter = avatar->mAttachmentPoints.begin(); - iter != avatar->mAttachmentPoints.end(); - ++iter) { - LLViewerJointAttachment *attachment = iter->second; - for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); - attachment_iter != attachment->mAttachedObjects.end(); - ++attachment_iter) + LLFastTimer t(FTM_IMPOSTOR_MARK_VISIBLE); + markVisible(avatar->mDrawable, *viewer_camera); + LLVOAvatar::sUseImpostors = FALSE; + + LLVOAvatar::attachment_map_t::iterator iter; + for (iter = avatar->mAttachmentPoints.begin(); + iter != avatar->mAttachmentPoints.end(); + ++iter) { - if (LLViewerObject* attached_object = (*attachment_iter)) + LLViewerJointAttachment *attachment = iter->second; + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) { - markVisible(attached_object->mDrawable->getSpatialBridge(), *viewer_camera); + if (LLViewerObject* attached_object = (*attachment_iter)) + { + markVisible(attached_object->mDrawable->getSpatialBridge(), *viewer_camera); + } } } } @@ -9455,6 +9504,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) U32 resX = 0; { + LLFastTimer t(FTM_IMPOSTOR_SETUP); const LLVector4a* ext = avatar->mDrawable->getSpatialExtents(); LLVector3 pos(avatar->getRenderPosition()+avatar->getImpostorOffset()); @@ -9509,6 +9559,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) if (!avatar->mImpostor.isComplete()) { + LLFastTimer t(FTM_IMPOSTOR_ALLOCATE); avatar->mImpostor.allocate(resX,resY,GL_RGBA,TRUE,FALSE); if (LLPipeline::sRenderDeferred) @@ -9523,6 +9574,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) else if(resX != avatar->mImpostor.getWidth() || resY != avatar->mImpostor.getHeight()) { + LLFastTimer t(FTM_IMPOSTOR_RESIZE); avatar->mImpostor.resize(resX,resY,GL_RGBA); } @@ -9544,6 +9596,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) } { //create alpha mask based on depth buffer (grey out if muted) + LLFastTimer t(FTM_IMPOSTOR_BACKGROUND); if (LLPipeline::sRenderDeferred) { GLuint buff = GL_COLOR_ATTACHMENT0; diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 6dd80b5b1..e5ed58ca1 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -168,7 +168,7 @@ public: void markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags flag = LLDrawable::REBUILD_ALL, BOOL priority = FALSE); void markPartitionMove(LLDrawable* drawablep); void markMeshDirty(LLSpatialGroup* group); - + //get the object between start and end that's closest to start. LLViewerObject* lineSegmentIntersectInWorld(const LLVector3& start, const LLVector3& end, BOOL pick_transparent, diff --git a/indra/newview/skins/default/xui/en-us/floater_god_tools.xml b/indra/newview/skins/default/xui/en-us/floater_god_tools.xml index c4dd40f74..bb8e1c8a8 100644 --- a/indra/newview/skins/default/xui/en-us/floater_god_tools.xml +++ b/indra/newview/skins/default/xui/en-us/floater_god_tools.xml @@ -154,6 +154,10 @@ + + (no target) + - - You are the only user in this session. - - - [NAME] is offline. - - - Click the [BUTTON NAME] button to accept/connect to this voice chat. - - - You have muted this resident. Sending a message will automatically unmute them. - - - - Error making request, please try again later. - - - You do not have sufficient permissions. - - - The session no longer exists - - - You do not have that ability. - - - You are not a session moderator. - - - A group moderator disabled your text chat. - - - - - Unable to add users to chat session with [RECIPIENT]. - - - Unable to send your message to the chat session with [RECIPIENT]. - - - You have been removed from the group. - - - You no longer have the ability to be in the chat session. - diff --git a/indra/newview/skins/default/xui/en-us/floater_instant_message.xml b/indra/newview/skins/default/xui/en-us/floater_instant_message.xml index 233b7645d..c0b222733 100644 --- a/indra/newview/skins/default/xui/en-us/floater_instant_message.xml +++ b/indra/newview/skins/default/xui/en-us/floater_instant_message.xml @@ -17,7 +17,7 @@ RP Mode