From bbbee73eaeb7cbab1a832c865ac22fbf3eed2078 Mon Sep 17 00:00:00 2001 From: Beeks Date: Thu, 30 Sep 2010 14:03:18 -0400 Subject: [PATCH 01/18] Updated multiple attachment code from Henri. Signed-off-by: Beeks --- indra/newview/llinventorybridge.cpp | 17 +- indra/newview/llinventorybridge.h | 2 +- indra/newview/llvoavatar.cpp | 232 +++++++++++++++--- indra/newview/llvoavatar.h | 1 + .../default/xui/en-us/menu_inventory.xml | 4 + 5 files changed, 212 insertions(+), 44 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index c019c33fe..20657e64d 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -118,7 +118,7 @@ void dec_busy_count() // Function declarations struct LLWearableHoldingPattern; -void wear_inventory_category_on_avatar(LLInventoryCategory* category, BOOL append); +void wear_inventory_category_on_avatar(LLInventoryCategory* category, BOOL append, BOOL replace = FALSE); void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata); void wear_inventory_category_on_avatar_loop(LLWearable* wearable, void*); void wear_inventory_category_on_avatar_step3(LLWearableHoldingPattern* holder, BOOL append); @@ -183,6 +183,7 @@ struct LLWearInfo { LLUUID mCategoryID; BOOL mAppend; + BOOL mReplace; }; @@ -2106,6 +2107,10 @@ void LLFolderBridge::performAction(LLFolderView* folder, LLInventoryModel* model { modifyOutfit(TRUE); } + else if ("wearitems" == action) + { + modifyOutfit(TRUE, TRUE); + } else if ("removefromoutfit" == action) { // derf @@ -2495,6 +2500,7 @@ void LLFolderBridge::folderOptionsMenu() { // mItems.push_back(std::string("Add To Outfit")); + mItems.push_back(std::string("Wear Items")); mItems.push_back(std::string("Replace Outfit")); // } @@ -2857,7 +2863,7 @@ void LLFolderBridge::createWearable(LLUUID parent_id, EWearableType type) LLPointer(NULL)); } -void LLFolderBridge::modifyOutfit(BOOL append) +void LLFolderBridge::modifyOutfit(BOOL append, BOOL replace) { // derf if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) @@ -2871,7 +2877,7 @@ void LLFolderBridge::modifyOutfit(BOOL append) LLViewerInventoryCategory* cat = getCategory(); if(!cat) return; - wear_inventory_category_on_avatar( cat, append ); + wear_inventory_category_on_avatar(cat, append, replace); } // helper stuff @@ -4791,7 +4797,7 @@ void wear_inventory_category(LLInventoryCategory* category, bool copy, bool appe } // *NOTE: hack to get from avatar inventory to avatar -void wear_inventory_category_on_avatar( LLInventoryCategory* category, BOOL append ) +void wear_inventory_category_on_avatar(LLInventoryCategory* category, BOOL append, BOOL replace) { // Avoid unintentionally overwriting old wearables. We have to do // this up front to avoid having to deal with the case of multiple @@ -4802,6 +4808,7 @@ void wear_inventory_category_on_avatar( LLInventoryCategory* category, BOOL appe LLWearInfo* userdata = new LLWearInfo; userdata->mAppend = append; + userdata->mReplace = replace; userdata->mCategoryID = category->getUUID(); if( gFloaterCustomize ) @@ -4999,7 +5006,7 @@ void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata ) msg->nextBlockFast(_PREHASH_ObjectData ); msg->addUUIDFast(_PREHASH_ItemID, item->getLinkedUUID()); msg->addUUIDFast(_PREHASH_OwnerID, item->getPermissions().getOwner()); - msg->addU8Fast(_PREHASH_AttachmentPt, 0 | ATTACHMENT_ADD); // Wear at the previous or default attachment point + msg->addU8Fast(_PREHASH_AttachmentPt, wear_info->mReplace ? 0 : ATTACHMENT_ADD); // Wear at the previous or default attachment point pack_permissions_slam(msg, item->getFlags(), item->getPermissions()); msg->addStringFast(_PREHASH_Name, item->getName()); msg->addStringFast(_PREHASH_Description, item->getDescription()); diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 8f9226a8f..a99168583 100755 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -344,7 +344,7 @@ protected: BOOL checkFolderForContentsOfType(LLInventoryModel* model, LLInventoryCollectFunctor& typeToCheck); - void modifyOutfit(BOOL append); + void modifyOutfit(BOOL append, BOOL replace = FALSE); public: static LLFolderBridge* sSelf; static void staticFolderOptionsMenu(); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9ef0a2697..59b2755a7 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -39,6 +39,7 @@ #include "llaudioengine.h" #include "noise.h" +#include "llsdserialize.h" #include "llagent.h" // Get state values from here #include "llviewercontrol.h" @@ -53,6 +54,7 @@ #include "llhudeffecttrail.h" #include "llhudmanager.h" +#include "llinventorybridge.h" #include "llinventoryview.h" #include "llkeyframefallmotion.h" #include "llkeyframestandmotion.h" @@ -720,6 +722,10 @@ F32 LLVOAvatar::sGreyTime = 0.f; F32 LLVOAvatar::sGreyUpdateTime = 0.f; bool LLVOAvatar::sDoProperArc = true; +// Globals +LLFrameTimer gAttachmentsTimer; +bool gAttachmentsListDirty = true; + //----------------------------------------------------------------------------- // Helper functions //----------------------------------------------------------------------------- @@ -834,6 +840,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, { mIsSelf = TRUE; gAgent.setAvatarObject(this); + gAttachmentsTimer.reset(); lldebugs << "Marking avatar as self " << id << llendl; } else @@ -2720,6 +2727,10 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) // attach objects that were waiting for a drawable lazyAttach(); + if (mIsSelf) + { + checkAttachments(); + } // animate the character // store off last frame's root position to be consistent with camera position @@ -2756,6 +2767,133 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) return TRUE; } +void LLVOAvatar::checkAttachments() +{ + const F32 LAZY_ATTACH_DELAY = 15.0f; + static bool first_run = true; + + if (!mIsSelf) + { + return; + } + + if (mPendingAttachment.size() == 0) + { + if (first_run) + { + if (gAttachmentsTimer.getElapsedTimeF32() > LAZY_ATTACH_DELAY) + { + first_run = false; + LLVOAvatar* avatarp = gAgent.getAvatarObject(); + if (!avatarp) return; + std::set worn; + for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin(); + iter != avatarp->mAttachmentPoints.end(); ) + { + LLVOAvatar::attachment_map_t::iterator curiter = iter++; + LLViewerJointAttachment* attachment = curiter->second; + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) + { + LLViewerObject *attached_object = (*attachment_iter); + if (attached_object) + { + worn.insert(attached_object->getAttachmentItemID()); + } + } + } + std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "attachments.xml"); + //llinfos << "Reading the saved worn attachments list from: " << filename << llendl; + LLSD list; + llifstream llsd_xml; + llsd_xml.open(filename.c_str(), std::ios::in | std::ios::binary); + if (llsd_xml.is_open()) + { + LLSDSerialize::fromXML(list, llsd_xml); + for (LLSD::map_iterator iter = list.beginMap(); iter != list.endMap(); iter++) + { + LLSD array = iter->second; + if (array.isArray()) + { + for (int i = 0; i < array.size(); i++) + { + LLSD map = array[i]; + if (map.has("inv_item_id")) + { + LLUUID item_id = map.get("inv_item_id"); + if (worn.find(item_id) == worn.end()) + { + LLViewerInventoryItem* item = gInventory.getItem(item_id); + if (item) + { + rez_attachment(item, NULL, false); + } + else + { + llwarns << item_id.asString() << " not found in inventory, could not reattach." << llendl; + } + } + } + else + { + llwarns << "Malformed attachments list file (no \"inv_item_id\" key). Aborting." << llendl; + llsd_xml.close(); + return; + } + } + } + else + { + llwarns << "Malformed attachments list file (not an array). Aborting." << llendl; + llsd_xml.close(); + return; + } + } + llsd_xml.close(); + } + } + } + else if (gAttachmentsListDirty) + { + gAttachmentsListDirty = false; + LLSD list; + LLSD array = list.emptyArray(); + LLVOAvatar* avatarp = gAgent.getAvatarObject(); + if (!avatarp) return; + for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin(); + iter != avatarp->mAttachmentPoints.end(); ) + { + LLVOAvatar::attachment_map_t::iterator curiter = iter++; + LLViewerJointAttachment* attachment = curiter->second; + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) + { + LLViewerObject *attached_object = (*attachment_iter); + if (attached_object) + { + LLSD entry = list.emptyMap(); + entry.insert("inv_item_id", attached_object->getAttachmentItemID()); + array.append(entry); + } + } + } + list.insert("attachments", array); + std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "attachments.xml"); + llofstream list_file(filename); + LLSDSerialize::toPrettyXML(list, list_file); + list_file.close(); + //llinfos << "Worn attachments list saved to: " << filename << llendl; + } + } + else + { + gAttachmentsListDirty = true; + gAttachmentsTimer.reset(); + } +} + void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled) { // disable voice visualizer when in mouselook @@ -3511,9 +3649,6 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) new_name = TRUE; } - LLNameValue *title = getNVPair("Title"); - LLNameValue* firstname = getNVPair("FirstName"); - LLNameValue* lastname = getNVPair("LastName"); // std::string client; @@ -3599,40 +3734,39 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) mClientTag = "Friend"; } } - } - - if (!mIsSelf && gSavedSettings.getBOOL("AscentUseStatusColors")) - { - LLViewerRegion* parent_estate = LLWorld::getInstance()->getRegionFromPosGlobal(this->getPositionGlobal()); - LLUUID estate_owner = LLUUID::null; - if(parent_estate && parent_estate->isAlive()) + if (!mIsSelf && gSavedSettings.getBOOL("AscentUseStatusColors")) { - estate_owner = parent_estate->getOwner(); - } - - std::string name; - name += firstname->getString(); - name += " "; - name += lastname->getString(); - //Lindens are always more Linden than your friend, make that take precedence - if(LLMuteList::getInstance()->isLinden(name)) - { - mClientColor = LLSavedSettingsGlue::getCOAColor4("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(); - } - //without these dots, SL would suck. - else if (LLAvatarTracker::instance().getBuddyInfo(this->getID()) != NULL) - { - mClientColor = LLSavedSettingsGlue::getCOAColor4("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(); + LLViewerRegion* parent_estate = LLWorld::getInstance()->getRegionFromPosGlobal(this->getPositionGlobal()); + LLUUID estate_owner = LLUUID::null; + if(parent_estate && parent_estate->isAlive()) + { + estate_owner = parent_estate->getOwner(); + } + /*this->getClientInfo + std::string name; + name += firstname->getString(); + name += " "; + name += lastname->getString(); + //Lindens are always more Linden than your friend, make that take precedence + if(LLMuteList::getInstance()->isLinden(name)) + { + mClientColor = LLSavedSettingsGlue::getCOAColor4("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(); + } + //without these dots, SL would suck. + else if (LLAvatarTracker::instance().getBuddyInfo(this->getID()) != NULL) + { + mClientColor = LLSavedSettingsGlue::getCOAColor4("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(); + } } } @@ -3677,8 +3811,10 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) sNumVisibleChatBubbles--; } } - - + + LLNameValue *title = getNVPair("Title"); + LLNameValue* firstname = getNVPair("FirstName"); + LLNameValue* lastname = getNVPair("LastName"); if (mNameText.notNull() && firstname && lastname) { @@ -6965,12 +7101,22 @@ void LLVOAvatar::addChild(LLViewerObject *childp) { mPendingAttachment.push_back(childp); } + if (mIsSelf) + { + gAttachmentsListDirty = true; + gAttachmentsTimer.reset(); + } } void LLVOAvatar::removeChild(LLViewerObject *childp) { LLViewerObject::removeChild(childp); detachObject(childp); + if (mIsSelf) + { + gAttachmentsListDirty = true; + gAttachmentsTimer.reset(); + } } LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* viewer_object) @@ -7093,6 +7239,11 @@ void LLVOAvatar::lazyAttach() if (mPendingAttachment[i]->mDrawable) { attachObject(mPendingAttachment[i]); + if (mIsSelf) + { + gAttachmentsListDirty = true; + gAttachmentsTimer.reset(); + } } else { @@ -7101,6 +7252,11 @@ void LLVOAvatar::lazyAttach() } mPendingAttachment = still_pending; + if (mIsSelf && still_pending.size() > 0) + { + gAttachmentsListDirty = true; + gAttachmentsTimer.reset(); + } } void LLVOAvatar::resetHUDAttachments() diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 82e135593..08077c7cd 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -301,6 +301,7 @@ public: BOOL attachObject(LLViewerObject *viewer_object); BOOL detachObject(LLViewerObject *viewer_object); void lazyAttach(); + void checkAttachments(); void sitOnObject(LLViewerObject *sit_object); void getOffObject(); diff --git a/indra/newview/skins/default/xui/en-us/menu_inventory.xml b/indra/newview/skins/default/xui/en-us/menu_inventory.xml index 7a1047e05..dc3a0b738 100644 --- a/indra/newview/skins/default/xui/en-us/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en-us/menu_inventory.xml @@ -208,6 +208,10 @@ mouse_opaque="true" name="Add To Outfit" width="128"> + + + From 810fff09d6beef193f7d118ae6564b014923e02a Mon Sep 17 00:00:00 2001 From: Beeks Date: Fri, 1 Oct 2010 22:51:50 -0400 Subject: [PATCH 02/18] -Sanity checks from snowglobe. ... -Null terminated a string buffer. -Mutex locks are expensive. -Realloc is my friend. -But leaks are not. -Nor are unused variables. -And buffer overruns should get lost. -bindManual shouldnt return failure if texture's already bound. -Pulled windlight and classic clouds apart into unique rendertypes. -'Client or Account' savedsettings stuff is now moar bettar. (and efficient) -Replaced LLSavedSettingsGlue with something that supports gSavedSettings, gSavedPerAccountSettings, and gCOASavedSettings -Added 'Enable Classic Clouds' checkbox to ascet performance settings panel -New cards added to gpu table. -General cleaning... -How2spell 'dimensions'? Via Shyotl Signed-off-by: Beeks --- indra/llcharacter/llheadrotmotion.cpp | 13 ++- indra/llcommon/llformat.cpp | 1 + indra/llcommon/llqueuedthread.cpp | 4 +- indra/llcommon/llstring.cpp | 8 +- indra/llimage/llimage.cpp | 31 +++-- indra/llimage/llimagepng.cpp | 40 ++++--- indra/llimage/llimagepng.h | 1 - indra/llimagej2coj/llimagej2coj.cpp | 3 +- indra/llimagej2coj/llimagej2coj.h | 3 - indra/llrender/llimagegl.cpp | 58 +++++----- indra/llrender/llrender.cpp | 19 ++-- indra/llrender/llvertexbuffer.cpp | 6 +- .../lscript_execute/lscript_execute.cpp | 2 +- indra/newview/ascentprefssys.cpp | 24 ++-- indra/newview/ascentprefsvan.cpp | 107 +++++++++--------- indra/newview/gpu_table.txt | 4 + indra/newview/llagent.cpp | 3 +- indra/newview/lldrawpoolwlsky.cpp | 2 +- indra/newview/llfloaterauction.cpp | 5 +- indra/newview/llfloateravatarlist.cpp | 9 +- indra/newview/llfloaterwater.cpp | 1 - indra/newview/llfloaterwindlight.cpp | 3 +- indra/newview/llmaniptranslate.cpp | 6 +- indra/newview/llnetmap.cpp | 9 +- indra/newview/llsavedsettingsglue.cpp | 37 +++--- indra/newview/llsavedsettingsglue.h | 27 ++--- indra/newview/llstartup.cpp | 9 +- indra/newview/lltexturefetch.cpp | 2 +- indra/newview/llviewercontrol.cpp | 51 +++++++++ indra/newview/llviewercontrol.h | 10 ++ indra/newview/llviewermenu.cpp | 8 +- indra/newview/llvoavatar.cpp | 18 +-- indra/newview/llvoclouds.cpp | 8 +- indra/newview/pipeline.cpp | 31 ++++- indra/newview/pipeline.h | 5 +- .../en-us/panel_preferences_ascent_system.xml | 7 +- 36 files changed, 345 insertions(+), 230 deletions(-) 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..8a4ede86e 100644 --- a/indra/llcommon/llqueuedthread.cpp +++ b/indra/llcommon/llqueuedthread.cpp @@ -435,17 +435,15 @@ 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..6805dbb25 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,15 @@ 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 +1505,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..31c0a3479 100644 --- a/indra/llimage/llimagepng.cpp +++ b/indra/llimage/llimagepng.cpp @@ -42,17 +42,16 @@ // LLImagePNG // --------------------------------------------------------------------------- LLImagePNG::LLImagePNG() - : LLImageFormatted(IMG_CODEC_PNG), - mTmpWriteBuffer(NULL) + : LLImageFormatted(IMG_CODEC_PNG) { } LLImagePNG::~LLImagePNG() { - if (mTmpWriteBuffer) + /*if (mTmpWriteBuffer) { - delete[] mTmpWriteBuffer; - } + delete[] mTmpWriteBuffer; -Shyotl + }*/ } // Virtual @@ -121,14 +120,29 @@ 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 +160,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..26ca7dddb 100644 --- a/indra/llimage/llimagepng.h +++ b/indra/llimage/llimagepng.h @@ -49,7 +49,6 @@ public: /*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..2919b0e04 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1563,49 +1563,47 @@ void LLImageGL::setNoDelete() //---------------------------------------------------------------------------- void LLImageGL::updatePickMask(S32 width, S32 height, const U8* data_in) { - if (mFormatType != GL_UNSIGNED_BYTE || - mFormatPrimary != GL_RGBA) + delete [] mPickMask; //Always happens regardless. + + mPickMask = NULL; + + mPickMaskSize = 0; + if (!(mFormatType != GL_UNSIGNED_BYTE || + mFormatPrimary != GL_RGBA)) //can only generate a pick mask for this sort of texture { - //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; - U32 pick_width = width/2; - U32 pick_height = height/2; + mPickMaskSize = llmax(pick_width, (U32) 1) * llmax(pick_height, (U32) 1); - mPickMaskSize = llmax(pick_width, (U32) 1) * llmax(pick_height, (U32) 1); + mPickMaskSize = mPickMaskSize/8 + 1; - mPickMaskSize = mPickMaskSize/8 + 1; + mPickMask = new U8[mPickMaskSize]; - delete[] mPickMask; - mPickMask = new U8[mPickMaskSize]; + memset(mPickMask, 0, sizeof(U8) * mPickMaskSize); - memset(mPickMask, 0, sizeof(U8) * mPickMaskSize); + U32 pick_bit = 0; - U32 pick_bit = 0; - - for (S32 y = 0; y < height; y += 2) - { - for (S32 x = 0; x < width; x += 2) + 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) + U8 alpha = data_in[(y*width+x)*4+3]; + + if (alpha > 32) { - llerrs << "WTF?" << llendl; + 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; } - mPickMask[pick_idx] |= 1 << pick_offset; + ++pick_bit; } - - ++pick_bit; } } } diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index b1fe15357..6a670f2e5 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..3c3dd465a 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,6 @@ 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 +150,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 +186,8 @@ 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 +292,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 +332,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 +352,8 @@ 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 +461,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..75c4794ca 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); @@ -205,25 +204,21 @@ void LLPrefsAscentVanImpl::refreshValues() mShowSelfClientTagColor = gSavedSettings.getBOOL("AscentShowSelfTagColor"); mCustomTagOn = gSavedSettings.getBOOL("AscentUseCustomTag"); - mSelectedClient = LLSavedSettingsGlue::getCOAU32("AscentReportClientIndex"); - mEffectColor = LLSavedSettingsGlue::getCOAColor4("EffectColor"); - - BOOL use_custom = LLSavedSettingsGlue::getCOABOOL("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..4e0b8205d 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..8fc5b94b8 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; } 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..85a0ef98b 100644 --- a/indra/newview/llfloaterauction.cpp +++ b/indra/newview/llfloaterauction.cpp @@ -44,8 +44,7 @@ #include "llagent.h" #include "llcombobox.h" -#include "llnotify.h" -#include "llsavedsettingsglue.h" +#include "llnotify.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..f3798f4b0 100644 --- a/indra/newview/llsavedsettingsglue.cpp +++ b/indra/newview/llsavedsettingsglue.cpp @@ -39,6 +39,7 @@ #include "llviewercontrol.h" +/* void LLSavedSettingsGlue::setBOOL(LLUICtrl* ctrl, void* data) { const char* name = (const char*)data; @@ -73,12 +74,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 +95,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 +103,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 +111,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 +119,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 +127,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 +137,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 +145,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 +153,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 +161,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 +169,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 +177,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..06799ec63 100644 --- a/indra/newview/llsavedsettingsglue.h +++ b/indra/newview/llsavedsettingsglue.h @@ -41,7 +41,7 @@ class LLUICtrl; // and assign the control name as a const char* to the userdata. class LLSavedSettingsGlue { -public: +public:/* static void setBOOL(LLUICtrl* ctrl, void* name); static void setS32(LLUICtrl* ctrl, void* name); static void setF32(LLUICtrl* ctrl, void* name); @@ -49,20 +49,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..68f63a7a2 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2638,16 +2638,15 @@ bool idle_startup() /*if (gSavedSettings.getBOOL("BeaconAlwaysOn")) { - LLFloaterBeacons::showInstance(); DIE + LLFloaterBeacons::showInstance(); DIE -HgB }*/ - 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..036b4e692 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() @@ -625,6 +660,22 @@ void settings_setup_listeners() 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("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) 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 59b2755a7..5a8359ae7 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3470,7 +3470,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" ); @@ -3478,12 +3478,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) { @@ -3722,6 +3722,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.. } } @@ -3750,22 +3752,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..9672a8463 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< - + Date: Sat, 2 Oct 2010 12:05:14 -0400 Subject: [PATCH 03/18] Unfinished code related to Contact Groups --- indra/newview/ascentfloatercontactgroups.cpp | 9 +++- indra/newview/llfloaterfriends.cpp | 46 ++++++++++++++----- .../skins/default/xui/en-us/panel_friends.xml | 4 +- 3 files changed, 44 insertions(+), 15 deletions(-) diff --git a/indra/newview/ascentfloatercontactgroups.cpp b/indra/newview/ascentfloatercontactgroups.cpp index d78000a58..a5d5c67af 100644 --- a/indra/newview/ascentfloatercontactgroups.cpp +++ b/indra/newview/ascentfloatercontactgroups.cpp @@ -20,7 +20,7 @@ #include "llcombobox.h" //Combo dropdowns #include "llscrolllistctrl.h" //List box for filenames #include "lluictrlfactory.h" //Loads the XUI - +#include "llresmgr.h" // project includes #include "llviewercontrol.h" #include "llviewerwindow.h" @@ -84,8 +84,13 @@ void ASFloaterContactGroups::onBtnSave(void* userdata) LLScrollListCtrl* scroller = self->getChild("group_scroll_list"); if(scroller != NULL) { - for (S32 i = self->mSelectedUUIDs.count(); i > 0; --i) + for (S32 i = (self->mSelectedUUIDs.count() - 1); i >= 0; --i) { + std::string i_str; + LLResMgr::getInstance()->getIntegerString(i_str, i); + LLChat msg("Adding index " + i_str + ": " + self->mSelectedUUIDs.get(i).asString()); + LLFloaterChat::addChat(msg); + self->addContactMember(scroller->getValue().asString(), self->mSelectedUUIDs.get(i)); } } diff --git a/indra/newview/llfloaterfriends.cpp b/indra/newview/llfloaterfriends.cpp index c8599db3b..275e48d17 100644 --- a/indra/newview/llfloaterfriends.cpp +++ b/indra/newview/llfloaterfriends.cpp @@ -241,12 +241,11 @@ void LLPanelFriends::populateContactGroupSelect() void LLPanelFriends::setContactGroup(std::string contact_grp) { - if (contact_grp != "All") - { - filterContacts(); - categorizeContacts(); - } - else refreshNames(LLFriendObserver::ADD); + LLChat msg("Group set to " + contact_grp); + LLFloaterChat::addChat(msg); + refreshNames(LLFriendObserver::ADD); + refreshUI(); + categorizeContacts(); } void LLPanelFriends::categorizeContacts() @@ -264,17 +263,45 @@ void LLPanelFriends::categorizeContacts() std::vector vFriends = mFriendsList->getAllData(); // all of it. for (std::vector::iterator itr = vFriends.begin(); itr != vFriends.end(); ++itr) { - BOOL show_entry = (contact_groups[group_name][(*itr)->getUUID().asString()].size() != 0); + BOOL show_entry = false;//contact_groups[group_name].has((*itr)->getUUID().asString()); + + S32 count = contact_groups[group_name].size(); + int i; + for(i = 0; i < count; i++) + { + if (contact_groups[group_name][i].asString() == (*itr)->getUUID().asString()) + { + show_entry = true; + break; + } + } if (!show_entry) { + LLChat msg("False: contact_groups['" + group_name + "'].has('" + (*itr)->getUUID().asString() + "');"); + LLFloaterChat::addChat(msg); mFriendsList->deleteItems((*itr)->getValue()); } + else + { + LLChat msg("True: contact_groups['" + group_name + "'].has('" + (*itr)->getUUID().asString() + "');"); + LLFloaterChat::addChat(msg); + } } } + else + { + LLChat msg("Group set to all."); + LLFloaterChat::addChat(msg); + } refreshUI(); } + else + { + LLChat msg("Null combo."); + LLFloaterChat::addChat(msg); + } } void LLPanelFriends::filterContacts() @@ -325,10 +352,7 @@ void LLPanelFriends::onChangeContactGroup(LLUICtrl* ctrl, void* user_data) if(panelp) { LLComboBox* combo = panelp->getChild("buddy_group_combobox"); - if (combo->getValue().asString() != "All") - { - panelp->setContactGroup(combo->getValue().asString()); - } + panelp->setContactGroup(combo->getValue().asString()); } } // -- diff --git a/indra/newview/skins/default/xui/en-us/panel_friends.xml b/indra/newview/skins/default/xui/en-us/panel_friends.xml index cf357c583..aba8bf589 100644 --- a/indra/newview/skins/default/xui/en-us/panel_friends.xml +++ b/indra/newview/skins/default/xui/en-us/panel_friends.xml @@ -44,9 +44,9 @@ height="18" left="-235" name="buddy_search_lineedit" tool_tip="The friend name you want to search for" width="130" /> - + width="80" />