Merge remote-tracking branch 'siana/master' into AltCompilers

This commit is contained in:
Drake Arconis
2012-07-15 10:37:06 -04:00
12 changed files with 115 additions and 23 deletions

View File

@@ -718,20 +718,33 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
}
else if (major_version > 1 || minor_version >= 30)
{ //switches are supported in GLSL 1.30 and later
text[count++] = strdup("\tvec4 ret = vec4(1,0,1,1);\n");
text[count++] = strdup("\tswitch (vary_texture_index.r)\n");
text[count++] = strdup("\t{\n");
//switch body
for (S32 i = 0; i < texture_index_channels; ++i)
{
std::string case_str = llformat("\t\tcase %d: ret = texture2D(tex%d, texcoord); break;\n", i, i);
text[count++] = strdup(case_str.c_str());
if (gGLManager.mIsNVIDIA)
{ //switches are unreliable on some NVIDIA drivers
for (S32 i = 0; i < texture_index_channels; ++i)
{
std::string if_string = llformat("\t%sif (vary_texture_index.r == %d) { return texture2D(tex%d, texcoord); }\n", i > 0 ? "else " : "", i, i);
text[count++] = strdup(if_string.c_str());
}
text[count++] = strdup("\treturn vec4(1,0,1,1);\n");
text[count++] = strdup("}\n");
}
else
{
text[count++] = strdup("\tvec4 ret = vec4(1,0,1,1);\n");
text[count++] = strdup("\tswitch (vary_texture_index.r)\n");
text[count++] = strdup("\t{\n");
//switch body
for (S32 i = 0; i < texture_index_channels; ++i)
{
std::string case_str = llformat("\t\tcase %d: ret = texture2D(tex%d, texcoord); break;\n", i, i);
text[count++] = strdup(case_str.c_str());
}
text[count++] = strdup("\t}\n");
text[count++] = strdup("\treturn ret;\n");
text[count++] = strdup("}\n");
text[count++] = strdup("\t}\n");
text[count++] = strdup("\treturn ret;\n");
text[count++] = strdup("}\n");
}
}
else
{ //should never get here. Indexed texture rendering requires GLSL 1.30 or later

View File

@@ -802,6 +802,7 @@ void LLDrawable::updateTexture()
}
}*/
getVOVolume()->mFaceMappingChanged = TRUE;
gPipeline.markRebuild(this, LLDrawable::REBUILD_MATERIAL, TRUE);
}
}

View File

@@ -556,6 +556,7 @@ void LLFeatureManager::setGraphicsLevel(S32 level, bool skipFeatures)
LLViewerShaderMgr::sSkipReload = false;
LLViewerShaderMgr::instance()->setShaders();
gPipeline.refreshCachedSettings();
}
void LLFeatureManager::applyBaseMasks()

View File

