automated merge

meow-7.2.2
Roxie Linden 2011-06-06 12:55:21 -07:00
commit 73bbcfb07b
12 changed files with 118 additions and 17 deletions

View File

@ -742,6 +742,7 @@ char const* const _PREHASH_MoneyData = LLMessageStringTable::getInstance()->getS
char const* const _PREHASH_ObjectDeselect = LLMessageStringTable::getInstance()->getString("ObjectDeselect");
char const* const _PREHASH_NewAssetID = LLMessageStringTable::getInstance()->getString("NewAssetID");
char const* const _PREHASH_ObjectAdd = LLMessageStringTable::getInstance()->getString("ObjectAdd");
char const* const _PREHASH_SimulatorFeatures = LLMessageStringTable::getInstance()->getString("SimulatorFeatures");
char const* const _PREHASH_RayEndIsIntersection = LLMessageStringTable::getInstance()->getString("RayEndIsIntersection");
char const* const _PREHASH_CompleteAuction = LLMessageStringTable::getInstance()->getString("CompleteAuction");
char const* const _PREHASH_CircuitCode = LLMessageStringTable::getInstance()->getString("CircuitCode");

View File

@ -742,6 +742,7 @@ extern char const* const _PREHASH_MoneyData;
extern char const* const _PREHASH_ObjectDeselect;
extern char const* const _PREHASH_NewAssetID;
extern char const* const _PREHASH_ObjectAdd;
extern char const* const _PREHASH_SimulatorFeatures;
extern char const* const _PREHASH_RayEndIsIntersection;
extern char const* const _PREHASH_CompleteAuction;
extern char const* const _PREHASH_CircuitCode;

View File

@ -82,6 +82,7 @@
#include "llvlcomposition.h"
#include "lltrans.h"
#include "llagentui.h"
#include "llmeshrepository.h"
const S32 TERRAIN_TEXTURE_COUNT = 4;
const S32 CORNER_COUNT = 4;
@ -590,9 +591,7 @@ bool LLPanelRegionGeneralInfo::refreshFromRegion(LLViewerRegion* region)
getChildView("im_btn")->setEnabled(allow_modify);
getChildView("manage_telehub_btn")->setEnabled(allow_modify);
const bool enable_mesh = gSavedSettings.getBOOL("MeshEnabled") &&
gAgent.getRegion() &&
!gAgent.getRegion()->getCapability("GetMesh").empty();
const bool enable_mesh = gMeshRepo.meshRezEnabled();
getChildView("mesh_rez_enabled_check")->setVisible(enable_mesh);
getChildView("mesh_rez_enabled_check")->setEnabled(getChildView("mesh_rez_enabled_check")->getEnabled() && enable_mesh);
// Data gets filled in by processRegionInfo

View File

@ -86,6 +86,7 @@
#include "llvovolume.h"
#include "lluictrlfactory.h"
#include "llaccountingquotamanager.h"
#include "llmeshrepository.h"
// Globals
LLFloaterTools *gFloaterTools = NULL;
@ -423,7 +424,7 @@ void LLFloaterTools::refresh()
// Refresh object and prim count labels
LLLocale locale(LLLocale::USER_LOCALE);
if ((gAgent.getRegion() && gAgent.getRegion()->getCapability("GetMesh").empty()) || !gSavedSettings.getBOOL("MeshEnabled"))
if (gMeshRepo.meshRezEnabled())
{
std::string obj_count_string;
LLResMgr::getInstance()->getIntegerString(obj_count_string, LLSelectMgr::getInstance()->getSelection()->getRootObjectCount());
@ -788,9 +789,7 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
getChildView("Strength:")->setVisible( land_visible);
}
bool show_mesh_cost = gAgent.getRegion() &&
!gAgent.getRegion()->getCapability("GetMesh").empty() &&
gSavedSettings.getBOOL("MeshEnabled");
bool show_mesh_cost = gMeshRepo.meshRezEnabled();
getChildView("obj_count")->setVisible( !land_visible && !show_mesh_cost);
getChildView("prim_count")->setVisible( !land_visible && !show_mesh_cost);

View File

@ -58,6 +58,7 @@
#include "llworld.h"
#include "v2math.h"
#include "llvoavatar.h"
#include "llmeshrepository.h"
const F32 MAX_MANIP_SELECT_DISTANCE_SQUARED = 11.f * 11.f;
@ -90,9 +91,7 @@ F32 get_default_max_prim_scale(bool is_flora)
{
// a bit of a hack, but if it's foilage, we don't want to use the
// new larger scale which would result in giant trees and grass
if (gSavedSettings.getBOOL("MeshEnabled") &&
gAgent.getRegion() &&
!gAgent.getRegion()->getCapability("GetMesh").empty() &&
if (gMeshRepo.meshRezEnabled() &&
!is_flora)
{
return DEFAULT_MAX_PRIM_SCALE;

View File

@ -61,6 +61,7 @@
#include "pipeline.h"
#include "llinventorymodel.h"
#include "llfoldertype.h"
#include "llviewerparcelmgr.h"
#include "boost/lexical_cast.hpp"
@ -3976,3 +3977,33 @@ void LLMeshRepository::buildPhysicsMesh(LLModel::Decomposition& decomp)
}
}
}
bool LLMeshRepository::meshUploadEnabled()
{
LLViewerRegion *region = gAgent.getRegion();
if(gSavedSettings.getBOOL("MeshEnabled") &&
LLViewerParcelMgr::getInstance()->allowAgentBuild() &&
region)
{
LLSD sim_features;
region->getSimulatorFeatures(sim_features);
return (sim_features.has("MeshUploadEnabled") &&
sim_features["MeshUploadEnabled"].asBoolean());
}
return false;
}
bool LLMeshRepository::meshRezEnabled()
{
LLViewerRegion *region = gAgent.getRegion();
if(gSavedSettings.getBOOL("MeshEnabled") &&
region)
{
LLSD sim_features;
region->getSimulatorFeatures(sim_features);
return (sim_features.has("MeshRezEnabled") &&
sim_features["MeshRezEnabled"].asBoolean());
}
return false;
}

