From 728056acdb5448b46e7d6666f4ba7156eff3b4bd Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Tue, 1 Jan 2013 20:15:21 -0500 Subject: [PATCH 1/9] Add support for Aurora's extended land layer codes to llvlmanager.cpp --- indra/newview/llvlmanager.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/indra/newview/llvlmanager.cpp b/indra/newview/llvlmanager.cpp index b586ab673..88afc9cc3 100644 --- a/indra/newview/llvlmanager.cpp +++ b/indra/newview/llvlmanager.cpp @@ -44,6 +44,11 @@ LLVLManager gVLManager; +// Extended land layer for Aurora Sim +const char AURORA_LAND_LAYER_CODE = 'M'; +const char AURORA_WIND_LAYER_CODE = '9'; +const char AURORA_CLOUD_LAYER_CODE = ':'; + LLVLManager::~LLVLManager() { S32 i; @@ -56,15 +61,15 @@ LLVLManager::~LLVLManager() void LLVLManager::addLayerData(LLVLData *vl_datap, const S32 mesg_size) { - if (LAND_LAYER_CODE == vl_datap->mType) + if (LAND_LAYER_CODE == vl_datap->mType || AURORA_LAND_LAYER_CODE == vl_datap->mType) { mLandBits += mesg_size * 8; } - else if (WIND_LAYER_CODE == vl_datap->mType) + else if (WIND_LAYER_CODE == vl_datap->mType || AURORA_WIND_LAYER_CODE == vl_datap->mType) { mWindBits += mesg_size * 8; } - else if (CLOUD_LAYER_CODE == vl_datap->mType) + else if (CLOUD_LAYER_CODE == vl_datap->mType || AURORA_CLOUD_LAYER_CODE == vl_datap->mType) { mCloudBits += mesg_size * 8; } @@ -93,12 +98,16 @@ void LLVLManager::unpackData(const S32 num_packets) { datap->mRegionp->getLand().decompressDCTPatch(bit_pack, &goph, FALSE); } - else if (WIND_LAYER_CODE == datap->mType) + else if (AURORA_LAND_LAYER_CODE == datap->mType) + { + datap->mRegionp->getLand().decompressDCTPatch(bit_pack, &goph, TRUE); + } + else if (WIND_LAYER_CODE == datap->mType || AURORA_WIND_LAYER_CODE == datap->mType) { datap->mRegionp->mWind.decompress(bit_pack, &goph); } - else if (CLOUD_LAYER_CODE == datap->mType) + else if (CLOUD_LAYER_CODE == datap->mType || AURORA_CLOUD_LAYER_CODE == datap->mType) { #if ENABLE_CLASSIC_CLOUDS datap->mRegionp->mCloudLayer.decompress(bit_pack, &goph); From 88de1b28a200cdf53b1e40b99863adf58e20aa48 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Thu, 3 Jan 2013 13:59:14 -0500 Subject: [PATCH 2/9] Add MoyMiniMapCustomColor swatch to Vanity Preferences. Fixed spacing of MoyMiniMapCustomColor in settings_ascent_coa.xml and removed it from settings_per_account.xml TODO: Make MoyMiniMapCustomColor more flexible. -Added ColorCustomChat checkbox, pref code, and setting commented out. --- .../newview/app_settings/settings_ascent_coa.xml | 16 +++++++++++++++- .../app_settings/settings_per_account.xml | 16 ---------------- indra/newview/ascentprefsvan.cpp | 6 ++++-- indra/newview/ascentprefsvan.h | 2 ++ .../en-us/panel_preferences_ascent_vanity.xml | 2 ++ 5 files changed, 23 insertions(+), 19 deletions(-) diff --git a/indra/newview/app_settings/settings_ascent_coa.xml b/indra/newview/app_settings/settings_ascent_coa.xml index f9cf9e010..2cb809679 100644 --- a/indra/newview/app_settings/settings_ascent_coa.xml +++ b/indra/newview/app_settings/settings_ascent_coa.xml @@ -31,7 +31,7 @@ 1 - MoyMiniMapCustomColor + MoyMiniMapCustomColor Comment Custom minimap color you wish to have. @@ -256,6 +256,20 @@ IsCOA 1 + AscentReportClientUUID Comment diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index b422fae32..d30cb4343 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -357,22 +357,6 @@ This is an autoresponse! - MoyMiniMapCustomColor - - Comment - Custom minimap color you wish to have. - Persist - 1 - Type - Color4 - Value - - 0.375 - 1.0 - 1.0 - 1.0 - - rkeastInventoryPreviousCount diff --git a/indra/newview/ascentprefsvan.cpp b/indra/newview/ascentprefsvan.cpp index e80be45d3..824566c78 100644 --- a/indra/newview/ascentprefsvan.cpp +++ b/indra/newview/ascentprefsvan.cpp @@ -211,11 +211,12 @@ void LLPrefsAscentVan::refreshValues() mEstateOwnerColor = gSavedSettings.getColor4("AscentEstateOwnerColor"); mLindenColor = gSavedSettings.getColor4("AscentLindenColor"); mMutedColor = gSavedSettings.getColor4("AscentMutedColor"); - //mCustomColor = gSavedSettings.getColor4("MoyMiniMapCustomColor"); + mCustomColor = gSavedSettings.getColor4("MoyMiniMapCustomColor"); mColorFriendChat = gSavedSettings.getBOOL("ColorFriendChat"); mColorEOChat = gSavedSettings.getBOOL("ColorEstateOwnerChat"); mColorLindenChat = gSavedSettings.getBOOL("ColorLindenChat"); mColorMutedChat = gSavedSettings.getBOOL("ColorMutedChat"); +// mColorCustomChat = gSavedSettings.getBOOL("ColorCustomChat"); //Body Dynamics -------------------------------------------------------------------------- mBreastPhysicsToggle = gSavedSettings.getBOOL("EmeraldBreastPhysicsToggle"); @@ -293,11 +294,12 @@ void LLPrefsAscentVan::cancel() gSavedSettings.setColor4("AscentEstateOwnerColor", mEstateOwnerColor); gSavedSettings.setColor4("AscentLindenColor", mLindenColor); gSavedSettings.setColor4("AscentMutedColor", mMutedColor); -// gSavedSettings.setColor4("MoyMiniMapCustomColor", mCustomColor); + gSavedSettings.setColor4("MoyMiniMapCustomColor", mCustomColor); gSavedSettings.setBOOL("ColorFriendChat", mColorFriendChat); gSavedSettings.setBOOL("ColorEstateOwnerChat", mColorEOChat); gSavedSettings.setBOOL("ColorLindenChat", mColorLindenChat); gSavedSettings.setBOOL("ColorMutedChat", mColorMutedChat); +// gSavedSettings.setBOOL("ColorCustomChat", mColorCustomChat); //Body Dynamics -------------------------------------------------------------------------- gSavedSettings.setBOOL("EmeraldBreastPhysicsToggle", mBreastPhysicsToggle); diff --git a/indra/newview/ascentprefsvan.h b/indra/newview/ascentprefsvan.h index 0c84ce432..62600a264 100644 --- a/indra/newview/ascentprefsvan.h +++ b/indra/newview/ascentprefsvan.h @@ -82,10 +82,12 @@ protected: LLColor4 mEstateOwnerColor; LLColor4 mLindenColor; LLColor4 mMutedColor; + LLColor4 mCustomColor; bool mColorFriendChat; bool mColorEOChat; bool mColorLindenChat; bool mColorMutedChat; +// bool mColorCustomChat; //Body Dynamics BOOL mBreastPhysicsToggle; F32 mBoobMass; diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml index bba6be356..0d730c4bb 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml @@ -42,11 +42,13 @@ + Use colors for chat: + From c3829485e4b7238636c3dd2541685387abdf3309 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Thu, 3 Jan 2013 14:08:39 -0500 Subject: [PATCH 3/9] Fixed LLCompileQueue messages via update to v-d in parts. Script resets now output properly~ --- indra/newview/llcompilequeue.cpp | 114 ++++++++++++++----------------- indra/newview/llcompilequeue.h | 18 ++--- indra/newview/llstartup.cpp | 2 +- 3 files changed, 59 insertions(+), 75 deletions(-) diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index 858c26909..26d3aa0a9 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -55,6 +55,7 @@ #include "llviewerobject.h" #include "llviewerregion.h" #include "llresmgr.h" + #include "llbutton.h" #include "lldir.h" #include "llnotificationsutil.h" @@ -207,8 +208,7 @@ BOOL LLFloaterScriptQueue::start() args["[COUNT]"] = llformat ("%d", mObjectIDs.count()); buffer = getString ("Starting", args); - LLScrollListCtrl* list = getChild("queue output"); - list->setCommentText(buffer); + getChild("queue output")->addSimpleElement(buffer, ADD_BOTTOM); return nextObject(); } @@ -240,12 +240,9 @@ BOOL LLFloaterScriptQueue::nextObject() } while((mObjectIDs.count() > 0) && !successful_start); if(isDone() && !mDone) { - - LLScrollListCtrl* list = getChild("queue output"); - - mDone = TRUE; - list->setCommentText(getString("Done")); - childSetEnabled("close",TRUE); + mDone = true; + getChild("queue output")->addSimpleElement(getString("Done"), ADD_BOTTOM); + getChildView("close")->setEnabled(TRUE); } return successful_start; } @@ -283,6 +280,40 @@ BOOL LLFloaterScriptQueue::popNext() /// Class LLFloaterCompileQueue ///---------------------------------------------------------------------------- +class LLCompileFloaterUploadQueueSupplier : public LLAssetUploadQueueSupplier +{ +public: + + LLCompileFloaterUploadQueueSupplier(const LLUUID& queue_id) : + mQueueId(queue_id) + { + } + + virtual LLAssetUploadQueue* get() const + { + LLFloaterCompileQueue* queue = (LLFloaterCompileQueue*) LLFloaterScriptQueue::findInstance(mQueueId); + if(NULL == queue) + { + return NULL; + } + return queue->getUploadQueue(); + } + + virtual void log(std::string message) const + { + LLFloaterCompileQueue* queue = (LLFloaterCompileQueue*) LLFloaterScriptQueue::findInstance(mQueueId); + if(NULL == queue) + { + return; + } + + queue->getChild("queue output")->addSimpleElement(message, ADD_BOTTOM); + } + +private: + LLUUID mQueueId; +}; + // static LLFloaterCompileQueue* LLFloaterCompileQueue::create(BOOL mono) { @@ -291,48 +322,8 @@ LLFloaterCompileQueue* LLFloaterCompileQueue::create(BOOL mono) LLRect rect = gSavedSettings.getRect("CompileOutputRect"); rect.translate(left - rect.mLeft, top - rect.mTop); LLFloaterCompileQueue* new_queue = new LLFloaterCompileQueue("queue", rect); - - class LLCompileFloaterUploadQueueSupplier : public LLAssetUploadQueueSupplier - { - public: - - LLCompileFloaterUploadQueueSupplier(const LLUUID& queue_id) : - mQueueId(queue_id) - { - } - - virtual LLAssetUploadQueue* get() const - { - LLFloaterCompileQueue* queue = - (LLFloaterCompileQueue*) LLFloaterScriptQueue::findInstance(mQueueId); - - if(NULL == queue) - { - return NULL; - } - - return queue->mUploadQueue; - } - virtual void log(std::string message) const - { - LLFloaterCompileQueue* queue = - (LLFloaterCompileQueue*) LLFloaterScriptQueue::findInstance(mQueueId); - - if(NULL == queue) - { - return; - } - - LLScrollListCtrl* list = queue->getChild("queue output"); - list->setCommentText(message.c_str()); - } - - private: - LLUUID mQueueId; - }; - - new_queue->mUploadQueue = new LLAssetUploadQueue(new LLCompileFloaterUploadQueueSupplier(new_queue->getID())); + new_queue->mUploadQueue = new LLAssetUploadQueue(new LLCompileFloaterUploadQueueSupplier(new_queue->getID())); new_queue->mMono = mono; new_queue->open(); return new_queue; @@ -414,8 +405,8 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id, llinfos << "LLFloaterCompileQueue::scriptArrived()" << llendl; LLScriptQueueData* data = (LLScriptQueueData*)user_data; if(!data) return; - LLFloaterCompileQueue* queue = static_cast - (LLFloaterScriptQueue::findInstance(data->mQueueID)); + LLFloaterCompileQueue* queue = static_cast (LLFloaterScriptQueue::findInstance(data->mQueueID)); + std::string buffer; if(queue && (0 == status)) { @@ -519,8 +510,7 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id, } if(queue && (buffer.size() > 0)) { - LLScrollListCtrl* list = queue->getChild("queue output"); - list->setCommentText(buffer); + queue->getChild("queue output")->addSimpleElement(buffer, ADD_BOTTOM); } delete data; } @@ -543,8 +533,7 @@ void LLFloaterCompileQueue::onSaveBytecodeComplete(const LLUUID& asset_id, void* { llinfos << "LLFloaterCompileQueue::onSaveBytecodeComplete()" << llendl; LLCompileQueueData* data = (LLCompileQueueData*)user_data; - LLFloaterCompileQueue* queue = static_cast - (LLFloaterScriptQueue::findInstance(data->mQueueID)); + LLFloaterCompileQueue* queue = static_cast (LLFloaterScriptQueue::findInstance(data->mQueueID)); if(queue && (0 == status) && data) { queue->saveItemByItemID(data->mItemId); @@ -692,7 +681,7 @@ void LLFloaterResetQueue::handleInventory(LLViewerObject* viewer_obj, // find all of the lsl, leaving off duplicates. We'll remove // all matching asset uuids on compilation success. LLDynamicArray names; - + LLInventoryObject::object_list_t::const_iterator it = inv->begin(); LLInventoryObject::object_list_t::const_iterator end = inv->end(); for ( ; it != end; ++it) @@ -704,10 +693,9 @@ void LLFloaterResetQueue::handleInventory(LLViewerObject* viewer_obj, if (object) { LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it)); - LLScrollListCtrl* list = getChild("queue output"); std::string buffer; buffer = getString("Resetting") + LLTrans::getString(":") + " " + item->getName(); - list->setCommentText(buffer); + getChild("queue output")->addSimpleElement(buffer, ADD_BOTTOM); LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_ScriptReset); msg->nextBlockFast(_PREHASH_AgentData); @@ -754,7 +742,7 @@ void LLFloaterRunQueue::handleInventory(LLViewerObject* viewer_obj, // find all of the lsl, leaving off duplicates. We'll remove // all matching asset uuids on compilation success. LLDynamicArray names; - + LLInventoryObject::object_list_t::const_iterator it = inv->begin(); LLInventoryObject::object_list_t::const_iterator end = inv->end(); for ( ; it != end; ++it) @@ -769,7 +757,7 @@ void LLFloaterRunQueue::handleInventory(LLViewerObject* viewer_obj, LLScrollListCtrl* list = getChild("queue output"); std::string buffer; buffer = getString("Running") + LLTrans::getString(":") + " " + item->getName(); - list->setCommentText(buffer); + list->addSimpleElement(buffer, ADD_BOTTOM); LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_SetScriptRunning); @@ -818,7 +806,7 @@ void LLFloaterNotRunQueue::handleInventory(LLViewerObject* viewer_obj, // find all of the lsl, leaving off duplicates. We'll remove // all matching asset uuids on compilation success. LLDynamicArray names; - + LLInventoryObject::object_list_t::const_iterator it = inv->begin(); LLInventoryObject::object_list_t::const_iterator end = inv->end(); for ( ; it != end; ++it) @@ -833,8 +821,8 @@ void LLFloaterNotRunQueue::handleInventory(LLViewerObject* viewer_obj, LLScrollListCtrl* list = getChild("queue output"); std::string buffer; buffer = getString("NotRunning") + LLTrans::getString(":") + " " + item->getName(); - list->setCommentText(buffer); - + list->addSimpleElement(buffer, ADD_BOTTOM); + LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_SetScriptRunning); msg->nextBlockFast(_PREHASH_AgentData); diff --git a/indra/newview/llcompilequeue.h b/indra/newview/llcompilequeue.h index e4bccff52..ee49ac574 100644 --- a/indra/newview/llcompilequeue.h +++ b/indra/newview/llcompilequeue.h @@ -79,7 +79,7 @@ protected: LLInventoryObject::object_list_t* inv, S32 serial_num, void* queue); - + // This is called by inventoryChanged virtual void handleInventory(LLViewerObject* viewer_obj, LLInventoryObject::object_list_t* inv) = 0; @@ -105,7 +105,7 @@ protected: // Object Queue LLDynamicArray mObjectIDs; LLUUID mCurrentObjectID; - BOOL mDone; + bool mDone; LLUUID mID; static LLMap sInstances; @@ -143,6 +143,8 @@ public: // remove any object in mScriptScripts with the matching uuid. void removeItemByItemID(const LLUUID& item_id); + LLAssetUploadQueue* getUploadQueue() { return mUploadQueue; } + protected: LLFloaterCompileQueue(const std::string& name, const LLRect& rect); virtual ~LLFloaterCompileQueue(); @@ -200,12 +202,10 @@ public: protected: LLFloaterResetQueue(const std::string& name, const LLRect& rect); virtual ~LLFloaterResetQueue(); - + // This is called by inventoryChanged virtual void handleInventory(LLViewerObject* viewer_obj, - LLInventoryObject::object_list_t* inv); - -protected: + LLInventoryObject::object_list_t* inv); }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -224,12 +224,10 @@ public: protected: LLFloaterRunQueue(const std::string& name, const LLRect& rect); virtual ~LLFloaterRunQueue(); - + // This is called by inventoryChanged virtual void handleInventory(LLViewerObject* viewer_obj, LLInventoryObject::object_list_t* inv); - -protected: }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -252,8 +250,6 @@ protected: // This is called by inventoryChanged virtual void handleInventory(LLViewerObject* viewer_obj, LLInventoryObject::object_list_t* inv); - -protected: }; #endif // LL_LLCOMPILEQUEUE_H diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 6d1e2d92c..1c5b2cacd 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1076,7 +1076,7 @@ bool idle_startup() gSavedSettings.getControl("_NACL_AntiSpamAmount")->getSignal()->connect(boost::bind(&NACLAntiSpamRegistry::handleNaclAntiSpamAmountChanged, _2)); // NaCl End - //good as place as any to create user windlight directories + //good a place as any to create user windlight directories std::string user_windlight_path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight", "")); LLFile::mkdir(user_windlight_path_name.c_str()); From 639b264d2d0fb498b68d38c2697f27540a969915 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Thu, 3 Jan 2013 21:06:20 +0100 Subject: [PATCH 4/9] Do not crash upon corrupted HTTP header. This addresses the reported assertion by luis thibodeaux. --- indra/llmessage/aicurl.cpp | 3 ++- indra/llmessage/aicurlthread.cpp | 30 +++++++++++++++++++++--------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/indra/llmessage/aicurl.cpp b/indra/llmessage/aicurl.cpp index 4cc9eadb3..cbb5fcc45 100644 --- a/indra/llmessage/aicurl.cpp +++ b/indra/llmessage/aicurl.cpp @@ -308,9 +308,10 @@ LLAtomicU32 Stats::llsd_body_count; LLAtomicU32 Stats::llsd_body_parse_error; LLAtomicU32 Stats::raw_body_count; +// Called from BufferedCurlEasyRequest::setStatusAndReason. +// The only allowed values for 'status' are S <= status < S+20, where S={100,200,300,400,500}. U32 Stats::status2index(U32 status) { - llassert_always(status >= 100 && status < 600 && (status % 100) < 20); // Max value 519. return (status - 100) / 100 * 20 + status % 100; // Returns 0..99 (for status 100..519). } diff --git a/indra/llmessage/aicurlthread.cpp b/indra/llmessage/aicurlthread.cpp index 194e23ddf..3dc3bd3e2 100644 --- a/indra/llmessage/aicurlthread.cpp +++ b/indra/llmessage/aicurlthread.cpp @@ -2268,7 +2268,11 @@ void BufferedCurlEasyRequest::setStatusAndReason(U32 status, std::string const& { mStatus = status; mReason = reason; - AICurlInterface::Stats::status_count[AICurlInterface::Stats::status2index(mStatus)]++; + if (status >= 100 && status < 600 && (status % 100) < 20) + { + // Only count statistic for sane values. + AICurlInterface::Stats::status_count[AICurlInterface::Stats::status2index(mStatus)]++; + } // Sanity check. If the server replies with a redirect status then we better have that option turned on! if ((status >= 300 && status < 400) && mResponder && !mResponder->redirect_status_ok()) @@ -2419,23 +2423,31 @@ size_t BufferedCurlEasyRequest::curlHeaderCallback(char* data, size_t size, size std::string::iterator pos2 = std::find(pos1, end, ' '); if (pos2 != end) ++pos2; std::string::iterator pos3 = std::find(pos2, end, '\r'); - U32 status; + U32 status = 0; std::string reason; if (pos3 != end && std::isdigit(*pos1)) { status = atoi(&header_line[pos1 - begin]); reason.assign(pos2, pos3); } - else + if (!(status >= 100 && status < 600 && (status % 100) < 20)) // Sanity check on the decoded status. { + if (status == 0) + { + reason = "Header parse error."; + llwarns << "Received broken header line from server: \"" << header << "\"" << llendl; + } + else + { + reason = "Unexpected HTTP status."; + llwarns << "Received unexpected status value from server (" << status << "): \"" << header << "\"" << llendl; + } + // Either way, this status value is not understood (or taken into account). + // Set it to internal error so that the rest of code treats it as an error. status = HTTP_INTERNAL_ERROR; - reason = "Header parse error."; - llwarns << "Received broken header line from server: \"" << header << "\"" << llendl; - } - { - self_w->received_HTTP_header(); - self_w->setStatusAndReason(status, reason); } + self_w->received_HTTP_header(); + self_w->setStatusAndReason(status, reason); return header_len; } From 2fbd53807cfb1f539ec74737229801e81f3f869f Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Thu, 3 Jan 2013 23:25:18 +0100 Subject: [PATCH 5/9] Do not use LLCachedControl as global variables. --- indra/llxml/llcontrol.cpp | 6 +++--- indra/newview/llviewerjointmesh.cpp | 4 ++-- indra/newview/llvoavatar.cpp | 15 ++++++--------- indra/newview/llvoavatar.h | 2 -- 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp index 86dd63f37..26a170dd0 100644 --- a/indra/llxml/llcontrol.cpp +++ b/indra/llxml/llcontrol.cpp @@ -1513,7 +1513,6 @@ DECL_LLCC(S32, (S32)-666); DECL_LLCC(F32, (F32)-666.666); DECL_LLCC(bool, true); DECL_LLCC(BOOL, FALSE); -static LLCachedControl mySetting_string("TestCachedControlstring", "Default String Value"); DECL_LLCC(LLVector3, LLVector3(1.0f, 2.0f, 3.0f)); DECL_LLCC(LLVector3d, LLVector3d(6.0f, 5.0f, 4.0f)); DECL_LLCC(LLRect, LLRect(0, 0, 100, 500)); @@ -1523,10 +1522,11 @@ DECL_LLCC(LLColor3, LLColor3(1.0f, 0.f, 0.5f)); LLSD test_llsd = LLSD()["testing1"] = LLSD()["testing2"]; DECL_LLCC(LLSD, test_llsd); -static LLCachedControl test_BrowserHomePage("BrowserHomePage", "hahahahahha", "Not the real comment"); - void test_cached_control() { + static const LLCachedControl mySetting_string("TestCachedControlstring", "Default String Value"); + static const LLCachedControl test_BrowserHomePage("BrowserHomePage", "hahahahahha", "Not the real comment"); + #define TEST_LLCC(T, V) if((T)mySetting_##T != V) llerrs << "Fail "#T << llendl; \ mySetting_##T = V;\ if((T)mySetting_##T != V) llerrs << "Fail "#T << "Pass # 2" << llendl; diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index 48661cd54..eb8b79a2a 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -568,8 +568,8 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) { // This warning will always trigger if you've hacked the avatar to show as incomplete. // Ignore the warning if that's the case. - static const LLCachedControl rener_unloaded_avatar("RenderUnloadedAvatar"); - if (!rener_unloaded_avatar) + static const LLCachedControl render_unloaded_avatar("RenderUnloadedAvatar", false); + if (!render_unloaded_avatar) { llwarns << "Layerset without composite" << llendl; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 210bccaa9..82b6679f6 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -993,12 +993,6 @@ EmeraldGlobalBoobConfig LLVOAvatar::sBoobConfig; static F32 calc_bouncy_animation(F32 x); static U32 calc_shame(LLVOVolume* volume, std::set &textures); -//----------------------------------------------------------------------------- -// Debug setting caches. -//----------------------------------------------------------------------------- -static LLCachedControl const freeze_time("FreezeTime", false); -static LLCachedControl const render_unloaded_avatar("RenderUnloadedAvatar", false); - //----------------------------------------------------------------------------- // LLVOAvatar() //----------------------------------------------------------------------------- @@ -1011,7 +1005,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mAttachmentGeometryBytes(0), mAttachmentSurfaceArea(0.f), mTurning(FALSE), - mFreezeTimeLangolier(freeze_time), mFreezeTimeDead(false), mPelvisToFoot(0.f), mLastSkeletonSerialNum( 0 ), @@ -1053,7 +1046,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mSupportsAlphaLayers(FALSE), mLoadedCallbacksPaused(FALSE), mHasPelvisOffset( FALSE ), - mRenderUnloadedAvatar(render_unloaded_avatar), mLastRezzedStatus(-1), mFirstSetActualBoobGravRan( false ), mSupportsPhysics( false ), @@ -1062,6 +1054,9 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mCCSChatTextOverride(false) // { + static LLCachedControl const freeze_time("FreezeTime", false); + mFreezeTimeLangolier = freeze_time; + LLMemType mt(LLMemType::MTYPE_AVATAR); //VTResume(); // VTune @@ -7662,9 +7657,11 @@ BOOL LLVOAvatar::processFullyLoadedChange(bool loading) BOOL LLVOAvatar::isFullyLoaded() const { + static LLCachedControl const render_unloaded_avatar("RenderUnloadedAvatar", false); + // [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.2.0a) | Added: Catznip-2.2.0a // Changes to LLAppearanceMgr::updateAppearanceFromCOF() expect this function to actually return mFullyLoaded for gAgentAvatarp - if ( (!isSelf()) && (mRenderUnloadedAvatar) ) + if ( (!isSelf()) && render_unloaded_avatar ) return TRUE; else return mFullyLoaded; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index c2ba5f8dd..2985a0da6 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -533,8 +533,6 @@ private: F32 mImpostorDistance; F32 mImpostorPixelArea; LLVector3 mLastAnimExtents[2]; - - LLCachedControl mRenderUnloadedAvatar; //-------------------------------------------------------------------- // Wind rippling in clothes From 7fc4348f6499ecdfd6926d5e065e24a0d8a53ea6 Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Sat, 5 Jan 2013 22:14:10 +0100 Subject: [PATCH 6/9] Fix build deselect --- indra/newview/lltoolselect.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/lltoolselect.cpp b/indra/newview/lltoolselect.cpp index 403113e50..39cd470f3 100644 --- a/indra/newview/lltoolselect.cpp +++ b/indra/newview/lltoolselect.cpp @@ -88,7 +88,7 @@ LLObjectSelectionHandle LLToolSelect::handleObjectSelection(const LLPickInfo& pi } // [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c - if (rlv_handler_t::isEnabled()) + if ( (object) && (rlv_handler_t::isEnabled()) ) { if (!gRlvHandler.canEdit(object)) { @@ -109,7 +109,7 @@ LLObjectSelectionHandle LLToolSelect::handleObjectSelection(const LLPickInfo& pi } } - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && (object) && ((!object->isAttachment()) || (!object->permYouOwner())) && + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && ((!object->isAttachment()) || (!object->permYouOwner())) && (dist_vec_squared(gAgent.getPositionAgent(), object->getPositionRegion()) > 1.5f * 1.5f) ) { // NOTE-RLVa: see behaviour notes for a rather lengthy explanation of why we're doing things this way From 20ae72e5faaa7215633b75b1d0ec3dab916e9c9c Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Sat, 5 Jan 2013 23:25:47 +0100 Subject: [PATCH 7/9] CMake needs proper quoting --- indra/cmake/FMODEX.cmake | 48 +++++++++++++++------------------------- 1 file changed, 18 insertions(+), 30 deletions(-) diff --git a/indra/cmake/FMODEX.cmake b/indra/cmake/FMODEX.cmake index 902af05fb..dbac0ebac 100644 --- a/indra/cmake/FMODEX.cmake +++ b/indra/cmake/FMODEX.cmake @@ -2,18 +2,6 @@ include(Linking) -if(INSTALL_PROPRIETARY) - include(Prebuilt) - use_prebuilt_binary(fmodex) -endif(INSTALL_PROPRIETARY) - -find_library(FMODEX_LIBRARY - NAMES fmodex fmodexL fmodex_vc fmodexL_vc - PATHS - optimized ${ARCH_PREBUILT_DIRS_RELEASE} - debug ${ARCH_PREBUILT_DIRS_DEBUG} - ) - if (NOT FMODEX_LIBRARY) set(FMODEX_SDK_DIR CACHE PATH "Path to the FMOD Ex SDK.") if (FMODEX_SDK_DIR) @@ -21,19 +9,19 @@ if (NOT FMODEX_LIBRARY) find_library(FMODEX_LIBRARY fmodex_vc fmodexL_vc fmodex fmodexL PATHS - ${FMODEX_SDK_DIR}/api/lib - ${FMODEX_SDK_DIR}/api - ${FMODEX_SDK_DIR}/lib - ${FMODEX_SDK_DIR} + "${FMODEX_SDK_DIR}/api/lib" + "${FMODEX_SDK_DIR}/api" + "${FMODEX_SDK_DIR}/lib" + "${FMODEX_SDK_DIR}" ) elseif(WORD_SIZE EQUAL 64) find_library(FMODEX_LIBRARY fmodex64 fmodexL64 PATHS - ${FMODEX_SDK_DIR}/api/lib - ${FMODEX_SDK_DIR}/api - ${FMODEX_SDK_DIR}/lib - ${FMODEX_SDK_DIR} + "${FMODEX_SDK_DIR}/api/lib" + "${FMODEX_SDK_DIR}/api" + "${FMODEX_SDK_DIR}/lib" + "${FMODEX_SDK_DIR}" ) endif(WORD_SIZE EQUAL 32) endif(FMODEX_SDK_DIR) @@ -42,24 +30,24 @@ if (NOT FMODEX_LIBRARY) find_library(FMODEX_LIBRARY fmodex_vc fmodexL_vc PATHS - ${FMODEX_PROG_DIR}/api/lib - ${FMODEX_PROG_DIR}/api - ${FMODEX_PROG_DIR} + "${FMODEX_PROG_DIR}/api/lib" + "${FMODEX_PROG_DIR}/api" + "${FMODEX_PROG_DIR}" ) if(FMODEX_LIBRARY) message(STATUS "Found fmodex in ${FMODEX_PROG_DIR}") - set(FMODEX_SDK_DIR ${FMODEX_PROG_DIR}) - set(FMODEX_SDK_DIR ${FMODEX_PROG_DIR} CACHE PATH "Path to the FMOD Ex SDK." FORCE) + set(FMODEX_SDK_DIR "${FMODEX_PROG_DIR}") + set(FMODEX_SDK_DIR "${FMODEX_PROG_DIR}" CACHE PATH "Path to the FMOD Ex SDK." FORCE) endif(FMODEX_LIBRARY) endif(WINDOWS AND NOT FMODEX_LIBRARY) endif (NOT FMODEX_LIBRARY) find_path(FMODEX_INCLUDE_DIR fmod.hpp - ${LIBS_PREBUILT_DIR}/include/fmodex - ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/fmodex - ${FMODEX_SDK_DIR}/api/inc - ${FMODEX_SDK_DIR}/inc - ${FMODEX_SDK_DIR} + "${LIBS_PREBUILT_DIR}/include/fmodex" + "${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/fmodex" + "${FMODEX_SDK_DIR}/api/inc" + "${FMODEX_SDK_DIR}/inc" + "${FMODEX_SDK_DIR}" ) if(DARWIN) From d5892bbb32de66e1c3b2d519495152309b0c8f93 Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Sun, 6 Jan 2013 02:38:12 +0100 Subject: [PATCH 8/9] My preliminary thoughts on OpenJPEG --- indra/libopenjpeg/j2k.c | 46 ++++++++++++++++++++++------------------- indra/libopenjpeg/t1.c | 19 ++++++++++++++--- indra/libopenjpeg/tcd.c | 17 +++++++++------ 3 files changed, 52 insertions(+), 30 deletions(-) diff --git a/indra/libopenjpeg/j2k.c b/indra/libopenjpeg/j2k.c index b81bd579c..47ec0be3a 100644 --- a/indra/libopenjpeg/j2k.c +++ b/indra/libopenjpeg/j2k.c @@ -703,15 +703,15 @@ static void j2k_read_cox(opj_j2k_t *j2k, int compno) { /* If user wants to remove more resolutions than the codestream contains, return error*/ if (cp->reduce >= tccp->numresolutions) { opj_event_msg(j2k->cinfo, EVT_ERROR, "Error decoding component %d.\nThe number of resolutions to remove is higher than the number " - "of resolutions of this component\nModify the cp_reduce parameter.\n\n", compno); + "of resolutions of this component\nModify the cp_reduce parameter.\n\n", compno); j2k->state |= J2K_STATE_ERR; } - if( tccp->numresolutions > J2K_MAXRLVLS ) { - opj_event_msg(j2k->cinfo, EVT_ERROR, "Error decoding component %d.\nThe number of resolutions is too big: %d vs max= %d. Truncating.\n\n", - compno, tccp->numresolutions, J2K_MAXRLVLS); + if( tccp->numresolutions > J2K_MAXRLVLS ) { + opj_event_msg(j2k->cinfo, EVT_ERROR, "Error decoding component %d.\nThe number of resolutions is too big: %d vs max= %d. Truncating.\n\n", + compno, tccp->numresolutions, J2K_MAXRLVLS); j2k->state |= J2K_STATE_ERR; - tccp->numresolutions = J2K_MAXRLVLS; - } + tccp->numresolutions = J2K_MAXRLVLS; + } tccp->cblkw = cio_read(cio, 1) + 2; /* SPcox (E) */ tccp->cblkh = cio_read(cio, 1) + 2; /* SPcox (F) */ @@ -1516,27 +1516,31 @@ static void j2k_read_sod(opj_j2k_t *j2k) { if (len == cio_numbytesleft(cio) + 1) { truncate = 1; /* Case of a truncate codestream */ - } + } - {/* chop padding bytes: */ - unsigned char *s, *e; + {/* chop padding bytes: */ + unsigned char *s, *e; - s = cio_getbp(cio); - e = s + len; + s = cio_getbp(cio); + e = s + len; - if(len > 8) s = e - 8; + if(len > 8) s = e - 8; - if(e[-2] == 0x00 && e[-1] == 0x00) /* padding bytes */ - { - while(e > s) - { - if(e[-2] == 0xff && e[-1] == 0xd9) break; - --len; --e; truncate = 1; - } - } - } + if(e[-2] == 0x00 && e[-1] == 0x00) /* padding bytes */ + { + while(e > s) + { + if(e[-2] == 0xff && e[-1] == 0xd9) break; + --len; --e; truncate = 1; + } + } + } data = j2k->tile_data[curtileno]; + if(!(j2k->tile_len[curtileno] + len)) { + opj_event_msg(j2k->cinfo, EVT_WARNING, "SG Corrupt data length\n"); + return; + } data = (unsigned char*) opj_realloc(data, (j2k->tile_len[curtileno] + len) * sizeof(unsigned char)); data_ptr = data + j2k->tile_len[curtileno]; diff --git a/indra/libopenjpeg/t1.c b/indra/libopenjpeg/t1.c index ed9cdc3fe..93b997b79 100644 --- a/indra/libopenjpeg/t1.c +++ b/indra/libopenjpeg/t1.c @@ -1091,14 +1091,27 @@ static double t1_getwmsedec( int numcomps, int mct) { - double w1, w2, wmsedec; + double w1 = 1, w2, wmsedec; + + // Prevent running an MCT on more than 3 components. NB openjpeg v2.0 will support this via + // custom MCT tables that can be passed as encode parameters, 1.3 cannot support this as it + // uses a static table of 3 entries and there for can only cope with 3 components with out an + // array overflow + + if(numcomps==3) { + if (qmfbid == 1) { + w1 = (numcomps > 1) ? mct_getnorm(compno) : 1.0; + } else { + w1 = (numcomps > 1) ? mct_getnorm_real(compno) : 1.0; + } + } + if (qmfbid == 1) { - w1 = (mct && numcomps==3) ? mct_getnorm(compno) : 1.0; w2 = dwt_getnorm(level, orient); } else { /* if (qmfbid == 0) */ - w1 = (mct && numcomps==3) ? mct_getnorm_real(compno) : 1.0; w2 = dwt_getnorm_real(level, orient); } + wmsedec = w1 * w2 * stepsize * (1 << bpno); wmsedec *= wmsedec * nmsedec / 8192.0; diff --git a/indra/libopenjpeg/tcd.c b/indra/libopenjpeg/tcd.c index ee0520556..c19b3eb6a 100644 --- a/indra/libopenjpeg/tcd.c +++ b/indra/libopenjpeg/tcd.c @@ -1418,15 +1418,20 @@ opj_bool tcd_decode_tile(opj_tcd_t *tcd, unsigned char *src, int len, int tileno int numres2decode; if (tcd->cp->reduce != 0) { - if ( tile->comps[compno].numresolutions < ( tcd->cp->reduce - 1 ) ) { + if ( tile->comps[compno].numresolutions < ( tcd->cp->reduce - 1 ) ) { opj_event_msg(tcd->cinfo, EVT_ERROR, "Error decoding tile. The number of resolutions to remove [%d+1] is higher than the number " - " of resolutions in the original codestream [%d]\nModify the cp_reduce parameter.\n", tcd->cp->reduce, tile->comps[compno].numresolutions); + " of resolutions in the original codestream [%d]\nModify the cp_reduce parameter.\n", tcd->cp->reduce, tile->comps[compno].numresolutions); return OPJ_FALSE; } - else { - tcd->image->comps[compno].resno_decoded = - tile->comps[compno].numresolutions - tcd->cp->reduce - 1; - } + else { + tcd->image->comps[compno].resno_decoded = + tile->comps[compno].numresolutions - tcd->cp->reduce - 1; + } + } + + if(!tilec->data) { + opj_event_msg(tcd->cinfo, EVT_ERROR, "Error decoding tile. null data\n"); + return OPJ_FALSE; } numres2decode = tcd->image->comps[compno].resno_decoded + 1; From cd27184332c99e599bb3120bc7d47b4dc7e81b78 Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Sun, 6 Jan 2013 04:01:28 +0100 Subject: [PATCH 9/9] Take out buggy padding removal in OJ --- indra/libopenjpeg/j2k.c | 46 ++++++----------------------------------- 1 file changed, 6 insertions(+), 40 deletions(-) diff --git a/indra/libopenjpeg/j2k.c b/indra/libopenjpeg/j2k.c index 47ec0be3a..21b462a34 100644 --- a/indra/libopenjpeg/j2k.c +++ b/indra/libopenjpeg/j2k.c @@ -1518,29 +1518,7 @@ static void j2k_read_sod(opj_j2k_t *j2k) { truncate = 1; /* Case of a truncate codestream */ } - {/* chop padding bytes: */ - unsigned char *s, *e; - - s = cio_getbp(cio); - e = s + len; - - if(len > 8) s = e - 8; - - if(e[-2] == 0x00 && e[-1] == 0x00) /* padding bytes */ - { - while(e > s) - { - if(e[-2] == 0xff && e[-1] == 0xd9) break; - --len; --e; truncate = 1; - } - } - } - data = j2k->tile_data[curtileno]; - if(!(j2k->tile_len[curtileno] + len)) { - opj_event_msg(j2k->cinfo, EVT_WARNING, "SG Corrupt data length\n"); - return; - } data = (unsigned char*) opj_realloc(data, (j2k->tile_len[curtileno] + len) * sizeof(unsigned char)); data_ptr = data + j2k->tile_len[curtileno]; @@ -1939,15 +1917,9 @@ opj_image_t* j2k_decode(opj_j2k_t *j2k, opj_cio_t *cio, opj_codestream_info_t *c #endif /* USE_JPWL */ if (id >> 8 != 0xff) { - if(cio_numbytesleft(cio) != 0) /* not end of file reached and no EOC */ - { - opj_event_msg(cinfo, EVT_ERROR, "%.8x: expected a marker instead of %x\n", cio_tell(cio) - 2, id); - opj_image_destroy(image); - return 0; - } - opj_event_msg(cinfo, EVT_WARNING, "%.8x: expected a marker instead of %x\n", cio_tell(cio) - 2, id); - j2k->state = J2K_STATE_NEOC; - break; + opj_image_destroy(image); + opj_event_msg(cinfo, EVT_ERROR, "%.8x: expected a marker instead of %x\n", cio_tell(cio) - 2, id); + return 0; } e = j2k_dec_mstab_lookup(id); /* Check if the marker is known*/ @@ -2041,15 +2013,9 @@ opj_image_t* j2k_decode_jpt_stream(opj_j2k_t *j2k, opj_cio_t *cio, opj_codestre id = cio_read(cio, 2); if (id >> 8 != 0xff) { - if(cio_numbytesleft(cio) != 0) /* no end of file reached and no EOC */ - { - opj_event_msg(cinfo, EVT_ERROR, "%.8x: expected a marker instead of %x\n", cio_tell(cio) - 2, id); - opj_image_destroy(image); - return 0; - } - opj_event_msg(cinfo, EVT_WARNING, "%.8x: expected a marker instead of %x\n", cio_tell(cio) - 2, id); - j2k->state = J2K_STATE_NEOC; - break; + opj_image_destroy(image); + opj_event_msg(cinfo, EVT_ERROR, "%.8x: expected a marker instead of %x\n", cio_tell(cio) - 2, id); + return 0; } e = j2k_dec_mstab_lookup(id); if (!(j2k->state & e->states)) {