@@ -688,6 +688,12 @@ BOOL LLMuteList::isMuted(const LLUUID& id, const std::string& name, U32 flags) c
// don't need name or type for lookup
LLMute mute(id_to_check);
// Can't mute self.
if (mute.mID == gAgent.getID() && !mute_object)
{
getInstance()->remove(mute);
return false;
}
mute_set_t::const_iterator mute_it = mMutes.find(mute);
if (mute_it != mMutes.end())
{

View File

@@ -858,12 +858,15 @@ void LLInventoryView::updateItemcountText()
{
std::ostringstream title;
title << "Inventory";
if (LLInventoryModelBackgroundFetch::instance().folderFetchActive())
if (LLInventoryModelBackgroundFetch::instance().folderFetchActive() || LLInventoryModelBackgroundFetch::instance().isEverythingFetched())
{
LLLocale locale(LLLocale::USER_LOCALE);
std::string item_count_string;
LLResMgr::getInstance()->getIntegerString(item_count_string, gInventory.getItemCount());
title << " (Fetched " << item_count_string << " items...)";
if(LLInventoryModelBackgroundFetch::instance().folderFetchActive())
title << " (Fetched " << item_count_string << " items...)";
else
title << " ("<< item_count_string << " items)";
}
title << mFilterText;
setTitle(title.str());

View File

@@ -1035,7 +1035,14 @@ BOOL LLToolDragAndDrop::handleDropTextureProtections(LLViewerObject* hit_obj,
}
}
// Add the texture item to the target object's inventory.
hit_obj->updateInventory(new_item, TASK_INVENTORY_ITEM_KEY, true);
if (LLAssetType::AT_TEXTURE == new_item->getType())
{
hit_obj->updateTextureInventory(new_item, TASK_INVENTORY_ITEM_KEY, true);
}
else
{
hit_obj->updateInventory(new_item, TASK_INVENTORY_ITEM_KEY, true);
}
// TODO: Check to see if adding the item was successful; if not, then
// we should return false here.
}
@@ -1050,7 +1057,14 @@ BOOL LLToolDragAndDrop::handleDropTextureProtections(LLViewerObject* hit_obj,
// *FIX: may want to make sure agent can paint hit_obj.
// Add the texture item to the target object's inventory.
hit_obj->updateInventory(new_item, TASK_INVENTORY_ITEM_KEY, true);
if (LLAssetType::AT_TEXTURE == new_item->getType())
{
hit_obj->updateTextureInventory(new_item, TASK_INVENTORY_ITEM_KEY, true);
}
else
{
hit_obj->updateInventory(new_item, TASK_INVENTORY_ITEM_KEY, true);
}
// Force the object to update its refetch its inventory so it has this texture.
hit_obj->fetchInventoryFromServer();
// TODO: Check to see if adding the item was successful; if not, then

View File

@@ -2874,6 +2874,23 @@ void LLViewerObject::processTaskInvFile(void** user_data, S32 error_code, LLExtS
(object = gObjectList.findObject(ft->mTaskID)))
{
object->loadTaskInvFile(ft->mFilename);
LLInventoryObject::object_list_t::iterator it = object->mInventory->begin();
LLInventoryObject::object_list_t::iterator end = object->mInventory->end();
std::list<LLUUID>& pending_lst = object->mPendingInventoryItemsIDs;
for (; it != end && pending_lst.size(); ++it)
{
LLViewerInventoryItem* item = dynamic_cast<LLViewerInventoryItem*>(it->get());
if(item && item->getType() != LLAssetType::AT_CATEGORY)
{
std::list<LLUUID>::iterator id_it = std::find(pending_lst.begin(), pending_lst.begin(), item->getAssetUUID());
if (id_it != pending_lst.end())
{
pending_lst.erase(id_it);
}
}
}
}
else
{
@@ -2984,6 +3001,33 @@ void LLViewerObject::removeInventory(const LLUUID& item_id)
//gBuildView->refresh();
}
bool LLViewerObject::isTextureInInventory(LLViewerInventoryItem* item)
{
bool result = false;
if (item && LLAssetType::AT_TEXTURE == item->getType())
{
std::list<LLUUID>::iterator begin = mPendingInventoryItemsIDs.begin();
std::list<LLUUID>::iterator end = mPendingInventoryItemsIDs.end();
bool is_fetching = std::find(begin, end, item->getAssetUUID()) != end;
bool is_fetched = getInventoryItemByAsset(item->getAssetUUID()) != NULL;
result = is_fetched || is_fetching;
}
return result;
}
void LLViewerObject::updateTextureInventory(LLViewerInventoryItem* item, U8 key, bool is_new)
{
if (item && !isTextureInInventory(item))
{
mPendingInventoryItemsIDs.push_back(item->getAssetUUID());
updateInventory(item, key, is_new);
}
}
void LLViewerObject::updateInventory(
LLViewerInventoryItem* item,
U8 key,
@@ -4867,9 +4911,11 @@ void LLViewerObject::deleteParticleSource()
// virtual
void LLViewerObject::updateDrawable(BOOL force_damped)
{
if (mDrawable.notNull() &&
!mDrawable->isState(LLDrawable::ON_MOVE_LIST) &&
isChanged(MOVED))
if (!isChanged(MOVED))
{ //most common case, having an empty if case here makes for better branch prediction
}
else if (mDrawable.notNull() &&
!mDrawable->isState(LLDrawable::ON_MOVE_LIST))
{
BOOL damped_motion =
!isChanged(SHIFTED) && // not shifted between regions this frame and...

View File

@@ -444,12 +444,15 @@ public:
// manager until we have better iterators.
void updateInventory(LLViewerInventoryItem* item, U8 key, bool is_new);
void updateInventoryLocal(LLInventoryItem* item, U8 key); // Update without messaging.
void updateTextureInventory(LLViewerInventoryItem* item, U8 key, bool is_new);
LLInventoryObject* getInventoryObject(const LLUUID& item_id);
void getInventoryContents(LLInventoryObject::object_list_t& objects);
LLInventoryObject* getInventoryRoot();
LLViewerInventoryItem* getInventoryItemByAsset(const LLUUID& asset_id);
S16 getInventorySerial() const { return mInventorySerialNum; }
bool isTextureInInventory(LLViewerInventoryItem* item);
// These functions does viewer-side only object inventory modifications
void updateViewerInventoryAsset(
const LLViewerInventoryItem* item,
@@ -698,6 +701,10 @@ protected:
F32 mAppAngle; // Apparent visual arc in degrees
F32 mPixelArea; // Apparent area in pixels
// IDs of of all items in the object's content which are added to the object's content,
// but not updated on the server yet. After item was updated, its ID will be removed from this list.
std::list<LLUUID> mPendingInventoryItemsIDs;
// This is the object's inventory from the viewer's perspective.
LLInventoryObject::object_list_t* mInventory;
class LLInventoryCallbackInfo

View File

@@ -8504,7 +8504,7 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerFetchedTexture
{
if (!aux_src->getData())
{
llerrs << "No auxiliary source data for onBakedTextureMasksLoaded" << llendl;
llwarns << "No auxiliary source data for onBakedTextureMasksLoaded" << llendl;
return;
}

View File

@@ -1435,7 +1435,7 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable)
return TRUE; // No update to complete
}
if (mVolumeChanged || mFaceMappingChanged || mDrawable->isState(LLDrawable::REBUILD_MATERIAL))
if (mVolumeChanged || mFaceMappingChanged)
{
dirtySpatialGroup(drawable->isState(LLDrawable::IN_REBUILD_Q1));

View File

@@ -14,8 +14,9 @@
<combo_box name="WLWaterPresetsCombo" bottom_delta="1" left_delta="20" height="18" width="133" tool_tip="WindLight Presets for your Water."/>
<button bottom_delta="0" height="18" label="&lt;" left="158" image_overlay="arrow_left.tga" name="WWprev" width="18"/>
<button bottom_delta="0" height="18" label="&gt;" left_delta="18" image_overlay="arrow_right.tga" name="WWnext" width="18"/>
<check_box left="5" label="Region Environment" control_name="UseEnvironmentFromRegion" height="16" name="use_estate_wl" tool_tip="Use the region/parcel's windlight settings when available."/>
<check_box left="5" label="Region WL" control_name="UseEnvironmentFromRegion" height="16" name="use_estate_wl" tool_tip="Use the region's windlight settings when available."/>
<!--check_box bottom_delta="0" left_delta="125" label="Always?" control_name="UseEnvironmentFromRegionAlways" height="16" name="Always" tool_tip="Always use region/parcel settings when they exist, automatically."/-->
<check_box bottom_delta="0" left_delta="110" label="Crossfade?" control_name="PhoenixInterpolateSky" height="16" name="Crossfade" tool_tip="If unchecked, Sky Windlight settings changes will apply immediately, without hesitation/animation."/>
<icon bottom_delta="-18" height="14" image_name="icon_day_cycle.tga" left="10" width="150"/>
<slider bottom_delta="-8" control_name="EnvTimeSlider" left="5" height="10" increment="0.00000001" label="" max_val="1" min_val="0" name="EnvTimeSlider" show_text="false" width="160"/>
<button bottom="1" height="22" label="" left="172" name="expand" scale_image="true" toggle="true" tool_tip="Hide the Settings Panel" width="22"/>

View File

@@ -25,8 +25,8 @@
* $/LicenseInfo$
* @endcond
*/
#include "llqtwebkit.h"
#include "linden_common.h"
#include "llqtwebkit.h"
#include "indra_constants.h" // for indra keyboard codes
#include "lltimer.h"