View File

@ -482,6 +482,10 @@ public:
void buildHull(const LLVolumeParams& params, S32 detail);
void buildPhysicsMesh(LLModel::Decomposition& decomp);
bool meshUploadEnabled();
bool meshRezEnabled();
LLSD& getMeshHeader(const LLUUID& mesh_id);

View File

@ -530,16 +530,24 @@ void LLPanelVolume::refresh()
getChildView("Light Ambiance")->setVisible( visible);
getChildView("light texture control")->setVisible( visible);
bool enable_mesh = gSavedSettings.getBOOL("MeshEnabled") &&
gAgent.getRegion() &&
!gAgent.getRegion()->getCapability("GetMesh").empty();
bool enable_mesh = false;
LLSD sim_features;
LLViewerRegion *region = gAgent.getRegion();
if(region)
{
LLSD sim_features;
region->getSimulatorFeatures(sim_features);
enable_mesh = sim_features.has("PhysicsShapeTypes");
}
getChildView("label physicsshapetype")->setVisible(enable_mesh);
getChildView("Physics Shape Type Combo Ctrl")->setVisible(enable_mesh);
getChildView("Physics Gravity")->setVisible(enable_mesh);
getChildView("Physics Friction")->setVisible(enable_mesh);
getChildView("Physics Density")->setVisible(enable_mesh);
getChildView("Physics Restitution")->setVisible(enable_mesh);
/* TODO: add/remove individual physics shape types as per the PhysicsShapeTypes simulator features */
}

View File

@ -107,9 +107,7 @@ class LLMeshUploadVisible : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
return gSavedSettings.getBOOL("MeshEnabled") &&
LLViewerParcelMgr::getInstance()->allowAgentBuild() &&
!gAgent.getRegion()->getCapability("ObjectAdd").empty();
return gMeshRepo.meshUploadEnabled();
}
};

View File

@ -69,6 +69,7 @@
#include "llspatialpartition.h"
#include "stringize.h"
#include "llviewercontrol.h"
#include "llsdserialize.h"
#ifdef LL_WINDOWS
#pragma warning(disable:4355)
@ -1140,6 +1141,20 @@ void LLViewerRegion::getInfo(LLSD& info)
info["Region"]["Handle"]["y"] = (LLSD::Integer)y;
}
void LLViewerRegion::getSimulatorFeatures(LLSD& sim_features)
{
sim_features = mSimulatorFeatures;
}
void LLViewerRegion::setSimulatorFeatures(const LLSD& sim_features)
{
std::stringstream str;
LLSDSerialize::toPrettyXML(sim_features, str);
llinfos << str.str() << llendl;
mSimulatorFeatures = sim_features;
}
LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp)
{
U32 local_id = objectp->getLocalID();
@ -1558,6 +1573,42 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
LLHTTPClient::post(url, capabilityNames, mImpl->mHttpResponderPtr);
}
class SimulatorFeaturesReceived : public LLHTTPClient::Responder
{
LOG_CLASS(SimulatorFeaturesReceived);
public:
SimulatorFeaturesReceived(LLViewerRegion* region)
: mRegion(region)
{ }
void error(U32 statusNum, const std::string& reason)
{
LL_WARNS2("AppInit", "SimulatorFeatures") << statusNum << ": " << reason << LL_ENDL;
}
void result(const LLSD& content)
{
if(!mRegion) //region is removed or responder is not created.
{
return ;
}
mRegion->setSimulatorFeatures(content);
}
static boost::intrusive_ptr<SimulatorFeaturesReceived> build(
LLViewerRegion* region)
{
return boost::intrusive_ptr<SimulatorFeaturesReceived>(
new SimulatorFeaturesReceived(region));
}
private:
LLViewerRegion* mRegion;
};
void LLViewerRegion::setCapability(const std::string& name, const std::string& url)
{
if(name == "EventQueueGet")
@ -1570,6 +1621,11 @@ void LLViewerRegion::setCapability(const std::string& name, const std::string& u
{
LLHTTPSender::setSender(mImpl->mHost, new LLCapHTTPSender(url));
}
else if (name == "SimulatorFeatures")
{
// kick off a request for simulator features
LLHTTPClient::get(url, new SimulatorFeaturesReceived(this));
}
else
{
mImpl->mCapabilities[name] = url;
@ -1663,3 +1719,4 @@ std::string LLViewerRegion::getDescription() const
return stringize(*this);
}

View File

@ -276,6 +276,8 @@ public:
void getInfo(LLSD& info);
void getSimulatorFeatures(LLSD& info);
void setSimulatorFeatures(const LLSD& info);
typedef enum
{
@ -401,6 +403,8 @@ private:
bool mCapabilitiesReceived;
BOOL mReleaseNotesRequested;
LLSD mSimulatorFeatures;
};
inline BOOL LLViewerRegion::getAllowDamage() const

View File

@ -601,7 +601,7 @@ public:
ypos += y_inc;
if (gSavedSettings.getBOOL("MeshEnabled"))
if (gMeshRepo.meshRezEnabled())
{
addText(xpos, ypos, llformat("%.3f MB Mesh Data Received", LLMeshRepository::sBytesReceived/(1024.f*1024.f)));