diff --git a/indra/llcharacter/llheadrotmotion.cpp b/indra/llcharacter/llheadrotmotion.cpp index 92e7f7e7b..80274e886 100644 --- a/indra/llcharacter/llheadrotmotion.cpp +++ b/indra/llcharacter/llheadrotmotion.cpp @@ -250,11 +250,14 @@ BOOL LLHeadRotMotion::onUpdate(F32 time, U8* joint_mask) head_rot_local = nlerp(head_slerp_amt, mLastHeadRot, head_rot_local); mLastHeadRot = head_rot_local; - // Set the head rotation. - LLQuaternion torsoRotLocal = mNeckState->getJoint()->getParent()->getWorldRotation() * currentInvRootRotWorld; - head_rot_local = head_rot_local * ~torsoRotLocal; - mNeckState->setRotation( nlerp(NECK_LAG, LLQuaternion::DEFAULT, head_rot_local) ); - mHeadState->setRotation( nlerp(1.f - NECK_LAG, LLQuaternion::DEFAULT, head_rot_local)); + if(mNeckState->getJoint() && mNeckState->getJoint()->getParent()) //Guess this has crashed? Taken from snowglobe -Shyotl + { + // Set the head rotation. + LLQuaternion torsoRotLocal = mNeckState->getJoint()->getParent()->getWorldRotation() * currentInvRootRotWorld; + head_rot_local = head_rot_local * ~torsoRotLocal; + mNeckState->setRotation( nlerp(NECK_LAG, LLQuaternion::DEFAULT, head_rot_local) ); + mHeadState->setRotation( nlerp(1.f - NECK_LAG, LLQuaternion::DEFAULT, head_rot_local)); + } return TRUE; } diff --git a/indra/llcommon/llformat.cpp b/indra/llcommon/llformat.cpp index cf509bee1..7a500c9e5 100644 --- a/indra/llcommon/llformat.cpp +++ b/indra/llcommon/llformat.cpp @@ -48,5 +48,6 @@ std::string llformat(const char *fmt, ...) vsnprintf(tstr, 1024, fmt, va); /* Flawfinder: ignore */ #endif va_end(va); + tstr[1023] = '\0'; return std::string(tstr); } diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp index dbb0eb82c..7fb9a8ab8 100644 --- a/indra/llcommon/llqueuedthread.cpp +++ b/indra/llcommon/llqueuedthread.cpp @@ -435,17 +435,16 @@ S32 LLQueuedThread::processNextRequest() { lockData(); req->setStatus(STATUS_COMPLETE); - unlockData(); + req->finishRequest(true); if ((req->getFlags() & FLAG_AUTO_COMPLETE)) { - lockData(); mRequestHash.erase(req); req->deleteRequest(); - unlockData(); } + unlockData(); } else { diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index 0e1dcb6fc..f08b4c042 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -582,10 +582,16 @@ std::string utf8str_removeCRLF(const std::string& utf8str) } const char CR = 13; + S32 i = utf8str.find(CR); + if(i == std::string::npos) + return utf8str; //Save us from a reserve call. + std::string out; out.reserve(utf8str.length()); const S32 len = (S32)utf8str.length(); - for( S32 i = 0; i < len; i++ ) + if(i) + out.assign(utf8str,0,i); //Copy previous text to buffer + for( ++i; i < len; i++ ) { if( utf8str[i] != CR ) { diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 7eb3c5417..d6ff49217 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -139,7 +139,8 @@ BOOL LLImageBase::sSizeOverride = FALSE; // virtual void LLImageBase::deleteData() { - delete[] mData; + if(mData) + free(mData);//delete[] mData; mData = NULL; mDataSize = 0; } @@ -166,14 +167,17 @@ U8* LLImageBase::allocateData(S32 size) { deleteData(); // virtual mBadBufferAllocation = FALSE ; - mData = new U8[size]; - if (!mData) + U8 *data = (U8 *)realloc(mData,sizeof(U8)*size);//new U8[size]; + if (!data) { + if(mData) + free(mData); llwarns << "allocate image data: " << size << llendl; size = 0 ; mWidth = mHeight = 0 ; mBadBufferAllocation = TRUE ; } + mData = data; mDataSize = size; } @@ -184,21 +188,16 @@ U8* LLImageBase::allocateData(S32 size) U8* LLImageBase::reallocateData(S32 size) { LLMemType mt1((LLMemType::EMemType)mMemType); - U8 *new_datap = new U8[size]; - if (!new_datap) + U8 *data = (U8 *)realloc(mData,sizeof(U8)*size); + if(data) { + mData = data; + mDataSize = size; + } + else llwarns << "Out of memory in LLImageBase::reallocateData" << llendl; - return 0; - } - if (mData) - { - S32 bytes = llmin(mDataSize, size); - memcpy(new_datap, mData, bytes); /* Flawfinder: ignore */ - delete[] mData; - } - mData = new_datap; - mDataSize = size; - return mData; + + return data; } const U8* LLImageBase::getData() const @@ -1507,6 +1506,7 @@ void LLImageFormatted::appendData(U8 *data, S32 size) S32 newsize = cursize + size; reallocateData(newsize); memcpy(getData() + cursize, data, size); + delete[] data; //Fixing leak from CommentCacheReadResponder } } } diff --git a/indra/llimage/llimagepng.cpp b/indra/llimage/llimagepng.cpp index 387e2fdfe..2518dbe8f 100644 --- a/indra/llimage/llimagepng.cpp +++ b/indra/llimage/llimagepng.cpp @@ -42,17 +42,12 @@ // LLImagePNG // --------------------------------------------------------------------------- LLImagePNG::LLImagePNG() - : LLImageFormatted(IMG_CODEC_PNG), - mTmpWriteBuffer(NULL) + : LLImageFormatted(IMG_CODEC_PNG) { } LLImagePNG::~LLImagePNG() { - if (mTmpWriteBuffer) - { - delete[] mTmpWriteBuffer; - } } // Virtual @@ -121,14 +116,34 @@ BOOL LLImagePNG::encode(const LLImageRaw* raw_image, F32 encode_time) // Image logical size setSize(raw_image->getWidth(), raw_image->getHeight(), raw_image->getComponents()); - // Temporary buffer to hold the encoded image. Note: the final image - // size should be much smaller due to compression. - if (mTmpWriteBuffer) - { - delete[] mTmpWriteBuffer; - } U32 bufferSize = getWidth() * getHeight() * getComponents() + 1024; - U8* mTmpWriteBuffer = new U8[ bufferSize ]; + + //New implementation + allocateData(bufferSize); //Set to largest possible size. + if(isBufferInvalid()) //Checking + { + setLastError("LLImagePNG::encode failed allocateData"); + return FALSE; + } + + // Delegate actual encoding work to wrapper + LLPngWrapper pngWrapper; + if (! pngWrapper.writePng(raw_image, getData())) + { + setLastError(pngWrapper.getErrorMessage()); + return FALSE; + } + + // Resize internal buffer. + if(!reallocateData(pngWrapper.getFinalSize())) //Shrink. Returns NULL on failure. + { + setLastError("LLImagePNG::encode failed reallocateData"); + return FALSE; + } + return TRUE; + + + /*U8* mTmpWriteBuffer = new U8[ bufferSize ]; // Delegate actual encoding work to wrapper LLPngWrapper pngWrapper; @@ -146,6 +161,6 @@ BOOL LLImagePNG::encode(const LLImageRaw* raw_image, F32 encode_time) delete[] mTmpWriteBuffer; - return TRUE; + return TRUE;*/ } diff --git a/indra/llimage/llimagepng.h b/indra/llimage/llimagepng.h index 083dda73b..4d6e2ee70 100644 --- a/indra/llimage/llimagepng.h +++ b/indra/llimage/llimagepng.h @@ -47,9 +47,6 @@ public: /*virtual*/ BOOL updateData(); /*virtual*/ BOOL decode(LLImageRaw* raw_image, F32 decode_time); /*virtual*/ BOOL encode(const LLImageRaw* raw_image, F32 encode_time); - -private: - U8* mTmpWriteBuffer; }; #endif diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp index 43e91a02f..8f78d43ae 100644 --- a/indra/llimagej2coj/llimagej2coj.cpp +++ b/indra/llimagej2coj/llimagej2coj.cpp @@ -99,7 +99,6 @@ void info_callback(const char* msg, void*) LLImageJ2COJ::LLImageJ2COJ() : LLImageJ2CImpl() { - mRawImagep=NULL; } @@ -331,7 +330,7 @@ BOOL LLImageJ2COJ::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, con OPJ_COLOR_SPACE color_space = CLRSPC_SRGB; opj_image_cmptparm_t cmptparm[MAX_COMPS]; opj_image_t * image = NULL; - S32 numcomps = raw_image.getComponents(); + S32 numcomps = min(raw_image.getComponents(),MAX_COMPS); //Clamp avoid overrunning buffer -Shyotl S32 width = raw_image.getWidth(); S32 height = raw_image.getHeight(); diff --git a/indra/llimagej2coj/llimagej2coj.h b/indra/llimagej2coj/llimagej2coj.h index 73cb074f1..8255d5225 100644 --- a/indra/llimagej2coj/llimagej2coj.h +++ b/indra/llimagej2coj/llimagej2coj.h @@ -51,9 +51,6 @@ protected: // Divide a by b to the power of 2 and round upwards. return (a + (1 << b) - 1) >> b; } - - // Temporary variables for in-progress decodes... - LLImageRaw *mRawImagep; }; #endif diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 2a8fe017c..6c2e20577 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1563,49 +1563,46 @@ void LLImageGL::setNoDelete() //---------------------------------------------------------------------------- void LLImageGL::updatePickMask(S32 width, S32 height, const U8* data_in) { - if (mFormatType != GL_UNSIGNED_BYTE || - mFormatPrimary != GL_RGBA) - { - //cannot generate a pick mask for this texture - delete [] mPickMask; - mPickMask = NULL; - mPickMaskSize = 0; - return; - } - - U32 pick_width = width/2; - U32 pick_height = height/2; - - mPickMaskSize = llmax(pick_width, (U32) 1) * llmax(pick_height, (U32) 1); - - mPickMaskSize = mPickMaskSize/8 + 1; - - delete[] mPickMask; - mPickMask = new U8[mPickMaskSize]; - - memset(mPickMask, 0, sizeof(U8) * mPickMaskSize); - - U32 pick_bit = 0; + delete [] mPickMask; //Always happens regardless. + mPickMask = NULL; + mPickMaskSize = 0; - for (S32 y = 0; y < height; y += 2) + if (!(mFormatType != GL_UNSIGNED_BYTE || + mFormatPrimary != GL_RGBA)) //can only generate a pick mask for this sort of texture { - for (S32 x = 0; x < width; x += 2) + U32 pick_width = width/2; + U32 pick_height = height/2; + + mPickMaskSize = llmax(pick_width, (U32) 1) * llmax(pick_height, (U32) 1); + + mPickMaskSize = mPickMaskSize/8 + 1; + + mPickMask = new U8[mPickMaskSize]; + + memset(mPickMask, 0, sizeof(U8) * mPickMaskSize); + + U32 pick_bit = 0; + + for (S32 y = 0; y < height; y += 2) { - U8 alpha = data_in[(y*width+x)*4+3]; - - if (alpha > 32) + for (S32 x = 0; x < width; x += 2) { - U32 pick_idx = pick_bit/8; - U32 pick_offset = pick_bit%8; - if (pick_idx >= mPickMaskSize) - { - llerrs << "WTF?" << llendl; - } + U8 alpha = data_in[(y*width+x)*4+3]; - mPickMask[pick_idx] |= 1 << pick_offset; - } + if (alpha > 32) + { + U32 pick_idx = pick_bit/8; + U32 pick_offset = pick_bit%8; + if (pick_idx >= mPickMaskSize) + { + llerrs << "WTF?" << llendl; + } + + mPickMask[pick_idx] |= 1 << pick_offset; + } - ++pick_bit; + ++pick_bit; + } } } } diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index b1fe15357..c32b962c5 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -293,15 +293,18 @@ bool LLTexUnit::bind(LLRenderTarget* renderTarget, bool bindDepth) bool LLTexUnit::bindManual(eTextureType type, U32 texture, bool hasMips) { - if (mIndex < 0 || mCurrTexture == texture) return false; + if (mIndex < 0) return false; - gGL.flush(); - - activate(); - enable(type); - mCurrTexture = texture; - glBindTexture(sGLTextureType[type], texture); - mHasMipMaps = hasMips; + if(mCurrTexture != texture) + { + gGL.flush(); + + activate(); + enable(type); + mCurrTexture = texture; + glBindTexture(sGLTextureType[type], texture); + mHasMipMaps = hasMips; + } return true; } diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 11cacd3e8..0628fa9f8 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -217,7 +217,7 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi llerrs << "Wrong vertex buffer bound." << llendl; } - if (mode > LLRender::NUM_MODES) + if (mode >= LLRender::NUM_MODES) { llerrs << "Invalid draw mode: " << mode << llendl; return; @@ -247,7 +247,7 @@ void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const llerrs << "Wrong vertex buffer bound." << llendl; } - if (mode > LLRender::NUM_MODES) + if (mode >= LLRender::NUM_MODES) { llerrs << "Invalid draw mode: " << mode << llendl; return; @@ -272,7 +272,7 @@ void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const llerrs << "Wrong vertex buffer bound." << llendl; } - if (mode > LLRender::NUM_MODES) + if (mode >= LLRender::NUM_MODES) { llerrs << "Invalid draw mode: " << mode << llendl; return; diff --git a/indra/lscript/lscript_execute/lscript_execute.cpp b/indra/lscript/lscript_execute/lscript_execute.cpp index 4ff3a223b..0f76c75ad 100644 --- a/indra/lscript/lscript_execute/lscript_execute.cpp +++ b/indra/lscript/lscript_execute/lscript_execute.cpp @@ -517,7 +517,7 @@ void LLScriptExecuteLSL2::callNextQueuedEventHandler(U64 event_register, const L } else { - llwarns << "Shit, somehow got an event that we're not registered for!" << llendl; + llwarns << "Somehow got an event that we're not registered for!" << llendl; } delete eventdata; } diff --git a/indra/newview/ascentprefssys.cpp b/indra/newview/ascentprefssys.cpp index 6bef23fd7..cd7c84875 100644 --- a/indra/newview/ascentprefssys.cpp +++ b/indra/newview/ascentprefssys.cpp @@ -93,6 +93,7 @@ private: BOOL mFetchInventoryOnLogin; BOOL mEnableLLWind; BOOL mEnableClouds; + BOOL mEnableClassicClouds; BOOL mSpeedRez; U32 mSpeedRezInterval; //Command Line ------------------------------------------------------------------------ @@ -115,7 +116,7 @@ LLPrefsAscentSysImpl::LLPrefsAscentSysImpl() childSetCommitCallback("system_folder_check", onCommitCheckBox, this); childSetCommitCallback("show_look_at_check", onCommitCheckBox, this); childSetCommitCallback("enable_clouds", onCommitCheckBox, this); - mEnableClouds = gSavedSettings.getBOOL("CloudsEnabled"); + refreshValues(); refresh(); } @@ -150,6 +151,11 @@ void LLPrefsAscentSysImpl::onCommitCheckBox(LLUICtrl* ctrl, void* user_data) bool enabled = self->childGetValue("system_folder_check").asBoolean(); self->childSetEnabled("temp_in_system_check", enabled); } + else if (ctrl->getName() == "enable_clouds") + { + bool enabled = self->childGetValue("enable_clouds").asBoolean(); + self->childSetEnabled("enable_classic_clouds", enabled); + } } void LLPrefsAscentSysImpl::refreshValues() @@ -181,11 +187,10 @@ void LLPrefsAscentSysImpl::refreshValues() //Performance ------------------------------------------------------------------------- mFetchInventoryOnLogin = gSavedSettings.getBOOL("FetchInventoryOnLogin"); mEnableLLWind = gSavedSettings.getBOOL("WindEnabled"); - if(mEnableClouds != gSavedSettings.getBOOL("CloudsEnabled")) - { - mEnableClouds = gSavedSettings.getBOOL("CloudsEnabled"); - LLPipeline::toggleRenderTypeControl((void*)LLPipeline::RENDER_TYPE_CLOUDS); - } + + mEnableClouds = gSavedSettings.getBOOL("CloudsEnabled"); + mEnableClassicClouds = gSavedSettings.getBOOL("SkyUseClassicClouds"); + mSpeedRez = gSavedSettings.getBOOL("SpeedRez"); mSpeedRezInterval = gSavedSettings.getU32("SpeedRezInterval"); @@ -290,6 +295,7 @@ void LLPrefsAscentSysImpl::refresh() childSetValue("fetch_inventory_on_login_check", mFetchInventoryOnLogin); childSetValue("enable_wind", mEnableLLWind); childSetValue("enable_clouds", mEnableClouds); + childSetValue("enable_classic_clouds", mEnableClassicClouds); gLLWindEnabled = mEnableLLWind; childSetValue("speed_rez_check", mSpeedRez); childSetEnabled("speed_rez_interval", mSpeedRez); @@ -329,6 +335,7 @@ void LLPrefsAscentSysImpl::cancel() childSetValue("fetch_inventory_on_login_check", mFetchInventoryOnLogin); childSetValue("enable_wind", mEnableLLWind); childSetValue("enable_clouds", mEnableClouds); + childSetValue("enable_classic_clouds", mEnableClassicClouds); childSetValue("speed_rez_check", mSpeedRez); if (mSpeedRez) { @@ -348,11 +355,9 @@ void LLPrefsAscentSysImpl::cancel() childSetValue("private_look_at_check", mPrivateLookAt); childSetValue("revoke_perms_on_stand_up_check", mRevokePermsOnStandUp); - if(mEnableClouds != gSavedSettings.getBOOL("CloudsEnabled")) - { - gSavedSettings.setBOOL("CloudsEnabled", mEnableClouds); - LLPipeline::toggleRenderTypeControl((void*)LLPipeline::RENDER_TYPE_CLOUDS); - } + childSetValue("enable_clouds", mEnableClouds); + childSetValue("enable_classic_clouds", mEnableClassicClouds); + gLLWindEnabled = mEnableLLWind; } @@ -460,6 +465,7 @@ void LLPrefsAscentSysImpl::apply() gSavedSettings.setBOOL("FetchInventoryOnLogin", childGetValue("fetch_inventory_on_login_check")); gSavedSettings.setBOOL("WindEnabled", childGetValue("enable_wind")); gSavedSettings.setBOOL("CloudsEnabled", childGetValue("enable_clouds")); + gSavedSettings.setBOOL("SkyUseClassicClouds", childGetValue("enable_classic_clouds")); gSavedSettings.setBOOL("SpeedRez", childGetValue("speed_rez_check")); gSavedSettings.setU32("SpeedRezInterval", childGetValue("speed_rez_interval").asReal()); diff --git a/indra/newview/ascentprefsvan.cpp b/indra/newview/ascentprefsvan.cpp index 9e97aeef4..5f13f675a 100644 --- a/indra/newview/ascentprefsvan.cpp +++ b/indra/newview/ascentprefsvan.cpp @@ -45,7 +45,6 @@ #include "v4color.h" #include "lluictrlfactory.h" #include "llcombobox.h" -#include "llsavedsettingsglue.h" #include "llwind.h" #include "llviewernetwork.h" #include "pipeline.h" @@ -124,8 +123,8 @@ void LLPrefsAscentVanImpl::onCommitColor(LLUICtrl* ctrl, void* user_data) { llinfos << "Recreating color message for tag update." << llendl; - LLSavedSettingsGlue::setCOAString("AscentCustomTagLabel", self->childGetValue("custom_tag_label_box")); - LLSavedSettingsGlue::setCOAColor4("AscentCustomTagColor", self->childGetValue("custom_tag_color_swatch")); + gCOASavedSettings->setString("AscentCustomTagLabel", self->childGetValue("custom_tag_label_box")); + gCOASavedSettings->setColor4("AscentCustomTagColor", self->childGetValue("custom_tag_color_swatch")); gAgent.sendAgentSetAppearance(); gAgent.resetClientTag(); } @@ -182,7 +181,7 @@ void LLPrefsAscentVanImpl::onCommitCheckBox(LLUICtrl* ctrl, void* user_data) } BOOL showCustomOptions; - showCustomOptions = LLSavedSettingsGlue::getCOABOOL("AscentUseCustomTag"); + showCustomOptions = gCOASavedSettings->getBOOL("AscentUseCustomTag"); self->childSetValue("customize_own_tag_check", showCustomOptions); self->childSetEnabled("custom_tag_label_text", showCustomOptions); self->childSetEnabled("custom_tag_label_box", showCustomOptions); @@ -203,27 +202,23 @@ void LLPrefsAscentVanImpl::refreshValues() //Colors mShowSelfClientTag = gSavedSettings.getBOOL("AscentShowSelfTag"); mShowSelfClientTagColor = gSavedSettings.getBOOL("AscentShowSelfTagColor"); - mCustomTagOn = gSavedSettings.getBOOL("AscentUseCustomTag"); - - mSelectedClient = LLSavedSettingsGlue::getCOAU32("AscentReportClientIndex"); - mEffectColor = LLSavedSettingsGlue::getCOAColor4("EffectColor"); - - BOOL use_custom = LLSavedSettingsGlue::getCOABOOL("AscentUseCustomTag"); + mCustomTagOn = gCOASavedSettings->getBOOL("AscentUseCustomTag"); + mSelectedClient = gCOASavedSettings->getU32("AscentReportClientIndex"); + mEffectColor = gCOASavedSettings->getColor4("EffectColor"); + childSetEnabled("custom_tag_label_text", mCustomTagOn); + childSetEnabled("custom_tag_label_box", mCustomTagOn); + childSetEnabled("custom_tag_color_text", mCustomTagOn); + childSetEnabled("custom_tag_color_swatch", mCustomTagOn); - childSetEnabled("custom_tag_label_text", use_custom); - childSetEnabled("custom_tag_label_box", use_custom); - childSetEnabled("custom_tag_color_text", use_custom); - childSetEnabled("custom_tag_color_swatch", use_custom); - - mCustomTagLabel = LLSavedSettingsGlue::getCOAString("AscentCustomTagLabel"); - mCustomTagColor = LLSavedSettingsGlue::getCOAColor4("AscentCustomTagColor"); - mFriendColor = LLSavedSettingsGlue::getCOAColor4("AscentFriendColor"); - mLindenColor = LLSavedSettingsGlue::getCOAColor4("AscentLindenColor"); - mMutedColor = LLSavedSettingsGlue::getCOAColor4("AscentMutedColor"); - mEMColor = LLSavedSettingsGlue::getCOAColor4("AscentEstateOwnerColor"); - mCustomColor = LLSavedSettingsGlue::getCOAColor4("MoyMiniMapCustomColor"); + mCustomTagLabel = gCOASavedSettings->getString("AscentCustomTagLabel"); + mCustomTagColor = gCOASavedSettings->getColor4("AscentCustomTagColor"); + mFriendColor = gCOASavedSettings->getColor4("AscentFriendColor"); + mLindenColor = gCOASavedSettings->getColor4("AscentLindenColor"); + mMutedColor = gCOASavedSettings->getColor4("AscentMutedColor"); + mEMColor = gCOASavedSettings->getColor4("AscentEstateOwnerColor"); + mCustomColor = gCOASavedSettings->getColor4("MoyMiniMapCustomColor"); } void LLPrefsAscentVanImpl::refresh() @@ -251,23 +246,23 @@ void LLPrefsAscentVanImpl::refresh() getChild("muted_color_swatch")->set(mMutedColor); getChild("em_color_swatch")->set(mEMColor); getChild("custom_color_swatch")->set(mCustomColor); - LLSavedSettingsGlue::setCOAColor4("EffectColor", LLColor4::white); - LLSavedSettingsGlue::setCOAColor4("EffectColor", mEffectColor); + gCOASavedSettings->setColor4("EffectColor", LLColor4::white); + gCOASavedSettings->setColor4("EffectColor", mEffectColor); - LLSavedSettingsGlue::setCOAColor4("AscentFriendColor", LLColor4::white); - LLSavedSettingsGlue::setCOAColor4("AscentFriendColor", mFriendColor); + gCOASavedSettings->setColor4("AscentFriendColor", LLColor4::white); + gCOASavedSettings->setColor4("AscentFriendColor", mFriendColor); - LLSavedSettingsGlue::setCOAColor4("AscentLindenColor", LLColor4::white); - LLSavedSettingsGlue::setCOAColor4("AscentLindenColor", mLindenColor); + gCOASavedSettings->setColor4("AscentLindenColor", LLColor4::white); + gCOASavedSettings->setColor4("AscentLindenColor", mLindenColor); - LLSavedSettingsGlue::setCOAColor4("AscentMutedColor", LLColor4::white); - LLSavedSettingsGlue::setCOAColor4("AscentMutedColor", mMutedColor); + gCOASavedSettings->setColor4("AscentMutedColor", LLColor4::white); + gCOASavedSettings->setColor4("AscentMutedColor", mMutedColor); - LLSavedSettingsGlue::setCOAColor4("AscentEstateOwnerColor", LLColor4::white); - LLSavedSettingsGlue::setCOAColor4("AscentEstateOwnerColor", mEMColor); + gCOASavedSettings->setColor4("AscentEstateOwnerColor", LLColor4::white); + gCOASavedSettings->setColor4("AscentEstateOwnerColor", mEMColor); - LLSavedSettingsGlue::setCOAColor4("MoyMiniMapCustomColor", LLColor4::white); - LLSavedSettingsGlue::setCOAColor4("MoyMiniMapCustomColor", mCustomColor); + gCOASavedSettings->setColor4("MoyMiniMapCustomColor", LLColor4::white); + gCOASavedSettings->setColor4("MoyMiniMapCustomColor", mCustomColor); gAgent.resetClientTag(); } @@ -279,18 +274,18 @@ void LLPrefsAscentVanImpl::cancel() childSetValue("tp_sound_check", mPlayTPSound); childSetValue("disable_logout_screen_check", mShowLogScreens); - LLSavedSettingsGlue::setCOAColor4("EffectColor", LLColor4::white); - LLSavedSettingsGlue::setCOAColor4("EffectColor", mEffectColor); - LLSavedSettingsGlue::setCOAColor4("AscentFriendColor", LLColor4::yellow); - LLSavedSettingsGlue::setCOAColor4("AscentFriendColor", mFriendColor); - LLSavedSettingsGlue::setCOAColor4("AscentLindenColor", LLColor4::yellow); - LLSavedSettingsGlue::setCOAColor4("AscentLindenColor", mLindenColor); - LLSavedSettingsGlue::setCOAColor4("AscentMutedColor", LLColor4::yellow); - LLSavedSettingsGlue::setCOAColor4("AscentMutedColor", mMutedColor); - LLSavedSettingsGlue::setCOAColor4("AscentEstateOwnerColor", LLColor4::yellow); - LLSavedSettingsGlue::setCOAColor4("AscentEstateOwnerColor", mEMColor); - LLSavedSettingsGlue::setCOAColor4("MoyMiniMapCustomColor", LLColor4::yellow); - LLSavedSettingsGlue::setCOAColor4("MoyMiniMapCustomColor", mCustomColor); + gCOASavedSettings->setColor4("EffectColor", LLColor4::white); + gCOASavedSettings->setColor4("EffectColor", mEffectColor); + gCOASavedSettings->setColor4("AscentFriendColor", LLColor4::yellow); + gCOASavedSettings->setColor4("AscentFriendColor", mFriendColor); + gCOASavedSettings->setColor4("AscentLindenColor", LLColor4::yellow); + gCOASavedSettings->setColor4("AscentLindenColor", mLindenColor); + gCOASavedSettings->setColor4("AscentMutedColor", LLColor4::yellow); + gCOASavedSettings->setColor4("AscentMutedColor", mMutedColor); + gCOASavedSettings->setColor4("AscentEstateOwnerColor", LLColor4::yellow); + gCOASavedSettings->setColor4("AscentEstateOwnerColor", mEMColor); + gCOASavedSettings->setColor4("MoyMiniMapCustomColor", LLColor4::yellow); + gCOASavedSettings->setColor4("MoyMiniMapCustomColor", mCustomColor); } void LLPrefsAscentVanImpl::apply() @@ -311,8 +306,8 @@ void LLPrefsAscentVanImpl::apply() if (client_index != mSelectedClient) { client_uuid = combo->getSelectedValue().asString(); - LLSavedSettingsGlue::setCOAString("AscentReportClientUUID", client_uuid); - LLSavedSettingsGlue::setCOAU32("AscentReportClientIndex", client_index); + gCOASavedSettings->setString("AscentReportClientUUID", client_uuid); + gCOASavedSettings->setU32("AscentReportClientIndex", client_index); LLVOAvatar* avatar = gAgent.getAvatarObject(); if (!avatar) return; @@ -324,15 +319,15 @@ void LLPrefsAscentVanImpl::apply() gSavedSettings.setBOOL("AscentShowSelfTag", childGetValue("show_self_tag_check")); gSavedSettings.setBOOL("AscentShowSelfTagColor", childGetValue("show_self_tag_color_check")); - LLSavedSettingsGlue::setCOAColor4("EffectColor", childGetValue("effect_color_swatch")); - LLSavedSettingsGlue::setCOAColor4("AscentFriendColor", childGetValue("friend_color_swatch")); - LLSavedSettingsGlue::setCOAColor4("AscentLindenColor", childGetValue("linden_color_swatch")); - LLSavedSettingsGlue::setCOAColor4("AscentMutedColor", childGetValue("muted_color_swatch")); - LLSavedSettingsGlue::setCOAColor4("AscentEstateOwnerColor", childGetValue("em_color_swatch")); - LLSavedSettingsGlue::setCOAColor4("MoyMiniMapCustomColor", childGetValue("custom_color_swatch")); - LLSavedSettingsGlue::setCOABOOL("AscentUseCustomTag", childGetValue("customize_own_tag_check")); - LLSavedSettingsGlue::setCOAString("AscentCustomTagLabel", childGetValue("custom_tag_label_box")); - LLSavedSettingsGlue::setCOAColor4("AscentCustomTagColor", childGetValue("custom_tag_color_swatch")); + gCOASavedSettings->setColor4("EffectColor", childGetValue("effect_color_swatch")); + gCOASavedSettings->setColor4("AscentFriendColor", childGetValue("friend_color_swatch")); + gCOASavedSettings->setColor4("AscentLindenColor", childGetValue("linden_color_swatch")); + gCOASavedSettings->setColor4("AscentMutedColor", childGetValue("muted_color_swatch")); + gCOASavedSettings->setColor4("AscentEstateOwnerColor", childGetValue("em_color_swatch")); + gCOASavedSettings->setColor4("MoyMiniMapCustomColor", childGetValue("custom_color_swatch")); + gCOASavedSettings->setBOOL("AscentUseCustomTag", childGetValue("customize_own_tag_check")); + gCOASavedSettings->setString("AscentCustomTagLabel", childGetValue("custom_tag_label_box")); + gCOASavedSettings->setColor4("AscentCustomTagColor", childGetValue("custom_tag_color_swatch")); refreshValues(); } diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt index c08e2b529..a49144ec0 100644 --- a/indra/newview/gpu_table.txt +++ b/indra/newview/gpu_table.txt @@ -164,11 +164,15 @@ Matrox .*Matrox.* 0 0 Mesa .*Mesa.* 0 0 NVIDIA GT 120 .*NVIDIA.*GeForce.*GT.*12.* 2 1 NVIDIA GT 130 .*NVIDIA.*GeForce.*GT.*13.* 3 1 +NVIDIA GT 220 .*NVIDIA.*GeForce.*GT.*22.* 3 1 NVIDIA GTS 250 .*NVIDIA.*GeForce.*GTS.*25.* 3 1 NVIDIA GTX 260 .*NVIDIA.*GeForce.*GTX.*26.* 3 1 NVIDIA GTX 270 .*NVIDIA.*GeForce.*GTX.*27.* 3 1 NVIDIA GTX 280 .*NVIDIA.*GeForce.*GTX.*28.* 3 1 NVIDIA GTX 290 .*NVIDIA.*GeForce.*GTX.*29.* 3 1 +NVIDIA GTX 460 .*NVIDIA.*GeForce.*GTX.*46.* 3 1 +NVIDIA GTX 470 .*NVIDIA.*GeForce.*GTX.*47.* 3 1 +NVIDIA GTX 480 .*NVIDIA.*GeForce.*GTX.*48.* 3 1 NVIDIA C51 .*NVIDIA.*C51.* 0 1 NVIDIA G72 .*NVIDIA.*G72.* 1 1 NVIDIA G73 .*NVIDIA.*G73.* 1 1 diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 6ac6575b2..3635d239b 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -95,7 +95,6 @@ #include "llnotify.h" #include "llprimitive.h" //For new client id method -HgB #include "llquantize.h" -#include "llsavedsettingsglue.h" //For Client-Or-Account settings #include "llsdutil.h" #include "llselectmgr.h" #include "llsky.h" @@ -475,7 +474,7 @@ void LLAgent::init() // LLDebugVarMessageBox::show("Camera Lag", &CAMERA_FOCUS_HALF_LIFE, 0.5f, 0.01f); - mEffectColor = LLSavedSettingsGlue::getCOAColor4("EffectColor"); + mEffectColor = gCOASavedSettings->getColor4("EffectColor"); mInitialized = TRUE; } @@ -7537,7 +7536,7 @@ void LLAgent::sendAgentSetAppearance() LLColor4 color; if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) { - color = LLSavedSettingsGlue::setCOAColor4("AscentCustomTagColor"); + color = gCOASavedSettings->setColor4("AscentCustomTagColor"); } else { diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index 451d08e6f..a16b4b079 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -192,7 +192,7 @@ void LLDrawPoolWLSky::renderStars(void) const void LLDrawPoolWLSky::renderSkyClouds(F32 camHeightLocal) const { - if (gPipeline.canUseWindLightShaders() && gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS)) + if (gPipeline.canUseWindLightShaders() && gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_WL_CLOUDS)) { LLGLSLShader* shader = LLPipeline::sUnderWaterRender ? diff --git a/indra/newview/llfloaterauction.cpp b/indra/newview/llfloaterauction.cpp index 747431fb1..8608d6d0b 100644 --- a/indra/newview/llfloaterauction.cpp +++ b/indra/newview/llfloaterauction.cpp @@ -45,7 +45,6 @@ #include "llagent.h" #include "llcombobox.h" #include "llnotify.h" -#include "llsavedsettingsglue.h" #include "llviewerimagelist.h" #include "llviewerparcelmgr.h" #include "llviewerregion.h" @@ -81,7 +80,7 @@ LLFloaterAuction::LLFloaterAuction() : childSetValue("fence_check", LLSD( gSavedSettings.getBOOL("AuctionShowFence") ) ); childSetCommitCallback("fence_check", - LLSavedSettingsGlue::setBOOL, (void*)"AuctionShowFence"); + onCommitControlSetting(gSavedSettings), (void*)"AuctionShowFence"); childSetAction("snapshot_btn", onClickSnapshot, this); childSetAction("ok_btn", onClickOK, this); diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index 221ec71b2..b2a1ff299 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -31,7 +31,6 @@ #include "llregionflags.h" #include "llfloaterreporter.h" #include "llagent.h" -#include "llsavedsettingsglue.h" #include "llviewerregion.h" #include "lltracker.h" #include "llviewerstats.h" @@ -708,22 +707,22 @@ void LLFloaterAvatarList::refreshAvatarList() //Lindens are always more Linden than your friend, make that take precedence if(LLMuteList::getInstance()->isLinden(av_name)) { - element["columns"][LIST_AVATAR_NAME]["color"] = LLSavedSettingsGlue::getCOAColor4("AscentLindenColor").getValue(); + element["columns"][LIST_AVATAR_NAME]["color"] = gCOASavedSettings->getColor4("AscentLindenColor").getValue(); } //check if they are an estate owner at their current position else if(estate_owner.notNull() && av_id == estate_owner) { - element["columns"][LIST_AVATAR_NAME]["color"] = LLSavedSettingsGlue::getCOAColor4("AscentEstateOwnerColor").getValue(); + element["columns"][LIST_AVATAR_NAME]["color"] = gCOASavedSettings->getColor4("AscentEstateOwnerColor").getValue(); } //without these dots, SL would suck. else if(is_agent_friend(av_id)) { - element["columns"][LIST_AVATAR_NAME]["color"] = LLSavedSettingsGlue::getCOAColor4("AscentFriendColor").getValue(); + element["columns"][LIST_AVATAR_NAME]["color"] = gCOASavedSettings->getColor4("AscentFriendColor").getValue(); } //big fat jerkface who is probably a jerk, display them as such. else if(LLMuteList::getInstance()->isMuted(av_id)) { - element["columns"][LIST_AVATAR_NAME]["color"] = LLSavedSettingsGlue::getCOAColor4("AscentMutedColor").getValue(); + element["columns"][LIST_AVATAR_NAME]["color"] = gCOASavedSettings->getColor4("AscentMutedColor").getValue(); } diff --git a/indra/newview/llfloaterwater.cpp b/indra/newview/llfloaterwater.cpp index 730c1393c..4ea21cf10 100644 --- a/indra/newview/llfloaterwater.cpp +++ b/indra/newview/llfloaterwater.cpp @@ -54,7 +54,6 @@ #include "llviewerdisplay.h" #include "llviewercontrol.h" #include "llviewerwindow.h" -#include "llsavedsettingsglue.h" #include "llwaterparamset.h" #include "llwaterparammanager.h" diff --git a/indra/newview/llfloaterwindlight.cpp b/indra/newview/llfloaterwindlight.cpp index 98b315795..a47687199 100644 --- a/indra/newview/llfloaterwindlight.cpp +++ b/indra/newview/llfloaterwindlight.cpp @@ -53,7 +53,6 @@ #include "llviewerdisplay.h" #include "llviewercontrol.h" #include "llviewerwindow.h" -#include "llsavedsettingsglue.h" #include "llwlparamset.h" #include "llwlparammanager.h" @@ -210,7 +209,7 @@ void LLFloaterWindLight::initCallbacks(void) { childSetCommitCallback("WLCloudScrollX", onCloudScrollXMoved, NULL); childSetCommitCallback("WLCloudScrollY", onCloudScrollYMoved, NULL); childSetCommitCallback("WLDistanceMult", onFloatControlMoved, ¶m_mgr->mDistanceMult); - childSetCommitCallback("DrawClassicClouds", LLSavedSettingsGlue::setBOOL, (void*)"SkyUseClassicClouds"); + childSetCommitCallback("DrawClassicClouds", onCommitControlSetting(gSavedSettings), (void*)"SkyUseClassicClouds"); // WL Top childSetAction("WLDayCycleMenuButton", onOpenDayCycle, NULL); diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index f2585c854..eaf0db70c 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -1663,7 +1663,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal, glClipPlane(GL_CLIP_PLANE0, plane); BOOL particles = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES); - BOOL clouds = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS); + BOOL clouds = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS); if (particles) { @@ -1671,7 +1671,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal, } if (clouds) { - LLPipeline::toggleRenderType(LLPipeline::RENDER_TYPE_CLOUDS); + LLPipeline::toggleRenderType(LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS); } //stencil in volumes @@ -1695,7 +1695,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal, } if (clouds) { - LLPipeline::toggleRenderType(LLPipeline::RENDER_TYPE_CLOUDS); + LLPipeline::toggleRenderType(LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS); } gGL.setColorMask(true, false); diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 5518419d0..8cc5b50d3 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -52,7 +52,6 @@ #include "llframetimer.h" #include "lltracker.h" #include "llmenugl.h" -#include "llsavedsettingsglue.h" #include "llsurface.h" #include "lltextbox.h" #include "lluictrlfactory.h" @@ -361,10 +360,10 @@ void LLNetMap::draw() // LLColor4 mapcolor = gAvatarMapColor; LLColor4 standard_color = gColors.getColor( "MapAvatar" ); - LLColor4 friend_color = LLSavedSettingsGlue::getCOAColor4("AscentFriendColor"); - LLColor4 em_color = LLSavedSettingsGlue::getCOAColor4("AscentEstateOwnerColor"); - LLColor4 linden_color = LLSavedSettingsGlue::getCOAColor4("AscentLindenColor"); - LLColor4 muted_color = LLSavedSettingsGlue::getCOAColor4("AscentMutedColor"); + LLColor4 friend_color = gCOASavedSettings->getColor4("AscentFriendColor"); + LLColor4 em_color = gCOASavedSettings->getColor4("AscentEstateOwnerColor"); + LLColor4 linden_color = gCOASavedSettings->getColor4("AscentLindenColor"); + LLColor4 muted_color = gCOASavedSettings->getColor4("AscentMutedColor"); std::vector avatar_ids; std::vector positions; diff --git a/indra/newview/llsavedsettingsglue.cpp b/indra/newview/llsavedsettingsglue.cpp index 64a33a220..e6feae31d 100644 --- a/indra/newview/llsavedsettingsglue.cpp +++ b/indra/newview/llsavedsettingsglue.cpp @@ -38,7 +38,7 @@ #include "lluictrl.h" #include "llviewercontrol.h" - +/* void LLSavedSettingsGlue::setBOOL(LLUICtrl* ctrl, void* data) { const char* name = (const char*)data; @@ -73,12 +73,20 @@ void LLSavedSettingsGlue::setString(LLUICtrl* ctrl, void* data) LLSD value = ctrl->getValue(); gSavedSettings.setString(name, value.asString()); } +*/ - +/* //Begin Ascent SavedSettings/PerAccountSettings handling //Get -BOOL LLSavedSettingsGlue::getCOABOOL(std::string name) +LLControlVariable *gCOASavedSettings->getControl(const std::string &name) +{ + if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) + return gSavedSettings.getControl(name); + else + return gSavedPerAccountSettings.getControl(name); +} +BOOL gCOASavedSettings->getBOOL(const std::string &name) { if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) return gSavedSettings.getBOOL(name); @@ -86,7 +94,7 @@ BOOL LLSavedSettingsGlue::getCOABOOL(std::string name) return gSavedPerAccountSettings.getBOOL(name); } -S32 LLSavedSettingsGlue::getCOAS32(std::string name) +S32 gCOASavedSettings->getS32(const std::string &name) { if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) return gSavedSettings.getS32(name); @@ -94,7 +102,7 @@ S32 LLSavedSettingsGlue::getCOAS32(std::string name) return gSavedPerAccountSettings.getS32(name); } -F32 LLSavedSettingsGlue::getCOAF32(std::string name) +F32 gCOASavedSettings->getF32(const std::string &name) { if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) return gSavedSettings.getF32(name); @@ -102,7 +110,7 @@ F32 LLSavedSettingsGlue::getCOAF32(std::string name) return gSavedPerAccountSettings.getF32(name); } -U32 LLSavedSettingsGlue::getCOAU32(std::string name) +U32 gCOASavedSettings->getU32(const std::string &name) { if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) return gSavedSettings.getU32(name); @@ -110,7 +118,7 @@ U32 LLSavedSettingsGlue::getCOAU32(std::string name) return gSavedPerAccountSettings.getU32(name); } -std::string LLSavedSettingsGlue::getCOAString(std::string name) +std::string gCOASavedSettings->getString(const std::string &name) { if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) return gSavedSettings.getString(name); @@ -118,7 +126,7 @@ std::string LLSavedSettingsGlue::getCOAString(std::string name) return gSavedPerAccountSettings.getString(name); } -LLColor4 LLSavedSettingsGlue::getCOAColor4(std::string name) +LLColor4 gCOASavedSettings->getColor4(const std::string &name) { if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) return gSavedSettings.getColor4(name); @@ -128,7 +136,7 @@ LLColor4 LLSavedSettingsGlue::getCOAColor4(std::string name) //Set -void LLSavedSettingsGlue::setCOABOOL(std::string name, BOOL value) +void gCOASavedSettings->setBOOL(const std::string &name, BOOL value) { if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) gSavedSettings.setBOOL(name, value); @@ -136,7 +144,7 @@ void LLSavedSettingsGlue::setCOABOOL(std::string name, BOOL value) gSavedPerAccountSettings.setBOOL(name, value); } -void LLSavedSettingsGlue::setCOAS32(std::string name, S32 value) +void gCOASavedSettings->setS32(const std::string &name, S32 value) { if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) gSavedSettings.setS32(name, value); @@ -144,7 +152,7 @@ void LLSavedSettingsGlue::setCOAS32(std::string name, S32 value) gSavedPerAccountSettings.setS32(name, value); } -void LLSavedSettingsGlue::setCOAF32(std::string name, F32 value) +void gCOASavedSettings->setF32(const std::string &name, F32 value) { if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) gSavedSettings.setF32(name, value); @@ -152,7 +160,7 @@ void LLSavedSettingsGlue::setCOAF32(std::string name, F32 value) gSavedPerAccountSettings.setF32(name, value); } -void LLSavedSettingsGlue::setCOAU32(std::string name, U32 value) +void gCOASavedSettings->setU32(const std::string &name, U32 value) { if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) gSavedSettings.setU32(name, value); @@ -160,7 +168,7 @@ void LLSavedSettingsGlue::setCOAU32(std::string name, U32 value) gSavedPerAccountSettings.setU32(name, value); } -void LLSavedSettingsGlue::setCOAString(std::string name, std::string value) +void gCOASavedSettings->setString(const std::string &name, std::string value) { if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) gSavedSettings.setString(name, value); @@ -168,10 +176,10 @@ void LLSavedSettingsGlue::setCOAString(std::string name, std::string value) gSavedPerAccountSettings.setString(name, value); } -void LLSavedSettingsGlue::setCOAColor4(std::string name, LLColor4 value) +void gCOASavedSettings->setColor4(const std::string &name, LLColor4 value) { if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) gSavedSettings.setColor4(name, value); else gSavedPerAccountSettings.setColor4(name, value); -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/indra/newview/llsavedsettingsglue.h b/indra/newview/llsavedsettingsglue.h index 61ece652d..2d4b10d51 100644 --- a/indra/newview/llsavedsettingsglue.h +++ b/indra/newview/llsavedsettingsglue.h @@ -42,6 +42,7 @@ class LLUICtrl; class LLSavedSettingsGlue { public: +/* static void setBOOL(LLUICtrl* ctrl, void* name); static void setS32(LLUICtrl* ctrl, void* name); static void setF32(LLUICtrl* ctrl, void* name); @@ -49,20 +50,21 @@ public: static void setString(LLUICtrl* ctrl, void* name); //Ascent Client-Or-Account Settings Get - static BOOL getCOABOOL(std::string name); - static S32 getCOAS32(std::string name); - static F32 getCOAF32(std::string name); - static U32 getCOAU32(std::string name); - static std::string getCOAString(std::string name); - static LLColor4 getCOAColor4(std::string name); + static LLControlVariable *gCOASavedSettings->getControl(const std::string &name); + static BOOL getCOABOOL(const std::string &name); + static S32 getCOAS32(const std::string &name); + static F32 getCOAF32(const std::string &name); + static U32 getCOAU32(const std::string &name); + static std::string getCOAString(const std::string &name); + static LLColor4 getCOAColor4(const std::string &name); //Ascent Client-Or-Account Settings Set - static void setCOABOOL(std::string name, BOOL value); - static void setCOAS32(std::string name, S32 value); - static void setCOAF32(std::string name, F32 value); - static void setCOAU32(std::string name, U32 value); - static void setCOAString(std::string name, std::string value); - static void setCOAColor4(std::string name, LLColor4 value); + static void setCOABOOL(const std::string &name, BOOL value); + static void setCOAS32(const std::string &name, S32 value); + static void setCOAF32(const std::string &name, F32 value); + static void setCOAU32(const std::string &name, U32 value); + static void setCOAString(const std::string &name, std::string value); + static void setCOAColor4(const std::string &name, LLColor4 value);*/ }; #endif diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 37c26a6c0..2418d1e12 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2641,13 +2641,11 @@ bool idle_startup() LLFloaterBeacons::showInstance(); DIE }*/ - if (!gSavedSettings.getBOOL("CloudsEnabled") && !gNoRender) - { - LLPipeline::toggleRenderTypeControl((void*)LLPipeline::RENDER_TYPE_CLOUDS); - } - if (!gNoRender) { + //Set up cloud rendertypes. Passed argument is unused. + handleCloudSettingsChanged(LLSD()); + // Move the progress view in front of the UI gViewerWindow->moveProgressViewToFront(); diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 9aa2ed600..e4516fa85 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1419,7 +1419,7 @@ bool LLTextureFetch::createRequest(const std::string& url, const LLUUID& id, con } else if (w*h*c > 0) { - // If the requester knows the dimentions of the image, + // If the requester knows the dimensions of the image, // this will calculate how much data we need without having to parse the header desired_size = LLImageJ2C::calcDataSizeJ2C(w, h, c, desired_discard); diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 338be40d9..924f7e056 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -71,6 +71,7 @@ #include "llvowlsky.h" #include "llrender.h" #include "llfloaterchat.h" +#include "llviewerobjectlist.h" #include "emeraldboobutils.h" #ifdef TOGGLE_HACKED_GODLIKE_VIEWER @@ -81,6 +82,7 @@ BOOL gHackGodmode = FALSE; std::map gSettings; LLControlGroup gSavedSettings; // saved at end of session LLControlGroup gSavedPerAccountSettings; // saved at end of session +LLControlGroup *gCOASavedSettings = &gSavedSettings; //Ascent Client-Or-Account LLControlGroup gColors; // read-only LLControlGroup gCrashSettings; // saved at end of session @@ -485,7 +487,40 @@ bool handleTranslateChatPrefsChanged(const LLSD& newvalue) return true; } +bool handleCloudSettingsChanged(const LLSD& newvalue) +{ + bool bCloudsEnabled = gSavedSettings.getBOOL("CloudsEnabled"); + if((bool)LLPipeline::hasRenderTypeControl((void*)LLPipeline::RENDER_TYPE_WL_CLOUDS)!=bCloudsEnabled) + LLPipeline::toggleRenderTypeControl((void*)LLPipeline::RENDER_TYPE_WL_CLOUDS); + if( !gSavedSettings.getBOOL("SkyUseClassicClouds") ) bCloudsEnabled = false; + + if((bool)LLPipeline::hasRenderTypeControl((void*)LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS)!=bCloudsEnabled ) + LLPipeline::toggleRenderTypeControl((void*)LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS); + return true; +} +bool handleAscentCOAChange(const LLSD& newvalue) +{ + gCOASavedSettings = newvalue.asBoolean() ? &gSavedPerAccountSettings : &gSavedSettings; + return true; +} +bool handleAscentSelfTag(const LLSD& newvalue) +{ + if(gAgent.getAvatarObject()) + gAgent.getAvatarObject()->mClientTag = ""; + return true; +} +bool handleAscentGlobalTag(const LLSD& newvalue) +{ + S32 object_count = gObjectList.getNumObjects(); + for (S32 i = 0; i < object_count; i++) + { + LLViewerObject *objectp = gObjectList.getObject(i); + if (objectp && objectp->isAvatar()) + ((LLVOAvatar*)objectp)->mClientTag = ""; + } + return true; +} //////////////////////////////////////////////////////////////////////////// void settings_setup_listeners() @@ -624,7 +659,23 @@ void settings_setup_listeners() gSavedSettings.getControl("VoiceOutputAudioDevice")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); gSavedSettings.getControl("AudioLevelMic")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); - gSavedSettings.getControl("TranslateChat")->getSignal()->connect(boost::bind(&handleTranslateChatPrefsChanged, _1)); + gSavedSettings.getControl("TranslateChat")->getSignal()->connect(boost::bind(&handleTranslateChatPrefsChanged, _1)); + + gSavedSettings.getControl("CloudsEnabled")->getSignal()->connect(boost::bind(&handleCloudSettingsChanged, _1)); + gSavedSettings.getControl("SkyUseClassicClouds")->getSignal()->connect(boost::bind(&handleCloudSettingsChanged, _1)); + + gSavedSettings.getControl("AscentStoreSettingsPerAccount")->getSignal()->connect(boost::bind(&handleAscentCOAChange,_1)); + gSavedSettings.getControl("AscentShowSelfTag")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1)); + gSavedSettings.getControl("AscentShowSelfTagColor")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1)); + gSavedSettings.getControl("AscentUseTag")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1)); + gCOASavedSettings->getControl("AscentUseCustomTag")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1)); + gCOASavedSettings->getControl("AscentCustomTagColor")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1)); + gCOASavedSettings->getControl("AscentCustomTagLabel")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1)); + gCOASavedSettings->getControl("AscentReportClientUUID")->getSignal()->connect(boost::bind(&handleAscentSelfTag,_1)); + gSavedSettings.getControl("AscentShowFriendsTag")->getSignal()->connect(boost::bind(&handleAscentGlobalTag,_1)); + gSavedSettings.getControl("AscentShowOthersTag")->getSignal()->connect(boost::bind(&handleAscentGlobalTag,_1)); + gSavedSettings.getControl("AscentShowOthersTagColor")->getSignal()->connect(boost::bind(&handleAscentGlobalTag,_1)); + gSavedSettings.getControl("AscentUseStatusColors")->getSignal()->connect(boost::bind(&handleAscentGlobalTag,_1)); } template <> eControlType get_control_type(const U32& in, LLSD& out) @@ -706,7 +757,6 @@ template <> eControlType get_control_type(const LLSD& in, LLSD& out) return TYPE_LLSD; } - #if TEST_CACHED_CONTROL #define DECL_LLCC(T, V) static LLCachedControl mySetting_##T("TestCachedControl"#T, V) diff --git a/indra/newview/llviewercontrol.h b/indra/newview/llviewercontrol.h index d0dc80cb9..6485d72b5 100644 --- a/indra/newview/llviewercontrol.h +++ b/indra/newview/llviewercontrol.h @@ -35,6 +35,7 @@ #include #include "llcontrol.h" +#include "lluictrl.h" // Enabled this definition to compile a 'hacked' viewer that // allows a hacked godmode to be toggled on and off. @@ -54,6 +55,7 @@ void create_graphics_group(LLControlGroup& group); // saved at end of session extern LLControlGroup gSavedSettings; +extern LLControlGroup *gCOASavedSettings; extern LLControlGroup gSavedPerAccountSettings; // Read-only @@ -74,6 +76,8 @@ eControlType get_control_type(const T& in, LLSD& out) return TYPE_COUNT; } +bool handleCloudSettingsChanged(const LLSD& newvalue); + //! Publish/Subscribe object to interact with LLControlGroups. //! An LLCachedControl instance to connect to a LLControlVariable @@ -171,6 +175,12 @@ template <> eControlType get_control_type(const LLColor3& in, LLSD& ou template <> eControlType get_control_type(const LLColor4U& in, LLSD& out); template <> eControlType get_control_type(const LLSD& in, LLSD& out); +//A template would be a little awkward to use here.. so.. a preprocessor macro. Alas. onCommitControlSetting(gSavedSettings) etc. +inline void onCommitControlSetting_gSavedSettings(LLUICtrl* ctrl, void* name) {gSavedSettings.setValue((const char*)name,ctrl->getValue());} +inline void onCommitControlSetting_gSavedPerAccountSettings(LLUICtrl* ctrl, void* name) {gSavedPerAccountSettings.setValue((const char*)name,ctrl->getValue());} +inline void onCommitControlSetting_gCOASavedSettings(LLUICtrl* ctrl, void* name) {gCOASavedSettings->setValue((const char*)name,ctrl->getValue());} +#define onCommitControlSetting(controlgroup) onCommitControlSetting_##controlgroup + //#define TEST_CACHED_CONTROL 1 #ifdef TEST_CACHED_CONTROL void test_cached_control(); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index f8c9b8d6d..ff7de906a 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -1299,10 +1299,10 @@ void init_debug_rendering_menu(LLMenuGL* menu) &LLPipeline::toggleRenderTypeControl, NULL, &LLPipeline::hasRenderTypeControl, (void*)LLPipeline::RENDER_TYPE_GRASS, '0', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); - sub_menu->append(new LLMenuItemCheckGL("Clouds", - &LLPipeline::toggleRenderTypeControl, NULL, - &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_CLOUDS, '-', MASK_CONTROL|MASK_ALT| MASK_SHIFT)); + sub_menu->append(new LLMenuItemCheckGL("Clouds", //This clobbers skyuseclassicclouds, but.. big deal. + &LLPipeline::toggleRenderPairedTypeControl, NULL, + &LLPipeline::hasRenderPairedTypeControl, + (void*)(1<append(new LLMenuItemCheckGL("Particles", &LLPipeline::toggleRenderTypeControl, NULL, &LLPipeline::hasRenderTypeControl, diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9ef0a2697..f9b38acd5 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -88,7 +88,7 @@ #include "llvoicevisualizer.h" // Ventrella #include "llsdserialize.h" //For the client definitions -#include "llsavedsettingsglue.h" //For optionally per-account settings + // #include "llfloaterexploreanimations.h" #include "llao.h" @@ -3332,7 +3332,7 @@ void LLVOAvatar::getClientInfo(std::string& client, LLColor4& color, BOOL useCom std::string uuid_str = getTE(TEX_HEAD_BODYPAINT)->getID().asString(); //UUID of the head texture if (mIsSelf) { - BOOL showCustomTag = LLSavedSettingsGlue::getCOABOOL("AscentUseCustomTag"); + BOOL showCustomTag = gCOASavedSettings->getBOOL("AscentUseCustomTag"); if (!gSavedSettings.getBOOL("AscentShowSelfTagColor")) { color = gColors.getColor( "AvatarNameColor" ); @@ -3340,12 +3340,12 @@ void LLVOAvatar::getClientInfo(std::string& client, LLColor4& color, BOOL useCom } else if (showCustomTag) { - color = LLSavedSettingsGlue::getCOAColor4("AscentCustomTagColor"); - client = LLSavedSettingsGlue::getCOAString("AscentCustomTagLabel"); + color = gCOASavedSettings->getColor4("AscentCustomTagColor"); + client = gCOASavedSettings->getString("AscentCustomTagLabel"); return; } else if (gSavedSettings.getBOOL("AscentUseTag")) - uuid_str = LLSavedSettingsGlue::getCOAString("AscentReportClientUUID"); + uuid_str = gCOASavedSettings->getString("AscentReportClientUUID"); } if(getTEImage(TEX_HEAD_BODYPAINT)->getID() == IMG_DEFAULT_AVATAR) { @@ -3587,6 +3587,8 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) llinfos << "Using Emerald-style client identifier." << llendl; //The old client identification. Used only if the new method doesn't exist, so that it isn't automatically overwritten. -HgB getClientInfo(mClientTag,mClientColor); + if(mClientTag == "") + client = "?"; //prevent console spam.. } } @@ -3617,22 +3619,22 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) //Lindens are always more Linden than your friend, make that take precedence if(LLMuteList::getInstance()->isLinden(name)) { - mClientColor = LLSavedSettingsGlue::getCOAColor4("AscentLindenColor").getValue(); + mClientColor = gCOASavedSettings->getColor4("AscentLindenColor").getValue(); } //check if they are an estate owner at their current position else if(estate_owner.notNull() && this->getID() == estate_owner) { - mClientColor = LLSavedSettingsGlue::getCOAColor4("AscentEstateOwnerColor").getValue(); + mClientColor = gCOASavedSettings->getColor4("AscentEstateOwnerColor").getValue(); } //without these dots, SL would suck. else if (LLAvatarTracker::instance().getBuddyInfo(this->getID()) != NULL) { - mClientColor = LLSavedSettingsGlue::getCOAColor4("AscentFriendColor"); + mClientColor = gCOASavedSettings->getColor4("AscentFriendColor"); } //big fat jerkface who is probably a jerk, display them as such. else if(LLMuteList::getInstance()->isMuted(this->getID())) { - mClientColor = LLSavedSettingsGlue::getCOAColor4("AscentMutedColor").getValue(); + mClientColor = gCOASavedSettings->getColor4("AscentMutedColor").getValue(); } } diff --git a/indra/newview/llvoclouds.cpp b/indra/newview/llvoclouds.cpp index a489f9177..ee195af09 100644 --- a/indra/newview/llvoclouds.cpp +++ b/indra/newview/llvoclouds.cpp @@ -80,7 +80,7 @@ BOOL LLVOClouds::isActive() const BOOL LLVOClouds::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) { - if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS))) + if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS))) { return TRUE; } @@ -110,7 +110,7 @@ LLDrawable* LLVOClouds::createDrawable(LLPipeline *pipeline) { pipeline->allocDrawable(this); mDrawable->setLit(FALSE); - mDrawable->setRenderType(LLPipeline::RENDER_TYPE_CLOUDS); + mDrawable->setRenderType(LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS); return mDrawable; } @@ -118,7 +118,7 @@ LLDrawable* LLVOClouds::createDrawable(LLPipeline *pipeline) BOOL LLVOClouds::updateGeometry(LLDrawable *drawable) { LLFastTimer ftm(LLFastTimer::FTM_UPDATE_CLOUDS); - if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS))) + if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS))) { return TRUE; } @@ -286,7 +286,7 @@ void LLVOClouds::updateDrawable(BOOL force_damped) LLCloudPartition::LLCloudPartition() { - mDrawableType = LLPipeline::RENDER_TYPE_CLOUDS; + mDrawableType = LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS; mPartitionType = LLViewerRegion::PARTITION_CLOUD; } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 86a561da9..e86566daa 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4471,6 +4471,25 @@ BOOL LLPipeline::toggleRenderTypeControlNegated(void* data) return !gPipeline.hasRenderType(type); } +//static +BOOL LLPipeline::hasRenderPairedTypeControl(void* data) +{ + U32 typeflags = (U32)(intptr_t)data; + return (gPipeline.mRenderTypeMask & typeflags); +} + +//static +void LLPipeline::toggleRenderPairedTypeControl(void *data) +{ + U32 typeflags = (U32)(intptr_t)data; + if(typeflags & RENDER_TYPE_WATER) + typeflags |= RENDER_TYPE_VOIDWATER; + if( gPipeline.mRenderTypeMask & typeflags) + gPipeline.mRenderTypeMask &= ~typeflags; + else + gPipeline.mRenderTypeMask |= typeflags; +} + //static void LLPipeline::toggleRenderDebug(void* data) { @@ -5752,7 +5771,8 @@ void LLPipeline::renderDeferredLighting() U32 render_mask = mRenderTypeMask; mRenderTypeMask = mRenderTypeMask & ((1 << LLPipeline::RENDER_TYPE_SKY) | - (1 << LLPipeline::RENDER_TYPE_CLOUDS) | + (1 << LLPipeline::RENDER_TYPE_WL_CLOUDS) | + (1 << LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS) | (1 << LLPipeline::RENDER_TYPE_WL_SKY) | (1 << LLPipeline::RENDER_TYPE_ALPHA) | (1 << LLPipeline::RENDER_TYPE_AVATAR) | @@ -5909,7 +5929,8 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) updateCull(camera, result); stateSort(camera, result); mRenderTypeMask = tmp & ((1 << LLPipeline::RENDER_TYPE_SKY) | - (1 << LLPipeline::RENDER_TYPE_CLOUDS) | + (1 << LLPipeline::RENDER_TYPE_WL_CLOUDS) | + (1 << LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS) | (1 << LLPipeline::RENDER_TYPE_WL_SKY)); renderGeom(camera, TRUE); mRenderTypeMask = tmp; @@ -5921,7 +5942,8 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) (1< - +